/* Unicode Presenter: the Entry Page on warm paper. Colour carries one meaning
   for the second fact (green drawn, amber drawn by a bundled font, red not drawn)
   and one for the block (a fixed family fill on the specimen and the chosen tile). */
* { box-sizing: border-box; margin: 0; padding: 0; }

@font-face { font-family: "Ancizar Serif"; font-weight: 700; font-display: swap;
  src: url("fonts/ancizar-serif-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Commissioner"; font-weight: 400; font-display: swap;
  src: url("fonts/commissioner-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Commissioner"; font-weight: 500; font-display: swap;
  src: url("fonts/commissioner-latin-500-normal.woff2") format("woff2"); }

:root {
  --paper: #f7f7e9;
  --ink: #141517;
  --muted: #4d565c;
  --line: #d3d6cd;
  --rule: #a9b0ae;
  --ok: #14804f;
  --amber: #e29a1a;
  --bad: #c93a36;
  --f-sym: #f87748;
  --f-his: #f2b134;
  --f-han: #c89ad9;
  --f-liv: #7fb8c9;
  --f-spc: #cfc8b9;
  --on-fill: #141517;
  --serif: "Ancizar Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Commissioner", -apple-system, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --glyph: -apple-system, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #16181a;
  --ink: #eef0e6;
  --muted: #a4aaa6;
  --line: #30363a;
  --rule: #566066;
  color-scheme: dark;
}

/* last-resort glyph coverage: used only on .fb cells, where the system already
   drew tofu. Jigmo first so Han gets real outlines before pixel Unifont. */
/* unicode-range keeps a character that only Unifont covers from pulling the 64 MB of Han fonts first:
   the three Jigmo files are asked only for ideographs, Unifont for the BMP, Unifont Upper for the rest */
@font-face { font-family: "Jigmo";         src: url("data/fonts/Jigmo.ttf");  unicode-range: U+2E80-2FDF, U+3005-3007, U+3021-3029, U+3038-303B, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+20000-3FFFF; }
@font-face { font-family: "Jigmo2";        src: url("data/fonts/Jigmo2.ttf"); unicode-range: U+2E80-2FDF, U+3005-3007, U+3021-3029, U+3038-303B, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+20000-3FFFF; }
@font-face { font-family: "Jigmo3";        src: url("data/fonts/Jigmo3.ttf"); unicode-range: U+2E80-2FDF, U+3005-3007, U+3021-3029, U+3038-303B, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+20000-3FFFF; }
@font-face { font-family: "Unifont";       src: url("data/fonts/unifont.otf"); unicode-range: U+0-FFFF; }
@font-face { font-family: "Unifont Upper"; src: url("data/fonts/unifont_upper.otf"); unicode-range: U+10000-10FFFF; }
.fb {
  font-family: "Jigmo", "Jigmo2", "Jigmo3", "Unifont", "Unifont Upper",
    -apple-system, sans-serif !important;
}

html, body { height: 100%; }
body {
  container: up / inline-size;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  caret-color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--f-sym); color: var(--on-fill); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* the comp is drawn at 1536 wide; --u is one comp pixel, capped so wide screens hold the composition */
.up {
  --u: 1px;
  --gut: max(16px, calc(74 * var(--u)));
  --t-body: max(14px, calc(17 * var(--u)));
  --t-small: max(12px, calc(15 * var(--u)));
  --t-lab: max(17px, calc(21 * var(--u)));
  --t-name: max(26px, calc(41 * var(--u)));
  --t-mark: max(26px, calc(42 * var(--u)));
  --tile-h: max(calc(138 * var(--u)), 124px);
  --gap: max(8px, calc(12 * var(--u)));
  --entry-h: max(calc(275 * var(--u)), 236px);
  --spec: max(120px, calc(208 * var(--u)));
  height: 100dvh;
  max-width: calc(1536 * var(--u));
  margin-inline: auto;
  padding-inline: var(--gut);
  display: flex;
  flex-direction: column;
}

@supports (width: 1cqi) {
  .up { --u: min(calc(100cqi / 1536), 1.3px); }
}

/* header */
.top {
  flex: none;
  display: flex;
  align-items: center;
  gap: calc(24 * var(--u));
  height: calc(74 * var(--u));
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}
.mark { margin-right: auto; font: 700 var(--t-mark)/1 var(--serif); letter-spacing: 0.01em; }
.mark button { all: unset; cursor: pointer; }
.mark button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.links { display: flex; gap: calc(31 * var(--u)); }
.link {
  border: 0; background: none; padding: calc(8 * var(--u)) calc(2 * var(--u));
  font: 400 max(13px, calc(15 * var(--u)))/1 var(--sans);
  text-underline-offset: 0.4em; text-decoration-thickness: 1px;
}
.link:hover { text-decoration-line: underline; }
.link[aria-current="true"] { text-decoration-line: underline; text-decoration-thickness: 2px; }

.switch {
  position: relative; display: inline-flex; align-items: stretch; height: calc(36 * var(--u)); min-height: 32px; padding: max(2px, calc(2 * var(--u)));
  border-radius: 999px;
}
.switch::before { content: ""; position: absolute; inset: 0; border: 1px solid var(--rule); border-radius: 999px; pointer-events: none; }
.switch button {
  border: 0; border-radius: 999px; background: transparent; padding: 0 calc(17 * var(--u));
  font: 400 max(13px, calc(15 * var(--u)))/1 var(--sans);
}
.switch button[aria-checked="true"] { background: var(--ok); color: #fff; }

.find { position: relative; display: block; }
.find input {
  width: calc(261 * var(--u)); min-width: 150px; height: calc(41 * var(--u)); min-height: 36px;
  padding: 0 calc(12 * var(--u)) 0 max(36px, calc(42 * var(--u)));
  border: 1px solid var(--rule); border-radius: 8px;
  background: transparent; color: var(--ink);
  font: 400 max(13px, calc(15 * var(--u)))/1 var(--sans);
  appearance: none;
}
.find input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.find input::placeholder { color: var(--muted); opacity: 1; }
.find input::-webkit-search-cancel-button {
  appearance: none; width: 14px; height: 14px; cursor: pointer;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 2l10 10M12 2L2 12' stroke='black' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}
.find-icon {
  position: absolute; left: max(11px, calc(14 * var(--u))); top: 50%; translate: 0 -50%;
  width: max(16px, calc(20 * var(--u))); fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round;
  pointer-events: none;
}

/* the entry */
.stage-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.entry {
  flex: none;
  display: grid;
  grid-template-columns: var(--spec) minmax(max(230px, calc(300 * var(--u))), calc(486 * var(--u))) auto;
  column-gap: max(18px, calc(35 * var(--u)));
  padding: calc(24 * var(--u)) 0 calc(19 * var(--u)) calc(130 * var(--u));
  min-height: var(--entry-h);
}
.entry[data-fam="sym"] { --fill: var(--f-sym); }
.entry[data-fam="his"] { --fill: var(--f-his); }
.entry[data-fam="han"] { --fill: var(--f-han); }
.entry[data-fam="liv"] { --fill: var(--f-liv); }
.entry[data-fam="spc"] { --fill: var(--f-spc); }
.spec { display: flex; flex-direction: column; align-items: center; gap: calc(4 * var(--u)); }
.specimen {
  width: var(--spec); aspect-ratio: 1; border: 0; border-radius: 3px;
  background: var(--fill, var(--f-sym)); color: var(--on-fill);
  display: grid; place-items: center; overflow: hidden;
  transition: background-color 0.35s var(--ease);
}
.sp-glyph { font: 400 calc(var(--spec) * 0.72)/1 var(--glyph); }
/* the one authored moment: the chosen glyph settles into its field */
.sp-glyph.land { animation: land 0.32s var(--ease); }
@keyframes land {
  from { opacity: 0.5; transform: translateY(calc(8 * var(--u))) scale(0.94); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.sp-code {
  font: 500 max(14px, calc(20 * var(--u)))/1 var(--sans); letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.who { min-width: 0; padding-right: max(16px, calc(107 * var(--u))); }
.name {
  font: 700 var(--t-name)/1.08 var(--serif); letter-spacing: -0.015em;
  overflow-wrap: anywhere; text-wrap: balance;
}
/* a short name takes one line as in the comp; every longer name shares one slot, so the labels
   and facts below sit at the same height whichever long name is chosen, and none is cut */
.name:not([data-len="s"]) { height: max(calc(71 * var(--u)), 74px); overflow: hidden; line-height: 1.06; }
.name[data-len="m"] { font-size: max(22px, calc(32 * var(--u))); }
.name[data-len="l"] { font-size: max(16px, calc(22 * var(--u))); }
.name[data-len="xl"] { font-size: max(13px, calc(16.5 * var(--u))); }
.entry[data-long] .who { padding-right: max(16px, calc(40 * var(--u))); }
.entry[data-view="emoji"] .who { padding-right: max(16px, calc(40 * var(--u))); }
.sp-code { max-width: var(--spec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts dd { overflow-wrap: anywhere; }
.lab { font: 700 var(--t-lab)/1.2 var(--serif); }
.who .lab { margin-top: calc(8 * var(--u)); padding-left: calc(3 * var(--u)); }
.facts {
  margin-top: calc(11 * var(--u)); padding-left: calc(3 * var(--u));
  display: grid; grid-template-columns: max(98px, calc(191 * var(--u))) 1fr; row-gap: calc(3 * var(--u));
  font: 400 var(--t-body)/1.35 var(--sans);
}
.facts dt { color: var(--muted); }
.facts dd { overflow-wrap: anywhere; }
.draws { position: relative; padding: calc(10 * var(--u)) 0 0 max(20px, calc(40 * var(--u))); margin-top: calc(37 * var(--u)); min-width: max(150px, calc(260 * var(--u))); }
.draws::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.pill {
  display: inline-flex; align-items: center; gap: calc(10 * var(--u));
  margin-top: calc(14 * var(--u)); padding: 0 calc(18 * var(--u)); height: max(28px, calc(36 * var(--u)));
  border-radius: 999px; background: var(--ok); color: #fff;
  font: 500 max(14px, calc(17 * var(--u)))/1 var(--sans);
}
.pill i { width: calc(11 * var(--u)); min-width: 8px; aspect-ratio: 1; border-radius: 50%; background: currentColor; }
.pill.warn { background: var(--amber); color: #22201c; }
.pill.bad { background: var(--bad); color: #fff; }
.pill.na { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
/* nothing found */
.entry.empty { --fill: var(--f-spc); }
.entry.empty .sp-code, .entry.empty .who .lab, .entry.empty .draws { display: none; }
.entry.empty .specimen { cursor: default; }
.entry.empty .sp-glyph { font-size: calc(96 * var(--u)); }
.facts .hint { grid-column: 1 / -1; max-width: 36ch; color: var(--muted); }
.note { margin-top: calc(14 * var(--u)); max-width: max(150px, calc(190 * var(--u))); font: 400 var(--t-body)/1.4 var(--sans); }
.note[data-wide] { max-width: max(170px, calc(250 * var(--u))); }

/* the block */
.block { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.blockbar { flex: none; height: calc(47 * var(--u)); min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.blk-name {
  all: unset; cursor: pointer; min-width: 0;
  display: inline-flex; align-items: center; gap: calc(12 * var(--u));
  font: 700 max(14px, calc(19 * var(--u)))/1 var(--serif); letter-spacing: 0.16em; position: relative; text-transform: uppercase;
}
.blk-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-name:not([data-static])::after {
  content: ""; flex: none; width: 10px; height: 6px; margin-left: 2px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='black' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}
.blk-name:hover span { text-decoration: underline; text-underline-offset: 0.35em; text-decoration-thickness: 1px; }
.blk-name:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.fam { flex: none; width: calc(12 * var(--u)); min-width: 9px; aspect-ratio: 1; border-radius: 50%; background: var(--fill, var(--f-sym)); border: 1px solid var(--ink); }
.ctl { display: flex; align-items: center; gap: calc(18 * var(--u)); font: 400 var(--t-small)/1 var(--sans); color: var(--muted); }
.ctl button, .ctl select { border: 0; background: none; color: inherit; padding: calc(6 * var(--u)) 0; font: inherit; text-underline-offset: 0.4em; }
.ctl button:hover, .ctl select:hover { color: var(--ink); }
.ctl button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.ctl select {
  appearance: none; cursor: pointer; text-transform: capitalize; padding-right: calc(18 * var(--u));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234d565c' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") right center / 9px no-repeat;
}
.blk-name[data-static] { cursor: default; }
.blk-name[data-static]:hover span { text-decoration: none; }

/* the jump list: where each block, year or version begins; its dots are the legend for the family fills */
.jump {
  position: absolute; z-index: 5; left: 0; top: max(36px, calc(47 * var(--u)));
  width: min(100%, calc(480 * var(--u))); min-width: min(100%, 300px); max-height: calc(100% - max(36px, calc(47 * var(--u))) - 8px); overflow-y: auto;
  background: var(--paper); border: 1px solid var(--ink); border-radius: 2px; padding: calc(6 * var(--u)) 0;
  scrollbar-width: thin; scrollbar-color: var(--ink) transparent;
}
.jump button {
  display: grid; grid-template-columns: max(10px, calc(12 * var(--u))) 1fr auto; align-items: center; gap: calc(14 * var(--u));
  width: 100%; padding: calc(9 * var(--u)) calc(16 * var(--u)); border: 0; background: none; text-align: left;
  font: 400 var(--t-small)/1.2 var(--sans);
}
.jump button:hover { background: var(--line); }
.jump button[aria-selected="true"] { font-weight: 500; }
.jump b { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.jump .fam { background: var(--fill); }
.f-none { --fill: transparent; }
.jump .key {
  position: sticky; top: calc(-6 * var(--u)); z-index: 1; display: flex; flex-wrap: wrap; gap: calc(6 * var(--u)) calc(16 * var(--u));
  margin-top: calc(-6 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)) calc(10 * var(--u)); background: var(--paper); border-bottom: 1px solid var(--line);
  font: 400 max(12px, calc(13 * var(--u)))/1.2 var(--sans); color: var(--muted);
}
.jump .key span { display: inline-flex; align-items: center; gap: calc(7 * var(--u)); }

/* the grid of tiles, virtualized by renderer.js */
.grid { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
#spacer { width: 1px; }
#rows { position: absolute; top: 0; left: 0; right: 0; }
.trow { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: var(--gap); height: var(--tile-h); margin-bottom: var(--gap); }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: calc(3 * var(--u)); min-width: 0; padding: calc(8 * var(--u)) calc(8 * var(--u)) 0;
  border: 1px solid var(--line); border-radius: 2px; background: transparent;
  color: var(--ink); text-align: center; overflow: hidden;
}
.tile { transition: background-color 0.12s var(--ease), border-color 0.12s var(--ease); }
.tile:hover { border-color: var(--ink); }
.tile .g { flex: none; width: 100%; overflow: hidden; height: max(62px, calc(72 * var(--u))); display: grid; place-items: center; font: 400 max(50px, calc(70 * var(--u)))/1 var(--glyph); }
.tile .c { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 400 max(12px, calc(14.5 * var(--u)))/1.2 var(--sans); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.tile .n {
  max-width: 100%; font: 400 max(11px, calc(13.5 * var(--u)))/1.25 var(--sans); letter-spacing: 0.05em; color: var(--muted);
  overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.tile[aria-selected="true"] { background: var(--fill); color: var(--on-fill); outline: 2px solid var(--ink); outline-offset: -2px; border-color: var(--ink); }
.tile[aria-selected="true"] .n { color: var(--on-fill); }
.f-sym { --fill: var(--f-sym); }
.f-his { --fill: var(--f-his); }
.f-han { --fill: var(--f-han); }
.f-liv { --fill: var(--f-liv); }
.f-spc { --fill: var(--f-spc); }

.count {
  flex: none; height: calc(36 * var(--u)); min-height: 28px; display: flex; align-items: center;
  font: 400 max(12px, calc(16 * var(--u)))/1 var(--sans); color: var(--muted);
}

/* installation config */
#install-view { overflow-y: auto; }
#install-config { max-width: 620px; margin: 48px 0 48px calc(130 * var(--u)); }
#install-config h2 { font: 700 28px/1.1 var(--serif); margin-bottom: 12px; }
.install-blurb { font: 400 var(--t-body)/1.5 var(--sans); color: var(--muted); margin-bottom: 26px; }
.cfg-label { display: block; font: 500 12px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 20px 0 8px; }
.cfg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cfg-btn { padding: 8px 16px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; font: 400 var(--t-body)/1 var(--sans); }
.cfg-btn.sel { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cfg-help { font: 400 var(--t-small)/1.4 var(--sans); color: var(--muted); margin-top: 10px; }
#cfg-speed { width: 260px; accent-color: var(--ink); }
#speed-readout { text-transform: none; letter-spacing: 0; }
#install-start { margin-top: 28px; padding: 13px 44px; border: 0; border-radius: 8px; background: var(--ink); color: var(--paper); font: 500 16px/1 var(--sans); letter-spacing: 0.2em; }

/* the stage */
#stage { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; overflow: hidden; cursor: none; }
#stage-inner { position: absolute; inset: 0; }
#stage-caption {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 12px; color: rgba(255,255,255,.35); letter-spacing: 1px;
}
.mode-crawl #track { position: absolute; top: 50%; transform-origin: left center; white-space: nowrap; will-change: transform; display: flex; align-items: center; height: 0; }
.mode-crawl .tick { font-size: 120px; line-height: 1; padding: 0 15px; display: inline-block; transform: translateY(-50%); }
.mode-crawl .chapter { font-family: var(--mono); font-size: 30px; letter-spacing: 4px; color: #fff; border: 2px solid #fff; padding: 18px 28px; margin: 0 60px; display: inline-block; transform: translateY(-50%); white-space: nowrap; }
.mode-museum { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
#mu-label { font-family: var(--mono); font-size: clamp(16px, 2.6vw, 34px); letter-spacing: 2px; color: #fff; text-align: center; padding: 0 40px; min-height: 1.4em; }
#mu-glyph { font-size: clamp(160px, 38vh, 420px); line-height: 1.15; text-align: center; }
#mu-glyph.pop { animation: mu-pop .45s ease-out; }
@keyframes mu-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.mode-apoc { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); height: 100%; }
.tower { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.12); }
.tower-glyph { font-size: clamp(80px, 16vh, 200px); line-height: 1.2; }
.tower-label { font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: rgba(255,255,255,.4); margin-top: 12px; }

/* toast */
#toast {
  position: fixed; bottom: calc(48 * var(--u, 1px)); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font: 500 14px/1 var(--sans); letter-spacing: 0.02em;
  padding: 10px 20px; border-radius: 999px; z-index: 10;
  animation: toast-in 0.22s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .sp-glyph.land, #toast { animation: none; }
  .specimen, .tile { transition: none; }
}


/* the window narrows: the comp's composition holds to 860, then the entry drops its indent,
   the header wraps below 760, and below 560 the entry becomes one compact block */
@container up (max-width: 1100px) {
  .entry { grid-template-columns: var(--spec) minmax(250px, 1fr) auto; }
  .who { padding-right: 24px; }
}
@container up (max-width: 860px) {
  .entry { padding-left: 0; }
  #install-config { margin-left: 0; }
}
@container up (max-width: 760px) {
  .up { --gut: 16px; }
  .top { flex-wrap: wrap; height: auto; padding-block: 10px; row-gap: 10px; column-gap: 20px; }
  .mark { flex: 1 1 auto; }
  .find { order: 4; flex: 1 1 200px; }
  .find input { width: 100%; }
  .switch { order: 3; }
}
@container up (max-width: 560px) {
  .up { --entry-h: 304px; --tile-h: 124px; --spec: 96px; --t-body: 14px; --t-small: 13px; --t-lab: 15px; --t-name: 24px; }
  .mark button { font-size: 26px; }
  .entry {
    grid-template-columns: var(--spec) minmax(0, 1fr); grid-template-areas: "spec who" "draws draws";
    column-gap: 16px; row-gap: 8px; padding: 12px 0;
  }
  .spec { grid-area: spec; }
  .who { grid-area: who; padding-right: 0; }
  .draws { grid-area: draws; margin: 0; padding: 12px 0 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; }
  .draws::before { inset: 0 0 auto 0; border-left: 0; border-top: 1px solid var(--line); }
  .draws .lab { font-size: 15px; }
  .pill { margin-top: 0; height: 28px; font-size: 14px; }
  .note { flex-basis: 100%; margin-top: 4px; max-width: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .sp-code { font-size: 13px; }
  .name, .name:not([data-len="s"]) { height: 62px; overflow: hidden; line-height: 1.06; }
  .name[data-len="m"] { font-size: 20px; }
  .name[data-len="l"] { font-size: 14px; }
  .name[data-len="xl"] { font-size: 12px; }
  .who .lab { margin-top: 6px; }
  .facts .nm { display: none; }
  .facts { margin-top: 4px; grid-template-columns: 92px 1fr; row-gap: 1px; }
  .entry[data-view="emoji"] .who { padding-right: 0; }
  .blockbar { height: 40px; min-height: 40px; }
  .blk-name { flex: 1 1 auto; font-size: 13px; letter-spacing: 0.1em; }
  .ctl { flex: none; gap: 12px; font-size: 13px; }
  .count { font-size: 12px; height: 28px; min-height: 28px; }
  #install-config { margin-top: 24px; margin-bottom: 24px; }
}
@media (pointer: coarse) {
  .link, .switch button, .ctl button, .ctl select, .jump button, .find input, .mark button { min-height: 44px; }
  .blk-name { min-height: 44px; }
  .switch { height: 44px; }
}
