/**
 * Layout, and the few things specific to this application.
 *
 * Controls are not styled here — that is `ui.css`. This file positions things and
 * nothing else, which is why it stays short as features arrive: a new panel is a
 * new region, not a new set of button, input and chip rules.
 */

/* -------------------------------------------------------------------- shell */

body { display: flex; flex-direction: column; }

.bar {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--bar-h);
  padding: var(--s-2) var(--s-4);
  background: var(--c-surface);
  border-bottom: var(--border);
  flex: 0 0 auto;
}

.brand {
  font-weight: var(--w-medium);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/*
 * The layout, in one place.
 *
 * Two rules decide everything and neither of them mentions a phone:
 *
 *   1. A pane below --pane-min is not worth showing, so the number of panes that
 *      fit is a function of the width and that minimum. Above --stack-at two fit;
 *      below it, one does.
 *   2. Any pane can be collapsed to a rail at any width, because "I want the
 *      other one bigger" is a thing people want on a 27-inch screen too.
 *
 * CSS decides; the script only records which pane you chose. Layout that lives in
 * JavaScript disagrees with the viewport the moment anything resizes.
 */
.split {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(var(--pane-min), var(--pane-pct)) 1fr;
  min-height: 0;
  min-width: 0;
}

/* A collapsed pane keeps its rail; the other takes what is left. */
.split[data-collapsed="thread"] { grid-template-columns: var(--rail) 1fr; }
.split[data-collapsed="side"]   { grid-template-columns: 1fr var(--rail); }

@media (max-width: 54rem) {
  /*
   * One pane at a time. Not stacked halves — two half-height panes on a phone
   * gives you two things you cannot use instead of one you can.
   */
  .split,
  .split[data-collapsed="thread"],
  .split[data-collapsed="side"] { grid-template-columns: 1fr; }
  .split[data-single] > .pane[data-showing="false"] { display: none; }
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

/* ------------------------------------------------------------------ the rail */

/*
 * What a collapsed pane leaves behind: a strip with the pane's name running up
 * it, and the whole strip is the control that brings it back. A collapse you
 * cannot visibly undo is a disappearance.
 */
.rail {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) 0;
  border: 0;
  background: var(--c-surface);
  color: var(--c-ink-soft);
  font: inherit;
  font-size: var(--t-xs);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  writing-mode: vertical-rl;
  cursor: pointer;
}

.rail:hover { color: var(--c-ink); background: var(--c-raise); }

.split[data-collapsed="thread"] .pane--thread > :not(.rail),
.split[data-collapsed="side"] .pane--preview > :not(.rail),
.split[data-collapsed="side"] .pane--local > :not(.rail) { display: none; }

.split[data-collapsed="thread"] .pane--thread > .rail,
.split[data-collapsed="side"] .pane--preview > .rail,
.split[data-collapsed="side"] .pane--local > .rail { display: flex; }

.pane--thread {
  background: var(--c-surface);
  border-right: var(--border);
}

/* ------------------------------------------------------------------- thread */

.thread {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--s-3) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/*
 * A turn reads as a document, not a card.
 *
 * Claude Code renders a conversation with whitespace and a marker rather than a
 * bordered box per message, and it is right: boxes turn a conversation into a
 * log. The prompt gets a rule and slight emphasis; everything after it flows.
 */
.turn {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-bottom: var(--s-3);
  border-bottom: var(--border);
}

.turn:last-child { border-bottom: 0; }

.ask {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding-left: var(--s-3);
  border-left: 2px solid var(--c-line-strong);
}

.ask__who {
  font: var(--w-medium) var(--t-label) / 1 var(--f-mono);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-ink-faint);
}

.ask__text { margin: 0; white-space: pre-wrap; font-weight: var(--w-medium); font-size: var(--t-sm); }

.body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }

/* ------------------------------------------------------------------- lines */

/*
 * The transcript runs denser than the rest of the interface, on purpose.
 *
 * It is a log of work — tool calls, paths, output — and the value is in seeing a
 * lot of it at once. Body copy comfort is the wrong target here; a terminal is
 * closer to the right one. Everything below is one step down from the app scale.
 */

.ln { margin: 0; min-width: 0; font-size: var(--t-sm); }

/* What Claude says. The only thing set at full reading colour. */
.ln--say { color: var(--c-ink); }

.ln--say .md-p { margin: 0 0 var(--s-2); line-height: 1.5; }
.ln--say .md-p:last-child { margin-bottom: 0; }

.ln--say .md-h {
  margin: var(--s-3) 0 var(--s-1);
  font-size: var(--t-md);
  font-weight: var(--w-medium);
}

.ln--say .md-list { margin: 0 0 var(--s-2); padding-left: var(--s-5); }
.ln--say .md-list li { margin: 1px 0; }

.ln--say .md-quote {
  margin: 0 0 var(--s-2);
  padding-left: var(--s-3);
  border-left: 2px solid var(--c-line);
  color: var(--c-ink-soft);
}

.ln--say a { color: var(--c-accent); text-underline-offset: 2px; }

/* Inline code as a translucent overlay, the way Claude Code does it — it sits on
   whatever is beneath instead of needing a colour picked per surface. */
.md-inline {
  font: var(--t-xs) var(--f-mono);
  background: var(--c-raise);
  border-radius: var(--r-sm);
  padding: 1px 3px;
}

.md-code {
  margin: 0 0 var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--c-sunk);
  border: var(--border);
  border-radius: var(--r-md);
  overflow-x: auto;
  font: var(--t-xs) / 1.5 var(--f-mono);
  color: var(--c-ink-soft);
}

.md-code code { font: inherit; background: none; padding: 0; }

/* Reasoning: present, recessive. There when you look for it. */
.ln--think {
  white-space: pre-wrap;
  color: var(--c-ink-fainter);
  font-size: var(--t-xs);
  padding-left: var(--s-3);
  border-left: 1px solid var(--c-line);
}

/* A tool firing: what it is, then what it touches. One line, always. */
.ln--tool {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  min-width: 0;
  font: var(--t-xs) / 1.5 var(--f-mono);
  color: var(--c-ink-faint);
}

.ln__name { color: var(--c-accent); flex: none; }
.ln__arg { color: var(--c-ink-fainter); }

/* What it returned. Capped and scrollable so one long result cannot bury the
   turn that follows it. */
.ln--out {
  max-height: 9rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--s-2);
  background: var(--c-sunk);
  border-radius: var(--r-sm);
  font: var(--t-xs) / 1.45 var(--f-mono);
  color: var(--c-ink-fainter);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ln--out-bad { color: var(--c-bad); background: var(--c-bad-soft); }

/* The platform's own lines, on the same stream. Set apart by a rule and colour
   rather than a box, so they narrate rather than interrupt. */
.ln--meta {
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
  padding-left: var(--s-3);
  border-left: 2px solid var(--c-line);
}

.ln--good { color: var(--c-good); border-left-color: color-mix(in oklab, var(--c-good) 60%, transparent); }
.ln--warn { color: var(--c-warn); border-left-color: color-mix(in oklab, var(--c-warn) 60%, transparent); }
.ln--bad  { color: var(--c-bad);  border-left-color: color-mix(in oklab, var(--c-bad) 60%, transparent); }

.ln--error {
  font-size: var(--t-xs);
  color: var(--c-bad);
  padding-left: var(--s-3);
  border-left: 2px solid var(--c-bad);
}

.turn__foot { font-size: var(--t-xs); color: var(--c-ink-fainter); }

.turn--live .ask { border-left-color: var(--c-accent); animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { border-left-color: var(--c-accent); }
  50% { border-left-color: var(--c-line-strong); }
}

@media (prefers-reduced-motion: reduce) { .turn--live .ask { animation: none; } }

/* ---------------------------------------------------------------- composer */

/*
 * One container, controls beneath the input — Claude Code's arrangement. The
 * border belongs to the container, not the textarea, so the whole thing reads as
 * a single object.
 */
.composer {
  flex: 0 0 auto;
  padding: var(--s-3);
  border-top: var(--border);
}

.composer__box {
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: var(--c-sunk);
  transition: border-color var(--m-fast) var(--m-ease);
}

.composer__box:focus-within { border-color: color-mix(in oklab, var(--c-accent) 55%, var(--c-line)); }
.composer__box.is-busy { opacity: 0.7; }

/* The textarea gives up its own chrome to the container. */
.composer__box .input {
  border: 0;
  background: transparent;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  min-height: 3.5rem;
  font-size: var(--t-md);
}

.composer__box .input:focus-visible { outline: none; }

.composer__attached { padding: var(--s-2) var(--s-2) 0; }

.composer__controls {
  padding: var(--s-1) var(--s-2) var(--s-2);
  min-height: 26px;
}

.status { font-size: var(--t-xs); color: var(--c-ink-faint); }
.status--bad { color: var(--c-bad); }
.status--warn { color: var(--c-warn); }

.hint { font-size: var(--t-label); color: var(--c-ink-fainter); white-space: nowrap; }

/* ----------------------------------------------------------------- preview */

.previewbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--bar-h);
  padding: var(--s-2) var(--s-4);
  background: var(--c-surface);
  border-bottom: var(--border);
  flex: 0 0 auto;
}

.segmented {
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 2px;
}

.segmented .btn.is-on {
  background: var(--c-ground);
  color: var(--c-ink);
}

/*
 * Desktop is full-bleed: no padding, no frame, no backdrop.
 *
 * Lovable gets this right and it matters more than it sounds — a bordered card
 * floating on a checkerboard reads as a mockup of a site. Flush to the pane, it
 * reads as the site. The backdrop and the frame exist only for mobile, where the
 * viewport genuinely is narrower than the pane and the gap has to be something.
 */
.route {
  height: var(--control-h);
  width: 10rem;
  padding: 0 var(--s-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--c-sunk);
  color: var(--c-ink-faint);
  font: var(--w-normal) var(--t-sm) / 1 var(--f-mono);
}

.route:hover:not(:disabled) { background: var(--c-raise); }
.route:focus-visible { color: var(--c-ink); border-color: var(--c-accent); }
.route:disabled { opacity: 0.4; }

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: stretch;
  overflow: hidden;
}

.stage--mobile {
  place-items: center;
  padding: var(--s-4);
  overflow: auto;
  background:
    repeating-conic-gradient(
      color-mix(in oklab, var(--c-line) 30%, transparent) 0% 25%,
      transparent 0% 50%
    ) 50% / 18px 18px;
}

/*
 * No background here, deliberately.
 *
 * Painting white behind the iframe made the preview lie: a site declaring
 * color-scheme light-dark renders light text in a dark-preferring browser, and
 * white-on-white showed a blank pane. The site paints itself; anything we put
 * underneath is a claim about how it looks that we are not entitled to make.
 */
.frame {
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: width var(--m-base) var(--m-ease), max-height var(--m-base) var(--m-ease);
}

/* A thin outline and a phone radius. No bezel, no shadow — it is the site, at
   a phone's width, not a picture of a phone. */
.frame--mobile {
  width: 390px;
  max-height: 844px;
  border: 1px solid var(--c-line-strong);
  border-radius: 20px;
}

.frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.builderr {
  flex: 0 0 auto;
  max-height: 34%;
  overflow: auto;
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-top: var(--border);
  background: var(--c-bad-soft);
  color: var(--c-bad);
  font: var(--t-sm) / var(--lh-body) var(--f-mono);
  white-space: pre-wrap;
}

/* ------------------------------------------------------------------ sheets */

.modes {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  border: var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
}

.mode {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  cursor: pointer;
}

.mode strong { display: block; font-weight: var(--w-medium); }
.mode small { display: block; font-size: var(--t-sm); }

.history {
  display: flex;
  flex-direction: column;
  max-height: 50vh;
  overflow-y: auto;
}

.history__row {
  padding: var(--s-2) 0;
  border-top: var(--border);
}

.history__row:first-child { border-top: 0; }

/* ----------------------------------------------------------------- palette */

/*
 * The slash palette. Anchored above the composer rather than centred, because it
 * is a continuation of typing — it should appear where your eyes already are,
 * not pull them to the middle of the screen.
 */
.pal__wrap {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  justify-items: start;
  padding: 0 var(--s-3) 5.5rem var(--s-3);
}

.pal {
  width: min(30rem, calc(var(--pane-pct) + 6rem));
  max-width: calc(100vw - var(--s-5));
  background: var(--c-surface);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pal__crumb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-bottom: var(--border);
}

.pal__here {
  font: var(--w-medium) var(--t-label) / 1 var(--f-mono);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-ink-faint);
}

.pal__back {
  border: 0;
  background: transparent;
  color: var(--c-ink-faint);
  font: var(--w-normal) var(--t-xs) / 1 var(--f-sans);
  cursor: pointer;
  padding: 0;
}

.pal__back:hover { color: var(--c-ink); }

.pal__filter {
  border: 0;
  border-bottom: var(--border);
  background: transparent;
  color: inherit;
  font: var(--w-normal) var(--t-md) / 1 var(--f-sans);
  padding: var(--s-3);
  outline: none;
}

.pal__filter::placeholder { color: var(--c-ink-fainter); }

.pal__list {
  max-height: 15rem;
  overflow-y: auto;
  padding: var(--s-1);
}

.pal__row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--t-sm);
}

/* One highlight, driven by the cursor — hover and arrow keys move the same
   thing, so there is never a second, competing "selected" row. */
.pal__row.is-on { background: var(--c-raise); }

.pal__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal__tick { color: var(--c-accent); }
.pal__more { color: var(--c-ink-fainter); }

.pal__none {
  padding: var(--s-3);
  color: var(--c-ink-fainter);
  font-size: var(--t-sm);
}

/* Fixed height, so arrowing through a list does not make the panel jump. */
.pal__detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-2) var(--s-3);
  border-top: var(--border);
  background: var(--c-sunk);
  min-height: 3.25rem;
}

.pal__dname { font: var(--w-medium) var(--t-xs) / 1.4 var(--f-mono); color: var(--c-ink); }
.pal__ddesc { font-size: var(--t-xs); color: var(--c-ink-faint); line-height: 1.4; }

/* ------------------------------------------------------------------- setup */

.setup__kind {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  border: var(--border);
  border-radius: var(--r-md);
}

.setup__why { margin: 0; font-size: var(--t-sm); }

/* Numbered because these are steps in an order, and the person performs them. */
.setup__how {
  margin: 0;
  padding-left: var(--s-5);
  font-size: var(--t-xs);
  color: var(--c-ink-faint);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setup__one {
  padding: var(--s-1) var(--s-2);
  background: var(--c-sunk);
  border-radius: var(--r-sm);
  font-size: var(--t-xs);
}

/* -------------------------------------------------------------- local mode */

/* The attribute must win over the display, or a hidden pane still holds a
   column — which is exactly what it did the first time. */
.pane--local[hidden],
.pane--preview[hidden] {
  display: none;
}

.pane--local { display: flex; flex-direction: column; }

.localhead {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.localhead .path {
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  color: var(--c-ink);
  word-break: break-all;
}

.localhead .sub {
  font-size: var(--t-xs);
  color: var(--c-ink-soft);
}

/* Each thing that was checked, and how it came out. The point of this pane is
   that a person can see the join was validated rather than assume it. */
.checks {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.check {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  font-size: var(--t-sm);
  line-height: var(--lh-tight);
}

.check .mark {
  flex: none;
  width: 1rem;
  text-align: center;
  font-weight: var(--w-medium);
}

.check--ok .mark { color: var(--c-good); }
.check--bad .mark { color: var(--c-bad); }
.check .what { color: var(--c-ink); }
.check .detail { color: var(--c-ink-soft); }

.dirlist {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  max-height: 15rem;
  overflow-y: auto;
}

.dirlist button {
  display: flex;
  gap: var(--s-2);
  align-items: baseline;
  justify-content: space-between;
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-bottom: 1px solid var(--c-line);
  background: none;
  color: var(--c-ink);
  font: inherit;
  font-size: var(--t-sm);
  text-align: left;
  cursor: pointer;
}

.dirlist button:last-child { border-bottom: 0; }
.dirlist button:hover { background: var(--c-raise); }
.dirlist .name { font-family: var(--f-mono); }
.dirlist .note { color: var(--c-ink-soft); font-size: var(--t-xs); flex: none; }

.crumbs {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--c-ink-soft);
  word-break: break-all;
}

/* Small print inside sheets and the local pane: true but secondary. */
.note {
  font-size: var(--t-xs);
  line-height: var(--lh-tight);
  color: var(--c-ink-soft);
  margin: 0;
}

.note--bad { color: var(--c-bad); }

.sheet__section {
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-ink-soft);
  font-weight: var(--w-medium);
  margin: 0;
}

.sess__title {
  font-size: var(--t-sm);
  line-height: var(--lh-tight);
  color: var(--c-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- gate */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--c-ground);
}

.gate[hidden] { display: none; }

.gate__card {
  width: min(22rem, calc(100vw - var(--s-6)));
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.gate__brand {
  font-size: var(--t-xl);
  font-weight: var(--w-medium);
  letter-spacing: -0.01em;
  color: var(--c-ink);
}

.gate__why {
  font-size: var(--t-sm);
  line-height: var(--lh-body);
  color: var(--c-ink-soft);
  margin: 0;
}

/* ------------------------------------------------------------------ usage */

.meter {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.meter__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-2);
  font-size: var(--t-xs);
}

.meter__label { color: var(--c-ink); }
.meter__value { color: var(--c-ink-soft); font-variant-numeric: tabular-nums; }

.meter__track {
  height: 4px;
  border-radius: var(--r-full);
  background: var(--c-sunk);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: var(--r-full);
}

/* Colour carries the same information as the number, for a glance rather than
   a read. Warn and bad are the semantic pair already in the tokens. */
.meter--warn .meter__fill { background: var(--c-warn); }
.meter--bad .meter__fill { background: var(--c-bad); }

.usage__plan {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--c-line);
}

.usage__plan:last-child { border-bottom: 0; }

/* ----------------------------------------------------------------- skills */

.skill {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--c-line);
  font-size: var(--t-sm);
}

.skill:last-child { border-bottom: 0; }
.skill__name { font-family: var(--f-mono); color: var(--c-ink); flex: none; }
.skill__desc { color: var(--c-ink-soft); flex: 1 1 auto; min-width: 0; }

/* A string somebody has to read off a screen and type somewhere else. */
.codeblock {
  font-family: var(--f-mono);
  font-size: var(--t-lg);
  letter-spacing: 0.08em;
  text-align: center;
  padding: var(--s-4);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-sunk);
  color: var(--c-ink);
  user-select: all;
}

/* The pane body inside the local panel, so the rail can be its sibling. */
.pane__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

/* ------------------------------------------------------- responsive detail */

/*
 * The rest of it, grouped by what is actually being responded to — the pointer,
 * the notch, the motion preference — rather than by guessed device widths.
 */

/* Notched phones and gesture bars. Zero everywhere else, so it costs nothing. */
.bar { padding-left: max(var(--s-4), env(safe-area-inset-left)); }
.composer {
  padding-bottom: max(var(--s-3), env(safe-area-inset-bottom));
}

@media (max-width: 54rem) {
  /* The bar earns its height back: wrap rather than squeeze things off-screen. */
  .bar {
    flex-wrap: wrap;
    row-gap: var(--s-2);
    padding-top: max(var(--s-2), env(safe-area-inset-top));
  }
  .bar .spacer { display: none; }

  /*
   * A sheet on a phone is a screen, not a card floating on one. Cards that
   * nearly fill the viewport leave a rim of unusable background and a scroll
   * that fights the page's.
   */
  .sheet {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    margin: 0;
  }
  .sheet__body { max-height: none; }

  .thread { padding: var(--s-3); }
}

/*
 * Touch, not screen size. A mouse is precise on a small screen and a finger is
 * blunt on a large one, so the thing to ask about is the pointer.
 * 44px is the long-standing floor for a reliable touch target.
 */
@media (pointer: coarse) {
  .btn,
  .rail,
  .chip--action,
  .dirlist button,
  .pal__item {
    min-height: 44px;
  }
  .btn--sm { min-height: 40px; }
  /* iOS zooms the page when a focused field is under 16px. */
  input, textarea, select { font-size: max(16px, var(--t-sm)); }
}

/* Long unbroken strings — paths, URLs, tokens — must not widen the layout. */
.path, .crumbs, .skill__name, .codeblock { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
