/* =====================================================================
   Gulf Advisors — "Quiet Authority" component layer (system.css)
   Loaded after base.css. Brings the older component families onto the
   system (one badge family, one tab style, one menu, quiet alerts) and adds
   the new pieces: command palette, stat figures, the runway, dashboard
   composition. Round 2 folds these back into base.css sections.
   ===================================================================== */

/* Cards: borders-only inside the sheet */

.card,
.detail-panel,
.ops-panel,
.panel,
.summary-card {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.card__title {
    font-size: var(--text-md);
    font-weight: 600;
}

.ops-panel h2 {
    font-size: var(--text-xs);
    color: var(--text-3);
    font-weight: 500;
}

.detail-item dt,
.ops-meta-grid dt,
.ops-meta__label,
.meta-label {
    color: var(--text-3);
    font-weight: 450;
}

/* One status family. Every status is a dot plus a word; the tint only
   repeats what the word says (never colour alone). */

.status-badge,
.reminder-badge,
.outbox-badge,
.expiry-badge,
.approval-badge,
.urgency-badge,
.readiness,
.ops-status,
.cycle-badge,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px 0 7px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--rule);
    background: var(--paper);
    color: var(--text-2);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0;
}

.reminder-badge::before,
.outbox-badge::before,
.expiry-badge::before,
.approval-badge::before,
.urgency-badge::before,
.ops-status::before,
.cycle-badge::before,
.badge::before,
.status-badge::before,
.readiness::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-400);
    flex-shrink: 0;
}

/* success */
.status-active, .status-badge--existing, .reminder-badge--completed, .outbox-badge--sent,
.expiry-badge--valid, .approval-badge--auto, .readiness--ready, .ops-status--success, .badge--success {
    background: var(--leaf-50);
    border-color: var(--leaf-200);
    color: var(--leaf-700);
}
.status-active::before, .status-badge--existing::before, .reminder-badge--completed::before,
.outbox-badge--sent::before, .expiry-badge--valid::before, .approval-badge--auto::before,
.readiness--ready::before, .ops-status--success::before, .badge--success::before {
    background: var(--leaf-500);
}

/* danger */
.status-badge--error, .reminder-badge--rejected, .outbox-badge--failed,
.expiry-badge--expired, .readiness--blocked, .ops-status--danger,
.urgency-badge--critical, .badge--danger {
    background: var(--rose-50);
    border-color: var(--rose-200);
    color: var(--rose-600);
}
.status-badge--error::before, .reminder-badge--rejected::before,
.outbox-badge--failed::before, .expiry-badge--expired::before, .readiness--blocked::before,
.ops-status--danger::before, .urgency-badge--critical::before,
.badge--danger::before {
    background: var(--rose-500);
}

/* attention / waiting */
.status-badge--renew, .reminder-badge--awaiting, .outbox-badge--pending, .outbox-badge--sending,
.expiry-badge--expiring_soon, .approval-badge--required, .ops-status--warning, .ops-status--blocked,
.urgency-badge--warning, .urgency-badge--soft, .badge--warning {
    background: var(--amber-50);
    border-color: var(--amber-200);
    color: var(--amber-700);
}
.status-badge--renew::before, .reminder-badge--awaiting::before, .outbox-badge--pending::before,
.outbox-badge--sending::before, .expiry-badge--expiring_soon::before,
.approval-badge--required::before, .ops-status--warning::before, .ops-status--blocked::before,
.urgency-badge--warning::before, .urgency-badge--soft::before, .badge--warning::before {
    background: var(--amber-500);
}

.outbox-badge--sending::before {
    animation: pulse-dot 1.2s var(--ease) infinite;
}

/* in progress / informational */
.status-badge--create, .reminder-badge--approved, .outbox-badge--claimed, .ops-status--action,
.ops-status--info, .cycle-badge--current, .badge--info {
    background: var(--sky-50);
    border-color: var(--sky-200);
    color: var(--sky-700);
}
.status-badge--create::before, .reminder-badge--approved::before, .outbox-badge--claimed::before,
.ops-status--action::before, .ops-status--info::before, .cycle-badge--current::before,
.badge--info::before {
    background: var(--sky-500);
}

/* neutral */
.status-inactive, .reminder-badge--cancelled, .outbox-badge--cancelled, .cycle-badge--historical,
.urgency-badge--neutral, .badge--neutral {
    background: var(--paper-2);
    border-color: var(--rule);
    color: var(--text-3);
}

.badge--accent {
    background: var(--sun-50);
    border-color: var(--sun-200);
    color: var(--sun-700);
}

.badge--accent::before {
    background: var(--sun-500);
}

@keyframes pulse-dot {
    50% {
        opacity: 0.35;
    }
}

/* Tabs — the orange rule marks the view you are in */

.tabs {
    gap: var(--space-5);
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--rule);
}

.tab {
    padding: 10px 0;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-3);
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
}

.tab:hover {
    color: var(--text);
    background: none;
}

.tab.is-active {
    color: var(--text);
    border-bottom-color: var(--sun-500);
}

.tab__count {
    height: 18px;
    min-width: 18px;
    padding: 0 5px;
    border: 0;
    border-radius: var(--radius-full);
    background: rgba(47, 50, 64, 0.07);
    color: var(--text-2);
    font-size: var(--text-2xs);
    font-weight: 600;
}

.tab.is-active .tab__count {
    background: var(--ink-800);
    color: var(--on-ink);
    border: 0;
}

.tab__count--alert {
    background: var(--rose-50);
    color: var(--rose-600);
}

/* Alerts — quiet panels with a coloured key, not coloured walls */

.alert {
    position: relative;
    align-items: flex-start;
    padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 10px);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    background: var(--paper);
    color: var(--text);
    font-size: var(--text-base);
}

.alert::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 3px;
    background: var(--sky-500);
}

.alert--info,
.alert--success {
    background: var(--paper);
    color: var(--text);
    border-color: var(--rule);
}

.alert--success::before {
    background: var(--leaf-500);
}

.alert--warning {
    background: var(--amber-50);
    color: var(--text);
    border-color: var(--amber-200);
}

.alert--warning::before {
    background: var(--amber-500);
}

.alert--error {
    background: var(--rose-50);
    color: var(--text);
    border-color: var(--rose-200);
}

.alert--error::before {
    background: var(--rose-500);
}

/* Menus */

.menu__panel {
    padding: 4px;
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transform-origin: top right;
    animation: pop-in var(--dur) var(--ease) both;
}

.menu__item {
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    padding: 7px 10px;
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-2px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.btn--danger:hover {
    background: var(--rose-700);
    border-color: var(--rose-700);
}

/* Flash message dismiss */

.message__text {
    flex: 1;
    min-width: 0;
}

.message__dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: -2px -6px -2px 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
}

.message__dismiss:hover {
    background: rgba(47, 50, 64, 0.06);
    color: var(--text);
}

.message__dismiss .icon {
    width: 14px;
    height: 14px;
}

/* Command palette */

.palette {
    width: min(620px, calc(100vw - 32px));
    max-height: min(520px, calc(100dvh - 120px));
    margin: 12vh auto auto;
    padding: 0;
    border: 0;
    border-radius: var(--radius-xl);
    background: var(--paper);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.palette[open] {
    display: flex;
    animation: palette-in 160ms var(--ease) both;
}

.palette::backdrop {
    background: rgba(31, 33, 41, 0.28);
}

@keyframes palette-in {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.palette__field {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    border-bottom: 1px solid var(--rule);
    color: var(--text-3);
}

.palette .palette__input {
    flex: 1;
    min-height: 54px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    font-size: var(--text-md);
}

.palette .palette__input:focus {
    box-shadow: none;
}

.palette__results {
    list-style: none;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    flex: 1;
}

.palette__section {
    padding: 10px 10px 4px;
    font-size: var(--text-xs);
    color: var(--text-3);
}

.palette__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-2);
}

.palette__item .icon {
    color: var(--text-3);
}

.palette__item[aria-selected="true"] {
    background: rgba(47, 50, 64, 0.06);
    color: var(--text);
}

.palette__item[aria-selected="true"] .icon {
    color: var(--sun-600);
}

.palette__title {
    flex: 1;
}

.palette__meta {
    font-size: var(--text-xs);
    color: var(--text-3);
}

.palette__empty {
    margin: 0;
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--text-3);
}

.palette__foot {
    display: flex;
    gap: var(--space-4);
    padding: 8px var(--space-4);
    border-top: 1px solid var(--rule);
    background: var(--paper-2);
    font-size: var(--text-xs);
    color: var(--text-3);
}

.palette__foot span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Page header extras */

.page-header h1 {
    font-size: var(--text-xl);
}

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin: 0 0 var(--space-3);
}

.section-title h2 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
}

.section-title .text-link {
    flex-shrink: 0;
}

/* Stat figures — one hero figure, the rest demoted (no identical KPI boxes) */

.figures {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-7);
    overflow: hidden;
}

.figure {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-4) var(--space-5);
    border-left: 1px solid var(--rule);
    color: inherit;
    text-decoration: none;
    min-width: 0;
    transition: background var(--dur-fast) var(--ease);
}

a.figure:hover {
    background: var(--paper-2);
    color: inherit;
}

.figure:first-child {
    border-left: 0;
}

.figure__label {
    font-size: var(--text-sm);
    color: var(--text-3);
}

.figure__value {
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.figure--hero .figure__value {
    font-size: 2.5rem;
}

.figure__note {
    font-size: var(--text-xs);
    color: var(--text-3);
}

.figure__note--danger,
.figure__value--danger {
    color: var(--rose-600);
}

.figure__note--warning {
    color: var(--amber-700);
}

.figure__note--ok {
    color: var(--leaf-700);
}

/* The runway — the signature element. Deadlines and stages drawn on one
   hairline rail; the orange seal marks "now". Used for document expiries
   (dashboard), request stages (staff and client) and the intake stepper. */

.runway {
    position: relative;
    padding: 30px 0 4px;
}

.runway__rail {
    position: relative;
    height: 2px;
    border-radius: 2px;
    background: var(--rule-solid);
}

.runway__zone {
    position: absolute;
    top: 0;
    height: 2px;
    border-radius: 2px;
}

.runway__zone--danger {
    background: var(--rose-500);
}

.runway__zone--warning {
    background: var(--amber-500);
}

.runway__zone--calm {
    background: var(--ink-300);
}

.runway__now {
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--sun-500);
    box-shadow: 0 0 0 4px var(--sun-100);
    z-index: 1;
}

.runway__now-label {
    position: absolute;
    left: 0;
    top: 4px;
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--sun-700);
}

.runway__marker {
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 2px;
    background: var(--paper);
    border: 2px solid var(--ink-400);
    transform: rotate(45deg);
}

.runway__marker--danger {
    border-color: var(--rose-500);
}

.runway__marker--warning {
    border-color: var(--amber-500);
}

.runway__ticks {
    position: relative;
    height: 16px;
    margin-top: 10px;
    font-size: var(--text-2xs);
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.runway__ticks span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.runway__ticks span:first-child {
    transform: none;
}

.runway__ticks span:last-child {
    transform: translateX(-100%);
}

.runway-legend {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin: var(--space-5) 0 0;
    padding: 0;
    list-style: none;
}

.runway-legend li a,
.runway-legend li > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--paper-2);
    color: inherit;
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease);
}

.runway-legend li a:hover {
    background: var(--well);
    box-shadow: inset 0 0 0 1px var(--rule);
}

.runway-legend__value {
    font-size: var(--text-lg);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.runway-legend__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    color: var(--text-3);
}

.runway-legend__label::before {
    content: "";
    width: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink-300);
}

.runway-legend__label--danger::before {
    background: var(--rose-500);
}

.runway-legend__label--warning::before {
    background: var(--amber-500);
}

/* Stage rail — steps drawn on the runway */

.stage-rail {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    list-style: none;
    margin: 0;
    padding: 0;
}

.stage-rail__step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 24px;
    padding-right: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-3);
    min-width: 0;
}

.stage-rail__step::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rule-solid);
}

.stage-rail__step::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--ink-300);
}

.stage-rail__step.is-done::before {
    background: var(--ink-800);
}

.stage-rail__step.is-done::after {
    background: var(--ink-800);
    border-color: var(--ink-800);
}

.stage-rail__step.is-current {
    color: var(--text);
    font-weight: 500;
}

.stage-rail__step.is-current::after {
    background: var(--sun-500);
    border-color: var(--sun-500);
    box-shadow: 0 0 0 4px var(--sun-100);
}

.stage-rail__step.is-blocked::after {
    background: var(--amber-500);
    border-color: var(--amber-500);
    box-shadow: 0 0 0 4px var(--amber-50);
}

.stage-rail__name {
    overflow-wrap: anywhere;
}

.stage-rail__meta {
    font-size: var(--text-xs);
    color: var(--text-3);
    font-weight: 400;
}

/* Dashboard composition */

.greeting {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4) var(--space-6);
    margin-bottom: var(--space-7);
}

.greeting__text {
    flex: 1;
    min-width: min(100%, 22rem);
}

.greeting__date {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.greeting__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.125rem, 3.6vw, 2.875rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.greeting__summary {
    margin: var(--space-3) 0 0;
    max-width: 42rem;
    color: var(--text-2);
    font-size: var(--text-md);
}

.greeting__summary strong {
    font-weight: 600;
    color: var(--text);
}

/* Administrators only: the chat's uptime line (apps/chat/uptime.py). */
.greeting__uptime {
    margin: var(--space-2) 0 0;
    color: var(--text-3);
    font-size: var(--text-sm);
}

.greeting__uptime--down {
    color: var(--color-danger);
    font-weight: 600;
}

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: var(--space-7) var(--space-8);
    align-items: start;
}

.dash-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
    min-width: 0;
}

.worklist {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule);
}

.worklist__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
}

.worklist__item a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.worklist__item a:hover {
    text-decoration: underline;
    text-decoration-color: var(--sun-500);
}

.worklist__main {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.worklist__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.worklist__sub {
    font-size: var(--text-xs);
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.worklist__side {
    font-size: var(--text-xs);
    color: var(--text-3);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.worklist__side--danger {
    color: var(--rose-600);
    font-weight: 500;
}

.worklist__side--warning {
    color: var(--amber-700);
    font-weight: 500;
}

.worklist__empty {
    padding: var(--space-5) 0;
    color: var(--text-3);
    border-bottom: 1px solid var(--rule);
}

.date-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--rule);
    background: var(--paper);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.date-chip__day {
    font-size: var(--text-md);
    font-weight: 600;
}

.date-chip__mon {
    margin-top: 3px;
    font-size: 9.5px;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.date-chip--danger {
    border-color: var(--rose-200);
    background: var(--rose-50);
    color: var(--rose-600);
}

.date-chip--danger .date-chip__mon {
    color: var(--rose-600);
}

.date-chip--warning {
    border-color: var(--amber-200);
    background: var(--amber-50);
    color: var(--amber-700);
}

.date-chip--warning .date-chip__mon {
    color: var(--amber-700);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.pipeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pipeline__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px var(--space-3);
    align-items: center;
    font-size: var(--text-sm);
}

.pipeline__label {
    color: var(--text-2);
}

.pipeline__count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pipeline__bar {
    grid-column: 1 / -1;
    height: 6px;
    border-radius: 6px;
    background: var(--well);
    box-shadow: inset 0 0 0 1px var(--rule);
    overflow: hidden;
}

.pipeline__bar span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--ink-700);
    transform-origin: left center;
    animation: grow-x 600ms var(--ease) both;
}

.pipeline__bar--accent span {
    background: var(--sun-500);
}

.pipeline__bar--danger span {
    background: var(--rose-500);
}

@keyframes grow-x {
    from {
        transform: scaleX(0);
    }
}

.stagger > * {
    animation: rise-in var(--dur-slow) var(--ease) both;
}

.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(n + 6) { animation-delay: 200ms; }

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 1100px) {
    .dash-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

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

    .figure:nth-child(3) {
        border-left: 0;
    }

    .figure:nth-child(n + 3) {
        border-top: 1px solid var(--rule);
    }

    .figure--hero .figure__value {
        font-size: var(--text-2xl);
    }

    .runway-legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .stage-rail {
        grid-auto-flow: row;
        grid-auto-columns: auto;
    }

    .stage-rail__step {
        padding: 0 0 var(--space-4) 26px;
    }

    .stage-rail__step::before {
        top: 12px;
        bottom: 0;
        left: 5px;
        right: auto;
        width: 2px;
        height: auto;
    }

    .stage-rail__step:last-child::before {
        display: none;
    }

    .stage-rail__step::after {
        top: 2px;
    }
}

/* Auth extras */

.brand-mark--light {
    background: var(--sun-500);
    color: var(--ink-950);
}

.auth-runway {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: var(--space-7) 0 0;
    padding: 0;
    list-style: none;
    max-width: 30rem;
}

.auth-runway li {
    position: relative;
    padding-top: 22px;
    padding-right: 8px;
    font-size: var(--text-xs);
    color: var(--sidebar-dark-muted, var(--on-ink-3));
}

.auth-runway li::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
}

.auth-runway li::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ink-900);
    border: 2px solid rgba(255, 255, 255, 0.28);
}

.auth-runway li.is-done {
    color: var(--on-ink-2);
}

.auth-runway li.is-done::before {
    background: rgba(255, 255, 255, 0.55);
}

.auth-runway li.is-done::after {
    background: var(--on-ink);
    border-color: var(--on-ink);
}

.auth-runway li.is-current {
    color: var(--on-ink);
}

.auth-runway li.is-current::after {
    background: var(--sun-500);
    border-color: var(--sun-500);
    box-shadow: 0 0 0 5px rgba(247, 162, 27, 0.2);
    animation: seal-breathe 2.8s var(--ease-move) infinite;
}

@keyframes seal-breathe {
    50% {
        box-shadow: 0 0 0 8px rgba(247, 162, 27, 0.08);
    }
}

.auth-brand__foot .icon {
    width: 14px;
    height: 14px;
    color: var(--sun-400);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 4.25rem;
}

.password-field__toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-3);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
}

.password-field__toggle:hover {
    background: rgba(47, 50, 64, 0.06);
    color: var(--text);
}

.app-main.app-main--auth {
    max-width: none;
    padding: 0;
}

/* The sign-in brand panel is the one ink surface in the product: its own
   text colours, independent of the (light) sidebar tokens. */
.auth-brand {
    background: var(--ink-900);
    color: var(--on-ink-2);
}

.auth-brand__statement p {
    color: var(--on-ink-2);
}

.auth-brand__foot {
    color: var(--on-ink-3);
}

/* Monogram sizing for two letters */
.app-sidebar__brand-mark,
.brand-mark,
.auth-card__mark {
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
}

.auth-card__mark {
    font-size: 1.125rem;
    background: var(--ink-800);
    color: var(--sun-400);
}

/* Dashboard: compact figures inside a column */
.figures--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: var(--space-4);
}

.figures--compact .figure {
    padding: var(--space-3) var(--space-4);
}

.figures--compact .figure__value {
    font-size: var(--text-xl);
}

.figures--compact .figure:nth-child(3) {
    border-left: 1px solid var(--rule);
    border-top: 0;
}

.pipeline-caption {
    margin: 0 0 var(--space-3);
}

.worklist__icon {
    width: 18px;
    height: 18px;
    color: var(--text-3);
    margin: 0 6px;
}

.worklist__side .outbox-badge {
    margin-bottom: 4px;
}

.panel__hint {
    font-size: var(--text-sm);
    color: var(--text-3);
    margin: var(--space-3) 0 0;
}

/* Sidebar: the nav scrolls, the brand and the person stay put */
.app-sidebar {
    overflow: hidden;
}

.app-sidebar__nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    gap: var(--space-4);
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
}

.app-sidebar__footer {
    flex-shrink: 0;
}

.num,
.data-table td.num {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .worklist__item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .worklist__title {
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .worklist__side {
        grid-column: 2;
        text-align: left;
    }
}

/* Phones: wide tables scroll sideways at a readable width instead of
   collapsing every column into a word-per-line stack. */
@media (max-width: 768px) {
    .table-scroll > .data-table,
    .table-panel > .data-table {
        min-width: 680px;
    }

    .table-panel {
        overflow-x: auto;
    }

    .table-scroll {
        scrollbar-width: thin;
    }
}

/* Error pages (403 / 404) */
.error-page {
    max-width: 34rem;
    margin: var(--space-10) auto;
    padding: 0 var(--space-4);
    text-align: center;
}

.app-body--auth .error-page {
    margin-top: 18vh;
}

.error-page__code {
    margin: 0 0 var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--sun-700);
    letter-spacing: 0.08em;
}

.error-page__title {
    margin: 0 0 var(--space-3);
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.error-page__text {
    color: var(--text-2);
    font-size: var(--text-md);
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

/* No keyboard shortcut hints on touch-only devices */
@media (hover: none) {
    .app-sidebar__search .kbd,
    .palette__foot {
        display: none;
    }
}

/* Reminder Center snapshot (the owner's landing page) uses the figure strip */
.work-snapshot {
    gap: 0;
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-5);
}

.work-card {
    gap: 2px;
    padding: var(--space-4) var(--space-5);
    border: 0;
    border-left: 1px solid var(--rule);
    border-radius: 0;
    background: var(--paper);
    transition: background var(--dur-fast) var(--ease);
}

.work-card:first-child {
    border-left: 0;
}

.work-card:hover {
    background: var(--paper-2);
}

.work-card__value {
    order: 2;
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -0.03em;
}

.work-card__label {
    order: 1;
    font-size: var(--text-sm);
    font-weight: 450;
    color: var(--text-3);
}

.work-card--attention {
    border-color: var(--rule);
}

.work-card--attention .work-card__value {
    color: var(--rose-600);
}

@media (max-width: 900px) {
    .work-card:nth-child(3) {
        border-left: 0;
    }

    .work-card:nth-child(n + 3) {
        border-top: 1px solid var(--rule);
    }
}
