/* ==========================================================================
   SUDOKU (sudoku.html)

   An app-like page: the page's own bar on top and one view under it (home,
   the game, the library, the daily puzzles, the lessons, a lesson, import,
   entering a puzzle, statistics). The game view lays the board out beside
   the keys when the room is wide, and above them when it is tall, sized by
   container queries so it fits any phone, tablet or window without
   scrolling. Nothing scrolls but the list views.
   ========================================================================== */

.su-body {
  --su-page: #f4f6f8;
  --su-bar-bg: #ffffff;
  --su-card: #ffffff;
  --su-card-line: #dfe4ea;
  --su-cell: #ffffff;
  --su-thin: #c9d0d8;
  --su-thick: #39434e;
  --su-given: #161b22;
  --su-user: #2a5b9f;
  --su-note: #5b6571;
  --su-peer: #edf1f5;
  --su-same: #fbe2c4;
  --su-sel: #f5c48b;
  --su-sel-ring: #d98a3d;
  --su-bad: #c22f2f;
  --su-bad-bg: #fde3e1;
  --su-unit: #fff3c9;
  --su-unit2: #e2edfb;
  --su-ring: #d4782f;
  --su-key: #2c9a58;
  --su-alt: #3a76c2;
  --su-fin: #8a52c8;
  --su-on: #3a76c2;
  --su-off: #e0862c;
  --su-on2: #2c9a58;
  --su-off2: #8a52c8;
  --su-elim: #d4413a;
  --su-link: #c2410c;
  --su-block: #f3d7b0;
  --su-soft: #dfe5ec;
  --su-focus: #f3b87b;
  --su-k1: #ffd5d2;
  --su-k2: #ffeab0;
  --su-k3: #d3f2d5;
  --su-k4: #d2e5ff;
  --su-k5: #e7d9ff;
  --su-k6: #ffd9ee;
  --su-l1: #3a9a57;
  --su-l2: #6b9a2b;
  --su-l3: #b8840e;
  --su-l4: #d16426;
  --su-l5: #c13f36;
  --su-l6: #973879;
  --su-l7: #5a3d99;
  --su-key-bg: #ffffff;
  --su-key-bg-hover: #f2f4f7;
  --su-shadow: 0 1px 2px rgba(19, 23, 28, 0.06), 0 4px 14px rgba(19, 23, 28, 0.06);
}
[data-theme="dark"] .su-body {
  --su-page: #0b0e12;
  --su-bar-bg: #10141a;
  --su-card: #141a21;
  --su-card-line: #262e38;
  --su-cell: #141a21;
  --su-thin: #2a323c;
  --su-thick: #8995a2;
  --su-given: #e9edf1;
  --su-user: #8ab8f2;
  --su-note: #98a3af;
  --su-peer: #1b222b;
  --su-same: #3b2c1b;
  --su-sel: #5e4223;
  --su-sel-ring: #e0a160;
  --su-bad: #ff7d72;
  --su-bad-bg: #3c1c1e;
  --su-unit: #312a12;
  --su-unit2: #162539;
  --su-ring: #e8954b;
  --su-key: #3fb86e;
  --su-alt: #5b97e3;
  --su-fin: #a679e2;
  --su-on: #5b97e3;
  --su-off: #ee9c45;
  --su-on2: #3fb86e;
  --su-off2: #a679e2;
  --su-elim: #f0625a;
  --su-link: #f08a4b;
  --su-block: #4a3920;
  --su-soft: #2e3742;
  --su-focus: #9c6a33;
  --su-k1: #4a2423;
  --su-k2: #45391a;
  --su-k3: #1d3a24;
  --su-k4: #1b2f4a;
  --su-k5: #31264a;
  --su-k6: #46213a;
  --su-l1: #4fb86c;
  --su-l2: #8cb94a;
  --su-l3: #d9a52e;
  --su-l4: #ec8546;
  --su-l5: #ec665c;
  --su-l6: #c862a8;
  --su-l7: #8f73d4;
  --su-key-bg: #171d25;
  --su-key-bg-hover: #1e2630;
  --su-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* The page never scrolls as a whole and a double tap does not zoom it. A
   pinned body leaves <html> zero high, so <html> paints the background. */
html { overflow: hidden; overscroll-behavior: none; touch-action: manipulation; background: var(--bg-primary); }
body.su-body { position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; }
.su-content { overflow: hidden; }

.su {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--su-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}
.su [hidden], .su-menu[hidden], .su-toast[hidden], .su-drop[hidden] { display: none !important; }
/* buttons take the page's font; :where() keeps this from outweighing any class */
:where(.su, .su-menu, .su-dialog) button { font: inherit; color: inherit; }
.su-noscript { position: fixed; left: 16px; right: 16px; top: 80px; text-align: center; }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.su-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.su-iconbtn svg { width: 19px; height: 19px; }
.su-iconbtn:focus-visible, .su-btn:focus-visible, .su-tool:focus-visible, .su-key:focus-visible,
.su-tile:focus-visible, .su-level:focus-visible, .su-choice:focus-visible, .su-link:focus-visible,
.su-libcell:focus-visible, .su-menu-item:focus-visible, .su-seg-btn:focus-visible, .su-lessoncard:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}
.su-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--su-card-line);
  border-radius: 10px;
  background: var(--su-card);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.su-btn svg { width: 17px; height: 17px; }
.su-btn-go { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.su-btn:disabled { opacity: 0.45; cursor: default; }
.su-link {
  border: 0;
  background: none;
  padding: 6px 4px;
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
.su-link:disabled { opacity: 0.4; cursor: default; text-decoration: none; }
@media (hover: hover) {
  .su-iconbtn:hover { background: var(--su-key-bg-hover); color: var(--text-primary); }
  .su-btn:hover:not(:disabled) { border-color: var(--accent-line); }
  .su-btn-go:hover:not(:disabled) { background: var(--accent-fill-hover); }
  .su-link:hover:not(:disabled) { color: var(--text-primary); }
}

/* ── The bar ─────────────────────────────────────────────────────────── */

.su-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 50px;
  padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--su-card-line);
  background: var(--su-bar-bg);
}
.su-homelink { display: none; align-items: center; padding: 0 6px 0 2px; border-radius: 6px; }
.su-homelink img { display: block; width: 24px; height: 24px; }
.su-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 4px;
  overflow: hidden;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.su-back { display: none; }
.su:not([data-view="home"]) .su-back { display: inline-flex; }
.su-bar-game { display: none; align-items: center; gap: 8px; flex: none; }
.su[data-view="game"] .su-bar-game { display: flex; }
.su-bar-end { display: flex; align-items: center; gap: 2px; flex: none; }
.su-gameonly { display: none; }
.su[data-view="game"] .su-gameonly { display: inline-flex; }
.su-themebtn { display: none; font-size: 17px; line-height: 1; }
.su-bar-end > .kvot-fullwin > button[type] { width: 38px; height: 38px; border-radius: 9px; }
:root.kvot-full .su-homelink { display: flex; }
:root.kvot-full .su-themebtn { display: inline-flex; }

.su-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 8px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--chip, var(--text-muted)) 14%, transparent);
  color: var(--chip, var(--text-secondary));
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.su-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.su-chip:empty { display: none; }
.su-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--su-card-line);
  border-radius: 17px;
  background: var(--su-card);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.su-timer-icon svg { width: 13px; height: 13px; display: block; }
.su-timer.is-hidden #su-time { display: none; }
#su-timer2.is-hidden { display: none; }

/* A touch screen or a phone never shows the site's header and footer:
   the bar has the kvot mark and the theme switch instead. */
@media (max-width: 680px), (pointer: coarse) {
  :root { --header-height: 0px; --footer-height: 0px; }
  body.su-body > header, body.su-body > footer, body.su-body > .nav-toggle,
  body.su-body > #menu, body.su-body > #kvotmap { display: none; }
  .su-homelink { display: flex; }
  .su:not([data-view="home"]) .su-homelink { display: none; }
  .su-themebtn { display: inline-flex; }
  .su-bar-end > .kvot-fullwin { display: none; }
}
/* On a phone in the game the page's buttons wait in the game menu. */
@media (max-width: 560px) {
  .su[data-view="game"] .su-pageonly, .su[data-view="game"] .su-themebtn { display: none; }
  .su[data-view="game"] .su-title { font-size: 15px; }
}

/* ── Views ───────────────────────────────────────────────────────────── */

.su-views { position: relative; flex: 1 1 auto; min-height: 0; }
.su-view {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.su-page { max-width: 1040px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
.su-page-narrow { max-width: 760px; }
.su-lead { margin: 4px 0 16px; color: var(--text-secondary); font-size: 15px; line-height: 1.5; }
.su-small { margin: 14px 0 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }
.su-h2 { margin: 22px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-family: var(--font-mono); }
.su-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.su-row-end { justify-content: flex-end; }

/* ── Home ────────────────────────────────────────────────────────────── */

.su-home-inner { max-width: 920px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left)); }
.su-continue {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid var(--su-card-line);
  border-radius: 16px;
  background: var(--su-card);
  box-shadow: var(--su-shadow);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.su-continue-mini { width: 112px; height: 112px; }
.su-continue-mini svg { width: 100%; height: 100%; display: block; }
.su-continue-text b { display: block; font-size: 18px; margin-bottom: 4px; }
.su-continue-text span { display: block; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.su-continue-text .su-continue-go { display: inline-flex; margin-top: 10px; color: #fff; font-size: 15px; }
.su-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.su-level {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 9px 14px 9px 12px;
  border: 1px solid var(--su-card-line);
  border-radius: 14px;
  background: var(--su-card);
  text-align: left;
  cursor: pointer;
}
.su-level-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lv); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lv) 18%, transparent); }
.su-level b { display: block; font-size: 16px; }
.su-level small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12.5px; line-height: 1.35; }
.su-level-count { color: var(--text-muted); font-size: 12px; font-family: var(--font-mono); text-align: right; }
.su-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 22px; }
.su-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid var(--su-card-line);
  border-radius: 14px;
  background: var(--su-card);
  text-align: left;
  cursor: pointer;
}
.su-tile-icon, .su-choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--color-kvot-accent) 12%, transparent);
  color: var(--accent-text);
}
.su-tile-icon svg, .su-choice-icon svg { width: 21px; height: 21px; }
.su-tile-text b { display: block; font-size: 15.5px; }
.su-tile-text small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 13px; }
@media (hover: hover) {
  .su-level:hover, .su-tile:hover, .su-continue:hover, .su-choice:hover, .su-lessoncard:hover { border-color: var(--accent-line); }
}

/* ── The game ────────────────────────────────────────────────────────── */

.su-game { overflow: hidden; container-type: size; }
.su-play {
  height: 100%;
  display: grid;
  justify-content: center;
  align-content: center;
  gap: 18px;
  padding: 16px;
  box-sizing: border-box;
}
.su-boardwrap { position: relative; }
.su-boardhost { width: 100%; height: 100%; }
.su-panel { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.su-panel-head { display: none; align-items: center; gap: 6px; }
.su-panel-head .su-timer { margin-left: auto; }
/* A phone on its side: the board takes the height, the bar's buttons go to the panel. */
@media (max-height: 460px) and (orientation: landscape) {
  .su[data-view="game"] .su-bar { display: none; }
  .su[data-view="game"] .su-panel-head { display: flex; }
}
.su-progress { height: 4px; border-radius: 2px; background: var(--su-card-line); overflow: hidden; }
.su-progress span { display: block; height: 100%; width: 0; background: var(--chip, var(--accent-line)); transition: width 0.3s; }

/* The board: nine boxes in a frame of thick lines, nine cells in each box
   with thin lines between them. */
.su-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 2px;
  box-sizing: border-box;
  border-radius: 6px;
  background: var(--su-thick);
  container-type: size;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: var(--su-shadow);
}
.su-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  background: var(--su-thin);
  min-width: 0;
  min-height: 0;
}
.su-box:nth-child(1) { border-top-left-radius: 4px; overflow: hidden; }
.su-box:nth-child(3) { border-top-right-radius: 4px; overflow: hidden; }
.su-box:nth-child(7) { border-bottom-left-radius: 4px; overflow: hidden; }
.su-box:nth-child(9) { border-bottom-right-radius: 4px; overflow: hidden; }
.su-cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  background: var(--su-cell);
  cursor: pointer;
  transition: background-color 0.12s;
}
.su-cell > .su-v, .su-cell > .su-n { grid-area: 1 / 1; }
.su-v {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7.2cqmin;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.su-cell.is-given .su-v { color: var(--su-given); font-weight: 600; }
.su-cell.is-user .su-v { color: var(--su-user); font-weight: 400; }
.su-n {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 0.25cqmin;
  pointer-events: none;
}
.su-m {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.12cqmin;
  border-radius: 50%;
  color: var(--su-note);
  font-size: 2.75cqmin;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.su-cell.k1 { background: var(--su-k1); }
.su-cell.k2 { background: var(--su-k2); }
.su-cell.k3 { background: var(--su-k3); }
.su-cell.k4 { background: var(--su-k4); }
.su-cell.k5 { background: var(--su-k5); }
.su-cell.k6 { background: var(--su-k6); }
.su-cell.is-peer { background: var(--su-peer); }
.su-cell.is-same { background: var(--su-same); }
.su-cell.is-sel { background: var(--su-sel); }
.su-cell.is-dim { opacity: 0.55; }
.su-cell.is-conflict .su-v { color: var(--su-bad); }
.su-cell.is-conflict { background: var(--su-bad-bg); }
.su-cell.is-wrong .su-v { color: var(--su-bad); text-decoration: underline 0.4cqmin; text-underline-offset: 0.8cqmin; }
.su-cell.is-sel.is-conflict { background: color-mix(in srgb, var(--su-sel) 60%, var(--su-bad-bg)); }
.su-m.n-focus { background: var(--su-focus); color: #161b22; font-weight: 600; }

/* Hints */
.su-cell.h-unit { background: var(--su-unit); }
.su-cell.h-unit2 { background: var(--su-unit2); }
.su-cell.h-unit.h-unit2 { background: color-mix(in srgb, var(--su-unit) 50%, var(--su-unit2)); }
.su-cell.h-block { background: var(--su-block); }
.su-cell.h-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0.45cqmin solid var(--su-ring);
  border-radius: 1px;
  pointer-events: none;
}
.su-cell.h-place .su-v { color: var(--su-key); font-weight: 600; }
.su-m.n-key { background: var(--su-key); color: #fff; font-weight: 600; }
.su-m.n-alt, .su-m.n-on { background: var(--su-on); color: #fff; font-weight: 600; }
.su-m.n-off { background: var(--su-off); color: #fff; font-weight: 600; }
.su-m.n-on2 { background: var(--su-on2); color: #fff; font-weight: 600; }
.su-m.n-fin, .su-m.n-off2 { background: var(--su-fin); color: #fff; font-weight: 600; }
.su-m.n-soft { background: var(--su-soft); color: var(--su-given); font-weight: 600; }
.su-m.n-elim { background: transparent; color: var(--su-elim); font-weight: 700; text-decoration: line-through 0.35cqmin; box-shadow: inset 0 0 0 0.3cqmin var(--su-elim); }
.su-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.su-arc { fill: none; stroke: var(--su-link); stroke-width: 2; }
.su-arc.is-weak { stroke-dasharray: 5 4; stroke-width: 1.6; }
.su-arc-tip { fill: var(--su-link); }

/* A digit just placed, a unit just filled */
.su-v.is-pop { animation: su-pop 0.22s ease-out; }
@keyframes su-pop { from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.su-cell.is-flash { animation: su-flash 0.7s ease-out; }
@keyframes su-flash { 0% { background: var(--su-cell); } 30% { background: color-mix(in srgb, var(--su-key) 30%, var(--su-cell)); } 100% { background: var(--su-cell); } }
@media (prefers-reduced-motion: reduce) {
  .su-v.is-pop, .su-cell.is-flash { animation: none; }
  .su-cell { transition: none; }
}

/* Coordinates round the board (a setting) */
.su-coords { display: none; }
.su.show-coords .su-coords { display: block; position: absolute; inset: 0; pointer-events: none; }
.su-coord-r, .su-coord-c { position: absolute; color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); line-height: 1; }
.su-coord-r { left: -14px; top: calc((var(--k) - 0.5) * 100% / 9 - 5px); }
.su-coord-c { top: -14px; left: calc((var(--k) - 0.5) * 100% / 9 - 3px); }
.su.show-coords .su-play { padding-left: 24px; padding-top: 24px; }

.su-paused {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--su-page) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Tools and keys */
.su-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.su-tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 4px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
}
.su-tool svg { width: 22px; height: 22px; }
.su-tool[aria-pressed="true"] { background: color-mix(in srgb, var(--color-kvot-accent) 14%, transparent); color: var(--accent-text); }
.su-tool-state {
  position: absolute;
  top: 5px;
  right: calc(50% - 22px);
  min-width: 22px;
  padding: 1px 4px;
  border-radius: 8px;
  background: var(--su-card-line);
  color: var(--text-muted);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.su-tool[aria-pressed="true"] .su-tool-state { background: var(--accent-fill); color: #fff; }
.su-tool-hint { color: var(--accent-text); }
.su-tool:disabled { opacity: 0.4; cursor: default; }
@media (hover: hover) { .su-tool:hover:not(:disabled) { background: var(--su-key-bg-hover); } }

.su-pad { display: grid; gap: 6px; }
.su-pad-row { grid-template-columns: repeat(9, 1fr); margin-top: 12px; }
.su-pad-row .su-key { height: 50px; font-size: 22px; }
.su-key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--su-card-line);
  border-radius: 12px;
  background: var(--su-key-bg);
  color: var(--su-user);
  font-size: 26px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
}
.su-key small {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 500;
  font-family: var(--font-mono);
}
.su-key small:empty { display: none; }
.su-key.is-done { color: var(--text-muted); opacity: 0.45; }
.su-key.is-lock { background: var(--su-same); border-color: var(--su-sel-ring); }
.su-key.is-notes { color: var(--su-note); font-size: 0.8em; }
.su.notes-mode .su-pad .su-key { color: var(--su-note); }
@media (hover: hover) { .su-key:hover { background: var(--su-key-bg-hover); } }
.su-key:active { transform: scale(0.96); }
.su.hide-counts .su-key small { display: none; }

.su-colours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.su-swatch { height: 46px; border: 1px solid var(--su-card-line); border-radius: 12px; cursor: pointer; }
.su-swatch[data-k="0"] { background: var(--su-cell); background-image: linear-gradient(135deg, transparent 46%, var(--su-bad) 47%, var(--su-bad) 53%, transparent 54%); }
.su-swatch[data-k="1"] { background: var(--su-k1); }
.su-swatch[data-k="2"] { background: var(--su-k2); }
.su-swatch[data-k="3"] { background: var(--su-k3); }
.su-swatch[data-k="4"] { background: var(--su-k4); }
.su-swatch[data-k="5"] { background: var(--su-k5); }
.su-swatch[data-k="6"] { background: var(--su-k6); }

.su-panel-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; }

/* The game's layout, after the keys' own rules so that it wins. */
/* Wide: the board beside the panel. */
@container (min-aspect-ratio: 23/20) {
  .su-play {
    --bs: min(calc(100cqh - 32px), calc(100cqw - 400px), 780px);
    grid-template-columns: var(--bs) clamp(250px, calc(100cqw - var(--bs) - 64px), 360px);
  }
  .su-boardwrap { width: var(--bs); height: var(--bs); }
  .su-panel { height: var(--bs); justify-content: center; }
  .su-pad { grid-template-columns: repeat(3, 1fr); }
  .su-key { aspect-ratio: 1.25; font-size: clamp(24px, 4.4cqh, 38px); }
}
/* Tall: the board above the panel. */
@container (max-aspect-ratio: 23/20) {
  .su-play {
    --bs: min(calc(100cqw - 16px), calc(100cqh - 178px), 720px);
    grid-template-columns: var(--bs);
    grid-template-rows: var(--bs) auto;
    align-content: start;
    gap: 10px;
    padding: 8px 8px 0;
  }
  .su-boardwrap { width: var(--bs); height: var(--bs); }
  .su-panel { gap: 8px; }
  .su-pad { grid-template-columns: repeat(9, 1fr); }
  .su-key { height: 58px; font-size: 27px; }
  .su-progress { display: none; }
}
/* Tall with room to spare (a tablet upright): roomier keys. */
@container (max-aspect-ratio: 23/20) and (min-height: 900px) {
  .su-play { --bs: min(calc(100cqw - 48px), calc(100cqh - 280px), 760px); padding-top: 24px; gap: 18px; }
  .su-key { height: 78px; font-size: 34px; }
  .su-tool { min-height: 60px; }
}
/* Very short and wide (a phone on its side): a smaller pad. */
@container (min-aspect-ratio: 23/20) and (max-height: 430px) {
  .su-play { --bs: min(calc(100cqh - 16px), calc(100cqw - 300px), 780px); padding: 8px; gap: 12px; }
  .su-panel { gap: 6px; }
  .su-key { aspect-ratio: auto; height: calc((var(--bs) - 140px) / 3); font-size: 23px; }
  .su-tool { min-height: 44px; font-size: 0; }
  .su-tool span:not(.su-tool-state) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .su-panel-foot { display: none; }
  .su-progress { display: none; }
}


/* The hint: in the panel beside the board, or a card over the keys. */
.su-hint {
  padding: 12px 14px 12px;
  border: 1px solid var(--su-card-line);
  border-left: 4px solid var(--accent-line);
  border-radius: 12px;
  background: var(--su-card);
  box-shadow: var(--su-shadow);
}
.su-hint-head { display: flex; align-items: center; gap: 8px; }
.su-hint-steps { display: inline-flex; gap: 3px; flex: none; }
.su-hint-steps i { width: 7px; height: 7px; border-radius: 50%; background: var(--su-card-line); }
.su-hint-steps i.on { background: var(--accent-line); }
.su-hint-title { flex: 1; min-width: 0; margin: 0; font-size: 15.5px; font-weight: 600; }
.su-hint-close { width: 32px; height: 32px; }
.su-hint-text { margin: 6px 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--text-secondary); user-select: text; -webkit-user-select: text; }
.su-hint-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.su-hint-actions .su-btn { min-height: 36px; padding: 0 12px; font-size: 14px; }
/* With the keys below the board the hint is a card over them, just under
   the board; on a phone on its side, a card over the keys beside it. */
@container (max-aspect-ratio: 23/20) {
  .su-hint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    max-height: calc(100cqh - var(--bs) - 16px);
    overflow-y: auto;
  }
}
@container (min-aspect-ratio: 23/20) and (max-height: 430px) {
  .su-hint {
    position: absolute;
    top: 46px;
    left: 0;
    right: 0;
    z-index: 5;
    max-height: calc(100cqh - 56px);
    overflow-y: auto;
  }
}

/* The game menu */
.su-menu {
  position: fixed;
  z-index: 60;
  min-width: 240px;
  max-height: calc(100dvh - 70px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--su-card-line);
  border-radius: 14px;
  background: var(--su-card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  font-family: var(--font-sans);
  color: var(--text-primary);
}
.su-menu hr { margin: 4px 6px; border: 0; border-top: 1px solid var(--su-card-line); }
.su-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.su-menu-item svg { width: 17px; height: 17px; color: var(--text-muted); flex: none; }
.su-menu-item:disabled { opacity: 0.4; cursor: default; }
@media (hover: hover) { .su-menu-item:hover:not(:disabled) { background: var(--su-key-bg-hover); } }

/* The analysis panel */
.su-analysis {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  border-left: 1px solid var(--su-card-line);
  background: var(--su-card);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.12);
}
/* With the keys below the board, the list takes their place and leaves the
   board in view, so a step tapped in it shows. */
@container (max-aspect-ratio: 23/20) {
  .su-analysis {
    top: calc(min(100cqw - 16px, 100cqh - 178px, 720px) + 14px);
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--su-card-line);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.14);
  }
}
.su-analysis-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 16px; }
.su-analysis-head h2 { margin: 0; font-size: 16px; }
.su-analysis .su-seg { margin: 4px 16px 8px; }
.su-analysis-summary { padding: 0 16px 8px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }
.su-steps { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0 8px 16px; list-style: none; counter-reset: step; }
.su-step {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 4px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.su-step-n { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; padding-top: 2px; }
.su-step b { font-size: 14px; font-weight: 600; }
.su-step small { display: block; color: var(--text-muted); font-size: 12.5px; font-family: var(--font-mono); }
.su-step[aria-current="true"] { background: var(--su-same); }
.su-step .su-lvdot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--lv); vertical-align: 1px; }
@media (hover: hover) { .su-step:hover { background: var(--su-key-bg-hover); } }

/* Segmented tabs */
.su-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--su-card-line) 60%, transparent); }
.su-seg-btn {
  flex: 1 1 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.su-seg-btn[aria-selected="true"] { background: var(--su-card); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.su-seg-btn .su-lvdot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--lv); }

/* ── Library ─────────────────────────────────────────────────────────── */

.su-seg-levels { margin-bottom: 14px; }
.su-lib-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.su-lib-count { color: var(--text-secondary); font-size: 14px; }
.su-lib-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.su-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.su-libcell {
  position: relative;
  height: 52px;
  padding: 0;
  border: 1px solid var(--su-card-line);
  border-radius: 10px;
  background: var(--su-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  cursor: pointer;
}
.su-libcell::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--lv) var(--rank), var(--su-card-line) var(--rank));
  opacity: 0.8;
}
.su-libcell.is-solved { background: color-mix(in srgb, var(--lv) 13%, var(--su-card)); border-color: color-mix(in srgb, var(--lv) 45%, var(--su-card-line)); }
.su-libcell.is-solved::before { content: "✓"; position: absolute; top: 3px; right: 6px; font-size: 11px; color: var(--lv); font-family: var(--font-sans); font-weight: 700; }
.su-libcell.is-started::before { content: ""; position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--lv); }
@media (hover: hover) { .su-libcell:hover { border-color: var(--accent-line); } }
.su-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; color: var(--text-secondary); font-size: 14px; }
.su-pager input { width: 70px; height: 36px; padding: 0 8px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--input-bg); color: var(--input-text); font: 16px var(--font-mono); text-align: center; box-sizing: border-box; }
.su-pager-jump { display: inline-flex; align-items: center; gap: 6px; }

/* ── Daily ───────────────────────────────────────────────────────────── */

.su-daily-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.su-daily-card { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--su-card-line); border-radius: 16px; background: var(--su-card); text-align: left; cursor: pointer; }
@media (max-width: 560px) {
  .su-daily-cards { gap: 6px; }
  .su-daily-card { gap: 6px; padding: 8px; border-radius: 12px; }
  .su-daily-card .su-chip { height: 22px; padding: 0 7px 0 6px; font-size: 12px; }
  .su-daily-card small { font-size: 11.5px; }
}
.su-daily-card svg { width: 100%; height: auto; display: block; }
.su-daily-card b { font-size: 16px; }
.su-daily-card small { color: var(--text-muted); font-size: 13px; }
.su-daily-card.is-done { border-color: color-mix(in srgb, var(--lv) 50%, var(--su-card-line)); }
.su-cal { max-width: 460px; margin: 22px auto 0; padding: 14px; border: 1px solid var(--su-card-line); border-radius: 16px; background: var(--su-card); }
.su-cal-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; margin-bottom: 10px; font-weight: 600; }
.su-cal-head small { color: var(--text-muted); font-weight: 400; }
.su-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 13px; }
.su-cal-grid .su-cal-dow { color: var(--text-muted); font-size: 11.5px; font-family: var(--font-mono); padding-bottom: 4px; }
.su-cal-day { position: relative; height: 42px; display: grid; place-items: center; border-radius: 9px; color: var(--text-secondary); }
.su-cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent-line); color: var(--text-primary); font-weight: 600; }
.su-cal-day .su-cal-marks { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.su-cal-day .su-cal-marks i { width: 5px; height: 5px; border-radius: 50%; background: var(--lv); }

/* ── Lessons ─────────────────────────────────────────────────────────── */

.su-lessons { display: grid; gap: 22px; }
.su-lesson-group h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; }
.su-lesson-group h2 .su-lvdot { width: 10px; height: 10px; border-radius: 50%; background: var(--lv); }
.su-lesson-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.su-lessoncard { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--su-card-line); border-radius: 13px; background: var(--su-card); text-align: left; cursor: pointer; }
.su-lessoncard b { font-size: 15px; }
.su-lessoncard small { color: var(--text-muted); font-size: 13px; line-height: 1.4; }
.su-lessoncard .su-stars { color: var(--su-l3); font-size: 12px; letter-spacing: 1px; }
.su-lesson-grid {
  display: grid;
  grid-template-columns: minmax(0, min(62vh, 560px)) minmax(280px, 440px);
  justify-content: center;
  gap: 24px;
  padding: 18px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
}
.su-lesson-board { position: relative; aspect-ratio: 1; }
.su-lesson-text h2 { margin: 0 0 4px; font-size: 21px; }
.su-lesson-text .su-chip { margin-bottom: 10px; }
.su-lesson-text p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; color: var(--text-secondary); user-select: text; -webkit-user-select: text; }
.su-lesson-text .su-lesson-now { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent-line) 10%, transparent); color: var(--text-primary); }
.su-lesson-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.su-practice { margin-top: 6px; }
.su-practice-task { margin: 0 0 6px; font-weight: 600; font-size: 15.5px; }
.su-practice-say { min-height: 1.5em; margin: 0 0 4px; font-size: 14.5px; line-height: 1.5; color: var(--text-secondary); }
.su-practice-say.is-good { color: var(--su-key); }
.su-practice-say.is-bad { color: var(--su-bad); }
.su-practice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 760px) {
  .su-lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 10px; }
  .su-lesson-board { width: min(100%, 520px); justify-self: center; }
}

/* ── Import ──────────────────────────────────────────────────────────── */

.su-import-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.su-choice {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--su-card-line);
  border-radius: 14px;
  background: var(--su-card);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.su-choice b { font-size: 15px; margin-top: 6px; }
.su-choice small { color: var(--text-muted); font-size: 13px; }
.su-camera-view { position: relative; width: 100%; max-height: 62vh; aspect-ratio: 3 / 4; margin: 0 auto; overflow: hidden; border-radius: 16px; background: #000; }
.su-camera-view video, .su-camera-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.su-camera-say { min-height: 1.5em; text-align: center; color: var(--text-secondary); }
.su-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.su-review-photo { margin: 0; }
.su-review-photo canvas { width: 100%; height: auto; display: block; border-radius: 8px; background: #000; }
.su-review-photo figcaption { margin-top: 6px; color: var(--text-muted); font-size: 12.5px; }
.su-review-board { aspect-ratio: 1; }
.su-review-say, .su-create-say { min-height: 1.5em; margin: 12px 0 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.5; }
.su-review-say.is-good, .su-create-say.is-good { color: var(--su-key); }
.su-review-say.is-bad, .su-create-say.is-bad { color: var(--su-bad); }
.su-board .su-cell.is-unsure { box-shadow: inset 0 0 0 0.5cqmin var(--su-off); }
.su-corners-view { position: relative; touch-action: none; }
.su-corners-view canvas { width: 100%; height: auto; display: block; border-radius: 8px; }
@media (max-width: 560px) { .su-review-grid { grid-template-columns: 1fr; } .su-review-photo canvas { max-height: 30vh; object-fit: contain; } }

/* ── Statistics ──────────────────────────────────────────────────────── */

.su-stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.su-stat { padding: 14px; border: 1px solid var(--su-card-line); border-radius: 14px; background: var(--su-card); }
.su-stat b { display: block; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.su-stat small { color: var(--text-muted); font-size: 13px; }
.su-stat-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.su-stat-table th, .su-stat-table td { padding: 9px 8px; border-bottom: 1px solid var(--su-card-line); text-align: right; }
.su-stat-table th:first-child, .su-stat-table td:first-child { text-align: left; }
.su-stat-table th { color: var(--text-muted); font-weight: 500; font-size: 12.5px; }
.su-stat-table .su-lvdot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--lv); }

/* ── Dialogs ─────────────────────────────────────────────────────────── */

.su-dialog {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--su-card-line);
  border-radius: 18px;
  background: var(--su-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.su-dialog::backdrop { background: var(--overlay-bg); }
.su-dialog-wide { width: min(760px, calc(100vw - 24px)); }
.su-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 20px; background: var(--su-card); }
.su-dialog-head h2 { margin: 0; font-size: 18px; }
.su-dialog-body { padding: 4px 20px 20px; }
.su-dialog > h2 { margin: 22px 20px 6px; font-size: 20px; }
.su-dialog > p { margin: 0 20px 12px; color: var(--text-secondary); line-height: 1.5; }
.su-dialog textarea { display: block; width: calc(100% - 40px); margin: 0 20px 10px; padding: 10px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--input-bg); color: var(--input-text); font: 16px/1.4 var(--font-mono); box-sizing: border-box; resize: vertical; }
.su-dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 8px 20px 20px; }
.su-set { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--su-card-line); }
.su-set:last-child { border-bottom: 0; }
.su-set-title { font-weight: 600; font-size: 14.5px; }
.su-set-help { color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.su-check { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 15px; cursor: pointer; }
.su-check input { flex: none; }
.su-set .su-seg { margin-top: 2px; }
.su-help-body h3 { margin: 18px 0 6px; font-size: 16px; }
.su-help-body p, .su-help-body li { font-size: 14.5px; line-height: 1.55; color: var(--text-secondary); }
.su-help-body ul { padding-left: 20px; margin: 4px 0 8px; }
.su-help-body kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--su-card-line); border-bottom-width: 2px; border-radius: 6px; background: var(--su-page); font: 12.5px var(--font-mono); text-align: center; }
.su-help-body a { color: var(--link-color); }

.su-solved-burst { height: 8px; background: linear-gradient(90deg, var(--su-l1), var(--su-l2), var(--su-l3), var(--su-l4), var(--su-l5), var(--su-l6), var(--su-l7)); border-radius: 18px 18px 0 0; }
.su-dialog#su-solved { text-align: center; }
.su-dialog#su-solved .su-dialog-foot { justify-content: center; }
.su-solved-what { color: var(--text-secondary); }
.su-solved-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 20px 8px; }
.su-solved-stats div { padding: 10px 6px; border-radius: 12px; background: var(--su-page); }
.su-solved-stats dt { color: var(--text-muted); font-size: 12px; }
.su-solved-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

.su-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 70;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #1b2129;
  color: #f2f4f7;
  font: 14.5px/1.4 var(--font-sans);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
}
.su-drop {
  position: fixed;
  inset: 12px;
  z-index: 80;
  display: grid;
  place-items: center;
  border: 3px dashed var(--accent-line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--su-page) 85%, transparent);
  font: 600 20px var(--font-sans);
  color: var(--text-primary);
  pointer-events: none;
}

/* ── Printing ────────────────────────────────────────────────────────── */

.su-printout { display: none; }
@media print {
  html, body.su-body { position: static; overflow: visible; background: #fff; color-scheme: light; }
  body.su-body > *:not(.su-printout) { display: none !important; }
  .su-printout { display: block; }
  .su-printout .su-printpage { break-after: page; display: grid; gap: 10mm; padding: 6mm; }
  .su-printout .su-printpage:last-child { break-after: auto; }
  .su-printout .su-printpage.n1 { grid-template-columns: 1fr; }
  .su-printout .su-printpage.n2 { grid-template-columns: 1fr; }
  .su-printout .su-printpage.n4, .su-printout .su-printpage.n6 { grid-template-columns: 1fr 1fr; }
  .su-printout figure { margin: 0; break-inside: avoid; text-align: center; }
  .su-printout figure svg { width: 100%; height: auto; max-height: 120mm; }
  .su-printout .su-printpage.n2 figure svg { max-height: 115mm; }
  .su-printout .su-printpage.n6 figure svg { max-height: 78mm; }
  .su-printout figcaption { font: 11pt "IBM Plex Sans", sans-serif; color: #333; margin-top: 2mm; }
}
