/* Smart Print QR - Green-Blue Gradient Theme
   Locked to Light Mode, Inter font, premium aesthetics */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #111827;
  --ink-2: #4B5563;
  --ink-3: #6B7280;
  --line: #E5E7EB;
  --line-2: #F3F4F6;
  --bg: #F8FAFC;
  --card: #ffffff;

  /* Blue Theme */
  --accent: #2563EB;
  --accent-ink: #ffffff;
  --accent-soft: #EFF6FF;
  
  --accent-glow: rgba(37, 99, 235, 0.25);

  --wait: #D97706;
  --wait-soft: #FEF3C7;
  --live: #2563EB;
  --live-soft: #EFF6FF;
  --good: #059669;
  --good-soft: #D1FAE5;
  --bad: #DC2626;
  --bad-soft: #FEE2E2;

  --r: 20px;
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 8px -2px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 12px 30px -5px rgba(0, 0, 0, 0.08), 0 6px 12px -5px rgba(0, 0, 0, 0.05);
  --shadow-inner: inset 0 2px 4px 0 rgba(255,255,255,0.3);
  --tap: 48px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* Light green → green → blue ambient gradient */
  background: linear-gradient(135deg,
    #e8faf0 0%,
    #c6f0d8 15%,
    #a8e6c4 30%,
    #7dd8b0 45%,
    #4dc4a0 58%,
    #2ab5c8 72%,
    #1a9ed4 85%,
    #1080d0 100%
  ) fixed;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.55 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- layout ---------- */

.wrap { max-width: 48rem; margin: 0 auto; padding: 24px 16px 96px; min-width: 0; }
.wrap-wide { max-width: 84rem; margin: 0 auto; padding: 24px 24px 64px; min-width: 0; overflow-x: hidden; }

/* Dashboard Grid Layouts */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 768px) {
  .dash-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .dash-layout { grid-template-columns: 320px 1fr; align-items: start; }
}

.global-header {
  display: flex;
  flex-direction: row;         /* always horizontal */
  flex-wrap: nowrap;           /* NEVER wrap to second line */
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;            /* clip content that overflows */
}
.global-header .logo-area {
  display: flex;
  flex-direction: row;         /* logos always in a row */
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  flex-shrink: 0;              /* never shrink logo area */
  overflow: hidden;
  max-width: 60%;              /* give actions space on right */
}
.global-header .logo-area img { height: 48px; }
.global-header .actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

/* Dual-logo layout: APHD logo | divider | Turant icon */
.dual-logo {
  display: flex;
  flex-direction: row;        /* ALWAYS row, never column */
  align-items: center;
  flex-wrap: nowrap;          /* never wrap to second line */
  gap: 0;
}
.dual-logo .logo-aphd {
  height: 52px;               /* larger APHD logo */
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
  display: block;
  flex-shrink: 0;
}
.dual-logo .logo-divider {
  display: block;
  width: 2px;                 /* solid visible line */
  height: 40px;
  background: #9ca3af;        /* solid grey — no fade so it's always visible */
  margin: 0 12px;
  flex-shrink: 0;
  border-radius: 2px;
}
.dual-logo .logo-turant {
  height: 40px;
  width: auto;
  max-width: 48px;            /* icon only, keep compact */
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--r);
  padding: 36px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100%;
  min-width: 0;
  overflow: hidden; /* keep long file names inside the card */
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.card + .card { margin-top: 24px; }
.stack > * + * { margin-top: 24px; }

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

label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }

input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; min-height: var(--tap);
  padding: 12px 20px;
  font: inherit; color: var(--ink);
  background: var(--card);
  border: 1px solid #D1D5DB;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder { color: var(--ink-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
button:focus-visible, a:focus-visible, label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field + .field { margin-top: 16px; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 8px; }

/* segmented choice: the whole tile is the tap target */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  margin: 0; display: flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 12px;
  text-align: center; font-size: 1rem; font-weight: 600; color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .1s;
}
.seg label:hover {
  border-color: #cbd5e1;
  background: var(--line-2);
}
.seg input:checked + label {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* stepper */
.step { display: flex; align-items: center; gap: 12px; }
.step button {
  width: var(--tap); height: var(--tap); flex: none;
  font-size: 1.5rem; font-weight: 500; line-height: 1;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 9999px;
  cursor: pointer;
  transition: background .2s;
}
.step button:hover { background: var(--line-2); }
.step button:active { transform: scale(.95); }
.step output {
  flex: 1; text-align: center;
  font-size: 1.4rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 12px 28px;
  font: inherit; font-weight: 600; font-size: 1rem;
  color: var(--accent-ink); 
  background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
  border: 1px solid #1D4ED8; border-radius: 9999px;
  cursor: pointer; text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--accent-glow), var(--shadow-inner);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { 
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow), var(--shadow-inner);
  filter: brightness(1.05);
  text-decoration: none;
}
.btn:active { transform: translateY(0); box-shadow: 0 2px 4px var(--accent-glow); filter: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; filter: none; }
.btn-wide { width: 100%; }

.btn-ghost {
  color: var(--ink); background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  text-shadow: none;
}
.btn-ghost:hover { 
  background: var(--line-2); 
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  filter: none;
  border-color: #cbd5e1;
}

.btn-sm { min-height: 38px; padding: 7px 16px; font-size: .85rem; }
.btn-bad { color: var(--accent-ink); background: var(--bad); border-color: var(--bad); box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25); }
.btn-bad:hover { background: #b91c1c; }

/* ---------- file drop ---------- */

.drop {
  display: block; text-align: center; cursor: pointer;
  padding: 64px 24px;
  border: 2px dashed #93C5FD;
  border-radius: var(--r);
  background: #F8FAFC;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
  overflow: hidden; /* long filenames must not widen the page */
  max-width: 100%;
  box-sizing: border-box;
}
.drop:hover, .drop.hot { 
  border-color: var(--accent); 
  background: #EFF6FF; 
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.1);
}
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .big {
  display: block;
  font-size: 1.25rem; font-weight: 700; color: var(--accent);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}
.drop .small {
  display: block;
  font-size: .9rem; color: var(--ink-2); margin-top: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- price bar ---------- */

.pricebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .05);
}
.pricebar .inner {
  max-width: 38rem; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.pricebar .amt { flex: 1; min-width: 0; }
.pricebar .btn { flex-shrink: 0; min-width: 140px; text-align: center; font-size: 1rem; padding: 12px 20px; }
.pricebar .rs { font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pricebar .meta { font-size: .85rem; color: var(--ink-3); font-weight: 500; }

/* submit button label states */
.spin { display: none; }
.htmx-request .lbl-idle { display: none; }
.htmx-request .spin { display: inline; }

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

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 9999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  white-space: nowrap;
}
.pill-wait { color: var(--wait); background: var(--wait-soft); border: 1px solid #fde68a; }
.pill-live { color: var(--live); background: var(--live-soft); border: 1px solid #bfdbfe; }
.pill-good { color: var(--good); background: var(--good-soft); border: 1px solid #a7f3d0; }
.pill-bad  { color: var(--bad);  background: var(--bad-soft); border: 1px solid #fecaca; }

.dot { width: 8px; height: 8px; border-radius: 9999px; background: currentColor; flex: none; }
.pill-live .dot { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

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

.ticket {
  text-align: center; padding: 40px 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.ticket .lbl { font-size: .9rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.ticket .no {
  font-size: 4rem; font-weight: 800; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; margin: 8px 0 16px; color: var(--accent);
}

.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 24px 0; color: var(--ink-3); font-size: 1.1rem;
  position: relative;
}
.steps li + li { border-top: 1px solid var(--line-2); }
.steps .mark {
  width: 32px; height: 32px; flex: none; margin-top: 2px;
  display: grid; place-items: center;
  border-radius: 50%; font-size: .85rem; font-weight: 800;
  background: var(--line-2); color: var(--ink-3);
  transition: all 0.3s ease;
}
.steps li.on { color: var(--ink); font-weight: 700; }
.steps li.on .mark { 
  background: var(--accent); color: var(--accent-ink); 
  box-shadow: 0 4px 12px var(--accent-glow), inset 0 2px 4px rgba(255,255,255,0.3); 
  transform: scale(1.1);
}
.steps li.past { color: var(--ink-2); font-weight: 500; }
.steps li.past .mark { background: var(--good-soft); color: var(--good); }

.notice {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 24px; border-radius: var(--r);
  font-size: 1rem; font-weight: 500;
  background: var(--wait-soft); color: var(--wait);
  border: 1px solid #fde68a;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.05);
}
.notice-bad { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.05); }
.notice strong { font-weight: 700; display: block; margin-bottom: 4px; color: var(--ink); }

.rows { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.rows li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; }
.rows li + li { border-top: 1px solid var(--line-2); }
.rows .k { color: var(--ink-3); font-weight: 500; }
.rows .v { font-weight: 600; text-align: right; }

/* ---------- admin ---------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 28px 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.04); }
.stat .n { font-size: 2.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink); }
.stat .k { font-size: .9rem; font-weight: 600; color: var(--ink-3); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.05em; }

.jobs { display: grid; gap: 16px; }
.job {
  background: var(--card); border: 1px solid var(--line);
  border-left: 6px solid var(--line);
  border-radius: var(--r); padding: 24px;
  display: grid; gap: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.job:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.04); }
.job.s-PENDING  { border-left-color: var(--wait); }
.job.s-PRINTING { border-left-color: var(--live); }
.job.s-DONE     { border-left-color: var(--good); }
.job.s-FAILED, .job.s-REJECTED { border-left-color: var(--bad); }

.job .head {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
  max-width: 100%;
}
.job .tk { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.job .fn {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: .95rem; font-weight: 500; color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job .spec { font-size: .85rem; color: var(--ink-3); }
.job .acts { display: flex; gap: 12px; flex-wrap: wrap; }
.job .rs { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--accent); }

.empty { text-align: center; padding: 64px 20px; color: var(--ink-3); }
.empty .big { font-size: 1.2rem; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }

.bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-radius: 9999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: .95rem; font-weight: 600;
  box-shadow: var(--shadow);
}
.bar.off { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.bar.on { color: var(--good); border-color: #a7f3d0; background: var(--good-soft); }

details.settings { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 12px rgba(0,0,0,0.02); }
details.settings summary {
  padding: 24px; cursor: pointer; font-weight: 700; font-size: 1.1rem;
  transition: background 0.2s;
}
details.settings summary:hover { background: var(--bg); }
details.settings .body { padding: 0 24px 32px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- landing ---------- */

.hero { padding: 120px 0 96px; text-align: center; }
.hero h1 {
  font-size: clamp(3rem, 7vw, 5rem); font-weight: 800;
  letter-spacing: -.04em; max-width: 22ch; margin: 0 auto;
  background: linear-gradient(135deg, var(--ink) 0%, #374151 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.25rem; color: var(--ink-2); max-width: 46ch; margin: 24px auto 0; line-height: 1.6; }
.hero .cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 48px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }

.flow { display: grid; gap: 24px; counter-reset: n; padding: 0; margin-top: 32px; }
.flow li { 
  list-style: none; display: flex; gap: 24px; padding: 32px; 
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}
.flow li:hover {
  transform: translateX(4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.04);
}
.flow .n {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.5);
}
.flow h3 { margin-bottom: 8px; font-size: 1.25rem; color: var(--ink); }
.flow p { font-size: 1.05rem; color: var(--ink-2); line-height: 1.6; }

.sect { padding: 76px 0; border-top: 1px solid var(--line); }
.sect h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; max-width: 28ch; }
.lede { color: var(--ink-2); margin-top: 16px; max-width: 52ch; font-size: 1.1rem; line-height: 1.6; }

.price-card {
  background: var(--card); border: 1px solid #bfdbfe; border-radius: 24px;
  padding: 48px; box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.1);
  position: relative; overflow: hidden;
}
.price-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, #3B82F6 0%, #2563EB 100%);
}
.price-card .amt { font-size: 3.5rem; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.price-card .per { font-size: 1.1rem; color: var(--ink-3); font-weight: 600; }
.price-card ul { list-style: none; margin: 32px 0 0; padding: 0; font-size: 1.1rem; }
.price-card li { padding: 12px 0; color: var(--ink-2); display: flex; gap: 16px; font-weight: 500; align-items: center; }
.price-card li::before { 
  content: "✓"; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--good-soft); color: var(--good); font-weight: 800; font-size: 0.9rem;
}

.foot {
  border-top: 1px solid var(--line); padding: 32px 0;
  font-size: .95rem; color: var(--ink-3);
  display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; font-weight: 500;
}

/* ---------- qr poster ---------- */

.poster {
  background: #fff; color: #111827;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 56px 40px; text-align: center; max-width: 32rem; margin: 0 auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}
.poster h2 { font-size: 2.25rem; font-weight: 800; letter-spacing: -.04em; }
.poster .qr { margin: 32px auto 24px; display: block; width: 100%; max-width: 16rem; height: auto; }
.poster .rate { font-size: 1.15rem; font-weight: 600; color: #4B5563; }
.poster .url { font-size: .9rem; font-weight: 500; color: #9CA3AF; margin-top: 16px; word-break: break-all; }

.token {
  font: .9rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--line-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 20px; word-break: break-all; color: var(--ink-2); font-weight: 600;
}

/* ---------- misc ---------- */

.spin { display: none; }
.htmx-request .spin { display: inline-flex; }
.htmx-request .lbl-idle { display: none; }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 9999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; text-transform: uppercase;
  background: var(--line-2); color: var(--ink-3);
}
.badge-ok   { background: var(--good-soft); color: var(--good); border: 1px solid #a7f3d0; }
.badge-warn { background: var(--wait-soft); color: var(--wait); border: 1px solid #fde68a; }
.badge-bad  { background: var(--bad-soft);  color: var(--bad); border: 1px solid #fecaca; }

.btn-warn { color: var(--wait); background: var(--wait-soft); border-color: #fde68a; }
.btn-warn:hover { background: #fef08a; box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.center { text-align: center; }
.mt { margin-top: 24px; }
.muted { color: var(--ink-3); font-size: .9rem; }

@media (max-width: 768px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
  .sect { padding: 48px 0; }
}

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

@media print {
  .global-header, .pricebar, .no-print { display: none !important; }
  body { background: #fff; }
  .poster { border: none; max-width: none; box-shadow: none; }
}

@media (max-width: 600px) {
  /* ── Header: single-row, no wrapping ── */
  .global-header {
    padding: 0 8px;
    min-height: 56px;
    gap: 6px;
  }

  /* Logo area: stays in one row, clips if too wide */
  .global-header .logo-area {
    max-width: 55%;
    flex-shrink: 0;
  }

  /* APHD logo: scale down proportionally */
  .dual-logo .logo-aphd {
    height: 32px;
    max-width: 100px;
    object-fit: contain;
  }

  /* Solid divider */
  .dual-logo .logo-divider {
    height: 24px;
    width: 2px;
    margin: 0 7px;
    background: #9ca3af;
  }

  /* Turant icon */
  .dual-logo .logo-turant {
    height: 28px;
    max-width: 28px;
    object-fit: contain;
  }

  /* Action buttons: shrink font & padding on mobile */
  .global-header .actions {
    gap: 4px;
    flex-shrink: 0;
  }
  .global-header .actions .btn,
  .global-header .actions .btn-ghost,
  .global-header .actions .btn-sm {
    font-size: 0.72rem;
    padding: 5px 8px;
    min-height: 32px;
    border-radius: 8px;
  }

  /* General page elements */
  .drop { padding: 32px 16px; }
  .drop .big { word-break: break-all; overflow-wrap: break-word; text-align: center; }
  .seg label { min-height: 44px; padding: 6px 4px; font-size: 0.85rem; line-height: 1.2; }

  /* Hide shop name in header on mobile — it shows in the page content */
  .header-shop-name {
    display: none;
  }

  .pricebar { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .pricebar .inner { gap: 12px; }
  .pricebar .btn { min-width: 110px; font-size: .85rem; padding: 10px 12px; }
  .pricebar .rs { font-size: 1.4rem; }
}