/* Whiteboard (v4.2; internal name orange-corkboard). A realistic magnetic whiteboard fills the whole viewport: glossy melamine,
   brushed aluminium frame and marker tray, round magnets and hanging strings. All art is procedural (whiteboard.js + CSS). */
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/AtkinsonHyperlegibleNext.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("fonts/PixelifySans.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
:root {
  --ink: #f4f6f8; --ink-soft: #cfd5dc; --orange: #ff9f2e; --paper-ink: #24170e; --paper-soft: #4a3424; --link-ink: #7a2408;
  --panel: #1d2026; --line: #6f7884; --field: #101216; --board-ink: #1b1e23;
  --display: "Pixelify Sans", "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --ui: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --news: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", "Liberation Serif", "DejaVu Serif", serif;
  --inv: 1;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { overflow: hidden; background: #cdc8bf; color: var(--ink); font: 17px/1.5 var(--ui); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
a { color: #ffd98c; text-underline-offset: 3px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
:focus-visible { outline: 3px solid #ffe08a; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(0, 0, 0, .8); }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 300; background: #fff; color: #15171a; padding: 10px 14px; font-weight: 700; } .skip:focus { top: 8px; }
.noscript { position: fixed; inset: 20px; z-index: 400; background: var(--panel); padding: 14px; }

/* ---- the board: full viewport, nothing around it ---- */
#board { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none; }
#board.panning { cursor: grabbing; }
#board:focus-visible { outline: none; box-shadow: none; }
#world { position: absolute; left: 0; top: 0; width: 4000px; height: 2600px; transform-origin: 0 0; background-color: #e9ebea; }
#world.moving { will-change: transform; }          /* GPU layer only while the view moves; dropped at rest so everything re-renders sharp */
#world.smooth { transition: transform .18s ease-out; }
#itemLayer, #pinLayer { position: absolute; left: 0; top: 0; width: 4000px; height: 2600px; pointer-events: none; z-index: 1; }
#itemLayer > *, #pinLayer > * { pointer-events: auto; }
#strings { position: absolute; left: 0; top: 0; width: 4000px; height: 2600px; pointer-events: none; overflow: visible; z-index: 1; }

/* melamine surface: cool white, fine speckle, slight falloff toward the frame */
#surface { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  background: var(--wb-noise) 0 0 / 256px 256px, radial-gradient(ellipse 120% 110% at 50% 45%, #eef0ef 0, #e7eae9 55%, #dbdfdf 100%); }
/* reflections of room light: a hot spot and two soft window bands; this layer drifts a little as you pan */
#sheen { position: absolute; left: -600px; top: -600px; width: 5200px; height: 3800px; will-change: transform; pointer-events: none;
  background:
    radial-gradient(ellipse 1100px 520px at 36% 26%, rgba(255, 255, 255, .92) 0, rgba(255, 255, 255, .5) 38%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(ellipse 700px 380px at 78% 30%, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, 0) 70%),
    linear-gradient(108deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .55) 36%, rgba(255, 255, 255, .62) 37.5%, rgba(255, 255, 255, .12) 39.5%, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, .34) 58%, rgba(255, 255, 255, 0) 61.5%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 60%, rgba(120, 128, 138, .07) 100%); }

/* brushed aluminium frame, inside the world so it scales with the board */
#frame { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.fr { position: absolute; }
.fr-top, .fr-bottom { left: 0; right: 0; height: 48px; }
.fr-left, .fr-right { top: 0; bottom: 0; width: 48px; }
.fr-top { top: 0; background: var(--brush-h) 0 0 / 256px 256px, linear-gradient(180deg, #f6f7f9 0, #dde1e5 14%, #c3c9cf 46%, #d4d8dc 74%, #a2a9b0 92%, #6f767d 100%); box-shadow: 0 7px 10px -3px rgba(20, 26, 34, .32), 0 2px 2px rgba(20, 26, 34, .25); }
.fr-bottom { bottom: 0; background: var(--brush-h) 0 0 / 256px 256px, linear-gradient(180deg, #6f767d 0, #a9b0b7 9%, #d9dde1 30%, #c5cbd1 62%, #aeb4bb 88%, #8c939a 100%); }
.fr-left { left: 0; background: var(--brush-v) 0 0 / 256px 256px, linear-gradient(90deg, #f1f3f5 0, #d8dce0 16%, #bec4ca 48%, #cfd3d8 76%, #9aa1a8 92%, #6f767d 100%); box-shadow: 6px 0 9px -3px rgba(20, 26, 34, .26), 2px 0 2px rgba(20, 26, 34, .22); }
.fr-right { right: 0; background: var(--brush-v) 0 0 / 256px 256px, linear-gradient(90deg, #747b82 0, #a4abb2 9%, #d3d7db 28%, #c0c6cc 60%, #aab0b7 88%, #858c93 100%); box-shadow: -2px 0 3px -1px rgba(20, 26, 34, .2); }
.fr-lip { inset: 48px; box-shadow: inset 0 0 0 1px rgba(40, 46, 54, .22), inset 0 1px 0 2px rgba(255, 255, 255, .35); }
.fcap { position: absolute; width: 76px; height: 76px; background: radial-gradient(circle at 34% 30%, #737981 0, #4a4f56 46%, #2b2e33 100%); box-shadow: 3px 5px 9px rgba(0, 0, 0, .35), inset 1px 1px 0 rgba(255, 255, 255, .22), inset -1px -2px 2px rgba(0, 0, 0, .35); }
.fcap::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #9aa0a7, #555a61 60%, #34373c); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .2); }
.fcap-tl { left: 0; top: 0; border-radius: 22px 10px 14px 10px; }
.fcap-tr { right: 0; top: 0; border-radius: 10px 22px 10px 14px; }
.fcap-bl { left: 0; bottom: 0; border-radius: 10px 14px 10px 22px; }
.fcap-br { right: 0; bottom: 0; border-radius: 14px 10px 22px 10px; }
.wb-tray { position: absolute; bottom: 0; filter: drop-shadow(0 -2px 2px rgba(20, 26, 34, .12)) drop-shadow(0 5px 6px rgba(20, 26, 34, .3)); }

/* ---- items ---- */
.item { position: absolute; user-select: none; -webkit-user-select: none; touch-action: none; cursor: grab; outline: none; transform: rotate(var(--rot, 0deg)); color: var(--paper-ink); }
.item.locked { cursor: default; }
.item.dragging { cursor: grabbing; z-index: 99999 !important; filter: drop-shadow(0 22px 18px rgba(20, 26, 34, .3)); }
.item:focus-visible { outline: none; box-shadow: none; }
.item.selected::after { content: ""; position: absolute; inset: -9px; border: 3px solid #ff8a1f; border-radius: 4px; box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(20, 22, 26, .7); pointer-events: none; z-index: 6; }
.item.type-pin.selected::after { inset: -7px; border-radius: 50%; }
.item.pending { opacity: .88; }
.item.pending::before { content: "Waiting for approval"; position: absolute; left: 0; top: -34px; z-index: 7; background: #1d2026; color: #ffe08a; font: 700 15px/1 var(--ui); padding: 5px 9px; border-radius: 3px; white-space: nowrap; pointer-events: none; }
.item.type-pin.pending::before { left: -50px; top: -34px; }

/* paper: real sheets with a tight contact shadow plus a softer lifted shadow under the curling bottom edge */
.sheet { position: relative; }
.paper .sheet::after { content: ""; position: absolute; z-index: -1; left: 7%; right: 7%; bottom: 5px; height: 34%; border-radius: 0 0 45% 45% / 0 0 22% 22%; box-shadow: 0 13px 14px rgba(20, 26, 34, .24); pointer-events: none; }
.paper .sheet::before { content: ""; position: absolute; z-index: -1; inset: 2px 3px; box-shadow: 0 2px 5px rgba(20, 26, 34, .18); pointer-events: none; }

.type-note { --note: #ffbd6e; }
.type-note.c-leaf { --note: #cfe9a3; } .type-note.c-blossom { --note: #ffcadb; } .type-note.c-cream { --note: #fff0bf; }
.type-note .sheet { aspect-ratio: 1 / 1; padding: 30px 18px 14px; display: flex; flex-direction: column;
  background: var(--paper-noise) 0 0 / 192px 192px, linear-gradient(180deg, rgba(0, 0, 0, .045) 0, rgba(0, 0, 0, 0) 16%), linear-gradient(0deg, rgba(70, 35, 0, .11) 0, rgba(70, 35, 0, 0) 13%), linear-gradient(100deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 40%), var(--note);
  box-shadow: 0 1px 1px rgba(20, 26, 34, .16), 0 0 0 .5px rgba(70, 40, 10, .12); }
.type-note p { margin: 0; white-space: pre-wrap; overflow: hidden; overflow-wrap: anywhere; font-size: 21px; line-height: 1.32; flex: 1; }
.type-note .by { flex: none; margin-top: 6px; font-size: 16px; font-weight: 700; color: var(--paper-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.type-image .sheet { padding: 12px 12px 14px; background: var(--paper-noise) 0 0 / 192px 192px, linear-gradient(170deg, #ffffff, #f2f1ed); box-shadow: 0 1px 1px rgba(20, 26, 34, .18), 0 0 0 .5px rgba(0, 0, 0, .08); }
.print { position: relative; background: #d9d6cf; }
.print::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(122deg, rgba(255, 255, 255, .34) 0, rgba(255, 255, 255, .06) 30%, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, .1) 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), inset 0 0 12px rgba(0, 0, 0, .12); }
.type-image img.photo { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.type-image .fcap { margin: 10px 0 0; min-height: 22px; font-size: 18px; font-weight: 600; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.type-image .cap:empty { min-height: 14px; margin: 0; }

/* newspaper clipping: newsprint, serif type, scissor-cut edge (clip-path) so its shadow comes from a filter */
.type-article { filter: drop-shadow(0 1px 1px rgba(20, 26, 34, .2)) drop-shadow(0 7px 7px rgba(20, 26, 34, .14)); }
.type-article .sheet { background: var(--paper-noise) 0 0 / 192px 192px, linear-gradient(0deg, rgba(90, 70, 30, .08), rgba(90, 70, 30, 0) 14%), linear-gradient(168deg, #f7f3e8, #ece5d3); }
.type-article.paper .sheet::after, .type-article.paper .sheet::before { display: none; }
.type-article img.og { display: block; width: calc(100% - 28px); margin: 16px 14px 0; height: auto; max-height: 220px; object-fit: cover; pointer-events: none; -webkit-user-drag: none; filter: saturate(.62) contrast(1.06) sepia(.14); mix-blend-mode: multiply; }
.type-article .tx { padding: 12px 16px 16px; }
.type-article h3 { margin: 0 0 8px; padding-top: 8px; border-top: 2px solid #2c2620; font: 700 22px/1.16 var(--news); color: #1c1712; overflow-wrap: anywhere; }
.type-article .ds { margin: 0 0 8px; font: 16px/1.38 var(--news); color: #3c342a; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.type-article .dm { font-size: 15px; font-weight: 700; color: var(--paper-soft); }

/* link: a ruled index card */
.type-link .sheet { padding: 12px 16px 12px; background: var(--paper-noise) 0 0 / 192px 192px, repeating-linear-gradient(180deg, rgba(255, 255, 255, 0) 0 25px, rgba(70, 120, 200, .34) 25px 26px), linear-gradient(170deg, #fffffb, #f6f5ef); box-shadow: 0 1px 1px rgba(20, 26, 34, .18), 0 0 0 .5px rgba(0, 0, 0, .08); }
.type-link .lt { margin: 0 0 6px; padding: 4px 0 6px; border-bottom: 2px solid rgba(214, 64, 58, .75); font-size: 19px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.type-link .dm, .type-article .dm { margin: 0; }
.item a.open { color: var(--link-ink); font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }

/* ---- magnets: glossy domed discs (CSS gradients, sharp at any zoom) ---- */
.mag { --m: 44px; position: absolute; left: 0; top: 0; width: var(--m); height: var(--m); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 36% 30%, var(--m1) 0, var(--m2) 28%, var(--m3) 72%, var(--m4) 100%);
  box-shadow: inset 0 calc(var(--m) * -.07) calc(var(--m) * .09) rgba(255, 255, 255, .26), inset 0 0 0 1px rgba(0, 0, 0, .22),
    0 1px 1px rgba(10, 12, 16, .45), calc(var(--m) * .07) calc(var(--m) * .13) calc(var(--m) * .12) rgba(10, 14, 20, .3), calc(var(--m) * .16) calc(var(--m) * .32) calc(var(--m) * .42) rgba(10, 14, 20, .16); }
.mag::before { content: ""; position: absolute; inset: 9%; border-radius: 50%; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .28), inset 0 -1px 2px rgba(0, 0, 0, .28); }
.mag::after { content: ""; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle at 70% 82%, rgba(255, 255, 255, .42) 0, rgba(255, 255, 255, 0) 30%); }
.mag .spec { position: absolute; left: 15%; top: 9%; width: 46%; height: 31%; border-radius: 50%; transform: rotate(-32deg); background: radial-gradient(ellipse at 50% 46%, rgba(255, 255, 255, .96) 0, rgba(255, 255, 255, .55) 32%, rgba(255, 255, 255, 0) 70%); }
.m-red { --m1: #ff9a8f; --m2: #e5362c; --m3: #a8140f; --m4: #560605; }
.m-orange { --m1: #ffd896; --m2: #ff9526; --m3: #dd600a; --m4: #803002; }
.m-blue { --m1: #93bdff; --m2: #2f70e0; --m3: #164196; --m4: #08204d; }
.m-black { --m1: #8a8e96; --m2: #393c42; --m3: #1a1b1e; --m4: #050506; }
.m-green { --m1: #93e8ad; --m2: #23a657; --m3: #0f6b33; --m4: #05331a; }
.m-yellow { --m1: #fff5ad; --m2: #f8cf24; --m3: #c49506; --m4: #6a4f02; }
.m-white { --m1: #ffffff; --m2: #f3f4f5; --m3: #c5cad0; --m4: #868b92; }
/* the orange magnet is a little orange: dimpled peel and a leaf */
.mag.fruit { background: radial-gradient(circle, rgba(120, 40, 0, .13) 0 .6px, rgba(120, 40, 0, 0) 1.2px) 0 0 / 3.1px 3.3px, radial-gradient(circle, rgba(255, 220, 160, .14) 0 .5px, rgba(255, 220, 160, 0) 1.1px) 1.3px 1.7px / 4.3px 3.9px, radial-gradient(circle at 36% 30%, var(--m1) 0, var(--m2) 30%, var(--m3) 74%, var(--m4) 100%); }
.mag.fruit::before { display: none; }
.mag .leaf { position: absolute; right: -2%; top: -12%; width: 52%; height: 30%; border-radius: 0 100% 0 100%; transform: rotate(-20deg); background: linear-gradient(140deg, #8fd068 0, #3d9a35 45%, #1f5e1f 100%); box-shadow: 1px 2px 2px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .35); }
.mag.hold { --m: 34px; left: 50%; top: -13px; margin-left: -17px; z-index: 3; }
.type-pin { width: 44px; height: 44px; transform: none; }
.item.drop-target .mag { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #ff8a1f, 0 6px 10px rgba(0, 0, 0, .3); }

.knob { position: absolute; right: -16px; top: -16px; width: 34px; height: 34px; border-radius: 50%; cursor: crosshair; display: grid; place-items: center; transform: scale(var(--inv)); transform-origin: 50% 50%; opacity: 0; transition: opacity .12s; touch-action: none; z-index: 4; }
.knob::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #c21d1d; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .6); }
.type-pin:hover .knob, .type-pin.selected .knob, .type-pin:focus-within .knob, .knob.always { opacity: 1; }
@media (pointer: coarse) { .type-pin .knob { opacity: 1; } }
.rh { position: absolute; right: -14px; bottom: -14px; width: 30px; height: 30px; background: #ff9f2e; border: 3px solid #1b1e23; border-radius: 3px; cursor: nwse-resize; transform: scale(var(--inv)); transform-origin: 100% 100%; touch-action: none; z-index: 5; }
.rh::after { content: ""; position: absolute; inset: 6px; border-right: 3px solid #1b1e23; border-bottom: 3px solid #1b1e23; }

/* ---- strings: twisted yarn with a soft shadow on the board ---- */
#strings { --str: #c4201f; --str-hi: rgba(255, 190, 180, .42); --str-lo: #7a0d0d; }
#strings.c-orange { --str: #f27d14; --str-hi: rgba(255, 236, 200, .5); --str-lo: #9a4304; }
#strings .s-hit { fill: none; stroke: transparent; stroke-width: 26; pointer-events: stroke; cursor: pointer; }
#strings .s-shadow { fill: none; stroke: rgba(18, 24, 34, .32); stroke-width: 4.5; stroke-linecap: round; transform: translate(5px, 9px); filter: url(#sBlur); pointer-events: none; }
#strings .s-edge { fill: none; stroke: var(--str-lo); stroke-width: 5.2; stroke-linecap: round; pointer-events: none; }
#strings .s-line { fill: none; stroke: var(--str); stroke-width: 3.6; stroke-linecap: round; pointer-events: none; transform: translate(-.3px, -.5px); }
#strings .s-twist { fill: none; stroke: var(--str-hi); stroke-width: 1.1; stroke-dasharray: 1.3 2.1; stroke-linecap: round; transform: translate(-.5px, -.9px); pointer-events: none; }
#strings .s-line.pending { stroke-dasharray: 12 9; }
#strings .s-twist.pending, #strings .s-shadow.pending, #strings .s-edge.pending { stroke-dasharray: 12 9; }
#strings .s-twist.pending { stroke-dasharray: none; stroke-opacity: 0; }
#strings g.string { pointer-events: none; outline: none; }
#strings g.selected .s-shadow { stroke: rgba(255, 138, 31, .85); stroke-width: 13; transform: none; filter: none; }
#strings g:focus-visible .s-shadow { stroke: rgba(255, 210, 60, .95); stroke-width: 13; transform: none; filter: none; }
#strings g.selected .s-line, #strings g:focus-visible .s-line { stroke-width: 5.5; }
#strings .s-temp { fill: none; stroke: var(--str); stroke-width: 4; stroke-dasharray: 2 9; stroke-linecap: round; pointer-events: none; }

/* ---- entry gate: minimal, frosted over the board ---- */
#gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(238, 240, 239, .8); -webkit-backdrop-filter: blur(7px) saturate(.9); backdrop-filter: blur(7px) saturate(.9); overflow: auto; }
.gate-in { width: min(100%, 420px); color: var(--board-ink); }
.gate-in h1 { font: 700 clamp(40px, 9vw, 60px)/1 var(--display); color: var(--board-ink); margin: 0 0 6px; }
.gate-in h1::after { content: ""; display: block; width: 4.2em; max-width: 100%; height: 9px; margin-top: 8px; border-radius: 6px; background: #f07a14; opacity: .9; }
.gate-in h2 { font: 800 22px/1.2 var(--ui); margin: 26px 0 8px; color: var(--board-ink); }
.lead { color: #3a4049; margin: 0 0 6px; font-size: 19px; }
.gate-in p { margin: 0 0 10px; }
.gate-in .hint { color: #474e58; }
.visit { border-top: 2px solid rgba(27, 30, 35, .16); margin-top: 28px; }
.gate-in .adminlink { margin: 40px 0 0; font-size: 14px; }
.gate-in .adminlink a { color: #454c56; }
.gate-in input[type=text], .gate-in input[type=password] { color: #15171a; background: #fff; border-color: #5d6571; }
label, legend { display: block; font-weight: 700; margin: 12px 0 5px; padding: 0; }
input[type=text], input[type=password], input[type=email], input[type=url], textarea { width: 100%; font: 17px/1.4 var(--ui); color: #f6f7f9; background: var(--field); border: 2px solid var(--line); border-radius: 4px; padding: 10px 12px; }
input[type=file] { width: 100%; color: var(--ink); font: 16px var(--ui); }
textarea { min-height: 110px; resize: vertical; }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: #d9422c; }
.hint { font-size: 15.5px; color: var(--ink-soft); margin: 5px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border: 0; border-radius: 4px; cursor: pointer; font: 800 17px/1.1 var(--ui); text-decoration: none; color: #1b1208; background: linear-gradient(180deg, #ffb347, #ff9220); box-shadow: 0 -2px 0 #ffd27a inset, 0 3px 0 #b5400d, 0 0 0 2px #1b1e23; }
.btn:hover { color: #1b1208; filter: brightness(1.05); }
.btn:active { transform: translateY(2px); }
.btn.quiet { color: #f6f7f9; background: #1d2026; box-shadow: 0 0 0 2px #c3c9d1; font-weight: 700; } .btn.quiet:hover { background: #2b2f37; color: #fff; }
.btn.danger { color: #fff3ef; background: #8a1e10; box-shadow: 0 0 0 2px #ffb59e; font-weight: 800; }
.btn.sq { min-width: 44px; padding: 8px 0; font-size: 24px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[aria-pressed=true] { background: #ff9f2e; color: #1b1208; box-shadow: 0 0 0 2px #ffe08a; }
.msg { margin: 10px 0 0; padding: 8px 12px; border-left: 5px solid #ff8a6a; border-radius: 3px; background: #2e0f09; color: #ffe3da; font-weight: 600; font-size: 16px; }
.msg.good { border-color: #9be15a; background: #14240d; color: #e6f8d2; }
.msg:empty { display: none; }
#pwForm .btn { margin-top: 12px; }

/* ---- corner tab + pop-out panel ---- */
#tools { position: fixed; top: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; max-height: 100dvh; padding-right: env(safe-area-inset-right); }
#toolsTab { min-height: 44px; padding: 8px 16px; border: 0; cursor: pointer; font: 800 17px/1 var(--ui); color: #1b1208; background: linear-gradient(180deg, #ffb347, #ff9220); border-radius: 0 0 0 12px; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); }
#toolsTab[aria-expanded=true] { background: var(--panel); color: #f6f7f9; box-shadow: none; }
#toolsPanel { width: min(340px, 100vw); max-height: calc(100dvh - 44px); overflow-y: auto; padding: 14px 16px 16px; background: var(--panel); box-shadow: -4px 6px 18px rgba(0, 0, 0, .4); border-radius: 0 0 0 12px; }
#toolsPanel h2 { font: 800 18px/1.2 var(--ui); margin: 16px 0 8px; color: #ffbe66; }
.p-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.scol span { font-weight: 700; margin-right: 4px; }
.scol .btn { min-height: 38px; padding: 6px 14px; font-size: 16px; }
#zPct { min-width: 52px; text-align: center; font-weight: 700; }
.roleline { margin: 6px 0 0; font-size: 16px; color: var(--ink-soft); }
.toolgrid { display: flex; gap: 8px; flex-wrap: wrap; }
.toolgrid .btn { flex: 1 1 calc(50% - 8px); padding: 8px 10px; font-size: 16px; }
.toolgrid .btn[aria-expanded=true] { background: #ff9f2e; color: #1b1208; box-shadow: 0 0 0 2px #ffe08a; }
.tform { margin-top: 12px; padding-top: 4px; border-top: 2px solid rgba(195, 201, 209, .3); }
.tform .btn { margin-top: 12px; }
fieldset { border: 0; padding: 0; margin: 4px 0 0; min-width: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 10px 6px 6px; background: var(--field); border: 2px solid var(--line); border-radius: 4px; cursor: pointer; font-weight: 700; font-size: 16px; }
.swatches input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatches .chip { width: 22px; height: 22px; border: 2px solid #1b1e23; border-radius: 2px; }
.swatches label:has(input:checked) { border-color: #ffe08a; box-shadow: 0 0 0 2px #ffe08a; background: #2b2f37; }
.swatches label:has(input:focus-visible) { outline: 3px solid #ffe08a; outline-offset: 3px; }
.chip.c-orange { background: #ffbd6e; } .chip.c-leaf { background: #cfe9a3; } .chip.c-blossom { background: #ffcadb; } .chip.c-cream { background: #fff0bf; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#aImg { display: block; width: 100%; max-height: 150px; object-fit: cover; margin-top: 12px; }
#selDesc { margin: 0 0 8px; font-weight: 600; overflow-wrap: anywhere; }
#selEdit .btn { margin-top: 8px; }
.pendlist { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.pendlist li { padding: 8px 10px; background: var(--field); border: 2px solid var(--line); border-radius: 4px; }
.pendlist .t { margin: 0 0 6px; font-size: 16px; overflow-wrap: anywhere; }
.pendlist .btn { min-height: 36px; padding: 4px 12px; font-size: 15px; }
.keys { margin-top: 12px; font-size: 15.5px; color: var(--ink-soft); } .keys summary { cursor: pointer; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 150; max-width: min(92vw, 520px); margin: 0; padding: 10px 16px; border-radius: 6px; background: #1d2026; color: #f6f7f9; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); pointer-events: none; text-align: center; }
.toast:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .item.fresh { animation: drop .45s cubic-bezier(.3, 1.3, .6, 1) both; }
  @keyframes drop { from { opacity: 0; translate: 0 -24px; } to { opacity: 1; translate: 0 0; } }
}
@media (max-width: 640px) {
  #toolsPanel { width: 100vw; max-height: calc(100dvh - 44px); border-radius: 0; }
  .gate-in h2 { font-size: 21px; }
}

/* while the entry gate is up, the corner tab stays out of the way */
body:has(#gate:not([hidden])) #tools { visibility: hidden; }
