/* PalPrintPal "printer screen" skin. Loaded after style.css on every page.
   The whole site is styled like the touchscreen on a 3D printer: dark glass panel, chunky touch tiles that press in,
   corner brackets, mono read-outs, and progress shown as printed layers. Light mode is the same screen in daylight. */

:root {
  --font-display: "Chakra Petch", "Rajdhani", system-ui, sans-serif;
  --font-body: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --heat: #FFB84D;      /* "heating" amber */
  --ready: #3DDC97;     /* "ready" green */
  --scan: #5CE1FF;      /* cyan */
  --tick: rgba(92, 225, 255, .55);
  --radius: 14px;
}
:root[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg: #04070F;
  --bg-glow: rgba(47, 91, 221, .42);
  --bg-glow-2: rgba(92, 225, 255, .10);
  --card: linear-gradient(180deg, rgba(20, 34, 78, .72), rgba(8, 14, 36, .86));
  --card-edge: inset 0 1px 0 rgba(160, 200, 255, .14), 0 0 0 1px rgba(92, 225, 255, .05), 0 26px 50px -30px rgba(0, 0, 0, .95);
  --field: rgba(2, 5, 16, .78);
  --line: rgba(110, 160, 255, .20);
  --line-strong: rgba(120, 175, 255, .42);
  --ink: #E9F0FF;
  --muted: #9FB0D8;
  --accent: #8FB4FF;
  --focus: #5CE1FF;
  --cta-bg: #2F5BDD;
  --cta-ink: #FFFFFF;
  --ok: #3DDC97;
  --bad: #FF7A70;
  --tick: rgba(92, 225, 255, .6);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EEF2FA;
  --card: #FFFFFF;
  --field: #F1F4FB;
  --line: #CBD5EC;
  --line-strong: #8FA2D2;
  --ink: #0A1431;
  --muted: #4A5779;
  --accent: #1E47C4;
  --focus: #1E47C4;
  --cta-bg: #1E47C4;
  --cta-ink: #FFFFFF;
  --tick: rgba(30, 71, 196, .5);
  --ready: #17703A;
}

html { -webkit-tap-highlight-color: transparent; }
body { font-feature-settings: "tnum" 1; }
h1, h2, h3, h4, .brand-name { font-family: var(--font-display); font-weight: 600; letter-spacing: .005em; }
h1 { text-transform: none; }
.eyebrow, .pill-tag, label, .lbl { font-family: var(--font-display); }
.eyebrow { letter-spacing: .18em; color: var(--scan); }
:root[data-theme="light"] .eyebrow { color: var(--accent); }
.price, .bal, .count, .ledger .amt, .kv td.num, .step-n, output { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* build-plate grid under everything */
body::after {
  content: ""; position: fixed; inset: auto 0 0 0; height: 46vh; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(92, 225, 255, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 225, 255, .10) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(520px) rotateX(58deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%); mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  opacity: .55;
}
:root[data-theme="light"] body::after { opacity: .25; }

/* ---------- header = the status bar ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand .logo { height: 30px; width: auto; display: block; }
.brand .logo-d { display: none; }
:root[data-theme="light"] .brand .logo-l { display: none; }
:root[data-theme="light"] .brand .logo-d { display: block; }
.brand-name { font-size: 1.12rem; letter-spacing: .02em; }
.head-wrap { border-bottom: 1px solid var(--line); }
.head-wrap .head-actions .btn.sm { border-radius: 10px; }

/* ---------- panels ---------- */
.card { border-radius: var(--radius); background: var(--card); }
.card::after, .wiz::after {
  content: ""; position: absolute; inset: 5px; pointer-events: none; border-radius: 10px;
  background:
    linear-gradient(var(--tick), var(--tick)) top left / 14px 1.5px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top left / 1.5px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top right / 14px 1.5px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top right / 1.5px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom left / 14px 1.5px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom left / 1.5px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom right / 14px 1.5px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom right / 1.5px 14px no-repeat;
}
.wiz { position: relative; }

/* ---------- buttons: chunky, they press in ---------- */
.btn {
  min-height: 44px; border-radius: 12px; font-family: var(--font-display); font-weight: 600; letter-spacing: .02em;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cta-bg) 88%, #fff), var(--cta-bg));
  border: 1px solid color-mix(in srgb, var(--cta-bg) 60%, #fff);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--cta-bg) 55%, #000), 0 8px 22px -8px var(--cta-bg);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 color-mix(in srgb, var(--cta-bg) 55%, #000), 0 2px 8px -4px var(--cta-bg); }
.btn.line { background: transparent; box-shadow: 0 3px 0 var(--line); border-color: var(--line-strong); }
.btn.line:active:not(:disabled) { box-shadow: 0 0 0 var(--line); }
.btn:focus-visible, .tile:focus-visible, .rs:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

input, select, textarea { border-radius: 10px; border-color: var(--line-strong); font-family: var(--font-body); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }

/* ---------- tabs = the printer menu ---------- */
.tabs.pill { display: flex; width: 100%; max-width: 100%; overflow-x: auto; scrollbar-width: none; border-radius: var(--radius); padding: 5px; gap: 5px; background: var(--field); border-color: var(--line-strong); }
.tabs.pill::-webkit-scrollbar { display: none; }
.tabs.pill button { flex: 1 0 auto; justify-content: center; border-radius: 10px; font-family: var(--font-display); min-height: 44px; letter-spacing: .02em; position: relative; }
.tabs.pill button[aria-selected="true"] { background: color-mix(in srgb, var(--cta-bg) 85%, transparent); color: #fff; box-shadow: 0 0 0 1px var(--focus) inset, 0 0 22px -6px var(--focus); }

/* ---------- progress = printed layers ---------- */
.wiz-bar { height: 12px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 8px); overflow: hidden; }
.wiz-bar i { border-radius: 0; background: repeating-linear-gradient(90deg, var(--focus) 0 6px, transparent 6px 8px); box-shadow: 0 0 14px color-mix(in srgb, var(--focus) 70%, transparent); }
.order .o-bar { border-radius: 4px; }
.stepper .dot { border-radius: 8px; font-family: var(--font-mono); }
.stepper li.cur .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent), 0 0 18px -2px var(--focus); }

/* ---------- touch tiles ---------- */
.tile { border-radius: var(--radius); min-height: 64px; background: var(--field); border-color: var(--line-strong); box-shadow: 0 3px 0 var(--line); transition: transform .08s ease, box-shadow .08s ease, border-color .15s ease; position: relative; }
.tile strong { font-family: var(--font-display); font-size: 1rem; }
.tile:hover { transform: none; border-color: var(--focus); }
.tile:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.tile[aria-pressed="true"] { background: color-mix(in srgb, var(--cta-bg) 78%, #000); border-color: var(--focus); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--cta-bg) 50%, #000), 0 0 26px -8px var(--focus); }
.tile[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 10px; font: 700 .8rem/1 var(--font-mono); color: var(--focus); }
.chip-btn { border-radius: 10px; font-family: var(--font-display); min-height: 40px; }
.chip-btn[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--focus) inset, 0 0 18px -6px var(--focus); }
.cpick { border-radius: var(--radius); }
.badge { font-family: var(--font-mono); letter-spacing: .04em; border-radius: 6px; }

/* ---------- status read-outs ---------- */
.dash-hero h1 { text-shadow: 0 0 28px color-mix(in srgb, var(--focus) 35%, transparent); }
.toast { border-radius: 12px; font-family: var(--font-display); border: 1px solid var(--focus); }
.rating .st.on { color: var(--heat); text-shadow: 0 0 10px rgba(255, 184, 77, .45); }

/* ---------- mascot ---------- */
.mascot { display: block; width: var(--m, 120px); height: auto; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .45)); }
.mascot.bob { animation: bob 3.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.empty-state .mascot, .empty .mascot { margin: 0 auto 10px; --m: 110px; }
.boot-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .35s ease, visibility .35s; }
.boot-screen.done { opacity: 0; visibility: hidden; }
.boot-screen .box { display: grid; gap: 14px; justify-items: center; font: 600 .78rem/1 var(--font-mono); letter-spacing: .2em; color: var(--muted); }
.boot-screen .box .mascot { --m: 96px; }
.boot-bar { width: 180px; height: 8px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 8px); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--focus) 0 6px, transparent 6px 8px); animation: boot .9s ease-out forwards; }
@keyframes boot { to { width: 100%; } }

/* ---------- legal pages ---------- */
.legal { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; padding: 10px 0 60px; }
.legal-toc { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); font-size: .84rem; }
.legal-toc h2 { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 8px; color: var(--scan); }
.legal-toc a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; line-height: 1.3; }
.legal-toc a:hover { color: var(--ink); background: color-mix(in srgb, var(--focus) 12%, transparent); }
.legal-doc { min-width: 0; }
.legal-doc > header h1 { margin: 6px 0 8px; font-size: clamp(1.9rem, 4vw, 2.8rem); }
.legal-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; font: 500 .74rem/1 var(--font-mono); color: var(--muted); }
.legal-meta span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); }
.legal-notice { margin: 18px 0; padding: 14px 16px; border-left: 3px solid var(--heat); border-radius: 8px; background: color-mix(in srgb, var(--heat) 10%, transparent); font-size: .92rem; }
.legal-doc section { margin: 30px 0; scroll-margin-top: 96px; }
.legal-doc h2 { font-size: 1.28rem; margin: 0 0 10px; padding-top: 4px; }
.legal-doc h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.legal-doc p, .legal-doc li { line-height: 1.7; }
.legal-doc li { margin: 5px 0; }
.legal-doc ul, .legal-doc ol { padding-left: 1.3rem; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.legal-doc table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.legal-doc th, .legal-doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.legal-doc th { font-family: var(--font-display); background: var(--field); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.legal-doc tr:last-child td { border-bottom: 0; }
.legal-doc code { font-family: var(--font-mono); font-size: .82em; padding: 1px 5px; border-radius: 4px; background: var(--field); border: 1px solid var(--line); }
.legal-doc a { color: var(--accent); }
.legal-bm { margin-top: 48px; padding-top: 28px; border-top: 1px dashed var(--line-strong); }
.legal-others { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- cookie notice ---------- */
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90; max-width: 640px; margin: 0 auto; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); background-color: var(--bg); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .75); display: grid; gap: 12px; animation: rise .35s ease both; }
.cookie-bar p { margin: 0; font-size: .86rem; line-height: 1.55; }
.cookie-bar .row { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-bar .btn { flex: 1 1 140px; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }

@media (max-width: 860px) {
  .legal { grid-template-columns: 1fr; }
  .legal-toc { position: static; max-height: none; }
  .brand-name { font-size: 1rem; }
  body::after { height: 30vh; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot.bob, .cookie-bar, .boot-bar i { animation: none; }
  .boot-bar i { width: 100%; }
  .btn, .tile { transition: none; }
}

@media (max-width: 520px) {
  #theme { font-size: 0; padding: 8px 12px; min-width: 44px; }
  #theme::before { content: "◐"; font-size: 1.05rem; line-height: 1; }
  .head-wrap .head-actions { gap: 6px; }
}
.foot-brand .brand .logo { height: 34px; }
.auth-copy .mascot { --m: 132px; margin: 0 0 14px; }
