/* Themes ------------------------------------------------------------------ */
/* Every colour lives here; the rest of the sheet only uses these variables. */
:root {
  color-scheme: light;
  --ink: #1c1c1a;
  --ink-2: #55534e;
  --ink-3: #8a877f;
  --line: #e2e0da;
  --line-2: #cfccc4;
  --paper: #ffffff;
  --panel: #f5f4f1;
  --raised: #ffffff;
  --accent: #a3401c;
  --accent-soft: #f7ece7;
  --ok: #2f6b3a;
  --warn: #8a5a00;
  --warn-soft: #fbf4e4;
  --bad: #a1251b;
  --bad-soft: #fbeceb;
  --hit: #fffaf0;
  --shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  --button: #1c1c1a;
  --button-hover: #000000;
  --button-text: #ffffff;

  --r-rare: #a6a39b;
  --r-super: #d29b14;
  --r-uber: #dd5a12;
  --r-legend: #7a2fb5;
  --r-legend-fest: #7b68ee;
  --r-super-text: #8f6800;
  --r-uber-text: #b8460c;
  --r-legend-text: #7a2fb5;

  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar: 400px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9e6df;
  --ink-2: #b5b1a8;
  --ink-3: #8c887f;
  --line: #34322e;
  --line-2: #4a4741;
  --paper: #191816;
  --panel: #211f1d;
  --raised: #2a2825;
  --accent: #e8875c;
  --accent-soft: #3a2a22;
  --ok: #86c793;
  --warn: #e3b860;
  --warn-soft: #2e2919;
  --bad: #f0877d;
  --bad-soft: #3a2220;
  --hit: #2b2619;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  --button: #e9e6df;
  --button-hover: #ffffff;
  --button-text: #191816;

  --r-rare: #8d8a83;
  --r-super: #e2ad34;
  --r-uber: #f07a3c;
  --r-legend: #a970e4;
  --r-legend-fest: #9d8dff;
  --r-super-text: #e7bb52;
  --r-uber-text: #f39563;
  --r-legend-text: #bb8cec;
}

/* Base -------------------------------------------------------------------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  font: 14px/1.45 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--accent); text-decoration: none; }
@media (hover: hover) {
  a:hover { text-decoration: underline; }
}
h1, h2, h3 { margin: 0; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
em { font-style: normal; color: var(--ink-3); }
button { font: inherit; color: inherit; cursor: pointer; }

/* Sidebar ---------------------------------------------------------------- */
.sidebar {
  height: 100vh;
  align-self: start;
  position: sticky;
  top: 0;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.brand-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { flex: none; width: 50px; height: 50px; overflow: visible; }

/* Logo mascot (mascot.js). At rest: the cat beside a faint dotted route,
   from a start through three stops to a target. Animated: the route is traced
   in dashes, lighting each stop, and the cat follows it with its eyes. Every
   stop has a halo of the background colour, so lines never run into it. */
.mascot-trail {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-dasharray: 0 5;
  opacity: 0.7;
  transition: opacity 0.5s ease;
}
.mascot-route {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-dasharray: 1.3 3.7; /* a dash where each dot is, none cut by a halo */
  stroke-dashoffset: 0.65;
}
.mascot-reveal { stroke-dasharray: 100 100; stroke-dashoffset: 100; }
.mascot-halos { fill: var(--panel); }
.mascot-run, .mascot-tip { opacity: 0; transition: opacity 0.5s ease; }
.mascot.is-running .mascot-run, .mascot.is-running .mascot-tip { opacity: 1; transition: none; }
.mascot.is-running .mascot-trail { opacity: 0; transition-duration: 0.2s; }
.mascot.is-arrived .mascot-tip { opacity: 0; transition: opacity 0.15s ease; }
.mascot-node {
  fill: var(--panel);
  stroke: var(--ink-3);
  stroke-width: 1.4;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 0.5s ease, stroke 0.5s ease;
}
.mascot-start { fill: var(--ink-3); }
.mascot-node.is-lit {
  fill: var(--accent);
  stroke: var(--accent);
  transition: none;
  animation: mascot-pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.mascot-tip-glow { fill: var(--accent); opacity: 0.22; }
.mascot-tip-dot { fill: var(--accent); }
.mascot-target-ring { fill: var(--panel); stroke: var(--accent); stroke-width: 1.6; }
.mascot-target-dot { fill: var(--accent); }
.mascot-target { transform-box: fill-box; transform-origin: center; }
.mascot.is-arrived .mascot-target { animation: mascot-pop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes mascot-pop {
  40% { transform: scale(1.4); }
}
.mascot-eyes, .mascot-happy { transition: opacity 0.12s ease; }
.mascot-happy { opacity: 0; }
.mascot.is-happy .mascot-eyes { opacity: 0; }
.mascot.is-happy .mascot-happy { opacity: 1; }
.mascot-blush { transition: opacity 0.3s ease; }
.mascot.is-happy .mascot-blush { opacity: 0.8; }
@media (prefers-reduced-motion: no-preference) {
  .brand-logo.mascot { cursor: pointer; -webkit-tap-highlight-color: transparent; }
}
@media (max-width: 420px) {
  .brand-logo { width: 46px; height: 46px; }
}
.brand h1 { font-size: 17px; line-height: 1.25; letter-spacing: -0.01em; }
.brand p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.35; }

.theme-toggle {
  align-self: flex-start; /* level with the title, not centred on the block */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-width: 84px; /* same width for Claro and Oscuro */
  padding: 5px 9px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 4px;
}
@media (hover: hover) {
  .theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
}
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

.group { padding: 14px 22px; border-bottom: 1px solid var(--line); }
.group h2 { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.field { display: block; margin-bottom: 10px; }
.field:last-child { margin-bottom: 0; }
.field > span, .field > label { display: block; font-size: 12.5px; margin-bottom: 3px; }
.field small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 11.5px; line-height: 1.35; }
.field .field-error { color: var(--bad); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 10px; }
.pair .field { margin-bottom: 0; }
.hint { display: block; margin: 0 0 8px; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; }
.pair + .hint { margin: 8px 0 0; }
#time-note { margin: -4px 0 10px; }
.hint + .hint { margin-top: 6px; }

input[type="url"], input[type="number"], input[type="date"], input[type="search"], input[type="text"], textarea {
  width: 100%;
  min-width: 0; /* date fields have a wide minimum of their own */
  padding: 6px 8px;
  font: inherit;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 4px;
}
textarea { resize: vertical; min-height: 64px; }
input[type="date"] { min-height: 2.4em; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input.invalid, textarea.invalid { border-color: var(--bad); }

.check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 13px; cursor: pointer; }
.check input { margin: 2px 0 0; accent-color: var(--accent); }
.check em { display: block; margin-top: 1px; font-size: 11.5px; line-height: 1.4; }
.check[hidden] { display: none; }
.check.sub {
  /* Hangs from the discount above: a small box lined up with its text. */
  margin: 2px 0 8px 21px;
  padding: 8px 10px;
  font-size: 12.5px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.check.sub em { margin-top: 2px; color: var(--ink-3); }
/* "?" after an option: its explanation opens in a box under the option,
   with an arrow pointing at the "?" (left set from app.js). */
.check-help { position: relative; }
.help {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-3);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  vertical-align: 1px;
  cursor: help;
}
.help::after { content: ""; position: absolute; inset: -8px; } /* bigger target for fingers */
.help[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
@media (hover: hover) {
  .help:hover { color: var(--accent); border-color: var(--accent); }
}
.help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-pop {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 24px;
  right: 0;
  max-width: 420px;
  margin-top: 2px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.help-pop::before {
  content: "";
  position: absolute;
  top: -6px;
  left: var(--arrow-x, 16px);
  width: 10px;
  height: 10px;
  background: var(--raised);
  border-top: 1px solid var(--line-2);
  border-left: 1px solid var(--line-2);
  transform: translateX(-50%) rotate(45deg);
}
.help-pop[hidden] { display: none; }
.help-pop p { margin: 0; }
.help-pop p + p { margin-top: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.dot.legend { background: var(--r-legend); }
.dot.legend-fest { background: var(--r-legend-fest); }

.actions { padding: 16px 22px 24px; }
.primary {
  width: 100%;
  padding: 9px 14px;
  font-weight: 600;
  color: var(--button-text);
  background: var(--button);
  border: 0;
  border-radius: 4px;
}
@media (hover: hover) {
  .primary:hover:not(:disabled) { background: var(--button-hover); }
}
.primary:disabled { background: var(--ink-3); cursor: progress; }

.link-button {
  padding: 0;
  font-size: 11.5px;
  color: var(--accent);
  background: none;
  border: 0;
}
@media (hover: hover) {
  .link-button:hover { text-decoration: underline; }
}

/* Target picker ----------------------------------------------------------- */
/* Search box with a dropdown, and the chosen cats as a list of equal rows
   underneath (icon · name · rarity · remove), so it stays tidy with 1 or 30. */
.picker-search { position: relative; scroll-margin-top: 10px; }
.picker-search input { padding-left: 30px; }
.picker-search .search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.picker-search input.invalid { border-color: var(--bad); }

/* The dropdown: the list, which scrolls, and a bar under it with the count
   and "Listo". Chosen cats stay in the list with their box ticked. */
.picker-pop {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  margin-top: 2px;
  overflow: hidden;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.picker-list {
  margin: 0;
  padding: 2px 0;
  max-height: min(320px, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.picker-list [role="option"] {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 13px;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.picker-list [role="option"].active { background: var(--accent-soft); border-left-color: var(--accent); }
@media (hover: hover) {
  .picker-list [role="option"]:hover { background: var(--accent-soft); }
}
.opt-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  background: var(--raised);
  border: 1.5px solid var(--line-2);
  border-radius: 3px;
}
[aria-selected="true"] > .opt-check { background: var(--accent); border-color: var(--accent); }
[aria-selected="true"] > .opt-check::after {
  content: "";
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border: solid var(--raised);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
[aria-selected="true"] .opt-name { font-weight: 600; }
.picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 11px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.picker-done {
  min-height: 30px;
  padding: 4px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--button-text);
  background: var(--button);
  border: 0;
  border-radius: 4px;
}
.opt-name { flex: 1; min-width: 0; }
.opt-name small { display: block; color: var(--ink-3); font-size: 11px; }
.picker-empty { padding: 6px 10px; font-size: 12px; color: var(--ink-3); }

/* Cat icons: square boxes, the picture itself is rounded. */
.cat-icon {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: var(--panel);
  border-radius: 5px;
}
.selected-list .cat-icon { width: 24px; height: 24px; border-radius: 4px; }

.rarity { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.rarity.super { color: var(--r-super-text); }
.rarity.uber { color: var(--r-uber-text); }
.rarity.legendary { color: var(--r-legend-text); }

.picker-selected {
  margin-top: 8px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 4px;
}
.picker-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px 5px 10px;
  font-size: 11.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.selected-list {
  margin: 0;
  padding: 0;
  max-height: 252px; /* 8 rows, then it scrolls */
  overflow-y: auto;
  list-style: none;
}
.selected-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 8px;
  height: 31px;
  padding: 0 4px 0 8px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.selected-list li:last-child { border-bottom: 0; }
.selected-list .sel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-list .remove {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-3);
  background: none;
  border: 0;
  border-radius: 3px;
}
@media (hover: hover) {
  .selected-list .remove:hover { color: var(--bad); background: var(--bad-soft); }
}
#picker-status { display: block; margin-top: 5px; color: var(--ink-3); font-size: 11.5px; }

/* Main ------------------------------------------------------------------- */
/* The results adapt to the room they have (container queries at the end):
   tables when they fit, cards when not, whatever the screen. */
.content { padding: 24px 32px 64px; min-width: 0; container: content / inline-size; }
#status, #error, #cancelled, #results { scroll-margin-top: 16px; }

.empty { max-width: 620px; color: var(--ink-2); }
.empty h2 { font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.empty ol { padding-left: 18px; }
.empty li { margin: 4px 0; }

.status { max-width: 620px; }
.bar { height: 2px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.bar span { display: block; width: 30%; height: 100%; background: var(--accent); animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.progress-line { margin: 0; font-size: 13px; color: var(--ink-2); }
#elapsed { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.progress-estimate { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.progress-hint {
  margin: 12px 0 0;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  border-left: 3px solid var(--line-2);
  background: var(--panel);
}
.progress-hint p { margin: 0; }
.progress-hint p + p { margin-top: 4px; }
.progress-hint.over { border-left-color: var(--warn); background: var(--warn-soft); }
.progress-hint.over b { color: var(--warn); }

/* Load of the analysis, above «Calcular rutas»: a level, a thin bar and the
   usual time. The bar is set by width (core/load.js `share`), never a number. */
.load { margin: 0 0 12px; }
.load p { margin: 0; }
.load-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); }
.load-head b { font-size: 12.5px; color: var(--ink); }
.load-bar { height: 4px; margin: 6px 0 5px; background: var(--line); border-radius: 2px; overflow: hidden; }
.load-bar span { display: block; width: 0; height: 100%; background: var(--ok); border-radius: 2px; transition: width 0.2s ease; }
.load-time { font-size: 11.5px; color: var(--ink-2); line-height: 1.4; }
.load p.load-note { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.load[data-level="medium"] .load-bar span { background: var(--ink-2); }
.load[data-level="heavy"] .load-bar span { background: var(--warn); }
.load[data-level="heavy"] .load-head b { color: var(--warn); }
.load[data-level="veryHeavy"] .load-bar span { background: var(--bad); }
.load[data-level="veryHeavy"] .load-head b { color: var(--bad); }
@media (prefers-reduced-motion: reduce) {
  .load-bar span { transition: none; }
}

/* Confirmation before a very heavy analysis. */
.heavy-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 20px 22px;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.heavy-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.heavy-dialog h2 { margin: 0 0 8px; font-size: 16px; color: var(--bad); }
.heavy-dialog p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.heavy-dialog ul { margin: 0 0 4px; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.heavy-dialog li { margin: 3px 0; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dialog-actions .secondary { margin-top: 0; }
.dialog-actions .primary { width: auto; }
@media (max-width: 420px) {
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
}
.secondary {
  min-height: 32px;
  margin-top: 12px;
  padding: 4px 14px;
  font-size: 12.5px;
  font-weight: 600;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
}
@media (hover: hover) {
  .secondary:hover { border-color: var(--ink-3); }
}

.notice {
  padding: 10px 12px;
  margin: 0 0 14px;
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  font-size: 13px;
}
.notice.error { border-color: var(--bad); background: var(--bad-soft); max-width: 720px; }
.notice.warn { max-width: 720px; }
.notice p { margin: 2px 0; }

/* Support card on top of every analysis: icon, title and text on the left,
   the button on the right; on phones the button goes full width underneath. */
.support {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title button"
    "icon body  button";
  align-items: center;
  gap: 2px 16px;
  margin: 0 0 22px;
  padding: 16px 18px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 8px;
}
.support-icon {
  grid-area: icon;
  align-self: start;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 50%;
}
.support-icon svg { width: 18px; height: 18px; }
.support-title { grid-area: title; font-size: 14.5px; font-weight: 600; }
.support-body { grid-area: body; margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.support-button {
  grid-area: button;
  margin-left: 16px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  color: var(--button-text);
  background: var(--accent);
  border-radius: 6px;
  white-space: nowrap;
}
.support-button:hover { text-decoration: none; }
@media (hover: hover) {
  .support-button:hover { filter: brightness(0.92); }
}
.support-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Diagnostics: why the plan can't get every cat */
.diagnostics { margin-bottom: 8px; }
.diag-intro { margin: 0 0 10px; color: var(--ink-2); }
.diag {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: var(--warn-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 4px;
}
.diag h4 { margin: 0 0 4px; font-size: 14px; }
.diag-target { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.diag ul { margin: 0; padding-left: 18px; font-size: 13px; }
.diag li { margin: 3px 0; }
.diag-fix { margin: 8px 0 0; font-size: 13px; }
.diag-fix span, .diag-links span { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.diag-links { margin: 8px 0 0; font-size: 12.5px; }
.diag-links a {
  display: inline-block;
  margin: 2px 4px 0 0;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 20px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--raised);
}

/* Summary on top of the analysis: the seed under a heavy rule, then rows
   like a table's (banners, legend cells, lilac note) split by thin rules. */
.summary { margin: 0 0 26px; padding-top: 12px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.summary-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  padding-bottom: 12px;
}
.seed-id { display: flex; align-items: baseline; gap: 10px; }
.seed-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.seed-num { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: 0.03em; }
.summary-facts { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.summary-facts b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.summary-row { border-top: 1px solid var(--line); }
.summary-row > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.summary-row > summary::-webkit-details-marker { display: none; }
.summary-row > summary::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.summary-row[open] > summary::before { transform: rotate(45deg); }
@media (hover: hover) {
  .summary-row > summary:hover { background: var(--panel); }
}
.summary-row > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.summary-row .count { font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.summary-body { padding: 0 8px 12px 26px; }
.summary-body table { font-size: 13px; }

.summary-note {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 10px 8px;
  font-size: 13px;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
}
.summary-note .dot { flex: none; margin: 0 8px 0 2px; }
.summary-note p { margin: 0; line-height: 1.5; }
.summary-note b { color: var(--ink); font-weight: 600; }

.section-title { font-size: 13px; color: var(--ink-2); margin: 22px 0 8px; }
.section-title + .muted { margin: 0; font-size: 13px; }
/* Section head in the style of the seed header: heavy rule, small caps. */
.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 26px;
  padding: 12px 0 6px;
  border-top: 2px solid var(--ink);
}
.sheet-label { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; }
.nowrap { white-space: nowrap; }
th, td { padding: 7px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font-size: 12px; font-weight: 600; color: var(--ink-2); border-bottom-color: var(--line-2); white-space: nowrap; }
td.r, th.r { text-align: right; }

.banners td { font-size: 13px; }
.kind { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }

.routes tbody tr { cursor: pointer; }
@media (hover: hover) {
  .routes tbody tr:hover { background: var(--panel); }
}
.routes tbody tr.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.routes .name { font-weight: 600; }
.routes .sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.routes td.r .sub { font-size: 11.5px; white-space: nowrap; }
.routes-hint { margin: 8px 0 0; }
.routes-hint.shown { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.routes-hint.shown b { font-weight: 600; color: var(--ink); }
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 3px;
  vertical-align: 1px;
}
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.muted { color: var(--ink-3); }

.detail { margin-top: 26px; }
.detail-head h3 { font-size: 16px; }
.detail-head p { margin: 2px 0 0; color: var(--ink-2); }
.detail-head { margin-bottom: 14px; }
.notice.alert {
  padding: 12px 14px;
  border-left-color: var(--bad);
  background: var(--bad-soft);
  border-radius: 0 4px 4px 0;
}
.notice.alert b { display: block; margin-bottom: 3px; font-size: 14px; color: var(--bad); }
.notice.alert p { margin: 0; color: var(--ink); line-height: 1.45; }
.notice.unproven { max-width: 860px; }
.notice.unproven p + p { margin-top: 6px; }
.notice.upcoming { max-width: 860px; padding: 12px 14px; border-radius: 0 4px 4px 0; }
.notice.upcoming b { display: block; margin-bottom: 4px; font-size: 14px; color: var(--warn); }
.notice.upcoming ul { margin: 0 0 6px; padding-left: 18px; }
.notice.upcoming li { margin: 2px 0; line-height: 1.45; overflow-wrap: anywhere; }
.notice.upcoming p { margin: 0; color: var(--ink); line-height: 1.45; }
.steps .banner small.upcoming { color: var(--warn); font-weight: 600; }
.detail-head p.why { max-width: 860px; margin-top: 6px; color: var(--ink); }
.figures { display: flex; flex-wrap: wrap; margin: 14px 0; border: 1px solid var(--line); border-radius: 4px; }
.figures div { padding: 8px 16px; border-right: 1px solid var(--line); }
.figures div:last-child { border-right: 0; }
.figures dt { font-size: 11.5px; color: var(--ink-3); }
.figures dd { margin: 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.targets { list-style: none; padding: 0; margin: 0 0 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 18px; font-size: 13px; }
.targets li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--line); padding: 3px 0; }
.targets .where { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.targets li.missing { color: var(--bad); }
.targets .why-link { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--accent); }
@media (pointer: coarse) {
  .targets .why-link { padding: 6px 0; margin: -6px 0; }
}
.diag:focus { outline: none; }
.diag.flash { animation: diag-flash 1.4s ease-out; }
@keyframes diag-flash {
  0%, 35% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
.step-got { display: none; }

.discounts { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.discounts li { padding: 3px 0; }
.discounts b { font-weight: 600; }

.steps { font-size: 13px; }
.steps td { padding: 6px 8px; }
.steps th { padding: 7px 8px; }
.steps .idx { color: var(--ink-3); width: 1%; }
.steps .banner { width: 26%; min-width: 240px; max-width: 380px; } /* room for the long banner names */
.steps .day, .steps .action, .steps .pos, .steps .pay { width: 1%; } /* as narrow as their content: the rest goes to the cats */
.steps .banner a { display: block; }
.steps .banner small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.steps .banner small b { color: var(--accent); font-weight: 600; }
.steps .banner .active-range { display: block; margin-top: 3px; color: var(--ink-2); font-size: 12px; }
.steps-hint { margin: 0 0 8px; font-size: 12.5px; }
.steps .day { min-width: 92px; max-width: 150px; }
.steps .day small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11.5px; line-height: 1.35; }
.steps .day small.deadline { color: var(--warn); font-weight: 600; }
.steps .pos { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.steps .pos .jump { display: block; font-family: var(--sans); font-size: 11px; color: var(--accent); }
.steps .pay { white-space: nowrap; }
.steps tr.hit { background: var(--hit); }
.action { white-space: nowrap; }
.action small { display: block; color: var(--ink-3); font-size: 11.5px; }

.cats { display: flex; flex-wrap: wrap; gap: 3px 4px; min-width: 260px; }
.cat {
  padding: 0 6px 0 5px;
  font-size: 12px;
  line-height: 19px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--r-rare);
  border-radius: 3px;
  white-space: nowrap;
}
.cat.super { border-left-color: var(--r-super); }
.cat.uber { border-left-color: var(--r-uber); }
.cat.legendary { border-left-color: var(--r-legend); }
.cat.target { border-color: var(--ink-2); border-left-color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.cat .mark { color: var(--accent); margin-left: 3px; }

.legend-option { display: block; margin: 1px 0; }
.legend-cells td { font-size: 13px; vertical-align: middle; }
.legend-cells tr.more td { border-top: 0; }
.legend-cells tr.first td { border-top: 1px solid var(--line-2); }
.legend-cells td.cell { font-family: var(--mono); white-space: nowrap; }
.legend-cells td small { display: block; margin-top: 1px; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); }
.legend-cells td.got .tag { margin-left: 0; margin-top: 3px; }
.legend-cells td.got b { display: block; }
.legend-cells td.got { max-width: 230px; }
.legend-cells small.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-cells td.ev { max-width: 300px; }
.legend-cells .ev-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-cells td.add { text-align: right; white-space: nowrap; }
.fit { display: inline-block; padding: 0 6px; font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap; border: 1px solid currentColor; border-radius: 3px; cursor: help; }
.fit.same { color: var(--ok); }
.fit.change { color: var(--ink-2); }
.legend-option .link-button { margin-left: 6px; }
.cat .dot { width: 7px; height: 7px; margin-right: 4px; }
.cat.skipped { text-decoration: line-through; text-decoration-color: var(--ink-3); }
td .dot { margin-right: 6px; }

.legend-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 0; font-size: 12px; color: var(--ink-2); }
.legend-row .cat { font-weight: 400; }

/* Footer (credits, legal links) ------------------------------------------- */
.site-footer { padding: 18px 22px 24px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); }
.foot-brand { margin: 0 0 12px; font-size: 12px; color: var(--ink-2); }
.foot-brand b { font-weight: 600; color: var(--ink); }
/* Where the banner data comes from and when it was last checked */
.foot-data {
  display: grid;
  gap: 3px;
  margin: 0 0 14px;
  padding: 10px 12px;
  line-height: 1.4;
  color: var(--ink-2);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.foot-data:empty { display: none; }
.foot-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.foot-data code { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.foot-check { display: flex; align-items: center; gap: 7px; }
.foot-check i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.foot-check.warn i { background: var(--warn); }
.foot-check.bad i { background: var(--bad); }
.foot-legal { margin: 0 0 14px; line-height: 1.5; }
/* A tidy grid rather than a row that breaks: two columns in the sidebar
   and on phones, all four in a row when there is room (tablets). */
.foot-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 7px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.foot-links a, .foot-links .link-button { justify-self: start; white-space: nowrap; font-size: 11.5px; text-align: left; }

/* Credits page -------------------------------------------------------------- */
body.doc { display: block; }
.doc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 14px 32px;
  font-size: 13px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.doc-head nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.doc-back { font-weight: 600; }
.doc-body { max-width: 760px; margin: 0 auto; padding: 28px 32px 72px; line-height: 1.55; }
.doc-body h1 { font-size: 22px; letter-spacing: -0.01em; }
.doc-body section { padding-top: 28px; scroll-margin-top: 12px; }
.doc-body h2 { font-size: 17px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.doc-body h3 { font-size: 14px; margin: 18px 0 4px; }
.doc-body p, .doc-body ul { margin: 8px 0; }
.doc-body ul { padding-left: 20px; }
.doc-body li { margin: 6px 0; }
.doc-body code { font-family: var(--mono); font-size: 0.92em; }

@media (max-width: 1600px) {
  .steps .banner { width: 21%; min-width: 210px; }
}
@media (max-width: 1280px) {
  .steps .banner { width: auto; min-width: 180px; max-width: 280px; }
  :root { --sidebar: 360px; }
  .content { padding: 22px 24px 56px; }
}
@media (max-width: 900px) {
  /* The sidebar's footer goes to the very end of the page, after the results */
  .sidebar { display: contents; }
  .brand, #route-form { background: var(--panel); }
  #route-form { border-bottom: 1px solid var(--line); }
  .content { order: 1; }
  .site-footer { order: 2; background: var(--panel); }
  body { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .content { padding: 20px 16px 48px; }
  .steps .banner { min-width: 150px; max-width: 200px; }
  .support {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "icon title"
      "body body"
      "button button";
    gap: 8px 12px;
    padding: 14px;
  }
  .support-icon { align-self: center; width: 32px; height: 32px; }
  .support-icon svg { width: 15px; height: 15px; }
  .support-button { margin: 6px 0 0; padding: 10px 18px; }
  .doc-head { padding: 12px 16px; }
  .doc-body { padding: 20px 16px 48px; }
}

/* Medium room (tablets, small laptops): the tables stay tables, with
   narrower columns so they fit. */
@container content (min-width: 800px) and (max-width: 960px) {
  .cats { min-width: 200px; }
  .legend-cells th, .legend-cells td { padding-left: 8px; padding-right: 8px; }
  .legend-cells td.ev { max-width: 180px; }
  .legend-cells td.got { max-width: 160px; }
}

/* Little room (phones, narrow windows): the wide tables become cards ----- */
/* Each row is laid out as a small grid with its own labels, so everything
   fits the width of the screen and nothing needs a sideways scroll. */
@container content (max-width: 799px) {
  .table-wrap { overflow: visible; }
  .summary-body { padding: 0 4px 12px; }
  .routes thead, .steps thead, .legend-cells thead, .events thead, .legend-all thead { display: none; }
  .routes, .routes tbody, .steps, .steps tbody, .legend-cells, .legend-cells tbody,
  .events, .events tbody, .legend-all, .legend-all tbody { display: block; }

  /* Banners analysed: name, then dates and type. */
  .events tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
  }
  .events td { display: block; padding: 0; border: 0; }
  .events td.bname { grid-column: 1 / -1; order: -1; }
  .events td.dates { font-size: 12px; color: var(--ink-2); }
  .events td.dates:empty { display: none; }
  .events td.kind { align-self: end; }

  /* Legend cells of the next rolls: the cell, then its legendaries. */
  .legend-all tr { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .legend-all td { display: block; padding: 0; border: 0; }
  .legend-all td:first-child { margin-bottom: 4px; }
  .legend-option { margin: 3px 0; }

  /* Routes: one card each; tap one to see its steps. The four costs, then
     the draws, then whether you can afford it as the card's foot. */
  .routes tbody tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 8px;
    margin: 0 0 10px;
    padding: 12px 14px;
    background: var(--paper);
    border: 1px solid var(--line-2);
    border-radius: 6px;
  }
  .routes tbody tr:hover { background: var(--paper); }
  .routes tbody tr.selected { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
  .routes tbody tr { -webkit-tap-highlight-color: transparent; }
  .routes td { display: block; padding: 0; border: 0; text-align: left; }
  .routes td:first-child { grid-column: 1 / -1; }
  .routes td.r { text-align: left; }
  .routes td.filler { display: none; }
  /* The draws detail goes beside the number, not under it, so the row stays even. */
  .routes td.draws { grid-column: span 3; white-space: normal; }
  .routes td.draws .sub { display: inline-block; margin: 0 0 0 4px; }
  .routes td.draws .sub::before { content: "· "; }
  .routes td.afford {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .routes td.afford > span { font-weight: 600; }
  .routes tbody tr.selected td.afford { border-top-color: var(--line-2); }
  .routes td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--ink-3);
  }
  .routes td.afford::before { margin: 0; }
  .routes .name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
  .routes .sub { margin-top: 2px; }

  /* Route figures: two columns, the last one across. */
  .figures { display: grid; grid-template-columns: 1fr 1fr; }
  .figures div { padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .figures div:nth-child(odd) { border-right: 1px solid var(--line); }
  .figures div:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }

  /* Legend cells of the route: the cell and what you get, then each other
     legendary with whether it keeps the route and its button. */
  .legend-cells tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 12px;
    padding: 8px 0;
    border-top: 1px dashed var(--line);
  }
  .legend-cells tr.first { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line-2); }
  .legend-cells td, .legend-cells tr.first td, .legend-cells tr.more td { display: block; padding: 0; border: 0; max-width: none; }
  .legend-cells td.cell { grid-column: 1 / -1; font-weight: 600; }
  .legend-cells td.cell small { display: inline; margin-left: 6px; font-weight: 400; }
  .legend-cells td.got { grid-column: 1 / -1; max-width: none; margin-bottom: 6px; }
  .legend-cells td.got::before { content: "Qué sacas ahí"; display: block; font-size: 11px; color: var(--ink-3); }
  .legend-cells td.got b { display: inline; }
  .legend-cells td.got .tag { margin: 0 0 0 6px; }
  .legend-cells td.opt { grid-column: 1; order: 1; }
  .legend-cells td.fitc { grid-column: 2; order: 2; text-align: right; }
  .legend-cells td.ev { grid-column: 1; order: 3; }
  .legend-cells td.add { grid-column: 2; order: 4; align-self: end; }
  .legend-cells td[colspan] { grid-column: 1 / -1; order: 1; }

  /* Steps: one card each, read top to bottom as an instruction:
       PASO 1                      13/10 · antes de las 11:00
       8 tiros simples                               1200 CF
       Banner name ↗ (opens the same table on godfat)
       Activo del … al … · Posición 1A → 9A
       ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
       Consigues Bath Cat
       [cats]                                                   */
  .steps tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "idx    day    day"
      "action action pay"
      "banner banner banner"
      "pos    pos    pos"
      "cats   cats   cats";
    gap: 2px 12px;
    margin: 0 0 10px;
    padding: 12px 14px 14px;
    background: var(--paper);
    border: 1px solid var(--line-2);
    border-radius: 8px;
  }
  .steps tr.hit {
    background: var(--hit);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2));
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .steps td, .steps .day, .steps .action, .steps .pos, .steps .pay, .steps .banner, .steps .idx {
    display: block; width: auto; min-width: 0; max-width: none; padding: 0; border: 0;
  }
  /* «PASO 1»: a filled tag, the first thing seen on each card. */
  .steps .idx {
    grid-area: idx;
    align-self: center;
    justify-self: start;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--button-text);
    background: var(--accent);
    border-radius: 999px;
  }
  .steps .idx::before { content: "Paso "; }
  .steps .day { grid-area: day; align-self: center; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
  .steps .day small { display: inline; margin: 0; font-size: 12px; font-weight: 400; }
  .steps .day small::before { content: " · "; color: var(--ink-3); font-weight: 400; }
  .steps .day small.deadline { font-weight: 600; }
  .steps .action { grid-area: action; margin-top: 6px; font-size: 15.5px; font-weight: 600; white-space: normal; }
  .steps .action small {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    color: var(--accent);
    vertical-align: 2px;
    border: 1px solid currentColor;
    border-radius: 3px;
  }
  .steps .pay { grid-area: pay; margin-top: 6px; text-align: right; font-size: 15.5px; font-weight: 600; }
  .steps .banner { grid-area: banner; margin-top: 4px; }
  .steps .banner a { display: inline; font-size: 13.5px; }
  .steps .banner a::after { content: " ↗"; font-size: 12px; }
  .steps .banner .active-range { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
  .steps .banner small { display: inline-block; margin-top: 4px; }
  .steps .banner small + small { margin-left: 8px; }
  .steps .pos { grid-area: pos; font-size: 12px; }
  .steps .pos::before { content: "Posición "; font-family: var(--sans); color: var(--ink-3); }
  .steps .pos .jump { display: inline; margin-left: 6px; }
  .steps .cats-cell { grid-area: cats; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
  .steps .step-got { display: block; margin: 0 0 8px; font-size: 13px; color: var(--accent); }
  .steps .step-got b { font-weight: 600; }
  .cats { min-width: 0; }
  .cat { line-height: 22px; }
}

/* Touch screens: 16px text in the fields (iPhones zoom into smaller ones)
   and bigger targets for fingers. */
@media (pointer: coarse) {
  input[type="url"], input[type="number"], input[type="date"], input[type="search"], input[type="text"], textarea { font-size: 16px; }
  input[type="number"], input[type="text"], input[type="url"] { padding: 7px 9px; }
  .picker-search input { padding-left: 32px; } /* room for the magnifier */
  .theme-toggle { min-height: 36px; padding: 6px 11px; }
  .check { margin: 8px 0; }
  .check input { width: 18px; height: 18px; margin-top: 0; }
  .check.sub { margin-left: 26px; }
  .check.sub input { width: 16px; height: 16px; margin-top: 1px; }
  .link-button { padding: 6px 0; margin: -6px 0; }
  .picker-list [role="option"] { padding: 6px 8px; }
  .selected-list li { grid-template-columns: 24px minmax(0, 1fr) auto 36px; height: 40px; }
  .selected-list .remove { width: 34px; height: 34px; font-size: 18px; }
  .foot-links { gap: 2px 16px; }
  .foot-links a, .foot-links .link-button { padding: 7px 0; margin: 0; }
  .doc-head { gap: 4px 20px; }
  .doc-head a { padding: 6px 0; }
}

/* Small phones (320-380px): tighter margins, and the theme button keeps only
   its icon so the title still fits beside it. */
@media (max-width: 380px) {
  .brand { gap: 10px; padding: 14px 16px; }
  .brand-id { gap: 10px; }
  .group, .actions { padding-left: 16px; padding-right: 16px; }
  .site-footer { padding-left: 16px; padding-right: 16px; }
  .theme-toggle { min-width: 0; }
  #theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@container content (max-width: 300px) {
  .routes tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .routes td.draws { grid-column: auto; }
}
