/* ════════ Allergy Buddy — Label Generator · "Product-first" design system ════════ */
  :root {
    --bg:#F8F6F1; --bg-2:#EFEDE5; --paper:#FDFCFA;
    --ink:#14181D; --ink-2:#4D535D; --ink-3:#616770;
    --line:#E3DFD4; --line-2:#CFC9BB;
    --red:#B9322A; --red-deep:#7A1E18; --red-soft:#F1DDD9;
    --accent:#B9322A; --accent-deep:#7A1E18; --accent-soft:#F1DDD9;
    --blue:#2A4A8A; --green:#3F7A44; --gold:#C98A2C;
    --plan-green:#2A7A3A; --plan-dgreen:#143D22;   /* ASCIA: allergic reaction / drug allergy (anaphylaxis uses --red). green darkened to ~5.3:1 on white */
    --plan-grey:#5C636E;   /* "other" — neutral, white text still ~5.6:1 */
    --sans:"DM Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
    --mono:"DM Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
    --max:1200px; --radius:14px;
  }
  * { box-sizing:border-box; }
  html,body { margin:0; padding:0; }
  /* body/a/footer are scoped to the standalone mockup (body.lab-standalone) so they don't bleed into
     the WordPress shell — on the live page (template-labels.php) the site's own body/links/footer apply */
  .lab-standalone { background:var(--bg); color:var(--ink); font-family:var(--sans); font-size:16px; line-height:1.55; -webkit-font-smoothing:antialiased; }
  .wrap { max-width:var(--max); margin:0 auto; padding:0 28px; }
  .lab-standalone a { color:inherit; text-decoration:none; }
  .lab-standalone img { max-width:100%; display:block; }
  h1,h2,h3,h4 { font-family:var(--sans); font-weight:500; letter-spacing:-0.025em; line-height:1.08; margin:0; color:var(--ink); }
  h1,h2 { text-wrap:balance; }
  .reg { font-size:0.55em; vertical-align:0.7em; color:var(--ink-3); margin-left:1px; }
  .stamp { position:fixed; top:14px; right:14px; z-index:100; background:var(--ink); color:var(--bg); padding:7px 13px; border-radius:999px; font-family:var(--mono); font-size:10.5px; font-weight:500; letter-spacing:0.08em; text-transform:uppercase; }

  .eyebrow { font-family:var(--mono); font-size:11.5px; font-weight:500; letter-spacing:0.16em; text-transform:uppercase; color:var(--ink-3); display:inline-flex; align-items:center; gap:10px; }
  .eyebrow--red { color:var(--accent); }
  .eyebrow::before { content:""; width:18px; height:2px; background:var(--accent); border-radius:2px; }

  .btn { display:inline-flex; align-items:center; justify-content:center; gap:9px; padding:14px 22px; border-radius:999px; font-family:var(--sans); font-size:14.5px; font-weight:500; line-height:1; border:1.5px solid transparent; cursor:pointer; transition:background-color .18s,color .18s,border-color .18s,transform .18s; }
  .btn:hover { transform:translateY(-1px); }
  .btn--cta { background:var(--accent); color:#fff; border-color:var(--accent); }
  .btn--cta:hover { background:var(--accent-deep); border-color:var(--accent-deep); }
  .btn--ink { background:var(--ink); color:var(--paper); border-color:var(--ink); }
  .btn--ink:hover { background:#000; }
  .btn--ghost { background:transparent; color:var(--ink); border-color:var(--line-2); }
  .btn--ghost:hover { border-color:var(--ink); }
  .btn--sm { padding:10px 16px; font-size:13px; }
  .btn--block { width:100%; }
  .btn[disabled] { opacity:.45; cursor:not-allowed; transform:none; }
  .btn .arr { transition:transform .18s; } .btn:hover .arr { transform:translateX(3px); }

  .topbar { background:var(--ink); color:var(--bg); font-size:12.5px; }
  .topbar .wrap { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:9px 28px; flex-wrap:wrap; }
  .topbar .left { display:flex; gap:22px; flex-wrap:wrap; }
  .topbar .left span { display:inline-flex; align-items:center; gap:8px; color:#E7E0D2; }
  .topbar .left span::before { content:""; width:6px; height:6px; border-radius:50%; background:var(--red); }
  .topbar .left span:nth-child(2)::before { background:var(--green); }
  .topbar .right { display:flex; gap:18px; } .topbar .right a { color:#CFC8BA; } .topbar .right a:hover { color:#fff; }
  nav.top { background:rgba(248,246,241,.9); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); position:sticky; top:0; z-index:40; border-bottom:1px solid var(--line); }
  nav.top .wrap { display:flex; align-items:center; justify-content:space-between; height:96px; }
  .brand img { height:74px; width:auto; }
  .nav-links { display:flex; gap:28px; font-size:15px; font-weight:500; color:var(--ink-2); }
  .nav-links a:hover, .nav-links a.is-active { color:var(--accent); }
  .nav-right { display:flex; align-items:center; gap:12px; }
  .cart-pill { display:inline-flex; align-items:center; gap:7px; padding:9px 13px; border:1px solid var(--line-2); border-radius:999px; font-family:var(--mono); font-size:12px; }
  .cart-pill .count { background:var(--accent); color:#fff; width:17px; height:17px; border-radius:50%; display:grid; place-items:center; font-size:10.5px; }

  /* Page sections sit on the off-white ground. GP's content well is --base-3;
     these rules load after it and cover the hero and the builder. */
  .separate-containers .inside-article,
  header.hero,
  .app { background-color: var(--bg); }

  /* hero + privacy banner */
  header.hero { padding:52px 0 22px; }
  header.hero .eyebrow { margin-bottom:16px; }
  h1.hero-title { font-size:clamp(30px,4.4vw,50px); line-height:1.02; letter-spacing:-0.03em; max-width:20ch; }
  .hero-lead { font-size:clamp(16px,1.7vw,18px); color:var(--ink-2); margin:18px 0 0; max-width:58ch; }
  .privacy-banner { display:flex; align-items:center; gap:14px; background:#E7F0E8; border:1px solid #CDE3D2; border-radius:14px; padding:16px 20px; margin-top:26px; }
  .privacy-banner .lock { width:38px; height:38px; flex-shrink:0; border-radius:10px; background:var(--green); color:#fff; display:grid; place-items:center; font-size:18px; }
  .privacy-banner b { color:#234B2C; } .privacy-banner p { margin:0; font-size:14px; color:#3C5A41; line-height:1.45; }

  /* live WP page: GeneratePress's .site-content is display:flex, so this wrapper is one full-width
     flex item — keeps the hero stacked above the builder instead of beside it (inert on the mockup) */
  .lab-content { flex:1 1 100%; min-width:0; }

  /* app */
  .app { padding:30px 0 84px; }
  .app-grid { display:grid; grid-template-columns:1.05fr 0.95fr; gap:40px; align-items:start; }

  /* form */
  .form-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:30px; }
  .form-card .step-lab { font-family:var(--mono); font-size:11px; letter-spacing:0.1em; text-transform:uppercase; color:var(--accent); }
  .form-card h2 { font-size:23px; letter-spacing:-0.02em; margin:8px 0 22px; }
  form { display:flex; flex-direction:column; gap:18px; }
  .row2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
  .field { display:flex; flex-direction:column; gap:7px; }
  .field label { font-family:var(--mono); font-size:11px; letter-spacing:0.06em; text-transform:uppercase; color:var(--ink-3); }
  .field .opt { color:var(--ink-3); text-transform:none; letter-spacing:0; }
  .field input, .field select { font-family:var(--sans); font-size:15px; color:var(--ink); background:var(--bg); border:1.5px solid var(--line-2); border-radius:10px; padding:12px 14px; width:100%; transition:border-color .15s, box-shadow .15s; }
  .field select { appearance:none; -webkit-appearance:none; cursor:pointer; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238A909A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; padding-right:36px; }
  .field input:focus, .field select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); background-color:var(--paper); }
  .field .warn { font-size:12px; color:var(--red); display:inline-flex; align-items:center; gap:6px; margin-top:2px; }

  /* photo dropzone */
  .dropzone { display:flex; align-items:center; gap:16px; border:1.5px dashed var(--line-2); border-radius:12px; padding:14px; cursor:pointer; transition:border-color .15s, background .15s; }
  .dropzone:hover, .dropzone.is-drag { border-color:var(--accent); background:var(--accent-soft); }
  .dropzone .thumb { width:56px; height:72px; border-radius:8px; flex-shrink:0; background:repeating-linear-gradient(135deg,var(--bg-2) 0 6px,var(--red-soft) 6px 12px); border:1px solid var(--line-2); background-size:cover; background-position:center; }
  .dropzone .dz-text strong { display:block; font-size:14px; font-weight:600; color:var(--ink); }
  .dropzone .dz-text span { font-size:12.5px; color:var(--ink-2); }
  .dropzone input { display:none; }

  /* chip input */
  .chipbox { display:flex; flex-wrap:wrap; gap:7px; align-items:center; background:var(--bg); border:1.5px solid var(--line-2); border-radius:10px; padding:9px 10px; transition:border-color .15s, box-shadow .15s; }
  .chipbox:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); background:var(--paper); }
  /* soft tinted pills — light so they don't fight the red primary button; allergy = green, medication = blue */
  .chip { display:inline-flex; align-items:center; gap:7px; background:#E2F0E4; color:#235C2C; border:1px solid rgba(35,92,44,.18); border-radius:999px; padding:5px 6px 5px 12px; font-size:13px; font-weight:500; }
  .chip.is-med { background:#E4EAF4; color:var(--blue); border-color:rgba(42,74,138,.18); }
  /* 18px circle, but a 24px tap target (WCAG 2.5.8) via a transparent border that the chip bg shows through */
  .chip button { margin:0; padding:0; border:3px solid transparent; background:rgba(0,0,0,.07); background-clip:padding-box; color:inherit; width:18px; height:18px; border-radius:50%; cursor:pointer; font-size:15px; line-height:1; font-family:inherit; display:grid; place-items:center; flex-shrink:0; transition:background .15s; }
  .chip button:hover { background:rgba(0,0,0,.15); }
  .chipbox input { border:0; background:transparent; outline:none; font-family:var(--sans); font-size:14.5px; color:var(--ink); flex:1; min-width:120px; padding:5px 2px; }
  .hint { font-size:12px; color:var(--ink-3); }
  .form-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:6px; }

  /* preview column */
  .preview { position:sticky; top:118px; display:flex; flex-direction:column; gap:20px; }
  .preview-lab { display:flex; justify-content:space-between; align-items:center; }
  .preview-lab .eyebrow { color:var(--ink-3); }
  .live-dot { display:inline-flex; align-items:center; gap:7px; font-family:var(--mono); font-size:11px; letter-spacing:0.06em; text-transform:uppercase; color:var(--green); }
  .live-dot::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--green); animation:pulse 1.8s infinite; }
  @keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:.35; } }

  /* ID card — 11.5 × 7.8 cm landscape · large photo left, details right, allergens full-width underneath */
  /* 115×70mm — sized to the pouch's clear window (was 78mm tall; the extra height pushed the header out of the window). Tune the 70mm + the print rules below together if the window differs. */
  .idcard { aspect-ratio:115/70; width:100%; max-width:480px; margin:0 auto; background:var(--paper); border:1.5px solid var(--ink); border-radius:12px; overflow:hidden; display:flex; flex-direction:column; box-shadow:0 18px 40px -28px rgba(20,24,29,.5); }
  .idcard .head { flex-shrink:0; background:var(--bg-2); color:var(--ink); border-bottom:1px solid var(--line); padding:7px 14px; display:flex; justify-content:space-between; align-items:center; font-family:var(--mono); font-size:10px; letter-spacing:0.12em; text-transform:uppercase; }
  .idcard .head .glyph { width:18px; height:18px; background:var(--plan,var(--red)); color:#fff; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:12px; }
  .idcard .head .brand { display:inline-flex; align-items:center; gap:6px; min-width:0; }
  .idcard .head .mark { width:15px; height:15px; flex-shrink:0; display:block; }
  .idcard .head b { font-weight:700; font-size:8.5px; letter-spacing:0.08em; white-space:nowrap; }
  .idcard .main { flex:1; min-height:0; display:grid; grid-template-columns:40% 1fr; }
  .idcard .photo { border-right:1px solid var(--line); background:repeating-linear-gradient(135deg,var(--bg-2) 0 6px,var(--red-soft) 6px 12px); background-size:cover; background-position:center; display:grid; place-items:center; }
  .idcard .photo span { font-family:var(--mono); font-size:9px; letter-spacing:0.1em; color:var(--ink-3); text-transform:uppercase; }
  .idcard .photo .photo-img { width:100%; height:100%; object-fit:cover; display:block; }   /* real <img> → prints at full resolution (background-images go fuzzy) */
  .idcard .details { padding:10px 14px; display:flex; flex-direction:column; justify-content:center; gap:6px; min-width:0; }
  .idcard .nm { font-size:19px; font-weight:500; letter-spacing:-0.02em; line-height:1.05; color:var(--ink); overflow-wrap:anywhere; }
  .idcard .nm.sample { color:var(--ink-3); font-weight:500; font-style:italic; }
  /* left-aligned label → value, fixed label column so values line up away from the right edge (misaligned pouch windows clip the right side) */
  .idcard .rowline { display:flex; gap:8px; align-items:baseline; border-bottom:1px dashed var(--line); padding-bottom:5px; }
  .idcard .rowline:last-child { border-bottom:0; padding-bottom:0; }
  .idcard .rowline .k { font-family:var(--mono); font-size:8.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink-2); width:64px; flex-shrink:0; }
  .idcard .rowline .v { font-size:13px; font-weight:400; color:var(--ink); text-align:left; flex:1; min-width:0; overflow-wrap:anywhere; line-height:1.25; }
  .idcard .rowline .v.sample { color:var(--ink-3); font-weight:500; font-style:italic; }
  .idcard .rowline .v.expired { color:var(--red); }
  .idcard[data-plan="allergic"] { --plan:var(--plan-green); }
  .idcard[data-plan="drug"] { --plan:var(--plan-dgreen); }
  .idcard[data-plan="other"] { --plan:var(--plan-grey); }
  .idcard .allergens { flex-shrink:0; background:var(--plan,var(--red)); color:#fff; padding:9px 14px; display:flex; align-items:center; gap:12px; }
  .idcard .allergens .alabel { font-family:var(--sans); font-weight:700; font-size:10px; letter-spacing:0.02em; text-transform:uppercase; opacity:1; flex-shrink:0; }
  .idcard .allergens .alabel:empty { display:none; }   /* "other" has no reaction-type text → no leftover gap */
  .idcard .allergens .aval { font-size:16px; font-weight:700; letter-spacing:0.01em; line-height:1.18; text-transform:uppercase; overflow-wrap:anywhere; }
  .idcard .allergens .aval.sample { font-weight:500; font-style:italic; opacity:.85; }

  /* roster panel */
  .roster-card { background:#fff; border:1px solid var(--line); border-radius:16px; padding:22px; }
  .roster-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
  .roster-head h3 { font-size:17px; font-weight:600; letter-spacing:-0.015em; }
  .roster-head-right { display:flex; align-items:center; gap:12px; }
  .roster-head .count { font-family:var(--mono); font-size:12px; color:var(--ink-2); }
  .rclear { font-family:var(--mono); font-size:11px; letter-spacing:0.04em; text-transform:uppercase; color:var(--ink-3); background:transparent; border:1px solid var(--line-2); border-radius:999px; padding:5px 11px; cursor:pointer; transition:color .15s, background .15s, border-color .15s; }
  .rclear:hover { color:var(--red); border-color:var(--red); }
  .rclear.armed { color:#fff; background:var(--red); border-color:var(--red); }
  /* student list — picture · name · plan + details. The plan is shown as a
     colour-coded dot paired with its name (never colour alone — colourblind /
     fading safe); --plan cascades from .srow[data-plan] to the dot below. */
  .roster { display:flex; flex-direction:column; gap:8px; }
  .srow { display:flex; align-items:center; gap:12px; padding:9px 10px; background:var(--bg); border:1px solid var(--line); border-radius:10px; cursor:pointer; transition:background .15s, box-shadow .15s, border-color .15s; }
  .srow[data-plan="allergic"] { --plan:var(--plan-green); }
  .srow[data-plan="drug"] { --plan:var(--plan-dgreen); }
  .srow[data-plan="other"] { --plan:var(--plan-grey); }
  .srow:hover, .srow:focus-visible { background:var(--paper); box-shadow:0 8px 20px -16px rgba(20,24,29,.5); outline:none; }
  .srow.editing { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
  .srow .spic { width:46px; height:46px; flex-shrink:0; border-radius:8px; background:var(--bg-2) center/cover no-repeat; border:1px solid var(--line-2); }
  .srow .sinfo { flex:1; min-width:0; }
  .srow .sname { font-size:15px; font-weight:600; letter-spacing:-0.01em; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .srow .smeta { display:flex; align-items:center; gap:8px; margin-top:2px; min-width:0; }
  .srow .splan { display:inline-flex; align-items:center; gap:5px; flex-shrink:0; font-family:var(--mono); font-size:10.5px; font-weight:500; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-2); white-space:nowrap; }
  .srow .splan::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--plan,var(--red)); flex-shrink:0; }
  .srow .sdetail { flex:1; min-width:0; font-size:12.5px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .srow .srm { flex-shrink:0; width:26px; height:26px; border:0; border-radius:50%; background:transparent; color:var(--ink-3); font-size:18px; line-height:1; cursor:pointer; display:grid; place-items:center; transition:background .15s, color .15s; }
  .srow .srm:hover { background:var(--red-soft); color:var(--red); }
  .srow .srm.armed { background:var(--red); color:#fff; }   /* 2-step remove: tap again to confirm */
  .sempty { padding:22px 16px; text-align:center; border:1px dashed var(--line-2); border-radius:10px; background:var(--bg); font-family:var(--mono); font-size:12px; color:var(--ink-3); line-height:1.5; }
  .actions { display:flex; flex-direction:column; gap:10px; margin-top:18px; }

  /* toast */
  .toast { position:fixed; left:50%; bottom:24px; transform:translate(-50%,20px); background:var(--ink); color:#fff; padding:13px 20px; border-radius:999px; font-size:14px; box-shadow:0 14px 34px -16px rgba(0,0,0,.5); opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:120; display:flex; align-items:center; gap:10px; max-width:90vw; }
  .toast.show { opacity:1; transform:translate(-50%,0); }
  .toast .lk { color:#7CC58C; }

  .lab-standalone footer { background:var(--ink); color:#CFC8BA; padding:64px 0 24px; }
  .foot-grid { display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr; gap:40px; padding-bottom:40px; border-bottom:1px solid rgba(255,255,255,.12); }
  .foot-grid h5 { font-family:var(--mono); font-size:11px; letter-spacing:0.12em; text-transform:uppercase; color:var(--ink-3); margin:0 0 14px; }
  .foot-grid ul { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:9px; }
  .foot-grid a { font-size:14.5px; color:#DBD4C6; } .foot-grid a:hover { color:#fff; }
  .foot-brand img { height:56px; filter:brightness(0) invert(1); opacity:.92; }
  .foot-brand p { font-size:14px; max-width:36ch; margin:16px 0 0; line-height:1.6; }
  .foot-contact { margin-top:18px; display:flex; flex-direction:column; gap:7px; font-family:var(--mono); font-size:13px; }
  .foot-base { padding-top:22px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-family:var(--mono); font-size:11px; color:var(--ink-3); }

  @media (max-width:980px){
    .app-grid { grid-template-columns:1fr; gap:28px; } .preview { position:static; }
    .foot-grid { grid-template-columns:1fr 1fr; } .nav-links { display:none; }
  }
  @media (max-width:760px){
    .wrap { padding:0 18px; } header.hero { padding:36px 0 16px; } .app { padding:22px 0 60px; }
    .topbar .right, .stamp { display:none; }
    nav.top .wrap { height:78px; } .brand img { height:58px; }
    .row2 { grid-template-columns:1fr; } .form-card { padding:22px 18px; }
  }
  /* print: native vector "Save as PDF". Only #printArea prints (siblings display:none, not
     just hidden, so no blank pages). Each .print-page is one A4-landscape sheet of up to four
     cards at the true physical insert size — the browser renders the real CSS, so spacing,
     radius, fonts and colours are exact. margin:0 + print-color-adjust:exact mean it looks
     right at default dialog settings (no need to fiddle with margins or "Background graphics"). */
  #printArea { display:none; }
  @media print {
    @page { size:A4 landscape; margin:0; }
    body > *:not(#printArea) { display:none !important; }
    #printArea { display:block !important; }
    .print-page { width:297mm; height:210mm; display:grid; grid-template-columns:115mm 115mm; grid-template-rows:70mm 70mm; column-gap:4mm; row-gap:6mm; justify-content:center; align-content:center; page-break-after:always; }
    .print-page:last-child { page-break-after:auto; }
    .print-page .idcard { width:115mm; height:70mm; max-width:none; margin:0; box-shadow:none; border-radius:0; }  /* square edges = straight cut lines (rounded stays on screen) */
    .idcard, .idcard .head, .idcard .allergens, .idcard .glyph, .idcard .photo { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  }
