  /* ---- tokens: light (bare :root defines the complete palette) ---- */
  :root {
    --bg:        #f6f8fb;
    --surface:   #ffffff;
    --surface-2: #f0f3f8;
    --hair:      #e4e8ef;
    --hair-strong:#d3d9e3;
    --ink:       #161a22;
    --muted:     #5b6675;
    --faint:     #8a94a4;
    --accent:    #2b57d6;
    --accent-ink:#ffffff;
    --accent-soft:#e7edfc;
    --focus:     #2b57d6;

    /* semantic status language (fg + soft tint), independent of the accent */
    --st-p:   #1f8a4c;  --st-p-bg:   #e4f4ea;   /* proven prime */
    --st-prp: #0d8a8a;  --st-prp-bg: #dff3f3;   /* probable prime */
    --st-c:   #b0740f;  --st-c-bg:   #f8eed8;   /* composite, no factor */
    --st-cf:  #4b54c6;  --st-cf-bg:  #e7e9fb;   /* composite, factor known */
    --st-u:   #6b7686;  --st-u-bg:   #eceff4;   /* unknown */
    --st-ff:  #167a45;  --st-ff-bg:  #dcf1e4;   /* fully factored */
    --st-x:   #b02a5b;  --st-x-bg:   #fbe0ea;   /* unresolved (resolution budget reached) */

    --sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(20,30,50,.04), 0 8px 24px -14px rgba(20,30,50,.18);
    --wrapw: 90%;     /* whole layout width as a % of the window */
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg:#0c1016; --surface:#141a22; --surface-2:#1a212b; --hair:#252d39;
      --hair-strong:#323c4a; --ink:#e7ecf3; --muted:#98a3b4; --faint:#6d7889;
      --accent:#5c86f7; --accent-ink:#0c1016; --accent-soft:#1b2740; --focus:#5c86f7;
      --st-p:#4cc983;  --st-p-bg:#123123;   --st-prp:#37c2c2; --st-prp-bg:#0f2e2e;
      --st-c:#e0a63a;  --st-c-bg:#33280f;   --st-cf:#8b93f0; --st-cf-bg:#1c2140;
      --st-u:#8b96a8;  --st-u-bg:#20272f;   --st-ff:#48cf85;  --st-ff-bg:#10301f;
      --st-x:#f07098;  --st-x-bg:#3a1020;
    }
  }
  :root[data-theme="dark"] {
    --bg:#0c1016; --surface:#141a22; --surface-2:#1a212b; --hair:#252d39;
    --hair-strong:#323c4a; --ink:#e7ecf3; --muted:#98a3b4; --faint:#6d7889;
    --accent:#5c86f7; --accent-ink:#0c1016; --accent-soft:#1b2740; --focus:#5c86f7;
    --st-p:#4cc983;  --st-p-bg:#123123;   --st-prp:#37c2c2; --st-prp-bg:#0f2e2e;
    --st-c:#e0a63a;  --st-c-bg:#33280f;   --st-cf:#8b93f0; --st-cf-bg:#1c2140;
    --st-u:#8b96a8;  --st-u-bg:#20272f;   --st-ff:#48cf85;  --st-ff-bg:#10301f;
    --st-x:#f07098;  --st-x-bg:#3a1020;
  }

  * { box-sizing: border-box; }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  .wrap { width: var(--wrapw); margin: 0 auto; padding: 0 24px; }

  /* ---- topbar (also a real component) ---- */
  .topbar {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--hair);
  }
  .topbar .row { display: flex; align-items: center; gap: 22px; height: 58px; }
  .brand { display: flex; align-items: baseline; gap: 9px; font-weight: 700; letter-spacing: -.02em; font-size: 18px; }
  .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
  .brand span { color: var(--faint); font-family: var(--mono); font-size: 12px; font-weight: 500; }
  .nav { display: flex; gap: 4px; margin-left: 6px; }
  .nav a {
    color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
    padding: 7px 11px; border-radius: 7px;
  }
  .nav a:hover { color: var(--ink); background: var(--surface-2); }
  .nav a[aria-current] { color: var(--accent); background: var(--accent-soft); }
  .spacer { flex: 1; }
  .acct {
    color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500;
    padding: 6px 10px; border-radius: 7px; white-space: nowrap;
  }
  .acct:hover { color: var(--ink); background: var(--surface-2); }
  .toggle {
    font: inherit; font-size: 13px; color: var(--muted); cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--hair); border-radius: 8px;
    padding: 7px 12px; display: inline-flex; align-items: center; gap: 7px;
  }
  .toggle:hover { color: var(--ink); border-color: var(--hair-strong); }

  /* ---- page rhythm ---- */
  main { padding: 40px 0 96px; }
  .lede h1 { font-size: 34px; font-weight: 700; letter-spacing: -.025em; margin: 0 0 8px; text-wrap: balance; }
  .lede p { color: var(--muted); font-size: 16.5px; max-width: 62ch; margin: 0; }
  section { margin-top: 56px; }
  .eyebrow {
    font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    color: var(--faint); margin: 0 0 16px; display: flex; align-items: center; gap: 12px;
  }
  .eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
  h2.sec { font-size: 13px; }

  /* ---- cards ---- */
  .card {
    background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  }
  .pad { padding: 22px 24px; }

  /* ---- the hero: a number record ---- */
  .record { box-shadow: var(--shadow); overflow: hidden; }
  .record .head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 16px 24px; border-bottom: 1px solid var(--hair); background: var(--surface-2);
  }
  .metas { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-left: auto; }
  .meta { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
  .meta b { color: var(--ink); font-weight: 500; }
  .record .body { padding: 24px; }
  .fieldlabel {
    font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); margin: 0 0 8px;
  }
  .value {
    font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: -.01em;
    line-height: 1.35; word-break: break-all; font-variant-numeric: tabular-nums;
  }
  .term { font-family: var(--mono); color: var(--muted); font-size: 14px; margin-top: 8px; }
  .term em { color: var(--accent); font-style: normal; }
  .facline {
    margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--hair-strong);
    display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap;
  }
  .factor {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 16px; font-weight: 500;
    background: var(--surface-2); border: 1px solid var(--hair); border-radius: 8px;
    padding: 6px 11px;
  }
  .factor sup { font-size: .7em; color: var(--muted); font-weight: 600; }
  .factor .tick { width: 7px; height: 7px; border-radius: 50%; flex: none; }
  .times { color: var(--faint); font-family: var(--mono); font-weight: 500; }

  /* ---- status badges ---- */
  .badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .02em;
    padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  }
  .badge .tick { width: 7px; height: 7px; border-radius: 50%; }
  .b-P   { color: var(--st-p);   background: var(--st-p-bg); }   .t-P{background:var(--st-p);}
  .b-PRP { color: var(--st-prp); background: var(--st-prp-bg); } .t-PRP{background:var(--st-prp);}
  .b-C   { color: var(--st-c);   background: var(--st-c-bg); }   .t-C{background:var(--st-c);}
  .b-CF  { color: var(--st-cf);  background: var(--st-cf-bg); }  .t-CF{background:var(--st-cf);}
  .b-U   { color: var(--st-u);   background: var(--st-u-bg); }   .t-U{background:var(--st-u);}
  .b-FF  { color: var(--st-ff);  background: var(--st-ff-bg); }  .t-FF{background:var(--st-ff);}
  .b-X   { color: var(--st-x);   background: var(--st-x-bg); }   .t-X{background:var(--st-x);}

  /* ---- buttons ---- */
  .btn {
    font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
    border-radius: 8px; padding: 9px 15px; border: 1px solid transparent;
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  }
  .btn-primary { background: var(--accent); color: var(--accent-ink); }
  .btn-primary:hover { filter: brightness(1.06); }
  .btn-ghost { background: transparent; border-color: var(--hair-strong); color: var(--ink); }
  .btn-ghost:hover { background: var(--surface-2); }
  .btn-quiet { background: transparent; color: var(--muted); padding: 9px 10px; }
  .btn-quiet:hover { color: var(--ink); }
  .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

  /* ---- search ---- */
  .search { display: flex; gap: 10px; }
  .search .input {
    flex: 1; display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--hair-strong); border-radius: 10px;
    padding: 0 14px;
  }
  .search input {
    flex: 1; border: 0; background: transparent; color: var(--ink);
    font-family: var(--mono); font-size: 15px; padding: 13px 0; outline: none;
  }
  .search input::placeholder { color: var(--faint); }
  .search .glyph { color: var(--faint); font-family: var(--mono); }
  .hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
  .hint code { font-family: var(--mono); color: var(--ink); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }

  /* ---- tables ---- */
  .tablewrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: var(--radius); }
  table { border-collapse: collapse; width: 100%; font-size: 14px; }
  thead th {
    text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
    color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--hair); background: var(--surface-2);
    white-space: nowrap;
  }
  tbody td { padding: 11px 16px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
  tbody tr:last-child td { border-bottom: 0; }
  tbody tr:hover td { background: var(--surface-2); }
  td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
  td.id { font-family: var(--mono); color: var(--muted); font-size: 13px; }
  .link { color: var(--accent); text-decoration: none; }
  .link:hover { text-decoration: underline; }
  td .link { font-family: var(--mono); }
  .right { text-align: right; }

  /* ---- sequence ---- */
  .seq { display: flex; flex-direction: column; }
  .seq .term-row {
    display: grid; grid-template-columns: 42px 120px 1fr auto; gap: 16px; align-items: center;
    padding: 11px 18px; border-bottom: 1px solid var(--hair);
  }
  .seq .term-row:last-child { border-bottom: 0; }
  .seq .ix { font-family: var(--mono); color: var(--faint); font-size: 13px; }
  .seq .n  { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
  .seq .fz { font-family: var(--mono); color: var(--muted); font-size: 13.5px; }
  .seq .fz sup { font-size: .72em; }

  /* ---- swatches ---- */
  .swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .sw { border: 1px solid var(--hair); border-radius: var(--radius-sm); overflow: hidden; }
  .sw .chip { height: 54px; }
  .sw .lab { padding: 8px 11px; font-size: 12px; }
  .sw .lab .name { font-weight: 600; }
  .sw .lab .hex { font-family: var(--mono); color: var(--faint); font-size: 11.5px; }

  .statusgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
  .statuscell { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); }
  .statuscell .desc { font-size: 13px; color: var(--muted); }
  .statuscell .desc b { color: var(--ink); font-weight: 600; display: block; font-size: 13.5px; }

  /* ---- type scale ---- */
  .typerow { display: flex; align-items: baseline; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
  .typerow:last-child { border-bottom: 0; }
  .typerow .tag { width: 132px; flex: none; font-family: var(--mono); font-size: 12px; color: var(--faint); }
  .typerow .demo { flex: 1; min-width: 0; }

  /* ---- distribution chart ---- */
  .chartcard { display: grid; grid-template-columns: 1fr; }
  .legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
  .legend .item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
  .legend .tick { width: 10px; height: 3px; border-radius: 2px; }

  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  @media (max-width: 760px) {
    .grid2 { grid-template-columns: 1fr; }
    .seq .term-row { grid-template-columns: 34px 1fr auto; }
    .seq .fz { display: none; }
    .metas { width: 100%; margin-left: 0; }
  }

  .field { display: flex; flex-direction: column; gap: 7px; }
  .field label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
  .field .control {
    background: var(--surface); border: 1px solid var(--hair-strong); border-radius: 8px;
    padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink); font-family: var(--mono);
  }
  select.control { cursor: pointer; }
  .field .help { font-size: 12px; color: var(--muted); }

  .pager { display: flex; align-items: center; gap: 6px; }
  .pager a, .pager span {
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--hair);
    display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono);
    font-size: 13px; color: var(--muted); text-decoration: none; background: var(--surface);
  }
  .pager a:hover { border-color: var(--hair-strong); color: var(--ink); }
  .pager .cur { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .pager .gap { border: 0; background: transparent; }

  .notice {
    display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm);
    background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    font-size: 13.5px; color: var(--ink);
  }
  .notice .mk { color: var(--accent); font-weight: 700; font-family: var(--mono); }

  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, .toggle:focus-visible {
    outline: 2px solid var(--focus); outline-offset: 2px;
  }
  .search .input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

  footer.foot { border-top: 1px solid var(--hair); margin-top: 72px; padding: 28px 0 48px; color: var(--muted); font-size: 13px; }
  footer.foot code { font-family: var(--mono); color: var(--ink); }

  /* ---- search-box kind selector ---- */
  .search .kind { flex: none; }

  /* ---- family: on-screen page-size control ---- */
  .pagesize { display: inline-flex; align-items: center; gap: 6px; }
  .pagesize label { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
  .pagesize .control { padding: 4px 8px; font-size: 12.5px; }

  /* ---- family: factorization cell (compact chips, no section divider) ---- */
  /* Reserve the create button's height so a row keeps its height when the button is replaced by
     its shorter #id link during "Create all shown" (the button is ~31px; 32px covers it). */
  .createslot { display: flex; align-items: center; justify-content: flex-end; min-height: 32px; }
  td.faccell { max-width: 420px; }
  td.faccell .facline { margin-top: 0; padding-top: 0; border-top: 0; gap: 6px 8px; }
  td.faccell .factor { font-size: 13px; padding: 3px 8px; gap: 6px; border-radius: 6px; }
  td.faccell .badge { font-size: 11px; }

  /* factor chip: keep base+exponent together; the <sup> now superscripts against the base */
  .factor .fbase { white-space: nowrap; }
  .factor .fbase sup { vertical-align: super; line-height: 0; margin-left: 1px; }


  /* family: inline editable start value in the header (x = [start] … end) */
  .rangeform { display: inline-flex; align-items: center; gap: 4px; }
  .startinput {
    font: inherit; font-family: var(--mono); font-weight: 700; color: var(--ink);
    background: var(--surface); border: 1px solid var(--hair-strong); border-radius: 6px;
    padding: 1px 6px; width: 11ch; text-align: right;
  }
  .startinput:hover { border-color: var(--accent); }
  .startinput:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

  /* full-digits view: base switch */
  .baseswitch { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; }
  .baseswitch label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
  .baseswitch .control { padding: 5px 10px; font-size: 13px; }

  /* family: type/parity filter dropdown */
  .filterdd { position: relative; }
  .filterdd > summary {
    cursor: pointer; list-style: none; user-select: none;
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--hair-strong); border-radius: 8px; padding: 4px 10px;
    font-size: 12.5px; color: var(--ink); background: var(--surface);
  }
  .filterdd > summary::-webkit-details-marker { display: none; }
  .filterdd > summary::after { content: "▾"; color: var(--muted); }
  .filterdd[data-active] > summary { border-color: var(--accent); color: var(--accent); }
  .filterpanel {
    position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 190px;
    max-width: calc(100vw - 32px);
    background: var(--surface); border: 1px solid var(--hair-strong); border-radius: 10px;
    padding: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
  }
  .filterpanel .filterhint { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
  .filtergrid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .filtergrid label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
  .filteractions { display: flex; gap: 8px; }
  .filteractions .btn { padding: 6px 12px; font-size: 12.5px; }

  /* ---- distribution page ---- */
  .distnav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .distnav .distspace { flex: 1; min-width: 8px; }
  .distchart { margin-top: 16px; overflow-x: auto; }
  .dgrid { stroke: var(--hair); stroke-width: 1; }
  .dtick { stroke: var(--hair-strong); stroke-width: 1; }
  .dnum { font-size: 11px; fill: var(--muted); font-family: var(--mono); }
  .daxis { font-size: 12px; fill: var(--ink); }
  .dleg { font-size: 12px; fill: var(--ink); }

  /* ---- sequence overview category picker ---- */
  .catpick { display: flex; align-items: center; gap: 8px; }
  .catpick label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .catpick .control { padding: 6px 10px; font-size: 13px; width: auto; }

  /* ---- factor tables page ---- */
  code.mono { font-family: var(--mono); font-size: 13.5px; color: var(--ink); }
  .btn.btn-sm { padding: 5px 12px; font-size: 12.5px; }
  .tablecats { padding: 0; }
  .tablecat { border-bottom: 1px solid var(--hair); }
  .tablecat:last-child { border-bottom: 0; }
  .tablecat > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; font-weight: 600; color: var(--ink);
  }
  .tablecat > summary::-webkit-details-marker { display: none; }
  .tablecat > summary::before {
    content: "▸"; color: var(--faint); font-size: 12px; transition: transform .12s ease;
  }
  .tablecat[open] > summary::before { transform: rotate(90deg); }
  .tablecat > summary:hover { background: var(--surface-2); }
  .tablecat .catname { flex: 1; }
  .tablecat .catcount {
    font-family: var(--mono); font-size: 12px; color: var(--muted);
    background: var(--surface-2); border-radius: 999px; padding: 2px 9px;
  }
  .tablecat .tablewrap { border: 0; border-radius: 0; }
  .tablecat table td { vertical-align: middle; }

  /* ---- algebraic factorization box (foldable) ---- */
  .algfac { margin-top: 16px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface); }
  .algfac > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; font-weight: 600; color: var(--ink);
  }
  .algfac > summary::-webkit-details-marker { display: none; }
  .algfac > summary::before {
    content: "▸"; color: var(--faint); font-size: 12px; transition: transform .12s ease;
  }
  .algfac[open] > summary::before { transform: rotate(90deg); }
  .algfac > summary:hover { background: var(--surface-2); }
  .algfac .algtitle { flex: 1; }
  .algfac .algcount {
    font-family: var(--mono); font-size: 12px; color: var(--muted);
    background: var(--surface-2); border-radius: 999px; padding: 2px 9px;
  }
  .algfac .algbody { padding: 0 16px 14px; }
  .algfac .alghint { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
  .algfac .algrow {
    display: flex; align-items: baseline; gap: 12px;
    padding: 8px 0; border-top: 1px solid var(--hair);
  }
  .algfac .algrow:first-child { border-top: 0; }
  .algfac .algterm { font-family: var(--mono); font-size: 13.5px; flex: 1; min-width: 0; word-break: break-all; }
  .algfac .algterm sup { font-size: 11px; }
  .algfac .algkind {
    font-size: 12px; color: var(--muted); white-space: nowrap;
    background: var(--surface-2); border-radius: 6px; padding: 2px 8px;
  }
  .algfac .algdig { font-family: var(--mono); font-size: 12px; color: var(--faint); white-space: nowrap; }
  .algfac .algfoot { margin-top: 12px; color: var(--muted); font-size: 12.5px; }

  /* ---- list-by-type page ---- */
  .ltform { margin-top: 8px; }
  .ltrow { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
  .ltform .field { gap: 7px; }
  .ltform .field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .ltform .control { padding: 11px 12px; font-size: 15px; }
  .control.mini2 { width: 130px; }
  .ltform > .ltrow > .btn { align-self: flex-end; }

  /* ---- sequences page ---- */
  .seqform { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
  .seqrow { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
  .seqform .field { gap: 7px; }
  .seqform .control { padding: 12px 12px; font-size: 15px; }
  .seqpart {
    border: 1px solid var(--hair-strong); border-radius: 10px; padding: 12px 14px;
    display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center;
  }
  .seqpart legend { padding: 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .seqpart label { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
  .seqpart .rangeopt { gap: 6px; }
  .control.mini { width: 72px; padding: 5px 8px; font-size: 13px; }
  .seqgo { gap: 12px 18px; align-items: center; }
  .seqgo .seqopts { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; flex: 1; min-width: 260px; }
  .seqgo > .btn { align-self: center; margin-left: auto; }
  .seqdl { text-decoration: none; color: var(--accent); font-weight: 600; }
  .seqdl:hover { text-decoration: underline; }

  /* sequence overview: sortable column headers */
  th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
  th.sortable:hover { color: var(--accent); }
  th.sortable::after { content: " ⇅"; color: var(--faint); font-size: .85em; }
  th.sortable[data-dir="asc"]::after  { content: " ▲"; color: var(--accent); }
  th.sortable[data-dir="desc"]::after { content: " ▼"; color: var(--accent); }

  /* status page */
  .statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
  .statrow { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 14px; }
  .statrow:last-child { border-bottom: 0; }
  .statrow span { color: var(--muted); }
  .statrow b { font-family: var(--mono); font-variant-numeric: tabular-nums; }

  /* status page - distribution donut + legend */
  .statdist { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 20px 24px; }
  .statdist .donut { flex: 0 0 auto; width: 190px; height: 190px; position: relative; }
  .statdist .donut svg { display: block; width: 100%; height: 100%; }
  .statdist .donut .center {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; pointer-events: none;
  }
  .statdist .donut .center .n { font-family: var(--mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .statdist .donut .center .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
  .statdist .legend { flex: 1 1 220px; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
  .leglink { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 7px; text-decoration: none; color: var(--ink); }
  .leglink:hover { background: var(--surface-2); }
  .leglink .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
  .leglink .lab { flex: 1; font-size: 13.5px; }
  .leglink .cnt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
  .leglink .pct { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 48px; text-align: right; }
