/* Shared shell contract v2: keep page-specific selectors out of this file.
   See website/architecture/site-shell.md and the CI contract tests. */
html { scrollbar-gutter: stable; }
.skip-link { position: absolute; top: -100px; left: 24px; padding: 12px 20px; border-radius: 8px; background: var(--text); color: var(--bg); z-index: 2; }
.skip-link:focus { top: 12px; }
.app-header { display: flex; height: 60px; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 24px; padding: 0 32px; }
.brand { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; white-space: nowrap; }
.workspace-label { width: 11ch; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; }
.logo { position: relative; width: 89.36px; height: 32px; flex: 0 0 89.36px; }
.logo-artwork { position: absolute; top: 0; left: 0; transform: scale(.4); transform-origin: top left; }
.header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 16px; }
.webring { display: flex; flex-shrink: 0; align-items: center; width: 344px; height: 36px; background: var(--side); box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; }
.webring a { display: flex; align-items: center; justify-content: center; height: 100%; }
.ring-neighbor { flex: 1; min-width: 0; padding: 0 12px; gap: 6px; }
.ring-neighbor span:not(.icon) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring-index { flex: 0 0 88px; color: var(--muted); }
.webring a:hover { color: var(--accent); background: var(--raised); border-radius: 8px; }
.editor-tabs { display: flex; align-items: center; min-height: 45px; padding: 0 32px; background: var(--side); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.editor-tab { display: flex; align-items: center; height: 44px; color: var(--muted); white-space: nowrap; }
.editor-tab-link { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 20px; }
.editor-tab:has(.tab-close-form) .editor-tab-link { padding-right: 4px; }
.editor-tab.active { background: var(--bg); color: var(--text); }
.editor-tab:hover { color: var(--text); }
.tab-close-form { display: flex; margin: 0 12px 0 0; }
.tab-close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; }
.tab-close:hover { background: var(--raised); }
.app-header .icon-button { width: 44px; height: 44px; }
.site-footer { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 16px; width: min(900px, calc(100% - 64px)); margin: 0 auto 32px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; line-height: 20px; }
.footer-path, .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-links { display: flex; align-items: center; gap: 24px; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
html:has(#staging-badge) .site-footer { margin-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 720px) and (max-width: 999px) {
    .app-header, .editor-tabs { padding-left: 24px; padding-right: 24px; }
    .workspace-label { display: none; }
    .header-actions { gap: 12px; }
}

@media (max-width: 719px) {
    .brand, .header-github, .desktop-theme, .editor-tabs { display: none; }
    .app-header { height: 69px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
    .header-actions { width: 100%; }
    .webring { width: 100%; height: 44px; }
    .ring-neighbor { gap: 4px; padding: 0 6px; }
    .ring-previous { min-width: 94px; }
    .ring-next { min-width: 102px; }
    .ring-index { flex-basis: 76px; }
    .webring .icon { --icon-size: 12px; }
    .site-footer { width: calc(100% - 48px); margin-bottom: 24px; }
    html:has(#staging-badge) .site-footer { margin-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
    .footer-links { gap: 16px; }
}

@media (max-width: 359px) {
    .site-footer { gap: 8px; }
    .footer-links { gap: 12px; }
}
