/* Hazelbelle Embroidery & Print --- core styles */

:root {
  --paper: #f5ebd9;
  --paper-2: #ede0c5;
  --card: #fdf7ea;
  --ink: #3a2a26;
  --ink-2: #6b554d;
  --ink-3: #9a857b;
  --rose: #b86a78;
  --rose-deep: #934e5c;
  --rose-soft: #e5c4ca;
  --sage: #8a9966;
  --sage-deep: #6a7a4d;
  --gold: #c5a36b;
  --gold-deep: #a78448;
  --line: #d9c8a8;
  --shadow: 0 2px 0 rgba(58, 42, 38, 0.04), 0 8px 24px -12px rgba(58, 42, 38, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain --- subtle SVG noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.40  0 0 0 0 0.32  0 0 0 0 0.25  0 0 0 0.18 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}

#app { position: relative; z-index: 1; }

a { color: var(--rose-deep); text-decoration: none; }
a:hover { color: var(--rose); }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}
h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.05; }
h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; }
h3 { font-size: 22px; line-height: 1.25; }

.script { font-family: 'Pinyon Script', cursive; font-weight: 400; }
.mono   { font-family: 'Special Elite', 'Courier New', monospace; letter-spacing: 0.02em; }
.smallcaps { text-transform: uppercase; letter-spacing: 0.22em; font-size: 12px; }

/* ----- Layout ----- */
.page { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }

/* Safety net: images always scale to fit their container (any upload size is fine) */
img { max-width: 100%; height: auto; }

/* ----- Top nav ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 235, 217, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px dashed rgba(184, 106, 120, 0.4);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.nav-brand img {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px dashed var(--rose);
  padding: 2px;
  background: var(--card);
}
.nav-brand-text {
  display: flex; flex-direction: column; line-height: 1;
}
.nav-brand-text .script { font-size: 26px; color: var(--rose-deep); }
.nav-brand-text .smallcaps { color: var(--sage-deep); margin-top: 2px; font-size: 10px; }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  padding: 8px 14px;
  color: var(--ink);
  font-size: 16px;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.01em;
}
.nav-link:hover { background: rgba(184, 106, 120, 0.08); color: var(--ink); }
.nav-link.active {
  color: var(--rose-deep);
  background: rgba(184, 106, 120, 0.1);
}
/* Right-side group (cart + mobile hamburger) — always visible */
.nav-actions { display: flex; align-items: center; gap: 4px; }
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--ink); padding: 6px; border-radius: 8px;
  align-items: center; justify-content: center;
}
.nav-toggle:hover { background: rgba(184, 106, 120, 0.08); }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 500;
  border: 1.5px dashed var(--rose);
  background: var(--rose);
  color: #fff7f0;
  transition: background 0.18s, transform 0.05s;
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--rose-deep); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--rose-deep);
  border: 1.5px dashed var(--rose);
}
.btn-ghost:hover { background: rgba(184, 106, 120, 0.08); color: var(--rose-deep); }
.btn-sage { background: var(--sage); border-color: var(--sage); }
.btn-sage:hover { background: var(--sage-deep); }
.btn-small { padding: 7px 14px; font-size: 14px; }

/* ----- Stitched containers ----- */
.stitched {
  position: relative;
  background: var(--card);
  border: 1.5px dashed var(--rose);
  border-radius: 14px;
  padding: 28px;
}
.stitched::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px dashed var(--rose);
  border-radius: 10px;
  pointer-events: none;
  opacity: 0.55;
}
.stitched-sage { border-color: var(--sage); }
.stitched-sage::before { border-color: var(--sage); }
.stitched-gold { border-color: var(--gold); }
.stitched-gold::before { border-color: var(--gold); }
.stitched-ink  { border-color: var(--ink-2); }
.stitched-ink::before { border-color: var(--ink-2); }

/* ----- Form fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
}
.field input,
.field textarea,
.field select {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(184, 106, 120, 0.15);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
.field-hint { font-size: 13px; color: var(--ink-3); font-style: italic; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ----- Dropzone ----- */
.dropzone {
  border: 1.5px dashed var(--sage);
  background: rgba(138, 153, 102, 0.06);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover { background: rgba(138, 153, 102, 0.12); }
.dropzone.drag { background: rgba(138, 153, 102, 0.18); border-color: var(--sage-deep); }
.dropzone-icon {
  font-family: 'Pinyon Script', cursive;
  font-size: 56px;
  color: var(--sage-deep);
  line-height: 1;
  margin-bottom: 6px;
}

/* ----- Thread divider (wavy SVG line) ----- */
.thread {
  display: block;
  width: 100%;
  height: 16px;
  margin: 24px 0;
  color: var(--rose);
}

/* ----- Cards ----- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 880px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .card-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  /* Collapse the nav into a hamburger dropdown; keep the cart visible. */
  .nav-toggle { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--card);
    border-bottom: 1px dashed rgba(184, 106, 120, 0.4);
    box-shadow: 0 12px 24px rgba(58, 42, 38, 0.16);
    padding: 8px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links .nav-link { width: 100%; padding: 12px 12px; font-size: 17px; border-radius: 8px; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .nav-inner { padding: 12px 16px; }
  .page { padding: 0 16px; }
  .section { padding: 48px 0; }
  .stitched { padding: 18px; }
}

.item-card {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px dashed var(--rose);
  position: relative;
  transition: transform 0.2s;
}
.item-card:hover { transform: translateY(-2px); }
.item-card-img {
  aspect-ratio: 1 / 1;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.item-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-card-body { padding: 16px 18px 20px; }
.item-card-title { font-size: 22px; margin-bottom: 4px; }
.item-card-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 8px;
}
.item-card-price { font-family: 'Special Elite', monospace; font-size: 16px; color: var(--rose-deep); }
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}
.tag-ready { background: rgba(138, 153, 102, 0.18); color: var(--sage-deep); }
.tag-example { background: rgba(184, 106, 120, 0.14); color: var(--rose-deep); }
.tag-new { background: rgba(197, 163, 107, 0.22); color: var(--gold-deep); }
.tag-cc {
  background: var(--ink);
  color: #f5ebd9;
  letter-spacing: 0.18em;
}

/* Couch Cowboy partnership strip on home page */
.cc-strip {
  background: linear-gradient(
    to right,
    rgba(58, 42, 38, 0.04),
    var(--card) 30%,
    var(--card)
  );
  transition: transform 0.18s, box-shadow 0.18s;
}
.cc-strip:hover { transform: translateY(-1px); }
.cc-badge {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Special Elite', monospace;
  font-size: 26px;
  letter-spacing: 0.04em;
  border: 1.5px dashed var(--gold);
  box-shadow: inset 0 0 0 4px var(--ink);
  flex-shrink: 0;
}
.item-card-cc { border-color: var(--ink-2); }

/* ----- Hero ----- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 64px 0 48px;
}
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--sage-deep);
  margin-bottom: 18px;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: '';
  display: inline-block; width: 28px; height: 1px;
  background: var(--sage); opacity: 0.6;
}
.hero h1 .script { color: var(--rose-deep); font-size: 1.15em; }
.hero-lede { font-size: 21px; color: var(--ink-2); margin: 18px 0 28px; max-width: 52ch; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--card);
  border-radius: 50%;
  border: 1.5px dashed var(--rose);
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.hero-art::before {
  content: '';
  position: absolute; inset: 10px;
  border: 1px dashed var(--rose);
  border-radius: 50%;
  opacity: 0.55;
}
.hero-art img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}

/* ----- Footer ----- */
.footer {
  margin-top: 80px;
  border-top: 1px dashed rgba(184, 106, 120, 0.4);
  padding: 40px 0 32px;
  color: var(--ink-2);
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
.footer h4 {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 12px;
}
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: var(--ink); font-size: 16px; }
.footer-bottom {
  max-width: 1180px;
  margin: 24px auto 0;
  padding: 16px 32px 0;
  border-top: 1px dashed rgba(184, 106, 120, 0.25);
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--ink-3);
}

/* ----- Toast ----- */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  background: var(--card);
  border: 1.5px dashed var(--sage);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: var(--shadow);
  max-width: 360px;
  animation: toastIn 0.25s ease-out;
}
@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ----- Admin ----- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
@media (max-width: 780px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-sidebar {
  background: var(--card);
  border: 1.5px dashed var(--ink-2);
  border-radius: 14px;
  padding: 16px;
}
.admin-sidebar h4 { font-family: 'Pinyon Script', cursive; font-size: 28px; color: var(--rose-deep); margin-bottom: 12px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav button {
  text-align: left;
  background: transparent;
  border: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Cormorant Garamond', serif;
  color: var(--ink);
}
.admin-nav button:hover { background: rgba(58,42,38, 0.06); }
.admin-nav button.active { background: rgba(184, 106, 120, 0.13); color: var(--rose-deep); }
.admin-nav .badge {
  float: right;
  background: var(--rose);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  margin-top: 3px;
}

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 780px) { .kpi-row { grid-template-columns: 1fr 1fr; } }
.kpi {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
}
.kpi-label { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
.kpi-value { font-size: 36px; font-family: 'Cormorant Garamond', serif; color: var(--ink); margin-top: 4px; line-height: 1; }
.kpi-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.upload-row {
  display: grid;
  grid-template-columns: 72px 1.2fr 1.4fr 1fr 1fr auto;
  gap: 14px;
  padding: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
}
@media (max-width: 880px) { .upload-row { grid-template-columns: 60px 1fr auto; } .upload-row > *:nth-child(n+4) { display: none; } }
.upload-row-thumb {
  width: 72px; height: 72px; border-radius: 8px; overflow: hidden;
  background: var(--paper-2);
  border: 1px dashed var(--rose);
}
.upload-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-row-name { font-size: 18px; font-weight: 500; }
.upload-row-meta { color: var(--ink-3); font-size: 14px; }
.upload-row-ref { font-family: 'Special Elite', monospace; font-size: 14px; color: var(--rose-deep); }

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
}
.status-new      { background: rgba(197, 163, 107, 0.22); color: var(--gold-deep); }
.status-progress { background: rgba(184, 106, 120, 0.16); color: var(--rose-deep); }
.status-done     { background: rgba(138, 153, 102, 0.22); color: var(--sage-deep); }

/* ----- Modal ----- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(58, 42, 38, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fadein 0.18s;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card);
  border: 1.5px dashed var(--rose);
  border-radius: 14px;
  padding: 28px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  position: relative;
}
.modal-close {
  position: absolute; right: 14px; top: 14px;
  background: transparent; border: none;
  font-size: 22px; color: var(--ink-2);
  width: 32px; height: 32px; border-radius: 50%;
}
.modal-close:hover { background: rgba(58,42,38, 0.06); color: var(--ink); }

/* ----- File chips ----- */
.file-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.file-chip {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
}
.file-chip-thumb {
  width: 36px; height: 36px; border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
}
.file-chip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-chip-x {
  background: transparent; border: none; color: var(--ink-3);
  font-size: 16px; cursor: pointer; padding: 4px;
}
.file-chip-x:hover { color: var(--rose-deep); }

/* ----- About spread ----- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

/* Home "About the studio" teaser */
.studio-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.studio-photo { min-width: 0; }
.studio-photo img {
  width: 100%; height: auto; display: block;
  border-radius: 14px; border: 1px dashed var(--rose);
  padding: 6px; background: var(--card);
}
@media (max-width: 800px) { .studio-grid { grid-template-columns: 1fr; gap: 24px; } }
.polaroid {
  background: #fff;
  padding: 14px 14px 36px;
  border: 1px solid rgba(58,42,38, 0.08);
  box-shadow: 0 14px 26px -18px rgba(58,42,38, 0.4);
  transform: rotate(-1.5deg);
  position: relative;
}
.polaroid:nth-child(2n) { transform: rotate(2deg); }
.polaroid-img {
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.polaroid-caption {
  text-align: center;
  margin-top: 10px;
  font-family: 'Special Elite', monospace;
  font-size: 13px;
  color: var(--ink-2);
}

/* placeholder striped imagery */
.ph-stripes {
  width: 100%; height: 100%;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(184, 106, 120, 0.08) 0 14px,
    rgba(184, 106, 120, 0.18) 14px 28px
  );
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  font-family: 'Special Elite', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 12px;
}
.ph-stripes-sage {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(138, 153, 102, 0.08) 0 14px,
    rgba(138, 153, 102, 0.18) 14px 28px
  );
}

/* misc */
.divider-dashed { border: none; border-top: 1px dashed rgba(58,42,38, 0.18); margin: 32px 0; }

.summary-box {
  background: var(--paper-2);
  border-radius: 12px;
  padding: 18px 22px;
  font-family: 'Special Elite', monospace;
  font-size: 14px;
  line-height: 1.8;
}
.summary-box .ref {
  font-size: 22px;
  color: var(--rose-deep);
  display: block;
  margin-bottom: 6px;
}

.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px dashed var(--ink-2);
  position: relative;
  cursor: pointer;
}
.swatch.on::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* no-stitch variant — used when Tweaks toggles stitched borders off */
body.no-stitch .stitched,
body.no-stitch .item-card,
body.no-stitch .upload-row,
body.no-stitch .dropzone,
body.no-stitch .nav-brand img,
body.no-stitch .hero-art,
body.no-stitch .modal,
body.no-stitch .toast {
  border-style: solid !important;
}
body.no-stitch .stitched::before,
body.no-stitch .hero-art::before { display: none; }
body.no-stitch .nav { border-bottom-style: solid; }
body.no-stitch .footer { border-top-style: solid; }
body.no-stitch .divider-dashed { border-top-style: solid; }
body.no-stitch .thread { display: none; }

/* ----- Legal pages ----- */
.legal-grid { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start; }
.legal-nav { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.legal-nav-link { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 16px; }
.legal-nav-link:hover { background: rgba(184, 106, 120, 0.07); color: var(--rose-deep); }
.legal-nav-link.active { background: var(--card); border: 1px dashed var(--line); color: var(--ink); }
.legal-doc { max-width: 70ch; }
.legal-meta { color: var(--ink-3); font-size: 13px; margin: 8px 0 18px; }
.legal-section { margin: 28px 0; }
.legal-section h3 { margin-bottom: 8px; }
.legal-section p { margin: 0; color: var(--ink-2); }
.legal-n { color: var(--gold-deep); font-size: 15px; margin-right: 4px; }
@media (max-width: 800px) {
  .legal-grid { grid-template-columns: 1fr; gap: 20px; }
  .legal-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .legal-nav-link { font-size: 14px; border: 1px dashed var(--line); }
  .legal-nav .smallcaps { display: none; }
}

/* ----- Admin: announcement colour swatches ----- */
.hb-swatch { width: 44px; height: 32px; border-radius: 8px; border: 1.5px solid transparent; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 14px; cursor: pointer; }
.hb-swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink-3); }
.hb-swatch-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); cursor: pointer; }
.hb-swatch-custom input[type="color"] { width: 32px; height: 32px; padding: 0; border: 1.5px dashed var(--line); border-radius: 8px; background: none; cursor: pointer; }

/* ----- Account link in nav (HB customer accounts, June 2026) ----- */
.nav-link-account {
  border: 1px solid rgba(184, 106, 120, 0.45);
  color: var(--rose-deep);
  margin-left: 6px;
}
.nav-link-account:hover { background: rgba(184, 106, 120, 0.12); }
@media (max-width: 720px) {
  .nav-link-account { margin-left: 2px; }
}

/* ----- Invoices & receipts (HB, June 2026) ----- */
.invoice-doc {
  background: #fff; color: #3a2a26;
  padding: 28px 30px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 14px;
}
.invoice-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.invoice-brand { display: flex; gap: 12px; align-items: flex-start; }
.invoice-brand img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.invoice-brand-name { font-size: 28px; color: var(--rose-deep); line-height: 1; }
.invoice-brand-sub { color: var(--ink-2); letter-spacing: 0.12em; }
.invoice-brand-meta { color: var(--ink-3); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.invoice-meta { text-align: right; }
.invoice-title { font-size: 24px; font-family: 'Cormorant Garamond', serif; color: var(--ink); }
.invoice-number { color: var(--gold-deep); font-size: 13px; margin-bottom: 8px; }
.invoice-meta table { margin-left: auto; font-size: 13px; border-collapse: collapse; }
.invoice-meta td { padding: 1px 0 1px 14px; color: var(--ink-2); }
.invoice-meta td:first-child { color: var(--ink-3); }
.invoice-billto { margin: 22px 0 14px; }
.invoice-billto .smallcaps { color: var(--sage-deep); margin-bottom: 4px; }
.invoice-items { width: 100%; border-collapse: collapse; margin-top: 10px; }
.invoice-items th {
  text-align: left; border-bottom: 2px solid var(--line); padding: 8px 6px;
  font-weight: 600; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2);
}
.invoice-items td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.invoice-items .num, .invoice-totals .num { text-align: right; white-space: nowrap; }
.invoice-totals { display: flex; justify-content: flex-end; margin-top: 14px; }
.invoice-totals table { min-width: 240px; border-collapse: collapse; }
.invoice-totals td { padding: 4px 6px; }
.invoice-totals td:first-child { color: var(--ink-2); }
.invoice-total-row td { border-top: 2px solid var(--line); font-size: 17px; font-weight: 600; color: var(--ink); padding-top: 8px; }
.invoice-due-row td { color: var(--rose-deep); font-weight: 600; }
.invoice-paid-stamp {
  margin-top: 18px; display: inline-block; border: 2px solid var(--sage-deep); color: var(--sage-deep);
  padding: 6px 16px; border-radius: 8px; transform: rotate(-3deg); font-size: 18px; letter-spacing: 0.04em;
}
.invoice-void { margin-top: 16px; color: var(--rose-deep); font-weight: 600; }
.invoice-notes { margin-top: 20px; color: var(--ink-2); }
.invoice-notes .smallcaps { color: var(--sage-deep); margin-bottom: 4px; }
.invoice-foot { margin-top: 26px; border-top: 1px dashed var(--line); padding-top: 12px; color: var(--ink-3); font-size: 12px; text-align: center; }

/* Print: isolate the invoice so "Print / Save as PDF" outputs just the document. */
@media print {
  @page { margin: 16mm; }
  body * { visibility: hidden !important; }
  .invoice-doc, .invoice-doc * { visibility: visible !important; }
  .no-print, .modal-close, .nav, .footer, .toast, .tweaks-panel { display: none !important; }
  .modal-overlay { position: absolute !important; inset: 0 !important; background: none !important; backdrop-filter: none !important; padding: 0 !important; display: block !important; }
  .modal { position: static !important; max-width: none !important; max-height: none !important; overflow: visible !important; box-shadow: none !important; border: none !important; padding: 0 !important; background: none !important; }
  .invoice-doc {
    position: absolute !important; left: 0; right: 0; top: 0;
    margin: 0 auto !important; width: 100%; max-width: 170mm;
    box-sizing: border-box !important;
    padding: 0 10mm !important;
    border: none !important; border-radius: 0 !important;
  }
}

/* ----- Admin sidebar section labels (HB, June 2026) ----- */
.admin-nav-section {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); font-family: 'Cormorant Garamond', serif;
  margin: 16px 0 4px; padding: 0 6px;
}
.admin-nav-section:first-child { margin-top: 0; }

/* ----- Type-to-search picker (HB, June 2026) ----- */
.picker-results {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: #fff;
}
.picker-result {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%; text-align: left; background: none; border: none;
  padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line);
  font-family: inherit;
}
.picker-result:last-child { border-bottom: none; }
.picker-result:hover { background: rgba(184, 106, 120, 0.08); }
.picker-result-name { font-size: 15px; color: var(--ink); }
.picker-result-meta { font-size: 12px; color: var(--ink-3); }

/* ----- FAQ accordion (HB, June 2026) ----- */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 4px; font-family: 'Cormorant Garamond', serif; font-size: 20px; color: var(--ink);
}
.faq-q:hover { color: var(--rose-deep); }
.faq-caret { color: var(--rose-deep); font-size: 22px; transition: transform 0.18s ease; flex: 0 0 auto; }
.faq-a { padding: 0 4px 20px; color: var(--ink-2); font-size: 17px; line-height: 1.6; max-width: 64ch; }

/* ===================================================================
   Light / dark theme (HB, June 2026)
   The toggle lives in the nav. A data-theme="dark" attribute on <html>
   remaps the neutral tokens to a warm dark palette; the brand accents
   (rose/sage) are lifted for contrast in JS (applyTweaks), since those
   are set inline. Everything else follows the tokens automatically.
   =================================================================== */

.nav-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: var(--ink-2); transition: background 0.15s, color 0.15s;
}
.nav-theme-toggle:hover { background: rgba(184, 106, 120, 0.10); color: var(--ink); }

/* Labeled theme toggle that lives inside the mobile dropdown. Hidden on
   desktop (the sun/moon icon button in the bar covers that case). */
.nav-theme-row { display: none; background: none; border: none; cursor: pointer; text-align: left; }
@media (max-width: 820px) { .nav-theme-row { display: block; } }

:root[data-theme="dark"] {
  --paper: #201915;
  --paper-2: #2a221d;
  --card: #2b231e;
  --ink: #efe6d6;
  --ink-2: #c8baa8;
  --ink-3: #998b7b;
  --line: #463a30;
  --shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 10px 28px -12px rgba(0, 0, 0, 0.6);
}

/* Translucent sticky nav needs a dark base in dark mode. */
[data-theme="dark"] .nav {
  background: rgba(32, 25, 21, 0.92);
  border-bottom-color: rgba(184, 106, 120, 0.35);
}

/* Form controls: the base styles hardcode a white field, so re-skin them.
   Checkboxes, radios, colour and range inputs keep their native look. */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--line);
}
[data-theme="dark"] ::placeholder { color: var(--ink-3); }

/* Other elements that hardcoded a white background. */
[data-theme="dark"] .file-chip { background: var(--paper-2); }
[data-theme="dark"] .picker-results { background: var(--card); }

/* The paper-grain overlay uses multiply, which just muddies a dark page —
   switch to a faint screen so a hint of texture survives. */
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.05; }

/* Printable receipts stay paper-white on purpose, so keep their dark ink. */
[data-theme="dark"] .invoice-doc { color: #3a2a26; }
