/* UI/UX overhaul — page styles for the home group (Home, first use, Activity log,
   How it works, error pages, welcome, sign-in). Shared components live in ui.css. */

/* ---------- Home ---------- */
.home .page-head .purpose a { color: var(--attn); font-weight: 500; }
.home-n { font: 400 16px/1 var(--sans); }
.home-foot { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.home-foot a { color: var(--ink); }
.home-none { margin: 0; }
.home .panel + .panel { margin-top: 0; }
.home .list form { margin: 0; }
.home .list > li { align-items: flex-start; }
.home .list > li > .pill { margin-top: 2px; }
.home .seg { flex-wrap: wrap; }
.home .seg a { font-size: 12px; min-height: 36px; display: inline-flex; align-items: center; }
.home-results .metrics { margin-top: 4px; }
.home-results .metric .k { font: 500 13px/1.3 var(--sans); letter-spacing: 0; text-transform: none; }
.home-results .metric .d { font: 400 13px/1.4 var(--sans); }

.home-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 980px) { .home-pair { grid-template-columns: 1fr; } }

/* the channel grid: same component, calmer and readable */
.home-chan { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.home-chan .chan { border-radius: var(--r); border-color: var(--line-soft); padding: 14px 16px; }
.home-chan a.chan:hover { border-color: var(--ink); }
.home-chan .chan .grp { font: 500 12px/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); margin: 0 0 2px; }
.home-chan .chan .nm { font: 600 16px/1.25 var(--sans); }
.home-chan .chan .flag { font: 500 12px/1.3 var(--sans); white-space: nowrap; }
.home-chan .chan .stats .sk { font: 400 12px/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted);
  white-space: normal; overflow: visible; text-overflow: clip; }
.home-chan .chan .stats .sv { font-size: 18px; }
.home-chan .chan .foot, .home-chan .chan .last { font: 400 13px/1.4 var(--sans); color: var(--muted); }
.home-chan .chan .foot.problem { color: var(--err); }
.home-chan .chan.is-err { border-color: color-mix(in srgb, var(--err) 45%, transparent); }
.home-chan .chan.off { border-style: dashed; }
.home-chan .chan .u { text-decoration: underline; text-underline-offset: 2px; }
.home-more { margin: 12px 0 0; font-size: 15px; }
.home .tech .kv dt { overflow-wrap: anywhere; }

/* ledger rows: readable times and "by" lines */
.home .ledger .t, .activity-page .ledger .t { font: 400 13px/1.6 var(--sans); color: var(--muted); }
.home .ledger .what, .activity-page .ledger .what { font-size: 15px; }
.home .ledger .by a, .activity-page .ledger .by a { color: var(--muted); }

/* ---------- First use ---------- */
.first-use { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 980px) { .first-use { grid-template-columns: 1fr; } }
.first-use > .panel { margin-top: 0; }
.first-use .steps { margin-top: 18px; gap: 20px; }
.first-use .steps > li > div { flex: 1; min-width: 0; }
.first-use .steps b { display: block; font-weight: 600; }
.first-use .steps .small { color: var(--muted); margin: 2px 0 0; }
.first-use .steps .btn { margin-top: 10px; }
.first-use .steps .step-link { display: inline-block; margin-top: 6px; font-size: 14px; }
.first-use .steps .who { display: inline-block; margin-top: 6px; font-size: 14px; color: var(--attn); }
.first-use aside .steps { margin-top: 12px; gap: 10px; }
.first-use aside p { margin: 14px 0 0; }
.first-use + .panel, .first-use-needs { margin-top: var(--gap); }

/* ---------- Activity log ---------- */
.activity-filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: end; margin: 0; }
.activity-filters > div { flex: 1 1 170px; min-width: 150px; }
.activity-filters label.f { margin: 0 0 6px; display: block; }
.activity-filters .check { flex: 1 1 100%; display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 15px; }
.activity-filters .check input { width: 20px; height: 20px; margin: 0; }
.activity-filters .go { flex: 0 0 auto; min-width: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 620px) { .activity-filters > div { flex-basis: 100%; } }
.activity-page .day { margin-top: 16px; }
.activity-page .day + .day { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.activity-page .day h3 { font: 600 15px/1.3 var(--sans); margin: 0 0 6px; }
.activity-page .day h3 .muted { font-weight: 400; }
.activity-page .ledger .what b { overflow-wrap: anywhere; }
.activity-page .ledger-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--muted); }
.activity-page .ledger-foot a { color: var(--ink); }
.activity-page .filter-summary { font-size: 14px; color: var(--muted); margin: 0 0 14px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: baseline; }
.activity-page .filter-summary b { color: var(--ink); font-weight: 600; }
.activity-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--muted); margin: 14px 0 0; padding: 0; list-style: none; }
#activity-panel { margin-top: var(--gap); position: relative; }
.skel .bar { display: block; background: var(--panel-dim); border-radius: 2px; height: 11px; }
.skel .bar + .bar { margin-top: 7px; }
.skel .t .bar { width: 36px; margin-left: auto; }
.skel .m .bar { width: 9px; margin: 2px auto 0; }
.skel .w6 { width: 60%; } .skel .w7 { width: 70%; } .skel .w8 { width: 80%; } .skel .w4 { width: 42%; }
#activity-loading { display: none; }
#activity-panel.htmx-request #activity-loading { display: block; }

/* ---------- How it works ---------- */
.doc { max-width: 760px; }
.doc h2 { font: 600 22px/1.3 var(--display); margin: 40px 0 8px; scroll-margin-top: 20px; }
.doc h3 { font: 600 16px/1.3 var(--sans); margin: 22px 0 4px; }
.doc p, .doc li { line-height: 1.65; }
.doc ol, .doc ul { padding-left: 22px; margin: 8px 0; }
.doc li { margin: 4px 0; }
.doc .toc { columns: 2; column-gap: 24px; padding-left: 20px; margin: 0; }
@media (max-width: 620px) { .doc .toc { columns: 1; } }
.doc .chain { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.doc .chain b { border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 10px; background: var(--panel-dim); font-weight: 500; }
.doc .chain span { color: var(--muted); }
.doc .modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.doc .modes .tile { cursor: default; }
.doc details.tech h3:first-of-type { margin-top: 6px; }
.doc .roles { width: 100%; }

/* ---------- 403 / 404 ---------- */
.refusal, .missing { max-width: 640px; }
.refusal .reason { margin: 0; }
.refusal .who { margin: 12px 0 0; }
.missing .path { font: 400 14px/1.6 var(--mono); color: var(--muted); word-break: break-all; margin: 0; }
.refusal .btn-row, .missing .btn-row { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Welcome (onboarding) and sign-in pages ---------- */
.onb-top { padding: 18px 24px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.onb-top .wordmark { font: 600 16px/1.1 var(--display); }
.onb-top .wordmark .tick, .auth-card .wordmark .tick { color: var(--attn); }
.onb-top a { font-size: 14px; color: var(--muted); }
.onb { max-width: 680px; margin: 0 auto; padding: 8px 16px 80px; }
.onb .page-head { margin-bottom: 12px; }
.onb-section { margin-top: 28px; }
.onb-section > h2 { font: 600 20px/1.25 var(--display); margin: 0 0 4px; }
.onb-section > .sub { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.onb fieldset.plain { border: 0; padding: 0; margin: 8px 0 20px; min-width: 0; }
.onb .choice .rec { color: var(--ok); font-weight: 500; font-size: 13px; margin-left: 6px; }
.onb .form-foot { margin-top: 28px; }
.onb .form-foot .hint { flex-basis: 100%; margin: 4px 0 0; color: var(--muted); }

.auth-shell main { width: 100%; display: flex; justify-content: center; }
.auth-card h1 { font: 600 28px/1.2 var(--display); margin: 6px 0 4px; }
.auth-card .lede { color: var(--muted); margin: 0 0 18px; }
.auth-card .btn { width: 100%; }
.auth-card .auth-alt { font: 400 14px/1.5 var(--sans); margin-top: 14px; }
.auth-card { border-radius: var(--r); border-color: var(--line-soft); }

/* password page */
.form-card { max-width: 560px; }

/* Activity filters: a disclosure, closed on phones by app.js */
.activity-filter-box > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; list-style: none; }
.activity-filter-box > summary::-webkit-details-marker { display: none; }
.activity-filter-box > summary::after { content: "▾"; color: var(--muted); margin-left: auto; }
.activity-filter-box:not([open]) > summary::after { content: "▸"; }
.activity-filter-box > summary h2 { margin: 0; }
.activity-filter-box[open] > summary { margin-bottom: 12px; }
