/*
 * static/css/mobile.css — the phone app (templates/mobile/, api/mobile.py).
 *
 * Tokens come straight from the design canvas "My Market Desk — Mobile".
 * Light reuses site.css's palette exactly (#f7f8fa / #0b1733 / #e2e8f0 /
 * #2f6bff), so the app and the marketing site are one brand; dark is the
 * canvas's own navy set.
 *
 * Theme: [data-theme="light"|"dark"] on <html>, set before first paint by
 * the bootstrap in mobile/base.html. No attribute = follow the device.
 */

:root {
    /* brand, identical in both themes */
    --brand: #2f6bff;
    --brand-dark: #1f55e0;
    --accent: #5b8bff;

    --radius: 14px;
    --radius-pill: 22px;
    --tap: 48px;
    --gutter: 16px;
    --tabbar-height: 62px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Light is the default so a no-JS, no-preference render is still correct. */
:root,
:root[data-theme="light"] {
    --bg: #f7f8fa;
    --card: #ffffff;
    --line: #e2e8f0;
    --line-2: #cbd5e1;
    --text: #0b1733;
    --text-2: #334155;
    --muted: #64748b;
    --muted-2: #5b6b84;
    --up: #15803d;
    --down: #c81e2b;
    --warn: #a16207;
    --up-bg: rgba(22, 163, 74, 0.12);
    --down-bg: rgba(220, 38, 38, 0.10);
    --down-brd: rgba(220, 38, 38, 0.30);
    --warn-bg: rgba(217, 119, 6, 0.12);
    --chip-bg: #ffffff;
    --avatar: #2f6bff;
    --avatar-text: #ffffff;
    --sel-bg: rgba(47, 107, 255, 0.12);
}

:root[data-theme="dark"] {
    --bg: #0a0e18;
    --card: #0e1524;
    --line: #1c2740;
    --line-2: #2a3a5c;
    --text: #e6ebf5;
    --text-2: #aab3c8;
    --muted: #8a96ad;
    --muted-2: #7c869e;
    --up: #22c55e;
    --down: #ff6b74;
    --warn: #e0a030;
    --up-bg: rgba(34, 197, 94, 0.12);
    --down-bg: rgba(240, 69, 79, 0.13);
    --down-brd: rgba(240, 69, 79, 0.35);
    --warn-bg: rgba(224, 160, 48, 0.12);
    --chip-bg: #0e1524;
    --avatar: #243e80;
    --avatar-text: #e6ebf5;
    --sel-bg: rgba(47, 107, 255, 0.22);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0e18;
        --card: #0e1524;
        --line: #1c2740;
        --line-2: #2a3a5c;
        --text: #e6ebf5;
        --text-2: #aab3c8;
        --muted: #8a96ad;
        --muted-2: #7c869e;
        --up: #22c55e;
        --down: #ff6b74;
        --warn: #e0a030;
        --up-bg: rgba(34, 197, 94, 0.12);
        --down-bg: rgba(240, 69, 79, 0.13);
        --down-brd: rgba(240, 69, 79, 0.35);
        --warn-bg: rgba(224, 160, 48, 0.12);
        --chip-bg: #0e1524;
        --avatar: #243e80;
        --avatar-text: #e6ebf5;
        --sel-bg: rgba(47, 107, 255, 0.22);
    }
}

* { box-sizing: border-box; }

/* our `display` rules beat the UA's [hidden], so say it louder */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.mono { font-family: var(--mono); }
.up { color: var(--up); }
.down { color: var(--down); }

.hide-scroll::-webkit-scrollbar { display: none; }
.hide-scroll { scrollbar-width: none; }

.pulse { animation: ui-pulse var(--motion-loading) ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none } }

/* ── shell ────────────────────────────────────────────────────────── */
/* Pin the shell to the visual viewport. Some mobile Chromium builds report
   a transient, tiny `dvh` while browser chrome is settling, which collapsed
   the feed's two scroll regions to zero height. Insets avoid that unit and
   keep the header and tab bar outside every tab's scroller. */
.app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    /* Installed, there is no browser chrome: without this the status bar
       sits on top of the header. Zero in a normal tab. */
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
    max-width: 640px;        /* a tablet shouldn't stretch the phone layout */
    margin: 0 auto;
    overflow: hidden;
}

.global-settings {
    position: absolute;
    z-index: 5;
    top: calc(8px + env(safe-area-inset-top));
    right: max(8px, calc((100vw - 640px) / 2 + 8px));
    width: var(--tap);
    height: var(--tap);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    border-radius: 50%;
}
.global-settings[aria-current="page"] { color: var(--accent); background: var(--sel-bg); }
.app-head {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 56px 4px var(--gutter);
    flex-shrink: 0;
    background: var(--bg);
}

.app-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.app-sub { font-size: 13px; color: var(--muted); }

/* A tab that must fit one screen cannot spend 77px on its own name.
   Same head, tighter, with the subtitle beside the title rather than
   under it: ~45px flat, which is 12-32px handed back to the content. */
.app-head.is-compact { padding: 10px 56px 4px var(--gutter); align-items: baseline; }
.app-head.is-compact .app-title { font-size: 22px; }
.app-head.is-compact .app-sub { font-size: 12px; }

.brand-lockup { display: flex; align-items: center; gap: 10px; }

.brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--brand);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.brand-name span { color: var(--accent); }

.icon-btn {
    width: var(--tap); height: var(--tap);
    border: 0; background: transparent; color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}

.app-main {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px var(--gutter) 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}


.app-head + .app-main { padding-top: 4px; }

/* ── strict one-screen tabs ──
   The page itself never scrolls here; .app-main becomes a fixed frame
   and whatever inside it is marked .scroller does the scrolling. Feed
   and Live Wire keep the default (one scrolling list) -- they are
   streams, and a stream is a scroll by definition. */
.app-main.is-fixed {
    overflow: hidden;
    gap: 10px;
    padding-bottom: 8px;
}
.scroller { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ── bottom nav ───────────────────────────────────────────────────── */
.tabbar {
    display: flex;
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(100%, 640px);
    min-height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
    padding: 5px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

.tab {
    flex: 1;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 600;
}

.tab[aria-current="page"] { color: var(--accent); font-weight: 700; }

.tab-label { display: block; font-size: 10px; letter-spacing: -0.01em; white-space: nowrap; }

/* ── the fixed ad slot on a strict tab ──
   Free only (the server renders nothing for Pro), flex:none so it never
   takes from the content region, and a reserved min-height so the tab
   does not reflow when the unit arrives. */
.ad-fixed { flex: none; display: flex; justify-content: center; align-items: center;
            min-height: 60px; padding: 4px 0 0; }
.ad-fixed:empty { display: none; }

/* ── building blocks ──────────────────────────────────────────────── */
.section { display: flex; flex-direction: column; gap: 10px; }
.feed-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.feed-news { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.feed-news-scroll { padding-right: 2px; }
#feedList { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
#feedList .story { border: 0; border-radius: 0; }
#feedList .story + .story { border-top: 1px solid var(--line); }
.feed-more { margin: 12px auto; }
.feed-topics { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; margin: 0; }
#feedPanes .seg-btn { flex: 1; min-height: var(--tap); padding: 6px 4px; }
.feed-category-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 var(--gutter); flex: none; }
.feed-category-toggle {
    min-height: 36px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--card); color: var(--text-2);
    font-size: 12px; font-weight: 700; cursor: pointer;
}
.text-link { color: var(--accent); font-size: 13px; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
.global-tile { min-height: 132px; }
.market-search { flex: none; width: 100%; min-height: var(--tap); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.calendar-week { display: flex; flex: none; gap: 3px; overflow-x: auto; }
.calendar-week button { flex: 1 0 44px; min-height: 56px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text-2); font: inherit; font-size: 11px; cursor: pointer; }
.calendar-week b { display: block; font-size: 14px; }
.calendar-week button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.wire-mark { display: flex; align-items: center; justify-content: center; width: 88px; height: 88px; margin: 0 auto 24px; border-radius: 22px; background: var(--brand); color: white; }
.global-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11px; color: var(--muted); }
.global-line > span { min-width: 0; overflow-wrap: anywhere; }
.global-line b { color: var(--text); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.empty .btn { margin-top: 12px; }

.section-label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.card-pad { padding: 14px; }

.rows { overflow: hidden; }
.rows > * + * { border-top: 1px solid var(--line); }

.strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-shrink: 0;
    padding: 6px var(--gutter) 10px;
}

/* let a strip bleed to the screen edge inside a padded scroller */
.strip-bleed { margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }

.chip {
    flex-shrink: 0;
    height: var(--tap);
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: var(--chip-bg);
    color: var(--text-2);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.chip[aria-pressed="true"], .chip.is-on {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}

.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── segmented control ──
   The desk's .pulse-subtabs pill group. Muted text with a rule under it
   reads as a heading, not as something to press, so the open segment is
   filled. Smaller than .chip: this sits inside a card, not on the page. */
.seg {
    display: flex; flex: none; gap: 2px; padding: 3px;
    border: 1px solid var(--line); border-radius: var(--radius-pill);
    background: var(--chip-bg);
    overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
    flex: none; padding: 7px 14px; border: 0; border-radius: var(--radius-pill);
    background: none; color: var(--text-2);
    font: inherit; font-size: 13px; font-weight: 600;
    white-space: nowrap; cursor: pointer;
}
.seg-btn[aria-selected="true"] { background: var(--brand); color: #fff; font-weight: 700; }

/* The panes' own scroll box. The head and the .seg are SIBLINGS of this,
   never inside it, so the figures you are reading the table against stay
   put while the table moves -- same fix as the desk's paneBox(). */
.panes { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pane[hidden] { display: none; }

/* ── compact data scale ──
   Tables and figures only. Prose keeps the 15px body size: 12px is below
   what most people read comfortably, and the Feed is all prose. */
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th {
    position: sticky; top: 0; z-index: 1;
    text-align: left; padding: 6px 8px 6px 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.ptable td {
    padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line);
    font-family: var(--mono); font-size: 12px; white-space: nowrap;
}
.ptable td:first-child { font-family: var(--font); font-size: 13px; white-space: normal; }
.ptable .up { color: var(--up); }
.ptable .down { color: var(--down); }
/* A company's stories and events (mobile.js storyList / eventList). */
.asset-table { padding: 2px 12px; }
.asset-table td { vertical-align: top; }
.asset-table td a { color: inherit; text-decoration: none; font-weight: 600; }
.asset-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

/* ── bottom sheet ──
   A child of <body>, never of .app: .app is overflow:hidden and capped
   at 640px, which would clip the sheet and centre it against the wrong
   box. Primary depth idiom -- tab switches are page loads, so a sheet is
   the only way down that costs no round trip. */
.sheet-scrim {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(8, 12, 22, 0.5);
    opacity: 0; pointer-events: none; transition: opacity var(--motion-content) ease;
}
.sheet-scrim.is-open { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 91;
    display: flex; flex-direction: column;
    max-width: 640px; margin: 0 auto;
    height: min(88dvh, 100dvh - 24px);
    background: var(--card);
    border-radius: 18px 18px 0 0;
    border: 1px solid var(--line); border-bottom: 0;
    transform: translateY(100%); transition: transform var(--motion-overlay) ease;
    padding-bottom: env(safe-area-inset-bottom);
}
.sheet.is-open { transform: translateY(0); }
.sheet-grab { flex: none; display: flex; justify-content: center; padding: 8px 0 4px; touch-action: none; cursor: grab; }
.sheet-grab > span { width: 38px; height: 4px; border-radius: 2px; background: var(--line); }
.sheet-head { flex: none; display: flex; align-items: flex-start; gap: 10px; padding: 2px var(--gutter) 10px; }
.sheet-title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.sheet-sub { font-size: 12px; color: var(--muted); }
.sheet-close { margin-left: auto; width: var(--tap); height: var(--tap); flex: none;
               border: 0; background: transparent; color: var(--text-2); font-size: 24px; cursor: pointer; }
.sheet-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
              gap: 10px; padding: 0 var(--gutter) var(--gutter); }
@media (prefers-reduced-motion: reduce) {
    .sheet, .sheet-scrim { transition: none; }
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 999px;
}

.pill-new { color: var(--down); background: var(--down-bg); border: 1px solid var(--down-brd); }
.pill-new .dot { width: 6px; height: 6px; background: currentColor; }

.tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-2);
    background: var(--up-bg);
    border: 1px solid var(--line);
    padding: 1px 6px;
    border-radius: 4px;
}

.tag-plain { background: transparent; }

.btn {
    height: var(--tap);
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover { background: var(--brand-dark); }

.btn-danger {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--down-brd);
    background: var(--down-bg);
    color: var(--down);
    border-radius: var(--radius);
    font-family: inherit;   /* it is a <button> now, not a link */
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.empty {
    padding: 28px 8px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.note { padding: 8px 0 4px; text-align: center; font-size: 12px; color: var(--muted); }

/* ── Feed ─────────────────────────────────────────────────────────── */
.ticker {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.ticker-name { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ticker-val, .ticker-chg { font-family: var(--mono); font-size: 12px; font-weight: 600; }

.topic {
    flex-shrink: 0;
    width: 210px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.topic-title { font-size: 15px; font-weight: 700; line-height: 20px; }
.topic-foot { display: flex; align-items: center; justify-content: space-between; }
.topic-count { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

.tone { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }

/* ── Hot Topics tab ──
   A card carries what you scan the list for; everything else the topic
   has opens in the sheet. .topic (the Feed's 210px carousel card) is a
   different shape, so this is its own thing rather than a variant. */
.hot-card {
    width: 100%;
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.hot-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.hot-flag {
    font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    color: var(--text-2); background: var(--chip-bg); border: 1px solid var(--line);
}
.hot-flag.is-unusual { color: #b45309; background: var(--warn-bg); border-color: transparent; }
.hot-title { font-size: 16px; font-weight: 700; line-height: 21px; text-wrap: pretty; }
.hot-foot { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* sheet contents */
.hot-why { margin: 0; font-size: 15px; line-height: 1.5; }
.hot-tickers { display: flex; flex-wrap: wrap; gap: 6px; }
.hot-ticker {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--chip-bg);
    font-size: 13px; font-weight: 600;
}
.hot-ticker .up { color: var(--up); font-family: var(--mono); font-size: 12px; }
.hot-ticker .down { color: var(--down); font-family: var(--mono); font-size: 12px; }
.hot-filter { align-self: flex-start; text-decoration: none; display: inline-flex; align-items: center; }
.hot-story-title { font-size: 14px; font-weight: 600; line-height: 19px; }
#topicStories .list-row { flex-direction: column; align-items: flex-start; gap: 4px; text-decoration: none; color: inherit; }
.tone-bullish { color: var(--up); background: var(--up-bg); }
.tone-bearish { color: var(--down); background: var(--down-bg); }
.tone-mixed { color: var(--warn); background: var(--warn-bg); }

.story {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
}

.story-disclosure > summary {
    display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-height: var(--tap);
    padding: 10px 12px; cursor: pointer; list-style: none;
}
.story-disclosure > summary::-webkit-details-marker { display: none; }
.story-details { padding: 0 6px 14px 14px; border-top: 1px solid var(--line); }
.story-open {
    display: inline-flex; align-items: center; min-height: 40px; margin-top: 8px;
    color: var(--brand); font-size: 13px; font-weight: 700;
}

.story-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: var(--tap);
}

.story-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }

.story-source {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-2);
}

.story-age { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--up); }
.story-title-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.story-disclosure[open] .story-title-text { display: block; }
.story-disclosure[open] .story-summary { display: block; }
.story-preview-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 16px; }
.story-preview-meta .story-age { font-size: 10px; }
.story-preview-meta .cat-pill { font-size: 9px; line-height: 14px; padding: 1px 6px; }

/* ── what a story actually carries ──
   The summary, the tagged tickers, the category and the other outlets
   that ran it were all in the response and none of them were rendered. */
.cat-pill {
    font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
    padding: 2px 8px; border-radius: 999px;
    color: var(--text-2); background: var(--chip-bg); border: 1px solid var(--line);
    white-space: nowrap;
}
/* Two lines: enough to tell you whether to open it, not so much that a
   feed of twenty becomes a wall. */
.story-summary {
    margin: 6px 8px 0 0;
    font-size: 14px; line-height: 1.45; color: var(--text-2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.story-assets { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 8px 0 0; }
.asset-chip {
    font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
    color: var(--text-2); background: var(--chip-bg); border: 1px solid var(--line);
}
.asset-chip.tone-bullish { color: var(--up); background: var(--up-bg); border-color: transparent; }
.asset-chip.tone-bearish { color: var(--down); background: var(--down-bg); border-color: transparent; }
.asset-chip.tone-mixed { color: var(--warn); background: var(--warn-bg); border-color: transparent; }

.story-also { margin: 8px 8px 0 0; }
.story-also > summary {
    font-size: 12px; font-weight: 700; color: var(--brand);
    cursor: pointer; list-style: none; padding: 4px 0;
}
.story-also > summary::-webkit-details-marker { display: none; }
.story-also ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.story-also a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.story-also b {
    font-family: var(--mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.story-also span { font-size: 13px; line-height: 18px; }

/* ── Market Chat (a pane in the Feed tab) ──
   A fixed frame inside .app-main.is-fixed: rooms on top, messages in the
   middle doing the scrolling, composer pinned at the foot where a thumb
   is. */
.chat-pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
#chatMessages { display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }

.chat-msg {
    align-self: flex-start; max-width: 88%;
    padding: 8px 12px; border-radius: 14px 14px 14px 4px;
    background: var(--card); border: 1px solid var(--line);
}
.chat-msg.is-mine {
    align-self: flex-end; border-radius: 14px 14px 4px 14px;
    background: var(--brand); border-color: transparent; color: #fff;
}
.chat-msg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.chat-who { font-size: 12px; font-weight: 700; }
.chat-tier {
    font-size: 9px; font-weight: 800; letter-spacing: 0.06em;
    padding: 1px 5px; border-radius: 4px; background: var(--warn-bg); color: #b45309;
}
.chat-asset {
    font-family: var(--mono); font-size: 10px; font-weight: 600;
    padding: 1px 6px; border-radius: 4px; background: var(--chip-bg); color: var(--text-2);
}
.chat-when { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.chat-msg.is-mine .chat-when, .chat-msg.is-mine .chat-who { color: rgba(255, 255, 255, 0.85); }
.chat-body { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }

.chat-compose { display: flex; gap: 8px; align-items: center; }
.chat-compose input {
    flex: 1; min-width: 0; height: var(--tap);
    padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-pill);
    background: var(--card); color: var(--text); font: inherit; font-size: 15px;
}
.chat-compose input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.chat-compose .btn { flex: none; }
.chat-compose .btn:disabled { opacity: .5; }
.chat-meta {
    display: flex; justify-content: space-between;
    font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 4px 2px 0;
}
.chat-meta .is-over { color: var(--down); font-weight: 700; }
.chat-error { margin: 4px 0 0; font-size: 12px; color: var(--down); }
.chat-error[hidden] { display: none; }

.bookmark-btn { color: var(--muted-2); }
.bookmark-btn.is-on { color: var(--brand); }
.bookmark-btn.is-on svg { fill: currentColor; }
.story-age.is-new { color: var(--down); }

.story h2, .story-title {
    margin: 0;
    padding-right: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    text-wrap: pretty;
}

/* ── Markets ──────────────────────────────────────────────────────── */
.quote {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    min-height: var(--tap);
}

.quote-left { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.quote-name { font-size: 15px; font-weight: 700; }
.quote-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quote-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.quote-val { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.quote-chg { font-family: var(--mono); font-size: 12px; font-weight: 600; }

/* Calendar: compact picker plus one day's events in a fixed frame. */
.cal-pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
#calEvents { display: flex; flex-direction: column; gap: 10px; }
button.event { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.event-co { font-size: 11px; color: var(--text-2); font-weight: 600; }
.evt-co { margin: 0; font-size: 15px; font-weight: 700; }

/* ── Live Wire ── */
a.post { text-decoration: none; color: inherit; }
.post-who { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }

/* ── Settings ── */
.plan-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── the drill-down page ── */
.chart-host { height: 220px; margin: 10px 0 4px; }
.tv-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 10px; }
.tv-stat { display: flex; flex-direction: column; gap: 2px; }
.tv-stat-label {
    font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--muted);
}
.tv-stat b { font-family: var(--mono); font-size: 15px; font-weight: 600; }

/* Mention volume, not price: a run of bars, deliberately unlike a chart
   so it is not read as one. */
.trend { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin: 6px 0 2px; }
.trend > i { flex: 1; min-width: 2px; background: var(--brand); border-radius: 2px 2px 0 0; opacity: .75; }

#assetBody { display: flex; flex-direction: column; gap: 8px; }
#assetBody .section-label { margin-top: 6px; }
.app-sub.up { color: var(--up); font-family: var(--mono); font-weight: 600; }
.app-sub.down { color: var(--down); font-family: var(--mono); font-weight: 600; }
a.asset-chip, a.hot-ticker, a.quote { text-decoration: none; color: inherit; }
a.quote { display: flex; }

/* ── Markets: panes, sparklines, the picker ── */
.mk-watch { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.watch-row { text-decoration: none; color: inherit; }
#watchBody .list-row { flex-direction: column; align-items: flex-start; gap: 4px; }
.settings-watchlist { max-height: 300px; overflow-y: auto; }

/* A month of closes at 56px: enough shape to read beside the number. */
.spark { display: block; width: 56px; height: 20px; flex: none; margin-top: 2px; }

.pick-row { gap: 12px; }
.pick-name { display: block; font-size: 15px; font-weight: 600; }
.pick-sym {
    display: block; font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
/* A native checkbox, scaled to the tap target. The .switch in this file
   wants a button with its own nested spans; a label-wrapped input is
   fewer parts and gets keyboard and screen-reader behaviour for free. */
.pick-box { flex: none; width: 24px; height: 24px; accent-color: var(--brand); }
.pick-box:disabled { opacity: .45; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-name { font-size: 14px; font-weight: 700; }
.tile-val { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.tile-chg { font-family: var(--mono); font-size: 12px; font-weight: 600; }

/* Market Pulse: NSE and global datasets share one scrolling card. */
.tile-grid { flex: 1 1 auto; min-height: 0; align-content: start; }
.pulse-combined { padding: 0 12px 12px; }
.pulse-section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 12px 2px 8px; font-weight: 800;
}
.pulse-section-head small { color: var(--muted); font-size: 11px; font-weight: 600; }
.pulse-combined .tile { background: var(--bg); padding: 12px; gap: 6px; }
.pulse-combined .tile-name { font-size: 12px; }
@media (max-width: 350px) { .pulse-combined .grid-2 { grid-template-columns: 1fr; } }
button.tile { text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.tile:disabled { cursor: default; opacity: .75; }
.tile-sub { font-size: 12px; color: var(--muted); }
.tile-val.up { color: var(--up); }
.tile-val.down { color: var(--down); }
.tile-wide { grid-column: 1 / -1; }
.tile-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tile-chips > span { font-family: var(--mono); font-size: 11px; font-weight: 600;
                     padding: 2px 7px; border-radius: 6px; background: var(--chip-bg); }

.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 8px; border-radius: 4px; }

.breadth { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.breadth-legend { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; font-weight: 600; }

.flow { display: flex; flex-direction: column; gap: 6px; }
.flow-head { display: flex; justify-content: space-between; align-items: baseline; }
.flow-name { font-size: 13px; color: var(--text-2); }
.flow-val { font-family: var(--mono); font-size: 13px; font-weight: 600; }

/* ── Calendar ─────────────────────────────────────────────────────── */
.calendar-picker {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; min-height: 48px; padding: 6px 12px;
    font-size: 13px; font-weight: 700;
}
.calendar-picker input {
    min-width: 150px; padding: 7px 9px; border: 1px solid var(--line);
    border-radius: 9px; background: var(--bg); color: var(--text); font: inherit;
}
.event { padding: 14px; display: flex; gap: 14px; }
.event-time { width: 52px; flex-shrink: 0; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 18px; }
.event-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.event-title { font-size: 15px; font-weight: 700; line-height: 20px; }
.event-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.event-cat {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--chip-bg); font-size: 12px; font-weight: 700;
}
.event-cat .dot { width: 8px; height: 8px; }
.event-origin { font-size: 12px; color: var(--muted); }

/* ── Live Wire ────────────────────────────────────────────────────── */
.live-toggle {
    height: var(--tap);
    padding: 0 14px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.live-toggle[aria-checked="true"] {
    border-color: var(--up);
    background: var(--up-bg);
    color: var(--up);
}

.live-toggle .dot { width: 8px; height: 8px; background: currentColor; }

.post { padding: 14px; display: flex; gap: 12px; }

.avatar {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--avatar);
    color: var(--avatar-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800;
}

.post-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.post-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.post-who { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex-wrap: wrap; }
.post-name { font-size: 14px; font-weight: 700; }
.post-handle { font-size: 13px; color: var(--muted); }
.post-age { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--up); flex-shrink: 0; }
.post-text { margin: 0; font-size: 15px; line-height: 22px; text-wrap: pretty; }

/* a locked band: the Live Wire for someone on Free */
.locked { padding: 32px 20px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.locked h2 { margin: 0; font-size: 18px; font-weight: 800; }
.locked p { margin: 0; color: var(--muted); font-size: 14px; }

/* ── Settings ─────────────────────────────────────────────────────── */
.who { display: flex; align-items: center; gap: 14px; }
.who .avatar { width: 52px; height: 52px; font-size: 20px; }
.who-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.who-name { font-size: 16px; font-weight: 700; }
.who-mail { font-size: 13px; color: var(--text-2); word-break: break-all; }

.plan-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding-top: 14px; border-top: 1px solid var(--line);
}

.plan-label { font-size: 12px; color: var(--muted); }
.plan-name { font-size: 15px; font-weight: 700; }

.list-row {
    width: 100%;
    min-height: 56px;
    padding: 0 14px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.list-value { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; font-weight: 500; }

.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.theme-opt {
    padding: 8px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
}

.theme-opt[aria-checked="true"] { border-color: var(--brand); }

.theme-swatch {
    height: 64px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 5px;
    padding: 10px;
}

.theme-swatch > span { height: 5px; border-radius: 3px; }
.theme-swatch > span:first-child { width: 60%; }
.theme-swatch > span:last-child { width: 36%; }

.theme-sys { background: linear-gradient(135deg, #f7f8fa 50%, #0a0e18 50%); }
.theme-sys > span { background: #8a96ad; }
.theme-light { background: #f7f8fa; }
.theme-light > span { background: #cbd5e1; }
.theme-dark { background: #0a0e18; }
.theme-dark > span { background: #2a3a5c; }

.theme-name {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 22px; font-size: 14px; font-weight: 600;
}

.theme-opt[aria-checked="true"] .theme-name { font-weight: 700; }
.theme-opt .tick { display: none; }
.theme-opt[aria-checked="true"] .tick { display: block; }

.switch { width: 64px; height: var(--tap); border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.switch > span { width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); display: flex; align-items: center; padding: 0 3px; }
.switch > span > span { width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.switch[aria-checked="true"] > span { background: var(--brand); justify-content: flex-end; }

/* ── search (Feed) ────────────────────────────────────────────────── */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.search-row { padding: 4px var(--gutter) 6px; flex-shrink: 0; }

.search-row input {
    width: 100%;
    height: var(--tap);
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: 15px;
}

.search-row input::placeholder { color: var(--muted); }

/* a Hot Topic card is a filter button: strip the UA's button look */
.topic { font: inherit; }
.topic[aria-pressed="true"] { border-color: var(--brand); }

/* ── auth (the app's first screen) ────────────────────────────────── */
.auth {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 640px;
    margin: 0 auto;
    padding: calc(40px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
}

.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
.auth-brand .brand-name { font-size: 20px; }

.auth-head { margin-top: 44px; display: flex; flex-direction: column; gap: 8px; }
.auth-head h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 38px; }
.auth-head p { margin: 0; font-size: 15px; line-height: 22px; color: var(--text-2); }

.auth-form { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text-2); }

.field input {
    height: 52px;
    padding: 0 16px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    font: inherit;
    font-size: 16px;   /* 16px or iOS zooms the page on focus */
    width: 100%;
}

.field input::placeholder { color: var(--muted-2); opacity: 1; }

.auth-link { min-height: var(--tap); display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; color: var(--accent); }

.auth-check {
    min-height: var(--tap);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-2);
    cursor: pointer;
}

.auth-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }

.btn-block {
    height: 52px;
    width: 100%;
    border: 0;
    border-radius: 26px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-block:hover { background: var(--brand-dark); }

.btn-ghost-block {
    height: 52px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line-2);
    border-radius: 26px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.auth-or { margin: 22px 0; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.auth-or span { flex: 1; height: 1px; background: var(--line); }

.auth-foot { margin-top: auto; padding-top: 24px; text-align: center; font-size: 14px; color: var(--text-2); }
.auth-foot a { display: inline-block; padding: 12px 4px; font-weight: 700; color: var(--accent); }

.auth-skip { margin-top: 14px; text-align: center; }
.auth-skip a { display: inline-block; min-height: var(--tap); padding: 12px 16px; font-size: 14px; font-weight: 700; color: var(--muted); }

.auth-error {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--down-bg);
    border: 1px solid var(--down-brd);
    color: var(--down);
    font-size: 14px;
    font-weight: 600;
}

/* ── ads (free readers only — templates/_ads.html) ───────────────── */
.ad-slot {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 5px 6px 6px;
    overflow: hidden;
}

/* Labelled, always: a desk that blurs a story and an ad loses trust. */
.ad-label {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.ad-slot .adsbygoogle { min-height: 50px; }

/* Account-level notification settings: the blue rail and tinted icon area
   keep the controls visually distinct from ordinary navigation rows. */
.notification-settings { overflow: hidden; border-color: var(--line); }
.notification-setting-row {
    position: relative; display: flex; align-items: center; gap: 12px;
    min-height: 64px; padding: 10px 14px 10px 18px;
    background: linear-gradient(90deg, var(--sel-bg), transparent 42%);
    border-bottom: 1px solid var(--line);
}
.notification-setting-row::before {
    content: ""; position: absolute; inset: 10px auto 10px 0; width: 4px;
    border-radius: 0 4px 4px 0; background: var(--brand);
}
.notification-setting-copy { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.notification-setting-copy strong { font-size: 14px; }
.notification-setting-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.setting-switch { position: relative; flex: none; width: 44px; height: 26px; }
.setting-switch input { position: absolute; opacity: 0; pointer-events: none; }
.setting-switch > span[aria-hidden] {
    display: block; width: 100%; height: 100%; border-radius: 999px;
    background: var(--line); transition: background var(--motion-content);
}
.setting-switch > span[aria-hidden]::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(11,23,51,.25);
    transition: transform var(--motion-content);
}
.setting-switch input:checked + span { background: var(--brand); }
.setting-switch input:checked + span::after { transform: translateX(18px); }
.setting-switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.notification-categories {
    width: 100%; min-height: 42px; padding: 8px 14px 8px 18px; border: 0;
    border-bottom: 1px solid var(--line); background: var(--card); color: var(--text);
    display: flex; align-items: center; justify-content: space-between; font: inherit;
    font-size: 12px; font-weight: 700; cursor: pointer;
}
.notification-status { margin: 0; padding: 9px 14px; color: var(--muted); font-size: 11px; }
.notification-status.is-error { color: var(--down); }
.notification-signin { display: flex; flex-direction: column; gap: 4px; padding: 16px; color: inherit; text-decoration: none; }
.notification-signin strong { color: var(--brand); }
.notification-signin span { color: var(--muted); font-size: 12px; }
.notification-category-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.notification-category-list label { display: flex; align-items: center; gap: 10px; min-height: 42px; font-size: 14px; }

/* templates/_company_events.html: a company's event history (api/seo.py) */
.company-seo-events { margin: 8px 0; font-size: 13px; color: var(--text-2); }
.company-seo-events summary { padding: 12px 0; cursor: pointer; font-weight: 600; color: var(--accent); }
.company-seo-events table { width: 100%; border-collapse: collapse; }
.company-seo-events th, .company-seo-events td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); text-align: left; }
.company-seo-events th { font-weight: 600; color: var(--muted); }
/* templates/_company_next.html: one swipeable row, so the chart stays near the top */
.company-next { margin: 0 0 10px; font-size: 13px; }
.company-next h2 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.company-next-peers { display: flex; gap: 6px; margin: 0 0 8px; padding: 0 0 2px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.company-next-peers li { flex: none; }
.company-next-peers a { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--text); text-decoration: none; white-space: nowrap; }
.company-next-peers span { color: var(--muted); }
.company-next-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.company-next-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); text-decoration: none; }
.company-next-card span { color: var(--muted); font-size: 12px; }

/* Week ahead in Learn, and its one-line teaser on the Feed. */
.week-card { margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text-2); font-size: 13px; line-height: 1.55; }
.week-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.week-card-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.week-card-nav { display: flex; gap: 12px; font-size: 12px; }
.week-card a { color: var(--accent); }
.week-card-summary { margin: 6px 0 0; }
.week-card-note { margin-top: 10px; color: var(--text); }
.week-card-note p { margin: 0 0 8px; }
.week-card-section { margin: 14px 0 4px; font-size: 14px; color: var(--text); }
.week-list { margin: 0; padding-left: 18px; }
.week-list-period, .week-card-fine { color: var(--muted); }
.week-card-more summary { padding: 8px 0; cursor: pointer; font-weight: 600; color: var(--accent); }
.week-card-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 6px 0 0; }
.week-card-open { padding: 6px 0; font-weight: 600; }
.week-teaser { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0 var(--gutter) 6px; padding: 8px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text-2); font-size: 12px; text-decoration: none; }
.week-teaser strong { color: var(--accent); }

/* Learn screen (templates/mobile/learn.html) */
.learn-tabs { display: flex; flex: none; gap: 8px; padding: 6px var(--gutter) 10px; }
.learn-tabs a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-2); font-weight: 700; }
.learn-tabs a[aria-selected="true"] { background: var(--sel-bg); border-color: var(--brand); color: var(--brand); }
.learn-week-panel > .week-card { margin: 0 var(--gutter) 12px; }
.learn-item { display: flex; flex-direction: column; gap: 2px; margin: 0 var(--gutter) 8px; padding: 12px 14px; color: var(--text-2); font-size: 13px; text-decoration: none; }
.learn-item strong { color: var(--text); font-size: 14px; }
.learn-article { padding: 4px var(--gutter) 16px; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.learn-article h2 { margin: 24px 0 6px; font-size: 18px; color: var(--text); }
.learn-article a { color: var(--accent); }
.learn-article table { width: 100%; border-collapse: collapse; font-size: 13px; }
.learn-article th, .learn-article td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.learn-title { margin: 0 0 10px; font-size: 22px; line-height: 1.25; color: var(--text); }
.learn-meta, .learn-fine { color: var(--muted); font-size: 12px; }
.learn-cta { padding: 10px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 12%, transparent); }
