/* ==========================================================================
   TPRC Client Portal — primitives
   Source: "Client Portal UI Enhancements" design handoff v3, slides 9-16.

   Layer 2 of the deck's build order. Four primitives cover most of the portal
   (Card, Row, Badge, Button) plus Tabs, the pipeline stepper, page headers and
   empty states.

   Everything is namespaced `t-` so these can be introduced page by page
   without colliding with the existing design-system.css classes. Load after
   tprc-tokens.css.
   ========================================================================== */

/* ---- App shell ---------------------------------------------------------
   Sticky top bar, right-aligned text links, no sidebar. The centred content
   container is the only layout: two-column splits are used on Home only, so
   every other page reflows to mobile without a second layout.
   ------------------------------------------------------------------------ */

body.t-shell {
    font-family: var(--t-font);
    color: var(--t-ink);
    background: linear-gradient(180deg, var(--t-page-from) 0%, var(--t-page-to) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Every page wraps its content in .main-content, which the old layout offset
   by the sidebar width and padded down past a FIXED header. The top bar is
   sticky and therefore in flow, so both are removed and .main-content simply
   becomes the centred container. This is what re-lays out all existing pages
   without touching their markup; newly built pages use .t-page directly.
   Scoped to .t-shell so admin-only pages keep their sidebar untouched. */
body.t-shell .main-content {
    /* `auto` on BOTH sides, so the column is centred under the top bar, which
       is itself centred at the same max-width. `margin-left: 0` centred
       nothing: it pinned the column to the left edge and dumped the whole
       leftover width on the right, leaving content visibly off-centre from
       the bar above it on any window wider than --t-container. The
       !important stays because design-system.css offsets .main-content by
       the old sidebar width. */
    margin-left: auto !important;
    margin-right: auto;
    width: auto;
    min-height: auto;
    max-width: var(--t-container);
    padding: var(--t-space-8) var(--t-page-pad) var(--t-space-9);
    transition: none;
}

/* Legacy chrome that the new shell replaces. Hidden rather than deleted from
   each page so the markup stays untouched while pages are converted. */
body.t-shell .mobile-header,
body.t-shell #mobile-bottom-nav,
body.t-shell #sidebar-overlay,
body.t-shell .sidebar-chatbot,
body.t-shell .guided-tour-widget { display: none !important; }

.t-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--t-surface);
    border-bottom: var(--t-border);
}

.t-topbar-inner {
    max-width: var(--t-container);
    margin: 0 auto;
    padding: 0 var(--t-page-pad);
    height: 68px;
    display: flex;
    align-items: center;
    gap: var(--t-space-6);
}

.t-brand {
    display: flex;
    align-items: center;
    gap: var(--t-space-3);
    text-decoration: none;
    flex-shrink: 0;
}
.t-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: var(--t-radius-sm);
    background: var(--t-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: var(--t-weight-bold);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.t-brand-name {
    font-size: var(--t-body-size);
    font-weight: var(--t-weight-bold);
    color: var(--t-ink);
    line-height: 1.15;
}

/* Text links only. Icons are reserved for notifications and inline warnings. */
.t-nav {
    display: flex;
    align-items: center;
    gap: var(--t-space-6);
    margin-left: auto;
}
.t-nav-link {
    position: relative;
    font-size: var(--t-body-sm-size);
    font-weight: 500;
    color: var(--t-muted);
    text-decoration: none;
    padding: 6px 0;
    white-space: nowrap;
    transition: color var(--t-duration) var(--t-ease);
}
.t-nav-link:hover { color: var(--t-ink); }
.t-nav-link.is-active {
    color: var(--t-ink);
    font-weight: var(--t-weight-bold);
}
/* 2px underline in brand orange marks the active destination. */
.t-nav-link.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--t-brand);
    border-radius: 2px;
}

.t-topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--t-space-3);
    padding-left: var(--t-space-5);
    margin-left: var(--t-space-2);
    border-left: var(--t-border);
}

.t-bell {
    position: relative;
    width: var(--t-tap);
    height: var(--t-tap);
    border: none;
    background: none;
    color: var(--t-muted);
    border-radius: var(--t-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--t-duration) var(--t-ease), color var(--t-duration) var(--t-ease);
}
.t-bell:hover { background: var(--t-surface-sunken); color: var(--t-ink); }
/* Hidden until loadNotifications() puts .has-updates on the bell. The dot's
   own text is the unread count, which screen readers still announce. */
.t-bell-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--t-radius-pill);
    background: var(--t-brand);
    border: 2px solid var(--t-surface);
    color: #fff;
    font-size: 9px;
    font-weight: var(--t-weight-bold);
    line-height: 12px;
    text-align: center;
    display: none;
}
.t-bell.has-updates .t-bell-dot { display: block; }

.t-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--t-radius-pill);
    background: var(--t-charcoal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--t-weight-bold);
    flex-shrink: 0;
}

.t-page {
    max-width: var(--t-container);
    margin: 0 auto;
    padding: var(--t-space-8) var(--t-page-pad) var(--t-space-9);
}

/* Home is the only two-column split: main column + rail. */
.t-split {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: var(--t-space-6);
    align-items: start;
}

.t-section { margin-top: var(--t-section-gap); }
.t-section:first-child { margin-top: 0; }

.t-stack { display: flex; flex-direction: column; gap: var(--t-stack-gap); }

/* ---- Typography --------------------------------------------------------
   Hierarchy by size and weight. Do not bold everything: one 700 element per
   row maximum, supporting metadata always drops to muted or faint.
   ------------------------------------------------------------------------ */

.t-page-title {
    font-size: var(--t-page-title-size);
    font-weight: var(--t-weight-bold);
    letter-spacing: var(--t-page-title-track);
    color: var(--t-ink);
    margin: 0;
    line-height: 1.2;
}
.t-page-sub {
    font-size: var(--t-body-size);
    color: var(--t-muted);
    margin: var(--t-space-2) 0 0;
    line-height: 1.5;
}
.t-section-title {
    font-size: var(--t-section-size);
    font-weight: var(--t-weight-bold);
    color: var(--t-ink);
    margin: 0 0 var(--t-space-4);
    line-height: 1.3;
}
.t-micro {
    font-size: var(--t-micro-size);
    font-weight: var(--t-weight-bold);
    letter-spacing: var(--t-micro-track);
    text-transform: uppercase;
    color: var(--t-faint);
    margin: 0 0 var(--t-space-3);
}
.t-body { font-size: var(--t-body-size); color: var(--t-muted); line-height: 1.55; margin: 0; }
.t-meta { font-size: var(--t-body-sm-size); color: var(--t-faint); margin: 0; }

/* Back affordance above a detail page title. */
.t-back {
    display: inline-flex;
    align-items: center;
    gap: var(--t-space-2);
    font-size: var(--t-body-sm-size);
    font-weight: var(--t-weight-row);
    color: var(--t-muted);
    text-decoration: none;
    margin-bottom: var(--t-space-4);
}
.t-back:hover { color: var(--t-action); }

.t-page-head { margin-bottom: var(--t-space-7); }

/* ---- Card --------------------------------------------------------------- */

.t-card {
    background: var(--t-surface);
    border: var(--t-border);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow);
    padding: var(--t-card-pad);
}
.t-card-lg { padding: var(--t-card-pad-lg); }
.t-card-flush { padding: 0; overflow: hidden; }

.t-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--t-space-4);
    margin-bottom: var(--t-space-4);
}
.t-card-head > .t-section-title { margin-bottom: 0; }

/* Charcoal panel. Sets Next Steps and page heroes apart from the white page. */
.t-panel {
    background: linear-gradient(160deg, var(--t-charcoal) 0%, var(--t-charcoal-deep) 100%);
    border-radius: var(--t-radius-lg);
    padding: var(--t-card-pad-lg);
    color: var(--t-on-charcoal);
}
.t-panel .t-section-title,
.t-panel .t-page-title { color: var(--t-on-charcoal); }
.t-panel .t-body,
.t-panel .t-meta { color: var(--t-on-charcoal-mute); }

/* A single, large, actionable figure. No metric tiles for their own sake. */
.t-figure {
    font-size: 44px;
    font-weight: var(--t-weight-bold);
    letter-spacing: -0.03em;
    color: var(--t-ink);
    line-height: 1;
    margin: var(--t-space-2) 0 var(--t-space-4);
}

/* ---- Row ---------------------------------------------------------------
   Avatar, name (links to profile), one line of meta, one primary link.
   Secondary actions are underlined text, never buttons.
   ------------------------------------------------------------------------ */

.t-row {
    display: flex;
    align-items: center;
    gap: var(--t-space-4);
    padding: var(--t-row-pad);
    background: var(--t-surface);
    border: var(--t-border);
    border-radius: var(--t-radius-sm);
    position: relative;
}
.t-row-plain { border: none; border-radius: 0; background: none; padding: var(--t-row-pad); }

/* Rows inside a flush card are separated by hairlines instead of gaps. */
.t-rows > .t-row { border: none; border-radius: 0; border-bottom: var(--t-border); }
.t-rows > .t-row:last-child { border-bottom: none; }

.t-row-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--t-radius-sm);
    background: var(--t-charcoal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--t-weight-bold);
    flex-shrink: 0;
}
.t-row-body { flex: 1; min-width: 0; }
.t-row-title {
    font-size: var(--t-row-title-size);
    font-weight: var(--t-weight-row);
    color: var(--t-ink);
    margin: 0;
    line-height: 1.35;
}
a.t-row-title { text-decoration: none; }
a.t-row-title:hover { color: var(--t-action); }
.t-row-meta {
    font-size: var(--t-body-sm-size);
    color: var(--t-muted);
    margin: 2px 0 0;
    line-height: 1.4;
}
.t-row-actions {
    display: flex;
    align-items: center;
    gap: var(--t-space-4);
    flex-shrink: 0;
}

/* Urgent rows carry a 4px left accent bar. Colour is never the only signal:
   the row still shows an Overdue badge and a warning icon. */
.t-row-urgent { border-left: 4px solid var(--t-overdue-fg); }
.t-row-warn   { border-left: 4px solid var(--t-awaiting-fg); }

/* Rows on the charcoal panel. */
.t-panel .t-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.t-panel .t-row-title { color: #fff; }
.t-panel .t-row-meta  { color: var(--t-on-charcoal-mute); }
.t-panel .t-row-urgent { border-left: 4px solid var(--t-brand); }

/* ---- Badge -------------------------------------------------------------
   Always carries a text label. Never colour alone.
   ------------------------------------------------------------------------ */

.t-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--t-radius-pill);
    font-size: 12px;
    font-weight: var(--t-weight-row);
    line-height: 1.4;
    white-space: nowrap;
    background: var(--t-inactive-bg);
    color: var(--t-inactive-fg);
}
.t-badge-approved { background: var(--t-approved-bg); color: var(--t-approved-fg); }
.t-badge-pending  { background: var(--t-pending-bg);  color: var(--t-pending-fg); }
.t-badge-awaiting { background: var(--t-awaiting-bg); color: var(--t-awaiting-fg); }
.t-badge-review   { background: var(--t-review-bg);   color: var(--t-review-fg); }
.t-badge-overdue  { background: var(--t-overdue-bg);  color: var(--t-overdue-fg); }
.t-badge-inactive { background: var(--t-inactive-bg); color: var(--t-inactive-fg); }

/* Uppercase micro variant used on hero panels and job order cards. */
.t-badge-micro {
    font-size: var(--t-micro-size);
    font-weight: var(--t-weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
}

/* ---- Button ------------------------------------------------------------
   One filled button per context. Everything else is outlined or text.
   Minimum tap target 44px.
   ------------------------------------------------------------------------ */

.t-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--t-space-2);
    min-height: var(--t-tap);
    padding: 0 var(--t-space-5);
    border-radius: var(--t-radius-pill);
    font-family: inherit;
    font-size: var(--t-body-sm-size);
    font-weight: var(--t-weight-row);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--t-duration) var(--t-ease),
                border-color var(--t-duration) var(--t-ease),
                color var(--t-duration) var(--t-ease);
}
.t-btn:disabled, .t-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.t-btn-primary {
    background: var(--t-brand);
    color: #fff;
}
.t-btn-primary:hover:not(:disabled) { background: var(--t-brand-hover); color: #fff; }

.t-btn-secondary {
    background: var(--t-surface);
    color: var(--t-ink);
    border-color: var(--t-border-strong);
}
.t-btn-secondary:hover:not(:disabled) { background: var(--t-surface-sunken); }

/* Text action. The "Upload ->" affordance that ends most rows. */
.t-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--t-body-sm-size);
    font-weight: var(--t-weight-row);
    color: var(--t-action);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.t-link:hover { color: var(--t-brand); text-decoration: underline; }
.t-panel .t-link { color: var(--t-brand); }

/* Secondary actions inside a row: underlined text, never buttons. */
.t-link-quiet {
    font-size: var(--t-body-sm-size);
    font-weight: 500;
    color: var(--t-muted);
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}
.t-link-quiet:hover { color: var(--t-ink); }
.t-link-danger { color: var(--t-overdue-fg); }

:where(.t-btn, .t-link, .t-link-quiet, .t-nav-link, .t-tab):focus-visible {
    outline: 2px solid var(--t-brand);
    outline-offset: 2px;
    border-radius: var(--t-radius-sm);
}

/* ---- Tabs --------------------------------------------------------------- */

.t-tabs {
    display: flex;
    align-items: center;
    gap: var(--t-space-6);
    border-bottom: var(--t-border);
    margin-bottom: var(--t-space-6);
    overflow-x: auto;
    scrollbar-width: none;
}
.t-tabs::-webkit-scrollbar { display: none; }

.t-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--t-space-2);
    padding: var(--t-space-3) 0 var(--t-space-4);
    font-size: var(--t-body-sm-size);
    font-weight: 500;
    color: var(--t-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: color var(--t-duration) var(--t-ease);
}
.t-tab:hover { color: var(--t-ink); }
.t-tab.is-active { color: var(--t-ink); font-weight: var(--t-weight-bold); }
.t-tab.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--t-brand);
    border-radius: 2px;
}
/* Count pill beside a tab label. */
.t-tab-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--t-radius-pill);
    background: var(--t-inactive-bg);
    color: var(--t-inactive-fg);
    font-size: 10px;
    font-weight: var(--t-weight-bold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.t-tab.is-active .t-tab-count { background: var(--t-pending-bg); color: var(--t-pending-fg); }

/* ---- Pipeline stepper --------------------------------------------------
   Each node is a filter: clicking a stage filters the list, "Show all"
   clears it. The current stage is larger with a soft ring.
   ------------------------------------------------------------------------ */

.t-stepper {
    display: flex;
    align-items: flex-start;
    background: var(--t-surface-sunken);
    border: var(--t-border);
    border-radius: var(--t-radius);
    padding: var(--t-space-6) var(--t-space-5);
}
.t-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--t-space-3);
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    min-width: 0;
}
/* Connector runs between node centres, behind the nodes. */
.t-step::before {
    content: '';
    position: absolute;
    top: 17px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--t-border-color);
}
.t-step:first-child::before { display: none; }
.t-step.is-done::before,
.t-step.is-current::before { background: var(--t-charcoal); }

.t-step-node {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: var(--t-radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--t-body-sm-size);
    font-weight: var(--t-weight-bold);
    background: var(--t-surface);
    border: 2px solid var(--t-border-color);
    color: var(--t-faint);
    transition: transform var(--t-duration) var(--t-ease);
}
.t-step-label {
    font-size: 12px;
    font-weight: var(--t-weight-row);
    color: var(--t-muted);
    text-align: center;
    line-height: 1.3;
}
.t-step.is-done .t-step-node {
    background: var(--t-charcoal);
    border-color: var(--t-charcoal);
    color: #fff;
}
.t-step.is-done .t-step-label { color: var(--t-ink); }
.t-step.is-current .t-step-node {
    width: 42px;
    height: 42px;
    margin-top: -3px;
    background: var(--t-brand);
    border-color: var(--t-brand);
    color: #fff;
    box-shadow: 0 0 0 5px var(--t-brand-subtle);
}
.t-step.is-current .t-step-label { color: var(--t-brand); font-weight: var(--t-weight-bold); }
.t-step.is-filtered .t-step-node { box-shadow: 0 0 0 5px var(--t-brand-subtle); }
.t-step:hover .t-step-node { transform: translateY(-1px); }
.t-step[aria-disabled="true"] { cursor: default; }
.t-step[aria-disabled="true"]:hover .t-step-node { transform: none; }

.t-stepper-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--t-space-4);
    margin-bottom: var(--t-space-4);
}

/* ---- Empty state -------------------------------------------------------
   Plain English, never a dead end.
   ------------------------------------------------------------------------ */

.t-empty {
    text-align: center;
    padding: var(--t-space-9) var(--t-space-5);
    color: var(--t-muted);
}
.t-empty-title {
    font-size: var(--t-row-title-size);
    font-weight: var(--t-weight-row);
    color: var(--t-ink);
    margin: 0 0 var(--t-space-2);
}
.t-empty-body {
    font-size: var(--t-body-sm-size);
    color: var(--t-muted);
    margin: 0 auto;
    max-width: 420px;
    line-height: 1.55;
}

/* ---- Grids -------------------------------------------------------------- */

.t-grid { display: grid; gap: var(--t-space-4); }
.t-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.t-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---- Definition list used on profile / record pages -------------------- */

.t-dl { display: flex; flex-direction: column; }
.t-dl-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--t-space-5);
    padding: var(--t-space-3) 0;
    border-bottom: var(--t-border);
}
.t-dl-row:last-child { border-bottom: none; }
.t-dl-key { font-size: var(--t-body-sm-size); color: var(--t-muted); }
.t-dl-val {
    font-size: var(--t-body-sm-size);
    font-weight: var(--t-weight-row);
    color: var(--t-ink);
    text-align: right;
}

/* ---- Responsive --------------------------------------------------------
   Two-column splits stack, rows become full-width, the pipeline wraps to two
   rows, tabs scroll horizontally.
   ------------------------------------------------------------------------ */

@media (max-width: 900px) {
    .t-split, .t-grid-2, .t-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
    .t-topbar-inner { height: 60px; gap: var(--t-space-4); }
    /* Desktop links collapse into the mobile sheet. */
    .t-nav { display: none; }
    .t-brand-name { display: none; }
    .t-page { padding: var(--t-space-6) var(--t-page-pad) var(--t-space-8); }
    .t-page-title { font-size: 23px; }

    /* Pipeline wraps onto two rows of nodes; identical behaviour and labels. */
    .t-stepper { flex-wrap: wrap; row-gap: var(--t-space-6); }
    .t-step { flex: 0 0 33.333%; }
    /* The connector would cross rows, so drop it once wrapped. */
    .t-step::before { display: none; }

    .t-row { flex-wrap: wrap; }
    .t-row-actions { width: 100%; justify-content: flex-end; }
}

/* ---- Mobile navigation -------------------------------------------------
   Hamburger sheet mirroring the desktop links, so a client who learns one
   navigation understands the other.
   ------------------------------------------------------------------------ */

.t-menu-btn {
    display: none;
    width: var(--t-tap);
    height: var(--t-tap);
    border: none;
    background: none;
    color: var(--t-ink);
    border-radius: var(--t-radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
@media (max-width: 768px) { .t-menu-btn { display: flex; } }

.t-sheet {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(27, 34, 40, 0.45);
    display: none;
}
.t-sheet.is-open { display: block; }
.t-sheet-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    background: var(--t-surface);
    padding: var(--t-space-6) var(--t-space-5);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--t-space-1);
}
.t-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--t-space-4);
}
.t-sheet-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--t-tap);
    padding: 0 var(--t-space-3);
    border-radius: var(--t-radius-sm);
    font-size: var(--t-body-size);
    font-weight: var(--t-weight-row);
    color: var(--t-ink);
    text-decoration: none;
}
.t-sheet-link:hover { background: var(--t-surface-sunken); }
.t-sheet-link.is-active { color: var(--t-brand); }
.t-sheet-divider { height: 1px; background: var(--t-border-color); margin: var(--t-space-3) 0; }

/* ---- Profile dropdown --------------------------------------------------- */

.t-menu { position: relative; }
.t-menu-trigger {
    display: flex;
    align-items: center;
    gap: var(--t-space-2);
    min-height: var(--t-tap);
    padding: 0 var(--t-space-2);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--t-body-sm-size);
    font-weight: 500;
    color: var(--t-muted);
    border-radius: var(--t-radius-sm);
}
.t-menu-trigger:hover { color: var(--t-ink); }
.t-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 232px;
    background: var(--t-surface);
    border: var(--t-border);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow-raised);
    padding: var(--t-space-2);
    display: none;
    z-index: 1050;
}
.t-menu-panel.is-open { display: block; }
.t-menu-item {
    display: flex;
    align-items: center;
    gap: var(--t-space-3);
    padding: 10px var(--t-space-3);
    border-radius: var(--t-radius-sm);
    font-size: var(--t-body-sm-size);
    font-weight: 500;
    color: var(--t-ink);
    text-decoration: none;
    white-space: nowrap;
}
.t-menu-item:hover { background: var(--t-surface-sunken); color: var(--t-ink); }
/* .sidebar-chatbot-btn is a JS hook — initChatbot() binds every element
   carrying it — and design-system.css also skins it as a solid orange pill.
   In this menu it is a plain row, so the legacy skin is undone here rather
   than by renaming the hook and breaking the binding. */
.t-menu-item.sidebar-chatbot-btn {
    background: none;
    color: var(--t-ink);
    font-size: var(--t-body-sm-size);
    font-weight: 500;
}
.t-menu-item.sidebar-chatbot-btn:hover {
    background: var(--t-surface-sunken);
    color: var(--t-ink);
}
.t-menu-item.sidebar-chatbot-btn i { font-size: inherit; }
/* Same story in the mobile sheet, where design-system.css's orange pill made
   "Talk to Maya" look like the one primary action in a list of plain links.
   Now that the sheet is reached from the bottom bar's More button it is the
   main menu on a phone, so the row has to match the rows around it. */
.t-sheet-link.sidebar-chatbot-btn {
    display: flex;
    background: none;
    border-radius: var(--t-radius-sm);
    padding: 0 var(--t-space-3);
    font-size: var(--t-body-size);
    font-weight: var(--t-weight-row);
    color: var(--t-ink);
}
.t-sheet-link.sidebar-chatbot-btn:hover {
    background: var(--t-surface-sunken);
    color: var(--t-ink);
}
.t-sheet-link.sidebar-chatbot-btn i { font-size: inherit; }
.t-menu-label {
    font-size: var(--t-micro-size);
    font-weight: var(--t-weight-bold);
    letter-spacing: var(--t-micro-track);
    text-transform: uppercase;
    color: var(--t-faint);
    padding: var(--t-space-3) var(--t-space-3) var(--t-space-2);
}
.t-menu-divider { height: 1px; background: var(--t-border-color); margin: var(--t-space-2) 0; }
.t-menu-head {
    padding: var(--t-space-3);
    border-bottom: var(--t-border);
    margin-bottom: var(--t-space-2);
}
.t-menu-head-name {
    font-size: var(--t-body-sm-size);
    font-weight: var(--t-weight-bold);
    color: var(--t-ink);
}
.t-menu-head-meta { font-size: 12px; color: var(--t-muted); margin-top: 2px; }
