/* ---------------------------------------------------------------------------
   htm worklist — "harbour light".
   Light frosted glass laid over a dusk photograph: one large pane holds the
   whole app, cards are brighter panes raised on it, and the type is dark
   ink throughout. One accent (lake blue). Self-hosted fonts and image; no
   external requests.

   Backdrop photograph: Unsplash (photo-1506905925346-21bda4d32df4), used
   under the Unsplash licence (free for commercial use, no attribution
   required). To swap it, replace static/backdrop.jpg — nothing else refers
   to it.
--------------------------------------------------------------------------- */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/ui/static/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/ui/static/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("/ui/static/fonts/spline-sans-mono.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  /* ink */
  --ink: #1b2431;
  --ink-2: rgba(27, 36, 49, 0.72);
  --ink-3: rgba(27, 36, 49, 0.52);
  --line: rgba(27, 36, 49, 0.1);
  --line-strong: rgba(27, 36, 49, 0.2);

  /* glass: the frame is the sheet the app sits on, panes are raised on it */
  --frame: rgba(214, 223, 234, 0.42);
  --frame-border: rgba(255, 255, 255, 0.55);
  --pane: rgba(244, 247, 251, 0.64);
  --pane-hover: rgba(250, 252, 254, 0.78);
  --pane-border: rgba(255, 255, 255, 0.75);
  --well: rgba(255, 255, 255, 0.55);
  --well-border: rgba(27, 36, 49, 0.14);

  /* the one accent */
  --accent: #2b7fd8;
  --accent-deep: #1f66b3;
  --accent-soft: rgba(43, 127, 216, 0.14);
  --danger: #a8342b;
  --danger-soft: rgba(168, 52, 43, 0.12);
  --ok: #256a4c;
  --ok-soft: rgba(37, 106, 76, 0.13);
  --warn: #7d5710;
  --warn-soft: rgba(154, 107, 18, 0.14);

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Schibsted Grotesk", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --blur-frame: blur(44px) saturate(160%);
  --blur-pane: blur(24px) saturate(140%);
  --radius-frame: 28px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-frame: 0 40px 90px -40px rgba(18, 28, 42, 0.5), 0 2px 6px rgba(18, 28, 42, 0.06);
  --shadow-pane: 0 12px 30px -20px rgba(18, 28, 42, 0.35);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.7);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
}

* { box-sizing: border-box; }
::selection { background: rgba(43, 127, 216, 0.22); }

html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  padding: 1.5rem 1.25rem 3rem;
  background: #5c6c81;
  color: var(--ink);
  font: 15px/1.55 var(--font-body);
}

/* --- backdrop: the photograph everything is frosted against ------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #5c6c81 url("/ui/static/backdrop.jpg") center 42% / cover no-repeat;
}
.backdrop::after {
  /* a light veil so the frame's contrast doesn't depend on which part of
     the photo is behind it */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 30, 45, 0.04) 0%, rgba(20, 30, 45, 0.22) 100%);
}

/* --- the frame: one sheet of glass holding the whole app ------------------ */

.frame {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--frame);
  border: 1px solid var(--frame-border);
  border-radius: var(--radius-frame);
  backdrop-filter: var(--blur-frame);
  -webkit-backdrop-filter: var(--blur-frame);
  box-shadow: var(--shadow-frame), var(--highlight);
  animation: settle 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes settle {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .frame { animation: none; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding: 1rem 1.5rem 1rem 1.75rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  color: var(--ink);
}
/* the mark is one SVG (static/mark.svg) shared with the login page and the
   favicon, so there is exactly one drawing of it */
.brand::before {
  content: "";
  width: 16px; height: 16px;
  background: url("/ui/static/mark.svg") center / contain no-repeat;
}
.brand:hover { text-decoration: none; }

.topbar nav { display: flex; align-items: center; gap: 0.1rem; flex-wrap: wrap; }
.logout-form { display: inline; margin: 0; }

.link-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  font-weight: 500;
  color: var(--ink-2);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.link-btn:hover { color: var(--ink); background: rgba(27, 36, 49, 0.07); text-decoration: none; }
a.link-btn { text-decoration: none; white-space: nowrap; }

.container { padding: 1.75rem 1.75rem 2.25rem; }
.container > header { margin-bottom: var(--space-6); }

/* --- type ------------------------------------------------------------------ */

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 330;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.022em;
  line-height: 1.08;
  text-wrap: balance;
}
.container > header h1 + p { margin: 0.5rem 0 0; }
h2 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 520;
  font-size: 1.08rem;
  letter-spacing: -0.008em;
  color: var(--ink);
}
h3 { font-family: var(--font-display); font-weight: 540; letter-spacing: -0.005em; }
.eyebrow {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
  color: var(--ink-3);
}
.muted { color: var(--ink-2); }
.hint { font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); }
p.hint { margin: 0 0 var(--space-4); }

/* --- panes ------------------------------------------------------------------- */

.panel {
  background: var(--pane);
  border: 1px solid var(--pane-border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: var(--space-4);
  backdrop-filter: var(--blur-pane);
  -webkit-backdrop-filter: var(--blur-pane);
  box-shadow: var(--shadow-pane), var(--highlight);
}
.panel > h2:first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
/* a wide table (people, invitations) scrolls inside its pane rather than
   pushing the pane out of the frame on a narrow screen */
.panel:has(table) { overflow-x: auto; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-4);
  align-items: start;
}
.detail-grid .side { position: sticky; top: 1.5rem; }
@media (max-width: 880px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .side { position: static; }
}

/* the hero pane: title, then a strip of facts divided by hairlines */
.hero h1 { margin-bottom: 0.2rem; }
.stats {
  display: flex; flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.stat {
  padding-right: 1.75rem;
  margin-right: 1.75rem;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stat .stat-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.84rem;
  color: var(--ink-3);
}
.stat .stat-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 440;
  font-size: 1.2rem;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

/* confidence meter */
.meter {
  position: relative;
  height: 5px;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: rgba(27, 36, 49, 0.1);
  overflow: hidden;
}
.meter span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--accent);
}

/* --- buttons ------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 1.15rem;
  background: rgba(27, 36, 49, 0.08);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font: 600 0.9rem/1.3 var(--font-body);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn:hover { background: rgba(27, 36, 49, 0.14); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(43, 127, 216, 0.8);
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: rgba(168, 52, 43, 0.2); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

:is(.btn, .link-btn, .chip, .tab, input, select, textarea, summary, a):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- status badges ------------------------------------------------------------ */

.badge {
  display: inline-flex; align-items: center; gap: 0.42rem;
  padding: 0.18rem 0.7rem 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.5;
  color: var(--ink-2);
  background: rgba(27, 36, 49, 0.07);
  vertical-align: middle;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-ready { color: var(--accent-deep); background: var(--accent-soft); }
.badge-reserved { color: var(--warn); background: var(--warn-soft); }
.badge-in-progress { color: var(--ok); background: var(--ok-soft); }
.badge-completed { color: var(--ink-2); background: rgba(27, 36, 49, 0.07); }
.badge-failed { color: var(--danger); background: var(--danger-soft); }
.badge-suspended { color: var(--ink-3); background: rgba(27, 36, 49, 0.05); }
.badge-suspended::before { background: none; border: 1.5px solid currentColor; }

/* --- worklist: rows inside one pane ------------------------------------------- */

#task-list { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--pane);
  border: 1px solid var(--pane-border);
  border-radius: var(--radius);
  backdrop-filter: var(--blur-pane);
  -webkit-backdrop-filter: var(--blur-pane);
  box-shadow: var(--shadow-pane), var(--highlight);
  overflow: hidden;
}
th {
  padding: 0.9rem 1.25rem 0.7rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}
td {
  padding: 1rem 1.25rem;
  text-align: left;
  vertical-align: middle;
  border-top: 1px solid var(--line);
  transition: background 0.15s;
}
tbody tr:hover td { background: rgba(255, 255, 255, 0.4); }
td a {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.008em;
}
td .muted { font-family: var(--font-body); font-size: 0.82rem; margin-top: 0.1rem; }

.task-time { color: var(--ink-2); font-size: 0.88rem; white-space: nowrap; }
.task-pri { font-family: var(--font-mono); font-size: 0.84rem; color: var(--ink-2); }

/* htmx swap on live updates */
#task-list { transition: opacity 0.3s; }
#task-list.htmx-request { opacity: 0.6; transition: opacity 0.2s; }

/* --- filters ------------------------------------------------------------------- */

.filters {
  display: flex; gap: 0.4rem; margin-bottom: var(--space-4);
  flex-wrap: wrap; align-items: center;
}
.filters .btn { padding: 0.42rem 1rem; font-size: 0.86rem; }
.filters .btn-primary { margin-left: auto; }
/* status toggle chips: real checkboxes, styled as a segmented set */
.chip {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 0.36rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-2);
  background: rgba(27, 36, 49, 0.06);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.chip:hover { color: var(--ink); background: rgba(27, 36, 49, 0.1); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(18, 28, 42, 0.12), 0 6px 16px -10px rgba(18, 28, 42, 0.4);
}
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- flash --------------------------------------------------------------------- */

.flash {
  padding: 0.8rem 1rem;
  margin-bottom: var(--space-4);
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid rgba(154, 107, 18, 0.22);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
#task-actions .flash { margin-top: var(--space-4); }

/* --- forms ---------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; margin-bottom: var(--space-4); }
.field label {
  display: flex; flex-direction: column; gap: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
}
.field label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 0.5rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border: 1px solid var(--well-border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--ink);
  background: var(--well);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field textarea { font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 127, 216, 0.18);
}
.field input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.field .hint { margin-top: 0.35rem; }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
}
fieldset legend {
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0 var(--space-2);
  color: var(--ink-2);
}

/* intent forms: quiet accordions inside the Actions pane */
details {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: var(--space-2);
  transition: border-color 0.15s, background 0.15s;
}
details:hover { border-color: var(--line-strong); }
details[open] { background: rgba(255, 255, 255, 0.55); }
details summary {
  cursor: pointer;
  list-style: none;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  display: flex; align-items: baseline; gap: 0.5rem;
  color: var(--ink);
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "";
  align-self: center;
  width: 6px; height: 6px;
  margin-right: 0.15rem;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg);
  transition: transform 0.18s;
}
details[open] summary::before { transform: rotate(45deg); }
details > form { padding: 0.25rem 1rem 1rem; }

/* --- code ------------------------------------------------------------------------ */

pre {
  margin: 0 0 var(--space-4);
  background: rgba(27, 36, 49, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--ink);
}
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ink);
  background: rgba(27, 36, 49, 0.06);
  padding: 0.08em 0.4em;
  border-radius: 6px;
}
pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; }

/* --- signed-out pages: the frame shrinks to a card ------------------------------- */

.frame:has(.login-wrap) { max-width: 460px; margin-top: 4vh; }
.frame:has(.login-wrap) .topbar { padding: 0.9rem 1.1rem 0.9rem 1.5rem; }
.login-wrap { display: flex; flex-direction: column; align-items: stretch; }
.login-mark { margin: 0.25rem 0 1.25rem; text-align: center; }
.login-mark .glyph {
  display: inline-block;
  width: 40px; height: 40px;
  margin-bottom: 0.8rem;
  background: url("/ui/static/mark.svg") center / contain no-repeat;
}
.login-mark .wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
.login-mark .tagline { color: var(--ink-3); font-size: 0.9rem; margin-top: 0.2rem; }
.login-form {
  padding: 1.5rem;
  background: var(--pane);
  border: 1px solid var(--pane-border);
  border-radius: var(--radius);
  backdrop-filter: var(--blur-pane);
  -webkit-backdrop-filter: var(--blur-pane);
  box-shadow: var(--shadow-pane), var(--highlight);
}
.login-form h1 { font-size: 1.5rem; font-weight: 400; margin-bottom: 1.25rem; }
.login-form button { width: 100%; margin-top: var(--space-2); padding: 0.7rem; }
.login-form > .hint:last-child { margin: var(--space-4) 0 0; text-align: center; }

/* --- misc ---------------------------------------------------------------------------- */

.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.back-link:hover { color: var(--ink); text-decoration: none; }
.container > p:first-child { margin-top: 0; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.55rem 1.25rem; margin: 0; }
.kv dt {
  color: var(--ink-3);
  font-size: 0.86rem;
  align-self: baseline;
}
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv code { font-size: 0.8rem; }
.kv ul { margin: 0; padding: 0; list-style: none; }

/* nested groups in field displays (task input rendered as fields) */
.kv .kv {
  margin: 0.1rem 0 0.3rem;
  padding-left: var(--space-3);
  border-left: 2px solid var(--line-strong);
}

/* collapsed raw-JSON escape hatch under the field display */
.raw-json { margin-top: var(--space-4); background: none; border: none; }
.raw-json summary {
  padding: 0;
  font-size: 0.84rem;
  color: var(--ink-3);
}
.raw-json summary:hover { color: var(--ink-2); }
.raw-json[open] summary { margin-bottom: var(--space-2); }
.raw-json pre { margin-bottom: 0; }

/* ── Connect page ─────────────────────────────────────────────────────── */

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent-deep); border-bottom-color: var(--accent); }

.tab-panel + .tab-panel { margin-top: var(--space-5); }
.tab-panel pre { margin: 0 0 var(--space-2); }
.tab-label {
  font-size: 0.84rem;
  color: var(--ink-3);
  margin: 0 0 var(--space-2);
}
/* The strip carries the labels once JS is running; keeping both would
   print every client name twice. */
.tabs.is-enhanced .tab-label { display: none; }

.token-reveal {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border: 1px solid rgba(154, 107, 18, 0.3);
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
}
.token-warn { color: var(--warn); font-size: 0.86rem; margin: 0 0 var(--space-2); }
.token-value {
  margin: 0;
  word-break: break-all;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.6);
}
.copy-btn { margin-top: var(--space-2); padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ── Task attachments ─────────────────────────────────────────────────── */

.attachments { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.attachment {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.45);
}
.attachment img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  background: rgba(27, 36, 49, 0.08);
}
.attachment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
}
.attachment-meta .muted { font-size: 0.8rem; }

/* ── Connect page: what an agent can hand over ────────────────────────── */

.ask-patterns { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-3); }
.ask-pattern {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
}
.ask-pattern h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.ask-pattern .hint { margin: 0; }
.ask-tools { margin: 0 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; }
.ask-tools .muted { font-size: 0.8rem; }

/* ── Landing page ─────────────────────────────────────────────────────── */

.landing-hero { max-width: 46rem; padding: 1.25rem 0 2.25rem; }
.landing-hero h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 5.2vw, 3.7rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.lede {
  margin: 0 0 1.5rem;
  max-width: 40rem;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.cta-row .btn { padding: 0.7rem 1.4rem; font-size: 0.95rem; }

/* the example task: real panes, inert buttons */
.showcase { margin: 0 0 2.75rem; }
.showcase-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-weight: 330;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}
.showcase-sub { margin: 0; }
.showcase-grid { display: grid; grid-template-columns: 3fr 2fr; gap: var(--space-4); align-items: start; }
.showcase-grid .panel { margin-bottom: 0; }
.showcase .btn { cursor: default; }
.showcase figcaption { margin: var(--space-4) 0 0; text-align: center; }
.stat-wide { flex: 1 1 12rem; }
.stat-wide .meter { max-width: 14rem; }
.returns { margin: var(--space-4) 0 0; }
.returns code { display: inline-block; margin-top: 0.35rem; }

.landing-section { margin-bottom: 2.75rem; }
.section-title {
  margin: 0 0 1rem;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.landing-patterns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.fact { margin: 0; }
.fact h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.fact .hint { margin: 0; }
.landing-footer {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .showcase-grid, .landing-patterns, .facts { grid-template-columns: 1fr; }
  .landing-hero { padding-top: 0.5rem; }
}

/* ── small screens ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  body { padding: 0.75rem 0.6rem 2rem; }
  .frame { border-radius: 22px; }
  .topbar { padding: 0.8rem 1rem; }
  .topbar nav { justify-content: flex-end; }
  .link-btn { padding: 0.35rem 0.6rem; font-size: 0.92rem; }
  .container { padding: 1.25rem 1rem 1.5rem; }
  .panel { padding: 1.1rem 1.15rem; }
  .stat { padding-right: 1.1rem; margin-right: 1.1rem; }
  .frame:has(.login-wrap) { margin-top: 2vh; }

  /* the worklist becomes stacked cards: title, then state · priority · age */
  #task-list table, #task-list tbody, #task-list tr, #task-list td { display: block; }
  #task-list thead { display: none; }
  #task-list tr { padding: 0.9rem 1rem; border-top: 1px solid var(--line); }
  #task-list tr:first-child { border-top: 0; }
  #task-list td { padding: 0; border: 0; }
  #task-list td:first-child { margin-bottom: 0.55rem; }
  #task-list td:not(:first-child) { display: inline-block; margin-right: 0.8rem; vertical-align: middle; }
  #task-list td:nth-child(4) { display: none; }
  #task-list tbody tr:hover td { background: none; }
}
