/* Tree Manager console. 10Coins MBO colours, Hum Pay feel. Tokens and rationale in ../DESIGN.md. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #132023;
  --panel: #0c1619;
  --surface: #0f1c20;
  --card: #16292e;
  --card-hover: #1a3036;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --teal: #72c9b1;
  --teal-dim: rgba(114, 201, 177, 0.14);
  --teal-glow: rgba(114, 201, 177, 0.35);
  --amber: #e8a500;
  --amber-dim: rgba(232, 165, 0, 0.14);
  --red: #ff3d71;
  --red-dim: rgba(255, 61, 113, 0.14);
  --green: #00d68f;
  --green-dim: rgba(0, 214, 143, 0.14);
  --text: #f4f8f7;
  --text-muted: #b0bec5;
  --text-dim: #6c8a80;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-pill: 999px;
  --shadow-rest: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-elev: 0 6px 18px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 200ms;
  --tap: 44px;
  --topbar: 56px;
}

* { box-sizing: border-box; }
/* Page to page: a short cross-fade instead of a flash (same-origin navigations, Chromium). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: var(--ease); }
html { color-scheme: dark; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 15% -10%, rgba(114, 201, 177, 0.07), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--teal); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: #9be0cd; }
h1, h2, .column-title, .brand-mark {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.3; margin-bottom: 12px; }
h3 { font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
h1 .pill, h2 .count { vertical-align: middle; }
p { margin: 0 0 8px; }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 4px; }
.eyebrow a { color: var(--text-dim); }
.eyebrow a:hover { color: var(--teal); }
.error { color: #ff7a95; background: var(--red-dim); border: 1px solid rgba(255, 61, 113, 0.3); border-radius: var(--radius-btn); padding: 10px 12px; }
/* A refused form: the message floats under the top bar, wherever the page is scrolled. */
.flash-area { position: fixed; top: calc(var(--topbar) + 10px); left: 50%; transform: translateX(-50%); z-index: 60; width: min(560px, calc(100vw - 24px)); pointer-events: none; }
.flash { pointer-events: auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius-card); background: #2b141b; border: 1px solid rgba(255, 61, 113, 0.5); color: #ffc2cf; box-shadow: var(--shadow-pop); font-weight: 500; }
.flash-close { flex: 0 0 auto; width: 28px; height: 28px; margin: -4px -6px -4px 0; border: none; border-radius: var(--radius-btn); background: transparent; color: inherit; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.flash-close:hover { background: rgba(255, 255, 255, 0.08); }
.error-panel { max-width: 640px; }
.empty { color: var(--text-dim); font-style: italic; padding: 14px 12px; border: 1px dashed var(--border); border-radius: var(--radius-btn); text-align: center; }
.key { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--teal); letter-spacing: 0.01em; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.07); color: var(--text-muted); font: 600 11.5px/1 var(--font-ui); letter-spacing: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  height: var(--topbar); padding: 0 clamp(16px, 4vw, 32px);
  background: rgba(12, 22, 25, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  view-transition-name: topbar;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--teal); color: #06201a; font-size: 13px; font-weight: 700; letter-spacing: -0.03em; box-shadow: 0 4px 14px var(--teal-glow); }
.brand-text { font-weight: 600; letter-spacing: -0.01em; }
.demo-mark { background: var(--teal-dim); color: var(--teal); }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-pill); white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav a.active { color: var(--teal); background: var(--teal-dim); }
/* The jump box: a ticket number opens the ticket, words search. A full field where the
   bar has room, and nothing on a phone, where Search is one swipe along the nav. */
.quick-search { flex: 0 1 190px; min-width: 0; margin: 0; }
.quick-search input[type="search"] { min-height: 34px; padding: 5px 12px; font-size: 13px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.04); }
@media (max-width: 1180px) { .quick-search { display: none; } }
.logout { margin-left: auto; }
.quick-search + .logout, .switch + .logout { margin-left: 0; }
/* The way over to Analytics: a labelled button where the bar has room, its icon alone on a
   laptop (the jump box gives up the same width, so no section link is pushed out of the
   bar), and on a phone the 10C mark, which opens the chooser. */
.switch { gap: 8px; white-space: nowrap; }
.switch-icon { flex: 0 0 auto; }
@media (max-width: 1499px) { .switch { padding-inline: 8px; } .switch-text { display: none; } }
@media (max-width: 1340px) { .quick-search { flex-basis: 138px; } }
.logout .btn { gap: 8px; }
.logout-icon { display: none; flex: 0 0 auto; }

/* Page */
/* Boosted navigation: the page dims a little while the request is in flight, and the new
   page rises in over 150ms the moment it arrives. No fade-out step: it only added waiting. */
.page { max-width: 1440px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 32px) 56px; transition: opacity 150ms var(--ease), transform 200ms var(--ease); }
/* The board's page: six columns want the window, not the width a page of text reads well at.
   Its own widest is where a column is as wide as a column of the board ever was. */
.page-wide { max-width: 2400px; }
.page.htmx-request { opacity: 0.75; }
.page.htmx-added { opacity: 0; transform: translateY(6px); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 18px; }
.page-head > div > p:last-child { margin-bottom: 0; }
.head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.foot { margin-top: 20px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px 20px; box-shadow: var(--shadow-rest); }
.panel.elev { box-shadow: var(--shadow-elev); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; }
.panel-head h2 { margin-bottom: 0; }
.notice { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: rgba(255, 255, 255, 0.04); color: var(--text-muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 2px 0 12px; }
.stat { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); }
.stat-value { font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.two-col { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .two-col { grid-template-columns: 3fr 2fr; } }
.stack-lg { display: grid; gap: 18px; align-content: start; }
.stack { display: grid; gap: 8px; }
.stack label, .inline-form label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.stack .btn { justify-self: start; margin-top: 6px; }
.stack label.check { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 500; letter-spacing: normal; text-transform: none; color: var(--text-muted); min-height: 32px; }
.stack label.check input { accent-color: var(--teal); width: 16px; height: 16px; }
.login { max-width: 420px; margin: 48px auto; padding: 28px; }
.login h1 { margin-bottom: 6px; }
.login-steps { margin: 12px 0; padding-left: 20px; color: var(--text-muted); display: grid; gap: 6px; }
/* The picture an authenticator scans: black on white whatever the page wears. */
.qr { display: block; width: 216px; height: 216px; margin: 14px auto; border-radius: 8px; }
.login-key { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-align: center; overflow-wrap: anywhere; margin: 0 0 12px; }
.login-foot { margin: 14px 0 0; font-size: 12.5px; }
/* The six digits and the button that takes them out of the clipboard, side by side. The
   button is hidden until the script finds a browser that can read one (static/app.js); a
   button's own display would show it regardless, hence the last-but-one rule. */
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1 1 auto; width: auto; min-width: 0; }
.stack .code-row .btn { flex: none; margin-top: 0; }
.code-row .btn[hidden] { display: none; }
.paste-said { margin: 0; }
/* My account and Users: the platform's own pages, cards side by side where there is room. */
.account-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.session-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.session-row:first-child { border-top: none; }
.session-what { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.account-acts { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 14px; }
/* What is shown once: the temporary passphrase of an account, above the cards. */
.account-once { margin-bottom: 16px; }
.account-once .login-key { font-size: 17px; margin: 6px 0 12px; }
/* Who changed what: the one table of the platform's own pages. */
.table-scroll { overflow-x: auto; }
.activity { width: 100%; border-collapse: collapse; font-size: 13px; }
.activity th { text-align: left; white-space: nowrap; padding: 0 16px 8px 0; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.activity td { padding: 9px 16px 9px 0; border-top: 1px solid var(--border); vertical-align: baseline; }
.activity th:last-child, .activity td:last-child { padding-right: 0; }
.activity td:first-child { white-space: nowrap; }
/* The chooser a login lands on: one card per system of the platform. */
.chooser { max-width: 760px; margin: 48px auto; }
.chooser h1 { margin-bottom: 22px; }
.chooser-grid { display: grid; gap: 16px; }
.chooser-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 22px 0 0; }
@media (min-width: 700px) { .chooser-grid { grid-template-columns: 1fr 1fr; } }
.chooser-card { display: block; padding: 24px; color: var(--text); transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 180ms var(--ease); }
.chooser-card:hover { color: var(--text); background: var(--card-hover); border-color: var(--teal); transform: translateY(-2px); }
.chooser-card h2 { margin-bottom: 6px; }
.chooser-card p { margin: 0; }

/* Buttons and forms */
.btn, .text-link, .sort-select {
  font: inherit; cursor: pointer;
  transition: transform 180ms var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 18px; font-size: 13px; font-weight: 600; border: 1px solid transparent; border-radius: var(--radius-btn); background: transparent; color: var(--text); }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 12.5px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #06201a; border-radius: var(--radius-pill); padding-inline: 24px; text-transform: uppercase; letter-spacing: 0.1em; font-size: 12.5px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.btn-primary:hover { box-shadow: 0 6px 18px var(--teal-glow); transform: translateY(-1px); }
.btn-outline { border-color: var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--teal-dim); }
.btn-danger { border-color: rgba(255, 61, 113, 0.6); color: var(--red); }
.btn-danger:hover { background: var(--red-dim); }
.btn-ghost { color: var(--text-muted); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.text-link { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; padding: 0; color: var(--teal); font-size: 12.5px; font-weight: 500; min-height: 28px; }
.text-link:hover { color: #9be0cd; }
.text-link .arrow { display: inline-block; transition: transform var(--dur) var(--ease); }
.text-link:hover .arrow { transform: translateX(3px); }
.inline { display: inline; margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.inline-form input { flex: 1 1 160px; width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
input[type="text"], input[type="password"], input[type="datetime-local"], input[type="date"], input[type="search"], textarea, .stack select, .pick select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn); padding: 9px 12px; min-height: 40px; width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* A form select wears the same clothes as the inputs around it, with its own arrow. */
.stack select, .pick select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 34px; background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23b0bec5' stroke-width='1.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}
.stack select option, .pick select option { background: var(--panel); color: var(--text); }
/* A select beside its button in the head of a page: as wide as what it says. */
.pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; }
.pick label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.pick select { width: auto; min-width: 150px; }
input:focus, textarea:focus, select:focus, .sort-select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
::placeholder { color: var(--text-dim); }

/* Sync status with the live dot */
.sync-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-rest); transition: opacity var(--dur) var(--ease); }
.sync-status.htmx-request { opacity: 0.55; }
.htmx-added { opacity: 0; }
.sync-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sync-text { font-weight: 500; }
.live { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); will-change: transform, opacity; }
.live-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--text-dim); opacity: 0; will-change: transform, opacity; }
.sync-status.is-ok .live-dot { background: var(--green); animation: hum-dot 2.2s ease-in-out infinite; }
.sync-status.is-ok .live-ring { border-color: var(--green); animation: hum-ring 2.2s ease-out infinite; }
.sync-status.is-error .live-dot { background: var(--red); }
.sync-status.is-error .sync-text { color: #ff7a95; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); vertical-align: middle; }
.dot.is-ok { background: var(--green); }
.dot.is-error { background: var(--red); }
.dot.is-running { background: var(--amber); }
@keyframes hum-dot { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes hum-ring { 0% { opacity: 0.5; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.6); } }

/* Chips and pills */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--panel); color: var(--text-muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 180ms var(--ease); }
.chip b { color: var(--text); font-weight: 600; }
.chip a { color: inherit; }
.chip .inline { display: inline; }
.chip:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.chip-dot, .column-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.pill-green { background: var(--green-dim); color: var(--green); }
.pill-amber { background: var(--amber-dim); color: var(--amber); }
.pill-red { background: var(--red-dim); color: #ff7a95; }
.pill-dim { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }
.pill-type { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); font-weight: 500; }
.pill-teal { background: var(--teal-dim); color: var(--teal); }

/* Board */
.board { display: flex; gap: 16px; overflow-x: auto; overscroll-behavior-x: contain; padding: 4px 2px 14px; -webkit-overflow-scrolling: touch; }
.column { flex: 0 0 clamp(290px, 86vw, 360px); scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px; min-height: 240px; transition: opacity var(--dur) var(--ease); }
.column.htmx-request .cards { opacity: 0.45; }
@media (min-width: 900px) { .column { flex-basis: clamp(280px, 19.5vw, 380px); } }
/* The release board has six columns since To do stands apart (tasks/todo.md section BD), and
   its page takes the window's width (.page-wide): held to the width of the other pages, a
   wide screen had room for a column on either side of the board while the six stood squeezed
   in the middle. Where the row has room, all six fill it. Where it has not, a column is 250px
   and the row scrolls, which on a laptop shows five and the edge of the sixth; under 250px a
   card's pills and links stack a row deeper. The roadmap's columns keep the width above. */
@media (min-width: 900px) {
  .board:not(.roadmap) .column { flex-basis: max(250px, calc((100% - 80px) / 6)); }
}
/* A head under about 262px has no room for the qualifier of "QA passed", and an ellipsis cut
   it mid-word. From a tablet's width up to the window in which six columns are wider than
   that, it is left out; the chip above and the head's tooltip say it in full. */
@media (min-width: 900px) and (max-width: 1799px) {
  .board:not(.roadmap) .column-sub { display: none; }
}
.column-head { display: grid; gap: 8px; margin: 2px 4px 12px; }
.column-title { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 16px; }
.column-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.column-dot { color: inherit; }
.cards { display: grid; gap: 10px; transition: opacity var(--dur) var(--ease); }
.column-note { text-align: center; padding: 6px 0 2px; }
.stage-to_do { color: var(--text-dim); }
.stage-in_progress { color: var(--text-muted); }
.stage-in_qa { color: var(--amber); }
.stage-qa_passed { color: var(--teal); }
.stage-scheduled { color: var(--green); }
.stage-released { color: var(--text-dim); }
.column-title .count { color: var(--text-muted); }

/* A desktop column is 280px: the sort select and a worded button do not both fit, and
   used to overlap. There the button is its icon; a phone column has room for the words. */
.column-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.column-tools .btn { flex: 0 0 auto; white-space: nowrap; }
.column-tools .sort-select { min-width: 0; max-width: 100%; }
.column-sub { font: 500 12.5px/1 var(--font-ui); letter-spacing: 0; color: var(--text-muted); }
.copy-keys { gap: 6px; }
@media (min-width: 900px) {
  .copy-keys { padding-inline: 8px; }
  .copy-keys .copy-text { display: none; }
}
.sort { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
/* Positioned, so that the hidden words inside it ("Sort" of which column) belong to the board's
   own scrolling row. Left to the page, the one in a column beyond the window's edge made the
   whole page scroll sideways: with the sixth column that reached a laptop's width. */
.sort-label { position: relative; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.sort-select {
  appearance: none; -webkit-appearance: none;
  max-width: 190px; min-height: 30px; padding: 4px 26px 4px 11px;
  color: var(--text-muted); background-color: var(--panel);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23b0bec5' stroke-width='1.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.sort-select:hover { color: var(--text); border-color: var(--border-strong); }

.card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px 10px; color: var(--text); box-shadow: var(--shadow-rest); transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--border-strong); }
.card.stage-in_qa::before { background: var(--amber); }
.card.stage-qa_passed::before { background: var(--teal); }
.card.stage-scheduled::before { background: var(--green); }
.card.stage-released::before { background: var(--text-dim); }
.card.is-stuck::before, .card.is-flagged::before { background: var(--red); }
.hover-lift { position: relative; transition: transform 220ms var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.hover-lift::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--shadow-elev); opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease); }
.hover-lift:hover { transform: translateY(-2px); }
.hover-lift:hover::after { opacity: 1; }
.card.hover-lift:hover { background: var(--card-hover); border-color: var(--border-strong); }
.card-top { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.card-meta .age { margin-left: auto; }
.age { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.ring { --pct: 0; --ring: var(--teal); width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto; background: conic-gradient(var(--ring) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.1) 0); -webkit-mask: radial-gradient(circle at center, transparent 55%, #000 58%); mask: radial-gradient(circle at center, transparent 55%, #000 58%); }
.card.stage-in_qa .ring { --ring: var(--amber); }
.card.stage-scheduled .ring { --ring: var(--green); }
.card.stage-released .ring { --ring: var(--text-dim); }
.ring.is-stuck { --ring: var(--red); }
.summary { margin: 8px 0 8px; font-size: 14px; line-height: 1.45; letter-spacing: -0.005em; }
.ai-teaser { margin: -2px 0 8px; font-size: 12.5px; line-height: 1.4; color: var(--text-muted); }
.summary-grid { display: grid; gap: 12px 20px; grid-template-columns: 1fr; margin-bottom: 10px; }
@media (min-width: 900px) { .summary-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.summary-cell p { margin: 0; }
.summary-cell .eyebrow { margin-bottom: 4px; }
.ai-summary form { margin-top: 10px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--text-muted); font-size: 12px; }
.card-meta .fix { color: var(--text); }
.who { display: inline-flex; align-items: center; gap: 7px; }
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: var(--text-muted); font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 6px; }
.card-actions:empty { display: none; }
.card-row { display: grid; gap: 6px; margin-bottom: 12px; }
.card-row .card { margin-bottom: 0; }
.card-row > form { justify-self: end; }

/* Rows and lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); }
.row.hover-lift:hover { border-color: var(--border-strong); }
.row .arrow { color: var(--text-dim); margin-left: auto; }
.row-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; flex: 1; min-width: 200px; color: var(--text); }
.row-main:hover { color: var(--text); }
.row-title { font-weight: 500; }
.row.status-done .row-title, .row.status-cancelled .row-title { color: var(--text-muted); }

/* Digest */
.digest-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .digest-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1300px) { .digest-grid { grid-template-columns: repeat(3, 1fr); } }
.digest-card h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.digest-card.is-empty { opacity: 0.7; }
.digest-section h3 { display: flex; align-items: center; gap: 8px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.lines li:last-child { border-bottom: none; }
.line-summary { flex: 1 1 200px; }
.notes { margin-top: 12px; white-space: pre-wrap; color: var(--text-muted); }

/* Sync runs */
.runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.run { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); transition: border-color var(--dur) var(--ease); }
.run:hover { border-color: var(--border-strong); }
.run.is-error { border-color: rgba(255, 61, 113, 0.35); background: rgba(255, 61, 113, 0.05); }
.run-status { display: grid; place-items: center; }
.run-main { min-width: 0; }
.run-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.run-when { font-weight: 600; font-variant-numeric: tabular-nums; }
.run-detail { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; }
.run-error { color: #ff7a95; }
.run-count { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }

/* Telegram updates switch */
.switch-form { display: inline-flex; transition: opacity var(--dur) var(--ease); }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px 0 8px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--panel); color: var(--text-muted); font: inherit; cursor: pointer; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 180ms var(--ease); }
.switch:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.12); transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.switch.is-on { color: var(--text); }
.switch.is-on .switch-track { background: var(--teal-dim); box-shadow: inset 0 0 0 1px var(--teal-glow); }
.switch.is-on .switch-knob { transform: translateX(16px); background: var(--teal); }
.switch-label { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.switch-form.htmx-request .switch { opacity: 0.6; }

/* Priorities */
.pill-prio { background: var(--teal-dim); color: var(--teal); }
.pill-prio.is-urgent { background: var(--red-dim); color: #ff7a95; }
.prio-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; }
.prio-head h2 { margin-bottom: 8px; }
.prio-list, .task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prio-item, .task-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); transition: border-color var(--dur) var(--ease); }
.prio-item:hover { border-color: var(--border-strong); }
.prio-item.is-urgent, .task-item.is-overdue { border-color: rgba(255, 61, 113, 0.35); }
.task-item .task-id { font: 12px/1 var(--mono); color: var(--text-dim); }
.task-actions { display: inline-flex; gap: 12px; margin-left: auto; }
.progress { height: 6px; margin: 8px 0 6px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress > span { --pct: 0; display: block; height: 100%; width: calc(var(--pct) * 1%); background: var(--teal); border-radius: inherit; }
.roadmap .column { min-height: 180px; }
.roadmap-card .row-title { color: var(--text); }
.inline-form select { min-height: var(--tap); }
.task-item.is-done .task-body { text-decoration: line-through; color: var(--text-muted); }
.prio-item.is-handled { opacity: 0.65; }
.prio-item.is-handled .prio-summary { text-decoration: line-through; }
.prio-summary, .task-body { flex: 1; min-width: 160px; }
.chip.is-active { color: var(--text); border-color: var(--teal); background: var(--teal-dim); }

/* Today: headline and the digest lines */
.headline { font-size: 16px; line-height: 1.5; margin: 0 0 6px; max-width: 72ch; }
.digest-card h2 .muted { font: 500 12.5px/1.3 var(--font-ui); letter-spacing: 0; }
.quiet { margin: 0 0 14px; }
.line-heading { padding-top: 6px; }
.line-heading:first-child { padding-top: 0; }
.line-person { font-weight: 600; }
.line-footer { margin: 8px 0 0; }
.no-release { margin-top: 18px; }
.no-release > summary { cursor: pointer; font-weight: 600; }
.prio-history { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.prio-history > summary { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; list-style: none; color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.prio-history > summary::-webkit-details-marker { display: none; }
.prio-history > summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.prio-history[open] > summary::before { transform: rotate(45deg); }
.prio-history > summary:hover { color: var(--text); }
.prio-list-block + .prio-list-block { margin-top: 14px; }
.prio-history .prio-list-block { margin-top: 12px; }
.prio-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 6px; }
.prio-list-head p { margin: 0; }
.prio-label-edit summary, .est-edit summary { list-style: none; cursor: pointer; }
.prio-label-edit summary::-webkit-details-marker, .est-edit summary::-webkit-details-marker { display: none; }
/* The estimate field of a board card: a text link until it is opened, then a row of its own. */
.est-edit[open] { flex-basis: 100%; }
.est-edit .prio-label-form { flex-wrap: nowrap; margin-bottom: 4px; }
.est-edit .prio-label-form input[type="text"] { flex: 1 1 auto; width: auto; min-width: 0; }
.prio-label-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.prio-label-form input[type="text"] { min-height: 34px; padding: 0 10px; font-size: 13px; width: min(100%, 260px); }
.prio-list.is-past .prio-item { opacity: 0.8; }
.prio-list.is-past .prio-item.is-handled { opacity: 0.55; }
.reply { white-space: pre-wrap; font: 13px/1.5 var(--mono); color: var(--text); margin: 0 0 18px; }

/* Phones */
@media (max-width: 768px) {
  h1 { font-size: 26px; }
  .topbar { gap: 10px; }
  .brand-text { display: none; }
  .btn, .nav a { min-height: var(--tap); }
  .btn-sm { min-height: 40px; }
  .page { padding-top: 16px; }
  .page-head { gap: 12px; }
  .sync-status { width: 100%; }
  .nav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; }
  .switch { display: none; }
  .logout-text { display: none; }
  .logout-icon { display: block; }
  .logout .btn { padding-inline: 12px; }
  .chips { position: sticky; top: var(--topbar); z-index: 10; margin: 0 calc(-1 * clamp(16px, 4vw, 32px)); padding: 8px clamp(16px, 4vw, 32px) 10px; background: rgba(19, 32, 35, 0.96); }
  .board { margin: 0 calc(-1 * clamp(16px, 4vw, 32px)); padding: 6px clamp(16px, 4vw, 32px) 14px; scroll-padding: 0 clamp(16px, 4vw, 32px); scroll-snap-type: x mandatory; }
  .run { grid-template-columns: 18px minmax(0, 1fr); }
  .run-count { grid-column: 2; text-align: left; }
}

/* Reduced motion keeps the short fades and drops movement: lifts, nudges, the breathing dot. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-dot, .live-ring { animation: none !important; }
  .hover-lift:hover, .chip:hover, .switch:hover, .btn-primary:hover, .btn:active, .text-link:hover .arrow, .page.htmx-added { transform: none !important; }
  ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Ticket page (section S) */
.ticket-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 18px; align-items: start; }
.ticket-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.ticket-title .key { font-size: 15px; }
.ticket-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--text-muted); font-size: 12.5px; }
.ticket-meta b { color: var(--text); font-weight: 500; }
.ticket-meta .avatar { vertical-align: middle; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; }
.rendered { line-height: 1.55; overflow-wrap: anywhere; font-size: 13.5px; }
.rendered p { margin: 0 0 10px; }
.rendered p:last-child { margin-bottom: 0; }
.rendered ul, .rendered ol { margin: 0 0 10px; padding-left: 22px; }
.rendered pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 10px 12px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; }
.rendered code, .rendered tt { font-family: var(--mono); font-size: 12.5px; }
.rendered table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 0 0 10px; }
.rendered th, .rendered td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.rendered blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid var(--border-strong); color: var(--text-muted); }
.rendered a { color: var(--teal); }
.rendered h1, .rendered h2, .rendered h3, .rendered h4, .rendered h5, .rendered h6 { font-size: 15px; margin: 12px 0 6px; }
.img-placeholder { display: inline-block; padding: 1px 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-pill); color: var(--text-muted); font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--text-muted); font-size: 12px; padding-top: 3px; white-space: nowrap; }
.timeline .head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.timeline .who { font-weight: 500; font-size: 13px; }
.timeline .note-body { white-space: pre-wrap; font-size: 13.5px; }
.timeline li.is-note { background: var(--teal-dim); margin: 0 -8px; padding: 10px 8px; border-radius: var(--radius-btn); border-bottom: none; }
.related h3 { font-family: var(--font-ui); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 4px; }
.related h2 + h3 { margin-top: 0; }
.note-form textarea { width: 100%; min-height: 84px; box-sizing: border-box; }

/* Meetings: the notes he pasted, folded away under the tickets they named (section AB3). */
.meeting .lines li { align-items: flex-start; }
.meeting-body { margin-top: 12px; }
.meeting-body summary { cursor: pointer; }
.meeting-body pre { margin: 10px 0 0; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-btn); white-space: pre-wrap; overflow-wrap: break-word; font-family: var(--mono); font-size: 12.5px; }

/* Search: one wide box and its button, the results as plain rows (section AB4). */
.search-form { margin: 0 0 20px; }
.search-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.search-row input[type="search"] { flex: 1 1 auto; max-width: 520px; min-width: 0; }
.search-row .btn { flex: 0 0 auto; }

/* Deploy report: the draft as it will paste, indentation kept, long lines wrapped for editing. */
.deploy-report .report-form { margin-top: 12px; }
.deploy-report textarea {
  width: 100%; min-height: 340px; box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.deploy-report.htmx-request { opacity: 0.55; }
/* Call prep: the cue sheet above the week (section AD). One column per person on a wide
   screen, stacked on a phone. The question is the loud line; the fact under the ticket is
   the quiet one, because the fact is what he can rely on and the question is only a prompt. */
.call-prep { margin-bottom: 20px; }
.call-prep .panel-head { align-items: flex-start; }
.call-prep .panel-head p { margin: 4px 0 0; max-width: 62ch; }
.cue-groups { display: grid; gap: 16px 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cue-groups { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1300px) { .cue-groups { grid-template-columns: repeat(3, 1fr); } }
.cue-group h3 {
  margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  font: 600 13px/1.3 var(--font-ui); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}
.cues { list-style: none; margin: 0; padding: 0; }
.cue { padding: 10px 0; border-bottom: 1px solid var(--border); }
.cue:last-child { border-bottom: none; }
.cue p { margin: 0; }
.cue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cue-fact { margin-top: 3px; }
.cue-tickets { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.cue-said { margin-top: 4px; font-style: italic; }
.cue-question {
  margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--teal-glow);
  color: var(--text); font-size: 14px;
}
/* What he says to the room rather than asks: the same shape, a warmer edge. */
.cue-shipped .cue-question, .cue-decision .cue-question { border-left-color: var(--amber); }
.call-prep.htmx-request { opacity: 0.55; }

@media (max-width: 860px) {
  .ticket-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}
