/* Editor chrome. Nothing here touches .page - see cv.css for the document. */

/* Two themes over one token set. The CV page itself is always white in both -
   it is paper, and it has to print. Only the app chrome changes. */

:root, :root[data-theme="dark"] {
  --bg: #0e1116;
  --panel: #12171e;
  --panel-2: #171e26;
  --line: #232c37;
  --line-soft: #1c242d;
  --text: #e7edf5;
  --muted: #8d99a8;
  --dim: #a9b6c6;

  --brand: #5b9dff;
  --brand-ink: #0b1220;
  --brand-hover: #7fb0ff;
  --brand-ring: rgba(91, 157, 255, 0.16);
  --brand-wash: rgba(91, 157, 255, 0.05);

  --danger: #f2707a;
  --danger-ink: #2a0d10;
  --danger-border: #4a2b30;
  --ok: #4ec98d;
  --ok-ink: #06251a;
  --warn: #e8b451;
  --warn-bg: #4a3313;
  --warn-ink: #ffd08a;

  --input-bg: #0f141a;
  --placeholder: #4e5a68;
  --card: #10161d;
  --hover: #1e2732;
  --hover-2: #202a35;
  --border-hover: #2e3945;
  --track: #263140;
  --chip: #232c37;
  --badge: #33404f;
  --seg-sel: #1e2937;

  --stage-bg: #20262e;
  --stage-bar: #1a2027;
  --review-bg: #1b2129;
  --toast-bg: #1d2630;

  --shadow-lg: rgba(0, 0, 0, 0.5);
  --scrim: rgba(6, 9, 13, 0.72);
  --page-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --mark-bg: rgba(242, 112, 122, 0.22);
  --mark-ink: #ffc9cd;

  --logo-ink: #08101f;
  --radius: 10px;
  --topbar-h: 56px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef1f6;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --line: #dde3ec;
  --line-soft: #ebeff5;
  --text: #16202b;
  --muted: #64717f;
  --dim: #47535f;

  --brand: #2563eb;
  --brand-ink: #ffffff;
  --brand-hover: #1d4ed8;
  --brand-ring: rgba(37, 99, 235, 0.18);
  --brand-wash: rgba(37, 99, 235, 0.06);

  --danger: #c62b38;
  --danger-ink: #ffffff;
  --danger-border: #e9b7bc;
  --ok: #12764a;
  --ok-ink: #ffffff;
  --warn: #a86a12;
  --warn-bg: #fbf0d4;
  --warn-ink: #74510f;

  --input-bg: #ffffff;
  --placeholder: #9aa6b4;
  --card: #f8fafc;
  --hover: #eef2f7;
  --hover-2: #e8eef6;
  --border-hover: #bcc7d5;
  --track: #e2e8f0;
  --chip: #eaeef4;
  --badge: #d5dde7;
  --seg-sel: #e2ebf9;

  --stage-bg: #dfe4ec;
  --stage-bar: #f7f9fc;
  --review-bg: #eef1f6;
  --toast-bg: #22303f;

  --shadow-lg: rgba(23, 35, 51, 0.16);
  --scrim: rgba(28, 38, 52, 0.42);
  --page-shadow: 0 6px 26px rgba(15, 22, 33, 0.18);
  --mark-bg: rgba(198, 43, 56, 0.14);
  --mark-ink: #8e1620;

  --logo-ink: #ffffff;
  color-scheme: light;
}

/* The toast keeps a dark surface in both themes, so it needs its own ink. */
.toast { color: #f2f6fb; }

/* Theme button shows the theme you would switch to, not the current one. */
.ico-sun { display: none; }
.ico-moon { display: block; }
:root[data-theme="light"] .ico-sun { display: block; }
:root[data-theme="light"] .ico-moon { display: none; }

* { box-sizing: border-box; }

/* The browser hides [hidden] with a user-agent rule, which ANY author `display`
   declaration outranks - so `.drop-veil { display: grid }` silently defeated
   `hidden` and pinned the overlay open. Anything toggled by the hidden
   attribute needs this to stay hidden. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
/* manipulation drops the 300ms double-tap wait; the grey flash is Android's. */
button, a, label, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }

/* ------------------------------------------------------------- app shell */

.app {
  display: flex;
  flex-direction: column;
  /* dvh, or a phone's collapsing address bar hides the bottom of the app and
     nothing can scroll it back into view. vh first for browsers without it. */
  height: 100vh;
  height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  flex: 0 0 auto;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-right: 4px;
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}
/* The chevron is what makes the logo read as a way out rather than decoration. */
.brand-back {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-right: -3px;
  color: var(--muted);
  transition: color 0.14s, transform 0.14s;
}
.brand-back svg { width: 16px; height: 16px; }
a.brand:hover .brand-back { color: var(--brand); transform: translateX(-2px); }
a.brand:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 8px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--brand), #9b7bff);
  color: var(--logo-ink);
  font-weight: 800;
  font-size: 13px;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
}

.spacer { flex: 1; }

.top-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  /* Several .btn are anchors, and the UA underline was showing through on
     them - a button with underlined text reads as broken. */
  text-decoration: none;
  transition: background 0.14s, border-color 0.14s, transform 0.08s;
}
.btn:hover { background: var(--hover); border-color: var(--border-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 620;
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { background: transparent; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 28px; padding: 0; justify-content: center; }
.btn-danger:hover { color: var(--danger); border-color: var(--danger-border); }

/* dropdown */

.menu { position: relative; }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 236px;
  padding: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px var(--shadow-lg);
  z-index: 40;
  display: none;
}
.menu.open .menu-list { display: block; }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.menu-item:hover { background: var(--hover-2); }
.menu-item small { display: block; color: var(--muted); font-size: 11.5px; }
/* The Home entry is an anchor, so middle-click and "open in new tab" work. */
a.menu-item { color: inherit; text-decoration: none; }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }

/* ------------------------------------------------------------ workspace */

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 430px 1fr;
}

.panel {
  min-height: 0;
  /* A grid item's automatic minimum is its min-content width, and the 794px
     CV page inside the stage made that column 752px wide on a 375px phone.
     Both tracks need an explicit floor of zero. */
  min-width: 0;
  overflow-y: auto;
  padding: 14px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.panel::-webkit-scrollbar { width: 10px; }
.panel::-webkit-scrollbar-thumb { background: var(--chip); border-radius: 20px; border: 3px solid var(--panel); }

/* accordion */

.acc {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  overflow: hidden;
}
.acc + .acc { margin-top: 10px; }

.acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.acc-head:hover { background: var(--hover); }
.acc-title { font-weight: 600; }
.acc-count {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--chip);
  border-radius: 20px;
  padding: 1px 8px;
}
.acc-chev { color: var(--muted); transition: transform 0.18s; }
.acc.open .acc-chev { transform: rotate(90deg); }
.acc-body { display: none; padding: 4px 13px 14px; border-top: 1px solid var(--line-soft); }
.acc.open .acc-body { display: block; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 2px; }

/* fields */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.field { grid-column: span 12; min-width: 0; }
.field.s6 { grid-column: span 6; }
.field.s4 { grid-column: span 4; }
.field > label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
}
.input,
.select,
textarea.input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.input:focus,
.select:focus,
textarea.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.input::placeholder { color: var(--placeholder); }
.input:disabled { opacity: 0.45; }
textarea.input { resize: vertical; line-height: 1.5; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

/* repeatable items */

.item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  margin-top: 10px;
  overflow: hidden;
}
.item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}
.item-grip {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
.item-name {
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-tools { display: flex; gap: 4px; flex: 0 0 auto; }
.item-body { display: none; padding: 2px 10px 12px; border-top: 1px solid var(--line-soft); }
.item.open .item-body { display: block; }
.add-row { margin-top: 10px; }

.empty {
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* template gallery */

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 10px;
}
.tpl-card {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  text-align: left;
}
.tpl-card:hover { border-color: var(--badge); }
.tpl-card.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-ring); }
.tpl-card b { display: block; font-size: 12px; font-weight: 600; margin-top: 6px; }
.tpl-card span { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.35; }

.thumb {
  position: relative;
  height: 64px;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
  display: flex;
}
.thumb i {
  position: absolute;
  background: #c7ced8;
  border-radius: 1px;
}
.thumb .bar { background: var(--brand); }
.thumb .col { position: relative; height: 100%; background: var(--brand); }

/* swatches */

.swatches { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; align-items: center; }
.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch.sel { border-color: var(--text); }
.swatch-custom {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.seg { display: flex; gap: 0; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  flex: 1;
  padding: 7px 6px;
  border: 0;
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.sel { background: var(--seg-sel); color: var(--text); font-weight: 600; }

.range-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.range-row output { width: 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* section order list */

.order-list { margin: 10px 0 0; padding: 0; list-style: none; }
.order-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.order-list li + li { margin-top: 6px; }
.order-list span { flex: 1; font-size: 13px; }

.photo-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.photo-prev {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--input-bg);
  border: 1px solid var(--line);
  object-fit: cover;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- stage */

.stage {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--stage-bg);
}

.stage-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 8px 14px;
  background: var(--stage-bar);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.pill {
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--chip);
  color: var(--text);
  font-size: 11.5px;
}
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }

.stage-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.page-scaler { zoom: var(--zoom, 1); }
.page-wrap { position: relative; }
.page-wrap .page {
  box-shadow: var(--page-shadow);
  border-radius: 2px;
}
.page-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--page-h, 297mm) - 1px),
    rgba(226, 78, 78, 0.55) calc(var(--page-h, 297mm) - 1px),
    rgba(226, 78, 78, 0.55) var(--page-h, 297mm)
  );
}

/* --------------------------------------------------------- form extras */

.hint.guide {
  border-left: 2px solid var(--brand);
  padding: 6px 0 6px 9px;
  color: var(--dim);
  background: var(--brand-wash);
  border-radius: 0 6px 6px 0;
  margin-bottom: 4px;
}

.callout {
  margin-top: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--input-bg);
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.5;
}
.callout b { color: var(--text); }

.checks { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.checks .check input:disabled + span { opacity: 0.5; }

.acc-flag {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warn-ink);
  background: var(--warn-bg);
  border-radius: 20px;
  padding: 2px 7px;
}

/* -------------------------------------------------------- review pane */

.stage-tabs { margin: 0; width: 190px; flex: 0 0 auto; }
.stage-tabs.wide { width: 268px; }
.tab-badge {
  display: inline-block;
  min-width: 17px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 20px;
  background: var(--badge);
  color: var(--text);
  font-size: 11px;
  line-height: 16px;
}
.tab-badge.bad { background: var(--danger); color: var(--danger-ink); font-weight: 700; }
.tab-badge.ok { background: var(--ok); color: var(--ok-ink); font-weight: 700; }

.review-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: var(--review-bg);
}
.review-inner { max-width: 760px; margin: 0 auto; }

.score-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}
.score-dial {
  --pct: 0;
  --ring: var(--ok);
  position: relative;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--track) 0);
}
.score-dial::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--panel-2);
}
.score-dial b {
  position: relative;
  z-index: 1;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.score-meta h3 { margin: 0 0 3px; font-size: 17px; }
.score-meta p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.bands { display: grid; gap: 8px; margin-top: 14px; }
.band { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; align-items: center; font-size: 12.5px; }
.band-track { height: 7px; border-radius: 20px; background: var(--track); overflow: hidden; }
.band-fill { height: 100%; border-radius: 20px; background: var(--ok); }
.band-fill.mid { background: var(--warn); }
.band-fill.low { background: var(--danger); }
.band-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stat {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  font-size: 12px;
  color: var(--muted);
}
.stat b { display: block; color: var(--text); font-size: 15px; font-weight: 650; }

.score-letter {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 9px;
  border-radius: 7px;
  background: var(--chip);
  font-size: 14px;
  font-weight: 700;
  vertical-align: 2px;
}
.verdict { color: var(--text) !important; margin-bottom: 6px !important; font-weight: 550; }

.chars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.char {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
}
.char-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.char-name { font-size: 13px; font-weight: 620; }
.char-letter {
  min-width: 30px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--chip);
}
.char-letter.gA { background: var(--ok); color: var(--ok-ink); }
.char-letter.gB { background: var(--brand); color: var(--brand-ink); }
.char-letter.gC { background: var(--warn); color: var(--warn-bg); }
.char-letter.gD, .char-letter.gE { background: var(--danger); color: var(--danger-ink); }
.char .band-track { display: block; margin: 9px 0 8px; }
.char-blurb { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }

/* ------------------------------------------------------------ sample bar */

.sample-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 9px 14px;
  background: var(--brand-wash);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--dim);
}
.sample-bar b { color: var(--text); }
.sample-tag {
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sample-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.find-group { margin-top: 20px; }
.find-group > h4 {
  margin: 0 0 9px;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.finding {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 13px 15px;
}
.finding + .finding { margin-top: 9px; }
.finding.blocker { border-left-color: var(--danger); }
.finding.warn { border-left-color: var(--warn); }
.finding.tip { border-left-color: var(--brand); }
.finding h5 { margin: 0 0 5px; font-size: 14px; font-weight: 620; }
.finding p { margin: 0 0 7px; font-size: 13px; color: var(--dim); line-height: 1.55; }
.finding .fix { color: var(--text); }
.finding .fix b { color: var(--ok); font-weight: 600; }

.samples { margin: 8px 0 0; padding: 0; list-style: none; }
.samples li {
  font-size: 12.5px;
  color: var(--dim);
  background: var(--input-bg);
  border-radius: 7px;
  padding: 7px 10px;
  margin-top: 5px;
  line-height: 1.5;
}
.samples mark {
  background: var(--mark-bg);
  color: var(--mark-ink);
  border-radius: 3px;
  padding: 0 2px;
}
.samples .suggest { display: block; margin-top: 3px; color: var(--ok); font-size: 12px; }
.finding-actions { margin-top: 10px; }

.review-clean {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.review-clean b { display: block; color: var(--ok); font-size: 16px; margin-bottom: 6px; }

/* ------------------------------------------------------- import dialog */

.modal-wide { width: min(680px, 100%); }

.dropzone {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 26px 18px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-wash); }
.dropzone b { font-size: 14px; }
.dropzone span { font-size: 12.5px; color: var(--muted); }

.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.or-line::before, .or-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------------------------------------------------------- clean-up UI */

.score-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.fix-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}
.fix-row + .fix-row { margin-top: 8px; }
.fix-row:hover { border-color: var(--border-hover); }
.fix-row.destructive { border-left: 3px solid var(--warn); }
.fix-row input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--brand); flex: 0 0 auto; }
.fix-body { display: block; min-width: 0; }
.fix-body b { font-size: 13.5px; }
.fix-count {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--chip);
  color: var(--muted);
  font-size: 11px;
}
.fix-detail { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.fix-caveat {
  margin: 14px 0 0 !important;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--input-bg);
  font-size: 12px !important;
  line-height: 1.5;
}

/* ------------------------------------------------------- planet result */

/* A full-screen flyby: the rail travels out from Mercury and decelerates onto
   the planet you earned, then the card lands. Deep space in both themes -
   this is the one surface that ignores the theme, because space is dark. */

.planet-show {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 30%, #16244a 0%, #0a0f1f 55%, #05070f 100%);
  animation: show-in 0.4s ease both;
}
@keyframes show-in { from { opacity: 0; } to { opacity: 1; } }

.sky { position: absolute; inset: 0; pointer-events: none; }
.sky i {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle 3.2s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.95; }
}

/* --- phase 1: the flyby ------------------------------------------------- */

.flyby {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.rail {
  display: flex;
  align-items: center;
  gap: 150px;
  will-change: transform;
  transform: translateX(0);
}
.rail-item {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 12px;
  opacity: 0.32;
  transform: scale(0.62);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.rail-item.target { opacity: 1; transform: scale(1); }
.rail-name {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}
.rail-item.target .rail-name { color: #fff; font-weight: 700; }

.planet-show.travelling .rail { filter: blur(1.4px); }
.planet-show.arrived .flyby { transform: translateY(-104px); transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.planet-show.arrived .rail-item:not(.target) { opacity: 0; }

/* --- phase 2: the card -------------------------------------------------- */

.verdict-card {
  position: relative;
  z-index: 2;
  width: min(470px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  margin-top: 190px;
  padding: 20px 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(11, 17, 33, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  color: #eaf0f8;
  text-align: center;
  opacity: 0;
  transform: translateY(22px);
  pointer-events: none;
}
.planet-show.arrived .verdict-card {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity 0.55s ease 0.15s, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}
.verdict-card .planet-stage { display: none; }

.verdict-card h2 { margin: 0 0 10px; font-size: 25px; letter-spacing: -0.01em; color: #fff; }
.planet-rank {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.planet-stars { color: #f5c14b; display: flex; justify-content: center; }
.stars { display: inline-flex; gap: 4px; }
.star { opacity: 0; transform: scale(0.4) rotate(-25deg); }
.star.lit { animation: star-pop 0.42s cubic-bezier(0.22, 1.6, 0.4, 1) forwards; }
@keyframes star-pop {
  to { opacity: 1; transform: none; }
}
.star.empty { color: rgba(255, 255, 255, 0.3); }

.score-line {
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
}
.score-line b { font-size: 30px; color: #fff; font-weight: 700; }
.score-line i {
  font-style: normal;
  margin-left: 9px;
  padding: 2px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.planet-line {
  margin: 12px auto 0;
  max-width: 36em;
  color: rgba(234, 240, 248, 0.78);
  font-size: 13.5px;
  line-height: 1.62;
}
.planet-tag { color: #fff; font-weight: 650; }

.planet-scale-toggle {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.16);
}
.planet-scale-toggle:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.planet-scale {
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  text-align: left;
}
.scale-row { display: flex; align-items: center; gap: 10px; padding: 7px 11px; font-size: 12.5px; }
.scale-row + .scale-row { border-top: 1px solid rgba(255, 255, 255, 0.09); }
.scale-row.now { background: rgba(120, 170, 255, 0.16); }
.scale-row .n { width: 18px; color: rgba(255, 255, 255, 0.45); font-variant-numeric: tabular-nums; }
.scale-row .who { flex: 1; font-weight: 550; }
.scale-row .sc { color: rgba(255, 255, 255, 0.45); font-variant-numeric: tabular-nums; }
.scale-row .stars { color: #f5c14b; }
.scale-row .star { opacity: 1; transform: none; }
.scale-row .star.empty { color: rgba(255, 255, 255, 0.22); }

.verdict-card .modal-actions { justify-content: center; margin-top: 18px; }
.verdict-card .btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.verdict-card .btn:hover { background: rgba(255, 255, 255, 0.18); }
.verdict-card .btn-primary { background: var(--brand); border-color: var(--brand); color: #06122c; }
.verdict-card .btn-primary:hover { background: #7fb0ff; }

.skip-hint {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
}
.planet-show.arrived .skip-hint { opacity: 0; transition: opacity 0.3s ease; }

@media (prefers-reduced-motion: reduce) {
  .planet-show, .planet-show .rail, .planet-show .flyby,
  .verdict-card, .star { animation: none !important; transition: none !important; }
  .sky i { animation: none !important; opacity: 0.6; }
  .star { opacity: 1; transform: none; }
}

@media (max-height: 700px) {
  .verdict-card { margin-top: 150px; }
  .planet-show.arrived .flyby { transform: translateY(-86px); }
}

/* The card is centred and then pushed down to clear the planet above it, so
   its own max-height has to allow for that push or the buttons at the bottom
   end up below the fold with no way to scroll to them. */
@media (max-width: 620px) {
  .verdict-card {
    margin-top: 132px;
    max-height: calc(100dvh - 190px);
    padding: 18px 18px 20px;
  }
  .planet-show.arrived .flyby { transform: translateY(-76px); }
  .rail { gap: 90px; }
  .verdict-card .modal-actions { flex-wrap: wrap; }
  .verdict-card .modal-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------------------------------------------------------- clean-up UI */

.score-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.fix-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}
.fix-row + .fix-row { margin-top: 8px; }
.fix-row:hover { border-color: var(--border-hover); }
.fix-row.destructive { border-left: 3px solid var(--warn); }
.fix-row input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--brand); flex: 0 0 auto; }
.fix-body { display: block; min-width: 0; }
.fix-body b { font-size: 13.5px; }
.fix-count {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--chip);
  color: var(--muted);
  font-size: 11px;
}
.fix-detail { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.fix-caveat {
  margin: 14px 0 0 !important;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--input-bg);
  font-size: 12px !important;
  line-height: 1.5;
}

/* ------------------------------------------------------- planet result */

.modal-planet { width: min(460px, 100%); text-align: center; }
.modal-planet h2 { margin: 14px 0 8px; font-size: 24px; letter-spacing: -0.01em; }
.modal-planet .modal-actions { justify-content: center; margin-top: 18px; }

.planet-stage {
  display: grid;
  place-items: center;
  min-height: 150px;
  animation: planet-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes planet-rise {
  from { opacity: 0; transform: translateY(16px) scale(0.85); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .planet-stage { animation: none; }
}
.planet-svg { filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35)); }

.planet-rank {
  display: inline-block;
  margin-bottom: 2px;
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.planet-stars { color: var(--warn); display: flex; justify-content: center; }
.stars { display: inline-flex; gap: 3px; }
.star.empty { opacity: 0.32; }
.planet-line {
  margin: 10px auto 0;
  max-width: 34em;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.6;
}
.planet-tag { color: var(--text); font-weight: 600; }

.planet-scale-toggle { margin-top: 14px; color: var(--muted); }
.planet-scale {
  margin-top: 10px;
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}
.scale-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  font-size: 12.5px;
}
.scale-row + .scale-row { border-top: 1px solid var(--line-soft); }
.scale-row.now { background: var(--brand-wash); }
.scale-row .n { width: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale-row .who { flex: 1; font-weight: 550; }
.scale-row .sc { color: var(--muted); font-variant-numeric: tabular-nums; }
.scale-row .stars { color: var(--warn); }

.import-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--danger-border);
  border-left: 3px solid var(--danger);
  border-radius: 9px;
  background: var(--card);
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.5;
}

.drop-veil {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  background: var(--scrim);
  pointer-events: none;
}
.drop-veil > div {
  padding: 22px 34px;
  border: 2px dashed var(--brand);
  border-radius: 16px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.report-list { margin: 0 0 12px; padding: 0; list-style: none; }
.report-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--input-bg);
  font-size: 13px;
}
.report-list li + li { margin-top: 5px; }
.report-list .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.report-list .none { opacity: 0.55; }
.report-note {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* --------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--toast-bg);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: none;
  /* flex-start + auto margins on the child, not align-items:center: a centred
     flex item taller than the viewport gets its top clipped with no way to
     scroll to it, which hid the lower half of the taller dialogs on a phone. */
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  z-index: 80;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(520px, 100%);
  margin: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
  box-shadow: 0 30px 70px var(--shadow-lg);
}
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.modal ol { margin: 0 0 18px; padding-left: 20px; color: var(--text); font-size: 13.5px; }
.modal li { margin-bottom: 6px; }
.modal li b { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* --------------------------------------------------- import: from LinkedIn */

.from-li {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 13px;
}
.from-li > summary {
  padding: 10px 13px;
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
  list-style: none;
}
.from-li > summary::-webkit-details-marker { display: none; }
.from-li > summary::before { content: "\25B8 "; color: var(--muted); }
.from-li[open] > summary::before { content: "\25BE "; }
.from-li > div { padding: 0 13px 12px; }
.from-li p { margin: 0 0 9px; color: var(--dim); font-size: 12.5px; line-height: 1.6; }
.from-li p:last-child { margin-bottom: 0; }
.from-li-note { color: var(--muted) !important; border-top: 1px solid var(--line-soft); padding-top: 9px; }

/* --------------------------------------------------------- fix my LinkedIn */

.li-field {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  margin-bottom: 12px;
  overflow: hidden;
}
.li-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.li-head label { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Past LinkedIn's own limit the rest is simply cut off, so this has to shout. */
.li-count.over { color: var(--danger); font-weight: 700; }

.li-box { border: 0 !important; border-radius: 0 !important; background: none !important; }
.li-box:focus { box-shadow: none !important; outline: 2px solid var(--brand); outline-offset: -2px; }
.li-hint { margin: 0; padding: 0 12px 8px; font-size: 11.5px; color: var(--muted); }

.li-flags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 11px; }
.li-flag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--mark-bg);
  color: var(--mark-ink);
}
.li-flag.soft { background: var(--warn-bg); color: var(--warn-ink); }
.li-clear { padding: 0 12px 11px; font-size: 11.5px; color: var(--ok); }

/* ------------------------------------------------------- install banner */

/* Built by pwa.js and prepended to .app, or to <body> above the sticky nav.
   In the app shell it is a flex child, so the workspace shrinks around it
   rather than being overlapped. */
.install-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top, 0px));
}
.install-bar-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--brand-wash);
  color: var(--brand);
}
.install-bar-mark svg { width: 19px; height: 19px; }
.install-bar-copy { flex: 1; min-width: 0; }
.install-bar-copy b { display: block; font-size: 13.5px; line-height: 1.3; }
.install-bar-copy span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.install-bar .btn { flex: 0 0 auto; }
.install-bar-x { color: var(--muted); }
.install-bar-x:hover { color: var(--text); }

@media (max-width: 420px) {
  .install-bar { gap: 9px; padding-inline: 10px; }
  .install-bar-mark { width: 32px; height: 32px; }
}
/* The second line ellipsises long before this; below here there is no room for
   it at all. */
@media (max-width: 330px) {
  .install-bar-copy span { display: none; }
}

/* ------------------------------------------------------- install dialog */

/* Built by pwa.js rather than sitting in three HTML files. */
.install-modal { width: min(430px, 100%); }
.install-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.install-head h2 { margin: 0 0 4px; }
.install-sub { margin: 0 !important; line-height: 1.55; }
/* Scoped: site.css defines .install-mark for the card in the share section and
   loads after this file, so an unscoped rule here would lose to it. */
.install-modal .install-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--brand-wash);
  color: var(--brand);
}
.install-modal .install-mark svg { width: 23px; height: 23px; }

.install-points { list-style: none; margin: 0 0 20px; padding: 0; }
.install-points li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 9px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.install-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
.install-points b { color: var(--text); font-weight: 600; }

.install-steps { margin: 0 0 20px; padding-left: 20px; }
.install-steps li { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.install-steps b { color: var(--text); }

/* ------------------------------------------------------------ mobile bar */

/* Below 900px this replaces the Edit/Preview toggle and the CV/Letter/Check
   tabs at once, because both were competing for a topbar with no room left. */
.mobile-bar { display: none; }
.narrow-only { display: none; }

@media (max-width: 900px) {
  .mobile-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    flex: 0 0 auto;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-bar button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    position: relative;
    min-height: 54px;
    padding: 6px 2px;
    border: 0;
    border-top: 2px solid transparent;
    background: none;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-bar button svg { width: 21px; height: 21px; }
  .mobile-bar button.sel { color: var(--brand); border-top-color: var(--brand); }
  .mobile-bar button:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
  .mobile-bar .tab-badge {
    position: absolute;
    top: 4px;
    left: 50%;
    margin-left: 6px;
    font-style: normal;
    font-size: 10px;
    line-height: 15px;
    min-width: 15px;
  }
}

/* ---------------------------------------------------------- responsive */

.mobile-tabs { display: none; }

@media (max-width: 1040px) {
  .workspace { grid-template-columns: 1fr; }
  .mobile-tabs { display: flex; }
  .panel { border-right: 0; }
  body[data-view="preview"] .panel { display: none; }
  body[data-view="edit"] .stage { display: none; }
  .top-actions .label-hide { display: none; }
  .stage-scroll { padding: 12px; }
}

@media (max-width: 900px) {
  /* The bottom bar owns view switching now, so these two go. Left in place
     they crushed to 2px and overlapped the buttons beside them. */
  .mobile-tabs { display: none; }
  .stage-tabs { display: none; }
  .narrow-only { display: block; }

  .topbar { gap: 8px; padding: 0 10px; }
  .brand small { display: none; }
  /* Everything below is reachable from the More menu instead. #btnInstall is
     in this list because it is only ever shown when an install is on offer,
     and that pushed the topbar 31px past the viewport when it appeared. */
  #saveState,
  #btnInstall,
  #btnImport,
  #btnExample { display: none; }
  .menu-list { min-width: min(280px, calc(100vw - 20px)); }

  /* 16px or iOS zooms the whole page on focus and never zooms back out. */
  .input,
  .select,
  textarea.input { font-size: 16px; min-height: 42px; }
  .btn { height: 40px; }
  .btn-sm { height: 34px; }
  .btn-icon { width: 40px; }
  .btn-sm.btn-icon { width: 34px; }
  .acc-head { padding: 15px 13px; }
  .item-head { padding: 11px 10px; }
  .check input { width: 19px; height: 19px; }
  .swatch, .swatch-custom { width: 30px; height: 30px; }
  .order-list li { padding: 9px 9px; }

  /* Nothing here should bounce the page behind it. */
  .panel, .stage-scroll, .review-pane { overscroll-behavior: contain; }
  .panel { padding: 12px 12px 20px; }
  .review-pane { padding: 14px; }
  .stage-bar { padding: 7px 10px; gap: 7px; }
  .modal { padding: 18px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 700px) {
  .tpl-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  /* Half a 375px screen is nine characters of an email address. */
  .field.s6 { grid-column: span 12; }
  .field.s4 { grid-column: span 6; }
  .sample-bar { flex-wrap: wrap; }
  .score-card { flex-direction: column; text-align: center; gap: 14px; }
  .stat-row .stat { flex: 1 1 calc(50% - 4px); }
}
