/* Configurator + cart + order confirmation, /designa/. Shares the design
   tokens with site.css (loaded first); everything configurator-specific
   lives here so the marketing sheet stays untouched. */

:root {
  --line: rgba(31, 31, 35, 0.12);
  --dim: #5b6672;
  --red: #dd4e4e;
  --red-strong: #d13c3c;
  --sky: #73c5f5;
  --sky-ink: #2578b2;
  --ink: #1f1f23;
  --white: #fff;
}

/* ---------- package cards ---------- */

/* board PackageCard: compact full-width rows — radio dot, name, desc, price */
.pkg-cards {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.8rem;
  margin-bottom: 1.6rem;
}
/* in-place ghost while /api/catalog loads – never a bare empty slot */
.pkg-skl {
  display: block;
  height: 96px;
  border-radius: var(--radius-card-sm, 20px);
  background: var(--line-soft);
}
.pkg-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-card-sm, 20px);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  /* reset the leaks from site.css `button { … }` */
  white-space: normal;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow var(--ease-fast), background var(--ease-fast);
}
@media (hover: hover) and (pointer: fine) {
  .pkg-card:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--ink); }
}
/* toggle buttons, not a pretend radiogroup: aria-pressed is what we ship */
.pkg-card[aria-pressed="true"] {
  background: var(--white);
  box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-card);
}
.pkg-card .pkg-radio {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: box-shadow var(--ease-fast);
}
.pkg-card[aria-pressed="true"] .pkg-radio { box-shadow: inset 0 0 0 7px var(--red); }
.pkg-card .pkg-main { flex: 1; min-width: 0; }
.pkg-card .pkg-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.pkg-card .pkg-desc { display: block; color: var(--dim); font-size: 0.9rem; margin-top: 0.25rem; }
.pkg-card .pkg-price { display: block; margin-top: 0.55rem; font-weight: 700; font-size: 0.95rem; color: var(--dim); }
.pkg-card[aria-pressed="true"] .pkg-price { color: var(--ink); }

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

/* ---------- configurator app shell (design: Configurator.jsx) ----------
   /designa/ is the app itself: its own bar, full viewport height, the stage
   and wizard filling what's left. No site header/footer/announce on this page. */

.cfg-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
  overflow: hidden;
}
.cfg-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  min-height: 68px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--white);
}
.cfg-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 40px;
  padding: 0 1rem 0 0.7rem;
  border-radius: var(--radius-pill, 999px);
  background: var(--sky-50);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.cfg-bar-left { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.cfg-logo { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; }
.cfg-logo .cfg-seal { width: 2.5rem; height: 2.5rem; flex: none; }
.cfg-word { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
/* the hairline divider between the back button and the logo (desktop) */
.cfg-divider { width: 1px; height: 28px; background: var(--line); }
.cfg-bar-right { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.cfg-bar-price { text-align: right; line-height: 1.25; }
.cfg-bar-price b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.cfg-bar-price span { font-size: 0.72rem; color: var(--dim); }
.cfg-bar-cart {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.2rem;
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--red-strong);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
}
.cfg-bar-cart:hover { color: var(--white); filter: brightness(1.07); }
/* design: once the cap is in the cart the bar CTA turns ink */
.cfg-bar-cart.is-added { background: var(--ink); box-shadow: none; }

/* the app body fills the remaining height: stage + wizard side by side */
.cfg-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem);
  gap: 0;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.cfg-app > .cfg-stage { margin: 1rem 0 1rem 1rem; }
.cfg-app > .cfg-wizard { margin: 0 0 0 0; }

.cfg-stage {
  position: relative;
  top: auto;
  /* design: the stage is a flat sky panel (Configurator.jsx: background sky-50) */
  background: var(--sky-50);
  border-radius: var(--radius-panel, 36px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#cap-canvas {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  display: block;
  /* `pan-y` on purpose: on a phone the stage is sticky inside a scrolling
     step sheet, so a vertical swipe has to reach the page. What the browser
     keeps from us is only the vertical tilt, and the canvas offers that on a
     two-finger drag. Pinch is implemented here either way — the page has
     nothing of its own to zoom. */
  touch-action: pan-y;
  cursor: grab;
}
#cap-canvas:active { cursor: grabbing; }

/* stage overlays (design Configurator): chips top-left, tools top-right,
   the drag hint as a bottom-centre pill (desktop only) */
.cfg-stage-chips {
  position: absolute;
  top: 1rem; left: 1rem; right: 4.5rem;
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  pointer-events: none;
}
.cfg-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--white); border-radius: var(--radius-pill, 999px);
  padding: 0.4rem 0.8rem; font-weight: 600; font-size: 0.8rem;
  box-shadow: var(--shadow-card);
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.cfg-chip--ink { background: var(--ink); color: var(--white); }
.cfg-chip[hidden] { display: none; }
.cfg-dot {
  width: 12px; height: 12px; flex: none; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.cfg-stage-tools {
  position: absolute; top: 1rem; right: 1rem;
  display: grid; gap: 0.45rem;
}
.cfg-tool {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--white); box-shadow: var(--shadow-card);
  cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: center; padding: 0;
  font-size: 1.05rem; line-height: 1;
  /* the tools sit over the canvas, so a tap flash reads as a render glitch */
  -webkit-tap-highlight-color: transparent;
}
.cfg-tool:hover { color: var(--ink); filter: none; }
.cfg-stage-hint {
  position: absolute; bottom: 1rem; left: 1rem; right: 1rem;
  display: flex; justify-content: center;
  pointer-events: none;
}
.cfg-stage-hint span {
  background: rgba(31, 31, 35, 0.82); color: var(--white);
  border-radius: var(--radius-pill, 999px); padding: 0.5rem 1rem;
  font-size: 0.78rem; text-align: center;
}

/* wizard fills its column and scrolls its panel internally */
.cfg-controls { display: grid; gap: 0.9rem; }

/* ---------- stepped wizard (right column) ---------- */

.cfg-wizard {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-self: stretch;
  min-width: 0;
  /* design: the wizard column is bare on desktop and becomes a white sheet
     with a top shadow on mobile (see the 760px block) */
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
.cfg-wiz-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 1.5rem 1.75rem 0.7rem;
}
.cfg-step-count {
  font-size: var(--fs-eyebrow, 0.78rem);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow, 0.14em);
  text-transform: uppercase;
  color: var(--red-strong);
}
/* the head shows the price on mobile (the bar price is hidden there) and the
   "Hoppa till granska" link on desktop — never both (design Configurator) */
.cfg-wiz-price {
  display: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.cfg-skip {
  background: none;
  border: 0;
  box-shadow: none; /* site.css button leak */
  padding: 0;
  color: var(--sky-ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.cfg-skip:hover { color: var(--sky-ink); filter: none; }
.cfg-skip[hidden] { display: none; }

/* the step rail: one bar per step, current = red, done = ink */
.cfg-rail {
  display: flex;
  gap: 4px;
  padding: 0 1.75rem;
  /* The step dots are built by designa.js, so the rail is EMPTY on first paint
     and grows to 6px when they arrive - which takes that 6px out of the
     `minmax(0,1fr)` panels track below it and shifts the whole step panel
     (measured: panels 686 -> 680, CLS 0.05 on /designa/). Reserving the strip
     makes the empty and filled states the same height. */
  min-height: 6px;
}
.cfg-rail button {
  flex: 1;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  background: var(--line);
}
.cfg-rail button[aria-selected="true"] { background: var(--red); }
.cfg-rail button[data-done="true"] { background: var(--ink); }

.cfg-panels {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  padding: 1.5rem 1.75rem;
}
/* padding reset: site.css gives every <section> the page's section spacing,
   which here pushed each step ~115px down and out of view */
.cfg-step { display: none; }
.cfg-step.is-active { display: block; }
/* site.css pads `section:not(#configurator)` with an id-level selector, so this
   has to out-rank it */
.cfg-panels > .cfg-step:not(#configurator) { padding: 0; }
.cfg-step-title { margin: 0 0 0.45rem; font-size: 2rem; }
.cfg-step-desc { margin: 0 0 1.5rem; color: var(--dim); font-size: 0.95rem; }
.cfg-step .cfg-part { padding: 0; box-shadow: none; background: none; }

.cfg-wiz-foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem;
  padding: 1rem 1.75rem 1.25rem;
  border-top: 1px solid var(--line-soft);
  background: var(--white);
}
.cfg-prev {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--white);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.cfg-prev:hover { color: var(--ink); filter: none; }
.cfg-prev:disabled { opacity: 0.35; cursor: default; }
.cfg-next {
  min-width: 0;
  height: 52px;
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 1.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfg-next:hover { color: var(--white); filter: brightness(1.1); }
.cfg-next[hidden], .cfg-add[hidden] { display: none; }
.cfg-add {
  min-width: 0;
  height: 52px;
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--red-strong);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 1.25rem;
  box-shadow: var(--shadow-btn);
  white-space: nowrap;
}
.cfg-add:hover { color: var(--white); filter: brightness(1.07); }

.cfg-part {
  background: var(--white);
  border-radius: var(--radius-card-sm, 20px);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 1.05rem 1.15rem;
}

/* ---------- press feedback ---------- */

/* The grey flash on tap is the UA tap-highlight, not a transition: it fires
   before any :active style and reads as a "weird animation". The design has
   no press colour either — selection is the state that persists, so the
   highlight is suppressed and a small scale gives the tap its feedback in
   the same place on every control. */
.opt-chip,
.opt-dot,
.pkg-card,
.cfg-rail button,
.cfg-prev,
.cfg-next,
.cfg-add,
.cfg-sumrow-edit,
.cfg-save,
.cfg-bar-cart {
  -webkit-tap-highlight-color: transparent;
}
.opt-chip,
.opt-dot,
.pkg-card,
.cfg-rail button,
.cfg-prev,
.cfg-next,
.cfg-add {
  transition: box-shadow var(--ease-fast), background var(--ease-fast),
              color var(--ease-fast), transform var(--ease-fast);
}
.opt-chip:active,
.opt-dot:active,
.pkg-card:active,
.cfg-rail button:active,
.cfg-prev:active:not(:disabled),
.cfg-next:active,
.cfg-add:active {
  transform: scale(0.94);
}
.cfg-part h3 { margin: 0 0 0.25rem; font-size: 1.02rem; }
.cfg-part-desc { margin: 0 0 0.7rem; color: var(--dim); font-size: 0.85rem; }

.cfg-opts { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cfg-dots { gap: 0.4rem; }
.opt-chip {
  border: 0;
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-chip, 999px);
  padding: 0.6rem 1.05rem;   /* ~44px tall tap target */
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow var(--ease-fast), background var(--ease-fast), color var(--ease-fast);
}
.opt-chip:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--ink); } /* button:hover would paint white */
.opt-chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
  box-shadow: none;
}
/* the cockade chips carry a photo of the real rosette: the label alone cannot
   tell three gold/blue/cream variants apart */
.opt-chip-kokard { display: inline-flex; align-items: center; gap: 0.5rem; padding-left: 0.5rem; }
.opt-chip-kokard img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
/* the design's ColorDot is a real 2.75rem box carrying its own ring
   (boxShadow: 0 0 0 3px white, 0 0 0 5px ink when selected, a 1px inset
   hairline otherwise). The earlier 2rem dot plus a 7px ::after halo made
   the row report a scroll overflow and put the selected ring outboard of
   the box, so the swatch now matches the design's geometry. */
.opt-dot {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  transition: box-shadow var(--ease-fast);
}
.opt-dot[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--ink);
}
.opt-dot.dot-none {
  background: repeating-linear-gradient(45deg, #fff, #fff 4px, #eee 4px, #eee 8px);
}
/* custom colour picker in the swatch rows: round it to match .opt-dot
   (the input itself is styled inline by designa.js; only the pseudos are ours) */
.cfg-opts input[type="color"] { appearance: none; -webkit-appearance: none; background: none; }
.cfg-opts input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cfg-opts input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
/* "valfri färg" is the Deluxe colour choice, so on a lower tier the picker is
   inert — it stays visible (with its tier badge) so the option is discoverable,
   but it cannot be pressed and does not look pressable. */
.cfg-opts input[type="color"].is-locked {
  cursor: not-allowed;
  opacity: 0.45;
  filter: saturate(0.4);
}
.cfg-opts input[type="color"].is-locked::-webkit-color-swatch {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 0 3px var(--white);
}
.cfg-opts input[type="color"][data-tier]:not([data-tier=""]) { position: relative; overflow: visible; }
  pointer-events: none;
}

.cfg-form { display: grid; gap: 0.7rem; }
.cfg-form label { display: grid; gap: 0.25rem; font-size: 0.85rem; font-weight: 700; }
.cfg-form label small { font-weight: 400; color: var(--dim); }
.cfg-form input,
.cfg-form select {
  font: inherit;
  font-weight: 400;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-input, 999px);
  background: var(--white);
}
/* native select (kept native for E2E select_option), styled per Selfridges/Faire */
.cfg-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%231f1f23' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.25 6 7.75l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cfg-form select:hover { border-color: var(--dim); }
.cfg-form select:focus-visible {
  outline: none;
  border-color: var(--sky-ink);
  box-shadow: 0 0 0 3px var(--sky-ink);
}
/* one focus idiom with the site inputs: solid sky-ink ring.
   The .cart-form half of this idiom lives in cart.css, which is loaded on
   every page that can render the cart (this one included). */
.cfg-form input:focus-visible {
  outline: none;
  border-color: var(--sky-ink);
  box-shadow: 0 0 0 3px var(--sky-ink);
}
.cfg-form input[aria-invalid="true"] {
  border-color: var(--red-strong);
}
.cfg-sub { display: grid; gap: 0.35rem; font-size: 0.85rem; font-weight: 700; }
.cfg-sub > span { color: var(--dim); font-weight: 700; }

/* ---------- summary (Granska): a label/value/Ändra table ---------- */

.cfg-sumtable {
  border-radius: var(--radius-card-sm, 20px);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.cfg-sumrow {
  display: grid;
  /* Label column sized to its own content, not a guess: a fixed 6.5rem left
     the short labels ("Text", "Fodret") floating away from their values and
     the long one ("Tillbehören") nearly touching them, so nothing in the
     table shared an edge. A subgrid-free two-track row plus a shared label
     width keeps every value on one vertical line. */
  grid-template-columns: minmax(6.5rem, max-content) minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
}
.cfg-sumrow-label {
  color: var(--dim);
  /* labels are short by design; keep them from wrapping so the row height
     stays one line and the value column never shifts */
  white-space: nowrap;
}
.cfg-sumrow-value {
  font-weight: 600;
  /* the edit button sits on the same baseline as the value's LAST line, not
     its first, so multi-line values do not push it to the top of the row */
  line-height: 1.45;
}
/* the reason a derived row says what it says, on its own line under the value */
.cfg-sumrow-note {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--dim);
}
/* a derived row has no third column, so it spans the value across both */
.cfg-sumrow.is-derived { grid-template-columns: minmax(6.5rem, max-content) minmax(0, 1fr); }
.cfg-sumrow-edit {
  background: none; border: 0; padding: 0;
  color: var(--sky-ink); font-weight: 600; cursor: pointer;
  font-family: var(--font-sans); font-size: 0.85rem;
}
.cfg-sumrow-edit:hover { color: var(--sky-ink); filter: none; }
.cfg-save {
  margin-top: 1rem; background: none; border: 0; padding: 0;
  color: var(--sky-ink); font-family: var(--font-sans);
  font-size: 0.92rem; font-weight: 700; cursor: pointer;
}
.cfg-save:hover { color: var(--sky-ink); filter: none; }
.cfg-msg { margin: 0.6rem 0 0; font-size: 0.85rem; min-height: 1.1em; }
.cfg-msg.err { color: #b3402f; }
.cfg-msg.ok { color: #2e7d43; }
.cfg-trust { margin: 0.8rem 0 0; font-size: 0.82rem; color: var(--dim); }

/* The cart rules (drawer, lines, totals, form, badge) live in
   cart.css, shared with the /varukorg/ page. */


/* ---------- order confirmation ---------- */

.order-confirm {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 35, 0.55);
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.confirm-card {
  background: var(--white);
  border-radius: var(--radius-card, 28px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  padding: 2rem;
  max-width: 26rem;
  width: 100%;
  text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  .order-confirm {
    transition: opacity 200ms ease, display 200ms allow-discrete;
  }
  .order-confirm:not([hidden]) { opacity: 1; }
  @starting-style { .order-confirm:not([hidden]) { opacity: 0; } }
  .confirm-card {
    transition: transform 240ms cubic-bezier(0.23, 1, 0.32, 1), opacity 240ms ease;
  }
  @starting-style { .confirm-card { transform: scale(0.95); opacity: 0; } }
}
.confirm-card h2 { margin-top: 0; }
.confirm-card .muted { font-size: 0.85rem; }

/* Storleksguide link beside the size label */
.cfg-guide {
  font-size: 0.85rem;
  color: var(--sky-ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ---------- responsive ---------- */

/* Landscape phones get the same stacked layout: an 844x390 screen is wider
   than the 760px breakpoint, so width alone put it back on the desktop
   two-column shell and left the wizard a 170px window beside a stage three
   quarters of the height. */
@media (max-width: 760px), ((max-height: 520px) and (orientation: landscape) and (max-width: 960px)) {
  /* Mobile is a scrolling page with a sticky stage, not a fixed two-row grid.
     The old layout gave the stage 42% of a 100dvh shell and let the wizard
     keep only what the bar, head, rail and foot left over — on a 375x667
     phone that was a 200px window for 650-850px of step content, with the
     stage unusable above it. Now the stage parks at ~38dvh while the page
     scrolls the wizard past it, so every step gets the full screen height
     and the cap stays visible while you choose. */
  .cfg-shell { height: auto; min-height: 100dvh; overflow: visible; }
  .cfg-app {
    display: block;
    grid-template-columns: none;
    grid-template-rows: none;
    overflow: visible;
  }
  .cfg-app > .cfg-stage {
    position: sticky;
    /* parks under the sticky bar, which is 58px tall on mobile */
    top: calc(58px + 0.5rem);
    z-index: 5;
    height: 38dvh;
    min-height: 12rem;
    max-height: 20rem;
    margin: 0.5rem 0.75rem 0;
    border-radius: var(--radius-card, 28px);
  }
  .cfg-app > .cfg-wizard,
  .cfg-app > .cfg-landing {
    margin: 0.75rem 0 0;
    background: var(--white);
    border-radius: var(--radius-card, 28px) var(--radius-card, 28px) 0 0;
    box-shadow: 0 -6px 20px -12px rgba(31, 31, 35, 0.25);
    overflow: visible;
  }
  /* the wizard is one sheet on mobile: head and rail scroll away with the
     step, and the foot parks at the bottom so Slutför is always in reach */
  .cfg-app > .cfg-wizard { grid-template-rows: auto auto auto auto; }
  .cfg-panels { overflow: visible; }
  .cfg-wiz-foot {
    position: sticky;
    bottom: 0;
    z-index: 6;
    background: var(--white);
    box-shadow: 0 -6px 18px -14px rgba(31, 31, 35, 0.4);
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
  .cfg-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0 0.75rem;
    gap: 0.75rem;
  }
  .cfg-bar-price { display: none; }            /* price moves into the wizard head */
  .cfg-wiz-price { display: block; }
  .cfg-skip { display: none; }                 /* skip link is desktop-only */
  .cfg-bar-cart { padding: 0 0.85rem; }
  .cfg-bar-cart span { display: none; }        /* icon-only add button */
  .cfg-logo { display: none; }                 /* board drops the lockup on mobile — the back pill carries the exit */
  .cfg-word { display: none; }                 /* wordmark hidden on mobile */

  /* The stage is the cap's, not the chips'. Two wrapped chip rows covered the
     top 30% of the drawing on a 375px phone, so mobile keeps only the two
     chips that report the design (package, kulle) in a single clipped row. */
  .cfg-stage-chips { top: 0.6rem; left: 0.6rem; right: 3.5rem; flex-wrap: nowrap; overflow: hidden; }
  .cfg-chip { font-size: 0.72rem; padding: 0.3rem 0.6rem; }
  .cfg-chip:nth-child(n + 3) { display: none; }

  /* 44px hit boxes: the 0.85 scale on the tool stack shrank the buttons to
     34x34, which is below every touch guideline; the step rail was 6px tall. */
  /* 12px between targets: a 44px button with a 7px gutter gets mis-tapped
     while the thumb is still orbiting. */
  .cfg-stage-tools { top: 0.6rem; right: 0.6rem; transform: none; gap: 0.75rem; }
  .cfg-tool { width: 44px; height: 44px; }
  /* the drag hint says "ctrl+rulla", a desktop gesture, and covers a fifth of
     the cap on a phone */
  .cfg-stage-hint { display: none; }
  .cfg-rail { gap: 2px; padding: 0 1.25rem; }
  .cfg-rail button {
    position: relative;
    flex: 1;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .cfg-rail button::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 19px;
    height: 6px;
    border-radius: 3px;
    background: var(--line);
  }
  .cfg-rail button[aria-selected="true"] { background: transparent; }
  .cfg-rail button[data-done="true"] { background: transparent; }
  .cfg-rail button[aria-selected="true"]::before { background: var(--red); }
  .cfg-rail button[data-done="true"]::before { background: var(--ink); }

  .cfg-wiz-head { padding: 1rem 1.25rem 0.4rem; }
  .cfg-panels { padding: 0.75rem 1.25rem 1.5rem; }
  .cfg-wiz-foot { padding: 0.75rem 1.25rem 1rem; }
  .cfg-step-title { font-size: 1.5rem; }
  .cfg-step-desc { margin-bottom: 1rem; }
  /* the keyboard shrinks the viewport instead of the page, so a focused field
     must be scrollable into view rather than stuck under the keyboard */
  .cfg-form input,
  .cfg-form select,
  .cfg-name-form input { scroll-margin-bottom: 45vh; }
}

/* Landscape phones: the width-only breakpoint put an 844x390 screen back on
   the desktop two-column layout, leaving the wizard a 170px column beside a
   stage three quarters of the height. */
@media (max-height: 520px) and (orientation: landscape) {
  /* the stage keeps a smaller share of a short screen, and the bar sheds its
     height so the wizard still gets a usable window */
  .cfg-app > .cfg-stage { height: 62dvh; min-height: 9rem; top: calc(48px + 0.4rem); }
  .cfg-bar { min-height: 48px; }
  .cfg-stage-chips { right: 3.5rem; }
  .cfg-rail button { height: 40px; }
  .cfg-rail button::before { top: 17px; }
  .cfg-step-title { font-size: 1.25rem; }
  .cfg-panels { padding: 0.5rem 1rem 1rem; }
  .cfg-wiz-foot { padding: 0.5rem 1rem 0.75rem; }
}

/* the v2 header is a 3-track grid (nav | brand | tools) that collapses at
   860px in site.css, so no page-scoped header fitting is needed here. */

/* ---------- my-hats landing (replaces the wizard in its grid slot) ---------- */

/* Desktop: column 2, row 1 — the exact cell the wizard auto-places into.
   Only one of the two is ever shown (designa.js toggles [hidden]), so the
   landing simply takes over the right-hand panel without touching the 3D
   stage in column 1. */
.cfg-app > .cfg-landing {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden auto;
  display: block;
}
.cfg-app > .cfg-landing[hidden] { display: none; }
.cfg-landing-head h2 {
  margin: 0 0 0.3rem;
  font-size: var(--fs-title, 2rem);
  letter-spacing: -0.03em;
}
.cfg-landing-head p { margin: 0 0 1.4rem; color: var(--dim); }
.cfg-landing-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.8rem;
  margin: 0 0 1.6rem;
}
.hat-card {
  background: var(--white);
  border-radius: var(--radius-card, 24px);
  padding: 0;
  display: grid;
  align-content: start;
  overflow: hidden;
  box-shadow: var(--shadow-card, 0 2px 10px rgba(31, 31, 35, 0.08));
  transition: box-shadow var(--ease-fast, 150ms ease), transform var(--ease-fast, 150ms ease);
}
.hat-card:hover {
  box-shadow: var(--shadow-lift, 0 10px 24px rgba(31, 31, 35, 0.14));
  transform: translateY(-2px);
}
.hat-tile {
  position: relative;
  background: var(--sky-100);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 148px;
  padding: 1rem 0.9rem 0;
  box-sizing: border-box;
}
.hat-tile .hat-cap { width: 116px; height: auto; filter: drop-shadow(0 5px 9px rgba(31, 31, 35, 0.13)); }
.hat-tile .cap-thumb-canvas { width: 116px; height: auto; display: block; filter: drop-shadow(0 5px 9px rgba(31, 31, 35, 0.13)); }
.hat-tile-chips {
  position: absolute;
  top: 0.7rem;
  left: 0.8rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.hat-chip {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--white);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  color: var(--ink);
}
.hat-chip-friend { background: var(--ink); color: var(--white); }
.hat-chip-cart {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--red-strong);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  color: var(--white);
}
.hat-body { padding: 0.85rem 1.05rem 1.05rem; display: grid; gap: 0.2rem; }
.hat-card .hat-name { margin: 0; font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em; }
.hat-card .hat-meta { margin: 0; color: var(--dim); font-size: 0.82rem; }
.hat-card .hat-actions {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.hat-btn {
  border: 0;
  border-radius: 999px;
  background: var(--sky-100);
  color: var(--sky-ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6em 1em;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hat-btn:hover { background: var(--sky-200); }
.hat-btn-open { grid-column: 1 / -1; }
.hat-btn-quiet.is-on { background: var(--sky-50); box-shadow: none; color: var(--sky-ink); }
.hat-owner {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 30px;
  font-size: 0.8rem;
  color: var(--dim);
}
.hat-owner-label { font-weight: 700; white-space: nowrap; }
.hat-owner-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: var(--sky-50);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.hat-owner-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hat-owner-form { display: flex; gap: 0.3rem; flex: 1; min-width: 0; }
.hat-owner-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  border: 0;
  box-shadow: inset 0 0 0 1.5px var(--sky-ink);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: var(--white);
}
.hat-owner-save {
  border: 0;
  border-radius: 999px;
  background: var(--sky-100);
  color: var(--sky-ink);
  font: inherit;
  font-weight: 700;
  padding: 0.3em 0.75em;
  cursor: pointer;
}
.hat-remove { justify-self: start; margin-top: 0.3rem; font-size: 0.8rem; }
.cfg-landing-new { width: 100%; }

/* ---------- stage 4: the board's bar extras, drawer, added sheet ---------- */

/* design-name block in the bar (design Configurator header): name + saved
   state, ellipsized, hidden pieces collapse on mobile */
.cfg-dname {
  display: grid;
  line-height: 1.2;
  min-width: 0;
}
.cfg-dname b {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
}
.cfg-dname span {
  font-size: 0.72rem;
  color: var(--dim);
  white-space: nowrap;
}
.cfg-mm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 44px;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--sky-50);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.cfg-mm-pill:hover { background: var(--sky-100); }
.cfg-mm-pill-n { font-size: 0.75rem; color: var(--dim); }
.cfg-bar-price span.is-group { color: var(--red-strong); font-weight: 700; }
@media (max-width: 1079px) {
  .cfg-back-txt,
  .cfg-word,
  .cfg-divider--dname { display: none; }
  /* the design name + saved state stay in the mobile bar (board keeps them) */
  .cfg-dname b { max-width: 8.5rem; font-size: 0.88rem; }
  .cfg-dname span { font-size: 0.68rem; }
  .cfg-mm-pill { padding: 0 0.75rem; }
  .cfg-mm-pill-txt { display: none; }
}

/* granska: design name + the save/share text links + the derived group card */
.cfg-name-form { margin-top: 1.1rem; }
.cfg-granska-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.cfg-linkbtn {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  color: var(--sky-ink);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.cfg-linkbtn:hover { color: var(--sky-ink); filter: none; text-decoration: underline; }
.cfg-linkbtn:disabled { opacity: 0.6; cursor: default; }
.cfg-group-card {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-card-sm, 16px);
  background: var(--ink);
  color: var(--white);
  display: grid;
  gap: 0.35rem;
}
.cfg-group-card[hidden] { display: none; }
.cfg-group-card b { font-size: 0.95rem; }
.cfg-group-card span { font-size: 0.84rem; line-height: 1.45; color: var(--sky-200); }

/* modal chrome shared by the added sheet and the drawer */
.cfg-added,
.cfg-drawer {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 35, 0.45);
  z-index: 70;
  display: grid;
}
.cfg-added { place-items: center; padding: 1rem; }
.cfg-drawer { justify-content: flex-end; }
.cfg-added[hidden],
.cfg-drawer[hidden] { display: none; }
.cfg-x {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--sky-50);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  flex: none;
}
.cfg-x:hover { background: var(--sky-100); }

/* confirmation sheet (design CfgAdded) */
.cfg-added-card {
  background: var(--white);
  width: 100%;
  max-width: 30rem;
  border-radius: var(--radius-card, 28px);
  box-shadow: var(--shadow-float, 0 18px 40px rgba(31, 31, 35, 0.25));
  padding: 1.75rem;
  box-sizing: border-box;
  display: grid;
  gap: 1.1rem;
}
@media (max-width: 759px) {
  .cfg-added { align-items: end; padding: 0; }
  .cfg-added-card {
    max-width: none;
    border-radius: var(--radius-card, 28px) var(--radius-card, 28px) 0 0;
    padding: 1.25rem 1.25rem 1.4rem;
  }
}
.cfg-added-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cfg-added-head > b {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.05rem;
  flex: 1;
}
.cfg-added-ok {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--success, #2e7d4f);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex: none;
}
.cfg-added-design {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
}
.cfg-added-thumb {
  background: var(--sky-100);
  border-radius: 14px;
  height: 72px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 6px 5px;
  box-sizing: border-box;
}
.cfg-added-thumb svg, .cfg-added-thumb .cap-thumb-canvas { width: 60px; height: auto; display: block; }
.cfg-added-info { min-width: 0; display: grid; gap: 0.15rem; }
.cfg-added-info b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfg-added-info span { font-size: 0.84rem; color: var(--dim); }
.cfg-added-price { font-weight: 800; white-space: nowrap; }
.cfg-added-meter {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-card-sm, 16px);
  padding: 1rem 1.1rem 0.9rem;
  display: grid;
  gap: 0.35rem;
}
.cfg-added-meter[hidden] { display: none; }
.cfg-added-meter b { font-size: 0.95rem; }
.cfg-added-meter span { font-size: 0.84rem; line-height: 1.45; color: var(--sky-200); }
.cfg-added-actions { display: grid; gap: 0.5rem; }
.cfg-added-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.cfg-added-row .btn { padding-left: 0.5rem; padding-right: 0.5rem; }

/* Mina mössor drawer (design CfgDrawer) */
.cfg-drawer-panel {
  background: var(--white);
  width: 25rem;
  max-width: 100%;
  height: 100%;
  border-radius: var(--radius-card, 28px) 0 0 var(--radius-card, 28px);
  box-shadow: var(--shadow-float, 0 18px 40px rgba(31, 31, 35, 0.25));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}
@media (max-width: 759px) {
  .cfg-drawer { align-items: end; }
  .cfg-drawer-panel {
    width: 100%;
    height: auto;
    max-height: 85%;
    border-radius: var(--radius-card, 28px) var(--radius-card, 28px) 0 0;
  }
}
.cfg-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0.75rem;
}
.cfg-drawer-head h2 { margin: 0; font-size: 1.6rem; }
.cfg-drawer-body { overflow-y: auto; padding: 0 0.75rem 1rem; min-height: 0; }
.cfg-drawer-new {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border-radius: var(--radius-card-sm, 16px);
  border: 2px dashed var(--sky-200);
  font-weight: 700;
}
.cfg-drawer-new > span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  line-height: 1;
  flex: none;
}
.cfg-drawer-label {
  margin: 1.1rem 0 0.4rem;
  padding: 0 0.5rem;
  font-size: var(--fs-eyebrow, 0.78rem);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow, 0.14em);
  text-transform: uppercase;
  color: var(--dim);
}
.cfg-drawer-list { display: grid; gap: 0.25rem; }
.cfg-drawer-row {
  all: unset;
  cursor: pointer;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.6rem;
  border-radius: var(--radius-card-sm, 16px);
  box-sizing: border-box;
}
.cfg-drawer-row:hover { background: var(--sky-50); }
.cfg-drawer-row.is-active {
  background: var(--sky-50);
  box-shadow: inset 0 0 0 1.5px var(--sky-ink);
}
.cfg-drawer-thumb {
  background: var(--sky-100);
  border-radius: 12px;
  height: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 5px 4px;
  box-sizing: border-box;
}
.cfg-drawer-thumb.is-friend { background: var(--sky-50); }
.cfg-drawer-thumb svg, .cfg-drawer-thumb .cap-thumb-canvas { width: 46px; height: auto; display: block; }
.cfg-drawer-info { min-width: 0; display: grid; }
.cfg-drawer-info b {
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfg-drawer-info span { font-size: 0.78rem; color: var(--dim); }
.cfg-drawer-badge {
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}
.cfg-drawer-row.is-active .cfg-drawer-badge { background: var(--ink); color: var(--white); }
.cfg-drawer-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--line-soft);
}
.cfg-drawer-foot .btn { justify-content: center; }

/* ---------- tier marks on the options ---------- */

/* Every option states the tier it needs, so the package is never a separate
   decision the student has to reconcile with what they picked. Classic needs
   no badge (it is the floor); the higher tiers do, or the choice looks free. */
.opt-chip[data-tier="Deluxe"]::after,
.opt-chip[data-tier="Premium"]::after {
  content: attr(data-tier);
  position: absolute;
  left: 50%;
  bottom: -0.34rem;
  transform: translateX(-50%);
  padding: 0.05rem 0.34rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
}
.opt-dot[data-tier],
.opt-chip[data-tier] { position: relative; overflow: visible; }
.cfg-dots { padding-bottom: 0.25rem; }
.opt-chip[data-tier="Deluxe"] { padding-bottom: 0.95rem; }
.opt-chip[data-tier="Premium"] { padding-bottom: 0.95rem; }

/* an option whose tier cannot be ordered right now: visible, inert, marked */
.opt-dot.is-soldout,
.opt-chip.is-soldout {
  cursor: not-allowed;
  opacity: 0.45;
  filter: saturate(0.4);
}
.opt-chip.is-soldout::before {
  content: "Slutsåld";
  position: absolute;
  left: 50%;
  top: -0.34rem;
  transform: translateX(-50%);
  padding: 0.05rem 0.34rem;
  border-radius: 999px;
  background: var(--red-50, #fde8e8);
  color: var(--ink);
  font-size: 0.58rem;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- tier locks and sold-out tiers ---------- */

/* A feature group behind a tier. The content stays visible but inert, so the
   student sees what the tier adds; the bar above it names the tier and holds
   the one-press unlock. */
.cfg-lockgroup { display: grid; gap: 0.85rem; }
.cfg-lockgroup + .cfg-lockgroup,
.cfg-lockgroup + .cfg-part { margin-top: 1.25rem; }
.cfg-lockgroup.is-locked > :not(.cfg-lockbar) {
  opacity: 0.42;
  filter: saturate(0.55);
  pointer-events: none;
  user-select: none;
}
.cfg-lockbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.9rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  border-radius: var(--radius-pill, 999px);
  background: var(--sky-50);
  box-shadow: inset 0 0 0 1px var(--line);
}
.cfg-lockbar-note { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.cfg-unlock {
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--ink);
  color: var(--white);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.42rem 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}
.cfg-unlock:hover { background: #000; }
.cfg-unlock:disabled { opacity: 0.55; cursor: not-allowed; }
.cfg-unlock:focus-visible { outline: 2px solid var(--focus, var(--sky-ink)); outline-offset: 2px; }

.pkg-card.is-soldout {
  cursor: not-allowed;
  background: var(--sky-50);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.pkg-card.is-soldout .pkg-name,
.pkg-card.is-soldout .pkg-desc { color: var(--dim); }
.pkg-card .pkg-soldout {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--red-50);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- colour row headers ---------- */

/* The tier lives once on the row header instead of on every dot; a sold-out
   row folds itself, and the head unfolds it. */
.cfg-sub-head {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  background: none; border: 0; padding: 0.3rem 0.15rem; margin: 0;
  font: inherit; color: var(--dim); font-weight: 700; cursor: pointer;
  text-align: left;
}
.row-dots {
  flex: 1; display: flex; gap: 3px; justify-content: flex-end;
  overflow: hidden; min-width: 0;
}
.row-dots i {
  width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid rgba(31, 31, 35, 0.14); opacity: 0.45; filter: saturate(0.3);
}
.cfg-sub:not(.is-folded) .row-dots { display: none; }
.cfg-sub:not(.is-folded) .row-pill { margin-left: auto; }
.cfg-sub-head::after { content: "\25BE"; font-size: 0.72em; opacity: 0.75; margin-left: 0.15rem; }
.cfg-sub.is-folded .cfg-sub-head::after { content: "\25B8"; }
.cfg-sub.is-folded .cfg-opts { display: none; }
.row-pill {
  font-style: normal; padding: 0.07rem 0.4rem; border-radius: 999px;
  font-size: 0.58rem; font-weight: 800; letter-spacing: 0.03em; line-height: 1.4;
  white-space: nowrap;
}
.row-pill-tier { background: var(--ink); color: var(--white); }
.row-pill-soldout { background: var(--red-50, #fde8e8); color: var(--ink); }
