/* =====================================================================
   Handset — design system
   Fontshare-inspired: warm paper, heavy ink, chunky display type,
   mono micro-labels, one loud accent.
   ===================================================================== */
:root {
  --paper: #F3F0E8;
  --paper-2: #EBE7DC;
  --card: #FBFAF6;
  --ink: #121212;
  --ink-2: #2A2926;
  --muted: #77736A;
  --line: rgba(18, 18, 18, 0.12);
  --line-2: rgba(18, 18, 18, 0.22);
  --accent: #FF5B2E;
  --lime: #D9F26B;
  --sky: #BFD7FF;

  --f-display: 'Clash Display', 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  --f-body: 'Satoshi', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --f-hand: 'Caveat', 'Bradley Hand', cursive;

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 18px 40px -24px rgba(30, 24, 10, .35), 0 2px 6px -2px rgba(30, 24, 10, .12);
  --topbar-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar-w: 356px;
}

* { box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* paper grain */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------ type */
.eyebrow {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px;
}
.display {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(48px, 7.4vw, 112px);
  line-height: .94; letter-spacing: -0.022em; margin: 0 0 24px;
}
.display em { font-style: normal; font-family: var(--f-hand); font-weight: 600; color: var(--accent); letter-spacing: 0; font-size: 1.12em; line-height: .6; padding-right: .12em; }
.display-sm { font-size: clamp(40px, 5.2vw, 76px); margin: 0; letter-spacing: -0.015em; }
.h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.012em; line-height: 1; margin: 0 0 10px; }
.h3 { font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -0.015em; margin: 0; }
.lede { font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-2); max-width: 34ch; margin: 0 0 32px; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 999px; border: 1.5px solid var(--ink);
  font-weight: 700; font-size: 15.5px; letter-spacing: -0.005em; cursor: pointer; text-decoration: none;
  transition: transform .25s var(--ease), background .2s, color .2s, box-shadow .25s var(--ease);
  user-select: none; white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-ink { background: var(--ink); color: var(--paper); box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.btn-ink:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(0,0,0,.55); background: #000; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-wide { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 4px 0; cursor: pointer; font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: var(--accent);
  transition: text-underline-offset .2s var(--ease);
}
.link-btn:hover { text-underline-offset: 8px; }
.link-btn.small { font-size: 13.5px; }

/* ------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 3vw, 36px);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; }
.brand-mark { width: 34px; height: 34px; transition: transform .5s var(--ease); }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.nav { display: flex; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background .2s;
}
.nav-link:hover { background: var(--paper-2); }
.nav-link.on { background: var(--ink); color: var(--paper); }
.count { font-family: var(--f-mono); font-size: 11px; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--accent); color: #fff; }

/* ------------------------------------------------------------ views */
.view { animation: viewIn .55s var(--ease) backwards; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ create */
.view-create { padding: clamp(28px, 6vw, 84px) clamp(16px, 4vw, 56px) 64px; max-width: 1440px; margin: 0 auto; }
.create-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.drop-hint { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin: 18px 0 0; }

.sheet-figure { margin: 0; min-width: 0; }
.sheet-figure figcaption { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-top: 22px; text-align: center; }
.sheet {
  position: relative; background: #FFFEFA; border-radius: 6px; padding: clamp(28px, 4vw, 48px) clamp(18px, 3vw, 40px) clamp(22px, 3vw, 36px);
  transform: rotate(-1.6deg); box-shadow: var(--shadow), 0 40px 80px -50px rgba(60,40,10,.45);
  background-image: repeating-linear-gradient(to bottom, transparent 0 47px, rgba(70,120,200,.18) 47px 48px);
  background-position: 0 30px;
  transition: transform .6s var(--ease);
}
.sheet:hover { transform: rotate(-0.4deg) translateY(-4px); }
.tape { position: absolute; top: -14px; width: 92px; height: 28px; background: rgba(217, 242, 107, .78); box-shadow: 0 2px 4px rgba(0,0,0,.06); }
.tape-l { left: 18px; transform: rotate(-6deg); }
.tape-r { right: 22px; transform: rotate(5deg); background: rgba(255, 91, 46, .5); }
.sheet-row { position: relative; padding: 8px 0 14px; }
.sheet-row + .sheet-row { margin-top: 18px; border-top: 1.5px dashed var(--line-2); padding-top: 22px; }
.row-tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.sheet-hand {
  margin: 4px 0 0; font-family: var(--f-hand); font-weight: 600; color: #1F2B4D;
  font-size: clamp(18px, 2.2vw, 36px); letter-spacing: .1em; line-height: 1.1; white-space: nowrap; overflow: hidden;
}

.tips { list-style: none; padding: 0; margin: clamp(48px, 7vw, 96px) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1.5px solid var(--ink); }
.tips li { padding: 22px 22px 6px 0; color: var(--ink-2); font-size: 15px; }
.tips li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.tips strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.tip-n { display: block; font-family: var(--f-mono); font-size: 12px; color: var(--accent); margin-bottom: 14px; }

/* ------------------------------------------------------------ confirm */
.view-confirm { padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 56px) 48px; max-width: 1440px; margin: 0 auto; }
.confirm-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: clamp(20px, 3vw, 48px); align-items: start; }
.confirm-stage { background: var(--ink); border-radius: var(--r-lg); padding: clamp(12px, 2vw, 24px); box-shadow: var(--shadow); position: sticky; top: calc(var(--topbar-h) + 20px); }
.scan-wrap { position: relative; border-radius: 14px; overflow: hidden; }
.scan-wrap canvas { width: 100%; height: auto; max-height: 72vh; object-fit: contain; }
.confirm-panel { padding-top: 6px; }
.crop-grid {
  display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; margin: 22px 0 26px;
  padding: 12px; background: var(--card); border-radius: var(--r-md); border: 1px solid var(--line);
}
.crop { position: relative; aspect-ratio: 3 / 4; background: #fff; border-radius: 6px; display: grid; place-items: center; overflow: hidden; animation: pop .4s var(--ease) both; }
.crop canvas { max-width: 80%; max-height: 70%; }
.crop b { position: absolute; left: 3px; top: 1px; font-family: var(--f-mono); font-weight: 500; font-size: 9px; color: var(--accent); }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.field { display: block; margin-bottom: 20px; }
.field-label { display: block; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field input {
  width: 100%; height: 60px; border-radius: var(--r-sm); border: 1.5px solid var(--ink); background: var(--card);
  padding: 0 18px; font-family: var(--f-display); font-weight: 500; font-size: 24px; letter-spacing: -0.01em; color: var(--ink);
}
.field input:focus { outline: none; box-shadow: 0 0 0 4px rgba(255, 91, 46, .25); }
.confirm-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.warn { color: #B4361A; }

/* ------------------------------------------------------------ processing */
.view-processing {
  min-height: calc(100vh - var(--topbar-h)); display: grid; grid-template-rows: 1fr auto; align-items: center;
  padding: clamp(16px, 4vw, 48px); gap: 24px;
}
.proc-paper {
  width: min(1100px, 100%); margin: 0 auto; aspect-ratio: 16 / 7; border-radius: 6px; background: #FFFEFA; position: relative;
  box-shadow: var(--shadow), 0 50px 90px -60px rgba(60,40,10,.5);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), rgba(70,120,200,.16) calc(25% - 1px) 25%);
  transform: rotate(-0.8deg);
}
.proc-paper::before { content: ''; position: absolute; left: 8%; top: 0; bottom: 0; width: 1.5px; background: rgba(255, 91, 46, .35); }
.pen-svg { width: 100%; height: 100%; overflow: visible; }
.pen-svg .ink { fill: none; stroke: #1F2B4D; stroke-linecap: round; stroke-linejoin: round; }
.pen-svg .ink-dot { fill: #1F2B4D; }
.pen-svg .fade { transition: opacity .5s; opacity: 0; }
.proc-status { width: min(720px, 100%); margin: 0 auto; text-align: center; }
.proc-line { font-family: var(--f-display); font-weight: 500; font-size: clamp(22px, 2.6vw, 34px); letter-spacing: -0.02em; margin: 0 0 16px; min-height: 1.3em; }
.proc-bar { height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; margin: 0 auto 18px; max-width: 420px; }
.proc-bar span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width .35s var(--ease); }
.proc-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.proc-steps li {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .04em; padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--line-2); color: var(--muted); transition: all .3s var(--ease);
}
.proc-steps li.active { border-color: var(--ink); color: var(--ink); background: var(--lime); }
.proc-steps li.done { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.proc-steps li.done::before { content: '✓ '; }

/* ------------------------------------------------------------ specimen */
.view-specimen { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); overflow-x: hidden; }
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 26px 24px 40px; border-right: 1px solid var(--line); background: var(--paper);
  scrollbar-width: none; -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.sheet-handle { display: none; }
.ctl { padding: 18px 0; border-bottom: 1px solid var(--line); }
.ctl:first-of-type { padding-top: 0; }
.ctl:last-child { border-bottom: 0; }
.ctl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.ctl-label { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.ctl-val { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.ctl-hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.4; min-height: 2.8em; }
.ctl-dl .ctl-hint { min-height: 0; }

.style-toggle { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.style-toggle button { position: relative; z-index: 1; height: 42px; border: 0; background: none; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 14.5px; transition: color .3s; }
.style-toggle button[aria-checked="true"] { color: var(--paper); }
.style-toggle button[data-style="replica"] { font-family: var(--f-hand); font-size: 22px; font-weight: 600; }
.style-toggle button[data-style="refined"] { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.01em; }
.style-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--ink); transition: transform .45s var(--ease); box-shadow: 0 6px 14px -8px rgba(0,0,0,.6); }
.style-toggle[data-on="refined"] .style-thumb { transform: translateX(100%); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(to right, var(--ink) var(--fill, 50%), var(--line-2) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); box-shadow: 0 3px 8px -2px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); }
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type="range"]:disabled { opacity: .35; cursor: default; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.chips button { height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 12.5px; font-weight: 600; transition: all .2s; }
.chips button:hover { border-color: var(--ink); }
.chips button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.switch-wrap { display: inline-flex; align-items: center; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch em { font-style: normal; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }

.swatches { display: flex; gap: 10px; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer; position: relative; transition: transform .25s var(--ease); }
.swatches button:hover { transform: translateY(-2px); }
.swatches button[aria-checked="true"]::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--ink); }
#theme-paper { background: linear-gradient(135deg, #FFFEFA 50%, #121212 50%); }
#theme-ink { background: linear-gradient(135deg, #121212 50%, #F3F0E8 50%); }
#theme-tomato { background: linear-gradient(135deg, #FF5B2E 50%, #121212 50%); }
#theme-lime { background: linear-gradient(135deg, #D9F26B 50%, #121212 50%); }
#theme-sky { background: linear-gradient(135deg, #BFD7FF 50%, #0F2A66 50%); }

.dl-list { list-style: none; margin: 0 0 14px; padding: 0; }
.dl-list li { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.dl-list .dl-sample { font-size: 24px; line-height: 1; }
.dl-list .dl-name { font-size: 13.5px; font-weight: 600; margin-left: 12px; flex: 1; }
.dl-list .dl-name small { display: block; font-family: var(--f-mono); font-weight: 400; font-size: 11px; color: var(--muted); }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); display: grid; place-items: center; cursor: pointer; transition: all .2s; }
.icon-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.specimen-main { padding: clamp(18px, 3vw, 40px) clamp(16px, 3vw, 44px) 80px; min-width: 0; }
.spec-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.spec-name { margin: 0; font-size: clamp(52px, 7vw, 116px); line-height: .95; letter-spacing: 0; font-weight: 400; word-break: break-word; }
.spec-meta { display: grid; grid-template-columns: auto auto; gap: 4px 18px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.spec-meta b { color: var(--ink); font-weight: 500; }

.tester { --t-bg: #FFFEFA; --t-fg: #121212; background: var(--t-bg); color: var(--t-fg); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; transition: background .4s var(--ease), color .4s var(--ease); }
.tester[data-theme="ink"] { --t-bg: #121212; --t-fg: #F3F0E8; }
.tester[data-theme="tomato"] { --t-bg: #FF5B2E; --t-fg: #121212; }
.tester[data-theme="lime"] { --t-bg: #D9F26B; --t-fg: #121212; }
.tester[data-theme="sky"] { --t-bg: #BFD7FF; --t-fg: #0F2A66; }
.tester-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 22px; border-bottom: 1px solid color-mix(in srgb, var(--t-fg) 14%, transparent); }
#tester-input {
  flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; color: inherit; font-family: var(--f-body); font-size: 18px; font-weight: 500;
}
#tester-input::placeholder { color: color-mix(in srgb, var(--t-fg) 45%, transparent); }
#tester-input:focus { outline: none; }
.tester-tag { font-family: var(--f-mono); font-size: 11.5px; padding: 6px 10px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--t-fg) 25%, transparent); white-space: nowrap; }
.tester-stage {
  position: relative; height: clamp(340px, calc(100vh - var(--topbar-h) - 330px), 1400px);
  padding: clamp(14px, 2.4vw, 36px); display: flex; align-items: center; overflow: hidden;
}
.tester-output {
  margin: 0; width: 100%; line-height: 1.02; white-space: pre-wrap; overflow-wrap: normal; word-break: keep-all;
  font-size: 120px; transition: opacity .2s; font-feature-settings: 'calt' 1, 'kern' 1; font-variant-ligatures: contextual;
}
.tester-output.swap { opacity: .35; }

.spec-section { margin-top: clamp(48px, 6vw, 80px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 14px; border-bottom: 1.5px solid var(--ink); margin-bottom: 8px; }

.waterfall-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .2s; border-radius: 8px; }
.waterfall-row:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.waterfall-row.on .wf-label b::after { content: ' ●'; color: var(--accent); }
.wf-label { font-family: var(--f-mono); font-size: 12px; color: var(--muted); padding-left: 8px; }
.wf-label b { display: block; color: var(--ink); font-family: var(--f-body); font-size: 15px; font-weight: 700; }
.wf-sample { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-feature-settings: 'calt' 1, 'kern' 1; font-variant-ligatures: contextual; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.compare-card { text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--r-lg); padding: 22px 24px; cursor: pointer; transition: all .3s var(--ease); display: flex; flex-direction: column; gap: 10px; }
.compare-card:hover { transform: translateY(-3px); border-color: var(--ink); }
.compare-card.on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.compare-aa { font-size: clamp(90px, 12vw, 180px); line-height: 1; }
.compare-label strong { display: block; font-size: 17px; }
.compare-label span { font-size: 13.5px; opacity: .7; }

.glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin-top: 14px; }
.glyph { position: relative; aspect-ratio: 1; display: grid; place-items: center; font-size: 46px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: default; transition: background .2s, color .2s; }
.glyph small { position: absolute; left: 6px; top: 4px; font-family: var(--f-mono); font-size: 9.5px; color: var(--muted); }
.glyph:hover { background: var(--ink); color: var(--paper); }
.glyph:hover small { color: var(--accent); }
.source-img { width: 100%; max-height: 520px; object-fit: contain; border-radius: var(--r-md); background: var(--ink); margin-top: 14px; }

/* ------------------------------------------------------------ library */
.view-library { padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 56px) 80px; max-width: 1440px; margin: 0 auto; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-bottom: 24px; border-bottom: 1.5px solid var(--ink); margin-bottom: 28px; flex-wrap: wrap; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.lib-card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px 18px; cursor: pointer;
  display: flex; flex-direction: column; min-height: 300px; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s; overflow: hidden;
  animation: viewIn .5s var(--ease) both;
}
.lib-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.lib-card:nth-child(4n+2) { background: var(--lime); }
.lib-card:nth-child(4n+3) { background: var(--ink); color: var(--paper); }
.lib-card:nth-child(4n+4) { background: var(--sky); }
.lib-card-top { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; opacity: .7; }
.lib-aa { flex: 1; display: grid; place-items: center; font-size: 132px; line-height: 1; padding: 8px 0; }
.lib-aa.loading { opacity: .25; }
.lib-name { font-size: 26px; line-height: 1.1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sub { font-family: var(--f-mono); font-size: 11px; opacity: .7; margin-top: 4px; }
.lib-del { position: absolute; right: 14px; bottom: 16px; opacity: 0; transition: opacity .2s; }
.lib-card:hover .lib-del, .lib-del:focus-visible { opacity: 1; }
.lib-empty { text-align: center; padding: 60px 0; color: var(--muted); }
.lib-empty-aa { font-family: var(--f-hand); font-size: 160px; line-height: 1; color: var(--ink); margin: 0; }

/* ------------------------------------------------------------ overlays */
.drop-veil { position: fixed; inset: 12px; z-index: 90; border-radius: 28px; border: 2px dashed var(--ink); background: color-mix(in srgb, var(--lime) 85%, transparent); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drop-veil p { font-family: var(--f-display); font-weight: 600; font-size: clamp(40px, 6vw, 88px); letter-spacing: -0.03em; }
body.dragging .drop-veil { opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 95; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14.5px; transition: all .35s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: #B4361A; }
.loading { position: fixed; right: 20px; top: calc(var(--topbar-h) + 14px); z-index: 60; display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 99px; font-family: var(--f-mono); font-size: 12px; }
.loading-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .create-grid { grid-template-columns: 1fr; }
  .sheet-figure { max-width: 760px; }
  .tips { grid-template-columns: 1fr 1fr; }
  .tips li:nth-child(3) { padding-left: 0; border-left: 0; }
  .confirm-grid { grid-template-columns: 1fr; }
  .confirm-stage { position: static; }
}

@media (max-width: 820px) {
  :root { --topbar-h: 60px; }
  .view-specimen { grid-template-columns: 1fr; }
  .specimen-main { padding-bottom: 210px; }
  .sidebar {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 50; height: auto; max-height: 78vh;
    border-right: 0; border-top: 1px solid var(--line); border-radius: 24px 24px 0 0;
    background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -20px 50px -30px rgba(0,0,0,.4);
    padding: 0 18px calc(18px + env(safe-area-inset-bottom));
    transition: max-height .45s var(--ease);
  }
  .sidebar .ctl-more { display: none; }
  .sidebar.open .ctl-more { display: block; }
  .sidebar .ctl-hint { min-height: 0; }
  .sidebar:not(.open) .ctl-style .ctl-hint { display: none; }
  .sheet-handle { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; border: 0; background: none; padding: 10px 0 8px; cursor: pointer; position: sticky; top: 0; z-index: 2; background: inherit; }
  .grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); }
  .sheet-handle-label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .ctl { padding: 12px 0; }
  .ctl-style { padding-top: 4px; }
  .tester-stage { height: clamp(300px, 58vh, 720px); }
  .waterfall-row { grid-template-columns: 1fr auto; }
  .wf-label { grid-column: 1 / -1; padding-left: 4px; }
  .wf-sample { grid-column: 1; }
  .compare { grid-template-columns: 1fr; }
  .crop-grid { grid-template-columns: repeat(9, 1fr); }
  .confirm-actions { grid-template-columns: 1fr; }
  .toast { bottom: auto; top: calc(var(--topbar-h) + 12px); transform: translate(-50%, -20px); }
  .toast.show { transform: translate(-50%, 0); }
  .tester-stage { height: clamp(280px, 48vh, 620px); }
}

@media (max-width: 560px) {
  .nav-link { padding: 0 10px; font-size: 13.5px; }
  .brand span { display: none; }
  .tips { grid-template-columns: 1fr; }
  .tips li, .tips li + li { padding-left: 0; border-left: 0; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
  .cta-row .btn { flex: 1 1 100%; }
  .spec-meta { display: none; }
  .proc-paper { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   v2 — community, review UI
   ===================================================================== */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
.topbar .nav { justify-self: center; }
.auth-box { justify-self: end; position: relative; display: flex; align-items: center; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: none; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 14px; }
.avatar-xs { width: 22px; height: 22px; font-size: 11px; }
.avatar-xl { width: 96px; height: 96px; font-size: 40px; box-shadow: var(--shadow); }
.avatar-fallback { background: var(--accent); color: #fff; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 3px var(--lime); }
.menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; z-index: 60; display: flex; flex-direction: column; }
.menu-name { margin: 6px 10px 8px; font-weight: 700; font-size: 14px; }
.menu a, .menu button { text-align: left; padding: 10px; border-radius: 10px; color: var(--ink); text-decoration: none; border: 0; background: none; cursor: pointer; font-size: 14px; font-weight: 500; }
.menu a:hover, .menu button:hover { background: var(--paper-2); }

.sheet-row + .sheet-row { margin-top: 10px; padding-top: 14px; }
.sheet-row { padding: 4px 0 8px; }
.sheet-hand { font-size: clamp(16px, 2vw, 32px); }

/* review */
.scan-wrap canvas { background: #fff; }
.scan-legend { display: flex; align-items: center; gap: 8px; margin: 12px 4px 0; font-family: var(--f-mono); font-size: 11px; color: rgba(255,255,255,.7); }
.lg-line { width: 22px; height: 3px; background: var(--accent); border-radius: 2px; }
.lg-box { width: 12px; height: 12px; border: 1.5px solid rgba(255,255,255,.75); border-radius: 2px; margin-left: 10px; }
.ai-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; margin: 0 0 14px; padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--paper-2); }
.ai-chip:empty { display: none; }
.ai-chip[data-state="done"] { background: var(--lime); }
.ai-chip[data-state="error"] { background: #FFE2D9; color: #8A2A12; }
.spark { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--accent), var(--lime), var(--sky), var(--accent)); animation: spin 1s linear infinite; }
.spark.done { animation: none; background: var(--ink); -webkit-mask: none; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
@keyframes spin { to { transform: rotate(360deg); } }
.row-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 6px; }
.row-tabs button { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 600; font-size: 13.5px; transition: all .2s; }
.row-tabs button span { font-family: var(--f-mono); font-size: 11px; opacity: .6; margin-left: 4px; }
.row-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.row-tabs button:disabled, .row-tabs button[aria-disabled="true"] { opacity: .4; cursor: not-allowed; background: var(--paper-2); color: var(--muted); border-style: dashed; }
.baseline-ctl { border-bottom: 0; padding-bottom: 4px; }
.crop-ctl { border-bottom: 0; padding-top: 6px; padding-bottom: 12px; }
.glyph-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; margin: 4px 0 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); max-height: 420px; overflow-y: auto; }
.cell { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border-radius: 8px; padding: 4px 4px 6px; border: 1px solid var(--line); animation: pop .35s var(--ease) both; }
.cell canvas { display: block; }
.cell input { width: 30px; height: 28px; text-align: center; border: 1px solid var(--line-2); border-radius: 6px; font-family: var(--f-mono); font-size: 14px; background: var(--paper); color: var(--ink); }
.cell input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,91,46,.25); }
.cell-off { opacity: .45; }
.cell-off input { border-style: dashed; }

.proc-steps li.skip { background: var(--paper-2); color: var(--muted); border-color: var(--line-2); }

/* specimen extras */
.spec-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.spec-actions:empty { display: none; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--ink); background: var(--card); cursor: pointer; font-weight: 700; font-size: 14px; transition: all .2s; }
.pill-btn:hover { background: var(--ink); color: var(--paper); }
.pill-btn svg, .heart-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.heart.on, .heart-btn.on { color: var(--accent); }
.heart.on svg, .heart-btn.on svg { fill: var(--accent); stroke: var(--accent); }
.heart.on:hover { color: var(--paper); }
.pill-switch { height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); }
.pill-switch em { font-size: 12px; color: var(--ink); }
.byline { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-weight: 700; font-size: 13px; }
.byline:hover { text-decoration: underline; }
.source-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.source-refined { background: #fff; }

/* galleries */
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.font-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s var(--ease); animation: viewIn .5s var(--ease) backwards; }
.font-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.font-card-art { aspect-ratio: 8 / 5; background: #FBFAF6; border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.font-card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.font-card:hover .font-card-art img { transform: scale(1.04); }
.font-card:nth-child(4n+2) .font-card-art { background: var(--lime); }
.font-card:nth-child(4n+2) .font-card-art img { mix-blend-mode: multiply; }
.font-card:nth-child(4n+3) .font-card-art { background: var(--sky); }
.font-card:nth-child(4n+3) .font-card-art img { mix-blend-mode: multiply; }
.font-card-art.noart::after { content: 'Aa'; font-family: var(--f-hand); font-size: 90px; }
.local-aa { font-size: 110px; line-height: 1; }
.font-card-body { position: relative; padding: 14px 16px 16px; display: grid; gap: 6px; }
.font-card-name { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; padding-right: 56px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-card-local .font-card-name { font-family: inherit; font-weight: 400; font-size: 24px; }
.font-card-owner { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600; width: fit-content; }
.font-card-owner:hover span { text-decoration: underline; }
.font-card-sub { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.heart-btn, .font-card-body .icon-btn { position: absolute; right: 12px; top: 14px; }
.heart-btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; font-family: var(--f-mono); font-size: 12px; transition: all .2s; }
.heart-btn:hover { border-color: var(--accent); color: var(--accent); }
.profile-head { display: flex; align-items: center; gap: 24px; padding: clamp(28px, 5vw, 64px) 0 28px; border-bottom: 1.5px solid var(--ink); margin-bottom: 28px; }
.profile-stats { margin: 8px 0 0; color: var(--muted); }
.profile-stats b { color: var(--ink); }
.view-explore, .view-profile { padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 56px) 80px; max-width: 1440px; margin: 0 auto; }
.view-profile { padding-top: 0; }
.lib-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.lib-tabs button { height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 600; }
.lib-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.signin-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--r-md); background: var(--lime); margin-bottom: 20px; }
.signin-banner p { margin: 0; }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--muted); }
.empty-aa { font-family: var(--f-hand); font-size: 140px; line-height: 1; color: var(--ink); margin: 0; }

@media (max-width: 820px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; }
  .topbar .nav { justify-self: center; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .glyph-strip { max-height: 320px; }
}
@media (max-width: 560px) {
  .nav-link { padding: 0 9px; font-size: 13px; }
  .font-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .font-card-name { font-size: 15px; padding-right: 0; }
  .heart-btn { position: static; width: fit-content; }
}


/* =====================================================================
   v3 — clean studio paper (matched to sample-sheet.jpg #F8FAF9)
   ===================================================================== */
:root {
  --paper: #F8FAF9;
  --paper-2: #EEF1F0;
  --card: #FFFFFF;
  --sheet: #FFFFFF;
  --ink: #141616;
  --ink-2: #2D3230;
  --muted: #666F6C;
  --line: rgba(20, 22, 22, 0.08);
  --line-2: rgba(20, 22, 22, 0.16);
  --accent: #E11D2E;
  --lift: 0 1px 2px rgba(15, 22, 20, .04), 0 8px 24px -10px rgba(15, 22, 20, .08);
  --lift-hi: 0 2px 4px rgba(15, 22, 20, .06), 0 18px 38px -14px rgba(15, 22, 20, .14);
  --shadow: var(--lift);
}
body {
  background-color: var(--paper);
  background-image: none;
}
.grain { display: none; }

/* top navigation tailored to studio colorway */
.topbar {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid rgba(20, 22, 22, 0.06);
  box-shadow: none;
}
.topbar .nav {
  background: var(--paper-2);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  gap: 2px;
}
.topbar .nav-link {
  height: 34px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.topbar .nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}
.topbar .nav-link.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 22, 20, .08);
}

/* clean white cards & sheets across all subsequent pages */
.paper-sheet, .tester, .compare-card, .font-card, .glyph-grid, .confirm-panel .scan-thumb, .signin-banner, .menu, .save-bar, .proc-paper {
  background-color: var(--sheet);
  background-image: none;
  box-shadow: var(--lift);
  border: 1px solid var(--line);
}
.tester { --t-bg: #FFFFFF; --t-fg: #141616; border-radius: 16px; }
.tester[data-theme="ink"] { background-color: #141616; --t-fg: #F8FAF9; }
.tester[data-theme="tomato"] { background-color: #E11D2E; --t-fg: #FFFFFF; }
.tester[data-theme="lime"] { background-color: #D9F26B; --t-fg: #141616; }
.tester[data-theme="sky"] { background-color: #BFD7FF; --t-fg: #0F2A66; }
#theme-paper { background: linear-gradient(135deg, #FFFFFF 50%, #141616 50%); }
#theme-ink { background: linear-gradient(135deg, #141616 50%, #F8FAF9 50%); }
#theme-tomato { background: linear-gradient(135deg, #E11D2E 50%, #FFFFFF 50%); }
.tester-bar { border-bottom: 1px solid color-mix(in srgb, var(--t-fg) 10%, transparent); }
.tester-stage { background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--rule, 64px) - 1px), rgba(20, 22, 22, .05) calc(var(--rule, 64px) - 1px) var(--rule, 64px)); }
.tester[data-theme]:not([data-theme="paper"]) .tester-stage { background-image: none; }
.sidebar { background: var(--paper); border-right: 1px solid var(--line); }
.compare-card { border-radius: 14px; }
.compare-card.on { background-color: var(--ink); color: var(--paper); border-color: var(--ink); }
.glyph-grid { border-radius: 14px; overflow: hidden; }
.glyph { border-color: var(--line); background: transparent; border-top: 0; border-left: 0; font: inherit; font-size: 46px; color: inherit; cursor: pointer; }
.glyph.sel { background: rgba(120,170,255,.35); color: var(--ink); }
.proc-paper { border-radius: 16px; transform: none; }
.proc-paper::before { background: rgba(225, 29, 46, .28); }
.pen-svg .ink { stroke: var(--ink); }
.pen-svg .ink-dot { fill: var(--ink); }

/* welcome hero sample photo seamlessly merged into #F8FAF9 background */
.view-create {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  align-items: center;
  padding-top: clamp(12px, 3vh, 40px);
  padding-bottom: clamp(24px, 5vh, 56px);
}
.create-grid {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.sheet-figure {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.sample-photo {
  width: 100%;
  max-width: 680px;
  height: auto;
  max-height: min(68vh, 560px);
  object-fit: contain;
  display: block;
  border-radius: 0;
  box-shadow: none;
}
.display { font-size: clamp(36px, min(5.8vw, 10vh), 92px); margin-bottom: clamp(12px, 2.2vh, 22px); }
.lede { font-size: clamp(15px, min(1.35vw, 2.5vh), 19px); margin-bottom: clamp(16px, 3vh, 28px); max-width: 38ch; }
.btn { height: clamp(44px, 6.8vh, 52px); }
.cta-row { margin-bottom: 14px; }

/* ------------------------------------------------ review screen */
.confirm-grid { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); }
.confirm-stage.paper-sheet { background-color: var(--sheet); padding: clamp(18px, 2.4vw, 32px); border-radius: 16px; position: relative; top: auto; min-height: 420px; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.strip-head .eyebrow { margin: 0; color: var(--ink); font-weight: 500; }
.strip-hint { margin: 0; font-size: 13px; color: var(--muted); }
.glyph-strip { display: flex; flex-wrap: wrap; gap: 22px 0; padding: 6px 0 0; margin: 0; background: none; border: 0; box-shadow: none; max-height: none; overflow: visible; border-radius: 0; }
.cell { position: relative; background: none; border: 0; border-radius: 8px; padding: 4px 3px 6px; gap: 6px; cursor: pointer; transition: background .15s, box-shadow .15s; }
.cell::before { content: ''; position: absolute; left: 0; right: 0; top: calc(var(--base-y) + 4px); height: 2px; margin-top: -1px; background: var(--accent); opacity: .85; pointer-events: none; }
.cell canvas { mix-blend-mode: multiply; border-radius: 6px; transition: background .15s; }
.cell input[type="text"] { width: 36px; height: 30px; font-size: 15px; background: var(--paper); color: var(--ink); border: 1px solid var(--line-2); transition: border-color .15s, background .15s, color .15s; }
.cell:hover canvas { filter: drop-shadow(0 0 0 rgba(0,0,0,0)); background: rgba(217,242,107,.25); }
.cell.cell-sel { background: rgba(20, 22, 22, 0.045); box-shadow: 0 0 0 1.5px var(--ink); }
.cell.cell-sel canvas { background: rgba(217, 242, 107, 0.28); }
.cell-off { opacity: 1; }
.cell-off canvas { opacity: .72; }
.cell.cell-off input[type="text"] {
  border: 1.5px solid #E11D2E;
  border-style: solid;
  background: rgba(225, 29, 46, 0.07);
  color: #E11D2E;
  font-weight: 700;
}
.cell.cell-off input[type="text"]::placeholder {
  color: #E11D2E;
  opacity: 1;
  font-weight: 700;
  font-size: 17px;
}
.cell input[type="text"]::placeholder {
  color: #E11D2E;
  opacity: 1;
  font-weight: 700;
}
.cell-crop-badge {
  font-family: var(--f-mono);
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 99px;
  background: var(--paper-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.cell.cell-sel .cell-crop-badge,
.cell-crop-badge.edited {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}
.scan-thumb { position: relative; border-radius: 12px; padding: 8px; margin: 16px 0 6px; cursor: pointer; }
.scan-thumb canvas { width: 100%; height: auto; max-height: 220px; object-fit: contain; display: block; mix-blend-mode: multiply; }
.rotate-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .2s var(--ease), background .2s, color .2s;
}
.rotate-btn:hover { background: var(--ink); color: var(--card); border-color: var(--ink); }
.rotate-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.confirm-panel .h2 { font-size: clamp(24px, 2.4vw, 34px); }

/* ------------------------------------------------ specimen extras */
.spec-hero { align-items: flex-start; }
.spec-side { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; padding-top: 4px; }
.spec-actions { margin-top: 0; justify-content: flex-end; }
.pill-quiet { border-color: var(--line-2); background: var(--paper-2); font-size: 12.5px; height: 34px; text-decoration: none; color: var(--ink); }
.pill-quiet:hover { background: var(--ink); color: var(--card); }
.save-bar { position: sticky; top: calc(var(--topbar-h) + 12px); z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; margin-bottom: 14px; border-radius: 999px; font-weight: 600; font-size: 14px; animation: viewIn .35s var(--ease) both; }
.save-bar #save-note { flex: 1; }
.save-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(225,29,46,.18); }
.tester-output .ch { cursor: pointer; border-radius: 4px; transition: background .15s; }
.tester-output .ch:hover { background: rgba(120,170,255,.18); }
.tester-output .ch.sel { background: rgba(120,170,255,.42); box-shadow: 0 0 0 2px rgba(60,110,220,.35); }
.chips-cuts button { height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.chips-cuts small { font-family: var(--f-mono); font-size: 10px; opacity: .65; font-weight: 400; }
.ctl-sub { margin: 14px 0 4px; }
.ctl-label-sm { font-size: 10.5px; color: var(--muted); }
.ctl .switch span { flex: none; }
.pattern-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pattern-chips button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 10.5px; font-weight: 600; }
.pattern-chips button.on { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink) inset; }
.pattern-chips button:disabled { opacity: .35; cursor: default; }
.pat { width: 26px; height: 26px; border-radius: 6px; display: block; }
.pat-solid { background: var(--ink); }
.pat-stripes { background: repeating-linear-gradient(45deg, var(--ink) 0 3px, transparent 3px 7px); }
.pat-dots { background: radial-gradient(circle, var(--ink) 2.2px, transparent 2.6px) 0 0 / 7px 7px; }
.pat-grid { background: linear-gradient(var(--ink) 1.5px, transparent 1.5px) 0 0 / 7px 7px, linear-gradient(90deg, var(--ink) 1.5px, transparent 1.5px) 0 0 / 7px 7px; }
.pat-checks { background: conic-gradient(var(--ink) 25%, transparent 0 50%, var(--ink) 0 75%, transparent 0) 0 0 / 10px 10px; }
.letter-editor { background: rgba(120,170,255,.12); margin: 0 -12px 8px; padding: 14px 12px !important; border-radius: 12px; border-bottom: 0 !important; }
.letter-big-wrap { display: grid; place-items: center; height: 110px; margin: 4px 0 8px; background: var(--sheet); border-radius: 8px; box-shadow: var(--lift); position: relative; overflow: hidden; }
.letter-big-wrap::after { content: ''; position: absolute; left: 0; right: 0; top: 74%; height: 1.5px; background: var(--accent); opacity: .6; }
.letter-big { font-size: 84px; line-height: 1; position: relative; top: 4px; }
.mini-ctl { display: grid; grid-template-columns: 1fr auto; align-items: center; margin-top: 6px; }
.mini-ctl label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.mini-ctl output { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.mini-ctl input { grid-column: 1 / -1; }
.icon-xs { width: 26px; height: 26px; font-size: 16px; line-height: 1; }

/* gallery cards */
.font-card { border-radius: 16px; }
.font-card:hover { transform: translateY(-4px); box-shadow: var(--lift-hi); }
.font-card-art { background-color: #FFFFFF; border-bottom: 1px solid var(--line); }
.font-card-art img { mix-blend-mode: multiply; }
.font-card:nth-child(4n+2) .font-card-art { background: #F2F5F4; }
.font-card:nth-child(4n+3) .font-card-art { background: #EEF3FA; }

@media (max-width: 1080px) {
  .confirm-grid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
}
@media (max-width: 920px) {
  .view-create {
    min-height: calc(100vh - var(--topbar-h));
    min-height: calc(100dvh - var(--topbar-h));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding-top: 28px;
    padding-bottom: 32px;
  }
  .create-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .create-copy {
    display: contents;
  }
  .create-copy .display {
    order: 1;
    margin-bottom: 0;
    padding-top: 10px;
    font-size: clamp(42px, 11.4vw, 64px);
    line-height: 0.96;
  }
  .sheet-figure {
    order: 2;
  }
  .sample-photo {
    max-height: min(38vh, 340px);
  }
  .create-copy .lede {
    order: 3;
    margin-bottom: 4px;
    max-width: 46ch;
    font-size: clamp(16px, 4.2vw, 18.5px);
  }
  .create-copy .cta-row {
    order: 4;
    margin-bottom: 2px;
  }
  .create-copy #btn-sample {
    order: 5;
    justify-self: start;
  }
}
@media (max-width: 860px) {
  .confirm-grid { grid-template-columns: 1fr; }
  .confirm-panel { order: -1; }
  .scan-thumb canvas { max-height: 160px; }
}
@media (max-width: 820px) {
  .view-specimen {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-h));
    height: calc(100dvh - var(--topbar-h));
    min-height: 0;
    overflow: hidden;
  }
  .specimen-main {
    display: contents;
  }
  .spec-hero,
  .spec-section {
    display: none;
  }
  .tester {
    order: 1;
    flex: 0 0 34%;
    min-height: 176px;
    max-height: 36dvh;
    margin: 8px 12px 0;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
  }
  .tester-bar {
    padding: 8px 12px;
    flex: none;
  }
  #tester-input {
    height: 32px;
    font-size: 15px;
  }
  .tester-tag {
    font-size: 10.5px;
    padding: 4px 8px;
  }
  .tester-stage {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    padding: 10px 14px;
  }
  .save-bar {
    order: 2;
    flex: none;
    position: static;
    margin: 6px 12px 0;
    padding: 8px 12px;
    border-radius: 12px;
    flex-wrap: wrap;
  }
  .sidebar {
    order: 3;
    flex: 1 1 0;
    min-height: 0;
    position: static;
    height: auto;
    max-height: none;
    width: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-right: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    margin-top: 8px;
    padding: 14px 16px calc(28px + env(safe-area-inset-bottom));
  }
  .sidebar .ctl-more {
    display: block;
  }
  .sidebar:not(.open) .ctl-style .ctl-hint {
    display: block;
  }
  .sheet-handle {
    display: none !important;
  }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar .nav { padding: 3px; }
  .topbar .nav-link { height: 30px; padding: 0 10px; font-size: 13px; }
  .topbar .btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
  .brand-mark { width: 30px; height: 30px; }
  .view-create {
    min-height: calc(100vh - var(--topbar-h));
    min-height: calc(100dvh - var(--topbar-h));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 18px 28px;
  }
  .create-grid { gap: 14px; }
  .create-copy .display {
    font-size: clamp(40px, 11.5vw, 54px);
    line-height: 0.96;
    padding-top: 8px;
  }
  .sample-photo { max-height: min(31dvh, 240px); }
  .create-copy .lede { font-size: 15px; line-height: 1.42; }
  .cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }
  .cta-row .btn {
    flex: initial;
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 12px;
    gap: 7px;
    font-size: 14.5px;
  }
  .cta-row .btn svg {
    width: 17px;
    height: 17px;
    flex: none;
  }
}
@media (max-width: 340px) {
  .cta-row .btn svg { display: none; }
}

/* =====================================================================
   v4 — specimen dedicated topbar + compact 5-slider editor
   ===================================================================== */
.topbar[data-mode="specimen"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.spec-topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  flex: none;
  transition: background .2s, color .2s, border-color .2s;
}
.back-btn:hover {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}
.back-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spec-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}
.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}
.spec-creator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 13px 0 5px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  min-width: 0;
  max-width: 220px;
  transition: border-color .2s, background .2s;
}
.spec-creator:hover {
  border-color: var(--ink);
}
.spec-creator span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spec-topbar-right .pill-btn {
  height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  white-space: nowrap;
  flex: none;
}

.ctl-cuts {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.ctl-cuts .chips {
  margin-top: 0;
}
.ctl-sliders {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 0;
}
.slider-row .ctl-head {
  margin-bottom: 4px;
}

@media (max-width: 820px) {
  .sidebar {
    padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
  }
  .ctl-cuts {
    padding: 0 0 10px;
  }
  .chips-cuts button {
    height: 42px;
  }
  .ctl-sliders {
    gap: 10px;
    padding: 10px 0 12px;
  }
  .slider-row .ctl-head {
    margin-bottom: 2px;
  }
  .slider-row input[type="range"] {
    height: 24px;
  }
}

@media (max-width: 560px) {
  .back-btn {
    height: 34px;
    padding: 0 11px;
    font-size: 13px;
  }
  .spec-creator {
    height: 34px;
    padding: 0 10px 0 3px;
    font-size: 13px;
    max-width: 165px;
    gap: 6px;
  }
  .spec-topbar-right {
    gap: 8px;
  }
  .spec-topbar-right .pill-btn {
    height: 34px;
    padding: 0 11px;
    font-size: 13px;
    gap: 6px;
  }
}

/* =====================================================================
   v5 — .otf / .ttf format toggle, dual download row, & Add to browser modal
   ===================================================================== */
.fmt-seg {
  display: inline-flex;
  padding: 2px;
  background: var(--line);
  border-radius: 999px;
  gap: 2px;
}
.fmt-seg button {
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.fmt-seg button.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 18, 15, 0.08);
}
.dl-btn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.dl-btn-row .btn {
  min-width: 0;
  width: 100%;
  padding: 0 10px;
  font-size: 12.5px;
  height: 40px;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-btn-row .btn svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 18, 15, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-backdrop[hidden] {
  display: none !important;
}
.modal-card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 22px 22px 20px;
  box-shadow: 0 24px 60px rgba(20, 18, 15, 0.24);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-head .eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
}
.modal-head .h3 {
  margin: 0;
}
.bm-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bm-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
}
.bm-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.bm-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.bm-desc a {
  color: var(--ink);
  font-weight: 600;
}
.bm-textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 26px;
  line-height: 1.25;
  resize: vertical;
  min-height: 64px;
}
.bm-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bm-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bm-actions-grid > .btn,
.bm-actions-grid > .bm-pill {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  margin: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bm-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--card);
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  cursor: grab;
}
@media (max-width: 440px) {
  .dl-btn-row,
  .bm-actions-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   v6 — Centered system loading spinner & Missing-characters confirmation
   ===================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.loading-backdrop {
  position: fixed;
  inset: 0;
  z-index: 98;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 249, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.loading-backdrop[hidden] {
  display: none !important;
}

.system-spinner {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.system-spinner svg {
  width: 100%;
  height: 100%;
  animation: sysSpinRotate 1.35s linear infinite;
}
.system-spinner circle {
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-dasharray: 84, 150;
  stroke-dashoffset: 0;
  animation: sysSpinDash 1.35s ease-in-out infinite;
}
@keyframes sysSpinRotate {
  100% { transform: rotate(360deg); }
}
@keyframes sysSpinDash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 88, 150; stroke-dashoffset: -34; }
  100% { stroke-dasharray: 88, 150; stroke-dashoffset: -124; }
}

.missing-notice {
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.missing-notice[hidden] {
  display: none !important;
}
.missing-notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}
.missing-notice-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}
.missing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.missing-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--ink);
}
.missing-pill b {
  font-weight: 700;
}

.modal-card-sm {
  width: min(480px, 100%);
}
.mm-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mm-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mm-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.mm-group-status {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.mm-missing-chars {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.06em;
  word-break: break-word;
}
.mm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.mm-actions .btn {
  width: 100%;
  height: 44px;
  font-size: 13.5px;
  padding: 0 12px;
}
@media (max-width: 440px) {
  .mm-actions {
    grid-template-columns: 1fr;
  }
}
