/* Copied from the phone app's style.css by build.py: edit the original, then run build.py. */
/* Dark only (owner, 2026-11-23): one set of colours, whatever the iPhone's setting. */
:root {
  color-scheme: dark;
  --bg: #000000;
  --fg: #f2f2f7;
  --muted: #98989f;
  --line: #38383a;
  --card: #1c1c1e;
  --accent: #4c9bff;
  --accent-bg: #13263f;  /* the bar's current section: the banner's blue tint */
  --error: #ff6b60;
  --reply: #13263f; /* chat replies: a blue tint, so they differ from yours */
  --question: #ff6b60;    /* a plan's open questions: red */
  --question-bg: #2b1513;
  --assumption: #4c9bff;  /* a plan's assumptions: blue */
  --assumption-bg: #13263f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Safari: follow the iPhone's text size (Dynamic Type); other browsers ignore this and keep
     17px. The shorthand resets line-height and family, so both are set again after it. */
  font: -apple-system-body;
  line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
header {
  position: sticky;
  top: 0;
  /* Above the page: list rows are positioned (for swipe-to-delete) and would otherwise
     scroll over the bar. A lifted row while dragging (z-index 10) still goes over it. */
  z-index: 4;
  /* Clear of the notch and the corners at the sides too, in landscape. */
  padding: calc(env(safe-area-inset-top) + 12px) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
/* One line always: it shrinks with an ellipsis rather than wrapping and growing the header. */
header .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
header h1.title { margin: 0; font-size: 1.5em; font-weight: 700; line-height: 1.2; }
.gear { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -6px -10px -6px 0; color: var(--muted); }
.gear svg { width: 24px; height: 24px; }
.gear[aria-current="page"] { color: var(--accent); }
main { padding: 16px max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 32px) max(16px, env(safe-area-inset-left)); max-width: 720px; margin: 0 auto; }
/* A long unbroken word (a slug, a path, a title) wraps inside its box rather than widening the page. */
main { overflow-wrap: anywhere; }
/* The page ends clear of the floating bar. */
body:not(.no-bar) main { padding-bottom: calc(env(safe-area-inset-bottom) + 104px); }
a { color: var(--accent); }

.ideas { list-style: none; margin: 0; padding: 0; }
.ideas li + li { margin-top: 8px; }
.ideas a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 44px;
  background: var(--card);
  border-radius: 12px;
  color: var(--fg);
  text-decoration: none;
}
/* Small text is in em (13px or 14px at the default 17px), so it scales with the iPhone's text size. */
.ideas .meta { color: var(--muted); font-size: 0.82em; }
/* The Ideas and Built search: the app's input look, one height whatever is typed. */
.list-search {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0 0 12px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
}
.ideas .no-match { padding: 4px 0; }

/* Status is shown as a glyph and a word, so it never relies on colour alone. */
.status {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.76em;
  color: var(--muted);
}

/* A whole 44 px line to tap, with the same space under it as before. */
.back { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0 2px; }
.muted { color: var(--muted); }
.error { color: var(--error); }

details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }

/* A plan's open question or assumption, with its own answer box (idea screen). */
.ask { margin-top: 12px; padding: 4px 12px 8px; border-left: 4px solid; border-radius: 8px; }
.ask.question { border-color: var(--question); background: var(--question-bg); }
.ask.orphan { border-color: var(--muted); background: transparent; border: 1px dashed var(--muted); border-left-width: 4px; }
.ask.assumption { border-color: var(--assumption); background: var(--assumption-bg); }
/* A follow-up sits under its question, a step in per level (shown at most 3 levels deep). */
.ask.depth-1 { margin-left: 14px; margin-top: 6px; }
.ask.depth-2 { margin-left: 28px; margin-top: 6px; }
.ask-state { text-transform: none; letter-spacing: 0; font-weight: 500; }
.past { margin: 6px 0 0; padding-left: 18px; }
.ask-label { margin: 8px 0 0; font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ask.question .ask-label { color: var(--question); }
.ask.assumption .ask-label { color: var(--assumption); }
.ask details { margin-top: 4px; border-top: 0; padding-top: 0; }

.md { overflow-wrap: anywhere; }
.md pre { overflow-x: auto; background: var(--card); padding: 12px; border-radius: 8px; font-size: 14px; }
.md code { font-size: 0.9em; }
.md table { display: block; overflow-x: auto; border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; }

form label { display: block; font-weight: 600; margin-bottom: 8px; }
form input {
  width: 100%;
  padding: 12px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
}
button {
  margin-top: 12px;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}
.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.switch input { width: 22px; height: 22px; margin: 0; }
.link-button { background: none; color: var(--accent); padding: 0; margin-top: 24px; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
button:disabled { opacity: 0.45; }
/* Delete idea / Delete chat: the same red as the swipe-revealed Delete. */
button.danger { background: #ff453a; }
/* Headings get focus on a new screen only to place VoiceOver there; no ring. */
[tabindex="-1"]:focus { outline: none; }

.msg { margin-bottom: 16px; }
.msg .who { font-size: 0.76em; font-weight: 600; color: var(--muted); }
.msg.user p { margin: 4px 0 0; padding: 10px 12px; background: var(--card); border-radius: 12px; }
.msg.assistant > .md, .msg.assistant > p.error {
  margin: 4px 0 0;
  padding: 10px 12px;
  background: var(--reply);
  border-radius: 12px;
}
.msg.assistant > .md > :first-child { margin-top: 0; }
.msg.assistant > .md > :last-child { margin-bottom: 0; }
form select {
  width: 100%;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
}
.msg .note { margin: 2px 0 0; font-size: 0.76em; }
form textarea {
  width: 100%;
  padding: 12px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into the field */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  resize: vertical;
}
/* Two lines reserved, so status text appearing never moves the button below it. */
.status-line { min-height: 2.9em; margin: 8px 0 0; }

.tabs svg { width: 20px; height: 20px; vertical-align: -4px; }
h2 { font-size: 20px; margin: 24px 0 8px; }
main > h2:first-child { margin-top: 0; }
fieldset.choices { border: 0; margin: 0; padding: 0; }
.choices label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.choices input { width: 22px; height: 22px; margin: 0; }
form input[type="checkbox"] { width: 22px; height: 22px; margin: 0; }
form .check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: normal; margin-top: 12px; }
form label + input, form label + textarea { margin-bottom: 12px; }
.choices label.status-choice { align-items: flex-start; padding: 6px 0; }
.choices .status-choice input { margin-top: 3px; }

/* Ideas | Built switch at the top of the Projects tab. */

/* Swipe-to-delete: the row slides left off a red Delete button labelled in words. */
.ideas li.swipe { position: relative; overflow: hidden; border-radius: 12px; }
.ideas .delete {
  position: absolute; inset: 0 0 0 auto; width: 96px; margin: 0;
  border-radius: 0; background: #ff453a; color: #fff; font-weight: 600;
}
.ideas li.swipe .row { position: relative; transition: transform 0.2s ease; touch-action: pan-y; }
.ideas li.open .row { transform: translateX(-96px); }
/* Hidden at rest, so no red shows at the rounded corners of a closed row. */
.ideas li.swipe:not(.open):not(.dragging) .delete { visibility: hidden; }
.next-step { margin: 12px 0 8px; }
.next-step .status-line { margin-top: 6px; }
.model-pill { white-space: nowrap; }

/* Chat reply bar: fixed to the bottom once a chat has messages. The status line keeps its
   one line of space, so text appearing there never moves the bar. */
.above-bar { padding-bottom: 120px; }
.composer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.composer-bar > * { max-width: 696px; margin-left: auto; margin-right: auto; }
.composer-bar .status-line { min-height: 1.4em; margin-top: 0; margin-bottom: 6px; font-size: 0.76em; }
.composer-bar .bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
}
/* Inside the bar, undo the app-wide form styles (margins and 44px minimums) that stretched it. */
.composer-bar .bar > * { margin: 0; }
.composer-bar select {
  flex: none;
  width: 40px;
  min-height: 0;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 20px;
  appearance: none;
  -webkit-appearance: none;
}
.composer-bar textarea {
  flex: 1;
  min-width: 0;
  height: 36px;
  max-height: 140px;
  padding: 7px 6px;
  border: none;
  background: transparent;
  font-size: 17px;
  line-height: 22px;
  resize: none;
}
.composer-bar textarea:focus { outline: none; }
.composer-bar button.icon {
  flex: none;
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}
.composer-bar #attach { background: transparent; color: var(--fg); font-size: 26px; font-weight: 300; }
button.secondary { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.pending:not(:empty) { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.82em;
}
.file-chip .remove { min-height: 0; margin: 0; padding: 0 2px; background: none; color: var(--muted); font-size: 18px; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; justify-content: flex-start; }
img.attachment { max-width: 70%; max-height: 240px; border-radius: 12px; background: var(--card); }
.queue { padding-left: 0; }
.queue .step {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* The idea screen's Run this idea card: a model, then Plan tonight / Build tonight. A queued
   button keeps its size (only its words and outline change), so nothing moves. */
.run-card { margin: 12px 0 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.run-title { margin: 0 0 8px; font-weight: 600; }
.segs { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segs .seg { flex: 1; margin: 0; min-height: 44px; padding: 0; border-radius: 0; background: var(--bg); color: var(--fg); }
.segs .seg + .seg { border-left: 1px solid var(--line); }
.segs .seg[aria-pressed="true"] { background: var(--accent); color: #fff; }
.now-row { display: flex; gap: 8px; }
.now-row button { flex: 1; margin-top: 10px; min-height: 56px; padding: 6px 10px; line-height: 1.25; }
.now-row .cost { display: block; font-size: 12px; color: var(--muted); }
.now-row button.queued { border: 2px solid var(--accent); color: var(--accent); }
.run-card .link { margin-top: 0; min-height: 44px; padding: 0; background: none; color: var(--accent); }

/* Running now: banner on Projects and the status screen. */
.banner { display: block; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--accent);
  border-radius: 12px; background: var(--reply); color: inherit; text-decoration: none; }
.banner-title { display: block; font-weight: 600; }
.banner-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 0.82em; }
/* This week's "recap isn't made yet": amber (build's and Waiting's colour), the word Overdue beside the glyph. */
.banner.overdue { margin: 4px 0 14px; border-color: #ffb340; background: #33230b; }
.banner.overdue .banner-title { color: #ffb340; } .banner.overdue .banner-sub { color: var(--fg); }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
  background: #34c759; vertical-align: 1px; }
.card-box { margin-bottom: 12px; padding: 12px; border-radius: 12px; background: var(--card); }
.card-box h3 { margin: 0 0 8px; font-size: 15px; }
.progress { height: 6px; margin: 8px 0 4px; overflow: hidden; border-radius: 3px; background: var(--line); }
.progress i { display: block; height: 100%; background: var(--accent); }
.agent-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--line); }
.agent-row:first-of-type { border-top: 0; }
.agent-row > .status { flex: none; white-space: nowrap; }
.status.live { color: #4cd07a; border-color: currentColor; }
.todo { padding: 4px 0; }
.todo.in_progress { font-weight: 600; }
.todo.pending { color: var(--muted); }

/* Up next: hold to drag. */
.drag { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.drag.lifted { position: fixed; z-index: 10; pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); opacity: 0.95; }
.placeholder { list-style: none; border: 2px dashed var(--accent); border-radius: 12px; margin-bottom: 8px; }
.drop { min-height: 56px; }
.hidden-empty { display: none; }
.save-bar { display: flex; gap: 8px; }
.save-bar button { margin-top: 0; }

/* Usage charts (#/usage). Provider colours are the first three slots of a palette checked for
   colour-blind separation; Claude uses the app accent. "Other" is hatched, so it never relies on colour. */
:root { --c-lemonade: #d95926; --c-codex: #199e70; }
.usage-row { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; margin-top: 8px;
  border-radius: 12px; background: var(--card); color: var(--fg); text-decoration: none; }
.usage-row::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 22px; }

/* News recap (#/news): a card per group, its stories stepper in the heading's line, its outlets as
   switches. The lean dot uses the app's own blue and red, grey for centre and none; the word says it. */
.news-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.news-head h3 { margin: 0; font-size: 0.82em; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { margin: 0; min-width: 44px; padding: 0; background: var(--bg); color: var(--accent); border: 1px solid var(--line); font-weight: 700; }
.stepper output { min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.news-feed { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--line); }
.news-head + .news-feed { border-top: 0; }
.news-name { flex: 1; min-width: 0; }
.news-name .muted { font-size: 0.82em; }
.news-feed input { flex: none; margin: 0; }  /* the native switch on iOS 17.4+ (the switch attribute), a checkbox elsewhere */
.lean { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.lean-left { background: var(--accent); }
.lean-right { background: var(--error); }
.news-changed { color: var(--accent); font-size: 0.82em; font-weight: 600; }
output.news-changed { font-size: inherit; }
.chart-title { margin: 24px 0 4px; font-size: 16px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick, .chart .value { fill: var(--muted); font-size: 11px; }
.chart .value { fill: var(--fg); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .dot-auto { fill: var(--accent); }
.chart .dot-manual { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart .allowance { stroke: var(--fg); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .reset { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .bar-value { font-size: 9px; }
.seg-claude { fill: var(--accent); background: var(--accent); }
.seg-lemonade { fill: var(--c-lemonade); background: var(--c-lemonade); }
.seg-codex { fill: var(--c-codex); background: var(--c-codex); }
.seg-other { fill: url(#hatch-other); }
.chart .hatch-bg { fill: var(--card); }
.chart .hatch-line { stroke: var(--muted); stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 6px; padding: 0; list-style: none; font-size: 0.76em; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key-auto { border-radius: 50%; background: var(--accent); }
.key-manual { border-radius: 50%; border: 2px solid var(--accent); }
.key-other { border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, var(--muted) 0 2px, var(--card) 2px 5px); }
.chart-caption { margin: 4px 0 0; font-size: 0.76em; }
/* Forecast to the reset (dashed) and the cap it stops at. */
.chart .forecast { stroke-dasharray: 5 4; }
.chart .cap { stroke: var(--muted); stroke-dasharray: 2 3; }
.chart .dot-forecast { fill: var(--bg); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 2 2; }
.key-forecast { border: 2px dashed var(--accent); }
/* Run metrics: a state in words first (never colour alone), then the numbers. */
.metrics-title { margin-top: 32px; }
.verdict { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--card); font-size: 15px; }
.verdict strong { display: block; }
.verdict-not, .verdict-over { background: var(--question-bg); color: var(--question); }
.stats { display: flex; gap: 8px; } .stats div { flex: 1; padding: 8px 10px; border-radius: 10px; background: var(--card); }
.stats b { display: block; font-size: 20px; } .stats span { font-size: 12px; color: var(--muted); }
.metric-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.metric-table td, .metric-table th { text-align: left; padding: 6px 2px; border-top: 1px solid var(--line); vertical-align: top; }
.metric-table th { color: var(--muted); font-weight: 500; font-size: 12px; border: 0; }
.outcomes { margin: 6px 0 0; padding: 0; list-style: none; font-size: 14px; }
.outcomes li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.outcomes strong { white-space: nowrap; }
.chart-empty { padding: 24px 12px; border-radius: 12px; background: var(--card); text-align: center; }

/* Plan mockups: a phone-sized picture, framed so it reads as a screen. */
.md img { max-width: 100%; }
.md img.mockup { display: block; width: 260px; border: 1px solid var(--line); border-radius: 16px; }
.md img.mockup[src], .ref-pic img { cursor: zoom-in; }  /* a tap opens it full screen (viewer.js) */

/* The morning line on the list: what the last run did, linking to the status page. */
.last-run { display: block; margin-bottom: 14px; min-height: 44px; padding: 10px 0; text-decoration: none; }
.report { margin: 0; padding-left: 1.2em; }
.report li + li { margin-top: 6px; }

/* Lemonade's suggested answers: tapping one fills the answer box. */
.chips-label { margin: 0 0 6px; font-size: 0.85em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--bg); color: var(--fg); font: inherit; font-size: 0.9em; text-align: left; }

/* An idea screen's own header: back, title, status, ⋯ menu, then the idea's tabs. */
header.idea-head { flex-wrap: wrap; justify-content: flex-start; row-gap: 0; padding-bottom: 0; }
header.idea-head .back { flex: none; display: flex; align-items: center; min-height: 44px; margin: 0; text-decoration: none; }
header.idea-head .title { flex: 1; }
header.idea-head details.more { position: relative; flex: none; border: 0; margin: 0; padding: 0; }
header.idea-head details.more summary { position: relative; min-height: 44px; min-width: 44px; justify-content: center; font-size: 1.3em; list-style: none; }
/* The idea has sub-ideas or notes: a dot on ⋯'s corner, out of the line, so nothing in the header moves. */
.more-dot { position: absolute; top: 9px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
header.idea-head details.more summary::-webkit-details-marker { display: none; }
/* At large text the back link, status and ⋯ leave the title a letter or two ("R…"), so below
   18em (scales with Dynamic Type) the title takes its own full row under them instead. */
header.idea-head { container-type: inline-size; }
@container (max-width: 18em) {
  header.idea-head .status { order: 1; margin-left: auto; }
  header.idea-head details.more { order: 2; }
  header.idea-head .title { order: 3; flex-basis: 100%; }
  header.idea-head .idea-tabs { order: 4; }
}
.menu { position: absolute; right: 0; top: 44px; z-index: 5; width: 230px; padding: 6px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.menu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--fg); text-decoration: none; }
.menu a + a { border-top: 1px solid var(--line); }
.menu a.danger-text { color: #ff453a; }
.menu-count { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 0.88em; font-variant-numeric: tabular-nums; }
/* The tabs share the width evenly, edge to edge. */
.idea-tabs { display: flex; width: calc(100% + 32px); margin: 4px -16px 0; padding: 0 4px; overflow-x: auto; }
/* Like the main tabs: an underline and colour mark the current one, never weight, so nothing shifts. */
.idea-tabs a { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 6px; color: var(--muted);
  text-decoration: none; font-size: 0.88em; border-bottom: 2px solid transparent; white-space: nowrap; }
.idea-tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: currentColor; }
.idea-tabs a.empty { opacity: 0.45; }
/* The smallest iPhones: a little tighter, so the tabs still fit without sideways scrolling. */
@media (max-width: 360px) { .idea-tabs a { padding: 0 3px; font-size: 0.8em; } .count { margin-left: 2px; padding: 0 4px; } }
.count { display: inline-block; min-width: 1.4em; margin-left: 4px; padding: 0 5px; border-radius: 999px;
  background: var(--card); font-size: 0.85em; text-align: center; }
.count.red { background: var(--question); color: #fff; }

/* Sub-ideas on the parent's screen. */
.sub-card { margin-bottom: 10px; padding: 12px 14px; border-radius: 12px; background: var(--card); }
.sub-card .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; min-height: 44px; }
.sub-card .why { margin: 4px 0 0; font-size: 0.86em; color: var(--muted); }
.row-actions { display: flex; gap: 8px; margin-top: 10px; }
.row-actions button { flex: 1; }
#sub-form input { width: 100%; box-sizing: border-box; }

/* Whose turn: feedback given (the next run uses it) or questions awaiting your answers. */
.fb-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fb { padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 0.76em; }
.fb.given { color: var(--accent); }
.fb.waiting { color: #ffb340; }

/* Suggested groupings on the Ideas screen */
.group-list { list-style: none; margin: 0 0 8px; padding: 0; }
.group-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.group-list li:first-child { border-top: 0; }
.group-reason { display: block; margin-top: 2px; }
.group-actions { display: flex; gap: 8px; margin-top: 8px; }
.group-msg { display: block; min-height: 1.4em; margin-top: 4px; }

/* Status colours, the same as the control panel's (planner-status-colours-match): blue new, purple
   planned, green ready, amber build, teal built, grey done (a built idea with a done: line). Always
   beside the glyph and the word, never the only sign of a status. */
.st-new { --st: #7aa9ff; --st-bg: #14213d; }
.st-planned { --st: #b69cff; --st-bg: #241a40; }
.st-ready { --st: #4cd07a; --st-bg: #0d2a22; }
.st-build { --st: #f6b44b; --st-bg: #33230b; }
.st-built { --st: #45d0c4; --st-bg: #0c2826; }
.st-done { --st: #aeaeb2; --st-bg: #23262b; }
.st-suggested, .st-none { --st: var(--muted); --st-bg: transparent; }
.status[class*="st-"] { background: var(--st-bg); border-color: var(--st); color: var(--fg); }
.status[class*="st-"] > span[aria-hidden] { color: var(--st); }
.status.st-suggested { border-style: dashed; }
/* Projects list: the row's left edge carries the status colour too; the text keeps its place. */
.ideas a.edge { border-left: 4px solid var(--st); padding-left: 12px; }
.edge .idea-title { font-weight: 600; }

/* Questions waiting: the count on the bar's Ideas (its place is always there) and the list's line. */
.tab-count.none { visibility: hidden; }
.waiting-line { margin: 0 0 12px; }
.waiting-line a { display: flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; color: #ffb340; }

/* The bottom bar (C): a floating pill, Home and Ideas left of the +, Up next and Built right of it.
   Each side shares its width, the current item taking twice its share for its word, so the + never
   leaves the middle. The words are a fixed size, as in iOS tab bars, so the largest text sizes
   can't push them out of the pill. */
.bar { position: fixed; z-index: 6; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 10px);
  max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px;
  padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); }
body.no-bar .bar { display: none; }
/* Scrolling down a list slides it out of view (bar-scroll.js); it is fixed, so nothing else moves.
   Hidden only once it has left the screen (visibility waits for the slide); shown at once. */
.bar { transition: transform 0.2s ease, visibility 0s; }
.bar.hidden { transform: translateY(calc(100% + 32px + env(safe-area-inset-bottom))); visibility: hidden;
  transition: transform 0.2s ease, visibility 0s 0.2s; }
@media (prefers-reduced-motion: reduce) { .bar, .bar.hidden { transition: none; } }
.bar-side { display: flex; gap: 4px; min-width: 0; }
.bar-side a { position: relative; flex: 1 1 0; min-width: 44px; min-height: 48px; display: flex; align-items: center; justify-content: center;
  gap: 6px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.bar-side a[aria-current="page"] { flex-grow: 2; background: var(--accent-bg); color: var(--accent); }
.bar-side svg { flex: none; }
.bar-word { font-size: 15px; white-space: nowrap; }
.bar-side a:not([aria-current]) .bar-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bar-plus { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; }

/* Home: four cards, each one line with a link under it, the whole card a tap target. */
.home-card { display: block; min-height: 44px; color: var(--fg); text-decoration: none; }
.home-card h3 { margin: 0 0 4px; font-size: 0.82em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.home-line, .home-more { display: block; }
.home-more { margin-top: 2px; color: var(--muted); font-size: 0.88em; }
.home-card .q-count { color: var(--question); font-weight: 600; }

/* Changes (X1): a muted heading per day, then a card per chat patch (blue), run (green) or the
   rest (grey): a coloured left bar and a tinted header with its name, count and time (the name is
   the word, the colour adds). Each row is its area, in the area's colour, a short title and one
   muted line of the rest. */
.day-head { margin: 18px 0 8px; font-size: 0.82em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.day-head:first-child { margin-top: 0; }
.cgroup { margin: 0 0 12px; border-left: 4px solid var(--cg); border-radius: 12px; background: var(--card); overflow: hidden; }
.cg-chat { --cg: var(--accent); --cg-bg: var(--accent-bg); }
.cg-nightly { --cg: #4cd07a; --cg-bg: #0d2a22; }
.cg-plan-now { --cg: #4fd1a1; --cg-bg: #0d2a22; }
.cg-other { --cg: #aeaeb2; --cg-bg: #2c2c2e; }
.cg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; padding: 9px 14px; background: var(--cg-bg); }
.cg-name { font-weight: 700; color: var(--cg); }
.cg-started { font-weight: normal; font-size: 0.85em; color: var(--muted); white-space: nowrap; }
.cg-meta { margin-left: auto; font-size: 0.82em; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.changes { list-style: none; margin: 0; padding: 0 14px; }
.changes li + li { border-top: 1px solid var(--line); }
/* Every row is a fold: its line (at least 44 px, a + that turns to −) opens in place to the
   full subject, the body (its own line breaks kept, long words wrapped) and the time, so
   opening one grows it downwards and nothing above moves. */
details.ch { margin: 0; border: 0; padding: 0; }
details.ch > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 0; font-weight: normal; list-style: none; }
details.ch > summary::-webkit-details-marker { display: none; }
.ch-sum { flex: 1; min-width: 0; }
.ch-more { flex: none; width: 1.2em; text-align: center; font-size: 1.15em; color: var(--muted); }
.ch-more::before { content: '+'; }
details.ch[open] .ch-more::before { content: '\2212'; }
.ch-line, .ch-rest { display: block; overflow-wrap: anywhere; }
.ch-rest { margin-top: 2px; font-size: 0.85em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.ch[open] .ch-rest { display: none; }
.ch-full { padding: 0 0 12px; overflow-wrap: anywhere; }
.ch-full p { margin: 0 0 8px; }
.ch-subject { font-weight: 600; }
.ch-body { white-space: pre-wrap; font-size: 0.92em; }
.ch-time { color: var(--muted); font-size: 0.85em; }
.area { font-weight: 600; }
.area-phone { color: var(--accent); }
.area-panel { color: #b69cff; }
.area-cs2 { color: #f6b44b; }
.area-tests { color: #45d0c4; }
.area-planner { color: #4fd1a1; }
.area-other { color: var(--muted); }

/* Up next: the rows tonight's run reaches get a left stripe, a bold title and the word Tonight.
   Every row keeps the stripe's width (transparent), so marking one never moves its text. */
.tonight-line { margin: 0 0 10px; font-size: 0.9em; }
.queue li.drag > a { border-left: 5px solid transparent; padding-left: 11px; }
.queue li.tonight > a { border-left-color: var(--accent); }
.queue li.tonight .idea-title { font-weight: 700; }
.tonight-tag { display: none; color: var(--accent); font-weight: 600; }
.queue li.tonight .tonight-tag { display: inline; }
/* The kind of step has a colour as well as its words. */
.kind { font-weight: 600; }
.kind-build { color: #f6b44b; }
.kind-check { color: #b69cff; }
.kind-feedback { color: var(--accent); }
.kind-first { color: #4fd1a1; }

/* A table scrolls sideways inside its own box instead of being squeezed or cut off. */
.table-scroll { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.md .table-scroll table { display: table; width: max-content; max-width: none; overflow-wrap: normal; word-break: normal; }
.md .table-scroll th, .md .table-scroll td { min-width: 5em; max-width: 18em; vertical-align: top; text-align: left; }
.md .table-scroll th { background: var(--card); }

/* The Plan tab: each section is a fold, coloured by what it is (its kind also as a word in a chip).
   Its line is at least 44 px and the same open or closed, so opening it grows the block downwards
   and nothing above moves; the glyph is drawn here because the line is a flex box (no marker). */
.plan-sec { margin: 20px 0; padding: 0 14px; border-top: 0; border-left: 4px solid var(--line); border-radius: 8px; }
.plan-sec[open] { padding-bottom: 10px; }
.plan-sec > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; }
.plan-sec > summary::-webkit-details-marker { display: none; }
.plan-sec > summary::before { content: '▸'; width: 0.8em; flex: none; color: var(--muted); }
.plan-sec[open] > summary::before { content: '▾'; }
.plan-sec > summary h2 { margin: 8px 0; font-size: 1.1em; }
.sec-chip { flex: none; border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; font-size: 0.75em; font-weight: 600; }
.sec-count { flex: none; margin-left: auto; color: var(--muted); font-size: 0.85em; font-weight: normal; white-space: nowrap; }
.sec-goal { border-color: #4fd1a1; background: #0d2a22; }
.sec-goal :is(h2, .sec-chip) { color: #4fd1a1; }
.sec-risk { border-color: #f6b44b; background: #33230b; }
.sec-risk :is(h2, .sec-chip) { color: #f6b44b; }
.sec-assumption { border-color: var(--assumption); background: var(--assumption-bg); }
.sec-assumption :is(h2, .sec-chip) { color: var(--assumption); }
.sec-question { border-color: var(--question); background: var(--question-bg); }
.sec-question :is(h2, .sec-chip) { color: var(--question); }
.sec-milestone { border-color: #b69cff; background: #241a40; }
.sec-milestone :is(h2, .sec-chip) { color: #b69cff; }
.sentences { padding-left: 20px; }
.sentences li + li { margin-top: 4px; }
/* The count sits on the icon's corner, out of the line, so the bar's items keep their places. */
.tab-count { position: absolute; top: 3px; left: calc(50% + 4px); margin: 0; padding: 0 4px; min-width: 1.5em; font-size: 11px; line-height: 1.5; text-align: center; }
.bar-side a[aria-current="page"] .tab-count { left: auto; right: 4px; }
.tab-count.word { display: inline-flex; align-items: center; gap: 3px; }
.tab-count.word::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }  /* the dot; "old" says it in words */

/* Usage history: one chart, two switches; a tapped bar is outlined and its numbers go in one line. */
.hist-switches { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.seg-chat { fill: var(--muted); background: var(--muted); }
.hist-chart .pct-line { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.hist-chart .pct-dot { fill: var(--bg); stroke: var(--fg); stroke-width: 1.5; }
.key-pct { border: 1.5px solid var(--fg); border-radius: 50%; }
.hist-chart .hit { fill: transparent; cursor: pointer; }
.hist-chart .picked { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.hist-chart .today { fill: var(--fg); font-weight: 700; }
.hist-line { margin: 6px 0 0; min-height: 4.2em; }  /* room for a tapped bar's three lines, so the caption under it never moves */
/* Run metrics: the Haiku status as one line; the chat and Lemonade lines */
.vpill { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.vpill.verdict-notdue, .vpill.verdict-none { color: var(--muted); } .vpill.verdict-dispatching { color: var(--ok, var(--accent)); border-color: currentColor; }
.vpill.verdict-not, .vpill.verdict-over { color: var(--question); background: var(--question-bg); border-color: transparent; }
.verdict-line, .outcome-line { margin: 6px 0 2px; }

/* "A new version is ready": floats above the page, so nothing moves when it appears. */
.update-bar { position: fixed; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; box-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
body:not(.no-bar) .update-bar { bottom: calc(env(safe-area-inset-bottom) + 84px); }  /* above the bottom bar */
/* Up next's order that failed to save as you left it (queue.js), in the same place: the error's red. */
.update-bar.save-failed { background: var(--question-bg); color: var(--fg); border: 1px solid var(--error); text-align: left; font-weight: 400; }

/* What an open question is about (its Refers to: line), under its text: a fold that opens in
   place, a section in a quieted box, a picture at the card's width, or a muted line saying the
   part isn't there. The glyph is drawn here because summary is a flex box (no marker). */
.ask details.ref > summary { color: var(--accent); list-style: none; }
.ask details.ref > summary::-webkit-details-marker { display: none; }
.ask details.ref > summary::before { content: '▸'; margin-right: 6px; }
.ask details.ref[open] > summary::before { content: '▾'; }
.ref-box { margin: 0 0 6px; padding: 2px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 0.92em; }
.ref-box :is(h1, h2, h3, h4, h5, h6) { font-size: 1em; margin: 8px 0 4px; }
.ref-pic { margin: 0 0 6px; }
.ref-pic img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.ref-missing { margin: 6px 0; font-style: italic; }

/* The full-screen picture (viewer.js): dark behind it in both themes, Close in the app's colours. The page
   under it keeps its place (no scroll while open, the gutter kept); pinch-zoom and pan are the browser's. */
html.viewing { overflow: hidden; scrollbar-gutter: stable; }
dialog.viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgba(0, 0, 0, 0.95); overscroll-behavior: contain; }
dialog.viewer::backdrop { background: transparent; }
.viewer-top { position: absolute; z-index: 1; top: 0; right: 0; padding: calc(env(safe-area-inset-top) + 8px) max(12px, env(safe-area-inset-right)) 8px 12px; }
.viewer-close { margin: 0; font-weight: 600; background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.viewer-scroll { position: absolute; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 68px) 8px calc(env(safe-area-inset-bottom) + 8px);
  touch-action: pinch-zoom pan-x pan-y; overscroll-behavior: contain; }
.viewer-scroll img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

/* The launcher (#/) and the apps' headers (apps.js, launcher.js). An app without a + in its bar
   (News) has one row of tabs across the pill. */
.bar.flat { grid-template-columns: 1fr; }
/* The header's left tile: the app's icon, a tap back to the launcher. The title takes the room between. */
header > h1.title { flex: 1 1 auto; }
.app-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -6px -6px -6px -6px; }
.app-icon[hidden] { display: none; }
.app-icon img { width: 32px; height: 32px; border-radius: 9px; }
.launcher { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.app-tile { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 168px; padding: 16px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--fg); text-decoration: none; }
.app-tile img { width: 56px; height: 56px; margin-bottom: 12px; border-radius: 14px; }
.app-tile strong { font-size: 1.1em; }
.tile-line { color: var(--muted); font-size: 0.88em; }
.tile-count { position: absolute; top: 12px; right: 12px; margin: 0; }
/* Not built yet: said in words ("later"), the tile only outlined. */
.app-tile.later { align-items: center; justify-content: center; text-align: center; border-style: dashed; background: transparent; color: var(--muted); }
.later-plus { font-size: 28px; line-height: 1; }
.launcher-head { margin: 24px 0 8px; font-size: 0.82em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.launcher-head + .usage-row { margin-top: 0; }

/* News: This week and Status (recap.js). */
.recap-chip { margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: var(--accent-bg); color: var(--accent); font-size: 0.6em; font-weight: 600; vertical-align: middle; }
.kv { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.kv span:last-child { font-variant-numeric: tabular-nums; }
.kv-big { margin: 0; font-size: 1.1em; }

/* The CS2 app (cs2.js): gains green, losses red, waiting amber, the app's own blue; every state also a word and a glyph. */
.cs2 { --pos: #4cd07a; --pos-bg: #0d2a22; --neg: #ff6b60; --neg-bg: #2b1513; --wait: #f6b44b; --wait-bg: #33230b; --lock: #a5adff; --lock-bg: #1f2247; }
.count.amber { background: #f6b44b; color: #000; }
.cs2 .pos { color: var(--pos); }
.cs2 .neg { color: var(--neg); }
.cs2-banner { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 0.88em; }
.cs2-banner.ok { border-color: var(--pos); background: var(--pos-bg); }
.cs2-banner.warn { border-color: var(--wait); background: var(--wait-bg); color: var(--wait); }
.cs2-banner.bad { border-color: var(--neg); background: var(--neg-bg); }
.cs2-undo { margin: 0 0 0 4px; min-height: 32px; padding: 0 10px; background: none; color: var(--pos); text-decoration: underline; font-weight: 600; }
.cs2-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 10px; font-size: 0.82em; font-variant-numeric: tabular-nums; }
.cs2-market { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
.cs2 select { min-height: 36px; padding: 0 8px; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--accent); }
/* The totals: two columns, the gain under them on its own line; the left edge says the sign (an inset shadow: nothing moves). */
.cs2-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0 0 10px; padding: 12px 12px 12px 15px; border-radius: 12px; background: var(--card); }
.cs2-totals.tone-pos { box-shadow: inset 3px 0 0 var(--pos); }
.cs2-totals.tone-neg { box-shadow: inset 3px 0 0 var(--neg); }
.cs2-totals.tone-flat { box-shadow: inset 3px 0 0 var(--line); }
.cs2-gain { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.cs2-gain small { flex: 1 1 auto; min-width: 0; min-height: 2.6em; display: flex; align-items: center; }  /* room for "(N shown)" on a second line: the box keeps its height */
/* The value never wraps: sign, glyph, amount and percent on one line, a smaller size on a narrow phone rather than cut. */
.cs2-totals .cs2-gain b { flex: none; white-space: nowrap; font-size: clamp(1.02em, 5vw, 1.4em); font-variant-numeric: tabular-nums; }
.cs2-totals > span { display: flex; flex-direction: column; min-width: 0; }
.cs2-totals small { color: var(--muted); font-size: 0.72em; }
.cs2-totals b { font-size: 1em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs2-of { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.76em; }
.cs2-list { list-style: none; margin: 0; padding: 0; }
.cs2-list > li + li { margin-top: 8px; }
.cs2-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; margin: 0; padding: 10px 12px; border-radius: 12px;
  background: var(--card); color: var(--fg); text-align: left; font-size: 1em; }
.cs2-row.edge-pos { box-shadow: inset 3px 0 0 var(--pos); }
.cs2-row.edge-neg { box-shadow: inset 3px 0 0 var(--neg); }
.cs2-row.edge-lock { box-shadow: inset 3px 0 0 var(--lock); }
.cs2-row:disabled { opacity: 1; }  /* greyed by its words, not by dimming (they say why) */
.cs2-row.kept { border: 1px solid var(--wait); }
.cs2-row.kept.st-refused { border-color: var(--neg); }
.cs2-pic { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 34px; border-radius: 6px; background: #2c2c3a;
  color: var(--muted); font-size: 0.7em; overflow: hidden; }
.cs2-pic img { width: 100%; height: 100%; object-fit: contain; }
.cs2-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.cs2-main strong { font-size: 0.94em; line-height: 1.25; }
.cs2-main .meta { color: var(--muted); font-size: 0.8em; }
/* The type tag before a name: the app's amber, blue, violet and green (the status colours), a word in each. */
.cs2-tag { display: inline-block; margin-right: 2px; padding: 0 5px; border-radius: 4px; font-size: 0.66em; font-weight: 700; letter-spacing: 0.04em; vertical-align: 0.12em; }
.cs2-tag.k-case { background: #33230b; color: #f6b44b; }
.cs2-tag.k-skin { background: #14213d; color: #7aa9ff; }
.cs2-tag.k-knife { background: #241a40; color: #b69cff; }
.cs2-tag.k-sticker { background: #0d2a22; color: #4cd07a; }
.cs2-why { margin-top: 2px; font-size: 0.78em; color: var(--muted); }
.cs2-why.lock { align-self: flex-start; padding: 0 8px; white-space: nowrap; border-radius: 999px; background: var(--lock-bg); color: var(--lock); }
.cs2-num { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; max-width: 48%; }
.cs2-now { font-size: 0.88em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs2-now.muted { white-space: normal; font-size: 0.76em; }
.cs2-pill { padding: 1px 8px; border-radius: 999px; font-size: 0.74em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs2-pill.up { background: var(--pos-bg); color: var(--pos); }
.cs2-pill.down { background: var(--neg-bg); color: var(--neg); }
.cs2-pill.flat, .cs2-pill.none { background: #2a2f3d; color: var(--muted); }
.cs2-state { padding: 1px 8px; border-radius: 999px; font-size: 0.74em; white-space: nowrap; }
.cs2-state.st-waiting, .cs2-state.st-sending { background: var(--wait-bg); color: var(--wait); }
.cs2-state.st-recorded { background: var(--pos-bg); color: var(--pos); }
.cs2-state.st-refused { background: var(--neg-bg); color: var(--neg); }
.cs2-empty { padding: 12px; border-radius: 12px; background: var(--card); color: var(--muted); font-size: 0.88em; }
.cs2-card { padding: 12px; border-radius: 12px; background: var(--card); }
.cs2-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cs2-card .meta { margin: 2px 0 0; color: var(--muted); font-size: 0.8em; }
.cs2-card button { margin-top: 8px; min-height: 40px; }
.cs2-reason-bad, .cs2-reason-warn { margin: 6px 0 0; font-size: 0.84em; color: var(--wait); }
.cs2 > button#cs2-try { width: 100%; margin-top: 16px; }
.cs2-reason { margin: 6px 0 0; font-size: 0.8em; min-height: 1.4em; }
/* The filter chips: one row, scrolled sideways when it doesn't fit, its height kept whatever is picked. Each meaning
   in its own colour (losing red, gaining green, locked blue-violet), the word and the count always there too. */
.cs2-chips { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; height: 44px; align-items: center; margin: 0 0 8px; scrollbar-width: none; }
.cs2-chips::-webkit-scrollbar { display: none; }
.cs2-chip { flex: none; min-height: 34px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--fg);
  font-size: 0.86em; font-weight: 500; white-space: nowrap; }
.cs2-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cs2-chip.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.cs2-chip.c-losing.on { border-color: var(--neg); background: var(--neg-bg); color: var(--neg); }
.cs2-chip.c-gaining.on { border-color: var(--pos); background: var(--pos-bg); color: var(--pos); }
.cs2-chip.c-locked.on { border-color: var(--lock); background: var(--lock-bg); color: var(--lock); }
.cs2-clear { margin: 0 0 0 4px; min-height: 32px; padding: 0 4px; background: none; color: var(--accent); font-weight: 600; }
/* Search and the sort button on one line; the button's width is fixed, so a longer choice doesn't move the search. */
.cs2-find { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.cs2-find .list-search { flex: 1 1 auto; min-width: 0; margin: 0; }
.cs2-sort { flex: none; width: 11.4em; height: 44px; margin: 0; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg); font-size: 0.86em; text-align: center; }
.cs2-sort-list { display: flex; flex-direction: column; }
.cs2-sort-item { display: flex; justify-content: space-between; align-items: center; min-height: 44px; margin: 0; padding: 0 4px; border-radius: 0;
  border-top: 1px solid var(--line); background: none; color: var(--fg); text-align: left; }
.cs2-sort-item[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.cs2-sheet .cs2-sort-note { margin: 10px 0 0; }
/* The sheet: from the bottom, over the list. */
.cs2-sheet-back { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.6); }
.cs2-sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 16px max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 16px) max(16px, env(safe-area-inset-left));
  border-radius: 18px 18px 0 0; background: #232326; border-top: 1px solid var(--line); }
.cs2-sheet h2 { margin: 0 0 2px; font-size: 1.05em; }
.cs2-sheet .muted { margin: 0 0 10px; font-size: 0.82em; }
.cs2-sheet label, .cs2-settings label { display: block; margin: 8px 0 4px; font-size: 0.84em; color: var(--muted); }
.cs2-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs2-two select, .cs2-sheet input, .cs2-settings input, .cs2-settings select { display: block; width: 100%; min-height: 44px; padding: 0 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #000; color: var(--fg); }
.cs2-sheet #s-go { width: 100%; margin-top: 8px; }
.cs2-sheet .secondary { width: 100%; margin-top: 8px; }
.cs2-warn { min-height: 1.4em; margin: 6px 0 0; color: var(--wait); font-size: 0.84em; }
.cs2-line { min-height: 2.8em; margin: 2px 0 0; color: var(--muted); font-size: 0.84em; font-variant-numeric: tabular-nums; }
.cs2-inline { display: flex; align-items: center; gap: 10px; }
.cs2-inline select { flex: 0 1 60%; }
.cs2-saved { min-height: 1.4em; margin: 8px 0 0; font-size: 0.84em; }
/* The Weekly tab (patch 0374, the fold of 0372): a row per dated recap, 44 px to tap, opening in the reader below. */
.recap-list { list-style: none; margin: 0; padding: 0; }
.recap-list button.recap-open { display: block; width: 100%; min-height: 44px; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: var(--accent); padding: 8px 0; }
#recap-reader:not(:empty) { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }

/* News stories (patch 0381, story-view.js): the chip row sticks under the header (--head-h is the header's measured height,
   so the iPhone's text size can't hide it), one row each that opens in place. One colour per section, the same on the pill,
   the chosen chip and the picture's tile: US politics red, Tech green, World violet (the palette's existing pairs). */
.nw-us { --nw: #ff6b60; --nw-bg: #2b1513; }
.nw-tech { --nw: #4fd1a1; --nw-bg: #0d2a22; }
.nw-world { --nw: #b69cff; --nw-bg: #241a40; }
.nw-day { --nw: var(--accent); --nw-bg: var(--accent-bg); }
.nw-none { --nw: var(--muted); --nw-bg: #2c2c2e; }
.story-chips { position: sticky; top: var(--head-h, 0px); z-index: 3; display: flex; flex-wrap: nowrap; gap: 6px; height: 56px; align-items: center;
  overflow-x: auto; margin: 0 0 4px; background: var(--bg); scrollbar-width: none; }
.story-chips::-webkit-scrollbar { display: none; }
.story-chip { flex: none; min-height: 44px; margin: 0; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--fg);
  font-size: 0.9em; font-weight: 500; white-space: nowrap; }
.story-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.story-chip[aria-pressed="true"] { border-color: var(--nw); background: var(--nw-bg); color: var(--nw); }
.story-note { margin: 4px 0 8px; font-size: 0.9em; }
.story-list { list-style: none; padding: 0 12px; }
.story + .story { border-top: 1px solid var(--line); }
.story-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; width: 100%; min-height: 44px; margin: 0; padding: 10px 0;
  border-radius: 0; background: none; color: var(--fg); text-align: left; font-weight: 600; line-height: 1.3; }
.story-tag { display: inline-block; margin-right: 2px; padding: 0 8px; border-radius: 999px; background: var(--nw-bg); color: var(--nw); font-size: 0.75em;
  font-weight: 600; line-height: 1.6; vertical-align: 0.1em; white-space: nowrap; }
.story-caret { color: var(--muted); min-width: 1em; text-align: center; }
.story-body { padding: 0 0 12px; }
.story-body p { margin: 0 0 8px; }
.story-sources { font-size: 0.9em; }
.story-all { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 0 0 12px; color: var(--muted); }
.story-all button { margin: 0; padding: 0 10px; background: none; color: var(--accent); }
.recap-about { margin-top: 0; border-top: 0; padding-top: 12px; }
/* Show pictures: the box is reserved before the picture arrives, the section's tinted tile and glyph under it. */
.story-row.with-pic { grid-template-columns: 72px 1fr auto; gap: 12px; }
.story-card .story-row.with-pic { grid-template-columns: 1fr auto; }
.story-pic { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 10px;
  background: var(--nw-bg); color: var(--nw); font-size: 1.6em; font-weight: 400; }
.story-pic.thumb { width: 72px; height: 72px; }
.story-pic.wide { grid-column: 1 / -1; width: 100%; aspect-ratio: 16 / 9; font-size: 2.4em; }
.story-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.news-pics-saved { min-height: 1.4em; margin: 4px 0 0; }

/* News settings: the read-only line of what the recaps last said. */
.news-seen { margin: 0 0 10px; font-variant-numeric: tabular-nums; }

/* CS2 Sold (patch 0374): the month picker, the month's line, sale rows (not tapped) with the Pending list's edges and pills. */
.cs2-month { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.cs2-month b { flex: 1; text-align: center; font-variant-numeric: tabular-nums; }
.cs2-month button { min-height: 44px; padding: 0 12px; }
.cs2-sold-top { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); font-size: 0.9em; font-variant-numeric: tabular-nums; }
.cs2-sold-top b.pos { color: var(--pos); }
.cs2-sold-top b.neg { color: var(--neg); }
.cs2-row.sold, .cs2-row.kept { cursor: default; }
/* CS2 Settings (patch 0374): the PC's fees, read only, and Forget's warning in place. */
.cs2-sub { margin: 14px 0 4px; font-size: 0.84em; color: var(--muted); font-weight: 600; }
.cs2-fees .kv { font-variant-numeric: tabular-nums; }
.cs2-forget-ask { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--neg); border-radius: 12px; background: var(--neg-bg); font-size: 0.9em; }
.cs2-forget-ask p { margin: 0 0 8px; }

/* The launcher's Edit (patch 0374): its button in the header, a row per app with word buttons and a switch, hidden apps at the bottom. */
.head-edit { flex: none; min-height: 44px; margin: -6px 0 -6px auto; padding: 0 12px; background: none; color: var(--accent); font-weight: 600; }
.launcher-editing { list-style: none; margin: 0 0 10px; padding: 0; }
.launcher-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 6px 10px; padding: 10px 12px; margin-bottom: 8px;
  border-radius: 12px; background: var(--card); }
.launcher-row img { border-radius: 10px; }
.launcher-name { display: flex; flex-direction: column; min-width: 0; }
.launcher-name .muted { font-size: 0.8em; }
.launcher-moves { grid-column: 2 / -1; display: flex; gap: 8px; }
.launcher-moves button { min-height: 44px; flex: 1; }
.launcher-hidden { list-style: none; margin: 0; padding: 0; }
.launcher-hidden li { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 4px 12px; border-radius: 12px; background: var(--card); margin-bottom: 8px; }
/* The Lemonade switch's card (lemonade-switch.js, patch 0375): its state as a pill with a glyph and a word, then the
   controls in two rows of tap-sized buttons. Off is neutral (paused, not a fault); the paused banner is the plain banner. */
.lem-pill { display: inline-block; padding: 1px 9px; border: 1px solid currentColor; border-radius: 999px; font-size: 0.85em; }
.lem-on { color: #4cd07a; } .lem-off { color: var(--muted); }
.lem-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.lem-row button { min-height: 44px; } .lem-date input { min-height: 44px; margin-left: 6px; font: inherit; }
