/* Avitus Brand Studio - Porsche-Inspired Architectural Configurator Stylesheet.
   Strictly obeys CSP style-src 'self' (zero inline styles, zero spectral text). */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./fonts/fraunces-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/inter-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/space-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/space-mono-latin-700-normal.woff2") format("woff2");
}

:root {
  --studio-ink: #1A1C20;
  --studio-ink-soft: #2D3138;
  --studio-steel: #6A7078;
  --studio-steel-soft: #8A9098;
  --studio-silver: #C8CCD0;
  --studio-silver-hi: #DEE1E4;
  --studio-platinum: #E9EBED;
  --studio-paper: #F4F5F6;
  --studio-white: #FFFFFF;
  --studio-line: rgba(26, 28, 32, 0.13);
  --studio-line-strong: rgba(26, 28, 32, 0.28);
  --studio-focus: #5B7BE6;
  --studio-font-display: "Fraunces Variable", "Fraunces", Georgia, serif;
  --studio-font-body: "Inter", system-ui, -apple-system, sans-serif;
  --studio-font-mono: "Space Mono", ui-monospace, monospace;
  --studio-r-xs: 6px;
  --studio-r-sm: 10px;
  --studio-r-md: 14px;
}

.studio-standalone-page {
  margin: 0;
  padding: 0;
  background: var(--studio-paper);
  color: var(--studio-ink);
  font-family: var(--studio-font-body);
  -webkit-font-smoothing: antialiased;
}

.avitus-studio-shell,
.avitus-studio-shell *,
.avitus-studio-shell *::before,
.avitus-studio-shell *::after {
  box-sizing: border-box;
}

.avitus-studio-shell [hidden] {
  display: none !important;
}

.avitus-studio-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--studio-paper);
  color: var(--studio-ink);
  font-family: var(--studio-font-body);
  font-size: 13px;
  line-height: 1.45;
  overflow-x: clip;
}

.avitus-studio-shell button,
.avitus-studio-shell input,
.avitus-studio-shell select,
.avitus-studio-shell textarea {
  font: inherit;
  color: inherit;
}

.avitus-studio-shell button {
  cursor: pointer;
  background: none;
  border: 0;
  touch-action: manipulation;
}

.avitus-studio-shell button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.avitus-studio-shell :focus-visible {
  outline: 2px solid var(--studio-focus);
  outline-offset: 2px;
}

/* Top Studio Header */
.studio-topbar {
  height: 58px;
  padding: 0 20px;
  background: var(--studio-white);
  border-bottom: 1px solid var(--studio-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  z-index: 12;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  text-decoration: none;
  color: var(--studio-ink);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.topbar-back:hover {
  background: var(--studio-paper);
  border-color: var(--studio-line-strong);
}

.topbar-back svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

.topbar-divider {
  width: 1px;
  height: 26px;
  background: var(--studio-line);
  flex-shrink: 0;
}

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

.studio-eyebrow {
  font-family: var(--studio-font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--studio-steel);
}

.topbar-heading {
  margin: 0;
  font-family: var(--studio-font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--studio-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.active-concept-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--studio-paper);
  border: 1px solid var(--studio-line);
  font-family: var(--studio-font-mono);
  font-size: 11px;
  color: var(--studio-ink);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-ghost-btn {
  padding: 7px 12px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  font-size: 12px;
  font-weight: 500;
  color: var(--studio-ink);
  background: var(--studio-white);
  transition: background-color 0.16s ease;
}

.studio-ghost-btn:hover:not(:disabled) {
  background: var(--studio-platinum);
}

/* Main Split Workspace: Mobile-First (360px+) then Desktop (>= 1024px 66% / 34%) */
.studio-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.studio-stage {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 56svh;
  min-height: 410px;
  max-height: 540px;
  width: 100%;
  background: radial-gradient(ellipse at 50% 36%, #F8F9FA 0%, #ECEEF1 62%, #DFE3E8 100%);
  border-bottom: 1px solid var(--studio-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stage-overlay-top {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  padding: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.stage-spec-callout {
  max-width: 72%;
}

.stage-format-title {
  margin: 3px 0 2px;
  font-family: var(--studio-font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--studio-ink);
}

.stage-dimensions {
  margin: 0;
  font-family: var(--studio-font-mono);
  font-size: 10px;
  color: var(--studio-steel);
}

.stage-compound-tag {
  margin: 4px 0 0;
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--studio-line);
  border-radius: 999px;
  font-family: var(--studio-font-mono);
  font-size: 9.5px;
  color: var(--studio-ink);
}

.stage-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--studio-line);
  font-family: var(--studio-font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--studio-steel);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2C8C64;
}

.studio-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.studio-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline: none;
}

.studio-canvas.is-grabbing {
  cursor: grabbing;
}

.studio-canvas.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.stage-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(244, 245, 246, 0.84);
  backdrop-filter: blur(6px);
  text-align: center;
  padding: 20px;
}

.stage-loading strong {
  font-size: 14px;
  font-weight: 600;
}

.stage-loading span:last-child {
  font-size: 11px;
  color: var(--studio-steel);
}

.studio-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--studio-silver);
  border-top-color: var(--studio-ink);
  animation: studio-spin 0.85s linear infinite;
}

@keyframes studio-spin {
  to {
    transform: rotate(360deg);
  }
}

.stage-fallback {
  position: absolute;
  inset: 72px 16px 118px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.stage-fallback canvas {
  max-width: 100%;
  max-height: 78%;
  width: auto;
  height: auto;
  border-radius: var(--studio-r-sm);
  border: 1px solid var(--studio-line);
}

.fallback-caption {
  margin: 0;
  max-width: 420px;
  text-align: center;
  font-size: 11px;
  color: var(--studio-steel);
}

/* Stage Controls Dock: non-overlapping bar on mobile, floating overlay on desktop */
.stage-controls-dock {
  position: relative;
  z-index: 3;
  padding: 6px 10px 8px;
  background: rgba(244, 245, 246, 0.92);
  border-top: 1px solid var(--studio-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.camera-toolbar,
.fit-control {
  pointer-events: auto;
}

.camera-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: var(--studio-r-sm);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 28, 32, 0.12);
  box-shadow: 0 6px 20px rgba(26, 28, 32, 0.06);
  max-width: 100%;
  overflow-x: auto;
}

.cam-btn {
  min-height: 34px;
  min-width: 34px;
  padding: 5px 9px;
  border-radius: var(--studio-r-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--studio-ink);
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.cam-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.cam-btn:hover,
.cam-btn[aria-pressed="true"] {
  background: var(--studio-ink);
  color: var(--studio-white);
}

.cam-icon {
  font-family: var(--studio-font-mono);
  font-size: 15px;
  padding: 4px 8px;
}

.fit-control {
  width: min(400px, 100%);
  padding: 8px 12px;
  border-radius: var(--studio-r-sm);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 28, 32, 0.12);
  box-shadow: 0 6px 20px rgba(26, 28, 32, 0.05);
}

.fit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

.fit-title {
  font-weight: 600;
  color: var(--studio-ink);
}

.fit-header output {
  font-family: var(--studio-font-mono);
  font-size: 10px;
  color: var(--studio-steel);
}

.studio-range {
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: var(--studio-ink);
  cursor: pointer;
}

.fit-quick-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.fit-pill {
  padding: 5px 8px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--studio-steel);
  background: var(--studio-white);
  transition: all 0.15s ease;
}

.fit-pill:hover {
  border-color: var(--studio-ink);
  color: var(--studio-ink);
}

.fit-pill.is-active,
.fit-pill[aria-pressed="true"] {
  background: var(--studio-ink);
  border-color: var(--studio-ink);
  color: var(--studio-white);
}

/* Right Configurator Rail */
.studio-rail {
  background: var(--studio-white);
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.studio-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--studio-line);
  background: var(--studio-paper);
  flex-shrink: 0;
}

.studio-tab {
  padding: 10px 4px;
  border-bottom: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  color: var(--studio-steel);
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.studio-tab:hover {
  color: var(--studio-ink);
  background: rgba(255, 255, 255, 0.6);
}

.studio-tab.is-active {
  background: var(--studio-white);
  color: var(--studio-ink);
  border-bottom-color: var(--studio-ink);
}

.tab-num {
  font-family: var(--studio-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  opacity: 0.72;
}

.tab-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.18;
  max-width: 100%;
  white-space: normal;
  text-wrap: balance;
}

.rail-scroll {
  padding: 20px 18px 24px;
  flex: 1;
}

.panel-intro {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--studio-line);
}

.panel-title {
  margin: 4px 0 6px;
  font-family: var(--studio-font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.panel-desc {
  margin: 0;
  font-size: 12px;
  color: var(--studio-steel);
  line-height: 1.55;
}

.control-block {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--studio-line);
}

.control-block:last-child {
  border-bottom: 0;
  margin-bottom: 6px;
}

.block-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}

.block-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--studio-ink);
}

.block-hint {
  font-family: var(--studio-font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--studio-steel-soft);
}

/* Swatch Canvas Elements (CSP-pure dynamic swatches!) */
.swatch-canvas {
  display: block;
  border-radius: 50%;
  flex-shrink: 0;
}

.swatch-sm {
  width: 18px;
  height: 18px;
}

.swatch-inline {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

/* Starter Concept Cards */
.concept-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.concept-card {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--studio-r-sm);
  border: 1px solid var(--studio-line);
  background: var(--studio-paper);
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.concept-card:hover {
  border-color: var(--studio-line-strong);
  background: var(--studio-white);
}

.concept-card.is-active {
  border-color: var(--studio-ink);
  background: var(--studio-white);
  box-shadow: 0 2px 10px rgba(26, 28, 32, 0.06);
}

.concept-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.concept-meta strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--studio-ink);
}

.concept-meta span {
  font-size: 11px;
  color: var(--studio-steel);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Form Fields */
.field-stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.field-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.studio-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--studio-steel);
}

.studio-field input[type="text"],
.studio-field textarea,
.studio-select {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line-strong);
  background: var(--studio-white);
  font-size: 12.5px;
  color: var(--studio-ink);
  transition: border-color 0.15s ease;
}

.studio-field input[type="text"]:focus,
.studio-field textarea:focus,
.studio-select:focus {
  border-color: var(--studio-ink);
}

.studio-field textarea {
  resize: vertical;
  min-height: 68px;
}

.segmented-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--studio-line-strong);
  border-radius: var(--studio-r-xs);
  overflow: hidden;
  background: var(--studio-paper);
}

.seg-btn {
  padding: 9px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--studio-steel);
  border-right: 1px solid var(--studio-line);
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.seg-btn:last-child {
  border-right: 0;
}

.seg-btn.is-active {
  background: var(--studio-ink);
  color: var(--studio-white);
  font-weight: 600;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--studio-ink);
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--studio-ink);
  flex-shrink: 0;
}

/* Upload Dropzone & Normalization Card */
.upload-dropzone {
  padding: 14px;
  border: 1.5px dashed var(--studio-line-strong);
  border-radius: var(--studio-r-sm);
  background: var(--studio-paper);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--studio-ink);
  background: var(--studio-platinum);
}

.upload-dropzone svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--studio-ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

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

.dropzone-copy strong {
  font-size: 12.5px;
  font-weight: 600;
}

.dropzone-copy span {
  font-size: 11px;
  color: var(--studio-steel);
}

.norm-preview-card {
  margin-top: 12px;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-r-sm);
  overflow: hidden;
  background: var(--studio-white);
}

.norm-preview-toolbar {
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--studio-paper);
  border-bottom: 1px solid var(--studio-line);
}

.norm-badge {
  font-family: var(--studio-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--studio-steel);
}

.norm-bg-toggle {
  display: flex;
  gap: 4px;
}

.mini-tab {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  color: var(--studio-steel);
  border: 1px solid transparent;
}

.mini-tab.is-active {
  background: var(--studio-white);
  color: var(--studio-ink);
  border-color: var(--studio-line-strong);
  font-weight: 600;
}

.logo-norm-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.norm-readout {
  margin: 0;
  padding: 7px 10px;
  font-family: var(--studio-font-mono);
  font-size: 10px;
  color: var(--studio-steel);
  border-top: 1px solid var(--studio-line);
  background: var(--studio-paper);
}

.norm-controls {
  margin: 10px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.range-field {
  margin-top: 4px;
}

.range-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--studio-steel);
  margin-bottom: 3px;
}

.range-head output {
  font-family: var(--studio-font-mono);
  color: var(--studio-ink);
}

.extracted-palette-box {
  margin-bottom: 14px;
  padding: 9px 11px;
  border-radius: var(--studio-r-xs);
  background: var(--studio-paper);
  border: 1px solid var(--studio-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.extracted-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--studio-steel);
}

.secondary-btn {
  padding: 7px 11px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line-strong);
  background: var(--studio-white);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--studio-ink);
  transition: background-color 0.15s ease;
}

.secondary-btn:hover {
  background: var(--studio-platinum);
}

.choice-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice-btn {
  padding: 10px 11px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  background: var(--studio-paper);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--studio-ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice-btn strong {
  font-size: 12px;
  font-weight: 600;
}

.choice-btn small {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--studio-steel);
  line-height: 1.35;
}

.choice-btn:hover {
  border-color: var(--studio-line-strong);
}

.choice-btn.is-active {
  border-color: var(--studio-ink);
  background: var(--studio-white);
  box-shadow: inset 0 0 0 1px var(--studio-ink);
}

/* Format & Compound Cards */
.format-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.format-card {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--studio-r-sm);
  border: 1px solid var(--studio-line);
  background: var(--studio-paper);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.format-card svg {
  width: 36px;
  height: 44px;
  fill: none;
  stroke: var(--studio-ink);
  stroke-width: 1.4;
  flex-shrink: 0;
}

.format-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.format-card-body strong {
  font-size: 13px;
  font-weight: 600;
}

.format-card-body span,
.format-card-body small {
  font-family: var(--studio-font-mono);
  font-size: 10px;
  color: var(--studio-steel);
}

.format-card.is-active {
  border-color: var(--studio-ink);
  background: var(--studio-white);
  box-shadow: inset 0 0 0 1px var(--studio-ink);
}

.compound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.compound-card {
  padding: 10px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  background: var(--studio-paper);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.compound-card strong {
  font-size: 12.5px;
  font-weight: 600;
}

.compound-card span {
  font-family: var(--studio-font-mono);
  font-size: 9.5px;
  color: var(--studio-steel);
  word-break: break-all;
}

.compound-card.is-active {
  border-color: var(--studio-ink);
  background: var(--studio-white);
  box-shadow: inset 0 0 0 1px var(--studio-ink);
}

.rail-label-card {
  width: 100%;
  padding: 10px;
  border-radius: var(--studio-r-sm);
  border: 1px solid var(--studio-line);
  background: var(--studio-paper);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.rail-label-card canvas {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.rail-label-cta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--studio-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Palette & HEX Inputs */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.palette-preset-btn {
  padding: 8px 6px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  background: var(--studio-paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.palette-preset-btn span {
  font-size: 10px;
  line-height: 1.2;
  color: var(--studio-steel);
}

.palette-preset-btn.is-active {
  border-color: var(--studio-ink);
  background: var(--studio-white);
  box-shadow: inset 0 0 0 1px var(--studio-ink);
}

.hex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.hex-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.hex-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid var(--studio-line-strong);
  border-radius: var(--studio-r-xs);
  background: var(--studio-white);
}

.hex-input-wrap input[type="color"] {
  position: absolute;
  left: 6px;
  top: 5px;
  width: 24px;
  height: 24px;
  opacity: 0;
  cursor: pointer;
}

.hex-code-input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  font-family: var(--studio-font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--studio-ink);
  outline: none;
}

.contrast-alert {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: var(--studio-r-xs);
  background: #FFF7E2;
  border: 1px solid #E5CE93;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.inline-action-btn {
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

/* Pattern Cards */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pattern-card {
  padding: 5px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  background: var(--studio-paper);
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.pattern-card canvas {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.pattern-card span {
  font-size: 10.5px;
  font-weight: 500;
  padding: 0 2px 2px;
  color: var(--studio-ink);
}

.pattern-card.is-active {
  border-color: var(--studio-ink);
  background: var(--studio-white);
  box-shadow: inset 0 0 0 1px var(--studio-ink);
}

/* Hardware Grid */
.hardware-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.hardware-btn {
  padding: 10px 6px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  background: var(--studio-paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 500;
  text-align: center;
}

.hardware-btn.is-active {
  border-color: var(--studio-ink);
  background: var(--studio-white);
  box-shadow: inset 0 0 0 1px var(--studio-ink);
}

.micro-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--studio-steel);
  line-height: 1.5;
}

/* Export & Review Summary */
.review-palette-strip {
  display: block;
  width: 100%;
  height: 32px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line);
  margin-bottom: 12px;
}

.spec-summary-list {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--studio-line);
  font-size: 11.5px;
}

.spec-row:last-child {
  border-bottom: 0;
}

.spec-row dt {
  color: var(--studio-steel);
  flex-shrink: 0;
}

.spec-row dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
  color: var(--studio-ink);
  overflow-wrap: anywhere;
}

.spec-row dd.mono-val {
  font-family: var(--studio-font-mono);
  font-size: 10.5px;
}

.export-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.primary-cta-btn {
  width: 100%;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: var(--studio-r-sm);
  background: var(--studio-ink);
  color: var(--studio-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.16s ease;
}

.primary-cta-btn:hover:not(:disabled) {
  background: var(--studio-ink-soft);
}

.export-status {
  margin: 0;
  font-size: 11px;
  color: var(--studio-steel);
  line-height: 1.45;
}

.enquiry-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
}

.secondary-cta-btn {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--studio-r-xs);
  border: 1.5px solid var(--studio-ink);
  background: var(--studio-white);
  color: var(--studio-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.secondary-cta-btn:hover {
  background: var(--studio-paper);
}

/* Sticky Rail Footer */
.rail-footer {
  padding: 12px 18px;
  background: var(--studio-white);
  border-top: 1px solid var(--studio-line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rail-nav-secondary {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--studio-r-xs);
  border: 1px solid var(--studio-line-strong);
  font-size: 12px;
  font-weight: 500;
}

.rail-nav-primary {
  flex: 1;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--studio-r-xs);
  background: var(--studio-ink);
  color: var(--studio-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
}

/* Flat Label Modal Dialog (Class-based Zoom, Zero Inline Styles!) */
.studio-dialog {
  width: min(1080px, 94vw);
  height: min(800px, 90dvh);
  padding: 0;
  border: 1px solid var(--studio-line);
  border-radius: var(--studio-r-md);
  background: var(--studio-paper);
  color: var(--studio-ink);
}

.studio-dialog::backdrop {
  background: rgba(20, 22, 26, 0.62);
  backdrop-filter: blur(6px);
}

.dialog-topbar {
  padding: 18px 22px;
  background: var(--studio-white);
  border-bottom: 1px solid var(--studio-line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-topbar h2 {
  margin: 4px 0 3px;
  font-family: var(--studio-font-display);
  font-size: 21px;
  font-weight: 500;
}

.dialog-topbar p {
  margin: 0;
  font-family: var(--studio-font-mono);
  font-size: 11px;
  color: var(--studio-steel);
}

.dialog-canvas-stage {
  height: calc(100% - 142px);
  overflow: auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: safe center;
}

.flat-proof-canvas {
  height: auto;
  display: block;
  border-radius: var(--studio-r-xs);
  box-shadow: 0 12px 36px rgba(26, 28, 32, 0.12);
  flex-shrink: 0;
  transition: width 0.14s ease;
}

.flat-proof-canvas.zoom-100 { width: min(100%, 880px); }
.flat-proof-canvas.zoom-125 { width: 1100px; }
.flat-proof-canvas.zoom-150 { width: 1320px; }
.flat-proof-canvas.zoom-175 { width: 1540px; }
.flat-proof-canvas.zoom-200 { width: 1760px; }
.flat-proof-canvas.zoom-225 { width: 1980px; }
.flat-proof-canvas.zoom-250 { width: 2200px; }

.dialog-footer {
  padding: 12px 22px;
  background: var(--studio-white);
  border-top: 1px solid var(--studio-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
}

.zoom-control input {
  width: 140px;
}

.zoom-control output {
  font-family: var(--studio-font-mono);
  font-size: 11px;
  min-width: 40px;
}

.dialog-note {
  font-family: var(--studio-font-mono);
  font-size: 10px;
  color: var(--studio-steel);
}

/* Toast Notification */
.studio-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--studio-ink);
  color: var(--studio-white);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(26, 28, 32, 0.22);
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* Desktop Split Layout (>= 1024px: 66% Stage Left / 34% Configurator Rail Right) */
@media (min-width: 1024px) {
  .avitus-studio-shell {
    height: 100dvh;
    overflow: hidden;
  }

  .studio-topbar {
    padding: 0 28px;
  }

  .studio-workspace {
    display: grid;
    grid-template-columns: minmax(0, 66fr) minmax(380px, 34fr);
    height: calc(100dvh - 58px);
    overflow: hidden;
  }

  .studio-stage {
    position: relative;
    height: 100%;
    max-height: none;
    min-height: 0;
    border-bottom: 0;
    border-right: 1px solid var(--studio-line);
  }

  .stage-overlay-top {
    position: absolute;
    top: 26px;
    left: 32px;
    right: 28px;
    padding: 0;
  }

  .stage-format-title {
    font-size: 32px;
  }

  .stage-dimensions {
    font-size: 11px;
  }

  .stage-controls-dock {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 20px;
    padding: 0;
    background: transparent;
    border-top: 0;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
  }

  .fit-control {
    width: 340px;
  }

  .studio-rail {
    height: 100%;
    overflow: hidden;
  }

  .rail-scroll {
    padding: 24px 26px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--studio-silver) transparent;
  }
}

/* Compact Mobile Refinements (<= 640px down to 360px) */
@media (max-width: 640px) {
  .studio-stage {
    height: 53svh;
    min-height: 385px;
    max-height: 465px;
  }

  .stage-overlay-top {
    top: 8px;
    left: 12px;
    right: 12px;
  }

  .stage-spec-callout {
    max-width: 80%;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(26, 28, 32, 0.1);
    backdrop-filter: blur(8px);
  }

  .stage-spec-callout .studio-eyebrow,
  .stage-dimensions {
    display: none;
  }

  .stage-format-title {
    font-size: 13px;
    margin: 0;
  }

  .stage-compound-tag,
  .stage-status-pill {
    display: none;
  }

  .stage-controls-dock {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
  }

  .camera-toolbar {
    padding: 2px;
    gap: 2px;
  }

  .cam-btn {
    min-height: 30px;
    min-width: 30px;
    padding: 4px 6px;
  }

  .cam-btn span {
    display: none;
  }

  .fit-header,
  #fit-slider {
    display: none;
  }

  .fit-control {
    width: auto;
    padding: 2px;
  }

  .fit-quick-btns {
    display: flex;
    gap: 3px;
    margin-top: 0;
  }

  .fit-pill {
    padding: 5px 9px;
    font-size: 10px;
    min-height: 30px;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .studio-topbar {
    height: 50px;
    min-height: 50px;
    padding: 0 10px;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .topbar-brand {
    gap: 8px;
  }

  .topbar-back {
    padding: 5px 8px;
    font-size: 11px;
  }

  .topbar-titles .studio-eyebrow,
  .topbar-divider,
  .active-concept-pill {
    display: none;
  }

  .topbar-heading {
    font-size: 14px;
  }

  .studio-ghost-btn {
    padding: 5px 9px;
    font-size: 11px;
  }

  .studio-eyebrow {
    font-size: 8px;
  }

  .field-row-two,
  .choice-grid-two,
  .enquiry-row {
    grid-template-columns: 1fr;
  }

  .palette-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hardware-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-label {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avitus-studio-shell *,
  .avitus-studio-shell *::before,
  .avitus-studio-shell *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.compound-card[hidden] {
  display: none !important;
}

/* Spectral hairline with luminous white specular beam on Studio topbar */
.studio-topbar {
  position: relative;
  overflow: hidden;
}
.studio-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-image:
    linear-gradient(108deg, transparent 42%, rgba(255, 255, 255, .96) 50%, transparent 58%),
    linear-gradient(90deg, #F24BC0 0%, #9B5BE6 26%, #5B7BE6 48%, #3FC6E0 72%, #6FE0B0 100%);
  background-size: 240% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: 140% 0, 0 0;
  animation: studio-beam 5.6s cubic-bezier(.4, 0, .2, 1) infinite;
  pointer-events: none;
}
@keyframes studio-beam {
  0% { background-position: 140% 0, 0 0; }
  58% { background-position: -40% 0, 0 0; }
  100% { background-position: -40% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-topbar::after {
    animation: none;
    background-image: linear-gradient(90deg, #F24BC0 0%, #9B5BE6 26%, #5B7BE6 48%, #3FC6E0 72%, #6FE0B0 100%);
    background-size: 100% 100%;
  }
}

