/* app.css — the builder chrome around the card.
   Nothing in here is printed; @media print hides all of it. */

:root {
  --ui-bg:        #F4F6FB;
  --ui-surface:   #FFFFFF;
  --ui-line:      #DFE4EF;
  --ui-line-soft: #EAEEF6;
  --ui-ink:       #16203A;
  --ui-ink-2:     #4C5875;
  --ui-ink-3:     #77839F;
  --ui-brand:     #214387;
  --ui-accent:    #1496CC;
  --ui-accent-lt: #E6F4FC;
  --ui-hot:       #D5137A;
  --ui-warm:      #EF4723;
  --ui-ok:        #15803D;
  --radius:       10px;
  --panel-w:      430px;
  --appbar-h:     58px;

  /* Card geometry + preview zoom. JS overwrites these; the defaults exist so
     the first paint is valid before any script runs. */
  --trim-w: 5.5in;
  --trim-h: 8.5in;
  --zoom: 0.6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--ui-bg);
  color: var(--ui-ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ui-brand);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:where(button, input, select, textarea, a):focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- app bar */
.appbar {
  height: var(--appbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 .9rem;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-line);
  position: relative;
  z-index: 5;
}
.appbar-brand { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.appbar-mark { width: 30px; height: 30px; flex: none; }
.appbar-title {
  display: block;
  font-family: Montserrat, Inter, sans-serif;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.appbar-sub {
  display: block;
  font-size: .74rem;
  color: var(--ui-ink-3);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar-actions { display: flex; gap: .4rem; flex: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  font: inherit;
  font-weight: 600;
  font-size: .82rem;
  padding: .5rem .85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ui-ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s ease, border-color .13s ease, color .13s ease;
}
.btn-primary { background: var(--ui-brand); color: #fff; }
.btn-primary:hover { background: #1a3670; }
.btn-ghost { border-color: var(--ui-line); background: var(--ui-surface); color: var(--ui-ink-2); }
.btn-ghost:hover { border-color: #C3CCE0; color: var(--ui-ink); }
.btn-sm { font-size: .76rem; padding: .34rem .6rem; }
.btn-block { display: block; width: 100%; margin-top: .3rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger { color: var(--ui-hot); border-color: var(--ui-line); background: var(--ui-surface); }

/* ---------------------------------------------------------------- layout */
.layout {
  height: calc(100% - var(--appbar-h));
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  overflow: hidden;
}

/* ---------------------------------------------------------------- stage */
.stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* Grid items default to min-height:auto, which lets a tall card push the
     whole stage past the viewport and defeat .stage-scroll's overflow. */
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(0deg, rgba(33,67,135,.03), rgba(33,67,135,.03)),
    repeating-conic-gradient(#EDF0F7 0% 25%, #F4F6FB 0% 50%) 0 0 / 22px 22px;
}
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .5rem .8rem;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-line);
}
.seg { display: inline-flex; background: var(--ui-bg); border-radius: 8px; padding: 2px; gap: 2px; }
.seg-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
.seg-wide .seg-btn { padding: .45rem .5rem; }
.seg-btn {
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  border: 0;
  background: transparent;
  color: var(--ui-ink-2);
  padding: .34rem .7rem;
  border-radius: 6px;
  cursor: pointer;
}
.seg-btn.is-on { background: var(--ui-surface); color: var(--ui-brand); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.stage-tools { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.zoom { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--ui-ink-2); }
.zoom-label { font-weight: 600; }
.zoom input { width: 110px; }
.zoom output { font-variant-numeric: tabular-nums; min-width: 3.1em; }
.chk { display: inline-flex; align-items: center; gap: .38rem; font-size: .78rem; color: var(--ui-ink-2); cursor: pointer; }
.chk input { accent-color: var(--ui-brand); }
.chk-note { font-style: normal; color: var(--ui-ink-3); }

.stage-scroll { overflow: auto; padding: 1.4rem; }
.stage-inner {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
  justify-content: center;
  min-width: min-content;
  min-height: min-content;
  margin: auto;
}
.card-wrap {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  /* zoom is applied by shrinking the box the scaled card sits in */
  width: calc((var(--trim-w) + .25in) * var(--zoom));
}
/* The unselected side is moved out of view rather than display:none'd. A card
   with no layout box measures as zero, and the fit pass would then "successfully"
   size the slate at maximum density — which is what would go to the printer. */
.stage[data-side="a"] .card-wrap[data-face="b"],
.stage[data-side="b"] .card-wrap[data-face="a"] {
  position: absolute;
  left: -100000px;
  top: 0;
  pointer-events: none;
}
.stage-inner { position: relative; }
.card-cap {
  font-size: .74rem;
  font-weight: 600;
  color: var(--ui-ink-2);
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}
.card-dim { color: var(--ui-ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.card-wrap .card-bleed {
  transform: scale(var(--zoom));
  transform-origin: top left;
  margin-bottom: calc((var(--trim-h) + .25in) * var(--zoom) - (var(--trim-h) + .25in));
}

.stage-status {
  padding: .45rem .8rem;
  font-size: .76rem;
  color: var(--ui-ink-2);
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-line);
  min-height: 2rem;
  /* Block, not flex. The status line is a sentence built from inline spans, and
     as a flex container each run of text became its own flex item with
     min-width: auto — so a long message could not wrap and widened the whole
     preview stage past the viewport on a phone. */
  display: block;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}
.stage-status .warn { color: var(--ui-warm); font-weight: 600; }
.stage-status .ok { color: var(--ui-ok); font-weight: 600; }

/* ---------------------------------------------------------------- panel */
.panel {
  display: grid;
  /* steps · restore banner · body */
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  background: var(--ui-surface);
  border-left: 1px solid var(--ui-line);
  min-width: 0;
}
/* Fixed set of steps — a grid that wraps, never a horizontal scroller. */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--ui-line-soft);
  border-bottom: 1px solid var(--ui-line);
}
.step {
  font: inherit;
  font-size: .74rem;
  font-weight: 600;
  border: 0;
  background: var(--ui-surface);
  color: var(--ui-ink-2);
  padding: .55rem .3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 44px;
}
.step-n {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ui-bg);
  color: var(--ui-ink-3);
  font-size: .66rem;
  flex: none;
}
.step.is-on { color: var(--ui-brand); box-shadow: inset 0 -2px 0 var(--ui-brand); }
.step.is-on .step-n { background: var(--ui-brand); color: #fff; }
.step:disabled { opacity: .42; cursor: not-allowed; }

.panel-body { overflow-y: auto; overflow-x: hidden; padding: .95rem; }

/* An explicit `display` beats the UA's [hidden] rule, so these two components
   have to opt back out of it themselves. */
[hidden] { display: none !important; }

.restore-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .55rem .8rem;
  background: #FFF8E6;
  border-bottom: 1px solid #F0DFAE;
  font-size: .78rem;
}
.restore-bar strong { display: block; font-size: .8rem; }
.restore-bar span { color: var(--ui-ink-3); }

.paste-box {
  margin-top: .5rem;
  padding: .6rem;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: #FBFCFE;
}
.paste-box label { display: block; font-size: .74rem; color: var(--ui-ink-2); margin-bottom: .3rem; }
.paste-box code { background: var(--ui-bg); padding: .04rem .22rem; border-radius: 4px; }
.step-pane { display: none; }
.step-pane.is-on { display: block; }

.pane-h {
  margin: 0 0 .3rem;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.pane-note { margin: 0 0 .95rem; font-size: .8rem; color: var(--ui-ink-2); }

/* ---------------------------------------------------------------- fields */
.field { margin-bottom: .9rem; }
.field > label, .field-label {
  display: block;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ui-ink-2);
  margin-bottom: .3rem;
}
input[type=text], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  font-size: .84rem;
  padding: .5rem .6rem;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-ink);
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--ui-accent); }
.hint { margin: .3rem 0 0; font-size: .72rem; color: var(--ui-ink-3); line-height: 1.4; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .55rem; }
.row-btns { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }

#countyFilter { margin-bottom: .35rem; }
#countySelect { max-height: 40vh; }

.radio-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; }
.radio-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.opt {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  padding: .5rem .55rem;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  cursor: pointer;
  font-size: .8rem;
}
.opt:has(input:checked) { border-color: var(--ui-brand); background: #F5F8FE; }
.opt input { margin-top: .2rem; accent-color: var(--ui-brand); flex: none; }
.opt span { display: block; min-width: 0; }
.opt strong { display: block; font-weight: 600; }
.opt em { display: block; font-style: normal; font-size: .72rem; color: var(--ui-ink-3); line-height: 1.3; }
.opt .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .3rem; }

/* ---------------------------------------------------------------- slate list */
.slate-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; margin-bottom: .5rem; }
.slate-toolbar select { width: auto; max-width: 11rem; font-size: .78rem; }
.bulkbar {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--ui-line-soft);
}
.bulk-count { margin-left: auto; font-size: .74rem; color: var(--ui-ink-3); font-variant-numeric: tabular-nums; }

.race-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; }
.sec-head {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ui-ink-3);
  margin: .7rem 0 .1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.sec-head .chk { flex: 1; min-width: 0; overflow: hidden; }
.sec-head .chk span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.race {
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  padding: .5rem .55rem;
  background: var(--ui-surface);
  min-width: 0;
}
.race.is-off { opacity: .5; background: #FAFBFD; }
.race-top { display: flex; align-items: flex-start; gap: .5rem; }
.race-top input[type=checkbox] { margin-top: .2rem; accent-color: var(--ui-brand); flex: none; }
.race-lab { font-size: .8rem; font-weight: 600; line-height: 1.25; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.race-lab small { display: block; font-weight: 400; font-size: .7rem; color: var(--ui-ink-3); overflow-wrap: anywhere; }
.sec-rename { margin-bottom: .3rem; font-weight: 600; }
.empty-sec { margin: 0 0 .4rem; padding: .5rem .6rem; border: 1px dashed var(--ui-line); border-radius: 8px; }
.slate-add { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--ui-line-soft); }
.slate-add .btn { flex: 1; }
#densityOut { font-weight: 500; color: var(--ui-ink-3); }
.sec-head .icon-btn { width: 22px; height: 22px; font-size: .74rem; }
.cand-opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: .2rem; margin-top: .4rem; padding-left: 1.4rem; }
.cand-opt {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  padding: .28rem .4rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.cand-opt:hover { background: #F7F9FD; }
.cand-opt:has(input:checked) { border-color: #C9D8EE; background: #F2F7FE; }
.cand-opt input { accent-color: var(--ui-brand); flex: none; }
.cand-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pty {
  font-size: .64rem;
  font-weight: 700;
  padding: .06rem .3rem;
  border-radius: 4px;
  flex: none;
}
.pty-D { background: #E4EEFB; color: #1D4ED8; }
.pty-R { background: #FCE6E6; color: #B91C1C; }
.pty-L { background: #FEF3C7; color: #92400E; }
.pty-G { background: #DCFCE7; color: #166534; }
.pty-I, .pty- { background: #EEF1F6; color: #52607C; }
.inc-tag { font-size: .64rem; font-weight: 700; color: var(--ui-accent); flex: none; }
.race-edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; margin-top: .4rem; padding-left: 1.4rem; }
.race-edit input { font-size: .78rem; padding: .34rem .45rem; }

/* ---------------------------------------------------------------- accordions */
.acc { border: 1px solid var(--ui-line); border-radius: 9px; margin-bottom: .5rem; overflow: hidden; }
.acc > summary {
  cursor: pointer;
  padding: .58rem .7rem;
  font-size: .82rem;
  font-weight: 600;
  background: #FAFBFD;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::before {
  content: "";
  width: 6px; height: 6px;
  border-right: 2px solid var(--ui-ink-3);
  border-bottom: 2px solid var(--ui-ink-3);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: none;
}
.acc[open] > summary::before { transform: rotate(45deg); }
.acc-body { padding: .7rem; border-top: 1px solid var(--ui-line-soft); }

.kv-rows, .loc-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; margin-bottom: .5rem; }
.kv-row, .loc-row {
  display: grid;
  gap: .3rem;
  padding: .45rem;
  border: 1px solid var(--ui-line-soft);
  border-radius: 8px;
  background: #FBFCFE;
}
.kv-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; }
.loc-row { grid-template-columns: minmax(0, 1fr) auto; }
.loc-row .loc-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: .25rem; }
.icon-btn {
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink-3);
  border-radius: 6px;
  width: 26px; height: 26px;
  cursor: pointer;
  font-size: .78rem;
  line-height: 1;
  padding: 0;
  flex: none;
}
.icon-btn:hover { color: var(--ui-hot); border-color: #F0C7DC; }
.loc-row .loc-btns { display: grid; gap: .2rem; align-content: start; }

/* ---------------------------------------------------------------- logo drop */
.logo-drop {
  border: 1.5px dashed var(--ui-line);
  border-radius: 9px;
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: .7rem;
  background: repeating-conic-gradient(#F4F6FB 0% 25%, #fff 0% 50%) 0 0 / 14px 14px;
  cursor: pointer;
  text-align: center;
}
.logo-drop.is-over { border-color: var(--ui-accent); background: var(--ui-accent-lt); }
.logo-drop img { max-width: 100%; max-height: 110px; object-fit: contain; }
.logo-empty strong { display: block; font-size: .8rem; }
.logo-empty span { font-size: .7rem; color: var(--ui-ink-3); }
.chk-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------------------------------------------------------------- design */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.theme-btn {
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: var(--ui-surface);
  padding: .5rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
}
.theme-btn.is-on { border-color: var(--ui-brand); box-shadow: 0 0 0 1px var(--ui-brand) inset; }
.theme-chips { display: flex; gap: 3px; margin-bottom: .35rem; }
.theme-chips i { width: 15px; height: 15px; border-radius: 4px; display: block; }
.swatch-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; }
.swatch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
  font-size: .76rem;
  color: var(--ui-ink-2);
}
.swatch-row input[type=color] {
  width: 38px; height: 26px; padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

/* ---------------------------------------------------------------- export */
.exp-card {
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  padding: .8rem;
  margin-bottom: .7rem;
}
.exp-card h3 { margin: 0 0 .3rem; font-size: .86rem; font-family: Montserrat, Inter, sans-serif; }
.exp-card p { margin: 0 0 .6rem; font-size: .78rem; color: var(--ui-ink-2); }
.exp-card code { background: var(--ui-bg); padding: .05rem .25rem; border-radius: 4px; font-size: .92em; }

.qr-check { display: flex; align-items: center; gap: .7rem; margin-top: .5rem; }
.qr-check-img { width: 84px; height: 84px; flex: none; background: #fff; border: 1px solid var(--ui-line); border-radius: 6px; padding: 4px; }
.qr-check-img svg { width: 100%; height: 100%; display: block; }

.order-summary {
  background: var(--ui-bg);
  border-radius: 9px;
  padding: .65rem .75rem;
  font-size: .78rem;
  margin: .6rem 0;
  display: grid;
  gap: .18rem;
}
.order-summary b { font-weight: 600; }
.order-summary .os-row { display: flex; justify-content: space-between; gap: 1rem; }
.order-summary .os-row span:last-child { color: var(--ui-ink-2); text-align: right; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 20px);
  background: var(--ui-ink);
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  padding: .6rem 1rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,40,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 60;
  max-width: min(90vw, 460px);
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { background: #9F1239; }

#exportStage {
  position: fixed;
  left: -20000px;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
}

/* ================================================================ responsive
   Test order that matters here: iPad portrait, iPad landscape, phone, desktop. */
@media (max-width: 1179px) {
  body { overflow: auto; }
  .appbar { position: sticky; top: 0; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: calc(100% - var(--appbar-h));
    /* Must be visible here: an `overflow: hidden` ancestor becomes the scroll
       container for the sticky preview below, which then floats out of place
       and paints over the step nav. */
    overflow: visible;
  }
  .stage {
    position: sticky;
    top: var(--appbar-h);
    z-index: 3;
    grid-template-rows: auto auto auto;
    border-bottom: 1px solid var(--ui-line);
    max-height: 62vh;
  }
  .stage-scroll { max-height: 46vh; padding: .9rem; }
  .panel { border-left: 0; }
  .panel-body { overflow: visible; }
  /* Step nav sticks directly under the pinned preview. --stage-h is measured in
     JS because the preview's height varies with card size and zoom. */
  .steps {
    position: sticky;
    top: calc(var(--appbar-h) + var(--stage-h, 0px));
    z-index: 2;
  }
  .appbar-actions .btn:not(.btn-primary) { display: none; }
}

@media (max-width: 700px) {
  body { font-size: 14px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: 1fr; }
  .radio-grid.two { grid-template-columns: 1fr; }
  .stage-scroll { max-height: 40vh; }
  .appbar-title { font-size: .86rem; }
  .slate-toolbar { grid-template-columns: 1fr; }
  .slate-toolbar select { max-width: none; width: 100%; }
}

@media (min-width: 1600px) {
  :root { --panel-w: 470px; }
}

/* ---------------------------------------------------------------- print */
@media print {
  .appbar, .panel, .stage-bar, .stage-status, .card-cap, .toast, .skip-link, .guides { display: none !important; }
  /* Every scroll container in the app chrome has to be unclipped for print, or
     the second card is simply cut off and the PDF comes out one page short. */
  html, body { height: auto; overflow: visible; }
  body { background: #fff; }
  .layout { display: block; height: auto; overflow: visible; }
  .stage { display: block; background: none; overflow: visible; min-height: 0; }
  .stage-scroll { overflow: visible; padding: 0; max-height: none; }
  .stage-inner { display: block; margin: 0; position: static; }
  /* The side toggle parks the unselected card off-canvas. Both sides always
     print, so that parking has to be undone here — otherwise printing while
     viewing a single side puts one card 100000px off the page. */
  .card-wrap {
    display: block !important;
    width: auto;
    margin: 0;
    position: static !important;
    left: auto !important;
    top: auto !important;
  }
  .card-wrap .card-bleed {
    transform: none !important;
    margin: 0 !important;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }
  .card-wrap:last-child .card-bleed { break-after: auto; page-break-after: auto; }
}
