/* Staff site, 2 of 13: base type, the shell (sidebar, phone app bar and tab bar, More page) and sign-in. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); }
a:hover { color: var(--primary-deep); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
/* FocusOnNavigate focuses the h1 (tabindex -1) so screen readers announce the page; it is never a Tab stop,
   so no ring. Not :focus-visible: script focus on a fresh page matches it in WebKit and Chromium. */
h1:focus { outline: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
/* A token or temporary password is one long word: it breaks rather than run off the card. */
code { background: var(--well); padding: .1rem .35rem; border-radius: 4px; font-size: .95em; overflow-wrap: anywhere; }
.muted { color: var(--muted); }

/* Shell */
/* The status bar is black-translucent (App.razor), so nothing behind it is drawn unless a page draws it.
   Navy on every layout, the sign-in pages included; the inset is 0 outside the installed app. */
body::before {
    content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top);
    background: var(--brand-navy); z-index: 20;
}
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar {
    background: var(--sidebar-bg); color: var(--sidebar-ink);
    display: flex; flex-direction: column; padding: 1rem .75rem; gap: 1rem;
}
.sidebar .brand { display: block; padding: .25rem .5rem; text-decoration: none; }
/* The sidebar and the phone app bar are navy in both themes, so the wordmark takes the dark-set tints there regardless. */
.sidebar .brand, .appbar .brand { --brand-blue: #6FA3C2; --brand-green: #86AE8F; }
.wordmark { display: block; height: auto; }
.wordmark-sidebar { width: 100%; max-width: 190px; }
.wordmark-auth { width: 200px; margin-bottom: .25rem; }
.foot-mark { height: 1.1em; width: auto; vertical-align: -.2em; margin-right: .3em; }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; }
.sidebar nav a {
    color: var(--sidebar-ink); text-decoration: none; padding: .5rem .6rem; border-radius: 6px;
}
.sidebar nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar nav a.active { background: var(--sidebar-active); color: #fff; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; padding: 0 .5rem; }
/* The identity block is the way into your own account, so it has to read as a target. */
.sidebar-foot .who {
    display: flex; flex-direction: column; font-size: .9rem;
    color: inherit; text-decoration: none;
    padding: .4rem .5rem; margin: 0 -.5rem .25rem; border-radius: var(--radius);
}
.sidebar-foot .who:hover, .sidebar-foot .who:focus-visible { background: var(--sidebar-hover); }
.sidebar-foot .who span { color: var(--sidebar-muted); }
.sidebar-foot .btn-ghost { color: var(--sidebar-ink); padding-left: 0; }
.content { padding: 1.5rem 2rem; max-width: 1100px; width: 100%; }

/* Phone shell (AppBar, TabBar): only at 800 px and below, where it stands in for the sidebar. */
.appbar, .tabbar { display: none; }

@media (max-width: 800px) {
    .sidebar { display: none; }
    .shell { display: block; }
    /* The bottom padding keeps the end of every page clear of the tab bar; the side gutters clear a landscape notch. */
    .content {
        padding: 1rem max(1rem, env(safe-area-inset-left)) calc(64px + env(safe-area-inset-bottom) + 1rem) max(1rem, env(safe-area-inset-right));
        min-width: 0; overflow-x: clip;
    }

    .appbar {
        position: sticky; top: 0; z-index: 10;
        display: flex; align-items: center; gap: .25rem;
        height: calc(56px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) max(.75rem, env(safe-area-inset-right)) 0 max(.75rem, env(safe-area-inset-left));
        background: var(--brand-navy); border-bottom: 1px solid rgba(255, 255, 255, .08);
    }
    .appbar .brand { display: flex; align-items: center; min-height: 44px; }
    .wordmark-appbar { width: 110px; }
    .appbar-back {
        width: 44px; height: 44px; margin-left: -.6rem; padding: 0; align-items: center; justify-content: center;
        background: transparent; border: 0; color: var(--sidebar-ink); cursor: pointer;
    }
    /* The bar has room for the glyph only; aria-label still names it. */
    .appbar-back span { display: none; }
    .appbar-account {
        margin-left: auto; width: 44px; height: 44px; border-radius: 50%;
        display: grid; place-items: center;
        background: var(--sidebar-active); color: #fff; font-weight: 700; text-decoration: none;
    }
    .appbar-account:hover { color: #fff; }

    .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
        display: flex; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: var(--surface); border-top: 1px solid var(--line);
    }
    .tab {
        flex: 1; position: relative;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
        color: var(--ink-3); font-size: 12px; font-weight: 600; text-decoration: none;
    }
    .tab:hover { color: var(--ink-3); }
    .tab.active { color: var(--brand-blue); }
    .tab.active::before {
        content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px;
        border-radius: 0 0 3px 3px; background: currentColor;
    }

    #blazor-error-ui { bottom: calc(64px + env(safe-area-inset-bottom)); }
    /* Signed in as someone else must never scroll out of mind: it rides under the app bar. */
    .founder-banner { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 5; }
}

/* More page: grouped rows, links with a chevron, actions without */
.more-list {
    list-style: none; margin: 0 0 1.5rem; padding: 0; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.more-list li + li { border-top: 1px solid var(--line-soft); }
.more-list form { margin: 0; }
.more-list a, .more-row {
    display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 56px; padding: .5rem 1rem;
    font: inherit; text-align: left; color: var(--ink); text-decoration: none; background: transparent; border: 0; cursor: pointer;
}
.more-list a:hover, .more-row:hover { color: var(--ink); background: var(--well); }
.more-list a::after {
    content: ""; flex: none; margin-left: auto; width: .5rem; height: .5rem;
    border: solid var(--ink-3); border-width: 2px 2px 0 0; transform: rotate(45deg);
}
/* The account row is two lines: name over company. */
.more-list .more-account { display: grid; grid-template-columns: 1fr auto; align-content: center; row-gap: 0; }
.more-account strong, .more-account span { grid-column: 1; }
.more-account span { color: var(--muted); }
.more-account::after { grid-column: 2; grid-row: 1 / span 2; }
.more-danger .more-row, .more-danger .more-row:hover { color: var(--danger); }

/* Auth */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.auth-card {
    width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.auth-card .brand { margin-bottom: .75rem; }
