/* ============================================================
   QR FORGER — Letterpress Atelier
   A warm editorial print-studio interface: ivory stock, espresso
   ink, a single vermilion ember, Fraunces (display) · Hanken
   Grotesk (UI) · Space Mono (register marks & readouts).
   ============================================================ */

:root {
  /* paper stock */
  --paper:    #f0e8d6;
  --paper-2:  #e7ddc8;
  --paper-3:  #fbf6ea;   /* raised cards / the proof plate */
  --paper-sink:#e3d9c2;

  /* ink */
  --ink:      #241d14;
  --ink-soft: #5a4f3c;
  --muted:    #8c7f66;
  --faint:    #b3a78c;

  /* rules & edges */
  --line:     rgba(36, 29, 20, 0.13);
  --line-2:   rgba(36, 29, 20, 0.24);
  --line-3:   rgba(36, 29, 20, 0.38);

  /* the forge ember */
  --accent:    #c5451c;
  --accent-d:  #a3360f;
  --accent-2:  #d8772f;
  --accent-ink:#fcf4ea;
  --accent-wash: rgba(197, 69, 28, 0.08);

  --danger:   #b22f1c;
  --ok:       #3c7a4e;

  --r-lg: 6px;
  --r-md: 5px;
  --r-sm: 4px;

  --shadow-sm: 0 1px 2px rgba(36,29,20,0.10), 0 4px 14px -10px rgba(36,29,20,0.4);
  --shadow:    0 2px 4px rgba(36,29,20,0.08), 0 22px 48px -30px rgba(36,29,20,0.55);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "Courier New", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 620px at 84% -12%, rgba(197,69,28,0.10), transparent 62%),
    radial-gradient(820px 600px at -6% 4%, rgba(185,138,46,0.10), transparent 55%),
    radial-gradient(1200px 900px at 50% 120%, rgba(36,29,20,0.07), transparent 60%);
  background-attachment: fixed;
  line-height: 1.55;
  overflow-x: hidden;
}

.mono { font-family: var(--font-mono); }
.small { font-size: 0.72rem; }

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

/* a wide content rhythm; everything sits above the texture */
.masthead, .workbench, .seo, .colophon { position: relative; z-index: 2; }

/* shared editorial index label: "Nº 01 — COMPOSE" */
.section-index {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 0.7rem;
}
.section-index::before {
  content: ""; width: 26px; height: 1px; background: var(--accent); opacity: 0.7;
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem 1.4rem; flex-wrap: wrap;
  padding: clamp(1.4rem, 3.4vw, 2.6rem) clamp(1.2rem, 5vw, 3.6rem) 0;
  animation: rise 0.7s 0.04s both;
}
.brand { display: flex; align-items: center; gap: 1.05rem; }

/* a stamped ink monogram — registration cross inside a pressed square */
.mark {
  width: 52px; height: 52px; flex: none; position: relative;
  border-radius: 7px; background: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), var(--shadow-sm);
  display: grid; place-items: center;
}
.mark span { display: none; }                 /* legacy grid cells removed */
.mark::before {                                /* registration ring */
  content: ""; width: 25px; height: 25px; border-radius: 50%;
  border: 2px solid var(--accent);
}
.mark::after {                                 /* crosshair */
  content: ""; position: absolute; width: 37px; height: 37px;
  background:
    linear-gradient(var(--accent-2), var(--accent-2)) center/2px 100% no-repeat,
    linear-gradient(var(--accent-2), var(--accent-2)) center/100% 2px no-repeat;
  opacity: 0.92;
}

.overline {
  display: block; font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.42rem;
}
.brand-text h1 {
  margin: 0; font-family: var(--font-display);
  font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.02em; line-height: 0.92; color: var(--ink);
  font-optical-sizing: auto;
}
.tagline {
  margin: 0.5rem 0 0; color: var(--ink-soft); font-size: 0.9rem;
  max-width: 34ch;
}
.tagline em {
  color: var(--accent); font-style: italic; font-family: var(--font-display);
  font-weight: 500;
}

.masthead-status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.66rem; letter-spacing: 0.16em;
  color: var(--ink-soft); padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-2); border-radius: 2px;
  background: var(--paper-3); box-shadow: var(--shadow-sm);
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(60,122,78,0.6); animation: pulse 2.6s infinite;
}

/* ============================================================
   WORKBENCH LAYOUT
   ============================================================ */
.workbench {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(1.3rem, 3vw, 2.4rem) clamp(1.2rem, 5vw, 3.6rem) 2.4rem;
  display: grid; gap: clamp(1.1rem, 2.6vw, 2rem);
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  align-items: start;
}
@media (max-width: 900px) { .workbench { grid-template-columns: 1fr; } }

.console, .stage {
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.console {
  padding: clamp(1.2rem, 2.4vw, 1.8rem);
  animation: rise 0.7s 0.14s both;
}
.stage {
  padding: clamp(1.2rem, 2.4vw, 1.7rem);
  position: sticky; top: 1.4rem;
  background:
    linear-gradient(180deg, var(--paper-3), var(--paper-3));
  animation: rise 0.7s 0.22s both;
}
@media (max-width: 900px) { .stage { position: static; } }

/* ============================================================
   CONSOLE INTRO
   ============================================================ */
.console-intro { margin-bottom: 1.2rem; }
.console-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.25rem, 2.8vw, 1.6rem); letter-spacing: -0.015em;
  margin: 0 0 0.4rem; color: var(--ink); line-height: 1.12;
}
.console-sub { margin: 0; color: var(--ink-soft); font-size: 0.88rem; line-height: 1.55; }
.console-sub b { color: var(--accent); font-weight: 700; }

/* ============================================================
   TABS — a printer's tab strip
   ============================================================ */
.tabs {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  margin-bottom: 1.3rem; padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line-2);
}
.tab {
  flex: 0 0 auto; position: relative;
  padding: 0.46rem 0.7rem; font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.04em;
  color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 4px 4px 0 0; cursor: pointer;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: var(--paper-2); }
.tab.active {
  color: var(--accent-ink); background: var(--ink);
}
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.55rem; height: 2px;
  background: var(--accent);
}

/* ============================================================
   PANELS & FIELDS
   ============================================================ */
.panel { display: none; animation: panel-in 0.32s ease both; }
.panel.active { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.field { display: block; margin-bottom: 0.9rem; }
.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.42rem;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
@media (max-width: 480px) { .row-2 { grid-template-columns: 1fr; } }

input[type="text"], input[type="url"], input[type="email"], input[type="tel"],
input[type="password"], textarea, select {
  width: 100%; font-family: var(--font-ui); font-size: 0.92rem;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 0.64rem 0.78rem; outline: none;
  box-shadow: inset 0 1px 2px rgba(36,29,20,0.06);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
textarea { resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash), inset 0 1px 2px rgba(36,29,20,0.06);
  background: #fffdf7;
}
select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238c7f66' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.78rem center;
  padding-right: 2rem;
}

.hint { color: var(--muted); font-size: 0.74rem; margin: 0.25rem 0 0; }

.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.chips { display: flex; gap: 0.4rem; margin-top: 0.3rem; }
.chips button {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-soft); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: 3px; padding: 0.3rem 0.62rem; transition: 0.15s;
}
.chips button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }

/* ============================================================
   FILE DROPZONE
   ============================================================ */
.dropzone {
  border: 1.5px dashed var(--line-3); border-radius: var(--r-md);
  background: var(--paper); padding: 1.7rem 1rem; text-align: center;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-wash); outline: none; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-wash); transform: scale(1.01); }
.dz-icon { font-size: 1.8rem; color: var(--accent); line-height: 1; }
.dz-title { margin: 0.55rem 0 0.2rem; font-size: 0.95rem; color: var(--ink); }
.dz-sub { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.link-look { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.file-meta {
  display: flex; gap: 0.9rem; align-items: center; margin-top: 0.95rem;
  padding: 0.75rem; background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.file-preview {
  width: 60px; height: 60px; flex: none; border-radius: 4px;
  background: var(--paper-3) center/cover no-repeat; border: 1px solid var(--line-2);
  display: grid; place-items: center; font-family: var(--font-mono);
  font-size: 0.6rem; color: var(--muted); text-transform: uppercase; overflow: hidden;
}
.file-info { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 0.72rem; }
.fi-row { display: flex; gap: 0.6rem; padding: 0.14rem 0; }
.fi-row span { color: var(--muted); width: 44px; flex: none; }
.fi-row b { color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-actions { display: flex; gap: 0.5rem; margin-top: 0.85rem; flex-wrap: wrap; }
.notice {
  font-size: 0.76rem; margin: 0.75rem 0 0; padding: 0.62rem 0.72rem;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); color: var(--ink-soft);
  background: var(--paper); line-height: 1.5;
}
.notice.ok { border-color: rgba(60,122,78,0.5); color: #2c6b40; background: rgba(60,122,78,0.08); }
.notice.err { border-color: rgba(178,47,28,0.5); color: #97291a; background: rgba(178,47,28,0.07); }
.notice.busy { border-color: rgba(197,69,28,0.45); color: var(--accent); background: var(--accent-wash); }
.notice a { color: inherit; }

.hr-or {
  display: flex; align-items: center; gap: 0.7rem; margin: 1.1rem 0 0.7rem;
  color: var(--muted); font-family: var(--font-mono); font-size: 0.64rem;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.hr-or::before, .hr-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

.sync-box { margin-top: 0.6rem; }
.sync-hint {
  line-height: 1.6; margin: 0 0 0.7rem; color: var(--ink-soft);
  font-size: 0.8rem; text-transform: none; letter-spacing: 0;
}
.sync-hint b { color: var(--ink); font-weight: 700; }
#effectiveUrl { word-break: break-all; color: var(--ok); margin-top: 0.4rem; }

/* permanent storage connector */
.storage {
  margin-top: 1.1rem; border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--paper); padding: 0 0.9rem;
}
.storage > summary, .styler > summary {
  cursor: pointer; list-style: none; font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink); display: flex; align-items: center;
  gap: 0.5rem; padding: 0.85rem 0;
}
.storage > summary::-webkit-details-marker, .styler > summary::-webkit-details-marker { display: none; }
.storage > summary::before, .styler > summary::before {
  content: "+"; color: var(--accent); font-size: 1rem; line-height: 1;
  transition: transform 0.22s; display: inline-grid; place-items: center;
  width: 16px; height: 16px; border: 1px solid var(--line-2); border-radius: 3px;
}
.storage[open] > summary::before, .styler[open] > summary::before { transform: rotate(45deg); }
.storage-body { padding: 0.2rem 0 1rem; animation: panel-in 0.3s both; }
.storage-actions { display: flex; gap: 0.5rem; margin-top: 0.3rem; flex-wrap: wrap; }
.prov-fields { animation: panel-in 0.25s both; }
.summary-hint.ok { color: var(--ok); }
.setup-steps { margin: 0.1rem 0 0.2rem; padding-left: 1.2rem; color: var(--ink-soft); font-size: 0.74rem; line-height: 1.7; }
.setup-steps li { margin-bottom: 0.12rem; }
.setup-steps li::marker { color: var(--accent); }
.setup-steps b { color: var(--ink); }
.setup-steps a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.pdf-note { margin-top: 0.55rem; padding: 0.5rem 0.65rem; border-left: 2px solid var(--accent); background: var(--accent-wash); border-radius: 0 4px 4px 0; }
.pdf-note b { color: var(--ink); }
.prov-fields code, .colophon code {
  font-family: var(--font-mono); background: rgba(36,29,20,0.07);
  padding: 0.05rem 0.34rem; border-radius: 3px; color: var(--accent-d); font-size: 0.9em;
}
.storage .hint a, .sync-box .hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   STYLER (appearance)
   ============================================================ */
.styler {
  margin-top: 1.3rem; border-top: 1px solid var(--line-2); padding-top: 0.4rem;
}
.styler > summary { padding: 0.7rem 0; }
.summary-hint { color: var(--muted); text-transform: none; letter-spacing: 0; font-family: var(--font-ui); }
.styler-body { padding-top: 0.95rem; animation: panel-in 0.3s both; }

.color-field .color-wrap {
  display: flex; align-items: center; gap: 0.55rem;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 0.32rem 0.55rem 0.32rem 0.35rem;
}
input[type="color"] {
  width: 34px; height: 30px; padding: 0; border: none; border-radius: 4px;
  background: none; cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line-2); border-radius: 4px; }
.color-wrap i { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-soft); font-style: normal; text-transform: uppercase; }

.swatches { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.95rem; }
.swatch {
  width: 30px; height: 30px; border-radius: 4px; cursor: pointer; padding: 0;
  border: 1px solid var(--line-2); position: relative; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.swatch::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--sw-fg) 0 50%, var(--sw-bg) 50% 100%);
}

.slider-field input[type="range"] {
  width: 100%; accent-color: var(--accent); margin-top: 0.3rem;
}
.slider-field .field-label i { font-family: var(--font-mono); color: var(--accent); font-style: normal; }

.logo-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-top: 0.4rem; }
.logo-left { flex: 1; min-width: 140px; }
.logo-buttons { display: flex; gap: 0.4rem; margin-top: 0.45rem; }
.logo-size { flex: 1; min-width: 140px; }

/* ============================================================
   BUTTONS — letterpress
   ============================================================ */
.btn {
  font-family: var(--font-ui); font-weight: 700; font-size: 0.84rem;
  letter-spacing: 0.01em;
  border-radius: var(--r-sm); padding: 0.66rem 1.05rem; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s, box-shadow 0.18s, background 0.18s, border-color 0.18s, color 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 0.44rem 0.72rem; font-size: 0.76rem; }
.btn-accent {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 8px 18px -12px rgba(165,54,15,0.9);
}
.btn-accent:hover { background: var(--accent-d); }
.btn-ghost {
  background: var(--paper-3); color: var(--ink); border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; box-shadow: none; }

/* ============================================================
   STAGE / PROOF
   ============================================================ */
.stage-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.6rem; margin-bottom: 0.95rem;
}
.stage-head .section-index { margin: 0; }
.stage-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  letter-spacing: -0.01em; color: var(--ink); margin: 0;
}

.readout {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  padding: 0.75rem 0.85rem; background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--r-md); margin-bottom: 0.75rem;
}
.ro-item { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.ro-key { font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.18em; color: var(--muted); }
.ro-val { font-family: var(--font-mono); font-size: 0.84rem; color: var(--accent-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.capacity { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.1rem; }
.cap-track { flex: 1; height: 6px; border-radius: 100px; background: var(--paper-2); overflow: hidden; border: 1px solid var(--line-2); }
.cap-fill {
  height: 100%; width: 0%; border-radius: 100px;
  background: linear-gradient(90deg, var(--ok), var(--accent-2));
  transition: width 0.35s ease, background 0.35s;
}
.cap-fill.warn { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.cap-fill.over { background: linear-gradient(90deg, var(--accent), var(--danger)); }
.cap-label { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); width: 3.6em; text-align: right; }

/* the proof plate + printer's crop marks */
.plate-wrap { position: relative; padding: 20px; }
.bracket { position: absolute; width: 18px; height: 18px; pointer-events: none; }
.bracket::before, .bracket::after { content: ""; position: absolute; background: var(--accent); }
.bracket::before { width: 1.5px; height: 100%; }   /* vertical tick */
.bracket::after  { width: 100%; height: 1.5px; }    /* horizontal tick */
.bracket-tl { top: 4px; left: 4px; }
.bracket-tl::before { left: 0; top: 0; } .bracket-tl::after { left: 0; top: 0; }
.bracket-tr { top: 4px; right: 4px; }
.bracket-tr::before { right: 0; top: 0; } .bracket-tr::after { right: 0; top: 0; }
.bracket-bl { bottom: 4px; left: 4px; }
.bracket-bl::before { left: 0; bottom: 0; } .bracket-bl::after { left: 0; bottom: 0; }
.bracket-br { bottom: 4px; right: 4px; }
.bracket-br::before { right: 0; bottom: 0; } .bracket-br::after { right: 0; bottom: 0; }

.plate {
  position: relative; border-radius: var(--r-sm); overflow: hidden;
  display: grid; place-items: center; padding: 22px;
  background: var(--paper-3);
  border: 1px solid var(--line-2); min-height: 250px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), 0 14px 30px -22px rgba(36,29,20,0.5);
}
.qr-host { display: grid; place-items: center; width: 100%; transition: opacity 0.25s; }
.qr-host canvas, .qr-host svg {
  width: 100% !important; height: auto !important; max-width: 330px;
  border-radius: 3px; display: block;
  filter: drop-shadow(0 12px 26px rgba(36,29,20,0.22));
  animation: qr-pop 0.4s ease both;
}
@keyframes qr-pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.plate-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--faint); font-family: var(--font-mono); font-size: 0.74rem;
  letter-spacing: 0.14em; text-transform: uppercase; pointer-events: none;
}
.plate.has-qr .plate-empty { display: none; }

.actions { display: flex; gap: 0.5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.actions .btn-accent { flex: 1 1 auto; }
.stage-foot {
  margin: 0.9rem 0 0; color: var(--muted); font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.04em; text-align: center;
}

/* ============================================================
   COLOPHON
   ============================================================ */
.colophon {
  border-top: 1px solid var(--line-2); margin-top: 1.2rem;
  padding: clamp(1.6rem, 4vw, 2.8rem) clamp(1.2rem, 5vw, 3.6rem) 3rem;
}
.colophon-inner { max-width: 1000px; margin: 0 auto; }
.colophon p { color: var(--ink-soft); font-size: 0.85rem; margin: 0 0 0.6rem; }
.colophon b { color: var(--ink); }
.colophon em { color: var(--accent); font-style: italic; font-family: var(--font-display); }
.colophon a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.colophon .small { color: var(--muted); }
.footer-brand { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot-title { font-size: 0.95rem; }
.foot-title b { font-family: var(--font-display); color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.foot-title em { color: var(--accent); font-style: italic; font-family: var(--font-display); }
.foot-year { color: var(--muted); white-space: nowrap; font-family: var(--font-mono); }

/* ============================================================
   PROTECTION OVERLAY (guard.js)
   ============================================================ */
#guardOverlay {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center; padding: 2rem; text-align: center;
  background: rgba(240, 232, 214, 0.92);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  animation: rise 0.25s both;
}
.guard-card { max-width: 420px; }
.guard-card h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.7rem;
  margin: 1.1rem 0 0.5rem; color: var(--ink);
}
.guard-card p { color: var(--ink-soft); margin: 0 0 0.4rem; font-size: 0.92rem; }
.guard-by {
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent) !important; margin-top: 1.2rem !important;
}
.guard-mark {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 7px;
  background: var(--ink); position: relative;
  box-shadow: var(--shadow);
}
.guard-mark::after {
  content: ""; position: absolute; inset: 14px; border: 2px solid var(--accent);
  border-radius: 50%;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(60,122,78,0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(60,122,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(60,122,78,0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   EXPLANATORY UI — per-tab help, info tooltips
   ============================================================ */
.panel-help {
  margin: 0 0 1rem; padding: 0.66rem 0.82rem;
  border-left: 2px solid var(--accent); background: var(--accent-wash);
  border-radius: 0 4px 4px 0; color: var(--ink-soft); font-size: 0.82rem; line-height: 1.55;
}
.panel-help b { color: var(--ink); font-weight: 700; }

.info {
  display: inline-grid; place-items: center; width: 15px; height: 15px;
  border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted);
  font-family: var(--font-ui); font-size: 0.62rem; font-style: normal; font-weight: 700;
  text-transform: none; letter-spacing: 0; cursor: help; position: relative; vertical-align: middle;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.info:hover, .info:focus-visible {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent); outline: none;
}
.info::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); right: -6px;
  width: max-content; max-width: min(240px, 72vw); padding: 0.5rem 0.66rem; z-index: 60;
  background: var(--ink); color: var(--paper-3); border-radius: 4px;
  font-family: var(--font-ui); font-size: 0.74rem; font-weight: 400; line-height: 1.5;
  letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.16s, transform 0.16s; pointer-events: none;
}
.info:hover::after, .info:focus-visible::after { opacity: 1; visibility: visible; transform: none; }

/* ============================================================
   SEO + FAQ CONTENT
   ============================================================ */
.seo {
  border-top: 1px solid var(--line-2);
  padding: clamp(2.2rem, 5vw, 4rem) clamp(1.2rem, 5vw, 3.6rem) 1rem;
}
.seo-inner { max-width: 1000px; margin: 0 auto; }
.seo h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
#seo-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 0.8rem; max-width: 22ch; line-height: 1.08; }
.seo-lede { color: var(--ink-soft); font-size: 0.98rem; max-width: 70ch; margin: 0 0 2.4rem; line-height: 1.65; }
.seo-lede b, .seo-card p b, .faq-item p b { color: var(--ink); font-weight: 700; }
.seo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2.8rem; }
.seo-card {
  background: var(--paper-3); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 1.3rem 1.25rem; position: relative; box-shadow: var(--shadow-sm);
}
.seo-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; margin: 0 0 0.45rem; color: var(--ink); }
.seo-card p { margin: 0; color: var(--ink-soft); font-size: 0.86rem; line-height: 1.6; }

.faq h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0 0 1.1rem; }
.faq-item { border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--paper-3); margin-bottom: 0.6rem; box-shadow: var(--shadow-sm); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1rem 1.15rem; font-weight: 700;
  color: var(--ink); font-size: 0.96rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; flex: none; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0; padding: 0 1.15rem 1.1rem; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.65; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) { .seo-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .masthead { padding-top: 1.3rem; }
  .actions { gap: 0.4rem; }
  .actions .btn { flex: 1 1 auto; }
  .ro-val { font-size: 0.78rem; }
  .ro-key { font-size: 0.5rem; letter-spacing: 0.14em; }
  .tab { font-size: 0.64rem; padding: 0.42rem 0.58rem; }
  .file-actions .btn { flex: 1 1 100%; }
}
@media (max-width: 380px) {
  .readout { grid-template-columns: 1fr 1fr; gap: 0.6rem 0.5rem; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
