/* CoE Print, in the house style of air.meowda.xyz. Mobile first. Made by xyoda. */

@font-face {
  font-family: "Outfit Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/outfit-latin-wght.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/static/fonts/manrope-latin-wght.woff2) format("woff2-variations");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/static/fonts/ibm-plex-mono-latin-400.woff2) format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/static/fonts/ibm-plex-mono-latin-500.woff2) format("woff2");
}

:root {
  --void: #0b0d11;
  --surface: #12151c;
  --surface-2: #171b24;
  --line: #242a36;
  --line-2: #323a4a;
  --ink: #e9ecef;
  --muted: #8b94a3;
  --faint: #5b6473;
  --accent: #e8b04b;
  --accent-dim: rgba(232, 176, 75, .14);
  --ok: #5ddba0;
  --ok-dim: rgba(93, 219, 160, .12);
  --no: #ff7a7a;
  --no-dim: rgba(255, 122, 122, .12);

  --display: "Outfit Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sans: "Manrope Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  /* The status bar / notch.  --sat-fallback is set from JS on iOS home-screen
     apps that draw under the status bar but report no inset. */
  --sat: max(env(safe-area-inset-top, 0px), var(--sat-fallback, 0px));
  --mast-h: 64px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  /* No scrollbars in the app; pages still scroll by touch, wheel and keys. */
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--void);
  scroll-padding-top: calc(var(--mast-h) + var(--sat) + 56px);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(700px 420px at 50% -140px, rgba(232, 176, 75, .08), transparent 70%) no-repeat,
    var(--void);
  padding-inline: var(--gutter);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
@media (min-width: 760px) {
  body { background-attachment: fixed; }
}

::selection { background: var(--accent); color: var(--void); }

* { scrollbar-width: none; }
::-webkit-scrollbar { display: none; width: 0; height: 0; }

.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
.wrap.wide { max-width: 1120px; }

a { color: inherit; }
img { max-width: 100%; }

/* A long press on a picture (the CoE mark, printer images, avatars, icons)
 * would otherwise select it, start a drag, or open the phone's image menu
 * and jolt the app's layout. */
img, svg, video, .brand, .printer-pic, .avatar, .swatch, .scan-icon, .qr-frame {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

html.offline body::before {
  content: "Offline";
  position: fixed;
  z-index: 30;
  top: var(--sat);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  background: var(--no);
  color: var(--void);
  font: 500 10px/1.4 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* ---------- masthead: the CoE lockup, sticky ---------- */

.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-inline: calc(var(--gutter) * -1);
  padding: var(--sat) var(--gutter) 0;
  background: rgba(11, 13, 17, .86);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--mast-h);
  max-width: 1120px;
  margin: 0 auto;
}
.wrap:not(.wide) .mast-inner { max-width: 600px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { flex: none; width: 38px; height: 38px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
@media (max-width: 360px) {
  .brand-name { font-size: 11px; letter-spacing: .14em; }
}

.menu { position: relative; flex: none; }
.menu-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}
.menu-toggle:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, calc(100vw - 32px));
  padding: 16px;
  display: grid;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 48px -20px #000;
  animation: rise .25s var(--ease-out) both;
}
.menu-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.menu-who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  object-fit: cover;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  display: inline-grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
}
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }

/* ---------- section tabs (admin) ---------- */

.tabs {
  position: sticky;
  top: calc(var(--mast-h) + var(--sat) + 1px);
  z-index: 15;
  display: flex;
  gap: 8px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 10px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(11, 13, 17, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  text-decoration: none;
  font: 500 11px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.tab:hover { color: var(--ink); border-color: var(--muted); }
.tab-count { color: var(--ink); }
.tab.hot { border-color: var(--accent); color: var(--accent); }
.tab.hot .tab-count { background: var(--accent); color: var(--void); padding: 3px 6px; margin-right: -6px; }
@media (min-width: 1000px) {
  .tabs { margin-inline: 0; padding-inline: 0; border-bottom: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; margin-top: 20px; }
}

.page { padding-top: 22px; }
.anchor { scroll-margin-top: calc(var(--mast-h) + var(--sat) + 64px); }

/* ---------- type ---------- */

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
h1, h2, h3, .title { margin: 0; font-family: var(--display); color: var(--ink); }
h1, .title {
  font-weight: 300;
  font-size: clamp(26px, 7.4vw, 40px);
  line-height: 1.12;
  letter-spacing: .1em;
  text-transform: uppercase;
}
h2 {
  font-weight: 400;
  font-size: 14px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
h3 { font-weight: 500; font-size: 17px; letter-spacing: .01em; line-height: 1.3; overflow-wrap: anywhere; }
p { margin: 0; }
.lede { margin-top: 12px; color: var(--muted); font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.center { text-align: center; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 36px 0 14px;
}
.page > :first-child .section-head, .page > .section-head:first-child { margin-top: 8px; }
.count {
  font-family: var(--mono);
  font-size: 11px;
  min-width: 26px;
  padding: 2px 8px;
  text-align: center;
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.count.hot { background: var(--accent); border-color: var(--accent); color: var(--void); }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--faint);
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- panels ---------- */

.panel, .ticket {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 120px);
  border: 1px solid var(--line);
  padding: 20px 18px;
  animation: rise .5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@media (min-width: 560px) { .panel, .ticket { padding: 28px; } }
.ticket + .ticket, .ticket + section, div + .ticket { margin-top: 16px; }

.hero h1 { margin-top: 2px; }

.rule, .perf { height: 1px; margin: 20px 0; background: var(--line); }

.stub {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Sections redrawn by polling appear in place, without the entrance animation. */
.settled .ticket, .settled .cards > li, .settled .install { animation: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 20px 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
}
.steps li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font: 500 12px/1 var(--mono);
}
.steps strong { color: var(--ink); font-weight: 600; }

/* ---------- buttons ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 500 12px/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out), color .2s var(--ease-out), transform .1s;
}
.btn:active:not([disabled]) { transform: scale(.98); }
@media (hover: hover) { .btn:hover { border-color: var(--ink); } }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .scan-btn:focus-visible, .card-link:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--void); }
@media (hover: hover) { .btn.primary:hover { background: #f0c068; border-color: #f0c068; } }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--void); }
@media (hover: hover) { .btn.ok:hover { background: #7de6b6; border-color: #7de6b6; } }
.btn.danger { color: var(--no); border-color: rgba(255, 122, 122, .4); }
@media (hover: hover) { .btn.danger:hover { border-color: var(--no); } }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 13px; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 11px; letter-spacing: .16em; }
.btn.ghost { border-color: transparent; padding-inline: 6px; color: var(--muted); }

.icon-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.nowrap { flex-wrap: nowrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.stack > :empty { margin-top: 0; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-row > .btn { flex: 1 1 auto; }
.btn-row.end { justify-content: flex-end; }
@media (min-width: 560px) { .btn-row > .btn { flex: 0 0 auto; } }

.decide { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 16px; }

.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 -18px -20px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(18, 21, 28, 0), var(--surface) 30%);
}
@media (min-width: 560px) { .action-bar { position: static; margin: 0; padding: 0; background: none; } }

.scan-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  text-align: left;
  background: var(--accent);
  color: var(--void);
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.scan-btn:active { transform: scale(.99); }
.scan-btn strong { display: block; font: 600 17px/1.2 var(--display); letter-spacing: .04em; }
.scan-btn .small { display: block; color: rgba(11, 13, 17, .72); margin-top: 3px; }
.scan-icon {
  flex: none;
  width: 44px;
  height: 44px;
  position: relative;
  background:
    linear-gradient(var(--void), var(--void)) 0 0 / 14px 3px no-repeat,
    linear-gradient(var(--void), var(--void)) 0 0 / 3px 14px no-repeat,
    linear-gradient(var(--void), var(--void)) 100% 0 / 14px 3px no-repeat,
    linear-gradient(var(--void), var(--void)) 100% 0 / 3px 14px no-repeat,
    linear-gradient(var(--void), var(--void)) 0 100% / 14px 3px no-repeat,
    linear-gradient(var(--void), var(--void)) 0 100% / 3px 14px no-repeat,
    linear-gradient(var(--void), var(--void)) 100% 100% / 14px 3px no-repeat,
    linear-gradient(var(--void), var(--void)) 100% 100% / 3px 14px no-repeat;
}
.scan-icon::after { content: ""; position: absolute; left: 8px; right: 8px; top: 20px; height: 3px; background: var(--void); }

/* ---------- forms ---------- */

label.field { display: block; min-width: 0; }
label.field > span {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
input[type=text], input[type=number], textarea, select {
  width: 100%;
  min-height: 48px;
  font: 16px/1.4 var(--sans);
  color: var(--ink);
  background: var(--void);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 12px 14px;
  transition: border-color .2s var(--ease-out);
}
select {
  appearance: none;
  background: var(--void) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b94a3' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center;
  padding-right: 36px;
}
input[type=text]:focus, input[type=number]:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 84px; font-family: var(--mono); font-size: 16px; }
.check { display: flex; gap: 12px; align-items: center; min-height: 44px; color: var(--muted); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 420px) { .two { grid-template-columns: 3fr 2fr; } }

.pin-input {
  font-family: var(--mono) !important;
  font-weight: 500;
  font-size: clamp(26px, 9vw, 34px) !important;
  letter-spacing: .45em;
  text-align: center;
  padding: 16px 0 16px .45em !important;
  min-height: 68px !important;
}
.pin-input::placeholder { color: var(--line-2); }

/* the one-time enrollment code an admin reads out to a printer */
.code-plate {
  margin: 18px 0 0;
  padding: 18px 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
  font-size: clamp(26px, 8vw, 34px);
  font-weight: 500;
  letter-spacing: .28em;
  text-indent: .28em;
}

/* ---------- print job ---------- */

.job-head { display: flex; gap: 14px; align-items: flex-start; }
.job-name { font: 500 21px/1.25 var(--display); letter-spacing: .01em; text-transform: none; overflow-wrap: anywhere; }
.job-file { overflow-wrap: anywhere; margin-top: 4px; color: var(--faint); }

.printer-pic {
  flex: none;
  display: block;
  width: 56px;
  height: 64px;
  object-fit: contain;
  background: radial-gradient(circle at 50% 60%, rgba(232, 176, 75, .08), transparent 70%);
}
.printer-pic.sm { width: 40px; height: 46px; }
.printer-pic.md { width: 64px; height: 74px; }
.printer-pic.lg { width: 96px; height: 112px; }
.printer-pic.placeholder {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  font: 500 10px/1 var(--mono);
  color: var(--faint);
}

.job-details { margin-top: 16px; }
.stats {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.stats > div { flex: 1 1 40%; background: var(--surface); padding: 10px 12px; min-width: 0; }
@media (min-width: 480px) { .stats > div { flex-basis: 28%; } }
.stats dt { font: 500 10px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.stats dd { margin: 2px 0 0; font: 500 15px/1.3 var(--display); overflow-wrap: anywhere; }

.filaments { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.filaments li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  font-size: 14px;
}
.swatch {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch, var(--faint));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.swatch.unknown { background: repeating-linear-gradient(45deg, var(--line-2) 0 3px, var(--surface) 3px 6px); }
.fil-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil-amount { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

.waiting-line { margin-top: 14px; }
.waiting-line .dot { margin: 0 6px 0 4px; }

/* ---------- status ---------- */

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font: 500 10px/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 6px 8px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.stamp.ok { color: var(--ok); background: var(--ok-dim); }
.stamp.no { color: var(--no); background: var(--no-dim); }
.stamp.wait { color: var(--accent); background: var(--accent-dim); }
.stamp.dim { color: var(--muted); border-color: var(--line-2); }

.hazard {
  position: absolute;
  inset: -1px -1px auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 45%, var(--accent) 55%, transparent) -60% 0 / 60% 100% no-repeat, var(--accent-dim);
  animation: sweep 2.4s var(--ease-out) infinite;
}
@keyframes sweep { to { background-position: 160% 0, 0 0; } }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); vertical-align: middle; }
.dot.live { background: var(--ok); animation: ping 2s infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(93, 219, 160, .55); }
  80%, 100% { box-shadow: 0 0 0 8px transparent; }
}

.big-state {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(28px, 8.4vw, 46px);
  line-height: 1.08;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tone-ok { color: var(--ok); }
.tone-no { color: var(--no); }
.tone-dim { color: var(--muted); }
.tone-wait { color: var(--accent); }

/* ---------- scanner: full screen, live camera ---------- */

html.qr-open, html.qr-open body { overflow: hidden; }

.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: var(--ink);
  overscroll-behavior: contain;
  touch-action: none;
}
.qr-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .25s var(--ease-out);
}
.qr-overlay.live .qr-video { opacity: 1; }

.qr-shade { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.qr-frame {
  --size: min(72vw, 52vh, 320px);
  position: relative;
  width: var(--size);
  height: var(--size);
  box-shadow: 0 0 0 200vmax rgba(5, 6, 9, .58);
  border-radius: 18px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 34px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 0 / 4px 34px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 34px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 0 / 4px 34px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 34px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 4px 34px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 34px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 4px 34px no-repeat;
  transition: transform .15s var(--ease-out);
}
.qr-beam {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
  animation: qr-scan 1.8s ease-in-out infinite alternate;
  opacity: 0;
}
.qr-overlay.live .qr-beam { opacity: 1; }
@keyframes qr-scan { from { top: 10%; } to { top: 90%; } }
.qr-frame.hit { transform: scale(.94); box-shadow: 0 0 0 200vmax rgba(5, 6, 9, .75), inset 0 0 0 4px var(--ok); }
.qr-frame.hit .qr-beam { display: none; }
.qr-overlay.failed .qr-frame { visibility: hidden; }

.qr-top, .qr-bottom { position: absolute; left: 0; right: 0; padding-inline: var(--gutter); }
.qr-top {
  top: 0;
  padding-top: calc(var(--sat) + 10px);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(rgba(0, 0, 0, .6), transparent);
}
.qr-title { font: 500 11px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; }
.qr-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(233, 236, 239, .28);
  border-radius: 22px;
  background: rgba(11, 13, 17, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font: 500 11px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
}
.qr-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--void); }
.qr-bottom {
  bottom: 0;
  padding-top: 40px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
}
.qr-hint { max-width: 420px; margin: 0 auto; font-size: 15px; }
.qr-extra:not(:empty) { max-width: 420px; margin: 16px auto 0; }
.qr-overlay.failed .qr-bottom { top: 0; display: flex; flex-direction: column; justify-content: center; background: var(--void); }

/* ---------- lists & cards ---------- */

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cards > li { min-width: 0; }
.wrap.wide .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.cards > li { animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.card-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  height: 100%;
}
a.card-link:active { background: var(--surface-2); }
@media (hover: hover) { a.card-link:hover { border-color: var(--line-2); } a.card-link:hover h3 { color: var(--accent); } }
.card-link h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-link p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid > * { min-width: 0; }
.grid > .ticket + .ticket { margin-top: 0; }

.printer-hero { display: flex; gap: 16px; align-items: center; }
.chip {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 12px;
}

dl.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
dl.facts dt { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding-top: 3px; }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.empty {
  padding: 24px 18px;
  text-align: center;
  color: var(--faint);
  border: 1px dashed var(--line-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
}

.notice { padding: 12px 14px; border: 1px solid currentColor; font-size: 14px; }
.notice.no { color: var(--no); background: var(--no-dim); }
.notice.ok { color: var(--ok); background: var(--ok-dim); }
.notice.info { color: var(--muted); background: var(--surface-2); border-color: var(--line-2); }

.install {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 8px 12px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  animation: rise .4s var(--ease-out) both;
}
.install img { flex: none; width: 44px; height: 44px; border-radius: 10px; }
.install strong { display: block; font-size: 14px; }
.ticket + div > .install { margin: 16px 0 0; }

/* ---------- dialogs: a bottom sheet on phones ---------- */

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  overscroll-behavior: contain;
}
dialog::backdrop { background: rgba(5, 6, 9, .72); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet { padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); }
.grabber { display: none; }
@media (max-width: 559px) {
  dialog {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    max-height: 92dvh;
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    animation: sheet .3s var(--ease-out) both;
  }
  .grabber { display: block; width: 40px; height: 4px; margin: -10px auto 16px; border-radius: 2px; background: var(--line-2); }
  .sheet .btn-row.end > .btn { flex: 1 1 0; }
}
@media (min-width: 560px) { .sheet { padding: 28px; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast {
  /* Centered with margins, not a transform: the entrance animation sets
   * transform too, and would push the toast half off the screen. */
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: fit-content;
  max-width: 560px;
  margin-inline: auto;
  overflow-wrap: anywhere;
  padding: 13px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  color: var(--ink);
  font-size: 14px;
  box-shadow: 0 18px 40px -18px #000;
  animation: rise .3s var(--ease-out) both;
  z-index: 40;
}

footer.credit {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
}

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
