/* Meridian. Every value here comes from STYLE.md at the module root; that file is the source of
   truth and this one is its translation into tokens. Nothing is invented here.

   The console is plain HTML and ES modules, so these class names are the whole component library:
   the server names a tone and a cell kind, and the renderer in render.js turns each into one of
   the classes below. */

html {
    /* 1. Colour — surfaces */
    --m-ground: #171614;
    --m-chrome: #1c1b18;
    --m-panel: #1f1e1b;
    --m-panel-header: #1b1a17;
    --m-row-hover: #242220;
    --m-row-selected: #2a2724;
    --m-row-alert: #211f1c;

    /* 1. Colour — borders & dividers */
    --m-border-panel: #2b2823;
    --m-border-row: #262420;
    --m-border-control: #3a352d;
    --m-border-control-strong: #4a463c;
    --m-leader: #35312b;

    /* 1. Colour — text */
    --m-text-primary: #ece9e4;
    --m-text-numeric: #e6e2db;
    --m-text-secondary: #c5c0b8;
    --m-text-tertiary: #a9a49c;
    --m-text-muted: #8f8a82;
    --m-text-faint: #6f6a63;
    --m-text-ghost: #5e5a54;

    /* 1. Colour — semantic. Amber is the only accent; green and red are state, never brand. */
    --m-accent: #f0a93b;
    --m-accent-bg: #2a2318;
    --m-accent-hover: #ffc46b;
    --m-accent-on: #1a1917;
    --m-positive: #6ec48a;
    --m-positive-bg: #1e2a22;
    --m-positive-border: #2c3b31;
    --m-negative: #e3695f;
    --m-negative-bg: #2a201b;
    --m-negative-soft: #e3a08f;
    --m-negative-border: #5c4034;
    --m-neutral: #c5c0b8;
    --m-neutral-bg: #262421;
    --m-chart-secondary: #3f4a44;
    --m-chip-border-inactive: #322e29;

    /* 2. Type. JetBrains Mono is named by the guide; the stack falls back to the platform's
       mono rather than reaching for a CDN, which a deployed app should not depend on. */
    --m-font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --m-font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --m-size-kpi: 19px;
    --m-size-kpi-profile: 17px;
    --m-size-profile-name: 16px;
    --m-size-wordmark: 14px;
    --m-size-page-title: 13.5px;
    --m-size-header-name: 13px;
    --m-size-price: 13px;
    --m-size-panel-title: 12.5px;
    --m-size-body: 12.5px;
    --m-size-row-name: 12px;
    --m-size-dense: 11.5px;
    --m-size-figure: 11px;
    --m-size-figure-small: 10.5px;
    --m-size-id: 10px;
    --m-size-meta: 9.5px;
    --m-size-column-header: 9px;
    --m-size-badge: 8.5px;

    /* 3. Space & density */
    --m-screen-padding: 14px 18px 24px 18px;
    --m-panel-padding: 12px;
    --m-panel-header-padding: 9px 12px;
    --m-table-header-padding: 6px 12px;
    --m-table-row-padding: 8px 12px;
    --m-gap-panels: 12px;
    --m-gap-kpi: 10px;
    --m-column-gap: 12px;
    --m-radius-panel: 4px;
    --m-radius-control: 3px;
    --m-radius-micro: 2px;

    /* 4. Layout */
    --m-rail-width: 196px;
    --m-topbar-height: 48px;
    --m-content-min-width: 1180px;
    --m-sidebar-width: 300px;
    --m-sidebar-sticky-top: 62px;

}

html,
body {
    background: var(--m-ground);
    color: var(--m-text-primary);
    font-family: var(--m-font-sans);
    font-size: var(--m-size-body);
    line-height: 1.4;
}

/* Component rules below set display, which outranks the browser's own rule for [hidden] and
   would otherwise show every element the client hides. */
[hidden] {
    display: none !important;
}

/* 7. Motion: effectively none. Hover changes colour instantly. */
* {
    transition: none !important;
    animation: none !important;
}

/* Every number is mono. */
.m-num,
.m-mono {
    font-family: var(--m-font-mono);
    font-variant-numeric: tabular-nums;
}

/* All-caps micro-type is always tracked, or caps at this size read as a smudge. */
.m-caps {
    font-family: var(--m-font-mono);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

/* ---- 4. Layout ------------------------------------------------------------------ */

.m-shell {
    display: flex;
    min-height: 100vh;
    background: var(--m-ground);
}

.m-rail {
    width: var(--m-rail-width);
    min-width: var(--m-rail-width);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    background: var(--m-chrome);
    border-right: 1px solid var(--m-border-panel);
    display: flex;
    flex-direction: column;
}

.m-wordmark {
    font-family: var(--m-font-sans);
    font-size: var(--m-size-wordmark);
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--m-text-primary);
    padding: 14px 12px;
}

.m-nav-group {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-badge);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--m-text-ghost);
    padding: 12px 12px 5px 12px;
}

.m-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    font-family: var(--m-font-sans);
    font-size: var(--m-size-row-name);
    color: var(--m-text-tertiary);
    border-left: 3px solid transparent;
    text-decoration: none;
    cursor: pointer;
}

.m-nav-item:hover {
    background: var(--m-row-hover);
    color: var(--m-text-secondary);
}

.m-nav-item[highlight],
.m-nav-item.m-active {
    border-left-color: var(--m-accent);
    color: var(--m-accent);
    font-size: var(--m-size-panel-title);
    font-weight: 600;
    background: var(--m-row-selected);
}

.m-nav-count {
    margin-left: auto;
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    color: var(--m-text-faint);
}

.m-rail-footer {
    margin-top: auto;
    padding: 9px 12px;
    border-top: 1px solid var(--m-border-panel);
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    letter-spacing: 0.09em;
    color: var(--m-text-ghost);
    display: flex;
    align-items: center;
    gap: 6px;
}

.m-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--m-text-faint);
    flex: none;
}

.m-dot.m-dot-live {
    background: var(--m-positive);
}

.m-dot.m-dot-down {
    background: var(--m-negative);
}

/* The content column never lets numeric columns collapse: below its floor the page scrolls
   sideways, top bar and all, rather than the figures reflowing. */
.m-main {
    flex: 1;
    min-width: var(--m-content-min-width);
    display: flex;
    flex-direction: column;
}

.m-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--m-topbar-height);
    min-height: var(--m-topbar-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    background: var(--m-chrome);
    border-bottom: 1px solid var(--m-border-panel);
}

.m-page-title {
    font-family: var(--m-font-sans);
    font-size: var(--m-size-page-title);
    font-weight: 600;
    color: var(--m-text-primary);
}

/* The subtitle is itself a readout, not a caption. */
.m-page-subtitle {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--m-text-muted);
}

.m-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--m-font-mono);
    font-size: var(--m-size-meta);
    color: var(--m-text-faint);
}

.m-topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--m-border-panel);
}

.m-screen {
    padding: var(--m-screen-padding);
    min-width: var(--m-content-min-width);
    display: flex;
    flex-direction: column;
    gap: var(--m-gap-panels);
}

.m-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--m-sidebar-width);
    gap: var(--m-gap-panels);
    align-items: start;
}

.m-split > .m-aside {
    position: sticky;
    top: var(--m-sidebar-sticky-top);
    display: flex;
    flex-direction: column;
    gap: var(--m-gap-panels);
}

/* ---- 5. Components ------------------------------------------------------------- */

.m-panel {
    background: var(--m-panel);
    border: 1px solid var(--m-border-panel);
    border-radius: var(--m-radius-panel);
    min-width: 0;
}

.m-panel-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: var(--m-panel-header-padding);
    background: var(--m-panel-header);
    border-bottom: 1px solid var(--m-border-panel);
    border-radius: var(--m-radius-panel) var(--m-radius-panel) 0 0;
}

.m-panel-title {
    font-family: var(--m-font-sans);
    font-size: var(--m-size-panel-title);
    font-weight: 600;
    color: var(--m-text-primary);
}

.m-panel-body {
    padding: var(--m-panel-padding);
}

/* KPI strip: label / value / delta, equal columns, first on an overview screen. */
.m-kpi-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--m-gap-kpi);
}

.m-kpi-label {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--m-text-muted);
}

.m-kpi-value {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-kpi);
    font-weight: 500;
    color: var(--m-text-primary);
    font-variant-numeric: tabular-nums;
}

.m-kpi-delta {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    color: var(--m-text-faint);
}

/* Tables are CSS grid. Header and body repeat the identical columns and column-gap; a row
   sets --m-cols once and both halves read it, so they cannot drift apart. */
.m-table {
    display: flex;
    flex-direction: column;
}

.m-tr {
    display: grid;
    grid-template-columns: var(--m-cols);
    column-gap: var(--m-column-gap);
    align-items: center;
}

.m-thead {
    padding: var(--m-table-header-padding);
    background: var(--m-panel-header);
    border-bottom: 1px solid var(--m-border-panel);
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--m-text-muted);
}

.m-trow {
    padding: var(--m-table-row-padding);
    border-bottom: 1px solid var(--m-border-row);
    font-size: var(--m-size-body);
    color: var(--m-text-primary);
}

.m-trow:hover {
    background: var(--m-row-hover);
}

.m-trow.m-selected {
    background: var(--m-row-selected);
}

.m-trow.m-unread {
    background: var(--m-row-alert);
}

.m-cell-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.m-cell-num {
    text-align: right;
    font-family: var(--m-font-mono);
    font-size: var(--m-size-figure);
    color: var(--m-text-numeric);
    font-variant-numeric: tabular-nums;
}

.m-cell-name {
    font-family: var(--m-font-sans);
    font-size: var(--m-size-row-name);
    color: var(--m-text-primary);
}

.m-cell-meta {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    color: var(--m-text-faint);
}

/* Status chip — one state, one pair of colours. */
.m-chip {
    display: inline-block;
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: var(--m-radius-micro);
    white-space: nowrap;
    background: var(--m-neutral-bg);
    color: var(--m-neutral);
}

.m-chip-positive {
    background: var(--m-positive-bg);
    color: var(--m-positive);
}

.m-chip-negative {
    background: var(--m-negative-bg);
    color: var(--m-negative-soft);
}

.m-chip-accent {
    background: var(--m-accent-bg);
    color: var(--m-accent);
}

/* Filter chip row — always leads a filterable table, always includes ALL. */
.m-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.m-filter {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-meta);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    border-radius: var(--m-radius-control);
    background: transparent;
    border: 1px solid var(--m-chip-border-inactive);
    color: var(--m-text-tertiary);
    cursor: pointer;
}

.m-filter.m-active {
    background: var(--m-accent-bg);
    border-color: var(--m-accent);
    color: var(--m-accent);
}

/* Buttons. Primary is amber fill and there is at most one per panel. */
.m-btn {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-meta);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 9px 10px;
    border-radius: var(--m-radius-control);
    background: transparent;
    border: 1px solid var(--m-border-control);
    color: var(--m-text-secondary);
    cursor: pointer;
}

.m-btn:hover {
    border-color: var(--m-accent);
    color: var(--m-accent);
}

.m-btn-primary {
    background: var(--m-accent);
    border-color: var(--m-accent);
    color: var(--m-accent-on);
    font-weight: 700;
}

.m-btn-primary:hover {
    background: var(--m-accent-hover);
    border-color: var(--m-accent-hover);
    color: var(--m-accent-on);
}

.m-btn-destructive {
    border-color: var(--m-negative-border);
    color: var(--m-negative-soft);
}

.m-btn-destructive:hover {
    border-color: var(--m-negative);
    color: var(--m-negative);
}

.m-btn-confirming {
    border-color: var(--m-positive-border);
    color: var(--m-positive);
}

.m-btn-confirming:hover {
    border-color: var(--m-positive);
    color: var(--m-positive);
}

.m-btn-row {
    font-size: var(--m-size-column-header);
    padding: 3px 6px;
    border-radius: var(--m-radius-micro);
}

.m-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* Stepper — the primary editing affordance for numbers. No text inputs. */
.m-stepper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.m-stepper button {
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: var(--m-radius-micro);
    border: 1px solid var(--m-border-control);
    background: transparent;
    color: var(--m-text-secondary);
    font-family: var(--m-font-mono);
    cursor: pointer;
}

.m-stepper .m-step-up:hover {
    border-color: var(--m-positive);
    color: var(--m-positive);
}

.m-stepper .m-step-down:hover {
    border-color: var(--m-negative);
    color: var(--m-negative);
}

.m-stepper.m-stepper-limit button:hover {
    border-color: var(--m-accent);
    color: var(--m-accent);
}

/* Fixed width so the value does not jitter as digits change. */
.m-stepper-value {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-price);
    font-weight: 500;
    color: var(--m-accent);
    min-width: 52px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Meter bar — fill carries the threshold colour. */
.m-meter-label {
    display: flex;
    align-items: baseline;
    gap: 9px;
    font-size: var(--m-size-dense);
    color: var(--m-text-secondary);
}

.m-meter-label .m-meter-value {
    margin-left: auto;
    font-family: var(--m-font-mono);
    font-size: var(--m-size-figure);
    color: var(--m-text-numeric);
}

.m-meter {
    height: 5px;
    border-radius: var(--m-radius-control);
    background: var(--m-border-panel);
    overflow: hidden;
    margin-top: 5px;
}

.m-meter-fill {
    height: 100%;
    border-radius: var(--m-radius-control);
    background: var(--m-positive);
}

.m-meter-fill.m-warn {
    background: var(--m-accent);
}

.m-meter-fill.m-breach {
    background: var(--m-negative);
}

/* Key-value row — dotted leader between label and value. */
.m-kv {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 5px 0;
}

.m-kv-label {
    font-size: var(--m-size-dense);
    color: var(--m-text-tertiary);
}

.m-kv-leader {
    flex: 1;
    border-bottom: 1px dotted var(--m-leader);
    transform: translateY(-3px);
}

.m-kv-value {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-figure);
    color: var(--m-text-numeric);
}

.m-kv-hint {
    font-size: var(--m-size-column-header);
    color: var(--m-text-faint);
}

/* Threshold colours, applied to figures rather than decoration. */
.m-up,
.m-positive {
    color: var(--m-positive);
}

.m-down,
.m-negative {
    color: var(--m-negative);
}

.m-attention {
    color: var(--m-accent);
}

.m-muted {
    color: var(--m-text-muted);
}

.m-faint {
    color: var(--m-text-faint);
}

/* The standard page for a menu item whose data does not exist yet. */
.m-placeholder {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 24px;
    text-align: left;
}

.m-placeholder-title {
    font-family: var(--m-font-sans);
    font-size: var(--m-size-panel-title);
    font-weight: 600;
    color: var(--m-text-secondary);
}

.m-placeholder-body {
    font-size: var(--m-size-dense);
    color: var(--m-text-tertiary);
    max-width: 62ch;
}

/* ---- Screens ------------------------------------------------------------------- */
/* Everything below is the same vocabulary as above, for the parts of the layout the screens
   assemble: the rail's own furniture, the two split ratios the guide names, card rows, the
   ticker, the alert register and the sign-in page. No new colour or size is introduced; each
   value is a token declared at the top of this file. */

.m-stack {
    display: flex;
    flex-direction: column;
    gap: var(--m-gap-panels);
    min-width: 0;
}

.m-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* 1.6fr beside 1fr: the overview's working split. */
.m-split-wide {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: var(--m-gap-panels);
    align-items: start;
}

/* 1.25fr beside 1fr: two registers side by side. */
.m-split-alerts {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: var(--m-gap-panels);
    align-items: start;
}

.m-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--m-gap-kpi);
    align-items: start;
}

.m-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: var(--m-panel-padding);
    min-width: 0;
}

.m-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.m-tag {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-column-header);
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: var(--m-radius-micro);
    background: #272521;
    color: var(--m-text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Rail furniture ------------------------------------------------------------ */

.m-rail-head {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 15px 14px 13px 14px;
    border-bottom: 1px solid var(--m-border-panel);
}

.m-rail-head .m-wordmark {
    padding: 0;
}

.m-rail-strap {
    letter-spacing: 0.15em;
    color: var(--m-text-muted);
    font-size: var(--m-size-meta);
}

.m-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 6px;
}

.m-nav-item {
    border-radius: var(--m-radius-control);
}

.m-nav-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.m-rail-health {
    display: flex;
    align-items: center;
    gap: 7px;
}

.m-rail-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.m-rail-version {
    color: var(--m-text-ghost);
    letter-spacing: 0.09em;
}

/* ---- Top bar ------------------------------------------------------------------- */

.m-search {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 230px;
    padding: 5px 9px;
    background: var(--m-row-hover);
    border: 1px solid var(--m-chip-border-inactive);
    border-radius: var(--m-radius-control);
}

.m-search-mark {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid var(--m-text-faint);
    flex: none;
}

.m-search-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--m-text-primary);
    font-family: var(--m-font-sans);
    font-size: var(--m-size-dense);
}

.m-topbar-clock {
    font-size: var(--m-size-figure-small);
    padding: 5px 8px;
    background: var(--m-row-hover);
    border: 1px solid var(--m-chip-border-inactive);
    border-radius: var(--m-radius-control);
    color: var(--m-text-secondary);
}

.m-identity {
    display: flex;
    align-items: center;
    gap: 7px;
}

.m-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--m-border-control);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--m-font-mono);
    font-size: var(--m-size-meta);
    color: var(--m-text-primary);
    flex: none;
}

.m-identity-text {
    display: flex;
    flex-direction: column;
}

.m-identity-name {
    font-size: var(--m-size-dense);
    color: var(--m-text-primary);
}

.m-identity-role {
    font-size: var(--m-size-badge);
    color: var(--m-text-muted);
    letter-spacing: 0.1em;
}

/* ---- Table cells --------------------------------------------------------------- */

.m-cell {
    min-width: 0;
}

.m-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* A name with an inline badge after it, on one line. */
.m-cell-named {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.m-cell-named .m-cell-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The rail's counts and the table's figures take their colour from a tone class, never from the
   element they sit in. */
.m-nav-count.m-default {
    color: var(--m-text-faint);
}

/* Buttons are elements now rather than Vaadin components, so they need the reset the rest of the
   vocabulary assumes. */
button.m-btn,
button.m-filter {
    font-family: var(--m-font-mono);
    appearance: none;
    -webkit-appearance: none;
}

.m-search-input::-webkit-search-cancel-button {
    filter: grayscale(1);
}

.m-kpi {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 11px;
}

.m-kv-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.m-chip-neutral {
    background: var(--m-neutral-bg);
    color: var(--m-neutral);
}

.m-default {
    color: var(--m-text-primary);
}

.m-btn-secondary {
    border-color: var(--m-border-control);
    color: var(--m-text-secondary);
}

.m-btn-accent {
    border-color: var(--m-accent);
    color: var(--m-accent);
}

/* Inline live/pre badge: the smallest type the guide allows, and tracked because of it. */
.m-badge {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-badge);
    letter-spacing: 0.06em;
    padding: 2px 4px;
    border-radius: var(--m-radius-micro);
    white-space: nowrap;
    flex: none;
}

.m-badge-live {
    background: var(--m-positive-bg);
    color: var(--m-positive);
}

.m-badge-dim {
    background: var(--m-neutral-bg);
    color: var(--m-text-faint);
}

/* ---- Ticker and registers ------------------------------------------------------ */

.m-ticker {
    max-height: 300px;
    overflow: auto;
}

.m-ticker-row {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 7px 12px;
    border-bottom: 1px solid var(--m-border-row);
}

.m-ticker-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.m-alert-list {
    display: flex;
    flex-direction: column;
}

.m-alert-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-bottom: 1px solid var(--m-border-row);
}

.m-alert-row.m-unread {
    background: var(--m-row-alert);
}

/* Acting on a row dims its bar and drops its title to muted. Reversible, never destructive. */
.m-alert-row.m-acknowledged .m-alert-title {
    color: var(--m-text-muted);
}

.m-alert-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.m-alert-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-alert-title {
    font-size: var(--m-size-row-name);
    color: var(--m-text-primary);
}

.m-accent-bar {
    width: 3px;
    align-self: stretch;
    border-radius: var(--m-radius-micro);
    flex: none;
    background: currentColor;
}

/* ---- Empty states and placeholders -------------------------------------------- */

.m-empty {
    padding: 14px 12px;
}

.m-empty-text {
    font-size: var(--m-size-dense);
    color: var(--m-text-muted);
    max-width: 72ch;
}

.m-placeholder-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 9px;
    max-width: 72ch;
}

/* ---- Sign-in ------------------------------------------------------------------- */

.m-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--m-ground);
}

.m-login .m-panel {
    width: 360px;
}

.m-login-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
}

.m-login-button {
    text-align: center;
    text-decoration: none;
    margin-top: 5px;
}

.m-login-button:hover {
    color: var(--m-accent-on);
}

.m-login-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ---- Toasts -------------------------------------------------------------------- */
/* Bottom-right, one line, no animation. It reports what Thoth said and then goes. */

.m-toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.m-toast {
    font-family: var(--m-font-mono);
    font-size: var(--m-size-meta);
    padding: 8px 10px;
    border-radius: var(--m-radius-control);
    background: var(--m-panel);
    border: 1px solid var(--m-border-control);
    color: var(--m-text-secondary);
    max-width: 48ch;
}

.m-toast.m-failed {
    border-color: var(--m-negative-border);
    color: var(--m-negative-soft);
}

/* ---- The shell before the first fetch ----------------------------------------- */

.m-booting {
    padding: 24px 18px;
    font-family: var(--m-font-mono);
    font-size: var(--m-size-meta);
    letter-spacing: 0.09em;
    color: var(--m-text-muted);
}

/* The rail's active item is set by the router rather than by a framework attribute. */
.m-nav-item {
    -webkit-user-select: none;
    user-select: none;
}
