/* OGNTH
   Palette from the logo: black cloth, gold crown, silver lettering.
   Paper white for the product area, concrete grey for photo wells,
   signal red only for sold out and errors.
   Type: Archivo. Wide (expanded) for headings, to match the wide logo
   letters; normal width for reading. */

:root {
  --ink: #000;
  --paper: #fff;
  --concrete: #e7e6e2;
  --rule: #c9c8c2;
  --muted: #55544f;
  --signal: #c21f17;
  --gold: #c8a562;
  --silver: #d8d6d1;
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --pad: 20px;
  --header-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-stretch: 100%;
}

body:has(dialog[open]) { overflow: hidden; }

img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
code { font-size: .92em; background: var(--concrete); padding: 1px 5px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.muted { color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }
.text-alert { color: var(--signal); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px; top: -60px;
  z-index: 50;
  background: var(--ink); color: var(--paper);
  padding: 10px 14px;
}
.skip-link:focus { top: 8px; }


/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}
.button:disabled {
  background: var(--concrete);
  border-color: var(--concrete);
  color: var(--muted);
  cursor: not-allowed;
}
.button-light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.button-outline { background: var(--paper); color: var(--ink); }
.button-block { width: 100%; }

.text-button {
  background: none;
  border: 0;
  padding: 6px 0;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:disabled { color: var(--muted); }


/* ---------- Header and footer ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--ink);
  color: var(--silver);
  border-bottom: 1px solid #2b2b29;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--silver);
  text-decoration: none;
}
.brand-crown { width: auto; height: 26px; }
.brand-word { width: auto; height: 15px; }
.brand-sub { font-weight: 500; font-size: 15px; color: var(--silver); }
.site-header :focus-visible { outline-color: var(--silver); }

.site-nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.nav-button {
  background: none;
  border: 0;
  padding: 10px 8px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-button:disabled { color: #8f8e88; }

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--silver);
}
.icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.cart-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cart-count[hidden] { display: none; }

.site-footer {
  display: grid;
  gap: 24px;
  padding: 40px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--silver);
  font-size: 15px;
}
.site-footer a { color: var(--silver); }
.site-footer :focus-visible { outline-color: var(--silver); }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 44px; height: auto; }
.footer-brand strong { font-stretch: 125%; letter-spacing: .04em; }
.footer-small {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 16px;
  border-top: 1px solid #2b2b29;
  font-size: 13px;
  color: #a7a59f;
}
.footer-small a { color: #a7a59f; }
@media (min-width: 900px) {
  .site-footer { grid-template-columns: 1fr auto; align-items: center; }
  .footer-small { grid-column: 1 / -1; }
}


/* ---------- Hero: the logo, laid out like the embroidery ---------- */

.hero {
  min-height: calc(74svh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 7svh, 64px);
  padding: 48px var(--gutter) 56px;
  background: var(--ink);
  color: var(--silver);
  text-align: center;
}
.hero :focus-visible { outline-color: var(--silver); }

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(88vw, 640px, 90svh);
}
.lockup-crown { width: 50%; height: auto; }
.lockup-name { width: 100%; margin: 7% 0 0; }
.lockup-name img { width: 100%; height: auto; }
.lockup-slogan {
  margin-top: 6%;
  font-size: min(4.2vw, 30px, 4.3svh);
  font-weight: 500;
  letter-spacing: .14em;
  white-space: nowrap;
}

/* One entrance: the name and slogan fade in, then the crown settles on top. */
.lockup-name, .lockup-slogan { animation: fade-in .6s ease-out both; }
.lockup-slogan { animation-delay: .15s; }
.lockup-crown { animation: crown-in .7s cubic-bezier(.2, .7, .2, 1) .3s both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes crown-in { from { opacity: 0; transform: translateY(-14%); } }

.hero .button-light { background: var(--silver); border-color: var(--silver); }


/* ---------- Brand story ---------- */

.story { padding: clamp(56px, 10vw, 120px) var(--gutter); }
.story-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 20px;
}
@media (min-width: 900px) {
  .story-inner { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
}
.story-mark { width: 52px; height: auto; margin-bottom: 18px; }
.story h2 {
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(30px, 7vw, 54px);
  line-height: 1.05;
  letter-spacing: -.015em;
}
.story p {
  max-width: 42ch;
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.6;
}
@media (min-width: 900px) { .story p { padding-top: 70px; } }


/* ---------- Featured products on the homepage ---------- */

.featured {
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  border-top: 1px solid var(--rule);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 {
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(26px, 5.5vw, 40px);
  line-height: 1.05;
  letter-spacing: -.01em;
}
/* Phones: one row you swipe through. Wider screens: three across. */
.featured-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 12px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.featured-row::-webkit-scrollbar { display: none; }
.featured-row > * { scroll-snap-align: start; }
.featured-row > .grid-message, .featured-row > .notice, .featured-row > p { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .featured-row {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}
.featured-action { display: flex; justify-content: center; margin-top: 32px; }


/* ---------- Shop grid ---------- */

.shop { padding: clamp(40px, 7vw, 88px) var(--gutter); }

.shop-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ink);
}
.shop-head h1, .shop-head h2 {
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1;
  letter-spacing: -.01em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 12px;
}
@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 20px; }
}
@media (min-width: 1180px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.grid-message, .grid .notice { grid-column: 1 / -1; display: grid; gap: 14px; justify-items: start; }

.card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.card-image {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--concrete);
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-name { font-weight: 600; line-height: 1.3; }
.card-price { font-variant-numeric: tabular-nums; }
@media (hover: hover) {
  .card:hover .card-name { text-decoration: underline; text-underline-offset: 3px; }
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.placeholder img {
  width: 42%;
  height: auto;
  filter: grayscale(1);
  opacity: .28;
}

.flag {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
}
.flag-out { background: var(--ink); color: var(--paper); }

.notice {
  padding: 18px;
  border: 1px solid var(--ink);
  max-width: 560px;
  display: grid;
  gap: 8px;
}


/* ---------- Dialogs ---------- */

dialog {
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  max-width: none;
  max-height: none;
}
dialog::backdrop { background: rgb(0 0 0 / .55); }

.sheet {
  width: 100%;
  max-height: 92svh;
  margin: auto 0 0;
}
@media (min-width: 760px) {
  .sheet { width: min(520px, 92vw); max-height: 88vh; margin: auto; }
  .product-sheet { width: min(980px, 92vw); }
  .editor-sheet { width: min(640px, 92vw); }
}

.drawer {
  width: min(460px, 100%);
  height: 100svh;
  max-height: 100svh;
  margin: 0 0 0 auto;
}

dialog[open].sheet { animation: sheet-in .22s ease-out; }
dialog[open].drawer { animation: drawer-in .22s ease-out; }
@keyframes sheet-in { from { transform: translateY(28px); opacity: 0; } }
@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } }

.dialog-frame {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  height: 100%;
}
.sheet .dialog-frame { max-height: 92svh; }
@media (min-width: 760px) { .sheet .dialog-frame { max-height: 88vh; } }

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px var(--pad);
  border-bottom: 1px solid var(--ink);
}
.dialog-head h2 { font-size: 20px; font-weight: 700; }

.dialog-scroll { overflow-y: auto; overscroll-behavior: contain; }
.dialog-body { padding: 20px var(--pad) calc(28px + env(safe-area-inset-bottom)); flex: 1; }
.product-sheet .dialog-scroll { max-height: 92svh; }
@media (min-width: 760px) { .product-sheet .dialog-scroll { max-height: 88vh; } }

.close {
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  font-size: 30px;
  line-height: 1;
}
.close-floating {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  margin: 0;
  background: var(--paper);
}


/* ---------- Product dialog ---------- */

.product-layout { display: grid; }
@media (min-width: 760px) {
  .product-layout { grid-template-columns: 1fr 1fr; align-items: start; }
  .product-image { max-height: none; }
}
.product-image {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 46svh;
  width: 100%;
  background: var(--concrete);
  overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-info {
  display: grid;
  gap: 12px;
  padding: 20px var(--pad) calc(28px + env(safe-area-inset-bottom));
}
@media (min-width: 760px) { .product-info { padding: 32px 28px; } }
.product-info h2 {
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.1;
  letter-spacing: -.01em;
  padding-right: 40px;
}
.product-price { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.product-description { max-width: 60ch; }

.sizes { border: 0; margin: 8px 0 0; padding: 0; }
.sizes legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.size-row { display: flex; flex-wrap: wrap; gap: 8px; }
.size {
  min-width: 56px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-weight: 600;
}
.size[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.size:disabled {
  border-color: var(--rule);
  color: #8f8e88;
  text-decoration: line-through;
  cursor: not-allowed;
}
.stock-note { min-height: 1.5em; color: var(--muted); }


/* ---------- Cart ---------- */

.lines { list-style: none; margin: 0; padding: 0; }
.line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.line-image, .thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--concrete);
  overflow: hidden;
}
.line-image img, .thumb img { width: 100%; height: 100%; object-fit: cover; }

.line-name { font-weight: 600; }
.line-main { display: grid; gap: 2px; align-content: start; }
.line-side { display: grid; justify-items: end; align-content: space-between; font-variant-numeric: tabular-nums; }

.stepper {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  border: 1px solid var(--ink);
  width: max-content;
}
.stepper button {
  width: 40px;
  height: 36px;
  border: 0;
  background: none;
  font-size: 18px;
}
.stepper button:disabled { color: var(--rule); cursor: not-allowed; }
.stepper span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }

.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lines + .sum-row { padding-top: 14px; }
.total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 16px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.checkout {
  display: grid;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}
.checkout h3 { font-size: 18px; margin-bottom: 10px; }
.checkout .hint { margin-top: 8px; }

.confirmation, .empty-state { display: grid; gap: 14px; justify-items: start; }
.confirmation h3 {
  font-stretch: 125%;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
}


/* ---------- Forms ---------- */

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field > span, .field-label { font-weight: 600; font-size: 15px; }
.field input, .field textarea, .field select,
.size-edit input {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
}
.field textarea { min-height: 96px; resize: vertical; }
.field select { appearance: auto; }
.form-error { min-height: 0; color: var(--signal); font-weight: 600; }
.form-error:not(:empty) { margin-bottom: 12px; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 18px;
  font-weight: 600;
}
.check input { width: 22px; height: 22px; accent-color: var(--ink); }

.auth-form { display: grid; gap: 4px; }
.auth-form > p:first-child { margin-bottom: 14px; }
.auth-switch { display: grid; gap: 6px; justify-items: start; margin-top: 18px; }


/* ---------- Account ---------- */

.account-top { display: grid; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--ink); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-title { font-size: 18px; font-weight: 700; margin: 20px 0 10px; }

.order-card {
  display: grid;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.order-card.is-cancelled { color: var(--muted); }
.order-head { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.order-head h2, .order-head h4 { font-size: 17px; font-weight: 700; }
.order-status { display: flex; flex-wrap: wrap; gap: 6px; }
.order-items { margin: 0; padding-left: 18px; }
.order-card .text-button { justify-self: start; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  vertical-align: middle;
}
.tag-quiet { background: var(--concrete); color: var(--ink); }


/* ---------- Toast ---------- */

.toast {
  position: fixed;
  inset: auto auto calc(16px + env(safe-area-inset-bottom)) 50%;
  margin: 0;
  border: 0;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:popover-open { display: block; }


/* ---------- Owner dashboard ---------- */

.admin-main {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
}

.gate { display: grid; gap: 16px; max-width: 440px; padding-top: 40px; }
.gate h1 {
  font-stretch: 125%;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
}

.tabs {
  display: flex;
  gap: 0;
  margin: 0 calc(var(--gutter) * -1) 24px;
  padding: 0 var(--gutter);
  overflow-x: auto;
  border-bottom: 1px solid var(--ink);
  scrollbar-width: none;
}
.tab {
  flex: none;
  padding: 14px 14px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  font-weight: 600;
  color: var(--muted);
}
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-title {
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1.05;
  margin-bottom: 12px;
}
.panel-head .panel-title { margin-bottom: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 28px;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat {
  padding: 14px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.stat dt { font-weight: 600; }
.stat dd { margin: 0; display: grid; gap: 2px; }
.stat-value {
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.plain-list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.product-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.product-row-main { display: grid; gap: 2px; min-width: 0; }
.product-row .button { min-height: 40px; padding: 0 16px; }

.segmented { display: inline-flex; border: 1px solid var(--ink); }
.segmented button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  background: var(--paper);
  font-weight: 600;
}
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.delivery {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: var(--concrete);
}
.delivery .address { white-space: pre-line; }
.order-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.order-controls .field { margin: 0; }

.activity { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); }

/* Product editor */
.photo-edit { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }

.file-button { position: relative; margin-bottom: 6px; }
.file-button:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }

.size-editor { border: 0; margin: 6px 0 16px; padding: 0; }
.size-editor legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.size-edit {
  display: grid;
  grid-template-columns: 1fr 88px 64px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.size-edit label { display: block; }
.size-edit-head { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.size-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 6px; }
.editor-actions { display: grid; gap: 10px; justify-items: center; }


/* ---------- Footer links and info pages ---------- */

.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

.page {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 56px) var(--gutter) 64px;
  line-height: 1.6;
}
.page h1 {
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.1;
  letter-spacing: -.01em;
  margin-bottom: 16px;
}
.page h2 { font-size: 19px; font-weight: 700; margin: 32px 0 8px; }
.page p, .page li { max-width: 65ch; }
.page p + p { margin-top: 10px; }
.page ul, .page ol { margin: 8px 0 0; padding-left: 22px; }
.page li + li { margin-top: 4px; }
.page .lead { font-size: 18px; }
.page .muted { margin-top: 8px; font-size: 14px; }

.details { margin: 24px 0; border-top: 1px solid var(--ink); }
.details div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.details dt { font-weight: 600; }
.details dd { margin: 0; }

.setting-form { max-width: 420px; }


/* ---------- Product gallery, colours and details ---------- */

.product-media { position: relative; background: var(--concrete); }
.gallery { position: relative; }
.gallery-track {
  display: flex;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 50svh;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { outline-offset: -3px; }
.gallery-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 2px;
}
.gallery-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
}
.gallery-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(255 255 255 / .55);
  box-shadow: 0 0 0 1px rgb(0 0 0 / .35);
}
.gallery-dot[aria-current="true"]::before { width: 10px; height: 10px; background: #fff; }
@media (min-width: 760px) { .gallery-track { max-height: none; } }

.options { border: 0; margin: 8px 0 0; padding: 0; }
.options legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.option-value { font-weight: 400; color: var(--muted); }

.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 5px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
}
.swatch[aria-pressed="true"] { border: 2px solid var(--ink); padding: 4px; }
.swatch-chip {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18);
}
.swatch.is-out::after {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: calc(50% - 1px);
  width: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}

.card-swatches { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.card-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .25);
}

.buy-note { font-size: 14px; color: var(--muted); }
.buy-note a { color: inherit; }

.more { border-top: 1px solid var(--rule); padding: 12px 0; }
.more:last-child { border-bottom: 1px solid var(--rule); }
.more summary { font-weight: 600; cursor: pointer; }
.more p { margin-top: 8px; white-space: pre-line; }


/* ---------- Product editor: colours and photos ---------- */

.editor-section { font-size: 18px; font-weight: 700; margin: 24px 0 4px; }
.colour-edit {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--ink);
}
.colour-head { display: grid; grid-template-columns: 1fr 80px; gap: 10px; }
.colour-head .field { margin: 0; }
.colour-pick input[type="color"] {
  width: 100%;
  min-height: 48px;
  padding: 4px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.photo-tile { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--concrete); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-main {
  position: absolute;
  left: 4px;
  top: 4px;
  padding: 1px 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
}
.photo-tools {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: rgb(0 0 0 / .6);
}
.photo-tools button {
  flex: 1;
  min-height: 38px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 20px;
}
.photo-tools button:disabled { opacity: .3; }
.photo-add {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  padding: 6px;
  border: 1px dashed var(--ink);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.photo-add:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.remove-colour { justify-self: start; margin-top: 6px; }
.tag-alert { background: var(--signal); color: var(--paper); }

.not-found { display: grid; gap: 16px; justify-items: start; }
.not-found img { width: 64px; height: auto; }


/* ---------- Selling features ---------- */

.flag-drop { background: var(--gold); color: var(--ink); }

.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.title-row h2 { padding-right: 0; }
.share-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-weight: 600;
  font-size: 14px;
}
.icon-small { width: 18px; height: 18px; }

.gallery-zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.viewer {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  background: #000;
}
.viewer::backdrop { background: #000; }
.viewer-close {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: 8px;
  z-index: 2;
  margin: 0;
  color: #fff;
}
.viewer-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  touch-action: pan-x pinch-zoom;
}
.viewer-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }

.notify-form { display: grid; gap: 8px; margin-top: 10px; }
.notify-fields { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
.notify-fields .field { margin: 0; }
.notify .button { justify-self: start; }

.inline-input { display: flex; gap: 8px; }
.inline-input input { flex: 1; min-width: 0; }
.inline-input .button { flex: none; }

.pay-box {
  display: grid;
  gap: 8px;
  margin: 6px 0;
  padding: 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.pay-box h4 { font-size: 16px; }
.pay-details { display: grid; gap: 4px; margin: 0; }
.pay-details div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }
.pay-details dt { color: var(--muted); }
.pay-details dd { margin: 0; overflow-wrap: anywhere; }
.pay-details .text-button { padding: 0 0 0 6px; font-size: 14px; }
.pay-note { white-space: pre-line; }
.confirmation .pay-box { width: 100%; }
.tracking .text-button { padding: 0 0 0 6px; font-size: 14px; }

.wa-button {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 4px 14px rgb(0 0 0 / .3);
}
.wa-button svg { width: 30px; height: 30px; }

/* Dashboard: settings, tracking and packing slips */
.settings-block { padding: 8px 0 24px; border-bottom: 1px solid var(--rule); }
.settings-block:last-child { border-bottom: 0; }
.settings-block .hint { margin-bottom: 12px; }
.code-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.code-actions { display: grid; justify-items: end; align-content: start; gap: 2px; }
.code-form { margin-top: 20px; }
.code-form h3 { font-size: 17px; margin-bottom: 10px; }
.tracking-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.tracking-form .field { margin: 0; }
.tracking-form .button { grid-column: 1 / -1; justify-self: start; }
.order-card > .text-button { justify-self: start; }

#printArea { padding: 24px var(--gutter) 48px; max-width: 720px; margin: 0 auto; }
body.showing-slip > *:not(#printArea):not(#toast) { display: none !important; }
.slip { display: grid; gap: 8px; }
.slip-head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 2px solid #000; }
.slip-head img { width: 56px; height: auto; }
.slip-brand { font-stretch: 125%; font-weight: 700; font-size: 22px; letter-spacing: .04em; }
.slip h1 { font-stretch: 125%; font-size: 26px; margin-top: 8px; }
.slip h2 { font-size: 16px; margin-top: 12px; }
.slip .address { white-space: pre-line; }
.slip table { width: 100%; border-collapse: collapse; }
.slip th, .slip td { padding: 8px 4px; border-bottom: 1px solid #999; text-align: left; }
.slip th:last-child, .slip td:last-child { text-align: right; width: 60px; }
.slip-thanks { margin-top: 16px; font-weight: 600; }
.slip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { padding: 0; }
  .slip-actions { display: none; }
}


/* ---------- Account page ---------- */

.account-page { width: min(760px, 100%); }
.account-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.account-head h1 { margin-bottom: 2px; }
.account-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.account-signed-out { display: grid; gap: 14px; justify-items: start; }
.account-tabs { margin-bottom: 20px; }
.account-tabs .tab { text-decoration: none; }
.account-panel { display: grid; gap: 4px; }
.account-form { display: grid; gap: 4px; margin-bottom: 32px; max-width: 520px; }
.account-form .section-title { margin-top: 0; }

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  border-left: 6px solid var(--gold);
  background: var(--paper);
}
.banner-good { border-left-color: #1f7a3d; }

.account-order { gap: 10px; padding: 20px 0; }
.account-order h2 { font-size: 18px; font-weight: 700; margin: 0; }

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 6px 0 2px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.progress li {
  position: relative;
  padding-top: 22px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  text-align: center;
}
.progress li::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border: 2px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
  z-index: 1;
}
.progress li::after {
  content: '';
  position: absolute;
  top: 9px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--rule);
}
.progress li:first-child::after { display: none; }
.progress li.done { color: var(--ink); font-weight: 600; }
.progress li.done::before { border-color: var(--ink); background: var(--ink); }
.progress li.done::after { background: var(--ink); }

.order-lines { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.order-lines li { display: flex; justify-content: space-between; gap: 12px; }
.order-lines li span:first-child { min-width: 0; }
.order-lines .order-total { padding-top: 6px; border-top: 1px solid var(--rule); font-weight: 700; }
.pay-actions { display: grid; gap: 8px; justify-items: start; }
.pay-actions .more { width: 100%; }
.order-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.order-card .address { white-space: pre-line; }

.address-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.address-row .address { white-space: pre-line; }

.choice { border: 0; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.choice .check { align-items: flex-start; margin: 0; font-weight: 400; }
.choice .check input { margin-top: 3px; flex: none; }


/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
}
