/* ==========================================================================
   DaVince Painting Color Visualizer v3
   Brand tokens: Navy #0b1f3a · Orange #c44e0c · Cream #f6f3ee
   Self-hosted Manrope + Source Serif 4
   ========================================================================== */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --navy: #0b1f3a;
  --navy-mid: #163156;
  --navy-soft: #23426e;
  --orange: #c44e0c;
  --orange-hover: #a53f06;
  --orange-soft: #fdf1e8;
  --orange-border: #f2cab0;
  --cream: #f6f3ee;
  --cream-2: #ece6dc;
  --white: #ffffff;
  --ink: #17202e;
  --muted: #525d6d;
  --line: #e2dbd0;
  --ok: #14532d;
  --ok-bg: #dcfce7;
  --err: #7f1d1d;
  --err-bg: #fee2e2;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 3px 12px rgba(11, 31, 58, 0.06);
  --shadow: 0 12px 32px rgba(11, 31, 58, 0.09);
  --font-sans: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

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

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 5rem;
}

@media (min-width: 860px) {
  body { padding-bottom: 0; }
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 999;
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container { padding: 0 1.5rem; }
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 64px;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand img {
  height: 40px;
  width: auto;
  display: block;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  display: none;
}

.header-tool-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn-link-back {
  display: none;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
}
.btn-link-back:hover { color: var(--orange); }

@media (min-width: 768px) {
  .header-divider { display: block; }
  .btn-link-back { display: inline-flex; }
}

@media (max-width: 640px) {
  .header-actions .btn-accent { display: none; }
  .header-tool-label { font-size: 0.84rem; }
}

/* Disclaimer Strip */
.disclaimer-strip {
  background: var(--navy);
  color: #e4ebf5;
  font-size: 0.8rem;
  padding: 0.48rem 0;
}
.disclaimer-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.disclaimer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  flex: 0 0 auto;
}
.disclaimer-strip p {
  margin: 0;
}
.disclaimer-short {
  display: none;
}
@media (max-width: 640px) {
  .disclaimer-full { display: none; }
  .disclaimer-short { display: block; font-size: 0.76rem; }
  .disclaimer-strip { padding: 0.36rem 0; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  padding: 0.65rem 1.15rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn:active { transform: translateY(1px); }

.btn-accent {
  background: var(--orange);
  color: var(--white);
}
.btn-accent:hover { background: var(--orange-hover); }

.btn-outline-sm {
  background: var(--white);
  color: var(--navy);
  border-color: var(--line);
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
}
.btn-outline-sm:hover { border-color: var(--navy); }

.btn-ghost-dark {
  background: var(--white);
  color: var(--navy);
  border-color: var(--line);
  padding: 0.56rem 0.95rem;
  font-size: 0.86rem;
}
.btn-ghost-dark:hover { border-color: var(--navy); background: #faf8f4; }

.btn-save-fav {
  background: var(--white);
  color: var(--navy);
  border-color: var(--line);
  padding: 0.56rem 0.85rem;
  font-size: 0.86rem;
}
.btn-save-fav:hover { border-color: var(--orange); color: var(--orange); }

.btn-block { width: 100%; }

/* Main Shell & Intro */
.main-shell {
  padding-top: 0.9rem;
  padding-bottom: 2.25rem;
}

.intro-band {
  margin-bottom: 0.9rem;
}

.intro-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--orange);
}

.headline-serif {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  font-size: clamp(1.65rem, 3.4vw, 2.35rem);
  line-height: 1.15;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.85rem;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.58rem 1.05rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s ease;
}
.cat-tab:hover { border-color: var(--navy-soft); }
.cat-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* Controls Bar (Finish Level + House Style / Deck Options) */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.5rem;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-sm);
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-width: 0;
  max-width: 100%;
}
.control-group--wide {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.control-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.control-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.42rem 0.85rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.14s ease;
}
.seg-btn.is-active {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.18);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 640px) {
  .main-shell { padding-top: 0.65rem; }
  .intro-head { margin-bottom: 0.45rem; }
  .category-tabs { margin-bottom: 0.55rem; }
  .controls-bar {
    padding: 0.6rem 0.75rem;
    gap: 0.55rem 1rem;
  }
  .control-hint {
    display: none;
  }
  .control-group--wide {
    padding-top: 0.45rem;
  }
  .pill-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }
  .pill-row::-webkit-scrollbar { display: none; }
  .pill-btn {
    flex: 0 0 auto;
    padding: 0.34rem 0.72rem;
  }
}

.pill-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  color: var(--navy);
  cursor: pointer;
  transition: all 0.14s ease;
}
.pill-btn:hover { border-color: var(--orange); }
.pill-btn.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.stage-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (min-width: 1020px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1.38fr) minmax(350px, 0.92fr);
    gap: 1.5rem;
  }
}

/* Four Palette Cards Strip */
.palettes-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(146px, 1fr));
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  margin-bottom: 0.85rem;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.palettes-strip::-webkit-scrollbar {
  display: none;
}

@media (max-width: 719px) {
  .stage-column .scene-card {
    order: 1;
    margin-bottom: 0.65rem;
  }
  .stage-column .palettes-strip {
    order: 2;
    margin-bottom: 0;
  }
}

@media (min-width: 720px) {
  .palettes-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: visible;
    padding-bottom: 0;
  }
}

.palette-card {
  text-align: left;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  scroll-snap-align: start;
  min-width: 0;
  font-family: var(--font-sans);
}
.palette-card:hover {
  border-color: var(--navy-soft);
  box-shadow: var(--shadow-sm);
}
.palette-card.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
  box-shadow: 0 6px 18px rgba(196, 78, 12, 0.14);
}

.palette-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 106px;
  border-radius: 8px;
  overflow: hidden;
  background: #eae6de;
  border: 1px solid rgba(11, 31, 58, 0.08);
}
@media (max-width: 640px) {
  .palettes-strip {
    grid-template-columns: repeat(4, minmax(138px, 1fr));
    gap: 0.5rem;
  }
  .palette-card { padding: 0.45rem; gap: 0.3rem; }
  .palette-thumb { max-height: 76px; }
  .palette-card-title { font-size: 0.81rem; }
  .palette-card-spec { font-size: 0.69rem; }
}

.palette-card-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.palette-card-spec {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.3;
}
.palette-card-dots {
  display: flex;
  gap: 4px;
  margin-top: auto;
  padding-top: 2px;
}
.palette-card-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(11, 31, 58, 0.22);
}

/* Main Scene Card */
.scene-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.scene-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fcfaf7;
}

.scene-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.scene-pill {
  background: var(--navy);
  color: var(--white);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
}

.scene-tip {
  font-size: 0.78rem;
  color: var(--muted);
}

.scene-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lighting-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  background: var(--cream);
}

.light-btn {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
.light-btn.is-active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.14);
}

.btn-reset {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.62rem;
  cursor: pointer;
}
.btn-reset:hover { color: var(--navy); border-color: var(--navy); }

.scene-viewport {
  width: 100%;
  background: #e9e4db;
  position: relative;
}

.scene-viewport.is-dusk .lighting-dusk {
  opacity: 1;
  transition: opacity 0.28s ease;
}
.scene-viewport .lighting-dusk {
  transition: opacity 0.28s ease;
}

.scene-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: #fcfaf7;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .scene-toolbar {
    padding: 0.48rem 0.75rem;
    gap: 0.4rem;
  }
  .scene-tip {
    display: none;
  }
  .scene-footer {
    padding: 0.46rem 0.75rem;
    font-size: 0.73rem;
  }
}

.active-surface-badge {
  font-weight: 700;
  color: var(--navy);
}

/* Inspector Column */
.inspector-column {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.details-card, .picker-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.details-badge {
  display: inline-flex;
  align-items: center;
  background: var(--orange-soft);
  color: var(--orange);
  border: 1px solid var(--orange-border);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.btn-text-copy {
  background: none;
  border: 0;
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.btn-text-copy:hover { color: var(--orange); }

.details-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--navy);
  margin: 0 0 0.3rem;
}

.details-desc {
  margin: 0 0 0.95rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.subhead {
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.official-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.color-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--cream);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
}
.color-chip:hover { border-color: var(--navy); }
.color-chip.is-focused {
  border-color: var(--orange);
  background: var(--orange-soft);
}

@keyframes pickerPulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 78, 12, 0.35); }
  100% { box-shadow: 0 0 0 10px rgba(196, 78, 12, 0); }
}
.picker-card.picker-flash {
  animation: pickerPulse 0.65s ease-out;
}

.coordinating-wrap,
.extra-combos-wrap {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.coord-chips,
.extra-combos-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}
.coord-btn,
.extra-combo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  cursor: pointer;
}
.coord-btn:hover,
.extra-combo-btn:hover {
  border-color: var(--orange);
}
.coord-btn.is-active,
.extra-combo-btn.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
}
.coord-btn small {
  font-weight: 500;
  color: var(--muted);
}
.coord-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(11, 31, 58, 0.25);
}
.extra-combo-dots {
  display: inline-flex;
  gap: 2px;
}
.extra-combo-dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(11, 31, 58, 0.25);
}

.chip-swatch {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(11, 31, 58, 0.2);
  flex: 0 0 auto;
}

.chip-info {
  min-width: 0;
}
.chip-role {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.chip-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-code {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Comparison Bars */
.metrics-block {
  margin-bottom: 1rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.9rem;
}

.metric-row {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
}
.metric-name {
  font-weight: 800;
  color: var(--navy);
}
.metric-val {
  font-size: 0.72rem;
  color: var(--muted);
}

.metric-track {
  height: 7px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
}
.metric-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--orange) 100%);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.details-disclaimer {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Fine-Grained Picker Card */
.picker-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.picker-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  color: var(--navy);
  margin: 0;
}

.picker-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.link-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}
.link-toggle input { accent-color: var(--orange); }

.layer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.layer-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.36rem 0.68rem;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  color: var(--navy);
  cursor: pointer;
}
.layer-tab.is-active {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--navy);
}
.layer-tab-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(11, 31, 58, 0.25);
}

.selected-layer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
}

.sheen-badge {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.deck-extra-controls {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hardware-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hw-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.68rem;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--white);
  cursor: pointer;
}
.hw-btn.is-active { border-color: var(--orange); background: var(--orange-soft); }
.hw-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.swatch-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.filter-pill {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.26rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
}
.filter-pill.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.45rem;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
}

.swatch-btn {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color 0.14s ease, transform 0.1s ease;
}
.swatch-btn:hover { border-color: var(--navy); }
.swatch-btn.is-active {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(196, 78, 12, 0.2);
}

.swatch-color {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(11, 31, 58, 0.14);
  margin-bottom: 0.32rem;
}
.swatch-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.swatch-meta {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Sample-only reference list */
.sample-only-box {
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  font-size: 0.8rem;
}
.sample-only-box summary {
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}
.sample-only-note {
  margin: 0.4rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.76rem;
}
.sample-only-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}
.sample-tag-btn {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px dashed var(--navy-soft);
  background: var(--cream);
  color: var(--navy);
  cursor: pointer;
}
.sample-tag-btn.is-selected {
  background: var(--navy);
  color: var(--white);
  border-style: solid;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #dce5f2;
  padding: 1.75rem 0;
  font-size: 0.85rem;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-inner p { margin: 0; }
.footer-links {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.3rem;
}
.footer-links a, .link-btn {
  color: #ffb888;
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
}
.footer-links a:hover, .link-btn:hover { text-decoration: underline; }

/* Sticky Mobile Bar */
.mobile-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 0.6rem 0.9rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  box-shadow: 0 -6px 20px rgba(11, 31, 58, 0.10);
}
@media (min-width: 860px) {
  .mobile-sticky-cta { display: none; }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.modal-backdrop[hidden] { display: none; }

.modal-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.35rem;
  box-shadow: 0 24px 60px rgba(6, 18, 36, 0.35);
}
.modal-panel--sm { max-width: 440px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-close {
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--navy);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.estimate-summary-box {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}
.estimate-summary-box strong { color: var(--navy); }

.form-row {
  margin-bottom: 0.85rem;
}
.form-row label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.28rem;
}
.req { color: var(--orange); }
.opt { font-weight: 500; color: var(--muted); font-size: 0.78rem; }

.form-row input, .form-row textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 0.62rem 0.78rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form-feedback {
  padding: 0.72rem 0.9rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.form-feedback.is-ok { background: var(--ok-bg); color: var(--ok); }
.form-feedback.is-err { background: var(--err-bg); color: var(--err); }

/* Saved list */
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(11, 31, 58, 0.35);
  z-index: 120;
}
@media (min-width: 860px) {
  .toast { bottom: 1.5rem; }
}


/* v3 Photoreal Photo + Mask Stage Enhancements */
.palette-thumb canvas.palette-thumb-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scene-viewport {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e5dfd5;
}

.scene-viewport canvas.scene-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scene-viewport .lighting-dusk {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(16, 36, 74, 0.24) 0%, rgba(11, 27, 56, 0.34) 100%);
  mix-blend-mode: multiply;
  transition: opacity 0.28s ease;
}

.scene-viewport.is-dusk .lighting-dusk {
  opacity: 1;
}

.scene-viewport.is-dusk canvas.scene-canvas {
  filter: brightness(0.92) contrast(1.04) saturate(0.96);
  transition: filter 0.28s ease;
}

.scene-viewport.is-loading canvas.scene-canvas {
  opacity: 0.72;
}

.pill-btn.is-coming-soon {
  opacity: 0.56;
  cursor: not-allowed;
  background: var(--cream);
  border-style: dashed;
}
.pill-btn.is-coming-soon:hover {
  border-color: var(--line);
}
.pill-btn.is-coming-soon small {
  font-weight: 500;
  color: var(--muted);
}
