/* ============================================================
   DORIA – Shell Layout
   Sidebar + topbar + main content shell.
   ============================================================ */

/* ── App Shell ─────────────────────────────────────────────── */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── Sidebar shell ──────────────────────────────────────────── */
.sidebar {
    grid-area: sidebar;
    background: var(--surface-flat);
    border-right: 1px solid rgba(var(--ink), 0.07);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: var(--z-sidebar);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    transition: width 0.22s ease;
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
}

/* ── Logo strip ─────────────────────────────────────────────── */
.sb-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: var(--topbar-h);
    border-bottom: 1px solid rgba(var(--ink), 0.07);
    flex-shrink: 0;
}

.sb-logo__mark {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(var(--ink), 0.55);
    letter-spacing: -0.04em;
    flex-shrink: 0;
    user-select: none;
}

.sb-logo__bracket {
    color: var(--brand-ink);
}

.sb-logo__wordmark {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.01em;
    color: rgba(var(--ink), 0.80);
    line-height: 1;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Only the lambda of DORIΛ // is lime (brand manual §2a); the rest of the
   wordmark keeps the ink colour above. */
.sb-logo__accent {
    color: var(--brand-ink);
}

.sb-logo__live {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sb-logo__live-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-ink);
    animation: sb-pulse 2.4s ease-in-out infinite;
}

@keyframes sb-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 4px var(--brand-ink);
    }

    50% {
        opacity: 0.2;
        box-shadow: none;
    }
}

/* ── Toggle button ──────────────────────────────────────────── */
.sb-toggle {
    margin-left: auto;
    background: none;
    border: 1px solid rgba(var(--ink), 0.09);
    color: rgba(var(--ink), 0.30);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.14s, color 0.14s;
    padding: 0;
}

@media (hover: hover) and (pointer: fine) {
    .sb-toggle:hover {
        border-color: rgba(var(--ink), 0.25);
        color: rgba(var(--ink), 0.70);
    }
}

.sb-toggle:active {
    border-color: rgba(var(--ink), 0.25);
    color: rgba(var(--ink), 0.70);
}

.sb-toggle__arrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1;
}

/* ── Thin ruler divider ─────────────────────────────────────── */
.sb-ruler {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    border-bottom: 1px solid rgba(var(--ink), 0.05);
    flex-shrink: 0;
    overflow: hidden;
}

.sb-ruler__tick {
    width: 5px;
    height: 5px;
    border: 1px solid rgba(var(--ink), 0.18);
    flex-shrink: 0;
}

.sb-ruler__label {
    font-size: 0.5rem;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: rgba(var(--ink), 0.18);
    white-space: nowrap;
    flex-shrink: 0;
}

.sb-ruler__track {
    flex: 1;
    height: 1px;
    background: rgba(var(--ink), 0.06);
    position: relative;
    overflow: hidden;
}

.sb-ruler__fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 40%;
    height: 100%;
    background: rgba(var(--brand-rgb), 0.25);
}

/* ── Nav scroll area ────────────────────────────────────────── */
.sb-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0 8px;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
}

.sb-nav::-webkit-scrollbar {
    display: none;
}

/* ── Section ────────────────────────────────────────────────── */
.sb-section {
    margin-bottom: 4px;
    border-top: 1px solid rgba(var(--ink), 0.05);
    padding-top: 4px;
}

.sb-section:first-child {
    border-top: none;
    padding-top: 0;
}

.sb-section__header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(var(--ink), 0.18);
    padding: 8px 16px 4px;
    pointer-events: none;
    user-select: none;
}

/* ── Nav link ───────────────────────────────────────────────── */
.sb-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 16px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    text-align: left;
    transition: background 0.12s;
    overflow: hidden;
}

.sb-link:focus-visible,
.sb-footer:focus-visible {
    outline: 1px solid rgba(var(--ink), 0.30);
    outline-offset: -1px;
}

@media (hover: hover) and (pointer: fine) {
    .sb-link:hover {
        background: rgba(var(--ink), 0.04);
    }
}

.sb-link:active {
    background: rgba(var(--ink), 0.07);
}

.sb-link--active {
    background: rgba(var(--brand-rgb), 0.06);
}

/* Left accent bar */
.sb-link--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--brand-ink);
}

/* Active pip — right edge */
.sb-link__pip {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--brand-ink);
    box-shadow: 0 0 5px rgba(var(--brand-rgb), 0.55);
}

/* Label */
.sb-link__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(var(--ink), 0.62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    transition: color 0.12s;
}

@media (hover: hover) and (pointer: fine) {
    .sb-link:hover .sb-link__label {
        color: rgba(var(--ink), 0.88);
    }
}

.sb-link:active .sb-link__label {
    color: rgba(var(--ink), 0.88);
}

.sb-link--active .sb-link__label {
    color: rgb(var(--ink));
}

/* ── User footer ────────────────────────────────────────────── */
/* A <button> when a user is signed in (see sidebar.js) — width:100% and
   text-align:left undo the browser's shrink-to-fit/centered button
   defaults so it still fills the sidebar edge-to-edge like the div did. */
.sb-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-top: 1px solid rgba(var(--ink), 0.07);
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
}

.sb-footer__avatar {
    width: 26px;
    height: 26px;
    background: rgba(var(--ink), 0.04);
    border: 1px solid rgba(var(--ink), 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5625rem;
    font-weight: 700;
    color: rgba(var(--ink), 0.50);
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.sb-footer__info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sb-footer__name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.59375rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(var(--ink), 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-footer__role {
    font-size: 0.5rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(var(--ink), 0.25);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-footer__status {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.sb-footer__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-ink);
    animation: sb-pulse 2.4s ease-in-out infinite;
}

/* ── Collapsed state ────────────────────────────────────────── */
.sb--collapsed .sb-logo__wordmark,
.sb--collapsed .sb-logo__live,
.sb--collapsed .sb-ruler__label,
.sb--collapsed .sb-ruler__track,
.sb--collapsed .sb-section__header,
.sb--collapsed .sb-link__label,
.sb--collapsed .sb-link__pip,
.sb--collapsed .sb-footer__info,
.sb--collapsed .sb-footer__status {
    display: none;
}

.sb--collapsed .sb-logo {
    padding: 0 8px;
    gap: 0;
    justify-content: space-between;
}

.sb--collapsed .sb-toggle {
    margin-left: 0;
}

.sb--collapsed .sb-ruler {
    padding: 5px 0;
    justify-content: center;
}

.sb--collapsed .sb-ruler__tick {
    margin: 0 auto;
}

.sb--collapsed .sb-link {
    padding: 9px 0;
    justify-content: center;
    gap: 0;
}

.sb--collapsed .sb-footer {
    padding: 12px 0;
    justify-content: center;
}

.sb--collapsed .sb-footer__avatar {
    margin: 0 auto;
}

/* ── Top Bar ────────────────────────────────────────────────── */
.topbar {
    grid-area: topbar;
    background: var(--surface-flat);
    border-bottom: 1px solid rgba(var(--ink), 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    height: var(--topbar-h);
    font-family: 'JetBrains Mono', monospace;
    /* Grid/flex items default to min-width:auto, not 0 — without this, the
       topbar's own content (breadcrumb + action buttons + bell + user chip,
       none of which wrap) sets a minimum content width that can exceed a
       phone's viewport, and since .topbar sits in the app-shell's `1fr`
       grid track, THAT TRACK grows to fit it — forcing the entire shell
       (every page, since they all share this one topbar) wider than the
       screen. Confirmed live: this single cause was behind identical
       right-edge cutoff on Dashboard, Ops Console, Deployments, and Site
       Analysis at once — four unrelated pages, one shared component.
       min-width:0 lets the track shrink to the viewport; overflow:hidden
       then contains whatever still doesn't fit to the topbar's own row
       instead of pushing the page wide. */
    min-width: 0;
    overflow: hidden;
}

/* Left — breadcrumb identity */
.tb-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    overflow: hidden;
}

.tb-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tb-identity__section {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.20em;
    color: rgba(var(--ink), 0.30);
    text-transform: uppercase;
    flex-shrink: 0;
}

.tb-identity__sep {
    font-size: 0.6875rem;
    color: rgba(var(--ink), 0.15);
    flex-shrink: 0;
}

.tb-identity__page {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(var(--ink), 0.82);
    text-transform: uppercase;
    /* The one topbar element allowed to lose content on a narrow screen —
       everything on the right (actions, notifications, the user's own
       identity chip) is more important to keep intact than a long page
       title, so this truncates first. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Right — actions + user */
.tb-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    /* .tb-left truncates before this ever has to give up space */
}

.tb-divider {
    width: 1px;
    height: 18px;
    background: rgba(var(--ink), 0.08);
    flex-shrink: 0;
}

/* CTA buttons */
.tb-btn {
    background: transparent;
    border: 1px solid rgba(var(--ink), 0.12);
    color: rgba(var(--ink), 0.55);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 6px 14px;
    cursor: pointer;
    transition: border-color 0.13s, color 0.13s, background 0.13s;
    white-space: nowrap;
}

.tb-btn--primary {
    border-color: var(--brand-ink);
    color: var(--brand-ink);
}

.tb-btn--ghost {
    border-color: rgba(var(--ink), 0.07);
    color: rgba(var(--ink), 0.30);
    font-size: 0.5625rem;
}

.tb-btn:active {
    background: rgba(var(--ink), 0.07);
}

@media (hover: hover) and (pointer: fine) {
    .tb-btn:hover {
        border-color: rgba(var(--ink), 0.28);
        color: rgba(var(--ink), 0.85);
    }

    .tb-btn--primary:hover {
        background: rgba(var(--brand-rgb), 0.07);
    }

    .tb-btn--ghost:hover {
        border-color: rgba(255, 32, 32, 0.40);
        color: rgba(var(--danger-rgb), 0.80);
    }
}

.tb-btn--primary:active {
    background: rgba(var(--brand-rgb), 0.07);
}

.tb-btn--ghost:active {
    border-color: rgba(255, 32, 32, 0.40);
    color: rgba(var(--danger-rgb), 0.80);
}

/* Icon button — theme toggle */
.tb-icon-btn {
    background: none;
    border: 1px solid rgba(var(--ink), 0.09);
    color: rgba(var(--ink), 0.38);
    font-size: 0.8125rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.13s, color 0.13s;
    flex-shrink: 0;
}

.tb-icon-btn:active {
    border-color: rgba(var(--ink), 0.30);
    color: rgba(var(--ink), 0.80);
}

@media (hover: hover) and (pointer: fine) {
    .tb-icon-btn:hover {
        border-color: rgba(var(--ink), 0.22);
        color: rgba(var(--ink), 0.70);
    }
}

/* User pill — now a button that opens the preferences panel */
.tb-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
}

.tb-user-btn:focus-visible {
    outline: 1px solid rgba(var(--ink), 0.30);
    outline-offset: 2px;
}

/* Chevron indicator */
.tb-user-btn::after {
    content: '▾';
    font-size: 0.5625rem;
    color: rgba(var(--ink), 0.22);
    margin-left: 2px;
    transition: color 0.13s;
}

.tb-user-btn[aria-expanded="true"]::after {
    color: rgba(var(--ink), 0.55);
}

@media (hover: hover) and (pointer: fine) {
    .tb-user-btn:hover::after {
        color: rgba(var(--ink), 0.55);
    }
}

.tb-user-btn:active::after {
    color: rgba(var(--ink), 0.55);
}

.tb-user__avatar {
    width: 26px;
    height: 26px;
    background: rgba(var(--ink), 0.05);
    border: 1px solid rgba(var(--ink), 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5625rem;
    font-weight: 700;
    color: rgba(var(--ink), 0.55);
    letter-spacing: 0.04em;
    flex-shrink: 0;
    transition: border-color 0.13s;
}

.tb-user-btn[aria-expanded="true"] .tb-user__avatar {
    border-color: rgba(var(--ink), 0.28);
    color: rgba(var(--ink), 0.80);
}

@media (hover: hover) and (pointer: fine) {
    .tb-user-btn:hover .tb-user__avatar {
        border-color: rgba(var(--ink), 0.28);
        color: rgba(var(--ink), 0.80);
    }
}

.tb-user-btn:active .tb-user__avatar {
    border-color: rgba(var(--ink), 0.28);
    color: rgba(var(--ink), 0.80);
}

.tb-user__name {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(var(--ink), 0.50);
    white-space: nowrap;
}

/* ── Preferences panel ──────────────────────────────────────
   Floats below the topbar, anchored to the right edge.
   The panel is rendered into the topbar element itself and
   uses position:fixed so it escapes any overflow:hidden parents.
   ─────────────────────────────────────────────────────────── */
.tb-prefs-panel {
    position: fixed;
    top: var(--topbar-h);
    right: 12px;
    z-index: var(--z-modal);
    width: 360px;
    background: rgba(3, 3, 3, 0.223);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--ink), 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
    font-family: 'JetBrains Mono', monospace;

    /* Entry animation */
    animation: tb-panel-in 140ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.light .tb-prefs-panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

@keyframes tb-panel-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panel header — operator identity */
.tb-prefs-panel__head {
    padding: 12px 16px 10px;
    border-bottom: 1px solid rgba(var(--ink), 0.07);
}

body.light .tb-prefs-panel__head {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.tb-prefs-panel__label {
    font-size: 0.5rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(var(--ink), 0.28);
    margin-bottom: 2px;
}

body.light .tb-prefs-panel__label {
    color: rgba(0, 0, 0, 0.35);
}

.tb-prefs-panel__name {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(var(--ink), 0.80);
}

body.light .tb-prefs-panel__name {
    color: rgba(0, 0, 0, 0.80);
}

/* Panel section */
.tb-prefs-section {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(var(--ink), 0.05);
}

body.light .tb-prefs-section {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.tb-prefs-section:last-of-type {
    border-bottom: none;
}

.tb-prefs-section__title {
    font-size: 0.5rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(var(--ink), 0.28);
    margin-bottom: 8px;
}

body.light .tb-prefs-section__title {
    color: rgba(0, 0, 0, 0.35);
}

/* Option button group */
.tb-prefs-group {
    display: flex;
    gap: 4px;
}

.tb-pref-btn {
    flex: 1;
    background: rgba(var(--ink), 0.04);
    border: 1px solid rgba(var(--ink), 0.08);
    color: rgba(var(--ink), 0.45);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    padding: 7px 6px;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
    white-space: nowrap;
    text-align: center;
    line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
    .tb-pref-btn:hover {
        background: rgba(var(--ink), 0.08);
        border-color: rgba(var(--ink), 0.18);
        color: rgba(var(--ink), 0.75);
    }
}

.tb-pref-btn:active {
    background: rgba(var(--ink), 0.08);
    border-color: rgba(var(--ink), 0.18);
    color: rgba(var(--ink), 0.75);
}

.tb-pref-btn[aria-pressed="true"] {
    background: rgba(var(--brand-rgb), 0.08);
    border-color: rgba(var(--brand-rgb), 0.50);
    color: var(--brand-ink);
}

body.light .tb-pref-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
    color: rgba(0, 0, 0, 0.45);
}

@media (hover: hover) and (pointer: fine) {
    body.light .tb-pref-btn:hover {
        background: rgba(0, 0, 0, 0.07);
        border-color: rgba(0, 0, 0, 0.20);
        color: rgba(0, 0, 0, 0.75);
    }
}

body.light .tb-pref-btn:active {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.20);
    color: rgba(0, 0, 0, 0.75);
}

body.light .tb-pref-btn[aria-pressed="true"] {
    background: rgba(106, 168, 0, 0.10);
    border-color: rgba(106, 168, 0, 0.55);
    color: #4e7e00;
}

/* Font-size buttons — show relative size difference */
.tb-pref-btn--font-normal {
    font-size: 0.5625rem;
}

.tb-pref-btn--font-large {
    font-size: 0.625rem;
}

.tb-pref-btn--font-xlarge {
    font-size: 0.6875rem;
}

/* Panel footer — logout */
.tb-prefs-panel__footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(var(--ink), 0.07);
}

body.light .tb-prefs-panel__footer {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.tb-prefs-panel__logout {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(var(--ink), 0.08);
    color: rgba(var(--ink), 0.28);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 7px 12px;
    cursor: pointer;
    transition: border-color 0.13s, color 0.13s, background 0.13s;
    text-align: left;
}

body.light .tb-prefs-panel__logout {
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.30);
}

@media (hover: hover) and (pointer: fine) {
    .tb-prefs-panel__logout:hover {
        border-color: rgba(var(--clr-danger-rgb), 0.40);
        color: rgba(var(--clr-danger-rgb), 0.80);
        background: rgba(var(--clr-danger-rgb), 0.04);
    }

    body.light .tb-prefs-panel__logout:hover {
        border-color: rgba(192, 57, 43, 0.40);
        color: rgba(192, 57, 43, 0.80);
        background: rgba(192, 57, 43, 0.04);
    }
}

.tb-prefs-panel__logout:active {
    border-color: rgba(var(--clr-danger-rgb), 0.40);
    color: rgba(var(--clr-danger-rgb), 0.80);
    background: rgba(var(--clr-danger-rgb), 0.04);
}

body.light .tb-prefs-panel__logout:active {
    border-color: rgba(192, 57, 43, 0.40);
    color: rgba(192, 57, 43, 0.80);
    background: rgba(192, 57, 43, 0.04);
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
    grid-area: main;
    padding: var(--content-pad);
    overflow-y: auto;
    /* Load-bearing, not decoration: overflow-y:auto alone makes the browser
       compute overflow-x as auto too (per spec, one non-visible axis forces
       the other out of 'visible'), so any page with an element even slightly
       wider than the viewport silently grows its own horizontal scrollbar
       here instead of the content properly collapsing. Confirmed on a real
       phone: several pages (Ops Console, Dashboard, Deployments, Site
       Analysis) were doing exactly this. This doesn't fix those pages' own
       layouts — it just stops a layout bug from also becoming a scroll-away
       usability bug while those get fixed page by page. */
    overflow-x: hidden;
    min-height: 0;
    background: var(--clr-bg);
    position: relative;
}

/* Very faint ambient radial — only perceptible on dark monitors */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at top right, rgba(var(--clr-brand-rgb), 0.025) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* All direct children sit above the glow */
.main-content>* {
    position: relative;
    z-index: 1;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
    margin-bottom: var(--sp-6);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 300;
    color: var(--clr-text);
    letter-spacing: 0.06em;
    line-height: 1;
    margin-bottom: var(--sp-2);
}

.page-header p {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--clr-text-muted);
    line-height: 1.5;
}

/* ── Collapsed grid ─────────────────────────────────────────── */
.app-shell.sidebar-collapsed {
    grid-template-columns: 48px 1fr;
}

.sb--collapsed {
    width: 48px;
}

/* ── Hamburger (mobile only) ────────────────────────────────── */
.tb-hamburger {
    display: none;
    /* hidden on desktop */
    background: none;
    border: 1px solid rgba(var(--ink), 0.10);
    color: rgba(var(--ink), 0.55);
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.14s, color 0.14s;
    font-size: 0.875rem;
    line-height: 1;
    margin-right: 8px;
}

body.light .tb-hamburger {
    border-color: rgba(0, 0, 0, 0.10);
    color: rgba(0, 0, 0, 0.55);
}

@media (hover: hover) and (pointer: fine) {
    .tb-hamburger:hover {
        border-color: rgba(var(--ink), 0.25);
        color: rgba(var(--ink), 0.90);
    }

    body.light .tb-hamburger:hover {
        border-color: rgba(0, 0, 0, 0.25);
        color: rgba(0, 0, 0, 0.85);
    }
}

.tb-hamburger:active {
    border-color: rgba(var(--ink), 0.25);
    color: rgba(var(--ink), 0.90);
}

body.light .tb-hamburger:active {
    border-color: rgba(0, 0, 0, 0.25);
    color: rgba(0, 0, 0, 0.85);
}

/* ── Scrim (mobile drawer backdrop) ────────────────────────── */
.sb-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    z-index: calc(var(--z-modal) - 1);
    /* backdrop-filter only applied when open — never when display:none
       because even an invisible fixed element with backdrop-filter
       blurs the entire page behind it */
}

/* ── Mobile: sidebar becomes a slide-in drawer ──────────────── */
@media (max-width: 900px) {

    .app-shell,
    .app-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
        grid-template-areas: "topbar" "main";
    }

    /* Sidebar always rendered, hidden off-screen.
       State is driven by body.sb-open — never by a class on the sidebar
       element itself, which is re-rendered on every navigation.
       translate3d (not translateX) forces the GPU to rasterize at full
       resolution. backface-visibility + font-smoothing prevent the text
       blur that appears when an element is promoted to a compositor layer. */
    .sidebar,
    .sidebar.sb--collapsed {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(280px, 85vw);
        height: 100%;
        z-index: var(--z-modal);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        box-shadow: none;
    }

    body.sb-open .sidebar {
        /* transform: none removes the compositor layer completely —
           text and content render natively without blur */
        transform: none;
        pointer-events: auto;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.6);
    }

    body.sb-open .sb-scrim {
        display: block;
        animation: fadeIn 0.2s ease both;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    /* Neutralise collapsed-state hiding inside the drawer */
    .sidebar .sb-logo__wordmark,
    .sidebar .sb-logo__live,
    .sidebar .sb-ruler__label,
    .sidebar .sb-ruler__track,
    .sidebar .sb-section__header,
    .sidebar .sb-link__label,
    .sidebar .sb-link__pip,
    .sidebar .sb-footer__info,
    .sidebar .sb-footer__status {
        display: revert;
    }

    .sidebar.sb--collapsed {
        width: min(280px, 85vw);
    }

    /* Collapse toggle has no function in the drawer pattern — close
       is handled by tap-outside or nav link click */
    .sb-toggle {
        display: none;
    }

    /* Topbar spans full width on mobile (sidebar is off-canvas), so it's
       the element that actually sits under the notch/Dynamic Island. */
    .topbar {
        padding-top: env(safe-area-inset-top, 0px);
        padding-left: max(24px, env(safe-area-inset-left, 0px));
        padding-right: max(24px, env(safe-area-inset-right, 0px));
    }

    .tb-hamburger {
        display: flex;
    }

    /* Mobile top bar is hamburger + bell + avatar only — the breadcrumb
       text, the page-specific CTA button (+ NEW REPORT / + SUBMIT / etc.,
       see topbar.js's _getActions), the dividers between icon groups, and
       the operator's name next to their avatar all drop out here. Desktop
       keeps all of it; this fires only below 900px, matching this file's
       own breakpoint for every other topbar touch-target rule below. */
    .tb-identity {
        display: none;
    }

    .tb-right .tb-btn,
    .tb-right .tb-divider {
        display: none;
    }

    .tb-user__name {
        display: none;
    }

    /* Touch targets >=44px — desktop's compact icon sizing (28px icon
       buttons, 26px avatars) is fine for a mouse pointer but too small for
       a ranger tapping with wet or gloved hands in the field. */
    .tb-btn {
        min-height: 44px;
    }

    .tb-hamburger,
    .tb-icon-btn {
        width: 44px;
        height: 44px;
    }

    /* .topbar qualifier bumps specificity above the unconditional
       .tb-notif-btn { width: 28px; height: 28px; } rule added later in
       this file (notification bell), which otherwise wins the cascade
       by source order despite this media query — same specificity,
       later always wins ties. Without this, mobile silently loses the
       44px touch target on the one icon button most people tap first. */
    .topbar .tb-notif-btn {
        width: 44px;
        height: 44px;
    }

    .tb-user__avatar,
    .sb-footer__avatar {
        width: 36px;
        height: 36px;
    }

    /* .tb-user-btn sizes to its content (the small avatar) with padding:0
       in its base rule, so add hit padding rather than enlarging the
       avatar itself to reach a 44px tap target — same "invisible hit
       padding" approach as Apple's ~10px hysteresis recommendation for
       tap targets. (.sb-footer already has 12px vertical padding, which
       combined with the 36px avatar bump above already clears 44px.) */
    .tb-user-btn {
        padding: 8px 4px;
    }

    /* .page-header is shared by 9 pages (Settings, Users, Roles, Export,
       Protected Areas, Species Intel, Forest Monitoring, Conservancies,
       Report Case File). Its clamp() floor (1.8rem/28.8px) sits above
       every page-specific hero size on mobile (Flashpoints/Species
       Intel/Deployments all land at 24-25.6px after the mobile token
       pass), so a page using this shared header read as a size
       inconsistent with everywhere else. Matching it to the same scale. */
    .page-header h1 {
        font-size: var(--text-3xl);
    }
}

/* ── Light Mode Overrides ───────────────────────────────────── */

/* Sidebar shell */
body.light .sidebar {
    background: #ffffff;
    border-right-color: rgba(0, 0, 0, 0.08);
}

body.light .sb-logo {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light .sb-logo__mark {
    color: rgba(0, 0, 0, 0.45);
}

body.light .sb-logo__wordmark {
    color: rgba(0, 0, 0, 0.75);
}

body.light .sb-toggle {
    border-color: rgba(0, 0, 0, 0.10);
    color: rgba(0, 0, 0, 0.30);
}

body.light .sb-ruler {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light .sb-ruler__tick {
    border-color: rgba(0, 0, 0, 0.18);
}

body.light .sb-ruler__label {
    color: rgba(0, 0, 0, 0.25);
}

body.light .sb-ruler__track {
    background: rgba(0, 0, 0, 0.06);
}

body.light .sb-section {
    border-top-color: rgba(0, 0, 0, 0.06);
}

body.light .sb-section__header {
    color: rgba(0, 0, 0, 0.28);
}

body.light .sb-link--active {
    background: rgba(78, 126, 0, 0.07);
}

body.light .sb-link__label {
    color: rgba(0, 0, 0, 0.60);
}

body.light .sb-link--active .sb-link__label {
    color: rgba(0, 0, 0, 0.90);
}

@media (hover: hover) and (pointer: fine) {
    body.light .sb-toggle:hover {
        border-color: rgba(0, 0, 0, 0.25);
        color: rgba(0, 0, 0, 0.65);
    }

    body.light .sb-link:hover {
        background: rgba(0, 0, 0, 0.04);
    }

    body.light .sb-link:hover .sb-link__label {
        color: rgba(0, 0, 0, 0.85);
    }
}

body.light .sb-toggle:active {
    border-color: rgba(0, 0, 0, 0.25);
    color: rgba(0, 0, 0, 0.65);
}

body.light .sb-link:active {
    background: rgba(0, 0, 0, 0.04);
}

body.light .sb-link:active .sb-link__label {
    color: rgba(0, 0, 0, 0.85);
}

body.light .sb-footer {
    border-top-color: rgba(0, 0, 0, 0.08);
}

body.light .sb-footer__avatar {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.50);
}

body.light .sb-footer__name {
    color: rgba(0, 0, 0, 0.70);
}

body.light .sb-footer__role {
    color: rgba(0, 0, 0, 0.35);
}

/* Topbar background + border */
body.light .topbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Topbar breadcrumb */
body.light .tb-identity__section {
    color: rgba(0, 0, 0, 0.30);
}

body.light .tb-identity__sep {
    color: rgba(0, 0, 0, 0.18);
}

body.light .tb-identity__page {
    color: rgba(0, 0, 0, 0.82);
}

/* Topbar divider */
body.light .tb-divider {
    background: rgba(0, 0, 0, 0.10);
}

/* Topbar CTA buttons */
body.light .tb-btn {
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.55);
}

body.light .tb-btn--primary {
    border-color: #4e7e00;
    color: #4e7e00;
}

body.light .tb-btn--ghost {
    border-color: rgba(0, 0, 0, 0.07);
    color: rgba(0, 0, 0, 0.28);
}

/* Topbar user button */
body.light .tb-user__name {
    color: rgba(0, 0, 0, 0.55);
}

body.light .tb-user-btn::after {
    color: rgba(0, 0, 0, 0.28);
}

body.light .tb-user-btn[aria-expanded="true"]::after {
    color: rgba(0, 0, 0, 0.55);
}

body.light .tb-user__avatar {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.55);
}

body.light .tb-user-btn[aria-expanded="true"] .tb-user__avatar {
    border-color: rgba(0, 0, 0, 0.28);
    color: rgba(0, 0, 0, 0.80);
}

@media (hover: hover) and (pointer: fine) {
    body.light .tb-btn:hover {
        border-color: rgba(0, 0, 0, 0.28);
        color: rgba(0, 0, 0, 0.85);
    }

    body.light .tb-btn--primary:hover {
        background: rgba(78, 126, 0, 0.07);
    }

    body.light .tb-btn--ghost:hover {
        border-color: rgba(192, 57, 43, 0.40);
        color: rgba(192, 57, 43, 0.80);
    }

    body.light .tb-user-btn:hover::after {
        color: rgba(0, 0, 0, 0.55);
    }

    body.light .tb-user-btn:hover .tb-user__avatar {
        border-color: rgba(0, 0, 0, 0.28);
        color: rgba(0, 0, 0, 0.80);
    }
}

body.light .tb-btn:active {
    border-color: rgba(0, 0, 0, 0.28);
    color: rgba(0, 0, 0, 0.85);
}

body.light .tb-btn--primary:active {
    background: rgba(78, 126, 0, 0.07);
}

body.light .tb-btn--ghost:active {
    border-color: rgba(192, 57, 43, 0.40);
    color: rgba(192, 57, 43, 0.80);
}

body.light .tb-user-btn:active::after {
    color: rgba(0, 0, 0, 0.55);
}

body.light .tb-user-btn:active .tb-user__avatar {
    border-color: rgba(0, 0, 0, 0.28);
    color: rgba(0, 0, 0, 0.80);
}

body.light .main-content::before {
    background: radial-gradient(ellipse at top right, rgba(106, 168, 0, 0.05) 0%, transparent 65%);
}

/* ── Notification bell ───────────────────────────────────── */
.tb-notif-btn {
    position: relative;
    background: none;
    border: 1px solid rgba(var(--ink), 0.09);
    color: rgba(var(--ink), 0.38);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.13s, color 0.13s;
}

.tb-notif-btn[aria-expanded="true"] {
    border-color: rgba(var(--ink), 0.22);
    color: rgba(var(--ink), 0.75);
}

@media (hover: hover) and (pointer: fine) {
    .tb-notif-btn:hover {
        border-color: rgba(var(--ink), 0.22);
        color: rgba(var(--ink), 0.75);
    }
}

.tb-notif-btn:active {
    border-color: rgba(var(--ink), 0.22);
    color: rgba(var(--ink), 0.75);
}

.tb-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    background: #ff3b3b;
    color: rgb(var(--ink));
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    pointer-events: none;
}

/* ── Notification panel ──────────────────────────────────── */
.tb-notif-panel {
    /* fixed, not absolute: .topbar has overflow:hidden (deliberate — see its
       own comment, fixes a real horizontal-overflow bug across 4 pages),
       which clips any absolutely-positioned descendant to the topbar's own
       56px height the instant it extends past it. This panel needs up to
       420px. position:fixed escapes that clipping (its containing block is
       the viewport, not .topbar) without touching the overflow rule that's
       load-bearing for something else. top is --topbar-h + the same 6px
       gap the old `calc(100% + 6px)` used when it was relative to the topbar. */
    position: fixed;
    top: calc(var(--topbar-h) + 6px);
    right: 48px;
    width: 500px;
    max-height: 420px;
    background: rgba(10, 13, 11, 0.632);
    border: 1px solid rgba(var(--ink), 0.1);
    backdrop-filter: blur(15px);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tb-notif-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid rgba(var(--ink), 0.07);
    flex-shrink: 0;
}

.tb-notif-panel__title {
    font-size: 0.5rem;
    letter-spacing: 0.18em;
    color: rgba(var(--ink), 0.35);
}

.tb-notif-mark-all {
    font-size: 0.5rem;
    letter-spacing: 0.08em;
    color: rgba(var(--ink), 0.3);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-transform: uppercase;
    transition: color 0.12s;
}

@media (hover: hover) and (pointer: fine) {
    .tb-notif-mark-all:hover {
        color: rgba(var(--ink), 0.7);
    }
}

.tb-notif-mark-all:active {
    color: rgba(var(--ink), 0.7);
}

.tb-notif-list {
    overflow-y: auto;
    flex: 1;
}

.tb-notif-empty {
    padding: 24px 14px;
    font-size: 0.5625rem;
    color: rgba(var(--ink), 0.2);
    text-align: center;
    letter-spacing: 0.08em;
}

.tb-notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(var(--ink), 0.05);
    cursor: pointer;
    transition: background 0.1s;
}

@media (hover: hover) and (pointer: fine) {
    .tb-notif-item:hover {
        background: rgba(var(--ink), 0.03);
    }
}

.tb-notif-item:active {
    background: rgba(var(--ink), 0.03);
}

.tb-notif-item--unread {
    border-left: 2px solid #ff3b3b;
}

.tb-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.tb-notif-type {
    font-size: 0.625rem;
    letter-spacing: 0.16em;
    color: #ff3b3b;
    text-transform: uppercase;
}

.tb-notif-time {
    font-size: 0.625rem;
    color: rgba(var(--ink), 0.22);
    letter-spacing: 0.04em;
}

.tb-notif-title {
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: rgba(var(--ink), 0.85);
    margin-bottom: 5px;
    line-height: 1.3;
}

.tb-notif-rows {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.tb-notif-tag {
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    padding: 1px 5px;
    border: 1px solid rgba(var(--danger-rgb), 0.5);
    color: rgba(255, 120, 120, 0.85);
    text-transform: uppercase;
}

.tb-notif-tag--dim {
    border-color: rgba(var(--ink), 0.1);
    color: rgba(var(--ink), 0.3);
}

.tb-notif-coords {
    font-size: 0.5rem;
    color: rgba(var(--ink), 0.3);
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
}

/* Open a casualty case from an SOS card (doc 46). */
.tb-notif-case-btn {
    margin-top: 8px;
    min-height: 32px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--danger-ink);
    color: var(--danger-ink);
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    cursor: pointer;
}
@media (pointer: coarse) { .tb-notif-case-btn { min-height: 44px; } }
.tb-notif-case-btn:focus-visible { outline: 2px solid var(--danger-ink); outline-offset: 1px; }

.tb-notif-location-btn {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(var(--ink), 0.18);
    color: rgba(var(--ink), 0.6);
    font-family: inherit;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 9px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

@media (hover: hover) and (pointer: fine) {
    .tb-notif-location-btn:hover {
        border-color: rgba(var(--ink), 0.4);
        color: rgba(var(--ink), 0.9);
    }
}

.tb-notif-location-btn:active {
    border-color: rgba(var(--ink), 0.4);
    color: rgba(var(--ink), 0.9);
}

body.light .tb-notif-location-btn {
    border-color: rgba(0, 0, 0, 0.18);
    color: rgba(0, 0, 0, 0.55);
}

body.light .tb-notif-btn {
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.4);
}

body.light .tb-notif-panel {
    background: rgba(248, 249, 246, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light .tb-notif-panel__title,
body.light .tb-notif-mark-all {
    color: rgba(0, 0, 0, 0.35);
}

body.light .tb-notif-item {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light .tb-notif-title {
    color: rgba(0, 0, 0, 0.8);
}

body.light .tb-notif-time,
body.light .tb-notif-coords {
    color: rgba(0, 0, 0, 0.3);
}

/* ── Theme crossfade ─────────────────────────────────────────
   UserPrefs.set('theme') wraps the switch in a View Transition: the
   browser snapshots the old page and fades it into the new one, so
   literal body.light overrides, canvases and map tiles all change
   together instead of snapping. Theme is the only view transition in
   the app, so the root selectors are not scoped further.
   Pure opacity, no movement, so it stays on under reduced motion,
   just shorter. */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 600ms;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 250ms;
    }
}
/* ── Superadmin active-sector chip (sectorContext.js, doc 38) ── */
.tb-sector-slot { position: relative; display: flex; align-items: center; min-width: 0; }
.tb-sector-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    max-width: 280px;
    height: 28px;
    padding: 0 var(--sp-2);
    background: none;
    border: 1px solid var(--clr-brand);
    color: var(--clr-text);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    letter-spacing: 0.1em;
    cursor: pointer;
}
.tb-sector-btn--none { border-color: var(--clr-warning); color: var(--clr-warning); }
.tb-sector-btn__k { color: var(--clr-text-dim); }
.tb-sector-btn__v {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* fixed, not absolute, for the same reason as .tb-notif-panel: .topbar has
   overflow:hidden, which clipped this menu to the topbar's 56px height so
   it never showed. top/right are set from the button in sectorContext.js. */
.tb-sector-menu {
    position: fixed;
    z-index: var(--z-modal);
    min-width: 240px;
    max-width: min(90vw, 360px);
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
}
.tb-sector-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    min-width: 0;
    padding: var(--sp-2) var(--sp-3);
    background: none;
    border: 0;
    border-bottom: 1px solid var(--clr-border);
    color: var(--clr-text);
    font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
}
.tb-sector-menu__item:hover { background: var(--clr-surface-2); }
.tb-sector-menu__item--active { color: var(--clr-brand); }
.tb-sector-menu__item--cmd {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    letter-spacing: 0.14em;
    color: var(--clr-brand);
}
.tb-sector-menu__name { min-width: 0; overflow-wrap: anywhere; }
.tb-sector-menu__flag {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--clr-text-dim);
}
.tb-sector-menu__empty { padding: var(--sp-3); font-size: var(--text-sm); color: var(--clr-text-muted); }
@media (max-width: 640px) {
    .tb-sector-btn { height: 44px; max-width: 150px; }
    .tb-sector-btn__k { display: none; }
    .tb-sector-menu__item { min-height: 44px; }
}
