/* The Remnant Room — shop styles. Self-contained: no external fonts or resources. */
:root {
  color-scheme: light;
  /* palette: deep green, cream, brass */
  --green-950: #0f2a20;
  --green-900: #173f30;
  --green-800: #1d4d3b;
  --green-700: #256049;
  --green-100: #dfe9df;
  --cream: #f7f1e2;
  --cream-2: #efe5cc;
  --card: #fffbf1;
  --ink: #1c2822;
  --ink-2: #47554d;
  --ink-3: #525e57;        /* muted text: 5.5:1 on cream even where the weave lines cross, 5.4:1 on --cream-2 */
  --line: #ddd0b1;
  --line-2: #cbbb94;
  --brass: #c4952f;        /* decorative; dark text sits on it */
  --brass-light: #e4c06a;  /* on deep green */
  --brass-ink: #7a5710;    /* brass as text on cream (AA) */
  --ok: #1f6b45;
  --bad: #a3271b;
  --bad-soft: #f8e1dc;
  --focus: #8a6418;        /* dark brass: >= 4.2:1 on cream and cards (3:1 needed for a focus ring) */

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 42, 32, .07), 0 6px 20px rgba(15, 42, 32, .07);
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
/* Below 900px the masthead has a second row for the section links. */
@media (max-width: 899.98px) { html { scroll-padding-top: 130px; } }
/* Reduced motion: the page and the assistant's runtime (its spinner and pulsing dots,
   whose styles it adds to the page) end each animation at once and do not repeat it. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font: 16px/1.55 var(--sans);
  color: var(--ink);
  background-color: var(--cream);
  /* a faint linen weave */
  background-image:
    repeating-linear-gradient(0deg, rgba(122, 87, 16, .035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(122, 87, 16, .03) 0 1px, transparent 1px 5px);
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--green-950); margin: 0 0 .5em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 .75em; }
a { color: var(--green-700); text-underline-offset: 2px; }
a:hover { color: var(--green-900); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
[tabindex="-1"]:focus-visible { outline: 3px solid var(--focus); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 50;
  background: var(--brass-light); color: var(--green-950); padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip:focus { top: 8px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 24px; } }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: var(--green-900);
  color: var(--cream);
  border-bottom: 3px solid var(--brass);
  box-shadow: 0 2px 10px rgba(15, 42, 32, .2);
}
.masthead-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; min-height: 44px; min-width: 0; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; color: var(--brass-light); flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
/* Phones and tablets: the section links get a row of their own under the name and the
   basket, scrolling sideways if they ever do not fit. From 900px they sit in one row. */
.masthead-inner { flex-wrap: wrap; row-gap: 4px; padding-top: 10px; }
.site-nav {
  display: flex; gap: 4px; order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none;
  margin: 0 0 2px; border-top: 1px solid var(--green-800);
}
.site-nav a {
  color: var(--cream); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm);
  min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap;
}
.site-nav a:hover { background: var(--green-800); color: #fff; }
.basket-chip {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 44px; padding: 6px 12px; border-radius: 999px;
  background: var(--brass-light); color: var(--green-950); text-decoration: none; font-weight: 600;
}
.basket-chip:hover { background: #efd089; color: var(--green-950); }
.basket-chip svg { width: 20px; height: 20px; }
.chip-count {
  min-width: 24px; height: 24px; border-radius: 12px; padding: 0 6px;
  display: inline-grid; place-items: center; background: var(--green-900); color: var(--cream); font-size: .85rem;
}
.basket-chip:focus-visible { outline-color: var(--cream); }
/* On the deep-green masthead the dark brass ring is faint: use light brass (6.7:1). */
.masthead :focus-visible { outline-color: var(--brass-light); }
@media (max-width: 420px) {
  .brand-name { font-size: 1.12rem; }
  .chip-label { display: none; }
}
/* Down to 320px (the WCAG reflow width) the name and the basket keep one row, and the
   three section links fit their row without scrolling. The long "Deadstock & policies"
   link needs about 383px, so below 420px (room for wider phone fonts) it is "Policies". */
.nav-short { display: none; }
@media (max-width: 419.98px) {
  .nav-full { display: none; }
  .nav-short { display: inline; }
}
@media (max-width: 379.98px) {
  .masthead-inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { font-size: 1.05rem; }
}
@media (min-width: 900px) {
  .masthead-inner { flex-wrap: nowrap; padding-top: 0; }
  .site-nav { order: 0; flex: 0 1 auto; margin: 0 0 0 auto; border-top: 0; }
  .site-nav a { padding: 10px 12px; min-height: 44px; }
  .basket-chip { margin-left: 8px; }
}

/* ---------- hero ---------- */
.hero { padding-top: 40px; padding-bottom: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; }
.hero-art { display: none; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .hero-art { display: block; width: 100%; max-width: 420px; justify-self: end; height: auto; }
}
.eyebrow {
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--brass-ink);
  margin-bottom: .6em;
}
.hero h1 { font-size: clamp(1.8rem, 1.1rem + 2.8vw, 3rem); max-width: 20ch; margin-bottom: .4em; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 60ch; }
.lede-small { font-size: 1rem; }
.demo-notice {
  display: inline-block; max-width: 100%;
  font-size: .9rem; color: var(--green-900); background: var(--green-100);
  border: 1px dashed var(--green-700); border-radius: var(--radius-sm); padding: 6px 10px;
}
.today { font-size: .9rem; color: var(--ink-3); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 40px; }
@media (min-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding: 2px; }
}

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.results-count { color: var(--ink-3); font-size: .95rem; margin: 0; }

/* ---------- forms ---------- */
label, legend { font-weight: 600; font-size: .92rem; color: var(--ink); }
.hint { font-weight: 400; color: var(--ink-3); font-size: .85rem; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type="search"], input[type="text"], input[type="email"], input:not([type]), input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px;
  /* the border is what shows a field is a field: --ink-3 keeps it at 3:1 or more (WCAG 1.4.11) */
  background: #fff; border: 1.5px solid var(--ink-3); border-radius: var(--radius-sm);
}
textarea { resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--green-900) 50%), linear-gradient(135deg, var(--green-900) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input:hover, select:hover, textarea:hover { border-color: var(--green-700); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; font-weight: 650; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--green-900); color: var(--cream); border-color: var(--green-900); }
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); }
.btn-primary:disabled { background: #b9bfb6; border-color: #b9bfb6; color: #2c3530; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--green-900); border-color: var(--line-2); }
.btn-quiet:hover { background: var(--cream-2); border-color: var(--green-700); }
.btn-wide { width: 100%; }

.unit-input { position: relative; display: block; }
.unit-input input { padding-right: 34px; }
.unit-input > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }

/* ---------- filters ---------- */
.filters {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 8px 0 20px; box-shadow: var(--shadow);
}
.field-query { grid-column: 1 / -1; }
.field-reset { grid-column: 1 / -1; }
.field-reset .btn { width: 100%; }
@media (min-width: 720px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
  .field-query { grid-column: 1 / span 3; }
  .field-reset { grid-column: auto; }
}

/* ---------- fabric cards ---------- */
.fabric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 20px; }
.fabric-card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.swatch-wrap { position: relative; }
.badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; margin: 0; }
.badge {
  font-size: .75rem; font-weight: 700; letter-spacing: .03em; padding: 3px 8px; border-radius: 999px;
  background: var(--card); color: var(--green-900); border: 1px solid var(--line-2);
}
.badge-dir::before { content: "↑ "; }
.badges { flex-wrap: wrap; right: 10px; }
.badge-pair { background: var(--green-900); color: var(--cream); border-color: var(--green-900); }
.badge-pair::before { content: "⇄ "; }
.origin, .pairs { font-size: .85rem; color: var(--ink-2); margin: 0 0 10px; padding: 6px 10px; background: var(--cream); border-left: 3px solid var(--brass); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pairs ul { margin: 4px 0 0; padding-left: 18px; }
.origin-label { font-weight: 700; color: var(--green-900); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-head h3 { margin: 0; }
.price { margin: 0; white-space: nowrap; color: var(--ink-2); }
.price strong { color: var(--green-900); font-size: 1.1rem; }
.desc { color: var(--ink-2); font-size: .93rem; margin: 6px 0 10px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0 0 10px; font-size: .88rem; }
.facts div { min-width: 0; }
.facts dt { color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; }
.tags li { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--cream-2); color: var(--brass-ink); font-weight: 600; }
.card-buy { margin-top: auto; border-top: 1px dashed var(--line-2); padding-top: 12px; }
.colour-picker legend { margin-bottom: 4px; }
.colour-name { font-weight: 400; color: var(--ink-2); }
.colour-options { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 8px; }
.colour-option {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 50%;
}
.colour-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.colour-option .swatch--dot {
  width: 32px; height: 32px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
}
.colour-option input:checked + .swatch--dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--green-900); }
.colour-option input:focus-visible + .swatch--dot { outline: 3px solid var(--focus); outline-offset: 4px; }
.colour-option.is-out .swatch--dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(135deg, transparent 46%, var(--bad) 46% 54%, transparent 54%);
}
.buy-row { display: flex; gap: 10px; align-items: end; }
.metres-field { display: flex; flex-direction: column; gap: 4px; width: 104px; flex: none; }
.buy-row .btn { flex: 1; }
.stock { font-size: .86rem; color: var(--ink-3); margin: 8px 0 0; }
.stock.low { color: var(--brass-ink); font-weight: 600; }
.card-msg, .line-msg { font-size: .88rem; margin: 6px 0 0; }
.card-msg:empty, .line-msg:empty { display: none; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

/* ---------- swatches (CSS only) ---------- */
.swatch { display: block; position: relative; background-color: var(--c, #ccc); overflow: hidden; }
.swatch--hero { height: 128px; border-bottom: 1px solid var(--line); }
.swatch--plain {
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px);
}
.swatch--twill {
  background-image:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .13) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 5px);
}
.swatch--crepe {
  background-image:
    radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.3px),
    radial-gradient(rgba(0, 0, 0, .14) 1px, transparent 1.3px);
  background-size: 4px 4px, 5px 5px;
  background-position: 0 0, 2px 1px;
}
.swatch--stripe {
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, var(--c) 0 9px, #fbf8f0 9px 18px);
}
.swatch--dot.swatch--stripe { background-image: repeating-linear-gradient(90deg, var(--c) 0 5px, #fbf8f0 5px 10px); }
.swatch--gingham { background-color: #fbf8f0; }
.swatch--gingham::before, .swatch--gingham::after { content: ""; position: absolute; inset: 0; opacity: .55; }
.swatch--gingham::before { background: repeating-linear-gradient(0deg, var(--c) 0 12px, transparent 12px 24px); }
.swatch--gingham::after { background: repeating-linear-gradient(90deg, var(--c) 0 12px, transparent 12px 24px); }
.swatch--dot.swatch--gingham::before { background: repeating-linear-gradient(0deg, var(--c) 0 6px, transparent 6px 12px); }
.swatch--dot.swatch--gingham::after { background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 12px); }
.swatch--line.swatch--gingham::before { background: repeating-linear-gradient(0deg, var(--c) 0 6px, transparent 6px 12px); }
.swatch--line.swatch--gingham::after { background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 12px); }
.swatch--wale {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .12)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .28) 0 1.5px, rgba(255, 255, 255, .1) 2px 4px, transparent 4px 5px);
}
.swatch--jumbo-wale {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .12)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .32) 0 3px, rgba(255, 255, 255, .14) 5px 9px, rgba(0, 0, 0, .06) 11px 13px);
}
.swatch--sheen {
  background-image:
    radial-gradient(120% 90% at 25% 15%, rgba(255, 255, 255, .34), transparent 55%),
    linear-gradient(160deg, transparent 40%, rgba(0, 0, 0, .35));
}
.swatch--print {
  background-image:
    radial-gradient(circle at 50% 30%, rgba(251, 246, 232, .9) 0 2px, transparent 2.5px),
    linear-gradient(rgba(251, 246, 232, .75), rgba(251, 246, 232, .75)),
    radial-gradient(circle at 25% 75%, rgba(196, 149, 47, .85) 0 2px, transparent 2.5px);
  background-size: 22px 22px, 1.5px 7px, 22px 22px;
  background-position: 0 0, 10px 9px, 11px 0;
  background-repeat: repeat, repeat, repeat;
}
/* tossed 70s poppies: no one-way label, the flowers face every way */
.swatch--poppy {
  background-image:
    radial-gradient(circle at 50% 50%, #2a1410 0 2px, transparent 2.5px),
    radial-gradient(circle at 50% 50%, rgba(237, 225, 200, .92) 0 7px, transparent 7.5px),
    radial-gradient(circle at 50% 50%, #2a1410 0 1.5px, transparent 2px),
    radial-gradient(circle at 50% 50%, rgba(232, 150, 46, .9) 0 5px, transparent 5.5px);
  background-size: 34px 34px, 34px 34px, 34px 34px, 34px 34px;
  background-position: 0 0, 0 0, 17px 17px, 17px 17px;
}
.swatch--dot.swatch--poppy { background-size: 14px 14px; background-image: radial-gradient(circle, rgba(237, 225, 200, .92) 0 3px, transparent 3.5px); }
.swatch--hero.swatch--print::after {
  content: "↑ one-way print"; position: absolute; right: 10px; bottom: 8px;
  font-size: .72rem; font-weight: 700; color: var(--green-950); background: rgba(255, 251, 241, .9);
  padding: 2px 6px; border-radius: 999px;
}

/* ---------- panels: basket, checkout, confirmation ---------- */
.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.basket { border-top: 5px solid var(--green-900); }
.basket h2, .checkout h2, .confirmation h2 { font-size: 1.35rem; }
.basket-empty { color: var(--ink-3); }
.basket-lines { list-style: none; margin: 0; padding: 0; }
.basket-line {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px 0; border-bottom: 1px dashed var(--line-2);
}
.swatch--line { width: 40px; height: 40px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.line-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.line-name { margin: 0; line-height: 1.3; min-width: 0; }
.line-name span { color: var(--ink-2); }
.line-meta { margin: 2px 0 6px; font-size: .85rem; color: var(--ink-3); }
.line-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.line-metres { width: 96px; }
.line-total { margin: 0; font-weight: 700; color: var(--green-900); white-space: nowrap; }
.subtotal { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; margin: 12px 0 4px; }
.subtotal strong { font-size: 1.35rem; color: var(--green-950); }
.fine { font-size: .85rem; color: var(--ink-3); }

.checkout { border-top: 5px solid var(--brass); }
.demo-tag {
  font-size: .85rem; font-weight: 700; color: var(--green-950);
  background: repeating-linear-gradient(-45deg, var(--brass-light) 0 10px, #ecd08c 10px 20px);
  padding: 6px 10px; border-radius: var(--radius-sm);
}
#checkout-form { display: flex; flex-direction: column; gap: 14px; }
.choice { gap: 6px; }
.radio {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; font-weight: 500; cursor: pointer;
}
.radio:has(input:checked) { border-color: var(--green-900); background: var(--green-100); }
.radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--green-900); }
.form-error {
  color: var(--bad); background: var(--bad-soft); border: 1px solid #e3b2a8;
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: .92rem;
}
.summary-lines { list-style: none; padding: 0; margin: 0 0 10px; }
.summary-lines li {
  display: flex; justify-content: space-between; gap: 12px; padding: 6px 0;
  border-bottom: 1px dashed var(--line); font-size: .93rem;
}
.summary-lines li span:last-child { white-space: nowrap; font-weight: 600; }
.totals { margin: 0 0 12px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals dd { margin: 0; font-weight: 600; }
.totals .grand { font-size: 1.12rem; border-top: 2px solid var(--green-900); margin-top: 4px; padding-top: 6px; }
.totals .grand dd { color: var(--green-950); font-weight: 750; }
.review-who, .review-how { font-size: .93rem; color: var(--ink-2); overflow-wrap: anywhere; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button-row .btn-primary { flex: 1; }
.confirmation { border-top: 5px solid var(--ok); }
.order-no strong { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.15rem; color: var(--green-950); }
#confirm-how { overflow-wrap: anywhere; }

/* ---------- policies ---------- */
.policies { padding-top: 36px; padding-bottom: 36px; border-top: 2px dashed var(--line-2); }
.policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.policy {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.policy h3 { color: var(--green-900); border-bottom: 2px solid var(--brass); display: inline-block; padding-bottom: 2px; }
.policy ul { padding-left: 1.1em; margin: 0; }
.policy li { margin-bottom: .4em; color: var(--ink-2); }
.policy-dl { margin: 0; }
.policy-dl dt { font-weight: 700; }
.policy-dl dd { margin: 0 0 .7em; color: var(--ink-2); }
.hours { margin: 0; }
.hours div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 6px; border-radius: 6px; }
.policy a { overflow-wrap: anywhere; }
.hours dd { margin: 0; color: var(--ink-2); white-space: nowrap; }
.hours .is-today { background: var(--green-100); font-weight: 700; }
.hours .is-today dd { color: var(--green-950); }
address { font-style: normal; margin-bottom: .75em; }

/* ---------- assistant (from the agentify-website skill's assistant.css, in the shop's palette) ---------- */
.assistant { padding-top: 28px; padding-bottom: 48px; }
.assistant-note { color: var(--ink-2); font-size: .95rem; }
#assistant-status { color: var(--ink-2); font-weight: 600; }

/* The runtime reads these variables for its chat, settings and agent panels.
   The chat background below also uses --ns-bg. White text sits on --ns-primary (the
   visitor's messages, Send, and the chat form and settings buttons) and on --ns-accent
   (Send while a turn is steered), so give both at least 4.5:1 contrast with white.
   --ns-accent also underlines the chat header. */
#agent-app {
  --ns-font: var(--sans);
  --ns-bg: #fffbf1;        /* --card */
  --ns-fg: #1c2822;        /* --ink */
  --ns-primary: #173f30;   /* --green-900: 11.7:1 with white */
  --ns-accent: #256049;    /* --green-700: 7.4:1 with white */
  --ns-border: #ddd0b1;    /* --line */
  --ns-panelbg: #fffbf1;
  --ns-msgbg: #efe5cc;     /* --cream-2 */
  --ns-muted: #525e57;     /* --ink-3: 6.6:1 on --ns-bg, 5.4:1 on --ns-msgbg */
}

.assistant-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  margin-top: 16px;
}

/* Set the height once the runtime has mounted the chat, so a failed load leaves no
   empty box. */
#agent-app.ns-composed-app [data-ns-slot="chat"] { height: 720px; }
/* The runtime gives the chat no background of its own. Keep --ns-msgbg different from
   --ns-bg, or bot replies lose their bubble. */
#agent-app .ns-chat { background: var(--ns-bg); }

/* Site-wide form rules often stretch the runtime's own controls. Undo them here. */
#agent-app input[type="checkbox"],
#agent-app input[type="radio"] { width: auto; }
#agent-app .ns-header { flex-wrap: wrap; }
/* Site label rules add margins and bold text, and the inputs inside the labels inherit
   the weight. */
#agent-app .ns-settings-body label { margin: 4px 0; font-weight: 400; }
/* Chat forms label radio groups with a legend, so site legend fonts would reach them. */
#agent-app .ns-w-label { font-family: inherit; }
/* Site label rules add margins to chat form fields and make their options bold. */
#agent-app .ns-widget label { margin: 0; }
#agent-app .ns-w-radio label,
#agent-app .ns-w-multi label,
#agent-app .ns-w-toggle { font-weight: 400; }
/* The runtime sizes radio and multi-choice options but not the checkbox label. */
#agent-app .ns-w-toggle { font-size: 13px; }
/* The runtime spaces its buttons with gap. A site's button margin pushes Send below the input. */
#agent-app button { margin: 0; }
/* Chat choices are buttons with a light background. A site's button color can hide their
   titles. */
#agent-app .ns-w-choice { color: var(--ns-fg); }
/* A site's button:hover background also reaches the runtime's plain buttons, behind
   their dark text. Keep the runtime's own backgrounds. */
#agent-app .ns-devtoggle:not(.on):hover,
#agent-app .ns-modal-close:hover { background: transparent; }
#agent-app .ns-w-choice:disabled:hover { background: #fafbfc; }
/* The runtime's message rule hides the partner consent card's own background, and its
   Decline label then has too little contrast. */
#agent-app .ns-consent { background: #fffbeb; }
/* While a consent card waits, the status line above it already says "Contacting", though
   nothing has been sent. Hide it until the visitor answers. */
#agent-app .ns-msgs:has(.ns-consent-actions) > .ns-turn-status { display: none; }
/* Long links in a reply would run out of the bubble on a phone. "anywhere" would also
   let the consent card's buttons shrink and split their labels. */
#agent-app .ns-msg { overflow-wrap: break-word; }
/* On a phone the consent card is too narrow for its three buttons in one row, and
   "Always allow" breaks onto two lines. Keep each label whole and wrap the row. */
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }

/* site.js and the runtime add their confirmation dialogs to <body>, outside #agent-app.
   Site h2 rules reach the heading, and the two buttons touch. A right margin keeps
   wrapped buttons lined up on the left. */
body > dialog h2 { margin: 0 0 12px; font: 700 1.25em system-ui, sans-serif; }
body > dialog button { margin-right: 8px; }
/* site.js's dialog: the details in two columns, and a plain decline button, so the two
   choices do not look the same. */
.assistant-review { max-width: 640px; width: 85%; max-height: 85vh; overflow: auto; border: 1px solid #888; border-radius: 12px; padding: 24px; font: 16px system-ui, sans-serif; }
.assistant-review dl { display: grid; grid-template-columns: fit-content(40%) 1fr; gap: 4px 16px; margin: 12px 0; }
.assistant-review dt { font-weight: 600; }
.assistant-review dd { margin: 0; overflow-wrap: anywhere; }
.assistant-review details { margin: 12px 0; }
.assistant-review pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-review .assistant-decline { background: transparent; color: inherit; border: 1px solid currentColor; }

@media (max-width: 760px) {
  .assistant-panels { grid-template-columns: 1fr; }
  /* On a phone, each detail goes under its label, so an email is not split. */
  .assistant-review dl { grid-template-columns: 1fr; gap: 0; }
  .assistant-review dd { margin-bottom: 8px; }
}

/* The basket note after following a basket link. */
.basket-note { background: var(--green-100); border-radius: var(--radius-sm); padding: 8px 12px; font-size: .92rem; }
.basket-note.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- footer ---------- */
.site-foot { background: var(--green-950); color: #d8e2d9; padding: 20px 0; font-size: .9rem; }
.site-foot p { margin: 0; }
/* The confirm button in site.js's dialog, in the shop's own button style. */
.assistant-review button { min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1.5px solid var(--green-900); background: var(--green-900); color: var(--cream); font-weight: 650; cursor: pointer; }
.assistant-review button:hover { background: var(--green-700); border-color: var(--green-700); }
.assistant-review .assistant-decline:hover { background: var(--cream-2); }
.assistant-review h2:focus-visible { outline: none; }

/* The runtime's small controls (the actions summary, the API-key help link): give them
   at least 24 px targets (WCAG 2.2 target size). */
#agent-app summary { min-height: 24px; padding-block: 3px; }
#agent-app .ns-key-help a { display: inline-block; min-height: 24px; padding-block: 3px; }
/* The runtime's warning hint (#b45309) is 4.46:1 on the cream page: use brass ink (5.8:1). */
#agent-app .ns-hint.warn { color: var(--brass-ink); }

/* Agent cards: the whole name shows (the runtime cuts it with an ellipsis), and keyboard focus is visible. */
#agent-app .ns-anode .ns-aname { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
#agent-app .ns-anode:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

/* Assistant controls: borders at 3:1 or more against the field and the panel (WCAG 1.4.11). */
#agent-app input:not([type="checkbox"]):not([type="radio"]), #agent-app select, #agent-app textarea,
#agent-app .ns-devtoggle, #agent-app button.ghost, #agent-app .ns-w-btn.ghost { border-color: var(--ink-3); }
#agent-app #ns-newchat { border-color: var(--ink-3) !important; color: var(--ink-2) !important; }
