/* Mystery Labs.
   Layout concept: a descent through an underground government-issue lab.
   Each section is a floor with its own paint, joined by concrete slabs, and
   scrolling moves a lift needle. Every colour comes from that building:
   institutional mint walls, triplicate-form paper, lift-lamp amber.
   Single visual world by choice, so there is no theme switch. The light cord is it. */
:root {
  color-scheme: light;

  /* paint */
  --mint: #b7d5c3;
  --mint-deep: #6f9f8b;
  --cobalt: #1a3fd0;
  --cobalt-deep: #122c97;
  --enamel: #1f3d35;
  --enamel-hi: #2b5247;
  --canary: #f6e27a;
  --salmon: #eeaa9c;
  --mustard: #e6ac12;
  --scarlet: #c81e1e;
  --scarlet-deep: #8e1014;

  /* paper */
  --form: #fbfaf3;
  --form-pink: #f7cfd2;
  --form-can: #f8ed9c;
  --manila: #e3c586;
  --kraft: #c9a26b;

  /* ink and metal */
  --ink: #14191b;
  --ink-soft: #3a4346;
  --pen-red: #d21414;
  --pen-blue: #1a3fd0;
  --lamp: #ffb627;
  --steel: #5e6b64;
  --steel-hi: #7c8a82;
  --concrete: #4a4f4e;

  /* type: poster, typewriter, form print, biro */
  --f-poster: "Rozha One", "Bodoni 72", Didot, Georgia, serif;
  --f-type: "Courier Prime", "Courier New", Courier, monospace;
  --f-form: "Archivo Narrow", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-pen: "Reenie Beanie", "Bradley Hand", "Segoe Script", cursive;

  --gut: max(clamp(16px, 5vw, 76px), env(safe-area-inset-left, 0px));
  --gut-r: max(clamp(16px, 5vw, 76px), env(safe-area-inset-right, 0px));
  --rail: 0px;

  --cork-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.5' numOctaves='3' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .22 0 0 0 0 .12 0 0 0 0 .04 0 0 0 1.9 -.78'/%3E%3C/filter%3E%3Crect width='420' height='420' filter='url(%23c)'/%3E%3C/svg%3E");
  --grain-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (min-width: 1000px) { :root { --rail: 44px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--f-type);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--canary); color: var(--ink); }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; }
.defs { position: absolute; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--ink); color: var(--form); padding: 8px 14px; font-family: var(--f-form);
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%; max-width: 1400px; margin-inline: auto;
  padding-left: var(--gut);
  padding-right: calc(var(--gut-r) + var(--rail));
}
.floor { position: relative; --top: clamp(92px, 8.4vw, 122px); --bot: clamp(56px, 7vw, 100px); }

.h-big {
  font-family: var(--f-poster); font-weight: 400;
  font-size: clamp(2.9rem, 7.4vw, 6.6rem);
  line-height: .98; letter-spacing: -.005em; text-wrap: balance;
}
.h-huge {
  font-family: var(--f-poster); font-weight: 400;
  font-size: clamp(3.3rem, 10vw, 9.6rem);
  line-height: .94; text-wrap: balance;
}
.typed { max-width: 56ch; }
.fine { font-family: var(--f-form); font-size: .92rem; letter-spacing: .01em; }

/* ───────── Darkness ───────── */
#grain {
  position: fixed; inset: 0; z-index: 980; pointer-events: none;
  background: var(--grain-tex); opacity: .07;
}
#dark {
  display: none; position: fixed; inset: 0; z-index: 900; pointer-events: none;
  --tx: 50vw; --ty: 40vh; --tr: min(52vw, 430px);
  background:
    radial-gradient(circle var(--tr) at var(--tx) var(--ty),
      rgba(255, 214, 140, .12) 0, rgba(255, 214, 140, .05) 34%, rgba(6, 8, 10, .3) 58%, rgba(6, 8, 10, .955) 100%),
    rgba(6, 8, 10, 0);
}
.lights-off #dark { display: block; }
.lights-off #dark::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle var(--tr) at var(--tx) var(--ty), transparent 92%, rgba(6, 8, 10, .955) 100%);
}
.flickering #dark { animation: tube 1.1s steps(1, end) forwards; }
@keyframes tube {
  0% { opacity: 1 } 7% { opacity: .2 } 11% { opacity: 1 } 28% { opacity: .35 } 32% { opacity: 1 }
  50% { opacity: .08 } 54% { opacity: .8 } 63% { opacity: 0 } 69% { opacity: .5 } 73%, 100% { opacity: 0 }
}
.darkhint {
  display: none; position: fixed; z-index: 950;
  left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(92vw, 520px);
  text-align: center; color: #cfe9c8;
  font-family: var(--f-form); letter-spacing: .03em;
}
.first-visit.lights-off:not(.flickering) .darkhint { display: grid; gap: 8px; justify-items: center; }
.darkhint button {
  border: 1px solid rgba(207, 233, 200, .5); padding: 6px 14px; border-radius: 2px;
  font-family: var(--f-form); letter-spacing: .06em; color: #cfe9c8;
}
.darkhint button:hover { background: rgba(207, 233, 200, .14); }

.scrawls { display: none; position: absolute; inset: 0; pointer-events: none; }
.lights-off .scrawls { display: block; }
.scrawl {
  position: absolute; font-family: var(--f-pen); color: var(--ink);
  font-size: clamp(2.2rem, 4.2vw, 3.8rem); line-height: .92; rotate: -3deg;
}
.s1 { top: 9%; left: 58%; }
.s2 { top: 52%; left: 44%; rotate: 2deg; color: var(--pen-blue); }
.s3 { top: 12%; right: 8%; rotate: 5deg; color: var(--pen-red); }

/* ───────── Cord ───────── */
.cord {
  position: fixed; z-index: 950; top: 0;
  right: calc(max(10px, env(safe-area-inset-right, 0px)) - 26px);
  width: 120px; height: 0; pointer-events: none;
}
.cord svg { position: absolute; top: 0; left: 0; overflow: visible; }
.cord line {
  stroke: #d9d6c8; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: .1 6.2;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,.55));
}
.cord__bob {
  position: absolute; left: 60px; top: 0; width: 0; height: 0;
  pointer-events: auto; touch-action: none; will-change: transform;
}
.cord__acorn {
  position: absolute; left: -11px; top: -2px; width: 22px; height: 34px;
  border-radius: 45% 45% 50% 50% / 30% 30% 70% 70%;
  background: radial-gradient(circle at 34% 28%, #e7ba7d, #a86a2b 58%, #5f3412);
  box-shadow: 1px 3px 4px rgba(0,0,0,.4);
  cursor: grab;
}
.cord__bob::after { content: ""; position: absolute; left: -26px; top: -14px; width: 52px; height: 104px; cursor: grab; }
.cord__tag {
  position: absolute; left: -24px; top: 38px; width: 48px;
  padding: 7px 0 4px; text-align: center;
  background: var(--form); color: var(--ink);
  font-family: var(--f-form); font-weight: 700; font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  clip-path: polygon(22% 0, 78% 0, 100% 16%, 100% 100%, 0 100%, 0 16%);
  rotate: 3deg;
}
.lights-off .cord__tag {
  background: #d7ff9e; color: #18330f;
  animation: phosphor 2.6s ease-in-out infinite;
}
@keyframes phosphor { 50% { filter: brightness(1.2) drop-shadow(0 0 12px #c7ff7c); } 0%, 100% { filter: brightness(.95) drop-shadow(0 0 4px #c7ff7c); } }

/* ───────── Lift plate ───────── */
.plate {
  position: fixed; z-index: 800;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center;
  padding: 8px 12px 7px 10px;
  background: linear-gradient(170deg, #27302f, #171d1e);
  color: #eee9d6;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 3px 10px rgba(0,0,0,.35);
}
.plate__brand { display: flex; align-items: center; gap: 7px; text-decoration: none; grid-row: 1 / 3; }
.plate__word { font-family: var(--f-poster); font-size: 17px; line-height: .98; }
.plate__dial { line-height: 0; }
.plate__now {
  grid-column: 2; font-family: var(--f-form); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--lamp); display: flex; gap: 6px; justify-content: center; white-space: nowrap;
}
.plate__now b { font-weight: 700; }
#dial text { font-family: var(--f-form); font-size: 8.5px; font-weight: 600; fill: #b9bda9; }
#dial .tick { stroke: #b9bda9; stroke-width: 1.2; }
#dial .needle { stroke: var(--lamp); stroke-width: 2; stroke-linecap: round; }
#dial .hub { fill: #d9d6c8; }

/* ───────── Lift rail ───────── */
.lift {
  position: fixed; z-index: 950; display: flex;
  right: max(10px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%);
  flex-direction: column; gap: 5px;
  padding: 8px 6px;
  background: linear-gradient(90deg, #7f8b84, #59645e 40%, #49534e);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 4px 14px rgba(0,0,0,.35);
}
.lift a, .lift button { position: relative; display: block; text-decoration: none; }
.lift i {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-style: normal; font-family: var(--f-form); font-weight: 700; font-size: 11.5px;
  color: #d8d6c8;
  background: radial-gradient(circle at 40% 30%, #2d3536, #101516 72%);
  box-shadow: 0 0 0 2px #c9ced0, 0 0 0 3px #3b4543, 0 2px 3px 2px rgba(0,0,0,.35);
  transition: color .15s, background .15s, box-shadow .15s;
}
.lift span {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(6px, -50%);
  white-space: nowrap; font-family: var(--f-form); font-size: 13px; letter-spacing: .04em;
  background: var(--ink); color: var(--form); padding: 3px 8px;
  opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s;
}
.lift a:hover span, .lift button:hover span, .lift a:focus-visible span, .lift button:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.lift a:hover i { color: #fff; }
.lift a.is-here i, .lift .is-on i {
  color: #3a2300;
  background: radial-gradient(circle at 45% 35%, #ffe2a0, var(--lamp) 60%, #d98600);
  box-shadow: 0 0 0 2px #c9ced0, 0 0 0 3px #3b4543, 0 0 16px 3px rgba(255, 182, 39, .75);
}
.lift__locked i { color: #7d8280; font-size: 10.5px; }
.lift__sound { margin-top: 5px; }
.lift__sound i { font-size: 13px; }

.toast {
  position: fixed; z-index: 960; left: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 18px); opacity: 0; pointer-events: none;
  max-width: min(90vw, 460px);
  background: var(--ink); color: var(--lamp); padding: 9px 16px;
  font-family: var(--f-form); font-size: 15px; letter-spacing: .03em; text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  transition: opacity .18s, transform .18s;
}
.toast.is-up { opacity: 1; transform: translate(-50%, 0); }

/* ───────── Slab ───────── */
.slab {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 28px;
  padding: 26px var(--gut-r) 22px var(--gut);
  background:
    repeating-linear-gradient(-45deg, var(--mustard) 0 16px, var(--ink) 16px 32px) top / 100% 10px no-repeat,
    linear-gradient(180deg, #55595a, #3c4040);
  color: #d7d8cf;
  font-family: var(--f-form); font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(0,0,0,.28) inset;
}
.slab b { font-family: var(--f-poster); font-weight: 400; font-size: 34px; line-height: 1; letter-spacing: 0; color: #f2efe2; }
.slab span:last-child { color: #9fa59f; }
.slab--b { background:
    repeating-linear-gradient(-45deg, var(--scarlet) 0 16px, var(--form) 16px 32px) top / 100% 10px no-repeat,
    linear-gradient(180deg, #55595a, #3c4040); }

/* ═════════ G ═════════ */
.f-g {
  background: linear-gradient(180deg, var(--mint) 0, var(--mint) calc(100% - 196px), var(--ink) calc(100% - 196px), var(--ink) calc(100% - 190px), var(--mint-deep) calc(100% - 190px));
  overflow: hidden;
}
.tube {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(46vw, 560px); height: 20px;
  background: linear-gradient(#cfcfc4, #8e9389);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.tube span {
  position: absolute; left: 3%; right: 3%; bottom: -5px; height: 8px; border-radius: 8px;
  background: #fffff4;
  box-shadow: 0 0 38px 10px rgba(255, 255, 235, .95), 0 0 130px 60px rgba(255, 255, 235, .4);
}
.lights-off .tube span { background: #6d7069; box-shadow: none; }

.f-g__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(16px, 3vw, 44px);
  padding-top: clamp(96px, 11vw, 136px);
  padding-bottom: 64px;
}
.f-g__main { min-width: 0; }
.eyebrow {
  font-family: var(--f-form); font-weight: 600; font-size: clamp(14px, 1.3vw, 17px);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: clamp(14px, 2vw, 22px);
}
.poster {
  font-family: var(--f-poster); font-weight: 400;
  font-size: clamp(3.15rem, 10vw, 10.2rem);
  line-height: .93; letter-spacing: -.012em; color: var(--ink);
}
.poster__l { display: block; white-space: nowrap; }
.fix { position: relative; display: inline-block; }
.fix__was { position: relative; display: inline-block; color: var(--ink); }
.fix__strike { position: absolute; left: -4%; top: 28%; width: 108%; height: 58%; overflow: visible; }
.fix__strike path {
  fill: none; stroke: var(--pen-red); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: strike .55s .35s cubic-bezier(.6,.05,.3,1) both;
}
@keyframes strike { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.fix__pen {
  position: absolute; left: 16%; top: -.44em; white-space: nowrap;
  font-family: var(--f-pen); color: var(--pen-red);
  font-size: 1.2em; line-height: 1; letter-spacing: 0; rotate: -7deg;
  animation: penin .4s .85s steps(5, end) both;
}
@keyframes penin { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -10% -20% 0); } }
.first-visit:not(.lit) .fix__strike path { animation: none; stroke-dashoffset: 1; }
.first-visit:not(.lit) .fix__pen { animation: none; clip-path: inset(0 100% 0 0); }

.lede {
  max-width: 52ch; margin-top: clamp(18px, 2.4vw, 30px);
  font-size: clamp(17px, 1.5vw, 20px); line-height: 1.42;
}
.solved {
  display: inline-block; margin-top: 18px; padding: 8px 14px 6px;
  background: var(--form-can); font-family: var(--f-pen); font-size: 27px; line-height: 1.05;
  rotate: -1.4deg; box-shadow: 2px 3px 6px rgba(0,0,0,.2);
  animation: drop .4s cubic-bezier(.2,1.4,.5,1) both;
}
.solved[hidden] { display: none; }
@keyframes drop { from { transform: translateY(-14px) rotate(4deg); opacity: 0; } }

.desk { display: grid; justify-items: center; align-content: start; gap: 12px; padding-top: 30px; width: clamp(190px, 19vw, 248px); }
.clock { display: flex; align-items: center; gap: 10px; }
.clock svg { width: 84px; height: 84px; filter: drop-shadow(2px 4px 4px rgba(0,0,0,.28)); flex: none; }
.clock figcaption { font-family: var(--f-form); font-size: 12.5px; line-height: 1.2; letter-spacing: .02em; }
#clock .face { fill: var(--form); stroke: var(--ink); stroke-width: 5; }
#clock .t { stroke: var(--ink); stroke-width: 1.6; }
#clock .t.major { stroke-width: 3.4; }
#clock .h, #clock .m { stroke: var(--ink); stroke-linecap: round; }
#clock .h { stroke-width: 5; } #clock .m { stroke-width: 3; }
#clock .s { stroke: var(--pen-red); stroke-width: 1.6; }

.dispenser { position: relative; width: 100%; display: grid; justify-items: center; padding-bottom: 64px; }
.serving {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px;
  padding: 3px 10px 2px; background: #120b05; color: var(--lamp); border-radius: 2px;
  font-family: var(--f-form); box-shadow: 0 0 0 3px #2b2f2d, 0 3px 6px rgba(0,0,0,.3);
}
.serving small { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #c78d1e; }
.serving output { font-family: var(--f-type); font-weight: 700; font-size: 26px; line-height: 1.1; text-shadow: 0 0 8px rgba(255,182,39,.8); font-variant-numeric: tabular-nums; }
.snail { position: relative; z-index: 2; width: 100%; max-width: 212px; filter: drop-shadow(3px 7px 7px rgba(0,0,0,.36)); }
.ticket {
  position: absolute; z-index: 1; left: 50%; bottom: 6px; translate: -50% 0;
  width: 92px; height: 86px; padding-top: 14px;
  display: grid; justify-items: center; align-content: center; line-height: 1;
  background: #fffdf0; color: var(--ink);
  font-family: var(--f-form);
  clip-path: polygon(0 0, 100% 0, 100% 90%, 92% 100%, 84% 90%, 76% 100%, 68% 90%, 60% 100%, 52% 90%, 44% 100%, 36% 90%, 28% 100%, 20% 90%, 12% 100%, 4% 90%, 0 100%);
  transition: transform .2s cubic-bezier(.3,1.5,.5,1);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.25));
  animation: nudge 3.4s 2s ease-in-out infinite;
}
@keyframes nudge { 0%, 88%, 100% { transform: none; } 92% { transform: translateY(5px); } 96% { transform: translateY(-1px); } }
.ticket:hover { animation: none; transform: translateY(8px); }
.ticket b { font-family: var(--f-poster); font-weight: 400; font-size: 32px; line-height: 1; }
.ticket small { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.ticket.is-torn { animation: tear .95s cubic-bezier(.3,.1,.6,1) forwards; pointer-events: none; }
@keyframes tear {
  0% { transform: none; } 18% { transform: translateY(16px) rotate(-3deg); }
  100% { transform: translate(-30px, 130vh) rotate(-42deg); }
}
.noqueue { font-family: var(--f-form); font-size: 14px; text-underline-offset: 3px; text-align: center; }

.notices { position: relative; padding-bottom: 28px; }
.notices__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 32px); }
.notice {
  position: relative; padding: 18px 18px 14px; background: var(--form); min-height: 128px;
  box-shadow: 1px 3px 7px rgba(0,0,0,.28);
  rotate: -.6deg;
}
.notice:nth-child(2) { rotate: .9deg; translate: 0 6px; }
.notice:nth-child(3) { rotate: -.3deg; translate: 0 -3px; }
.notice::before {
  content: ""; position: absolute; top: -8px; left: 50%; width: 64px; height: 18px; translate: -50% 0; rotate: -2deg;
  background: rgba(240, 232, 190, .78); box-shadow: 0 1px 1px rgba(0,0,0,.14);
}
.notice--pink { background: var(--form-pink); }
.notice--can { background: var(--form-can); }
.notice h2 { font-family: var(--f-form); font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.notice p { font-size: 15.5px; line-height: 1.34; }

/* ═════════ B1 ═════════ */
.f-b1 {
  background:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 100% 36px,
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 36px 100%,
    var(--cobalt);
  color: #f3f2e8;
  padding-block: var(--top) var(--bot);
}
.f-b1__head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px 40px; align-items: end; margin-bottom: clamp(30px, 4vw, 54px); }
.intake { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(26px, 4vw, 56px); align-items: start; }

.form { position: relative; color: var(--ink); }
.form__sheet { position: relative; z-index: 3; background: var(--form); padding: clamp(16px, 2.4vw, 28px); box-shadow: 0 2px 3px rgba(0,0,0,.2); rotate: -.5deg; }
.form__copy { position: absolute; z-index: 2; inset: 6px -7px -7px 7px; background: var(--form-pink); rotate: .5deg; box-shadow: 0 2px 3px rgba(0,0,0,.2); }
.form__copy--can { z-index: 1; inset: 12px -13px -14px 13px; background: var(--form-can); rotate: 1.1deg; box-shadow: 0 6px 16px rgba(0,0,0,.34); }
.form__head {
  display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 3px double var(--ink);
  font-family: var(--f-form); font-size: 14px; line-height: 1.2;
}
.form__head b { font-family: var(--f-poster); font-weight: 400; font-size: 21px; }
.form__ref { text-align: right; }
.form__label { display: block; font-family: var(--f-form); font-weight: 700; font-size: 15px; letter-spacing: .02em; margin-bottom: 4px; }
.form__label em { font-weight: 400; font-style: italic; }
#problem {
  display: block; width: 100%; resize: vertical; min-height: 148px;
  border: 0; outline-offset: 2px; padding: 0 2px; margin-bottom: 18px;
  font-family: var(--f-type); font-size: 18px; line-height: 30px; color: var(--pen-blue);
  background: repeating-linear-gradient(transparent 0 29px, #9fb0c6 29px 30px) local;
}
#problem::placeholder { color: #8a93a2; }
.presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 14px; margin-bottom: 16px; }
.presets button {
  display: grid; grid-template-columns: 15px 1fr; gap: 7px; align-items: start; text-align: left; width: 100%;
  font-family: var(--f-form); font-size: 15px; line-height: 1.22; padding: 3px 0;
}
.presets button::before {
  content: ""; width: 14px; height: 14px; margin-top: 2px; border: 1.6px solid var(--ink); display: block;
}
.presets button:hover { color: var(--pen-red); }
.presets button.is-ticked::before {
  border-color: var(--ink);
  background:
    linear-gradient(45deg, transparent 44%, var(--pen-blue) 44% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 44%, var(--pen-blue) 44% 58%, transparent 58%);
}
.form__foot { display: flex; justify-content: space-between; align-items: end; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--ink); padding-top: 12px; font-family: var(--f-form); font-weight: 700; font-size: 15px; }
.sig { font-family: var(--f-pen); font-weight: 400; font-size: 25px; color: var(--pen-blue); margin-left: 6px; }
.btn-file {
  padding: 11px 20px 10px; background: var(--ink); color: var(--form);
  font-family: var(--f-form); font-weight: 700; font-size: 17px; letter-spacing: .04em;
  box-shadow: 0 4px 0 #000; transition: transform .07s, box-shadow .07s;
}
.btn-file:hover { background: var(--scarlet); box-shadow: 0 4px 0 var(--scarlet-deep); }
.btn-file:active { transform: translateY(4px); box-shadow: 0 0 0 #000; }
.btn-file[disabled] { opacity: .6; cursor: progress; }

.printer { position: relative; min-width: 0; }
.printer__head {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
  background: linear-gradient(180deg, #2f393a, #15191a);
  color: #aeb4a9; font-family: var(--f-form); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  border-radius: 4px 4px 2px 2px; box-shadow: 0 6px 12px rgba(0,0,0,.4);
}
.printer__slot { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 4px; background: #050606; border-radius: 3px; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #5aff7a; box-shadow: 0 0 8px #5aff7a; }
.is-printing .led { background: var(--lamp); box-shadow: 0 0 10px var(--lamp); animation: blink .22s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.printer__feed { margin-inline: 16px; overflow: hidden; padding-bottom: 10px; }
.report {
  position: relative; background: var(--form-can); color: var(--ink);
  padding: 22px 22px 18px; min-height: 420px;
  box-shadow: 0 6px 14px rgba(0,0,0,.3);
  background-image: repeating-linear-gradient(transparent 0 25px, rgba(20,25,27,.05) 25px 26px);
}
.report.is-feeding { animation: feed .45s steps(9, end) both; }
@keyframes feed { from { transform: translateY(-104%); } }
.report__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 12px; font-size: 15px; }
.report dl { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 7px 12px; font-size: 15.5px; line-height: 1.34; }
.report dt { font-family: var(--f-form); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 12.5px; padding-top: 3px; }
.report dd { min-height: 1.3em; overflow-wrap: anywhere; }
.sev { letter-spacing: .05em; font-family: var(--f-type); color: var(--pen-red); }
.report__foot { margin-top: 14px; font-family: var(--f-form); font-size: 14px; color: var(--ink-soft); padding-right: 40%; }
.caret::after { content: "\2588"; animation: blink .7s steps(2) infinite; }

.stamp {
  position: absolute; right: 18px; bottom: 16px;
  padding: .14em .5em .1em; border: 4px solid currentColor; border-radius: 4px;
  color: var(--pen-red); text-align: center;
  font-family: var(--f-form); font-weight: 700; font-size: 25px; line-height: 1.05; letter-spacing: .05em; text-transform: uppercase;
  rotate: -9deg; mix-blend-mode: multiply; filter: url(#ink); opacity: 0;
}
.stamp small { display: block; font-size: .46em; letter-spacing: .06em; }
.stamp--on { opacity: .92; }
.stamp.is-slam { animation: slam .24s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes slam { from { transform: scale(2.6); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1); opacity: .92; } }
.is-thud { animation: thud .2s linear; }
@keyframes thud { 25% { transform: translate(1px, 3px); } 60% { transform: translate(-1px, -1px); } }

.report__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 14px 16px 0; }
.report__actions[hidden] { display: none; }
.report__actions p { flex-basis: 100%; font-family: var(--f-form); font-size: 14px; color: #d9def7; }
.btn-send {
  padding: 10px 18px 9px; background: var(--lamp); color: var(--ink); text-decoration: none;
  font-family: var(--f-form); font-weight: 700; font-size: 17px; letter-spacing: .03em;
  box-shadow: 0 4px 0 #a76e00;
}
.btn-send:hover { background: #ffd071; }
.btn-send:active { transform: translateY(4px); box-shadow: none; }
.btn-ghost {
  padding: 9px 14px 8px; border: 2px solid currentColor;
  font-family: var(--f-form); font-weight: 600; font-size: 15px;
}
.btn-ghost:hover { background: rgba(255,255,255,.14); }

/* ═════════ B2 ═════════ */
.f-b2 {
  background: var(--cork-tex), linear-gradient(180deg, #bb8c58, #a97a48);
  padding-block: var(--top) clamp(40px, 5vw, 64px);
  box-shadow: inset 0 18px 30px -18px rgba(0,0,0,.5), inset 0 -18px 30px -18px rgba(0,0,0,.45);
}
.f-b2__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 40px; margin-bottom: 26px; }
.ransom { font-weight: 400; font-size: clamp(2.05rem, 5.4vw, 4.5rem); line-height: 1.32; }
.rw { display: inline-block; white-space: nowrap; margin-right: .22em; }
.ransom i {
  display: inline-block; font-style: normal; padding: 0 .12em; margin: 0 .012em;
  background: var(--form); color: var(--ink);
  font-family: var(--f-poster); box-shadow: 1px 2px 2px rgba(0,0,0,.34);
}
.ransom i:nth-child(3n)   { background: var(--ink); color: var(--form); font-family: var(--f-form); font-weight: 700; rotate: -4deg; }
.ransom i:nth-child(4n+1) { background: var(--form-can); font-family: var(--f-type); font-weight: 700; rotate: 3deg; }
.ransom i:nth-child(5n)   { background: var(--scarlet); color: var(--form); rotate: -2deg; translate: 0 3px; }
.ransom i:nth-child(7n+2) { background: var(--cobalt); color: var(--form); font-family: var(--f-form); rotate: 5deg; }
.ransom i:nth-child(11n)  { background: var(--form-pink); color: var(--ink); font-family: var(--f-poster); rotate: -6deg; }
.rw:nth-child(2) i:first-child { background: var(--scarlet); color: var(--form); font-family: var(--f-poster); rotate: -3deg; }
.rw:nth-child(2) i:last-child { background: var(--ink); color: var(--form); font-family: var(--f-form); rotate: 3deg; }
.rw:nth-child(4) i:first-child { background: var(--form); color: var(--ink); font-family: var(--f-poster); rotate: -2deg; }
.rw:nth-child(4) i:last-child { background: var(--scarlet); color: var(--form); font-family: var(--f-form); rotate: 5deg; }
.pencilled { font-family: var(--f-pen); font-size: 29px; line-height: 1.02; color: var(--ink); max-width: 28ch; }

.board { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 22px; align-items: start; }
#yarn { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
.ev {
  position: relative; z-index: 3; min-width: 0;
  padding: 26px 18px 16px; rotate: var(--r, 0deg);
  box-shadow: 2px 4px 10px rgba(30, 14, 0, .42);
  transition: box-shadow .15s;
}
.ev h3 { font-family: var(--f-form); font-weight: 700; font-size: 21px; line-height: 1.08; margin-bottom: 6px; }
.ev p { font-size: 15.5px; line-height: 1.36; }
.pin {
  position: absolute; left: 50%; top: 7px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; z-index: 5;
  background: radial-gradient(circle at 36% 30%, #ff9a8e 0, var(--scarlet) 44%, #6d0a0a 100%);
  box-shadow: 2px 4px 3px rgba(0,0,0,.45);
}
.pin--y { background: radial-gradient(circle at 36% 30%, #fff0a8 0, var(--mustard) 46%, #8a6200 100%); }
.pin--b { background: radial-gradient(circle at 36% 30%, #a7b9ff 0, var(--cobalt) 46%, #0c1e74 100%); }
.pin--w { background: radial-gradient(circle at 36% 30%, #fff 0, #cfd2c8 46%, #6d7169 100%); }
.is-draggable { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.is-dragging { cursor: grabbing; z-index: 8; box-shadow: 10px 20px 24px rgba(30, 14, 0, .46); }

.ev-suspect { grid-column: 1 / -1; justify-self: center; width: min(250px, 74%); padding: 12px 12px 12px; background: #f6f5ee; }
.ev-suspect .pin { top: -8px; }
.suspect__photo {
  aspect-ratio: 1 / .92; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(circle at 50% 118%, #06080a 0 44%, transparent 44.6%),
    radial-gradient(circle at 50% 42%, #06080a 0 17%, transparent 17.6%),
    radial-gradient(ellipse at 30% 20%, #4d5a5b, #1f2729 70%);
}
.suspect__photo span { font-family: var(--f-poster); font-size: 88px; line-height: 1; color: #f4c20d; translate: 0 -8%; }
.ev-suspect figcaption { font-family: var(--f-pen); font-size: 33px; line-height: .96; text-align: center; padding-top: 8px; color: var(--pen-blue); }
.ev-suspect figcaption small { display: block; font-size: 22px; color: var(--ink-soft); }

.ev-index {
  background:
    linear-gradient(transparent 51px, var(--pen-red) 51px 52.5px, transparent 52.5px),
    repeating-linear-gradient(transparent 0 22px, #a9bfd4 22px 23px) 0 54px,
    #fdfbf2;
}
.ev-index h3 { line-height: 22px; margin-bottom: 7px; }
.ev-index p { line-height: 23px; }
.ev-receipt {
  background: #fbfbf6; padding-bottom: 28px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), 95% 100%, 90% calc(100% - 9px), 85% 100%, 80% calc(100% - 9px), 75% 100%, 70% calc(100% - 9px), 65% 100%, 60% calc(100% - 9px), 55% 100%, 50% calc(100% - 9px), 45% 100%, 40% calc(100% - 9px), 35% 100%, 30% calc(100% - 9px), 25% 100%, 20% calc(100% - 9px), 15% 100%, 10% calc(100% - 9px), 5% 100%, 0 calc(100% - 9px));
  font-family: var(--f-type);
}
.ev-receipt h3 { font-family: var(--f-type); text-align: center; border-bottom: 1.6px dashed var(--ink); padding-bottom: 6px; font-size: 19px; }
.ev-receipt li { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; line-height: 1.5; }
.ev-receipt__foot { text-align: center; border-top: 1.6px dashed var(--ink); margin-top: 6px; padding-top: 5px; font-size: 13px !important; }
.ev-sticky { background: linear-gradient(170deg, #fcec8c, #f6dd59); border-bottom-right-radius: 40px 8px; }
.ev-sticky h3, .ev-sticky p { font-family: var(--f-pen); }
.ev-sticky h3 { font-size: 34px; font-weight: 400; }
.ev-sticky p { font-size: 24.5px; line-height: 1.02; }
.ev-napkin {
  background: #f8f5ec;
  outline: 1px dashed rgba(26, 63, 208, .3); outline-offset: -8px;
}
.ev-napkin h3, .ev-napkin p { font-family: var(--f-pen); color: var(--pen-blue); }
.ev-napkin h3 { font-size: 35px; font-weight: 400; }
.ev-napkin p { font-size: 25px; line-height: 1.02; }
.ev-napkin svg { width: 100%; margin: 2px 0 4px; }
.ev-graph {
  background:
    linear-gradient(rgba(26,63,208,.2) 1px, transparent 1px) 0 0 / 100% 14px,
    linear-gradient(90deg, rgba(26,63,208,.2) 1px, transparent 1px) 0 0 / 14px 100%,
    #fbfbf4;
}
.ev-graph svg { width: 100%; }
.ev-tag {
  background: var(--manila);
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 100%, 0 100%, 0 10%);
}
.ev-torn {
  background: repeating-linear-gradient(transparent 0 24px, #9fc3dc 24px 25px) 0 22px, #fcfcf6;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 96% 98%, 90% 100%, 84% 97%, 77% 100%, 70% 98%, 62% 100%, 54% 97%, 46% 100%, 38% 98%, 30% 100%, 22% 97%, 14% 100%, 7% 98%, 0 100%);
  padding-bottom: 24px;
}
.ev-torn p { line-height: 25px; }
.ev-env {
  background: var(--kraft);
  border: 8px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--scarlet) 0 12px, var(--form) 12px 24px, var(--cobalt) 24px 36px, var(--form) 36px 48px) 12;
  background-clip: padding-box;
}
.ev-any { background: var(--form-pink); }

@media (min-width: 1000px) {
  .board { display: block; height: 972px; }
  #yarn { z-index: 4; }
  .ev { position: absolute; width: var(--w, 25%); }
  .ev-suspect { z-index: 5; }
  .ev-index .pin   { left: auto; right: 12px; top: auto; bottom: 10px; }
  .ev-receipt .pin { top: auto; bottom: 18px; }
  .ev-sticky .pin  { left: 22px; top: auto; bottom: 10px; }
  .ev-napkin .pin  { left: auto; right: 10px; top: 46%; }
  .ev-graph .pin   { left: 18px; top: 46%; }
  .ev-tag .pin     { left: auto; right: 22px; }
  .ev-suspect { left: 38%;  top: 330px; width: 24%; min-width: 220px; }
  .ev-index   { left: 0;    top: 8px;   --w: 26.5%; }
  .ev-receipt { left: 33%;  top: 0;     --w: 22%; }
  .ev-sticky  { left: 62%;  top: 22px;  --w: 23%; }
  .ev-napkin  { left: 2%;   top: 352px; --w: 28%; }
  .ev-graph   { left: 70%;  top: 318px; --w: 27%; }
  .ev-tag     { left: 0;    top: 758px; --w: 21%; }
  .ev-torn    { left: 25%;  top: 700px; --w: 24.5%; }
  .ev-env     { left: 53%;  top: 722px; --w: 25%; }
  .ev-any     { left: 81%;  top: 690px; --w: 19%; }
}

/* ═════════ B3 ═════════ */
.f-b3 {
  background: var(--enamel); color: #e8e4cf;
  padding-block: var(--top) var(--bot);
}
.f-b3__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 40px; align-items: end; margin-bottom: 30px; }
.console {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px);
  padding: clamp(18px, 3vw, 38px);
  background: linear-gradient(160deg, #35594d, #24443a 55%, #1c362f);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 -2px 0 rgba(0,0,0,.4) inset, 0 16px 34px rgba(0,0,0,.42);
}
.console.is-touched { animation: tilt 2.6s cubic-bezier(.4,1.6,.5,1) both; transform-origin: 8% 0; }
@keyframes tilt { 0%, 100% { rotate: 0deg; } 12%, 84% { rotate: 1.8deg; } 94% { rotate: -.5deg; } }
.rivet { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e4e7df, #79827c 60%, #333b38); box-shadow: 0 1px 1px rgba(0,0,0,.6); }
.r1 { left: 10px; top: 10px; } .r2 { right: 10px; top: 10px; } .r3 { left: 10px; bottom: 10px; } .r4 { right: 10px; bottom: 10px; }

.meter {
  position: relative; padding: 6px 6px 0; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #fbe6a2, #f4cf6b);
  box-shadow: inset 0 0 0 3px #111, inset 0 4px 16px rgba(120, 70, 0, .5), 0 0 0 5px #39433f, 0 2px 0 6px rgba(255,255,255,.08);
  overflow: hidden;
}
#meter { display: block; width: 100%; height: auto; }
#meter .tick { stroke: var(--ink); stroke-width: 1.6; }
#meter .tick.major { stroke-width: 3.2; }
#meter .arc { fill: none; stroke: var(--ink); stroke-width: 2; }
#meter .arc-red { fill: none; stroke: var(--pen-red); stroke-width: 10; }
#meter text { font-family: var(--f-form); font-weight: 700; font-size: 19px; fill: var(--ink); letter-spacing: .03em; }
#meter .lab-red { fill: var(--pen-red); }
#meter .needle { stroke: #16110d; stroke-width: 3.6; stroke-linecap: round; }
#meter .hub { fill: #15110e; }
#meter .shadow { stroke: rgba(70, 40, 0, .26); stroke-width: 5; stroke-linecap: round; }
.meter__maker { position: absolute; right: 16px; bottom: 12px; text-align: right; pointer-events: none; font-family: var(--f-form); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(20,25,27,.62); }

.controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(14px, 2.4vw, 30px); align-items: center; margin-top: 26px; }
.engrave { font-family: var(--f-form); font-weight: 600; font-size: 12.5px; letter-spacing: .13em; text-transform: uppercase; color: #dfd9bd; text-shadow: 0 -1px 0 rgba(0,0,0,.5); text-align: center; }
.engrave--red { color: #ff9d8c; }
.knobwrap { display: grid; gap: 8px; justify-items: center; }
.knob {
  position: relative; width: 112px; height: 112px; border-radius: 50%; cursor: grab; touch-action: none;
  background: repeating-conic-gradient(#0d1011 0 4deg, #434a4b 4deg 8deg);
  box-shadow: 0 6px 12px rgba(0,0,0,.55), 0 0 0 4px rgba(0,0,0,.28);
}
.knob:active { cursor: grabbing; }
.knob__cap {
  position: absolute; inset: 11px; border-radius: 50%;
  background:
    conic-gradient(from 12deg, #eef0ea, #9aa19d 14%, #e8ebe4 27%, #8d9591 42%, #f3f5ef 55%, #949c98 69%, #e4e7e0 83%, #eef0ea);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.8), inset 0 -2px 5px rgba(0,0,0,.4);
}
.knob__cap i { position: absolute; left: 50%; top: 4px; width: 5px; height: 24px; margin-left: -2.5px; background: var(--scarlet); border-radius: 2px; }
.minis { display: grid; gap: 12px; }
.mini .engrave { text-align: left; margin-bottom: 4px; }
.bar { height: 11px; background: #0d1312; border-radius: 2px; overflow: hidden; box-shadow: inset 0 1px 2px #000; }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--lamp) 0 6px, transparent 6px 8px); }
.bar--z i { background: repeating-linear-gradient(90deg, #ff5a4a 0 6px, transparent 6px 8px); transition: width .4s; }
.dnt { display: grid; justify-items: center; gap: 8px; padding: 10px 12px 8px; border: 2px dashed rgba(255, 157, 140, .6); border-radius: 4px; }
.toggle {
  position: relative; width: 30px; height: 56px; border-radius: 15px;
  background: linear-gradient(90deg, #0b0e0e, #2c3233 50%, #0b0e0e);
  box-shadow: inset 0 2px 5px #000, 0 0 0 3px #6d7770;
}
.toggle i {
  position: absolute; left: 3px; right: 3px; top: 3px; height: 26px; border-radius: 13px;
  background: radial-gradient(circle at 40% 28%, #fff, #b7bdb9 56%, #5d6461);
  box-shadow: 0 3px 4px rgba(0,0,0,.6);
  transition: transform .12s cubic-bezier(.3,1.7,.6,1);
}
.toggle[aria-checked="true"] i { transform: translateY(24px); }

.regimes { display: grid; gap: 6px; align-content: start; min-width: 0; }
.regimes li { background: rgba(5, 15, 12, .35); border-radius: 3px; box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
.regimes button { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 1px 10px; align-items: center; width: 100%; text-align: left; padding: 9px 12px 8px; }
.regimes__sym { grid-column: 2 / 4; font-family: var(--f-form); font-size: 14px; letter-spacing: .01em; color: #b6c2b0; }
.regimes b { grid-column: 2; font-family: var(--f-poster); font-weight: 400; font-size: clamp(19px, 2vw, 24px); line-height: 1.1; color: #f4efd9; }
.regimes small { grid-column: 3; grid-row: 2; font-family: var(--f-form); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--lamp); white-space: nowrap; }
.lamp { grid-row: 1 / 3; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 40% 32%, #5a4b2c, #2a2312); box-shadow: 0 0 0 2px #0c1110; }
.regimes li.is-live .lamp { background: radial-gradient(circle at 40% 32%, #fff0c0, var(--lamp) 60%, #c47d00); box-shadow: 0 0 0 2px #0c1110, 0 0 14px 2px rgba(255,182,39,.8); }
.regimes li:last-child.is-live .lamp, .regimes li:nth-child(4).is-live .lamp { background: radial-gradient(circle at 40% 32%, #ffd5cc, #ff4a35 60%, #b31308); box-shadow: 0 0 0 2px #0c1110, 0 0 14px 2px rgba(255,74,53,.85); animation: blink .8s steps(2) infinite; }
.regimes p { display: none; padding: 0 12px 11px 40px; font-size: 15px; line-height: 1.36; color: #e8e4cf; }
.regimes li.is-live p { display: block; }
.regimes li.is-live { background: rgba(5, 15, 12, .6); }

/* ═════════ B4 ═════════ */
.f-b4 { background: var(--canary); padding-block: var(--top) var(--bot); overflow: hidden; }
.f-b4__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(26px, 5vw, 70px); align-items: start; }
.f-b4__side { display: grid; gap: 18px; justify-items: start; position: relative; }
.btn-black {
  padding: 10px 16px 9px; background: var(--ink); color: var(--canary);
  font-family: var(--f-form); font-weight: 700; font-size: 16px; letter-spacing: .03em;
  box-shadow: 4px 4px 0 var(--scarlet);
}
.btn-black:hover { translate: 1px 1px; box-shadow: 3px 3px 0 var(--scarlet); }
.hand { font-family: var(--f-pen); font-size: 28px; line-height: 1; }
.hand--note { color: var(--pen-red); rotate: -2deg; }

.memo { position: relative; background: var(--form); padding: clamp(18px, 3vw, 40px); box-shadow: 3px 6px 0 rgba(20,25,27,.14), 0 12px 26px rgba(90, 70, 0, .28); rotate: .4deg; min-width: 0; }
.memo__mast { font-family: var(--f-poster); font-size: clamp(22px, 3vw, 34px); line-height: 1; margin-bottom: 12px; }
.memo__head dl { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 1px 8px; border-block: 2px solid var(--ink); padding-block: 8px; margin-bottom: 20px; font-size: 16px; }
.memo__head dt { font-weight: 700; }
.memo__steps { counter-reset: step; display: grid; gap: 18px; }
.memo__steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 4px; }
.memo__steps li::before { content: counter(step) "."; grid-row: 1 / 3; font-family: var(--f-poster); font-size: 32px; line-height: 1; }
.memo__steps h3 { font-family: var(--f-type); font-weight: 700; font-size: 19px; line-height: 1.5; }
.memo__steps p { font-size: 16.5px; line-height: 1.55; }
.bar-x { line-height: 1.7; }
.bar-x .w { position: relative; display: inline-block; cursor: crosshair; }
.bar-x .w::after {
  content: ""; position: absolute; inset: -1px -5px -1px -3px; background: var(--ink); transform-origin: 100% 50%;
  transition: transform .22s ease-out; filter: url(#marker);
}
.bar-x .w.is-off::after { transform: scaleX(0); }
.bar-x .w.is-off { color: var(--pen-red); cursor: default; }
html:not(.js) .bar-x .w::after { display: none; }
.stamp--blue { color: var(--pen-blue); right: 16px; bottom: auto; top: 18px; rotate: 8deg; font-size: 24px; }
.stamp--blue.stamp--on { opacity: .9; }

/* ═════════ B5 ═════════ */
.f-b5 { background: var(--salmon); padding-block: var(--top) var(--bot); }
.f-b5__grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(24px, 5vw, 70px); align-items: start; }
.f-b5__side { display: grid; gap: 16px; justify-items: start; }
.unlisted {
  margin-top: 14px; padding: 16px 18px 14px; max-width: 320px; background: var(--form); rotate: -1.4deg;
  background-image: linear-gradient(transparent 38px, var(--pen-red) 38px 39.5px, transparent 39.5px);
  box-shadow: 2px 5px 10px rgba(90, 30, 20, .3); font-size: 16px; line-height: 1.36;
}
.unlisted b { display: block; font-family: var(--f-form); letter-spacing: .02em; margin-bottom: 8px; line-height: 20px; }
.unlisted a { font-weight: 700; text-underline-offset: 3px; }
.cabinet {
  position: relative; padding: 0 14px;
  background: linear-gradient(90deg, #4c574f, #66726a 12%, #6d7a71 50%, #5e6a62 88%, #454f48);
  box-shadow: 8px 14px 24px rgba(70, 20, 10, .42);
}
.cabinet__cap {
  height: 30px; margin: 0 -14px 10px; display: grid; place-items: center;
  background: linear-gradient(180deg, #8b988f, #5c675f); box-shadow: 0 3px 5px rgba(0,0,0,.3);
  font-family: var(--f-form); font-weight: 600; font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: #dfe3d6;
}
.cabinet__base { height: 18px; margin: 10px -14px 0; background: linear-gradient(180deg, #2c3430, #171c1a); }
.drawer { position: relative; margin-bottom: 10px; }
.drawer h3 { font-weight: 400; }
.drawer button {
  position: relative; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) 96px; gap: 14px; align-items: center;
  width: 100%; min-height: 84px; padding: 12px 16px; text-align: left;
  background: linear-gradient(180deg, #7f8c83, #6a776e 46%, #606c64);
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 -2px 0 rgba(0,0,0,.26) inset, 0 3px 5px rgba(0,0,0,.34);
  transition: transform .28s cubic-bezier(.2,.9,.3,1.1), box-shadow .2s;
  transform-origin: 50% 100%;
}
.drawer button:hover { transform: translateY(2px) scale(1.008); }
.drawer.is-open button { transform: scale(1.03); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 -2px 0 rgba(0,0,0,.26) inset, 0 12px 16px rgba(0,0,0,.45); }
.drawer__label {
  padding: 5px 9px 4px; background: var(--form); color: var(--ink);
  font-family: var(--f-form); font-weight: 700; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 0 0 2px #2e3632, 0 0 0 3px #a9b3ab;
}
.drawer__title { font-family: var(--f-poster); font-size: clamp(19px, 2.3vw, 27px); line-height: 1.08; color: #f6f3e3; text-shadow: 0 2px 1px rgba(0,0,0,.42); }
.drawer__pull { height: 22px; border-radius: 3px; background: linear-gradient(180deg, #eef0ea, #9aa29d 52%, #5c645f); box-shadow: 0 4px 4px rgba(0,0,0,.45); }
.drawer__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s cubic-bezier(.2,.9,.3,1); }
.drawer.is-open .drawer__body { grid-template-rows: 1fr; }
.drawer__body > div { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility .32s; }
.drawer.is-open .drawer__body > div { visibility: visible; }
.folder {
  position: relative; display: grid; gap: 8px; margin: 18px 14px 12px; padding: 16px 18px 16px;
  background: var(--manila); font-size: 16px; line-height: 1.42;
  box-shadow: 0 -2px 0 rgba(255,255,255,.3) inset, 0 3px 6px rgba(0,0,0,.3);
}
.folder::before { content: ""; position: absolute; left: 18px; top: -12px; width: 120px; height: 12px; background: var(--manila); clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); }

/* ═════════ B6 ═════════ */
.f-b6 { background: var(--mustard); padding-block: var(--top) var(--bot); }
.f-b6__head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px 40px; align-items: end; margin-bottom: 34px; }
.f-b6__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(26px, 4vw, 56px); align-items: start; }
.org { display: grid; justify-items: center; gap: 28px; font-family: var(--f-form); position: relative; }
.org__box { position: relative; background: var(--form); border: 2.5px solid var(--ink); padding: 9px 10px 7px; text-align: center; min-width: 0; box-shadow: 3px 3px 0 var(--ink); }
.org__note { font-family: var(--f-pen); font-size: 30px; line-height: 1; rotate: -1.4deg; color: var(--ink); max-width: 30ch; text-align: center; }
.org__box b { display: block; font-size: 16px; line-height: 1.1; }
.org__box small { display: block; font-size: 13.5px; line-height: 1.2; margin-top: 2px; }
.org__box--top { padding: 12px 26px 10px; background: var(--ink); color: var(--form); box-shadow: 3px 3px 0 var(--scarlet); }
.org__box--top b { font-family: var(--f-poster); font-weight: 400; font-size: 26px; }
.org__row { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
.org__row::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: -14px; border-top: 2.5px solid var(--ink); }
.org__row .org__box::before { content: ""; position: absolute; left: 50%; top: -17px; height: 14px; border-left: 2.5px solid var(--ink); }
.org__link { display: inline-block; margin-top: 5px; font-weight: 700; font-size: 15px; color: var(--lamp); text-underline-offset: 3px; }
.org__link:hover { color: var(--form); }
.org__box--top::after { content: ""; position: absolute; left: 50%; bottom: -19px; height: 14px; border-left: 2.5px solid var(--ink); }
.org__box--intern { border-style: dashed; rotate: -1.2deg; }
.org__box--intern::before { content: ""; position: absolute; left: 50%; top: -22px; height: 18px; border-left: 2.5px dashed var(--ink); }

.register {
  background: var(--form);
  background-image: linear-gradient(90deg, transparent 37%, rgba(210,20,20,.4) 37%, rgba(210,20,20,.4) calc(37% + 1.5px), transparent calc(37% + 1.5px));
  padding: 16px 18px 12px; box-shadow: 3px 7px 16px rgba(90, 50, 0, .4); rotate: .6deg; min-width: 0;
}
.register h3 { font-family: var(--f-form); font-weight: 700; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; }
.register h3 small { display: block; font-weight: 400; font-size: 14px; letter-spacing: .01em; text-transform: none; color: var(--ink-soft); }
.register table { width: 100%; border-collapse: collapse; margin-top: 10px; table-layout: fixed; }
.register th { font-family: var(--f-form); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; text-align: left; padding: 3px 12px 3px 0; border-bottom: 2px solid var(--ink); }
.register th:first-child { width: 37%; }
.register td { padding: 7px 12px 5px 0; border-bottom: 1px solid #a9bfd4; vertical-align: bottom; }
.register td:first-child { font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.register td + td { padding-left: 12px; font-family: var(--f-pen); font-size: 27px; line-height: .98; color: var(--pen-blue); }
.register td.r2 { color: var(--ink); } .register td.r3 { color: #0d6b4e; } .register td.r4 { color: var(--pen-red); }

/* ═════════ B7 ═════════ */
.f-b7 { background: var(--scarlet); color: #fff6ea; padding-top: var(--top); }
.f-b7__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(26px, 5vw, 64px); align-items: center; padding-bottom: clamp(44px, 6vw, 80px); }
.f-b7__copy { display: grid; gap: 18px; min-width: 0; }
.address { display: grid; gap: 4px; justify-items: start; margin-top: 6px; }
.address__lab { font-family: var(--f-form); font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.address__mail { font-family: var(--f-poster); font-size: clamp(1.7rem, 4.5vw, 3.5rem); line-height: 1.1; overflow-wrap: anywhere; }
.address__mail a { text-decoration-thickness: 3px; text-underline-offset: 6px; }
.address__mail a:hover { color: var(--canary); }
.btn-ghost--light { margin-top: 10px; }
.breakglass { display: grid; justify-items: center; gap: 12px; }
.glassbox {
  position: relative; width: min(100%, 320px); aspect-ratio: 1 / 1.08;
  padding: 16px; background: linear-gradient(145deg, #e23a33, #9c1216);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 8px 14px 26px rgba(50, 0, 0, .5);
}
.glassbox__inside {
  position: absolute; inset: 16px; display: grid; place-content: center; gap: 6px; text-align: center; text-decoration: none;
  background: var(--ink); color: var(--form); font-family: var(--f-form);
  box-shadow: inset 0 6px 14px #000;
}
.glassbox:not(.is-broken) .glassbox__inside { visibility: hidden; }
.glassbox::before, .glassbox::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 5px; z-index: 1;
  background: radial-gradient(circle 2.5px at 2.5px 50%, #e8d0c8 0 2.4px, transparent 2.6px), radial-gradient(circle 2.5px at calc(100% - 2.5px) 50%, #e8d0c8 0 2.4px, transparent 2.6px);
}
.glassbox::before { top: 6px; } .glassbox::after { bottom: 6px; }
.glass__crack { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .08s; pointer-events: none; }
.glass__crack path { fill: none; stroke: rgba(255,255,255,.95); stroke-width: 1.2; }
.glass:hover .glass__crack, .glass:focus-visible .glass__crack { opacity: 1; }
.glassbox__inside b { font-family: var(--f-poster); font-weight: 400; font-size: 34px; line-height: 1; color: var(--canary); }
.glassbox__inside small { font-size: 14px; }
.glass {
  position: absolute; inset: 16px; display: grid; place-items: center; text-align: center; z-index: 2;
  background:
    linear-gradient(125deg, rgba(255,255,255,.55) 0 12%, rgba(255,255,255,.08) 12.5% 40%, rgba(255,255,255,.3) 40.5% 46%, rgba(255,255,255,.07) 46.5%),
    #cfe3e4;
  color: var(--scarlet-deep); font-family: var(--f-form); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 17px; line-height: 1.2;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55);
}
.glass b { font-family: var(--f-poster); font-weight: 400; font-size: 42px; line-height: 1; letter-spacing: 0; text-transform: none; display: block; color: var(--scarlet); }
.glass.is-gone { visibility: hidden; }
.shards { position: absolute; inset: 16px; z-index: 3; pointer-events: none; }
.shards i { position: absolute; inset: 0; background: rgba(214, 233, 234, .92); }
.fine--light { color: #ffe0d6; }

.foot { background: var(--ink); color: #c6c8bb; font-family: var(--f-form); font-size: 14.5px; padding-block: 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
.foot__row { display: flex; flex-wrap: wrap; gap: 8px 30px; justify-content: space-between; align-items: center; }
.foot__up { color: var(--lamp); text-underline-offset: 3px; }

/* ───────── Tablet ───────── */
@media (max-width: 999px) {
  .f-b4__grid, .f-b5__grid, .f-b7__grid, .console, .f-b6__grid { grid-template-columns: minmax(0, 1fr); }
  .lift {
    top: auto; bottom: 0; left: 0; right: 0; transform: none; flex-direction: row; justify-content: center; gap: 3px;
    padding: 5px max(6px, env(safe-area-inset-right, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    border-radius: 0;
  }
  .lift i { width: 32px; height: 32px; box-shadow: 0 0 0 1.5px #c9ced0, 0 1px 2px 1px rgba(0,0,0,.4); }
  .lift span { display: none; }
  .lift__sound { margin-top: 0; }
  .foot { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .darkhint { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}

/* ───────── Phone ───────── */
@media (max-width: 759px) {
  body { font-size: 16px; }
  .plate { padding: 6px 8px 5px 7px; }
  .plate__word { font-size: 14px; }
  .plate__brand svg { width: 24px; height: 24px; }
  #dial { width: 78px; height: 40px; }
  .f-g { background: linear-gradient(180deg, var(--mint) 0, var(--mint) calc(100% - 330px), var(--ink) calc(100% - 330px), var(--ink) calc(100% - 325px), var(--mint-deep) calc(100% - 325px)); }
  .f-g__grid { grid-template-columns: minmax(0, 1fr); padding-top: 104px; }
  .poster { font-size: 13.8vw; }
  .floor { --top: 118px; }
  .desk { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; padding-top: 6px; gap: 8px 14px; }
  .clock { grid-column: 2; grid-row: 1; flex-direction: column; text-align: center; }
  .dispenser { grid-column: 1; grid-row: 1 / 3; }
  .noqueue { grid-column: 2; grid-row: 2; }
  .notices__row, .f-b1__head, .f-b3__head, .f-b6__head, .intake { grid-template-columns: minmax(0, 1fr); }
  .notice { min-height: 0; translate: none !important; }
  .presets { grid-template-columns: minmax(0, 1fr); }
  .report dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .report dd { margin-bottom: 6px; }
  .report__foot { padding-right: 46%; }
  .printer__feed { margin-inline: 8px; }
  .slab { gap: 2px 16px; font-size: 12.5px; }
  .board { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .ev { justify-self: center; width: min(100%, 340px); }
  .ev-suspect { width: min(236px, 68%); }
  .controls { grid-template-columns: auto minmax(0, 1fr); }
  .knob { width: 96px; height: 96px; }
  .dnt { grid-column: 1 / -1; grid-template-columns: auto 1fr; justify-self: start; align-items: center; }
  .org__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
  .org__row::before, .org__row .org__box::before { display: none; }
  .org__box--top::after, .org__box--intern::before { display: none; }
  .drawer button { grid-template-columns: auto minmax(0, 1fr); }
  .drawer__pull { display: none; }
  .register { padding-inline: 12px; }
  .only-fine { display: none; }
  .memo__steps li { grid-template-columns: 34px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (pointer: fine) { .only-touch { display: none; } }
