/* niche.css - the niche builder and its checkout.
   Everything sits under .nb so it cannot restyle the host page, and every
   colour, face and radius is a --nb-* token. theme.css (made per site by
   scripts/extract_theme.mjs from the host's own stylesheet) sets those
   tokens, so the builder looks like the site it is dropped into. The values
   here are only the fallback for a host with nothing to borrow. */
.nb {
  --nb-bg: #ffffff;
  --nb-surface: #f6f6f4;
  --nb-surface-2: #ececea;
  --nb-ink: #161616;
  --nb-muted: #55595e;
  --nb-dim: #7a7f85;
  --nb-line: #e3e3e0;
  --nb-line-2: #cfcfcb;
  --nb-accent: #1d4f9c;
  --nb-accent-ink: #ffffff;
  /* state colours lean toward the page's own text colour, so they stay
     readable whether the host is light or dark */
  --nb-ok: color-mix(in srgb, #1f9d45 70%, var(--nb-ink));
  --nb-bad: color-mix(in srgb, #d93a2f 72%, var(--nb-ink));
  --nb-warn: color-mix(in srgb, #df7a1c 72%, var(--nb-ink));
  --nb-radius: 12px;
  --nb-radius-sm: 8px;
  --nb-font: inherit;
  --nb-font-head: inherit;
  --nb-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --nb-max: 1160px;
  --nb-gutter: 16px;
  color: var(--nb-ink);
  font-family: var(--nb-font);
  line-height: 1.5;
}
.nb *, .nb *::before, .nb *::after { box-sizing: border-box; }
.nb [hidden] { display: none !important; }
.nb button, .nb input, .nb select, .nb textarea { font: inherit; color: inherit; }
.nb :focus-visible { outline: 2px solid var(--nb-accent); outline-offset: 2px; }

/* ---- buttons ---- */
.nb .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--nb-radius-sm);
  border: 1px solid var(--nb-line-2); background: var(--nb-bg); color: var(--nb-ink);
  font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.nb .btn:hover { border-color: var(--nb-ink); }
.nb .btn:active { transform: translateY(1px); }
.nb .btn svg { width: 18px; height: 18px; }
.nb .btn-p { background: var(--nb-accent); border-color: var(--nb-accent); color: var(--nb-accent-ink); }
.nb .btn-p:hover { background: color-mix(in srgb, var(--nb-accent) 88%, #000); border-color: transparent; }
.nb .btn-s { background: transparent; }
.nb .btn[disabled] { opacity: .55; cursor: not-allowed; }
.nb .btn-wide { width: 100%; }
.nb .link { background: none; border: 0; padding: 0; color: var(--nb-accent); text-decoration: underline; cursor: pointer; font-weight: 600; }

/* ---- layout ---- */
.nb-builder { max-width: var(--nb-max); margin: 0 auto; padding: 0 var(--nb-gutter); display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); align-items: start; }
@media (max-width: 900px) { .nb-builder { grid-template-columns: 1fr; } }
.nb-form { display: grid; gap: 14px; }
.nb-side { position: sticky; top: 16px; display: grid; gap: 14px; }
/* On a phone the tag stays in view while the form is filled in: the preview
   comes first and sticks to the top, compact; the order list follows the form. */
@media (max-width: 900px) {
  .nb-builder { display: flex; flex-direction: column; align-items: stretch; }
  .nb-builder .nb-side { display: contents; }
  .nb-builder .nb-preview { order: -1; position: sticky; top: 0; z-index: 5; padding: 10px; box-shadow: 0 6px 14px rgba(0,0,0,.08); }
  .nb-builder .nb-stage { min-height: 96px; padding: 10px; }
  .nb-builder .nb-facts { margin-top: 8px; }
  .nb-builder .nb-actions { margin-top: 8px; }
  .nb-checkout .nb-side { position: static; }
}
.nb-card { background: var(--nb-surface); border: 1px solid var(--nb-line); border-radius: var(--nb-radius); padding: 18px; }
.nb-card > h3, .nb-step > legend { margin: 0 0 12px; font: 700 1rem/1.3 var(--nb-font-head); display: flex; align-items: center; gap: 10px; padding: 0; }
.nb-step { border: 0; margin: 0; min-width: 0; }
.nb-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--nb-ink); color: var(--nb-bg); font: 700 .78rem/1 var(--nb-font); flex: none; }
.nb-hint { margin: 6px 0 0; font-size: .86rem; color: var(--nb-muted); }
.nb-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---- fields ---- */
.nb-field { display: grid; gap: 6px; }
.nb-field > span { font-weight: 600; font-size: .9rem; }
.nb-field > span small { font-weight: 500; color: var(--nb-dim); }
.nb input[type=text], .nb input[type=email], .nb input[type=tel], .nb input[type=number], .nb select, .nb textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; background: var(--nb-bg); border: 1px solid var(--nb-line-2);
  border-radius: var(--nb-radius-sm); font-size: 1rem;
}
.nb textarea { min-height: 84px; resize: vertical; }
.nb input:focus, .nb select:focus, .nb textarea:focus { outline: none; border-color: var(--nb-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nb-accent) 20%, transparent); }
.nb input.upper { text-transform: uppercase; }
.nb-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-seg button {
  min-height: 40px; padding: 0 14px; border-radius: var(--nb-radius-sm); border: 1px solid var(--nb-line-2);
  background: var(--nb-bg); cursor: pointer; font-weight: 600;
}
.nb-seg button[aria-pressed=true] { background: var(--nb-ink); color: var(--nb-bg); border-color: var(--nb-ink); }
.nb-seg.big button { font-size: 1.15rem; min-width: 52px; }
.nb-check { display: flex; gap: 10px; align-items: center; font-size: .92rem; cursor: pointer; }
.nb-check input { width: 18px; height: 18px; accent-color: var(--nb-accent); }

/* ---- colour ---- */
.nb-colour { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nb-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--nb-line-2); background: var(--nb-bg); font-weight: 600; font-size: .9rem; }
.nb-chip i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 800 .8rem/1 var(--nb-font); font-style: normal; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.nb-pairs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nb-pairs button { padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.nb-pairs button[aria-pressed=true] { border-color: var(--nb-ink); }
.nb-pairs i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 800 .85rem/1 var(--nb-font); font-style: normal; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* ---- preview ---- */
.nb-preview { background: var(--nb-surface); border: 1px solid var(--nb-line); border-radius: var(--nb-radius); padding: 18px; }
.nb-stage {
  display: grid; place-items: center; min-height: 170px; padding: 18px; border-radius: var(--nb-radius-sm);
  background: repeating-linear-gradient(45deg, var(--nb-bg), var(--nb-bg) 10px, color-mix(in srgb, var(--nb-surface) 60%, var(--nb-bg)) 10px, color-mix(in srgb, var(--nb-surface) 60%, var(--nb-bg)) 20px);
  border: 1px dashed var(--nb-line-2); overflow: hidden;
}
.nb-stage svg { display: block; max-width: 100%; height: auto; filter: drop-shadow(0 3px 7px rgba(10,20,40,.22)); }
.nb-facts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 12px; font-size: .9rem; color: var(--nb-muted); }
.nb-facts b { color: var(--nb-ink); font-variant-numeric: tabular-nums; }
.nb-price { font: 800 1.6rem/1 var(--nb-font-head); color: var(--nb-ink); font-variant-numeric: tabular-nums; }
.nb-price small { font: 500 .8rem var(--nb-font); color: var(--nb-dim); }
.nb-warn { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--nb-radius-sm); background: color-mix(in srgb, var(--nb-warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--nb-warn) 35%, transparent); font-size: .88rem; }
.nb-warn.crit { background: color-mix(in srgb, var(--nb-bad) 10%, transparent); border-color: color-mix(in srgb, var(--nb-bad) 40%, transparent); }
.nb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.nb-actions .btn-p { flex: 1; }

/* ---- the order list ---- */
.nb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.nb-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--nb-line); border-radius: var(--nb-radius-sm); background: var(--nb-bg); }
.nb-item.editing { border-color: var(--nb-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--nb-accent) 25%, transparent); }
.nb-thumb svg { width: 76px; height: auto; display: block; }
.nb-item .t { font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; }
.nb-item .s { font-size: .8rem; color: var(--nb-muted); }
.nb-item .r { display: grid; justify-items: end; gap: 6px; }
.nb-item .r b { font-variant-numeric: tabular-nums; }
.nb-qty { display: inline-flex; align-items: center; border: 1px solid var(--nb-line-2); border-radius: var(--nb-radius-sm); overflow: hidden; }
.nb-qty button { width: 30px; height: 30px; border: 0; background: var(--nb-surface); cursor: pointer; font-weight: 700; }
.nb-qty input { width: 52px !important; min-height: 30px !important; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 0 !important; -moz-appearance: textfield; }
.nb-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.nb-mini { display: flex; gap: 10px; font-size: .8rem; }
.nb-empty { color: var(--nb-dim); font-size: .92rem; padding: 6px 0; }
.nb-totals { display: grid; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--nb-line); font-variant-numeric: tabular-nums; }
.nb-totals div { display: flex; justify-content: space-between; color: var(--nb-muted); }
.nb-totals .grand { color: var(--nb-ink); font-weight: 800; font-size: 1.15rem; }

/* ---- checkout ---- */
.nb-checkout { max-width: var(--nb-max); margin: 0 auto; padding: 0 var(--nb-gutter); display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); align-items: start; }
@media (max-width: 900px) { .nb-checkout { grid-template-columns: 1fr; } }
.nb-ship { display: grid; gap: 8px; margin-top: 10px; }
.nb-ship label { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--nb-line-2); border-radius: var(--nb-radius-sm); background: var(--nb-bg); cursor: pointer; }
.nb-ship label:has(input:checked) { border-color: var(--nb-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--nb-accent) 25%, transparent); }
.nb-ship small { color: var(--nb-muted); }
.nb-err { color: var(--nb-bad); font-weight: 600; font-size: .92rem; margin: 8px 0 0; }
.nb-note { font-size: .86rem; color: var(--nb-muted); }
.nb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- progress while the order is made ---- */
.nb-progress { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: color-mix(in srgb, var(--nb-bg) 82%, transparent); backdrop-filter: blur(4px); }
.nb-progress .box { width: min(440px, calc(100vw - 32px)); padding: 26px; border-radius: var(--nb-radius); background: var(--nb-surface); border: 1px solid var(--nb-line); box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.nb-progress h3 { margin: 0 0 14px; font: 700 1.15rem var(--nb-font-head); }
.nb-progress ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nb-progress li { display: flex; gap: 10px; align-items: center; color: var(--nb-dim); }
.nb-progress li.on { color: var(--nb-ink); font-weight: 600; }
.nb-progress li.done { color: var(--nb-ok); }
.nb-progress li i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.nb-progress li.on i { animation: nb-pulse 1s infinite; }
@keyframes nb-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .nb-progress li.on i { animation: none; } .nb .btn { transition: none; } }

/* sign niche: signal-word colour dot in the word buttons */
.nb .nb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.22); }

/* checkout: header, two-column details, delivery as option cards, pinned summary */
.nb-co-head { display: grid; gap: 6px; margin-bottom: 4px; }
.nb-co-head h2 { margin: 6px 0 0; font: 800 1.6rem/1.1 var(--nb-font-head); color: var(--nb-ink); }
.nb-co-head p { margin: 0; color: var(--nb-muted); max-width: 60ch; }
.nb .nb-back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--nb-line-2); border-radius: 999px;
  background: var(--nb-bg); color: var(--nb-ink); font: 600 .85rem/1 var(--nb-font); cursor: pointer; }
.nb .nb-back:hover { border-color: var(--nb-ink); }
.nb-row.nb-two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 560px) { .nb-row.nb-two { grid-template-columns: minmax(0, 1fr); } }
.nb-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nb .nb-opt { font: 500 .72rem/1 var(--nb-font); font-style: normal; color: var(--nb-dim); text-transform: uppercase; letter-spacing: .06em; }
.nb .nb-help { font-size: .8rem; color: var(--nb-dim); }
.nb-step > legend .nb-opt { margin-left: 4px; }
.nb-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .nb-methods { grid-template-columns: minmax(0, 1fr); } }
.nb .nb-method { position: relative; display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px 16px 14px 46px; border: 1.5px solid var(--nb-line-2);
  border-radius: var(--nb-radius-sm); background: var(--nb-bg); color: var(--nb-ink); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.nb .nb-method:hover { border-color: var(--nb-dim); }
.nb .nb-method i { position: absolute; left: 16px; top: 16px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--nb-line-2); background: var(--nb-bg); }
.nb .nb-method b { font: 700 .98rem/1.2 var(--nb-font-head); }
.nb .nb-method span { font-size: .84rem; color: var(--nb-muted); line-height: 1.35; }
.nb .nb-method[aria-pressed=true] { border-color: var(--nb-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nb-accent) 45%, transparent); }
.nb .nb-method[aria-pressed=true] i { border-color: var(--nb-ink); background: radial-gradient(circle, var(--nb-ink) 0 45%, var(--nb-bg) 50%); }
.nb-checkout .nb-side { position: sticky; top: 16px; }
.nb-summary h3 { display: flex; align-items: baseline; justify-content: space-between; }
.nb-summary h3 small { font: 500 .8rem var(--nb-font); color: var(--nb-dim); }
.nb-secure { display: flex; gap: 8px; align-items: flex-start; }
.nb-secure::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 2px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 1 1 8 0v2h1v8H3V7h1zm2 0h4V5a2 2 0 1 0-4 0v2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 1 1 8 0v2h1v8H3V7h1zm2 0h4V5a2 2 0 1 0-4 0v2z'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (max-width: 900px) { .nb-checkout .nb-side { position: static; } }
