/*
 * First American Settlements identity chrome.
 * Master tokens: First-American/first-american-brand. Do not resample. Do not invent hex.
 *
 * Navy chrome, white type, 3px burgundy hairline. Paper / card / line in the
 * body come from the same tokens. Card titles and primary actions are burgundy.
 * Official eagle: static/images/fas-official-logo.jpeg
 * (alt "First American Settlements"), 30px, left of the wordmark.
 */
:root {
    --fas-navy: #16263f;
    --fas-navy-2: #1e334f;
    --fas-burgundy: #8a1f1f;
    --fas-red-soft: #f8eeee;
    --fas-paper: #f6f3ee;
    --fas-card: #fffcf7;
    --fas-line: #d5d0c6;
    --fas-ink: #1a1a1a;
    --fas-muted: #5c6570;

    --app-bg: var(--fas-paper);
    --app-surface: var(--fas-card);
    --app-surface-muted: #eef2f7;
    --app-border: var(--fas-line);
    --app-text: var(--fas-ink);
    --app-muted: var(--fas-muted);
    --app-primary: var(--fas-burgundy);
    --app-primary-hover: var(--fas-navy);
    --app-primary-soft: var(--fas-red-soft);
    --app-danger: var(--fas-burgundy);
    --app-danger-soft: var(--fas-red-soft);
    --app-focus: rgba(22, 38, 63, 0.24);
    --app-nav-bg: var(--fas-navy);
    --app-font-display: "IBM Plex Sans", Calibri, sans-serif;
    --app-font-sans: "IBM Plex Sans", Calibri, "Liberation Sans", ui-sans-serif, system-ui, sans-serif;
}

.app-navbar {
    background: var(--fas-navy) !important;
    border-bottom: 3px solid var(--fas-burgundy) !important;
}

.app-brand {
    align-items: center;
    display: inline-flex;
    gap: 0.55rem;
    text-decoration: none;
}

.app-brand-eagle {
    display: block;
    flex: none;
    width: 30px;
    height: 30px;
    max-width: 32px;
    max-height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.app-brand-eagle[hidden] {
    display: none;
}

.app-brand-name {
    color: #ffffff;
    font-family: var(--app-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
}

html.dark .app-brand-name {
    color: #ffffff;
}

.app-brand-mark {
    display: none;
}

.app-nav-link {
    color: #ffffff !important;
}

.app-nav-link:hover,
.app-nav-link:focus-visible,
.app-nav-link:active,
.app-nav-link--current {
    color: #ffffff !important;
    text-decoration: underline;
    text-decoration-color: var(--fas-burgundy);
    text-decoration-thickness: 2px;
}

.app-nav-user {
    color: #ffffff !important;
}

.app-menu-button {
    color: #ffffff !important;
}

.app-menu-button:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.app-theme-toggle {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.app-nav-more {
    position: relative;
}

.app-nav-more summary {
    cursor: pointer;
    list-style: none;
}

.app-nav-more summary::-webkit-details-marker {
    display: none;
}

.app-nav-more-list {
    padding: 0.35rem 0;
}

@media (min-width: 768px) {
    .app-nav-more[open] .app-nav-more-list {
        background: var(--fas-card);
        border: 1px solid var(--fas-line);
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
        min-width: 11rem;
        padding: 0.4rem 0;
        position: absolute;
        right: 0;
        top: calc(100% + 0.55rem);
        z-index: 50;
    }

    .app-nav-more-list .app-nav-link {
        color: var(--fas-ink) !important;
        display: block;
        padding: 0.45rem 0.9rem;
    }

    .app-nav-more-list .app-nav-link:hover,
    .app-nav-more-list .app-nav-link--current {
        color: var(--fas-burgundy) !important;
    }
}

.brand-strip {
    background: var(--fas-navy);
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
}

.brand-strip .app-brand-name {
    color: #ffffff;
}

.brand-strip + .error-shell {
    min-height: calc(100vh - 3.75rem);
}

.app-main h1,
.app-main h2,
.app-main h1.text-gray-900,
.app-main h2.text-gray-900,
html.dark .app-main h1,
html.dark .app-main h2 {
    color: var(--fas-burgundy) !important;
    font-family: var(--app-font-display);
}

@media (max-width: 480px) {
    .app-brand-name { white-space: normal; max-width: 11rem; font-size: 1rem; line-height: 1.15; }
}

/* Palantir-density shell. Tokens stay the brand package. */
html, body.app-body {
    max-width: 100%;
    /* clip, not hidden: hidden turns html/body into scroll containers, which
       silently disables every position:sticky below them (the phone topbar and
       the Email Sender's pinned Send). `hidden` stays as the fallback for
       browsers without clip. */
    overflow-x: hidden;
    overflow-x: clip;
}

.app-topbar {
    align-items: center;
    background: var(--fas-navy);
    border-bottom: 3px solid var(--fas-burgundy);
    display: flex;
    gap: 0.65rem;
    min-height: calc(3.25rem + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 0.85rem 0.55rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.app-rail-open {
    align-items: center;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex: none;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.app-topbar .app-brand {
    flex: 1;
    min-width: 0;
}

.app-topbar-user {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-rail-backdrop {
    background: rgba(22, 38, 63, 0.45);
    inset: 0;
    position: fixed;
    z-index: 45;
}

.app-rail {
    background: var(--fas-navy) !important;
    border-bottom: 0 !important;
    border-right: 3px solid var(--fas-burgundy);
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100vh;
    height: 100dvh;
    left: 0;
    overflow-y: auto;
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 0.85rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    width: min(17.5rem, 86vw);
    z-index: 50;
    -webkit-overflow-scrolling: touch;
}

body.app-rail-open .app-rail {
    transform: translateX(0);
}

.app-rail-brand {
    padding: 0.15rem 0.35rem 0.5rem;
}

.app-rail-search {
    position: relative;
}

.app-rail-search input {
    background: var(--fas-navy-2);
    border: 1px solid rgba(255, 255, 255, 0.5); /* edge 5.3:1 on the navy bar (WCAG 1.4.11 >= 3:1) */
    border-radius: 2px;
    color: #fff;
    font-size: 16px; /* iOS Safari will not zoom */
    min-height: 44px;
    padding: 0.45rem 0.7rem;
    width: 100%;
}

.app-rail-search input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.app-rail-search input:focus {
    border-color: var(--fas-card);
    box-shadow: 0 0 0 2px var(--fas-card); /* 14.8:1 on navy, 12.5:1 on navy-2 */
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.app-search-panel {
    background: var(--fas-card);
    border: 1px solid var(--fas-line);
    left: 0;
    margin-top: 0.25rem;
    max-height: 16rem;
    overflow: auto;
    position: absolute;
    right: 0;
    z-index: 60;
}

.app-search-hit {
    border-bottom: 1px solid var(--fas-line);
    color: var(--fas-ink);
    display: block;
    font-size: 0.8rem;
    padding: 0.55rem 0.7rem;
    text-decoration: none;
}

.app-search-kind {
    background: var(--fas-red-soft);
    color: var(--fas-burgundy);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-right: 0.4rem;
    padding: 0.05rem 0.3rem;
    text-transform: uppercase;
}

.app-rail-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.25rem 0;
}

.app-rail .app-nav-link {
    align-items: center;
    border-radius: 2px !important;
    color: #ffffff !important;
    display: flex;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 0.7rem;
    letter-spacing: 0.08em;
    min-height: 44px;
    padding: 0.35rem 0.7rem;
    text-decoration: none !important;
    text-transform: uppercase;
}

.app-nav-icon {
    flex: none;
    height: 16px;
    overflow: visible;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    width: 16px;
    fill: none;
}

.app-nav-icon--claim {
    fill: rgba(255, 255, 255, 0.08);
}

.app-nav-link--current .app-nav-icon--claim {
    fill: var(--fas-burgundy);
    stroke: #ffffff;
}

.app-rail .app-nav-link:hover,
.app-rail .app-nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.08) !important;
}

.app-rail .app-nav-link--current {
    box-shadow: inset 3px 0 0 var(--fas-burgundy);
    background: rgba(138, 31, 31, 0.22) !important;
}

.app-rail-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-top: 0.65rem;
}

.app-rail-foot .app-nav-user {
    color: #fff !important;
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
}

.app-rail-foot .app-theme-toggle {
    align-self: flex-start;
    color: #fff;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    min-height: 36px;
    text-transform: uppercase;
}

html.dark .app-theme-light-label { display: none; }
html:not(.dark) .app-theme-dark-label { display: none; }

.app-main {
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
    .app-main {
        padding: 1.25rem 1.5rem 2.5rem;
    }
}

.sr-only {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

.desk-stage {
    padding: 1rem 0.9rem 2rem;
}

.desk-canvas {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 96rem;
    padding: 0;
    width: 100%;
}

.desk-kicker,
.home-kicker {
    color: var(--fas-navy);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-signal { color: var(--app-text, #1a1a1a); font-size: 1.05rem; margin: 0.2rem 0 1rem; }
.home-signal a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }
.home-signal strong { color: var(--fas-burgundy, #8a1f1f); }
#desk-hot, #desk-due, #desk-outreach, #od-outreach { scroll-margin-top: 4.5rem; }

.desk-fold { margin: 0 0 0.85rem; }
.desk-fold > summary {
    align-items: baseline;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    list-style: none;
    min-height: 44px;
}
.desk-fold > summary::-webkit-details-marker { display: none; }
.desk-fold > summary::before {
    color: var(--fas-navy, #16263f);
    content: "\2212";
    font-weight: 700;
    width: 0.8rem;
}
.desk-fold:not([open]) > summary::before { content: "+"; }
.desk-fold-title {
    color: var(--fas-ink, #1a1a1a);
    font-family: var(--app-font-display);
    font-size: 1.25rem;
    font-weight: 600;
}
.home-shell .desk-fold { border-top: 1px solid var(--app-border, #d5d0c6); padding-top: 0.35rem; }

.desk-headline,
.home-shell h1 {
    color: var(--fas-ink);
    font-family: var(--app-font-display);
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0.2rem 0 0.85rem;
}

.home-button {
    align-items: center;
    background: var(--fas-burgundy);
    border: 0;
    border-radius: 2px;
    color: #fff !important;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    min-height: 44px;
    padding: 0.55rem 1rem;
    text-decoration: none !important;
}

.home-button:hover { background: var(--fas-navy); }
.home-button--secondary {
    background: transparent;
    border: 1px solid var(--fas-navy);
    color: var(--fas-navy) !important;
}
.home-button--secondary:hover {
    background: var(--fas-navy);
    color: #fff !important;
}

.section-nav {
    border-bottom: 1px solid var(--app-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 1.25rem;
}
.section-nav a {
    align-items: center;
    border-bottom: 2px solid transparent;
    color: var(--app-muted);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    text-decoration: none;
    text-transform: uppercase;
}
.section-nav a.is-current {
    border-bottom-color: var(--fas-burgundy);
    color: var(--fas-burgundy);
}

.desk-pipeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1.25rem;
}
.desk-pipeline a {
    align-items: center;
    border: 1px solid var(--app-border);
    color: var(--fas-ink);
    display: inline-flex;
    font-size: 0.78rem;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.35rem 0.55rem;
    text-decoration: none;
}
.desk-pipeline a.is-bottleneck {
    border-color: var(--fas-burgundy);
    color: var(--fas-burgundy);
}
.desk-bottleneck {
    color: var(--fas-burgundy);
    font-weight: 650;
    margin: 0 0 1rem;
}
.desk-focus {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    margin-bottom: 1.25rem;
}
@media (min-width: 900px) {
    .desk-focus { grid-template-columns: 1fr 1.4fr; }
}
.desk-aside {
    color: var(--app-muted);
    display: block;
    font-size: 0.78rem;
}
.claim-buy {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.35rem 0 0;
}
.claim-buy-face {
    color: var(--fas-ink);
    font-size: 1.35rem;
    font-weight: 700;
}
.claim-buy-payout {
    color: var(--fas-burgundy);
    font-weight: 700;
}

.office-list {
    display: grid;
    gap: 0;
    max-width: 28rem;
}
.office-list a {
    border-bottom: 1px solid var(--app-border);
    color: var(--fas-ink);
    display: flex;
    font-weight: 650;
    min-height: 48px;
    align-items: center;
    text-decoration: none;
}
.office-list a:hover { color: var(--fas-burgundy); }

.home-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.desk-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin: 0 0 1.1rem;
}

.desk-fact {
    font-size: 0.8rem;
}

.desk-fact b {
    display: block;
    font-family: var(--app-font-display);
    font-size: 1.35rem;
    font-weight: 600;
}

.desk-fact a { color: inherit; text-decoration: none; }
.desk-fact a:hover { color: var(--fas-burgundy); }

.home-overdue { color: var(--fas-burgundy); font-weight: 700; }

.desk-table-wrap {
    border: 1px solid var(--fas-line);
    margin: 0 0 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.desk-table {
    border-collapse: collapse;
    min-width: 36rem;
    width: 100%;
}

.desk-table th {
    color: var(--fas-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.55rem 0.75rem;
    text-align: left;
    text-transform: uppercase;
}

.desk-table td {
    border-top: 1px solid var(--fas-line);
    font-size: 0.85rem;
    padding: 0.7rem 0.75rem;
}

.desk-table a.desk-row {
    color: inherit;
    display: block;
    text-decoration: none;
}

.desk-table tbody tr:hover td {
    background: var(--fas-red-soft);
}

.desk-empty {
    color: var(--fas-muted);
    font-size: 0.9rem;
    padding: 0.85rem 0;
}

.desk-empty a { color: var(--fas-burgundy); }

.home-funnel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.home-funnel-cell {
    min-width: 5.5rem;
}

.home-status--pending { color: var(--fas-burgundy); font-size: 0.75rem; font-weight: 700; }

@media (min-width: 1024px) {
    .app-topbar { display: none; }
    .app-rail {
        transform: none;
        width: 13.75rem;
    }
    .app-rail-backdrop { display: none !important; }
    .app-body--railed .app-main,
    .app-body--railed .desk-stage,
    .app-body--railed .auth-shell {
        margin-left: 13.75rem;
    }
    .desk-stage { padding: 1.25rem 1.5rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .app-rail { transition: none; }
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.app-topbar {
    flex-wrap: wrap;
}

.app-topbar-search {
    flex: 1 1 100%;
    order: 5;
    position: relative;
}

.app-topbar-search input {
    background: var(--fas-navy-2);
    border: 1px solid rgba(255, 255, 255, 0.5); /* edge 5.3:1 on the navy bar (WCAG 1.4.11 >= 3:1) */
    border-radius: 2px;
    color: #fff;
    font-size: 16px;
    min-height: 44px;
    padding: 0.45rem 0.7rem;
    width: 100%;
}

.app-topbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.app-topbar-search input:focus {
    border-color: var(--fas-card);
    box-shadow: 0 0 0 2px var(--fas-card); /* 14.8:1 on navy, 12.5:1 on navy-2 */
    outline: 2px solid transparent;
    outline-offset: 2px;
}

body.app-rail-open {
    overflow: hidden;
}

.app-main input,
.app-main select,
.app-main textarea,
.desk-stage input,
.desk-stage select,
.desk-stage textarea {
    font-size: 16px;
}

@media (max-width: 1023px) {
    .app-brand-name {
        font-size: 0.82rem;
        line-height: 1.15;
        max-width: 11.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .home-shell h1 {
        font-size: 1.35rem;
    }

    .home-quick-actions .home-button {
        flex: 1 1 100%;
        justify-content: center;
    }

    .desk-facts {
        gap: 0.75rem 1rem;
    }

    .desk-table {
        min-width: 0;
    }

    .desk-table thead {
        display: none;
    }

    .desk-table,
    .desk-table tbody,
    .desk-table tr,
    .desk-table th,
    .desk-table td {
        display: block;
        width: 100%;
    }

    .desk-table td,
    .desk-table th {
        padding: 0.85rem 0.7rem;
    }

    .desk-table a.desk-row {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .app-grid-shell .px-6,
    .app-grid-shell .p-4,
    .app-grid-shell .p-6 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .app-grid-toolbar-actions {
        width: 100%;
    }

    .app-grid-toolbar-actions .app-grid-button {
        flex: 1 1 100%;
        min-height: 44px;
    }

    .app-grid-surface > div[id] {
        height: min(58dvh, 22rem) !important;
        min-height: 16rem !important;
    }

    .claim-title {
        font-size: 1.35rem !important;
    }

    .claim-header,
    .claim-badges {
        max-width: none;
        justify-content: flex-start;
    }

    .app-main {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .max-w-5xl .grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 1024px) {
    .app-topbar-search { display: none; }
}

/* Inner-page phone rewrite. Desktop grids stay. */
.phone-list {
    border: 1px solid var(--fas-line);
    display: none;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.phone-list > li + li {
    border-top: 1px solid var(--fas-line);
}

.phone-list a,
.phone-list .phone-list-row {
    color: var(--fas-ink);
    display: block;
    min-height: 52px;
    padding: 0.85rem 0.9rem;
    text-decoration: none;
}

.phone-list strong {
    display: block;
    font-size: 0.95rem;
}

.phone-list span {
    color: var(--fas-muted);
    display: block;
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

@media (max-width: 1023px) {
    .phone-list { display: block; }
    .app-grid-surface { display: none !important; }

    .app-main h1,
    .desk-stage h1 {
        font-size: 1.4rem !important;
        line-height: 1.15;
    }

    nav[aria-label="Breadcrumb"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .app-main table thead {
        display: none;
    }

    .app-main table,
    .app-main tbody,
    .app-main tr,
    .app-main th,
    .app-main td {
        display: block;
        width: 100%;
    }

    .app-main tr {
        border-bottom: 1px solid var(--fas-line);
        padding: 0.85rem 0.15rem;
    }

    .app-main td,
    .app-main th {
        border: 0 !important;
        min-height: 1.35rem;
        padding: 0.15rem 0 !important;
        text-align: left !important;
        white-space: normal !important;
    }

    .app-main td:first-child,
    .app-main th:first-child {
        font-weight: 700;
    }

    .app-main .overflow-x-auto {
        overflow: visible;
    }

    .claim-row,
    .action-item {
        grid-template-columns: 1fr !important;
        gap: 0.3rem !important;
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .claim-title { font-size: 1.3rem !important; }

    .action-button,
    .action-input,
    .app-grid-button,
    .calls-import-button,
    .auth-submit,
    button[type="submit"],
    a.inline-flex.items-center {
        min-height: 44px;
    }

    .action-control,
    .action-form,
    .app-grid-toolbar-actions,
    .flex.flex-wrap.gap-2 {
        width: 100%;
    }

    .action-button,
    .app-grid-toolbar-actions > a,
    .app-grid-toolbar-actions > button,
    .flex.flex-wrap.gap-2 > a {
        flex: 1 1 100%;
        justify-content: center;
        width: 100%;
    }

    .app-main input,
    .app-main select,
    .app-main textarea,
    .action-input,
    .status-select-compact {
        font-size: 16px !important;
        min-height: 44px;
    }

    .calls-import a,
    .calls-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 0.4rem;
    }

    .claim-badges { justify-content: flex-start !important; max-width: none !important; }

    #toast {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }
}


/* ---- Owner navigation: top bar on desktop, bottom bar on phone. ----------
 * Same tokens as the rail (navy, 3px burgundy hairline, 44px taps). Only the
 * Owner role gets .app-rail--top / .app-bottombar; reps keep the rail. */
.app-tools > summary { list-style: none; cursor: pointer; }
.app-tools > summary::-webkit-details-marker { display: none; }
.app-tools-menu a {
    color: #fff !important;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    min-height: 44px;
    padding: 0 0.7rem 0 2.2rem;
    text-decoration: none !important;
}
.app-tools-menu a:hover { background: rgba(255, 255, 255, 0.08); }
.app-bottombar { display: none; }

@media (max-width: 1023px) {
    .app-bottombar {
        background: var(--fas-navy);
        border-top: 3px solid var(--fas-burgundy);
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        left: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        position: fixed;
        right: 0;
        z-index: 40;
    }
    .app-bottombar a, .app-bottombar button {
        align-items: center;
        background: none;
        border: 0;
        color: rgba(255, 255, 255, 0.78);
        display: flex;
        flex-direction: column;
        font: 600 0.72rem var(--app-font-sans);
        gap: 0.2rem;
        justify-content: center;
        min-height: 56px;
        text-decoration: none;
    }
    .app-bottombar .is-current { color: #fff; box-shadow: inset 0 3px 0 var(--fas-burgundy); }
}

@media (min-width: 1024px) {
    .app-rail.app-rail--top {
        align-items: center;
        border-bottom: 3px solid var(--fas-burgundy);
        border-right: 0;
        flex-direction: row;
        gap: 1rem;
        height: auto;
        overflow: visible;
        padding: 0 1.25rem;
        right: 0;
        width: auto;
        z-index: 60;
    }
    /* Owner desktop hairline: beats `.app-rail { border-bottom: 0 !important }`
       above, which otherwise erases the 3px burgundy line (#185 review). */
    html body .app-rail.app-rail--top {
        border-bottom: 3px solid var(--fas-burgundy) !important;
    }
    .app-rail--top .app-rail-brand { padding: 0.5rem 0; }
    .app-rail--top .app-rail-search { margin-left: auto; width: 15rem; }
    .app-rail--top .app-rail-nav { flex: none; flex-direction: row; gap: 0.1rem; padding: 0; }
    .app-rail--top .app-nav-link, .app-rail--top .app-tools > summary { min-height: 56px; }
    .app-rail--top .app-nav-link--current { box-shadow: inset 0 -3px 0 var(--fas-burgundy); }
    .app-rail--top .app-rail-foot { border-top: 0; flex-direction: row; align-items: center; padding: 0; gap: 0.25rem; }
    .app-rail--top .app-tools { position: relative; }
    .app-rail--top .app-tools-menu {
        background: var(--fas-navy);
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-top: 3px solid var(--fas-burgundy);
        left: 0;
        min-width: 14rem;
        padding: 0.25rem 0;
        position: absolute;
        top: 100%;
    }
    .app-rail--top .app-tools-menu a { padding-left: 1rem; }
    .app-body--railed:has(.app-rail--top) .app-main,
    .app-body--railed:has(.app-rail--top) .desk-stage,
    .app-body--railed:has(.app-rail--top) .auth-shell {
        margin-left: 0;
        padding-top: 4.75rem;
    }
}
@media (max-width: 1023px) {
    .app-rail--top .app-tools-menu { display: block; }
    .app-rail--top .app-tools > summary { min-height: 44px; }
    body:has(.app-rail--top) .app-main, body:has(.app-rail--top) .desk-stage { padding-bottom: 5rem; }
}

/* Owner bar is navy with white type (approved mockup, brand chrome). */
html body .app-rail.app-rail--top,
html body:has(.app-rail--top) .app-topbar {
    background: var(--fas-navy) !important;
    border-color: var(--fas-burgundy) !important;
}
html body .app-rail--top .app-nav-link,
html body .app-rail--top .app-nav-user,
html body .app-rail--top .app-brand-name,
html body .app-rail--top .app-theme-toggle,
html body:has(.app-rail--top) .app-topbar .app-brand-name,
html body:has(.app-rail--top) .app-topbar-user,
html body:has(.app-rail--top) .app-rail-open { color: #fff !important; }
html body .app-rail--top .app-nav-link:hover { background: rgba(255, 255, 255, 0.12) !important; }
html body .app-rail--top .app-nav-link--current { background: #fff !important; color: var(--fas-navy) !important; box-shadow: none; border-radius: 2px !important; }
html body .app-rail--top .app-theme-toggle { border-color: rgba(255, 255, 255, 0.35); }
