/* Creator Hub: one stylesheet for every page (cached; was inline in base.html).
   Tokens first, then the shell (sidebar + content), then components.
   Existing class names (.card .pill .muted .flash .scroll ...) keep working. */

/* Light is the default. Dark is its own set of steps (not an automatic
   flip): it follows the OS setting unless the viewer picks one with the
   theme switch, which sets data-theme on <html> (base.html). */
:root {
  color-scheme: light;
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --field: #fcfcfd;
  --border: #e6e6ec;
  --border-strong: #d3d3db;
  --line: #eeeef2;
  --row-hover: #fafbff;
  --ink: #16161d;
  --ink-2: #44444f;
  --ink-muted: #6b6b7b;
  --inverse: #16161d;
  --on-inverse: #ffffff;
  --accent: #2a67e0;          /* links: 4.7:1 on the page background (was 4.2) */
  --accent-hover: #1f52b8;
  --accent-fill: #2f6feb;
  --accent-fill-hover: #2559c4;
  --on-accent: #ffffff;
  --accent-soft: #eef4ff;
  --accent-border: #d4e0fc;
  --accent-ink: #1e40af;
  --disabled: #a8bff2;
  --series-1: #2a78d6;
  --series-neg: #e34948;
  --chart-label: #44444f;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #1c5cab;
  --seq-ink-1: #16161d; --seq-ink-2: #16161d; --seq-ink-3: #16161d; --seq-ink-4: #0b0b10; --seq-ink-5: #ffffff;
  --chart-grid: #eeeef2;
  --chart-ink: #6b6b7b;
  --good: #067647;
  --good-soft: #ecfdf3;
  --good-ink: #05603a;
  --good-border: #a6f4c5;
  --bad: #b42318;
  --bad-hover: #912018;
  --bad-soft: #fef3f2;
  --bad-ink: #912018;
  --bad-border: #fecdca;
  --warn: #93370d;
  --warn-soft: #fffaeb;
  --warn-border: #fedf89;
  --role-owner: #f4ebff; --role-owner-ink: #53389e; --role-owner-border: #d9d6fe;
  --role-member: #f2f4f7; --role-member-ink: #344054; --role-member-border: #d0d5dd;
  --side: #16161d;
  --side-ink: #b9b9c6;
  --side-muted: #85859a;
  --side-hover: #20202a;
  --side-active: #2b2b36;
  --side-line: #2b2b36;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 16, 29, 0.04);
  --shadow-up: 0 -2px 12px rgba(16, 16, 29, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f14; --surface: #18181f; --surface-2: #1f1f28; --field: #14141a;
    --border: #2c2c37; --border-strong: #3d3d4a; --line: #25252f; --row-hover: #1d1d27;
    --ink: #ececf1; --ink-2: #c6c6d1; --ink-muted: #9c9cab;
    --inverse: #ececf1; --on-inverse: #16161d;
    --accent: #7aa5f7; --accent-hover: #a3c1fa; --accent-fill: #2f6feb; --accent-fill-hover: #4a82ee;
    --on-accent: #ffffff; --accent-soft: #16223d; --accent-border: #26396a; --accent-ink: #bcd0fb;
    --disabled: #2d3d63;
    --series-1: #3987e5; --chart-grid: #2a2a35; --chart-ink: #9c9cab;
    --series-neg: #e66767; --chart-label: #c6c6d1;
    --seq-1: #1a2a42; --seq-2: #1c4174; --seq-3: #25599f; --seq-4: #3987e5; --seq-5: #86b6ef;
    --seq-ink-1: #ececf1; --seq-ink-2: #ececf1; --seq-ink-3: #ffffff; --seq-ink-4: #0b0b10; --seq-ink-5: #0f0f14;
    --good: #47cd89; --good-soft: #0f2a1d; --good-ink: #7ee2aa; --good-border: #1f5a3c;
    --bad: #f97066; --bad-hover: #fda29b; --bad-soft: #2e1515; --bad-ink: #fda29b; --bad-border: #5f2522;
    --warn: #fdb022; --warn-soft: #2b2110; --warn-border: #5b4313;
    --role-owner: #231a3d; --role-owner-ink: #c5b8fb; --role-owner-border: #3d2f6b;
    --role-member: #20242c; --role-member-ink: #c3cad6; --role-member-border: #39404c;
    --side: #0a0a0e; --side-ink: #b9b9c6; --side-muted: #7e7e92; --side-hover: #17171f;
    --side-active: #23232d; --side-line: #23232d;
    --shadow: none; --shadow-up: 0 -2px 12px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f14; --surface: #18181f; --surface-2: #1f1f28; --field: #14141a;
  --border: #2c2c37; --border-strong: #3d3d4a; --line: #25252f; --row-hover: #1d1d27;
  --ink: #ececf1; --ink-2: #c6c6d1; --ink-muted: #9c9cab;
  --inverse: #ececf1; --on-inverse: #16161d;
  --accent: #7aa5f7; --accent-hover: #a3c1fa; --accent-fill: #2f6feb; --accent-fill-hover: #4a82ee;
  --on-accent: #ffffff; --accent-soft: #16223d; --accent-border: #26396a; --accent-ink: #bcd0fb;
  --disabled: #2d3d63;
  --series-1: #3987e5; --chart-grid: #2a2a35; --chart-ink: #9c9cab;
  --series-neg: #e66767; --chart-label: #c6c6d1;
  --seq-1: #1a2a42; --seq-2: #1c4174; --seq-3: #25599f; --seq-4: #3987e5; --seq-5: #86b6ef;
  --seq-ink-1: #ececf1; --seq-ink-2: #ececf1; --seq-ink-3: #ffffff; --seq-ink-4: #0b0b10; --seq-ink-5: #0f0f14;
  --good: #47cd89; --good-soft: #0f2a1d; --good-ink: #7ee2aa; --good-border: #1f5a3c;
  --bad: #f97066; --bad-hover: #fda29b; --bad-soft: #2e1515; --bad-ink: #fda29b; --bad-border: #5f2522;
  --warn: #fdb022; --warn-soft: #2b2110; --warn-border: #5b4313;
  --role-owner: #231a3d; --role-owner-ink: #c5b8fb; --role-owner-border: #3d2f6b;
  --role-member: #20242c; --role-member-ink: #c3cad6; --role-member-border: #39404c;
  --side: #0a0a0e; --side-ink: #b9b9c6; --side-muted: #7e7e92; --side-hover: #17171f;
  --side-active: #23232d; --side-line: #23232d;
  --shadow: none; --shadow-up: 0 -2px 12px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       background: var(--bg); color: var(--ink); line-height: 1.55; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* ---- shell ------------------------------------------------------------------ */
/* The dock and its menu are in glass.css (the sidebar went on 2026-10-11). */

.main { min-width: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 1.75rem 2rem 2.5rem; }
.wrap.narrow { max-width: 940px; }
.footer { text-align: center; margin-top: 2.5rem; font-size: 0.8rem; color: var(--ink-muted); }
@media (max-width: 860px) { .wrap { padding: 1.25rem 1rem 2rem; } }

/* ---- page header, tabs, filters -------------------------------------------- */

.pagehead { display: flex; align-items: flex-end; justify-content: space-between;
            gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.pagehead h1 { margin: 0; }
.pagehead .sub { color: var(--ink-muted); font-size: 0.88rem; margin-top: 0.15rem; }
.crumbs { font-size: 0.82rem; color: var(--ink-muted); margin-bottom: 0.35rem; }
.crumbs a { color: var(--ink-muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border);
        margin-bottom: 1.2rem; overflow-x: auto; }
.tabs a { padding: 0.55rem 0.85rem; text-decoration: none; color: var(--ink-muted);
          font-size: 0.92rem; font-weight: 500; border-bottom: 2px solid transparent;
          margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* A segmented control built from links: the range filter. */
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border);
             border-radius: 8px; padding: 2px; max-width: 100%; overflow-x: auto;
             scrollbar-width: none; }
.segmented a { padding: 0.3rem 0.75rem; font-size: 0.84rem; color: var(--ink-2);
               text-decoration: none; border-radius: 6px; font-weight: 500; white-space: nowrap; }
.segmented a:hover { background: var(--surface-2); color: var(--ink); }
.segmented a.active { background: var(--inverse); color: var(--on-inverse); }
.filters { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
           margin-bottom: 1.1rem; }
.filters .note { color: var(--ink-muted); font-size: 0.82rem; }

/* ---- cards, tiles ------------------------------------------------------------ */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 1.25rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card > h2:first-child, .cardhead { margin-bottom: 0.8rem; }
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem;
            flex-wrap: wrap; }
.cardhead h2 { margin: 0; }
.cardhead .aside { font-size: 0.82rem; color: var(--ink-muted); }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
         gap: 0.8rem; margin-bottom: 1.1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 0.9rem 1rem; box-shadow: var(--shadow); }
.tile .label { font-size: 0.8rem; color: var(--ink-muted); }
.tile .value { font-size: 1.55rem; font-weight: 650; line-height: 1.25; margin-top: 0.15rem; }
.tile .foot { font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.2rem; }

/* Change against the previous period: arrow + sign + words, never colour alone. */
.delta { font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--ink-muted); font-weight: 500; }

.brief { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--radius);
         padding: 0.9rem 1.05rem; }
.brief .headline { font-weight: 650; margin-bottom: 0.4rem; }
.brief ul { margin-left: 1.1rem; font-size: 0.92rem; }
.brief li { margin-bottom: 0.2rem; }
.brief .meta { font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.5rem; }
.brief .check-ok { color: var(--good); }
.brief .check-bad { color: var(--warn); }

.empty { color: var(--ink-muted); font-size: 0.9rem; padding: 0.4rem 0; }

/* ---- type, forms -------------------------------------------------------------- */

h1 { font-size: 1.4rem; margin-bottom: 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.02rem; margin-bottom: 0.75rem; }
label { display: block; font-weight: 600; font-size: 0.88rem; margin: 0.9rem 0 0.3rem; }
input[type=text], input[type=password], input[type=file], input[type=url],
input[type=email], textarea, select {
  width: 100%; padding: 0.55rem; border: 1px solid var(--border-strong); border-radius: 7px;
  font: inherit; background: var(--field); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
button { margin-top: 1.1rem; padding: 0.6rem 1.2rem; background: var(--accent-fill); color: var(--on-accent);
         border: none; border-radius: 7px; font-size: 0.95rem; font-weight: 600; cursor: pointer; }
button:disabled { background: var(--disabled); cursor: not-allowed; }
button:hover:not(:disabled) { background: var(--accent-fill-hover); }
button.small { margin: 0; padding: 0.3rem 0.8rem; font-size: 0.8rem; }
button.quiet { background: var(--surface); color: var(--ink-2); border: 1px solid var(--border-strong); }
button.quiet:hover:not(:disabled) { background: var(--surface-2); }

/* ---- tables ---------------------------------------------------------------------- */

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 460px; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line);
         vertical-align: top; }
th { color: var(--ink-muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase;
     letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--row-hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { display: block; font-size: 0.78rem; color: var(--ink-muted); }

/* ---- small parts ------------------------------------------------------------------- */

.pill { display: inline-block; padding: 0.08rem 0.55rem; border-radius: 999px; white-space: nowrap;
        font-size: 0.76rem; border: 1px solid var(--border); background: var(--surface-2); }
.ok { background: var(--good-soft); color: var(--good-ink); border-color: var(--good-border); }
.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: var(--bad-border); }
.muted { color: var(--ink-muted); font-size: 0.85rem; }
.flash { background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-ink);
         padding: 0.6rem 0.9rem; border-radius: 7px; margin-bottom: 0.8rem; font-size: 0.9rem; }
.checkline { display: flex; align-items: center; gap: 0.5rem; font-weight: 500;
             margin: 0.35rem 0; font-size: 0.9rem; }
.checkline input { width: auto; }
.consent { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
           padding: 0.75rem; margin-top: 1rem; font-size: 0.85rem; color: var(--ink-2); }
.preview { max-width: 260px; border-radius: 8px; margin-top: 0.6rem; display: block; }
details > summary { cursor: pointer; }
[hidden] { display: none !important; }

/* ---- page actions, lists, search, pager (Home / Posts / Compose) ------------ */

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: 0.5rem 1rem; background: var(--accent-fill); color: var(--on-accent);
       border-radius: 7px; font-size: 0.9rem; font-weight: 600; text-decoration: none;
       border: 1px solid transparent; }
.btn:hover { background: var(--accent-fill-hover); color: var(--on-accent); }
.btn.quiet { background: var(--surface); color: var(--ink-2); border-color: var(--border-strong); }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); }
a.tile.link { text-decoration: none; color: inherit; transition: border-color 0.12s; }
a.tile.link:hover { border-color: var(--accent); }

.list { list-style: none; }
.list > li { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
           padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: none; }
.grow { flex: 1; min-width: 180px; }
.sub { display: block; font-size: 0.78rem; color: var(--ink-muted); }
.rowform { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; width: 100%; }
.rowform button { margin: 0; }
td .pill { margin: 0 0.15rem 0.15rem 0; }

.search input { width: 240px; max-width: 100%; padding: 0.38rem 0.6rem; font-size: 0.88rem;
                border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); }
.pager { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-top: 0.4rem; }

/* Compose: numbered steps, and the publish bar that keeps TikTok's
   declaration beside the button. */
.step { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--inverse); color: var(--on-inverse);
           font-size: 0.78rem; font-weight: 700; display: inline-flex; align-items: center;
           justify-content: center; flex: none; }
.step h2 { margin: 0; }
.choice { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
          border-radius: 8px; padding: 2px; margin: 0.4rem 0 0.2rem; }
.choice button { margin: 0; background: transparent; color: var(--ink-2); font-size: 0.85rem;
                 font-weight: 500; padding: 0.32rem 0.8rem; border-radius: 6px; }
.choice button:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.choice button[aria-pressed="true"] { background: var(--inverse); color: var(--on-inverse); }
.brand-group { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem;
               margin-bottom: 0.7rem; background: var(--surface-2); }
.publishbar { position: sticky; bottom: 0; background: var(--surface); border: 1px solid var(--border);
              border-radius: var(--radius); padding: 0.9rem 1.1rem; box-shadow: var(--shadow-up);
              display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.publishbar .consent { margin: 0; flex: 1; min-width: 240px; }
.publishbar button { margin: 0; }
@media (max-width: 860px) {
  /* A sticky bar eats a quarter of a phone screen: at the end of the form instead. */
  .publishbar { position: static; box-shadow: var(--shadow); }
}

/* ---- detail pages: main + side column, fields, facts ------------------------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.1rem; align-items: start; }
.sidecol .card { margin-bottom: 1rem; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } }
h3 { font-size: 0.9rem; margin: 1rem 0 0.35rem; color: var(--ink-2); }
.section + .section { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 0.4rem; }
.field { margin-top: 0.8rem; }
.fieldhead { display: flex; align-items: center; justify-content: space-between;
             font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.3rem; }
.uploadline { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
              padding: 0.6rem 0; border-top: 1px solid var(--line); }
.uploadline form button { margin: 0; }
.stills { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; }
.stills img { width: 100%; border-radius: 6px; border: 1px solid var(--border); }
.chips .pill { margin: 0 0.2rem 0.3rem 0; }
pre.quote { white-space: pre-wrap; font: inherit; font-size: 0.88rem; background: var(--surface-2);
            border: 1px solid var(--border); border-radius: 7px; padding: 0.6rem 0.75rem; }
.swatch { display: inline-block; width: 0.9rem; height: 0.9rem; border: 1px solid var(--border-strong);
          border-radius: 3px; vertical-align: middle; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.9rem; font-size: 0.9rem; }
.facts dt { color: var(--ink-muted); }
.value.big { font-size: 1.8rem; font-weight: 650; line-height: 1.2; }
.tabs a[href^="#"] { border-bottom-color: transparent; }
button.danger, .btn.danger { background: var(--bad); color: #fff; }
button.danger:hover:not(:disabled), .btn.danger:hover { background: var(--bad-hover); color: #fff; }
/* Destructive but rare: grey until hovered, so a table of them is not a wall of red. */
button.quiet.danger { background: var(--surface); color: var(--ink-muted); border: 1px solid var(--border-strong); }
button.quiet.danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-border); }
.btn.small { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.inline { display: inline; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.options { margin-top: 0.2rem; }
.options .checkline { align-items: flex-start; font-weight: 400; }
.options .checkline input { margin-top: 0.3rem; }
/* Clipper: a 9:16 preview beside its edit form, never a screen-high picture. */
.source-video { width: 100%; max-height: 260px; border-radius: 8px; background: var(--side); }
.clipgrid { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-top: 0.6rem; }
.clip-video { width: 180px; max-height: 320px; border-radius: 8px; background: var(--side); }
.sendbox { border-top: 1px solid var(--border); margin-top: 0.9rem; padding-top: 0.7rem; }

/* ---- admin ---------------------------------------------------------------------- */
.role-owner { background: var(--role-owner); color: var(--role-owner-ink); border-color: var(--role-owner-border); }
.role-admin { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.role-premium { background: var(--good-soft); color: var(--good-ink); border-color: var(--good-border); }
.role-member { background: var(--role-member); color: var(--role-member-ink); border-color: var(--role-member-border); }
.hot { color: var(--bad); }
.meter { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 0.35rem 0 0.8rem; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter span.hot { background: var(--bad); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; }
.row > div { flex: 1 1 160px; }
.divided { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 0.9rem; }
input[type=number] { width: 100%; padding: 0.55rem; border: 1px solid var(--border-strong); border-radius: 7px;
                     font: inherit; background: var(--field); color: var(--ink); }
pre.detail { white-space: pre-wrap; word-break: break-word; font-size: 0.78rem; color: var(--ink-2); }
.inlineform { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.6rem; }
.inlineform input { max-width: 260px; }
.inlineform button { margin: 0; }
.actions form { margin: 0; }
.actions button { margin: 0; }
.inlineform select { width: auto; }
.flash.error { background: var(--bad-soft); border-color: var(--bad-border); color: var(--bad-ink); }

/* ---- theme switch (in the More menu; colours in glass.css) ------------------------ */
.theme { display: flex; gap: 2px; border-radius: 8px; padding: 2px; margin: 0.6rem 0 0.8rem; }
.theme button { flex: 1; margin: 0; padding: 0.28rem 0; background: transparent;
                font-size: 0.76rem; font-weight: 500; border-radius: 6px; }

/* ---- Insights: word cloud and the day x time heat grid ------------------------- */
/* Words are TEXT, so they wear text tokens (4.5:1), not the bar colours. */
.cloud { line-height: 2.1; text-align: center; padding: 0.4rem 0 0.8rem; }
.cloud .word { display: inline-block; margin: 0 0.35rem; font-weight: 600; cursor: default;
               white-space: nowrap; }
.cloud .word.up { color: var(--accent); }
.cloud .word.down { color: var(--bad); }
.cloud .word.flat { color: var(--ink-muted); font-weight: 500; }
.legend { font-weight: 600; white-space: nowrap; }
.legend.up { color: var(--accent); }
.legend.down { color: var(--bad); }
.legend.flat { color: var(--ink-muted); }
table.heat { min-width: 420px; border-collapse: separate; border-spacing: 3px; }
table.heat td, table.heat th { border: none; }
table.heat td { border-radius: 6px; padding: 0.45rem 0.5rem; text-align: center; min-width: 78px; }
table.heat td .sub { color: inherit; opacity: 0.8; }
table.heat tbody tr:hover td { background: revert-layer; }
table.heat td.step-0 { background: var(--surface-2); }
table.heat td.step-1 { background: var(--seq-1); color: var(--seq-ink-1); }
table.heat td.step-2 { background: var(--seq-2); color: var(--seq-ink-2); }
table.heat td.step-3 { background: var(--seq-3); color: var(--seq-ink-3); }
table.heat td.step-4 { background: var(--seq-4); color: var(--seq-ink-4); }
table.heat td.step-5 { background: var(--seq-5); color: var(--seq-ink-5); }

/* Numbered how-to steps inside a card (Clipper's Drive link). */
ol.steps { margin: 0.4rem 0 0.9rem; padding-left: 1.2rem; }
ol.steps li { margin: 0.3rem 0; line-height: 1.45; }

/* "How?" bubble: a small button fixed at the bottom right of every page that
   opens a short plain-words note about the page (app/web/how.py). */
.how { position: fixed; right: 1rem; bottom: 1rem; z-index: 30; }
.how > summary { list-style: none; cursor: pointer; padding: 0.45rem 0.9rem; border-radius: 999px;
                 background: var(--surface); color: var(--ink-2); border: 1px solid var(--border-strong);
                 box-shadow: var(--shadow); font-size: 0.85rem; font-weight: 600; user-select: none; }
.how > summary::-webkit-details-marker { display: none; }
.how > summary:hover, .how[open] > summary { color: var(--accent); border-color: var(--accent-border); }
.how-bubble { position: absolute; right: 0; bottom: calc(100% + 0.6rem); width: min(22rem, calc(100vw - 2rem));
              max-height: 70vh; overflow: auto; background: var(--surface); color: var(--ink);
              border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem;
              box-shadow: var(--shadow-up); font-size: 0.9rem; line-height: 1.45; }
.how-bubble p { margin: 0.4rem 0 0; }
.how-bubble a { display: inline-block; margin-top: 0.6rem; font-size: 0.82rem; }
@media print { .how { display: none; } }
/* Room at the end of the page, so the button never sits on the last line. */
body:has(.how) .footer { padding-bottom: 3rem; }
