/* ============================================================
   Jewel Demo — design system
   Ivory & charcoal with a gold accent; serif display, sans body.
   No external fonts or libraries — system stacks only.
   ============================================================ */

:root {
  --ink: #17130e;
  --ink-soft: #4a4234;
  --ink-faint: #8a8072;
  --ivory: #faf7f1;
  --ivory-deep: #f1ece2;
  --paper: #ffffff;
  --gold: #b08d2f;
  --gold-bright: #d4af37;
  --gold-soft: rgba(176, 141, 47, 0.14);
  --line: #e5ddcd;
  --danger: #8f2f2f;
  --danger-bg: #fbeeee;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px rgba(23, 19, 14, 0.08);
  --shadow-soft: 0 4px 18px rgba(23, 19, 14, 0.06);
  --font-display: 'Didot', 'Bodoni MT', 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Author styles below set display on elements that JS toggles via the hidden
   attribute — this keeps the attribute authoritative. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- shared components ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #fff;
  box-shadow: 0 6px 20px rgba(176, 141, 47, 0.35);
}
.btn-gold:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(176, 141, 47, 0.45); }

.btn-dark { background: var(--ink); color: var(--ivory); }
.btn-dark:hover:not(:disabled) { transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--gold); }

.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }

.spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Landing page
   ============================================================ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.2rem, 5vw, 4rem);
  background: rgba(250, 247, 241, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 221, 205, 0.6);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.brand svg { width: 30px; height: 30px; }
/* var() does not substitute inside SVG presentation attributes — style the
   logo strokes from here instead. */
.brand svg path { stroke: var(--gold); }

.nav-links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.2rem); font-size: 0.94rem; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }
.nav-links .btn { margin-left: 0.5rem; }
@media (max-width: 720px) { .nav-links a.nav-item { display: none; } }

/* hero */
.hero {
  position: relative;
  padding: clamp(8rem, 16vh, 11rem) clamp(1.2rem, 6vw, 4rem) clamp(4rem, 8vh, 6rem);
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(212, 175, 55, 0.16), transparent 70%),
    radial-gradient(35% 30% at 15% 25%, rgba(212, 175, 55, 0.08), transparent 70%),
    radial-gradient(35% 30% at 85% 20%, rgba(23, 19, 14, 0.05), transparent 70%);
  pointer-events: none;
}
.hero-kicker {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.12;
  letter-spacing: 0.005em;
  max-width: 17ch;
  margin: 0 auto 1.3rem;
}
.hero h1 em { font-style: italic; color: var(--gold); }
.hero p.lead {
  max-width: 54ch;
  margin: 0 auto 2.2rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}
.hero-ctas { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* hero collage */
.hero-collage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.8rem, 2.5vw, 1.8rem);
  margin-top: clamp(2.4rem, 6vh, 3.8rem);
}
.hero-collage img {
  width: clamp(140px, 22vw, 250px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(176, 141, 47, 0.35);
  box-shadow: 0 18px 45px rgba(23, 19, 14, 0.18);
  background: var(--paper);
}
.hero-collage img:first-child { transform: rotate(-4deg) translateY(10px); }
.hero-collage img.tall { width: clamp(170px, 26vw, 300px); z-index: 1; }
.hero-collage img:last-child { transform: rotate(3.5deg) translateY(12px); }
@media (max-width: 560px) { .hero-collage img:first-child { display: none; } }

/* before/after sliders */
.ba-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
  max-width: 1100px;
  margin: 0 auto;
}
.ba-card { margin: 0; }
.ba-card figcaption {
  text-align: center;
  margin-top: 0.7rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.ba {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: var(--ivory-deep);
}
.ba img.after {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.ba .ba-before {
  position: absolute; inset: 0 auto 0 0;
  width: 50%;
  overflow: hidden;
}
.ba .ba-before img {
  position: absolute; inset: 0 auto 0 0;
  height: 100%;
  width: auto;
  max-width: none;
}
.ba .ba-line {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.ba .ba-line span {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.ba .ba-line span::before {
  content: '⟷';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--gold);
  font-size: 15px;
}
.ba input[type='range'] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}
.ba-tag {
  position: absolute; bottom: 10px;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(23, 19, 14, 0.65);
  color: #fff;
  pointer-events: none;
}
.tag-before { left: 10px; }
.tag-after { right: 10px; }

/* hero stats */
.stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(1.6rem, 5vw, 4rem);
  margin-top: clamp(2.6rem, 6vh, 4rem);
}
.stat { text-align: center; }
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  color: var(--ink);
}
.stat span { font-size: 0.83rem; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }

/* faq */
.faq { max-width: 720px; margin: 0 auto; display: grid; gap: 0.8rem; }
.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.3rem;
}
.faq details[open] { border-color: rgba(176, 141, 47, 0.45); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font-size: 1.3rem; font-weight: 400; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin-top: 0.7rem; color: var(--ink-soft); font-size: 0.94rem; }

/* section scaffolding */
.section { padding: clamp(3.5rem, 9vh, 6.5rem) clamp(1.2rem, 6vw, 4rem); }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto clamp(2.2rem, 5vh, 3.5rem); }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.section-head p { color: var(--ink-soft); }

/* tool cards */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  max-width: 1180px;
  margin: 0 auto;
}
.tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(176, 141, 47, 0.45); }
.tool-card .cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.tool-card:hover .cover { transform: scale(1.04); }
.tool-body { padding: 1.4rem 1.6rem 1.7rem; position: relative; background: var(--paper); }
.tool-card .icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--gold);
  margin-bottom: 1.1rem;
}
.tool-card .icon svg { width: 24px; height: 24px; }
.tool-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; margin-bottom: 0.5rem; }
.tool-card p { color: var(--ink-soft); font-size: 0.94rem; }

/* steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
  max-width: 1000px;
  margin: 0 auto;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.4rem 1.6rem 1.7rem;
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: -1rem; left: 1.4rem;
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--gold);
  background: var(--ivory);
  padding: 0 0.4rem;
  line-height: 1;
}
.step h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.step p { color: var(--ink-soft); font-size: 0.93rem; }

/* showcase band */
.band {
  background: var(--ink);
  color: var(--ivory);
  border-radius: clamp(0px, 2vw, 28px);
  margin: 0 clamp(0rem, 3vw, 2.5rem);
  padding: clamp(3.5rem, 8vh, 5.5rem) clamp(1.2rem, 6vw, 4rem);
  text-align: center;
}
.band h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: 0.9rem; }
.band p { color: rgba(250, 247, 241, 0.75); max-width: 52ch; margin: 0 auto 2rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 10 tiles → two equal rows */
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
}
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery .tile {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, #241f17, #17130e 65%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  position: relative;
  overflow: hidden;
}
.gallery .tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery .tile:hover img { transform: scale(1.045); }
.gallery .tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.07) 50%, transparent 60%);
  pointer-events: none;
}

/* footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem clamp(1.2rem, 6vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* ============================================================
   Callback page
   ============================================================ */
.page-callback { display: grid; place-items: center; min-height: 100vh; }
.callback-shell { display: grid; place-items: center; gap: 1.2rem; color: var(--ink-soft); }

/* ============================================================
   Studio (app) page
   ============================================================ */

.studio-body { background: var(--ivory); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- shell: dark side nav + content ---------- */
.studio-shell { display: flex; min-height: 100vh; }

.side-nav {
  width: 240px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--ivory);
  display: flex;
  flex-direction: column;
  padding: 1.3rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-nav .brand { color: var(--ivory); font-size: 1.2rem; margin: 0 0.5rem 1.6rem; }
.side-nav nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; overflow-y: auto; }
.nav-sec {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 247, 241, 0.45);
  margin: 1.1rem 0.6rem 0.4rem;
}
.nav-sec:first-child { margin-top: 0; }
.side-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(250, 247, 241, 0.78);
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.side-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }
.side-item:hover { background: rgba(250, 247, 241, 0.08); color: var(--ivory); }
.side-item.active { background: rgba(212, 175, 55, 0.16); color: var(--gold-bright); }
.side-item.active svg { opacity: 1; }
.side-foot {
  border-top: 1px solid rgba(250, 247, 241, 0.12);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(250, 247, 241, 0.6);
  word-break: break-all;
}
.side-foot .btn { align-self: flex-start; color: var(--ivory); box-shadow: inset 0 0 0 1.5px rgba(250, 247, 241, 0.25); }
.side-foot .btn:hover { box-shadow: inset 0 0 0 1.5px var(--gold-bright); background: transparent; color: var(--gold-bright); }

.studio-content { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .studio-shell { flex-direction: column; }
  .side-nav { width: 100%; height: auto; position: static; padding: 0.8rem; }
  .side-nav nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
  .nav-sec { display: none; }
  .side-nav .brand { margin-bottom: 0.6rem; }
  .side-foot { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- view: tool picker (home) ---------- */
.view-head { margin-bottom: 1.6rem; }
.view-head h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.7rem; }
.view-head p { color: var(--ink-faint); font-size: 0.94rem; }

.app-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.3rem;
}
.app-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(176, 141, 47, 0.5); }
.app-card .cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.app-card .body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.app-card .cat {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.app-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.app-card .desc { font-size: 0.9rem; color: var(--ink-soft); }
.app-card .best { font-size: 0.82rem; color: var(--ink-faint); border-top: 1px solid var(--line); padding-top: 0.6rem; margin-top: auto; }
.app-card .best strong { color: var(--ink-soft); }

/* ---------- view: tool workspace header ---------- */
.tool-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.tool-head .back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-faint);
}
.tool-head .back:hover { color: var(--gold); }
.tool-head h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; }

.studio-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2.2rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.studio-nav .who { display: flex; align-items: center; gap: 0.9rem; font-size: 0.88rem; color: var(--ink-faint); }

.studio-main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 3vw, 2.2rem) 3rem;
  flex: 1;
}

/* tool tabs */
.tool-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.tool-tab {
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: all 0.15s ease;
}
.tool-tab:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--gold); }
.tool-tab.active { background: var(--ink); color: var(--ivory); box-shadow: none; }

.studio-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 1.4rem;
  align-items: start;
}
@media (max-width: 900px) { .studio-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem;
}
.panel + .panel { margin-top: 1.4rem; }

.panel h2 { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 1rem; }

/* numbered section headers (neuroviz-style flow) */
.panel-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
}
.panel-head .num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.panel-head h2 { margin: 0; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.02em; text-transform: none; color: var(--ink); }
.panel-head .opt {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--ivory-deep);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
}

/* toggle switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--ivory);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.9rem;
}
.switch-row.on { background: var(--gold-soft); border-color: rgba(176, 141, 47, 0.45); }
.switch-row .sw-label { font-size: 0.9rem; font-weight: 600; }
.switch-row .sw-sub { font-size: 0.78rem; color: var(--ink-faint); font-weight: 400; display: block; }
.switch {
  position: relative;
  width: 44px; height: 24px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: left 0.15s ease;
}
.switch.on { background: var(--gold); }
.switch.on::after { left: 23px; }

/* option pills */
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--ivory);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: all 0.12s ease;
}
.pill:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); }
.pill.active { background: var(--ink); color: var(--ivory); box-shadow: none; }
.pill small { display: block; font-weight: 400; font-size: 0.7rem; opacity: 0.75; }

/* range slider */
.slider-row { display: flex; align-items: center; gap: 0.9rem; }
.slider-row input[type='range'] {
  flex: 1;
  accent-color: var(--gold);
  height: 4px;
}
.slider-row .slider-val {
  min-width: 44px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--ivory);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
}
.slider-ends { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ink-faint); margin-top: 0.25rem; }

/* metal color selects */
.metal-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
@media (max-width: 480px) { .metal-row { grid-template-columns: 1fr; } }

/* collapsible instructions */
.notes-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
}
.notes-toggle:hover { text-decoration: underline; }

/* secondary dropzone (model photo) */
.dropzone.small { padding: 1rem; font-size: 0.85rem; }
.thumb.model-thumb img { border-color: var(--gold); }

.field { margin-bottom: 1.15rem; }
.field > label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 0.45rem; }

.field select,
.field textarea,
.field input[type='text'] {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--ivory);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.field select:focus, .field textarea:focus, .field input[type='text']:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 110px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }

/* upload area */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 1.6rem 1rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }

.thumbs { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.thumb { position: relative; width: 72px; height: 72px; }
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ivory);
}
.thumb .n {
  position: absolute; left: 4px; bottom: 4px;
  background: rgba(23, 19, 14, 0.7);
  color: #fff;
  font-size: 10px;
  border-radius: 5px;
  padding: 0 4px;
}
.thumb .x {
  position: absolute; top: -6px; right: -6px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  line-height: 19px;
  text-align: center;
  opacity: 0;
}
.thumb:hover .x, .thumb .x:focus-visible { opacity: 1; }
@media (pointer: coarse) { .thumb .x { opacity: 1; } }

.presets { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.preset {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.83rem;
  background: var(--ivory);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.preset:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); }

/* result panel */
.result-stage {
  min-height: 340px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--ivory);
  border: 1px solid var(--line);
  overflow: hidden;
}
.result-stage.empty { border-style: dashed; background: transparent; }
.result-stage img, .result-stage video { width: 100%; }

.result-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
}

.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.9rem; }
.result-meta { color: var(--ink-faint); font-size: 0.8rem; margin-top: 0.7rem; word-break: break-word; }

.status-chip {
  display: inline-block;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}
.status-chip.processing { background: #eef3fb; color: #2f5a8f; }
.status-chip.completed { background: #eef7ef; color: #2f6a3a; }
.status-chip.failed { background: var(--danger-bg); color: var(--danger); }

/* not-authorized gate */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(23, 19, 14, 0.55);
  backdrop-filter: blur(6px);
  padding: 1.2rem;
}
.gate-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 420px;
  padding: 2rem 1.8rem;
  text-align: center;
}
.gate-card h2 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 0.6rem; }
.gate-card p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1.4rem; }

/* history */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.9rem;
}
.history-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.history-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.history-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold); }
.history-card .ph { height: 110px; background: var(--ivory-deep); position: relative; }
.history-card .ph img, .history-card .ph video { width: 100%; height: 100%; object-fit: cover; }
.history-card .row { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.6rem; font-size: 0.72rem; color: var(--ink-faint); }
