/* Bondrucker — "the printer on the desk".
   One bold thing: the printer and its paper. Everything else stays quiet.
   Fonts are self-hosted (no Google requests → GDPR). OFL licence, see fonts/OFL.txt. */

@font-face { font-family: "Gabarito"; src: url("fonts/gabarito-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Gabarito"; src: url("fonts/gabarito-latin-ext.woff2") format("woff2"); font-weight: 400 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DotGothic16"; src: url("fonts/dotgothic16-latin.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DotGothic16"; src: url("fonts/dotgothic16-latin-ext.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Desk: pale eucalyptus, lit from above */
  --desk: #CFDFDA;
  --desk-light: #DDEAE6;
  --desk-deep: #A9C2BB;
  /* Printer: graphite plastic */
  --shell: #2C2E33;
  --shell-hi: #42454D;
  --shell-lo: #1C1D21;
  /* Paper + thermal ink */
  --paper: #FFFFFF;
  --paper-shade: #ECEEE9;
  --ink: #2B2742;
  --ink-soft: #6F6B86;
  /* The one accent: the yellow feed button */
  --accent: #F2C230;
  --accent-deep: #C99A0C;
  /* LEDs */
  --led-ok: #46D483;
  --led-busy: #F5A524;
  --led-err: #F04438;
  --led-off: #5A5D66;

  --ui: "Gabarito", system-ui, sans-serif;
  --thermal: "DotGothic16", "Courier New", monospace;
  --radius-shell: 22px;
  --paper-w: min(340px, 86vw);
  --ease-feed: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--desk); }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 17px/1.5 var(--ui);
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% -10%, var(--desk-light) 0%, var(--desk) 55%, #C4D7D1 100%) fixed;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-weight: 800; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); font-size: .92em; }
.error { color: var(--led-err); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 14px clamp(16px, 4vw, 40px);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 900; font-size: 1.15rem; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 26px; height: 30px; flex: none; }
.topbar nav { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.topbar nav a {
  text-decoration: none; padding: .35rem .75rem; border-radius: 999px; font-weight: 600; font-size: .95rem; color: var(--ink);
}
.topbar nav a:hover { background: rgba(43, 39, 66, .07); }
.topbar nav a.active { background: var(--ink); color: var(--paper); }
.topbar nav .me { display: inline-flex; align-items: center; gap: .45rem; margin-left: .5rem; padding-left: .3rem; }
.avatar {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--ink); font-weight: 800; font-size: .85rem;
}
.topbar nav .me.active .avatar { box-shadow: 0 0 0 2px var(--paper); }
.topbar nav .logout { color: var(--ink-soft); }
.menu-toggle { display: none; }

/* ---------------------------------------------------------------- buttons + fields */
button, .button {
  font: 700 1rem/1 var(--ui); cursor: pointer; border: 0; border-radius: 12px;
  padding: .8rem 1.3rem; color: var(--ink); background: var(--accent);
  box-shadow: 0 3px 0 var(--accent-deep), 0 6px 14px rgba(43, 39, 66, .18);
  transition: transform .08s ease, box-shadow .08s ease;
}
button:hover { filter: brightness(1.04); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep), 0 3px 8px rgba(43, 39, 66, .18); }
button:disabled { opacity: .55; cursor: default; transform: none; }
button.quiet, .button.quiet { background: var(--paper); box-shadow: 0 2px 0 var(--desk-deep), 0 4px 10px rgba(43, 39, 66, .12); }
button.danger { background: var(--paper); color: #B42318; box-shadow: 0 2px 0 #F3B8B0, 0 4px 10px rgba(43, 39, 66, .1); }
button.small { padding: .45rem .8rem; font-size: .9rem; border-radius: 9px; }
button.link { background: none; box-shadow: none; padding: 0; color: #B42318; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
button.link:active { transform: none; }

label { display: block; margin: 0 0 .9rem; font-weight: 600; font-size: .95rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .65rem .8rem;
  font: 400 1rem/1.4 var(--ui); color: var(--ink);
  background: var(--paper); border: 2px solid #D5DED9; border-radius: 10px;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
input[type="file"] { padding: .45rem; font-size: .95rem; }
input[type="file"]::file-selector-button {
  font: 700 .9rem/1 var(--ui); color: var(--ink); background: var(--accent); border: 0; border-radius: 8px;
  padding: .55rem .9rem; margin-right: .8rem; cursor: pointer; box-shadow: 0 2px 0 var(--accent-deep);
}
form.inline { display: inline; margin: 0; }
form.inline select, td select { width: auto; margin: 0; padding: .35rem .5rem; display: inline-block; }
input.short { display: inline-block; width: 11rem; margin: 0 .4rem 0 0; padding: .4rem .6rem; }

/* ---------------------------------------------------------------- the printer (shared by send + login) */
.stage { display: grid; justify-items: center; padding: clamp(12px, 5vh, 56px) 16px 72px; }
.printer {
  position: relative; z-index: 2;
  width: min(420px, 94vw); height: 128px;
  border-radius: var(--radius-shell) var(--radius-shell) 14px 14px;
  background:
    linear-gradient(180deg, var(--shell-hi) 0%, var(--shell) 38%, var(--shell) 70%, var(--shell-lo) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .12),
    inset 0 -3px 0 rgba(0, 0, 0, .35),
    0 18px 30px -10px rgba(28, 29, 33, .55),
    0 4px 0 #17181B;
}
/* the lid seam and the paper slot */
.printer::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: 46px; height: 2px;
  background: rgba(0, 0, 0, .35); box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
.printer .slot {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: calc(var(--paper-w) + 22px); height: 12px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #0B0B0D 0%, #000 100%);
  box-shadow: inset 0 3px 4px rgba(0, 0, 0, .8);
}
.printer .nameplate {
  position: absolute; left: 22px; top: 62px;
  font: 800 .78rem/1 var(--ui); letter-spacing: .02em; color: #A6A9B2; opacity: .8;
}
.printer .nameplate b { color: #E6E7EA; font-weight: 800; }
.printer .led {
  position: absolute; right: 86px; top: 64px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--led-off); box-shadow: inset 0 -1px 2px rgba(0, 0, 0, .5);
  transition: background .2s, box-shadow .2s;
}
.printer .led-text { position: absolute; right: 104px; top: 60px; font: 600 .75rem/1.6 var(--ui); color: #A6A9B2; text-align: right; }
.printer .feed {
  position: absolute; right: 22px; top: 14px; width: 50px; height: 50px; padding: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FFE27A 0%, var(--accent) 45%, var(--accent-deep) 100%);
  box-shadow: 0 4px 0 #8A6A06, 0 7px 12px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
  display: grid; place-items: center;
}
.printer .feed svg { width: 22px; height: 22px; }
.printer .feed:active { transform: translateY(3px); box-shadow: 0 1px 0 #8A6A06, 0 3px 6px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .5); }

.printer[data-led="ok"] .led   { background: var(--led-ok);  box-shadow: 0 0 10px 2px rgba(70, 212, 131, .6); }
.printer[data-led="busy"] .led { background: var(--led-busy); box-shadow: 0 0 10px 2px rgba(245, 165, 36, .65); animation: blink .5s steps(1) infinite; }
.printer[data-led="sleep"] .led{ background: var(--led-busy); box-shadow: 0 0 8px 1px rgba(245, 165, 36, .45); animation: breathe 2.4s ease-in-out infinite; }
.printer[data-led="err"] .led  { background: var(--led-err); box-shadow: 0 0 12px 3px rgba(240, 68, 56, .7); }
.printer.is-working { animation: hum .12s linear infinite; }
.printer.is-jammed  { animation: jolt .55s cubic-bezier(.36, .07, .19, .97) both; }

@keyframes blink   { 50% { background: #7A5A12; box-shadow: none; } }
@keyframes breathe { 50% { opacity: .35; } }
@keyframes hum     { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(.4px, -.3px); } }
@keyframes jolt    {
  10%, 90% { transform: translate(-2px, 0) rotate(-.4deg); }
  20%, 80% { transform: translate(4px, -1px) rotate(.6deg); }
  30%, 50%, 70% { transform: translate(-7px, 1px) rotate(-1deg); }
  40%, 60% { transform: translate(7px, 0) rotate(1deg); }
}

/* ---------------------------------------------------------------- paper */
/* The paper path starts at the slot; anything above it is "inside" the printer. */
.paper-path {
  position: relative; z-index: 1; width: var(--paper-w);
  margin-top: -2px; padding-bottom: 40px;
  clip-path: inset(0 -100vw -200vh -100vw);   /* hide paper above the slot only — it may fly anywhere else */
}
.receipt {
  position: relative; width: 100%;
  padding: 26px 22px 34px;
  font: 400 17px/1.55 var(--thermal); color: var(--ink);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .10) 0, rgba(0, 0, 0, 0) 14px),   /* shadow from the slot */
    linear-gradient(90deg, var(--paper-shade) 0, var(--paper) 6%, var(--paper) 94%, var(--paper-shade) 100%);
  /* torn zig-zag bottom edge */
  --tooth: 9px;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth)) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--tooth)) var(--tooth) repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth)) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--tooth)) var(--tooth) repeat-x;
  filter: drop-shadow(0 10px 12px rgba(43, 39, 66, .16));
  transform-origin: 50% 0;
}
.receipt .head { text-align: center; letter-spacing: .08em; margin-bottom: .2em; }
.receipt .rule { border: 0; border-top: 2px dashed rgba(43, 39, 66, .35); margin: .55em 0; }
.receipt .from { font-size: 1.35em; line-height: 1.25; letter-spacing: .02em; }
.receipt .stamp-line { text-align: center; color: var(--ink); }
.receipt .meta { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: .8em; margin-top: .4em; }
.receipt textarea {
  display: block; width: 100%; min-height: 7.75em; margin: .4em 0 .2em; padding: 0;
  font: inherit; color: var(--ink); background: transparent; border: 0; border-radius: 0; resize: none; overflow: hidden;
  caret-color: var(--ink);
}
.receipt textarea::placeholder { color: #A9A6BA; }
.receipt textarea:focus { outline: none; }
.receipt:focus-within { filter: drop-shadow(0 10px 12px rgba(43, 39, 66, .16)) drop-shadow(0 0 0 var(--ink)); }
.receipt .printed-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .4em 0 .2em; min-height: 3em; }
.receipt canvas { display: block; width: 100%; height: auto; margin: .5em 0; image-rendering: pixelated; }
.receipt .photo { position: relative; }
.receipt .photo button {
  position: absolute; top: 8px; right: 8px; padding: .3rem .55rem; font-size: .8rem; border-radius: 8px;
  background: var(--paper); box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* feeding states (JS toggles classes; durations mirrored in app.js) */
.receipt.feed-in  { animation: feed-in .7s var(--ease-feed) both; }          /* pulled into the slot */
.receipt.feed-out { animation: print-out 1.1s steps(16, end) both; }       /* printed line by line, top first */
.receipt.fresh    { animation: feed-out .55s var(--ease-feed) both; }       /* blank paper advances */
.receipt.torn     { animation: tear-away 1.05s cubic-bezier(.45, 0, .2, 1) forwards; }
.receipt.crumpled { animation: crumple .7s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes feed-in  { to { transform: translateY(-104%); } }
@keyframes feed-out { from { transform: translateY(-104%); } to { transform: translateY(0); } }
@keyframes print-out { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes tear-away {
  0%   { transform: translateY(0) rotate(0); }
  14%  { transform: translateY(8px) rotate(-2.5deg); }                       /* tug */
  24%  { transform: translateY(4px) rotate(1.5deg); }
  100% { transform: translate(min(60vw, 520px), 70vh) rotate(38deg); opacity: 0; }
}
@keyframes crumple {
  0%   { transform: translateY(-40%) scale(1, 1); }
  40%  { transform: translateY(-34%) scale(.94, .7) skewX(-6deg); }
  100% { transform: translateY(-30%) scale(.86, .46) skewX(4deg) rotate(-3deg); }
}
.receipt.crumpled::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-28deg, rgba(43, 39, 66, .0) 0 14px, rgba(43, 39, 66, .12) 15px 17px, rgba(255, 255, 255, .5) 18px 19px, rgba(43, 39, 66, 0) 20px 34px),
              repeating-linear-gradient(35deg, rgba(43, 39, 66, 0) 0 22px, rgba(43, 39, 66, .1) 23px 25px, rgba(43, 39, 66, 0) 26px 46px);
}

/* the ticket the printer hands back (success / error / queued / status) */
.ticket {
  position: relative; width: min(300px, 80vw); margin: 18px auto 0; padding: 16px 18px 22px;
  font: 400 15px/1.5 var(--thermal); background: var(--paper);
  --tooth: 7px;
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--tooth)) var(--tooth) repeat-x,
                linear-gradient(#000 0 0) center / 100% calc(100% - 2 * var(--tooth)) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--tooth)) var(--tooth) repeat-x;
          mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--tooth)) var(--tooth) repeat-x,
                linear-gradient(#000 0 0) center / 100% calc(100% - 2 * var(--tooth)) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--tooth)) var(--tooth) repeat-x;
  filter: drop-shadow(0 8px 10px rgba(43, 39, 66, .18));
  animation: ticket-in .5s var(--ease-feed) both;
}
.ticket[hidden] { display: none; }
.ticket .title { font-size: 1.2em; margin-bottom: .3em; }
.ticket .body { color: var(--ink); }
.ticket .body u { text-decoration: none; }
.ticket button { margin-top: .9em; font-family: var(--ui); }
.ticket.ok    { transform: rotate(-1.5deg); }
.ticket.ok .title::before    { content: "✓ "; }
.ticket.err .title::before   { content: "✕ "; }
.ticket.err   { background: #FFF3F1; }
@keyframes ticket-in { from { transform: translateY(-14px) rotate(0); opacity: 0; } }

/* ---------------------------------------------------------------- send page */
.picker { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 0 0 22px; }
.picker[hidden] { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0; cursor: pointer;
  padding: .45rem .9rem .45rem .7rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
  background: rgba(255, 255, 255, .55); border: 2px solid transparent;
}
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked) { background: var(--paper); border-color: var(--ink); }
.chip:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.chip small { font-weight: 500; color: var(--ink-soft); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--led-off); flex: none; display: inline-block; }
.dot.on  { background: var(--led-ok); box-shadow: 0 0 6px var(--led-ok); }
.dot.off { background: #B9C2C0; }

.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .7rem; margin-top: 6px; }
.actions .print { font-size: 1.1rem; padding: .95rem 1.8rem; }
.actions .count { font: 400 .85rem/1 var(--thermal); color: var(--ink-soft); min-width: 5ch; text-align: center; }
.file-pick { position: relative; overflow: hidden; margin: 0; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }

.emoji-hint { text-align: center; max-width: 36ch; margin: 12px auto 0; }
.service { width: min(420px, 94vw); margin: 34px auto 0; }
.service summary { cursor: pointer; font-weight: 700; padding: .5rem 0; list-style: none; display: flex; align-items: center; gap: .5rem; }
.service summary::-webkit-details-marker { display: none; }
.service summary::before { content: "⚙"; font-size: 1.1em; }
.service .cmd-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.empty-state { text-align: center; max-width: 34ch; margin: 30px auto 0; }

/* ---------------------------------------------------------------- QR guest mode */
.guest-name { display: flex; align-items: baseline; gap: .3em; margin: 0; font: inherit; }
.guest-name input {
  flex: 1; min-width: 0; margin: 0; padding: 0 0 .05em; font: inherit; color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px dotted rgba(43, 39, 66, .45); border-radius: 0;
}
.guest-name input:focus { border-bottom-style: solid; border-bottom-color: var(--ink); }
.guest-note { text-align: center; max-width: 34ch; margin: 14px auto 0; }

.page-qr .topbar { display: none; }
.kiosk { --paper-w: min(58vh, 500px, 88vw); min-height: 100vh; align-content: center; padding-top: 3vh; }
.kiosk .printer { width: calc(var(--paper-w) + 90px); max-width: 96vw; }
.qr-receipt { text-align: center; font-size: clamp(16px, 2.4vh, 26px); padding-bottom: 40px; }
.qr-receipt .from { font-size: 1.6em; }
.qr svg { display: block; width: 100%; height: auto; margin: .3em 0 .6em; }
.countdown { height: 6px; background: var(--paper-shade); margin: 0 0 .9em; }
.countdown span { display: block; height: 100%; background: var(--ink); transform-origin: left; }
.howto { text-align: left; margin: 0; padding-left: 1.4em; line-height: 1.6; }
.kiosk-controls { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 10px; opacity: .55; }
.kiosk-controls:hover, .kiosk-controls:focus-within { opacity: 1; }
:fullscreen .kiosk-controls { display: none; }

/* ---------------------------------------------------------------- picture collection */
.picture-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.picture-grid li { display: grid; gap: .3rem; justify-items: center; text-align: center; }
.picture-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--paper); border: 2px solid #E3E8E5; border-radius: 10px; padding: 10px; }
.picture-name input { text-align: center; padding: .35rem .5rem; font-size: .92rem; margin: 0; }
.picture-grid.pick button {
  display: grid; gap: .35rem; width: 100%; padding: 0; background: none; box-shadow: none; font: 600 .92rem/1.2 var(--ui); color: var(--ink);
}
.picture-grid.pick button:hover img, .picture-grid.pick button:focus-visible img { border-color: var(--ink); }
.picture-grid.pick button:active { transform: scale(.97); }
dialog.gallery {
  width: min(640px, 92vw); max-height: 86vh; padding: 22px 24px; border: 0; border-radius: 6px;
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(28, 29, 33, .55);
}
dialog.gallery::backdrop { background: rgba(43, 39, 66, .35); backdrop-filter: blur(3px); }
dialog.gallery[open] { animation: ticket-in .3s var(--ease-feed) both; }

.guest-panel .share { margin: .3rem 0 .6rem; }
.guest-panel .share input { font: 400 .9rem/1.4 var(--thermal); background: var(--paper-shade); border-color: transparent; }
.guest-panel .group-label { display: flex; align-items: center; gap: .5rem; }
.service .guest-panel { margin-top: .4rem; padding-top: .6rem; border-top: 2px dotted var(--desk-deep); }
a.button { display: inline-block; text-decoration: none; }
a.button.small { padding: .45rem .8rem; font-size: .9rem; border-radius: 9px; }

/* ---------------------------------------------------------------- login */
.login .receipt { padding-bottom: 40px; }
.login .receipt label { font: 400 1em/1.4 var(--thermal); margin: 0 0 .8em; }
.login .receipt input {
  font: 400 1.05em/1.4 var(--thermal); background: transparent; border: 0; border-bottom: 2px dotted rgba(43, 39, 66, .45);
  border-radius: 0; padding: .2em 0; margin-top: .1em;
}
.login .receipt input:focus { border-bottom-style: solid; border-bottom-color: var(--ink); }
.login .receipt .error { font-family: var(--thermal); }
.login .receipt.wrong { animation: wobble .5s ease both; }
@keyframes wobble { 20% { transform: rotate(-1.6deg); } 45% { transform: rotate(1.3deg); } 70% { transform: rotate(-.7deg); } }
.login .actions { margin-top: 0; }

/* ---------------------------------------------------------------- admin + account: paper sheets on the desk */
main.sheets, main.grid, main.stack, main.card { max-width: 1100px; margin: 0 auto 64px; }
main.sheets, main.grid, main.stack { padding: 8px clamp(16px, 4vw, 40px) 0; }
main.card { width: calc(100% - 2 * clamp(16px, 4vw, 40px)); }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; grid-column: 1 / -1; margin: 6px 0 -4px; }
.page-title h1 { margin: 0; font-size: 2rem; }
main.grid { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
main.grid.side { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.btn-group { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1.1rem; }
.group-label { font-weight: 700; font-size: .9rem; color: var(--ink-soft); margin: 1rem 0 .2rem; }
.danger-zone { margin-top: 1.4rem; padding-top: 1rem; border-top: 2px dotted #DCE2DF; }
.inline-fold summary { cursor: pointer; color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.inline-fold summary::-webkit-details-marker { display: none; }
.inline-fold[open] summary { margin-bottom: .5rem; }
.inline-fold form { display: flex; gap: .4rem; flex-wrap: wrap; }
.inline-fold input { width: auto; flex: 1 1 10rem; margin: 0; padding: .45rem .6rem; }
fieldset.grants { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.grants legend { font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
label.grant { display: flex; align-items: center; justify-content: space-between; gap: .8rem; font-weight: 500; margin: 0 0 .4rem; }
label.grant select { width: auto; margin: 0; }
.status-pill { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.empty { color: var(--ink-soft); padding: 1rem 0 .4rem; }
main.stack { display: grid; gap: 22px; }
.card {
  background: var(--paper); border-radius: 4px; padding: 24px 26px;
  box-shadow: 0 1px 0 rgba(43, 39, 66, .06), 0 12px 24px -12px rgba(43, 39, 66, .35);
}
.card.wide { grid-column: 1 / -1; }
.card.narrow { max-width: 380px; margin: 0 auto; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.row h1, .row h2 { margin: 0; }
.row-form { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.row-form label { flex: 1 1 200px; margin: 0; }
.cmd-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .65rem .5rem; vertical-align: top; border-bottom: 2px dotted #DCE2DF; }
th { font-weight: 700; color: var(--ink-soft); font-size: .85rem; border-bottom: 2px solid var(--ink); }
tbody tr:last-child td { border-bottom: 0; }
td code, dd code, p code { font: 400 .92em/1 var(--thermal); }
.table-wrap { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.small-text { font-size: .9em; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge.ok   { background: #DDF6E8; color: #116B3C; }
.badge.warn { background: #FDEBC8; color: #8A5300; }
.badge.info { background: #E4E9F6; color: #33407A; }
.badge.guest { background: #F3E5F7; color: #6B2C80; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0 0 1rem; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

.banner {
  max-width: 1100px; margin: 0 auto 14px; padding: .8rem 1.1rem; border-radius: 10px; font-weight: 600;
  width: calc(100% - 2 * clamp(16px, 4vw, 40px));
}
.banner.ok    { background: #DDF6E8; color: #116B3C; }
.banner.error { background: #FDE3DF; color: #B42318; }
.banner.warn  { background: #FDEBC8; color: #8A5300; }

.result { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: 10px; background: #F4F6F5; font-size: .95rem; }
.result[hidden] { display: none; }
.result.ok    { background: #DDF6E8; }
.result.error { background: #FDE3DF; color: #B42318; }
.result.pending { color: var(--ink-soft); }

@media (max-width: 760px) {
  main.grid, main.grid.side { grid-template-columns: 1fr; }
  /* menu: one button, opens a paper sheet */
  .topbar { position: relative; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: .55rem; padding: .5rem .85rem; border-radius: 999px;
    background: var(--paper); box-shadow: 0 2px 0 var(--desk-deep); font-size: .95rem;
  }
  .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
    display: block; width: 16px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; content: "";
  }
  .menu-toggle span::before { position: absolute; top: -5px; }
  .menu-toggle span::after  { position: absolute; top: 5px; }
  .topbar nav {
    display: none; position: absolute; z-index: 20; top: calc(100% - 4px); right: 16px; left: 16px;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px;
    background: var(--paper); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(43, 39, 66, .45);
  }
  .topbar.open nav { display: flex; }
  .topbar nav a { padding: .7rem .9rem; border-radius: 10px; font-size: 1.02rem; }
  .topbar nav .me { margin: 6px 0 0; padding-top: .8rem; border-top: 2px dotted #DCE2DF; border-radius: 0 0 10px 10px; }
  /* tables become stacked cards */
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: .8rem 0; border-bottom: 2px dotted #DCE2DF; }
  table.cards tbody tr:last-child { border-bottom: 0; }
  table.cards td { border: 0; padding: .2rem 0; display: flex; gap: .8rem; }
  table.cards td::before { content: attr(data-label); flex: 0 0 7.5rem; color: var(--ink-soft); font-size: .85rem; padding-top: .1rem; }
  table.cards td[data-label=""]::before { display: none; }
  table.cards td.title { font-weight: 700; font-size: 1.05rem; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: .55rem; }
  .card { padding: 20px 18px; }
  .printer .led-text { display: none; }
  .printer .led { right: 84px; }
}

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