/* ═══════════════════════════════════════════
   Color Muse — Clean & Fresh Design System
   ═══════════════════════════════════════════ */

:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-alt: #F5F3EF;
  --border: #E8E4DD;
  --border-light: #F0ECE6;
  --text: #2D2D2D;
  --text-secondary: #8B8B8B;
  --text-hint: #B5B0A8;
  --accent: #7C9A8E;
  --accent-hover: #6B8A7D;
  --accent-light: rgba(124, 154, 142, 0.08);
  --accent-medium: rgba(124, 154, 142, 0.15);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 14px rgba(0,0,0,0.025);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.06), 0 6px 20px rgba(0,0,0,0.04);
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-cn: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ─── Header ─── */

.app-header {
  height: 56px;
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.app-header h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  font-family: var(--font-ui);
}

/* ─── Main Layout ─── */

.app-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  gap: 1px;
  background: var(--border-light);
  min-height: 0;
}

/* ─── Left Toolbar ─── */

.toolbar-left {
  width: 260px;
  background: var(--surface);
  padding: 28px 22px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.toolbar-top {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.toolbar-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-family: var(--font-ui);
}

/* ─── Buttons ─── */

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-ui);
  transition: background 0.2s, opacity 0.2s, box-shadow 0.2s;
  letter-spacing: 0.2px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(124, 154, 142, 0.25);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-ui);
  transition: background 0.2s, border-color 0.2s;
  letter-spacing: 0.2px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--text-hint);
}

.btn-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.btn-text {
  margin-top: 7px;
  padding: 5px 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: 500 11px var(--font-ui);
  transition: color 0.2s;
}

.btn-text:hover {
  color: var(--accent);
}

/* ─── Smart Mode ─── */

.smart-mode-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-alt), var(--surface));
}

.smart-mode-kicker {
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.smart-mode-card strong {
  font-size: 13px;
  font-weight: 600;
}

.smart-mode-card p {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.55;
}

/* ─── Radio Buttons ─── */

.algo-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  font-family: var(--font-ui);
  user-select: none;
}

.radio-label:hover {
  background: var(--accent-light);
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.radio-custom::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}

.radio-label input[type="radio"]:checked + .radio-custom {
  border-color: var(--accent);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
  background: var(--accent);
}

/* ─── Range Slider ─── */

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 1px 6px rgba(124, 154, 142, 0.35);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 6px;
}

.slider-value {
  color: var(--accent);
  font-weight: 500;
}

/* ─── Toggle Button ─── */

.btn-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-ui);
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 0.2px;
}

.btn-toggle:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(124, 154, 142, 0.15);
}

.btn-toggle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.toggle-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toggle-icon svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* ─── Split Compare Overlay ─── */

#split-overlay-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  z-index: 5;
  pointer-events: none;
  cursor: ew-resize;
}

#anatomy-overlay-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  display: none;
  width: auto;
  height: auto;
  max-width: 90%;
  max-height: 90%;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

/* ─── Processing Spinner ─── */

.processing-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing-spinner.hidden {
  display: none;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-spin 0.8s linear infinite;
}

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

/* ─── Canvas Workspace ─── */

.canvas-workspace {
  flex: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

#drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  width: min(480px, 70%);
  height: min(380px, 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}

.drop-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.drop-zone-content p {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.drop-hint {
  font-size: 13px;
  color: var(--text-hint);
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-zone-content {
  text-align: center;
  color: var(--text-hint);
}

/* ─── Right Panel ─── */

.panel-right {
  width: 380px;
  background: var(--surface);
  padding: 24px 22px;
  overflow-y: auto;
  flex-shrink: 0;
}

/* ─── Panel Modes ─── */

.panel-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 9px;
  background: var(--surface-alt);
}

.panel-mode-tab {
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: 600 11px var(--font-ui);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.panel-mode-tab span {
  margin-left: 4px;
  color: #a06f55;
  font-size: 7px;
  letter-spacing: 0.5px;
}

.panel-mode-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.panel-mode-content.hidden {
  display: none;
}

.section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-family: var(--font-ui);
}

.section-title-spaced {
  margin-top: 24px;
}

/* ─── Intelligent Candidates ─── */

.candidate-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.candidate-refresh {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font: 500 11px var(--font-ui);
}

.candidate-refresh:disabled {
  color: var(--text-hint);
  cursor: not-allowed;
}

.candidate-status {
  margin: -4px 0 14px;
  color: var(--text-hint);
  font-size: 11px;
  line-height: 1.5;
}

.candidate-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.candidate-recommendation {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(124, 154, 142, 0.38);
  border-radius: var(--radius);
  background: var(--accent-light);
}

.candidate-recommendation.hidden {
  display: none;
}

.candidate-recommendation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.candidate-recommendation-heading strong {
  font-size: 12px;
}

#candidate-recommendation-confidence {
  padding: 3px 7px;
  border-radius: 100px;
  background: var(--surface);
  color: var(--accent-hover);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

#candidate-recommendation-confidence[data-level="low"] {
  color: #a06f55;
}

.candidate-recommendation p {
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.55;
}

.candidate-scene-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.candidate-scene-tags:empty {
  display: none;
}

.candidate-scene-tags span {
  padding: 3px 6px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  font-size: 8px;
}

.candidate-empty {
  padding: 22px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-hint);
  font-size: 11px;
  text-align: center;
}

.candidate-card {
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.candidate-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.candidate-card.recommended {
  border-color: rgba(124, 154, 142, 0.45);
}

.candidate-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-medium);
}

.candidate-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  background: var(--surface-alt);
}

.candidate-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px 12px;
}

.candidate-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.candidate-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.candidate-heading strong {
  font-size: 13px;
  font-weight: 600;
}

.candidate-badge {
  padding: 3px 7px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.candidate-score {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--accent-hover);
  flex-shrink: 0;
}

.candidate-score strong {
  font-size: 17px;
  line-height: 1;
}

.candidate-score small {
  color: var(--text-hint);
  font-size: 8px;
}

.candidate-detail,
.candidate-insight {
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.45;
}

.candidate-insight {
  color: var(--accent-hover);
}

.candidate-insight.has-risk {
  color: #a06f55;
}

.candidate-strength {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 9px;
}

.candidate-strength strong {
  color: var(--text);
  font-size: 11px;
}

.candidate-current-strength {
  margin-left: auto;
  color: #a06f55;
}

.candidate-metrics {
  display: grid;
  gap: 4px;
  padding: 2px 0;
}

.candidate-metric {
  display: grid;
  grid-template-columns: 48px 1fr 20px;
  align-items: center;
  gap: 6px;
  color: var(--text-hint);
  font-size: 8px;
}

.candidate-metric-track {
  height: 3px;
  overflow: hidden;
  border-radius: 100px;
  background: var(--border-light);
}

.candidate-metric-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.candidate-metric-score {
  text-align: right;
}

.candidate-evidence {
  color: var(--text-secondary);
  font-size: 9px;
}

.candidate-evidence summary {
  color: var(--accent-hover);
  cursor: pointer;
}

.candidate-evidence ul {
  display: grid;
  gap: 3px;
  margin: 6px 0 0 14px;
  line-height: 1.45;
}

.candidate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.candidate-actions > span {
  color: var(--text-hint);
  font-size: 9px;
}

.candidate-apply {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: 600 11px var(--font-ui);
}

.candidate-card.active .candidate-apply {
  color: var(--text-secondary);
}

.candidate-loading {
  display: grid;
  gap: 10px;
}

.candidate-loading span {
  height: 98px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-alt) 25%, #faf9f6 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: candidate-shimmer 1.4s infinite linear;
}

@keyframes candidate-shimmer {
  to { background-position: -200% 0; }
}

/* ─── Color Anatomy ─── */

.color-anatomy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.color-anatomy-heading,
.anatomy-block-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.color-anatomy-heading h3 {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.color-anatomy-kicker {
  color: var(--accent-hover);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.color-anatomy-live {
  margin-top: 2px;
  padding: 4px 7px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.color-anatomy-summary {
  padding: 11px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-light);
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.55;
}

.anatomy-source-tabs,
.component-tabs,
.scope-tabs {
  display: flex;
  gap: 4px;
}

.anatomy-source-tabs button,
.component-tabs button,
.scope-tabs button {
  border: 1px solid var(--border-light);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-hint);
  cursor: pointer;
  font: 600 8px var(--font-ui);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.anatomy-source-tabs button {
  flex: 1;
  padding: 6px 8px;
}

.component-tabs button {
  min-width: 31px;
  padding: 5px 8px;
}

.scope-tabs button {
  flex: 1;
  padding: 6px 5px;
}

.anatomy-source-tabs button.active,
.component-tabs button.active,
.scope-tabs button.active {
  border-color: rgba(124, 154, 142, 0.45);
  background: var(--accent-light);
  color: var(--accent-hover);
}

.anatomy-source-tabs button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.anatomy-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.anatomy-metrics div {
  min-width: 0;
  padding: 8px 7px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.anatomy-metrics span,
.anatomy-metrics strong {
  display: block;
}

.anatomy-metrics span {
  overflow: hidden;
  color: var(--text-hint);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anatomy-metrics strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.anatomy-block {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.anatomy-block-heading {
  align-items: center;
}

.anatomy-block-heading strong {
  font-size: 10px;
}

.anatomy-block-heading > span {
  color: var(--text-hint);
  font-size: 8px;
}

#color-component-map,
#color-scope-canvas,
#recipe-tone-curve {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
}

#color-component-map {
  max-height: 180px;
  background: var(--surface-alt);
  object-fit: contain;
}

#color-scope-canvas {
  height: 220px;
  background: #151817;
}

.waveform-mode-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.waveform-mode-controls button {
  min-width: 0;
  padding: 5px 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #232725;
  color: #989e9a;
  cursor: pointer;
  font: 600 7px var(--font-ui);
}

.waveform-mode-controls button.active {
  border-color: rgba(116, 190, 161, 0.45);
  background: #2d3833;
  color: #b8dbc9;
}

.waveform-mode-controls > span {
  grid-column: 1 / -1;
  color: var(--text-hint);
  font-size: 7px;
  text-align: right;
}

.reference-recipe-panel {
  border-color: rgba(207, 154, 63, 0.32);
  background: linear-gradient(180deg, rgba(251, 246, 235, 0.92), var(--surface));
}

.recipe-v2-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-v2-title span {
  padding: 3px 6px;
  border-radius: 100px;
  background: #efe1c2;
  color: #8b6425;
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.35px;
}

.recipe-curve-heading,
.recipe-point-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
}

.recipe-curve-heading strong,
.recipe-point-heading strong {
  font-size: 9px;
}

.recipe-curve-heading span,
.recipe-point-heading span {
  color: var(--text-hint);
  font-size: 7px;
}

#recipe-tone-curve {
  height: 184px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #171a18;
}

.recipe-curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--text-hint);
  font-size: 7px;
}

.recipe-curve-legend span::before {
  display: inline-block;
  width: 8px;
  height: 2px;
  margin: 0 4px 2px 0;
  content: '';
}

.recipe-curve-legend .source::before { background: #9c9b96; }
.recipe-curve-legend .reference::before { background: #d5aa4d; }
.recipe-curve-legend .result::before { background: #74bea1; }
.recipe-curve-legend .curve::before { background: #f5eee1; }

.recipe-point-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.recipe-point-color {
  display: grid;
  grid-template-columns: 11px 1fr;
  gap: 3px 6px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
}

.recipe-point-color:hover,
.recipe-point-color.active {
  border-color: hsl(var(--point-hue) 48% 52% / 0.7);
  background: var(--surface);
}

.recipe-point-color .point-swatch {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  margin-top: 1px;
  border-radius: 50%;
  background: hsl(var(--point-hue) 58% 54%);
}

.recipe-point-color strong {
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-point-color small {
  color: var(--text-hint);
  font-size: 7px;
  font-variant-numeric: tabular-nums;
}

.anatomy-help {
  color: var(--text-secondary);
  font-size: 8px;
  line-height: 1.5;
}

.color-slice-controls {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.color-slice-controls button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  padding: 7px 2px 5px;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-ui);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.color-slice-controls button:hover,
.color-slice-controls button.active {
  transform: translateY(-1px);
  border-color: var(--slice-color);
  background: var(--surface);
}

.color-slice-controls button > span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--slice-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.color-slice-controls strong {
  font-size: 8px;
}

.color-slice-controls small {
  color: var(--text-hint);
  font-size: 7px;
}

.scope-legend {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.scope-legend button {
  padding: 4px 7px;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-hint);
  cursor: pointer;
  font: 600 7px var(--font-ui);
  opacity: 0.42;
}

.scope-legend button.active {
  opacity: 1;
}

.scope-legend button:disabled {
  cursor: not-allowed;
  opacity: 0.22;
}

.scope-legend button::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  content: '';
}

.scope-legend .source::before { background: #b9b5ad; }
.scope-legend .reference::before { background: #d5aa4d; }
.scope-legend .result::before { background: #74bea1; }

.color-explanation-list {
  display: grid;
  gap: 6px;
  padding-left: 15px;
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1.5;
}

.color-explanation-list li::marker {
  color: var(--accent);
}

.color-recipe-stack {
  display: grid;
  gap: 6px;
}

.color-recipe-layer {
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: start;
  gap: 7px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.color-recipe-layer.disabled {
  opacity: 0.48;
}

.recipe-layer-toggle {
  position: relative;
  width: 24px;
  height: 14px;
  border: 0;
  border-radius: 100px;
  background: #cbc8c0;
  cursor: pointer;
  transition: background 0.2s;
}

.recipe-layer-toggle::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  content: '';
  transition: transform 0.2s;
}

.recipe-layer-toggle[aria-checked="true"] {
  background: var(--accent);
}

.recipe-layer-toggle[aria-checked="true"]::after {
  transform: translateX(10px);
}

.recipe-layer-toggle:disabled {
  cursor: default;
}

.recipe-index {
  color: var(--accent);
  font-size: 8px;
  font-weight: 700;
}

.color-recipe-layer div {
  min-width: 0;
}

.color-recipe-layer strong,
.color-recipe-layer small {
  display: block;
}

.color-recipe-layer strong {
  font-size: 9px;
}

.color-recipe-layer small {
  margin-top: 2px;
  color: var(--text-hint);
  font-size: 7px;
}

.color-recipe-layer p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 8px;
  line-height: 1.4;
}

.recipe-amount {
  color: var(--accent-hover);
  font-size: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.recipe-amount small {
  display: block;
  margin-top: 3px;
  color: var(--text-hint);
  font-size: 6px;
  font-weight: 600;
  text-align: right;
}

.panel-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--border-light);
}

/* ─── Reference Links ─── */

.ref-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}

.ref-link:hover {
  background: var(--accent-light);
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}

.ref-link-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.ref-link-icon svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.ref-link:hover .ref-link-icon {
  background: var(--accent-medium);
}

.ref-link-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ref-link-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

.ref-link-desc {
  font-size: 11px;
  color: var(--text-hint);
  line-height: 1.2;
}

.ref-link-arrow {
  font-size: 13px;
  color: var(--text-hint);
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.ref-link:hover .ref-link-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* ─── Reference Grid ─── */

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.ref-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
  padding: 0;
  background: none;
}

.ref-thumb:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.ref-thumb.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-medium);
}

.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── Footer ─── */

.app-footer {
  height: 52px;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 28px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  position: relative;
}

.footer-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

/* ─── Download Dropdown ─── */

.download-dropdown {
  position: relative;
}

.download-dropdown > .btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
}

.download-dropdown > .btn-primary::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  transition: transform 0.2s;
}

.download-dropdown.open > .btn-primary::after {
  transform: rotate(180deg);
}

.download-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 100;
  overflow: hidden;
}

.download-dropdown.open .download-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.download-menu-section {
  padding: 6px;
}

.download-menu-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-hint);
  padding: 6px 10px 4px;
}

.download-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  text-align: left;
}

.download-menu-item:hover {
  background: var(--accent-light);
}

.download-menu-item:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.download-menu-item:disabled:hover {
  background: none;
}

.download-menu-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.download-menu-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0 6px;
}

/* ─── Description Bar ─── */

.app-desc {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 28px;
  line-height: 1.6;
  color: var(--text-hint);
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-desc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}

.app-desc-body {
  font-size: 13px;
}

.footer-feedback {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-hint);
  white-space: nowrap;
}

.footer-feedback a {
  color: var(--accent);
  text-decoration: none;
}

.footer-feedback a:hover {
  text-decoration: underline;
}

.app-desc a {
  color: var(--accent);
  text-decoration: none;
}

.app-desc a:hover {
  text-decoration: underline;
}

/* ─── Main Canvas ─── */

#workspace-canvas {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 1;
}

#workspace-canvas.compare-active {
  pointer-events: none;
}

/* ─── Toast ─── */

.toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(124, 154, 142, 0.3);
  animation: toast-in 0.3s ease;
  font-family: var(--font-ui);
  letter-spacing: 0.2px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ─── Scrollbar ─── */

.toolbar-left::-webkit-scrollbar,
.panel-right::-webkit-scrollbar {
  width: 4px;
}

.toolbar-left::-webkit-scrollbar-track,
.panel-right::-webkit-scrollbar-track {
  background: transparent;
}

.toolbar-left::-webkit-scrollbar-thumb,
.panel-right::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ─── Selection ─── */

::selection {
  background: var(--accent-medium);
  color: var(--text);
}

@media (max-width: 1280px) {
  .toolbar-left {
    width: 230px;
    padding: 22px 18px;
  }

  .panel-right {
    width: 320px;
    padding: 20px 18px;
  }

  .toolbar-top {
    gap: 22px;
  }
}

@media (max-width: 1080px) {
  .toolbar-left {
    width: 210px;
  }

  .panel-right {
    width: 300px;
  }

  .app-desc-body,
  .footer-feedback {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Editorial Lab / 2026
   A high-contrast, image-first visual system for Color Muse.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #e9e5dc;
  --surface: #f5f2ea;
  --surface-alt: #ddd8cd;
  --border: #bdb8ad;
  --border-light: rgba(17, 18, 15, 0.14);
  --text: #11120f;
  --text-secondary: #68675f;
  --text-hint: #929087;
  --accent: #3155ff;
  --accent-hover: #1838d3;
  --accent-light: rgba(49, 85, 255, 0.08);
  --accent-medium: rgba(49, 85, 255, 0.18);
  --acid: #d8ff3e;
  --coral: #ff6f4a;
  --ink: #11120f;
  --paper: #f5f2ea;
  --radius: 2px;
  --radius-sm: 1px;
  --radius-lg: 3px;
  --shadow: none;
  --shadow-hover: 0 18px 44px rgba(17, 18, 15, 0.12);
  --font-ui: "Helvetica Neue", "Arial Narrow", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Iowan Old Style", "Baskerville", "Times New Roman", "Songti SC", serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", Consolas, monospace;
}

html {
  background: var(--ink);
}

body.editorial-lab {
  background: var(--paper);
  letter-spacing: -0.01em;
}

button,
a,
summary,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 9px 12px;
  transform: translateY(-160%);
  background: var(--acid);
  color: var(--ink);
  font: 700 11px var(--font-mono);
  text-decoration: none;
  transition: transform 180ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

#app {
  background: var(--paper);
}

/* Masthead */

.app-header {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(320px, 1.8fr) auto;
  gap: 28px;
  align-items: center;
  height: 82px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.brand-lockup {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  color: inherit;
  text-decoration: none;
}

.brand-code,
.header-statement > span,
.header-edition span,
.panel-heading > span,
.rail-heading > span,
.rail-note > span,
.canvas-hud,
.transport-heading span,
.drop-index {
  font: 650 8px/1.2 var(--font-mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.brand-code {
  margin-top: 6px;
  padding: 3px 4px;
  background: var(--acid);
}

.app-header .brand-lockup h1 {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font: 400 clamp(29px, 3vw, 43px)/0.85 var(--font-display);
  letter-spacing: -0.07em;
}

.brand-lockup h1 span {
  font-style: italic;
}

.brand-lockup h1 em {
  font-family: var(--font-ui);
  font-size: 0.73em;
  font-style: normal;
  font-weight: 750;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.header-statement {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(220px, 1fr);
  gap: 16px;
  align-items: baseline;
  max-width: 700px;
  padding-left: 18px;
  border-left: 1px solid var(--ink);
}

.header-statement p {
  font: 500 13px/1.35 var(--font-ui);
}

.header-edition {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.header-edition strong {
  font: 700 14px var(--font-mono);
}

/* Workflow strip */

.app-desc {
  display: grid;
  grid-template-columns: minmax(440px, 1.2fr) minmax(260px, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 43px;
  padding: 0 22px;
  border-bottom: 1px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  text-align: left;
}

.workflow-index {
  display: flex;
  align-self: stretch;
}

.workflow-index button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 20px;
  border: 0;
  border-left: 1px solid rgba(17, 18, 15, 0.3);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 650 9px var(--font-mono);
  letter-spacing: 0.04em;
  transition: background 180ms ease-out, color 180ms ease-out;
}

.workflow-index button:last-child {
  border-right: 1px solid rgba(17, 18, 15, 0.3);
}

.workflow-index button span {
  opacity: 0.52;
}

.workflow-index button:hover,
.workflow-index button.active {
  background: var(--ink);
  color: var(--acid);
}

.app-desc .app-desc-body {
  overflow: hidden;
  font: 600 8px var(--font-mono);
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.focus-mode-btn {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 28px;
  padding: 0 0 0 13px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 650 10px var(--font-ui);
  transition: background 180ms ease-out, color 180ms ease-out;
}

.focus-mode-btn kbd {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 26px;
  border-left: 1px solid currentColor;
  font: 700 8px var(--font-mono);
}

.focus-mode-btn:hover,
.focus-mode-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--acid);
}

/* Three-part workspace */

.app-main {
  display: grid;
  grid-template-columns: 252px minmax(360px, 1fr) 410px;
  gap: 0;
  background: var(--ink);
  transition: grid-template-columns 360ms cubic-bezier(.2,.75,.2,1);
}

.toolbar-left,
.panel-right {
  width: auto;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--ink);
  background: var(--paper);
  transition: opacity 220ms ease-out, padding 360ms cubic-bezier(.2,.75,.2,1);
}

.toolbar-left {
  justify-content: flex-start;
  gap: 30px;
  padding: 20px 18px 16px;
  background: #e7e2d8;
}

.panel-right {
  display: block;
  padding: 18px 18px 28px;
  border-right: 0;
  border-left: 1px solid var(--ink);
}

.rail-heading,
.panel-heading {
  display: grid;
  gap: 7px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}

.rail-heading strong {
  font: 400 25px/1 var(--font-display);
  letter-spacing: -0.035em;
}

.rail-heading p,
.panel-heading p,
.rail-note p {
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.55;
}

.panel-heading {
  grid-template-columns: 1fr 1.15fr;
  align-items: start;
  margin-bottom: 13px;
}

.toolbar-top {
  gap: 26px;
}

.toolbar-section {
  position: relative;
}

.toolbar-section + .toolbar-section {
  padding-top: 25px;
  border-top: 1px solid rgba(17, 18, 15, 0.2);
}

.toolbar-label {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink);
  font: 650 9px var(--font-mono);
  letter-spacing: 0.08em;
}

.toolbar-label span {
  color: var(--accent);
}

.btn-primary,
.btn-secondary,
.btn-toggle {
  min-height: 40px;
  border-radius: 0;
  font-weight: 650;
  transition: color 180ms ease-out, background 180ms ease-out, border-color 180ms ease-out, transform 180ms ease-out;
}

.btn-primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.28;
}

.btn-secondary {
  border-color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.btn-text {
  margin-top: 9px;
  color: var(--text-secondary);
  font: 600 9px var(--font-mono);
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text:hover {
  color: var(--accent);
}

.smart-mode-card {
  gap: 9px;
  margin-bottom: 10px;
  padding: 13px;
  border-color: var(--ink);
  border-radius: 0;
  background: transparent;
}

.smart-mode-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
}

.smart-mode-card strong {
  font: 500 15px/1.15 var(--font-display);
}

.smart-mode-card p {
  font-size: 9px;
}

.rail-note {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 12px 0 0;
  border-top: 1px solid var(--ink);
}

.rail-note > span {
  color: var(--accent);
}

/* Image stage */

.canvas-workspace {
  isolation: isolate;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px;
  color: #d8d7d0;
}

.canvas-workspace::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.07), transparent 42%);
  content: "";
  pointer-events: none;
}

.canvas-hud {
  position: absolute;
  top: 12px;
  right: 14px;
  left: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  color: rgba(245,242,234,.48);
  pointer-events: none;
}

.canvas-hud span:last-child {
  text-align: right;
}

#drop-zone {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100% - 64px));
  height: min(410px, calc(100% - 154px));
  border: 1px solid rgba(245,242,234,.35);
  border-radius: 0;
  background: rgba(17,18,15,.42);
  transition: border-color 220ms ease-out, background 220ms ease-out, transform 220ms ease-out;
}

#drop-zone::before,
#drop-zone::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--acid);
  content: "";
  pointer-events: none;
}

#drop-zone::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--acid);
  border-left: 2px solid var(--acid);
}

#drop-zone::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--acid);
  border-bottom: 2px solid var(--acid);
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--acid);
  background: rgba(216,255,62,.06);
  transform: scale(.995);
}

.drop-zone-content {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--paper);
}

.drop-icon {
  width: 28px;
  height: 28px;
  margin: 0 0 4px;
  color: var(--acid);
  opacity: 1;
}

.drop-index {
  color: var(--acid);
}

.drop-zone-content p {
  margin: 0;
  color: var(--paper);
  font: italic 400 clamp(24px, 3vw, 38px)/1.02 var(--font-display);
  letter-spacing: -0.045em;
}

.drop-hint {
  color: rgba(245,242,234,.46);
  font: 650 8px var(--font-mono);
  letter-spacing: .08em;
}

#workspace-canvas,
#split-overlay-canvas,
#anatomy-overlay-canvas {
  max-width: calc(100% - 48px);
  max-height: calc(100% - 126px);
  border-radius: 0;
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
}

.canvas-transport {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 132px;
  gap: 12px;
  align-items: center;
  padding: 9px 10px 9px 12px;
  border: 1px solid rgba(245,242,234,.22);
  background: rgba(20,21,18,.9);
  color: var(--paper);
  backdrop-filter: blur(16px);
}

.transport-strength {
  min-width: 0;
}

.transport-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  color: rgba(245,242,234,.55);
}

.transport-heading .slider-value {
  color: var(--acid);
  font: 700 12px var(--font-mono);
}

.canvas-transport input[type="range"] {
  height: 2px;
  border-radius: 0;
  background: rgba(245,242,234,.25);
}

.canvas-transport input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 1px var(--acid);
}

.canvas-transport .slider-labels {
  margin-top: 5px;
  color: rgba(245,242,234,.34);
  font: 600 7px var(--font-mono);
  letter-spacing: .08em;
}

.canvas-transport .btn-toggle {
  align-self: stretch;
  padding: 0 12px;
  border: 1px solid rgba(245,242,234,.35);
  background: transparent;
  color: var(--paper);
  font-size: 10px;
}

.canvas-transport .btn-toggle:hover:not(:disabled) {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
  box-shadow: none;
}

.toggle-mark {
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  background: linear-gradient(90deg, currentColor 48%, transparent 48%);
}

.processing-spinner {
  gap: 13px;
  min-width: 248px;
  padding: 16px 18px;
  border: 1px solid rgba(216,255,62,.5);
  background: rgba(17,18,15,.92);
  color: var(--paper);
}

.spinner-ring {
  width: 28px;
  height: 28px;
  border-width: 2px;
  border-color: rgba(245,242,234,.2);
  border-top-color: var(--acid);
}

.processing-copy {
  display: grid;
  gap: 4px;
}

.processing-copy strong {
  font-size: 11px;
}

.processing-copy span {
  color: rgba(245,242,234,.45);
  font: 600 7px var(--font-mono);
  letter-spacing: .12em;
}

/* Reference and decision desk */

.reference-drawer {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--ink);
}

.reference-drawer summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 41px;
  cursor: pointer;
  list-style: none;
}

.reference-drawer summary::-webkit-details-marker {
  display: none;
}

.reference-drawer summary span {
  font: 650 10px var(--font-ui);
}

.reference-drawer summary b {
  margin-right: 7px;
  color: var(--accent);
  font: 700 8px var(--font-mono);
}

.reference-drawer summary small {
  color: var(--text-hint);
  font: 650 7px var(--font-mono);
  letter-spacing: .08em;
}

.reference-drawer summary small::after {
  margin-left: 8px;
  color: var(--ink);
  content: "+";
  font-size: 12px;
}

.reference-drawer[open] summary small::after {
  content: "−";
}

.reference-drawer-body {
  padding: 5px 0 15px;
  animation: panel-reveal 260ms ease-out both;
}

.section-title {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font: 650 8px var(--font-mono);
  letter-spacing: .1em;
}

.section-title-spaced {
  margin-top: 14px;
}

.reference-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}

.ref-thumb {
  border-width: 1px;
  border-radius: 0;
  filter: saturate(.86);
  transition: filter 180ms ease-out, transform 180ms ease-out, border-color 180ms ease-out;
}

.ref-thumb:hover {
  border-color: var(--ink);
  box-shadow: none;
  filter: saturate(1.05);
  transform: translateY(-2px);
}

.ref-thumb.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  filter: saturate(1.08);
}

.panel-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
}

.panel-mode-tab {
  min-height: 38px;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font: 650 9px var(--font-mono);
  letter-spacing: .03em;
}

.panel-mode-tab + .panel-mode-tab {
  border-left: 1px solid var(--ink);
}

.panel-mode-tab span {
  color: var(--accent);
  font-family: var(--font-mono);
}

.panel-mode-tab.active {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}

.panel-mode-content:not(.hidden) {
  animation: panel-reveal 260ms ease-out both;
}

@keyframes panel-reveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.candidate-section-heading .section-title {
  color: var(--ink);
}

.candidate-refresh {
  color: var(--accent);
  font-family: var(--font-mono);
}

.candidate-status {
  margin-bottom: 13px;
  font-size: 9px;
}

.candidate-recommendation {
  position: relative;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--acid);
}

.candidate-recommendation::before {
  display: block;
  margin-bottom: 8px;
  content: "AGENT VERDICT";
  font: 700 7px var(--font-mono);
  letter-spacing: .12em;
}

#candidate-recommendation-confidence {
  border-radius: 0;
  background: var(--ink);
  color: var(--acid);
  font-family: var(--font-mono);
}

.candidate-recommendation p {
  color: rgba(17,18,15,.72);
}

.candidate-scene-tags span {
  border: 1px solid rgba(17,18,15,.22);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.candidate-board {
  gap: 12px;
  counter-reset: candidate;
}

.candidate-empty {
  border-color: var(--border);
  border-radius: 0;
  background: rgba(17,18,15,.025);
  font-family: var(--font-mono);
}

.candidate-card {
  position: relative;
  overflow: visible;
  border-color: var(--ink);
  border-radius: 0;
  box-shadow: none;
  counter-increment: candidate;
}

.candidate-card::before {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  background: var(--paper);
  color: var(--ink);
  content: "0" counter(candidate);
  font: 700 8px var(--font-mono);
}

.candidate-card:hover {
  z-index: 2;
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.candidate-card.recommended {
  border-color: var(--ink);
  box-shadow: 5px 5px 0 var(--acid);
}

.candidate-card.active {
  border-color: var(--accent);
  box-shadow: 5px 5px 0 var(--accent);
}

.candidate-preview {
  aspect-ratio: 16 / 7.5;
  filter: saturate(.96);
}

.candidate-content {
  gap: 7px;
  padding: 12px 13px 13px;
}

.candidate-title-group {
  gap: 6px;
}

.candidate-heading strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}

.candidate-badge {
  border-radius: 0;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--font-mono);
}

.candidate-score {
  color: var(--accent);
}

.candidate-score strong {
  font-family: var(--font-mono);
  font-size: 20px;
}

.candidate-strength {
  border: 1px solid var(--border-light);
  border-radius: 0;
  background: transparent;
}

.candidate-metric {
  grid-template-columns: 50px 1fr 22px;
  font-family: var(--font-mono);
}

.candidate-metric-track,
.candidate-metric-fill {
  border-radius: 0;
}

.candidate-metric-fill {
  background: var(--accent);
}

.candidate-evidence summary,
.candidate-apply {
  color: var(--accent);
}

.candidate-apply {
  padding: 7px 9px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  transition: background 180ms ease-out, color 180ms ease-out;
}

.candidate-apply:hover {
  background: var(--acid);
  color: var(--ink);
}

.candidate-card.active .candidate-apply {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.candidate-loading span {
  border: 1px solid var(--border-light);
  border-radius: 0;
  background: linear-gradient(90deg, #e4e0d7 25%, var(--acid) 50%, #e4e0d7 75%);
  background-size: 200% 100%;
}

/* Anatomy becomes an editorial technical report */

.color-anatomy {
  gap: 14px;
}

.color-anatomy-heading h3 {
  font: 400 23px/1 var(--font-display);
  letter-spacing: -.04em;
}

.color-anatomy-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
}

.color-anatomy-live {
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--font-mono);
}

.color-anatomy-summary {
  padding: 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  background: var(--accent-light);
}

.anatomy-source-tabs,
.component-tabs,
.scope-tabs {
  gap: 0;
}

.anatomy-source-tabs button,
.component-tabs button,
.scope-tabs button {
  border-color: var(--border);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
}

.anatomy-source-tabs button + button,
.component-tabs button + button,
.scope-tabs button + button {
  border-left: 0;
}

.anatomy-source-tabs button.active,
.component-tabs button.active,
.scope-tabs button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.anatomy-metrics {
  gap: 0;
}

.anatomy-metrics div {
  padding: 9px 8px;
  border-color: var(--ink);
  border-radius: 0;
}

.anatomy-metrics div + div {
  border-left: 0;
}

.anatomy-metrics span {
  font-family: var(--font-mono);
}

.anatomy-metrics strong {
  font-family: var(--font-mono);
}

.anatomy-block {
  gap: 10px;
  padding: 12px;
  border-color: var(--ink);
  border-radius: 0;
  box-shadow: none;
}

.anatomy-block-heading {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.anatomy-block-heading strong {
  font-size: 11px;
}

.anatomy-block-heading > span,
.anatomy-help,
.recipe-curve-heading span,
.recipe-point-heading span {
  font-family: var(--font-mono);
}

.reference-recipe-panel {
  border-color: var(--ink);
  background: #eee7d8;
  box-shadow: 5px 5px 0 #e0ad4e;
}

.recipe-v2-title span,
.recipe-point-color,
.color-slice-controls button,
.waveform-mode-controls button,
.scope-legend button,
.color-recipe-layer {
  border-radius: 0;
}

#color-component-map,
#color-scope-canvas,
#recipe-tone-curve {
  border-radius: 0;
}

.waveform-mode-controls button {
  border-radius: 0;
  font-family: var(--font-mono);
}

.scope-legend button {
  font-family: var(--font-mono);
}

.color-recipe-layer {
  border-left: 2px solid var(--accent);
}

/* Footer / output dock */

.app-footer {
  height: 46px;
  padding: 0 18px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
  font-size: 10px;
}

.footer-status {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
}

.footer-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.footer-feedback {
  color: var(--text-hint);
  font: 650 7px var(--font-mono);
  letter-spacing: .12em;
}

.footer-actions {
  gap: 6px;
}

.app-footer .btn-primary,
.app-footer .btn-secondary {
  min-height: 31px;
  padding: 0 13px;
  font-size: 10px;
}

.download-menu {
  border-color: var(--ink);
  border-radius: 0;
  background: var(--paper);
  box-shadow: 8px 8px 0 rgba(17,18,15,.18);
}

.download-menu-item {
  border-radius: 0;
  font-size: 11px;
}

.download-menu-item:hover {
  background: var(--acid);
}

.download-menu-icon {
  font: 700 8px var(--font-mono);
}

.toast {
  border: 1px solid var(--acid);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 6px 6px 0 rgba(216,255,62,.72);
  font-family: var(--font-mono);
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Focus mode: the image temporarily owns the interface. */

#app.focus-mode .app-main {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

#app.focus-mode .toolbar-left,
#app.focus-mode .panel-right {
  overflow: hidden;
  padding-right: 0;
  padding-left: 0;
  opacity: 0;
  pointer-events: none;
}

#app.focus-mode #workspace-canvas,
#app.focus-mode #split-overlay-canvas,
#app.focus-mode #anatomy-overlay-canvas {
  max-width: calc(100% - 70px);
}

/* Responsive reflow: preserve the narrative instead of shrinking the lab. */

@media (max-width: 1320px) {
  .app-main {
    grid-template-columns: 220px minmax(320px, 1fr) 360px;
  }

  .toolbar-left,
  .panel-right {
    width: auto;
  }

  .toolbar-left {
    padding: 17px 14px 14px;
  }

  .panel-right {
    padding: 16px 14px 24px;
  }

  .workflow-index button {
    padding: 0 13px;
  }
}

@media (max-width: 1080px) {
  .app-header {
    grid-template-columns: minmax(210px, .7fr) 1fr auto;
  }

  .header-statement {
    display: block;
  }

  .header-statement > span {
    display: none;
  }

  .app-desc {
    grid-template-columns: 1fr auto;
  }

  .app-desc .app-desc-body {
    display: none;
  }

  .app-main {
    grid-template-columns: 200px minmax(300px, 1fr) 330px;
  }

  .panel-heading {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  #app {
    min-height: 100vh;
  }

  .app-header {
    position: relative;
    grid-template-columns: 1fr auto;
    height: 72px;
  }

  .header-statement {
    display: none;
  }

  .app-desc {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .app-main,
  #app.focus-mode .app-main {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .toolbar-left,
  .panel-right,
  #app.focus-mode .toolbar-left,
  #app.focus-mode .panel-right {
    width: 100%;
    overflow: visible;
    padding: 22px;
    border: 0;
    border-bottom: 1px solid var(--ink);
    opacity: 1;
    pointer-events: auto;
  }

  .toolbar-left {
    display: grid;
    grid-template-columns: minmax(190px, .75fr) minmax(380px, 1.5fr);
    gap: 26px;
  }

  .toolbar-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .toolbar-section + .toolbar-section {
    padding: 0 0 0 16px;
    border-top: 0;
    border-left: 1px solid rgba(17,18,15,.2);
  }

  .rail-note {
    display: none;
  }

  .canvas-workspace {
    order: 2;
    min-height: 68vh;
  }

  .panel-right {
    order: 3;
  }

  .reference-grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .candidate-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .candidate-board:has(.candidate-card) {
    display: grid;
  }

  .candidate-content {
    padding: 10px;
  }

  .candidate-title-group {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Opening sequence — atmospheric color before the color lab
   ═══════════════════════════════════════════════════════════════ */

body.intro-active {
  overflow: hidden;
}

.intro-gate {
  --intro-x: 0;
  --intro-y: 0;
  position: fixed;
  inset: 0;
  z-index: 1600;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 38% at 50% 54%, rgba(239, 235, 222, 0.7) 0%, rgba(216, 217, 207, 0.28) 44%, transparent 75%),
    radial-gradient(circle at 76% 20%, rgba(142, 165, 172, 0.25), transparent 34%),
    linear-gradient(180deg, #1e3442 0%, #3e5968 23%, #82949a 42%, #d1cec1 60%, #d39c73 75%, #b85e31 100%);
  color: rgba(249, 247, 241, 0.94);
  opacity: 1;
  transition: opacity 700ms cubic-bezier(.22,.68,.18,1), visibility 700ms step-start;
}

.intro-gate[hidden] {
  display: none;
}

.intro-gate::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(9, 18, 25, 0.14), transparent 18%, transparent 82%, rgba(55, 27, 13, 0.08)),
    linear-gradient(180deg, rgba(7, 17, 24, 0.15), transparent 30%, transparent 72%, rgba(84, 31, 11, 0.12));
  content: "";
  pointer-events: none;
}

.intro-atmosphere {
  position: absolute;
  inset: -3%;
  z-index: 1;
  overflow: hidden;
  transform: translate3d(calc(var(--intro-x) * -5px), calc(var(--intro-y) * -4px), 0) scale(1.02);
  transition: transform 800ms cubic-bezier(.2,.7,.2,1);
}

.intro-haze {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.32;
}

.intro-haze-one {
  top: 35%;
  left: 18%;
  width: 62vw;
  height: 22vh;
  background: rgba(237, 235, 221, 0.7);
  transform: translate3d(calc(var(--intro-x) * 12px), calc(var(--intro-y) * 8px), 0) rotate(-3deg);
}

.intro-haze-two {
  right: -8%;
  bottom: -10%;
  width: 58vw;
  height: 36vh;
  background: rgba(206, 94, 43, 0.36);
  transform: translate3d(calc(var(--intro-x) * -9px), calc(var(--intro-y) * -6px), 0);
}

.intro-grain {
  position: absolute;
  inset: 0;
  background-image:
    repeating-radial-gradient(circle at 18% 27%, rgba(255,255,255,.19) 0 .45px, transparent .7px 3.2px),
    repeating-radial-gradient(circle at 73% 61%, rgba(15,20,21,.2) 0 .4px, transparent .65px 2.9px);
  background-position: 0 0, 7px 11px;
  background-size: 7px 7px, 9px 9px;
  mix-blend-mode: soft-light;
  opacity: 0.28;
  pointer-events: none;
}

.intro-header,
.intro-footer,
.intro-hero {
  position: relative;
  z-index: 4;
}

.intro-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: start;
  padding: 31px 38px;
  opacity: 0;
  transform: translateY(-9px);
  transition: opacity 850ms 120ms ease-out, transform 850ms 120ms ease-out;
}

.intro-identity,
.intro-system,
.intro-data {
  display: grid;
  gap: 6px;
  font: 600 8px/1.15 var(--font-mono);
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.intro-identity {
  grid-template-columns: auto 1fr;
  column-gap: 10px;
}

.intro-identity strong {
  font-weight: 700;
  letter-spacing: 0.12em;
}

.intro-identity span,
.intro-system span,
.intro-data span {
  color: rgba(249, 247, 241, 0.53);
}

.intro-nav {
  display: flex;
  gap: 38px;
  color: rgba(249, 247, 241, 0.66);
  font: 600 8px var(--font-mono);
  letter-spacing: 0.18em;
}

.intro-system {
  justify-items: end;
  text-align: right;
}

#intro-skip-btn {
  margin-top: 2px;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid rgba(249, 247, 241, 0.32);
  background: transparent;
  color: rgba(249, 247, 241, 0.7);
  cursor: pointer;
  font: 600 8px var(--font-mono);
  letter-spacing: 0.13em;
  transition: border-color 180ms ease-out, color 180ms ease-out;
}

#intro-skip-btn:hover {
  border-color: rgba(249, 247, 241, 0.82);
  color: #fff;
}

.intro-hero {
  position: absolute;
  top: 49%;
  left: 50%;
  display: grid;
  justify-items: center;
  width: min(1040px, calc(100% - 64px));
  text-align: center;
  opacity: 0;
  transform: translate3d(calc(-50% + var(--intro-x) * 3px), calc(-50% + 14px + var(--intro-y) * 2px), 0);
  transition: opacity 1100ms 220ms ease-out, transform 1200ms 220ms cubic-bezier(.16,.7,.18,1);
}

.intro-transmitting {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: clamp(34px, 5vh, 62px);
  color: rgba(249, 247, 241, 0.58);
  font: 600 8px var(--font-mono);
  letter-spacing: 0.18em;
}

.intro-transmitting i {
  display: block;
  width: 24px;
  height: 1px;
  background: rgba(249, 247, 241, 0.28);
}

.intro-kicker {
  margin-bottom: 17px;
  color: rgba(249, 247, 241, 0.62);
  font: italic 400 13px var(--font-display);
  letter-spacing: 0.08em;
}

.intro-hero h2 {
  color: rgba(250, 248, 243, 0.94);
  font: 300 clamp(62px, 8vw, 132px)/0.88 "Songti SC", "STSong", var(--font-display);
  letter-spacing: -0.075em;
  text-wrap: balance;
  text-shadow: 0 2px 34px rgba(20, 29, 34, 0.12);
}

.intro-hero h2 em {
  display: inline-block;
  margin-top: 0.1em;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.055em;
}

.intro-subtitle {
  max-width: 510px;
  margin-top: 25px;
  color: rgba(249, 247, 241, 0.68);
  font: 400 12px/1.75 var(--font-ui);
  letter-spacing: 0.06em;
}

.intro-signal {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 23px;
  color: rgba(249, 247, 241, 0.48);
  font: 600 7px var(--font-mono);
  letter-spacing: 0.14em;
}

.intro-signal i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #dda176;
  box-shadow: 0 0 0 4px rgba(221, 161, 118, 0.12);
  animation: intro-signal 2.4s ease-in-out infinite;
}

@keyframes intro-signal {
  50% { opacity: .45; transform: scale(.76); }
}

.intro-enter-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 42px;
  align-items: center;
  min-width: 330px;
  margin-top: 37px;
  padding: 17px 18px 17px 23px;
  border: 1px solid rgba(249, 247, 241, 0.25);
  border-radius: 15px;
  background: rgba(245, 238, 227, 0.1);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font: 600 10px var(--font-ui);
  letter-spacing: 0.12em;
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 45px rgba(55, 29, 18, 0.06);
  transition: background 260ms ease-out, border-color 260ms ease-out, transform 260ms ease-out, box-shadow 260ms ease-out;
}

.intro-enter-btn small {
  color: rgba(255, 255, 255, 0.5);
  font: 600 7px var(--font-mono);
  letter-spacing: .12em;
}

.intro-enter-btn:hover {
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(246, 241, 232, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 20px 48px rgba(56, 30, 18, 0.12);
  transform: translateY(-2px);
}

.intro-footer {
  position: absolute;
  right: 38px;
  bottom: 28px;
  left: 38px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  opacity: 0;
  transform: translateY(9px);
  transition: opacity 900ms 430ms ease-out, transform 900ms 430ms ease-out;
}

.intro-compass {
  color: rgba(249, 247, 241, 0.7);
  font-size: 20px;
  line-height: 1;
  animation: intro-compass 16s linear infinite;
}

@keyframes intro-compass {
  to { transform: rotate(360deg); }
}

.intro-directions {
  display: grid;
  gap: 10px;
  justify-self: end;
  min-width: 185px;
  list-style: none;
  color: rgba(249, 247, 241, 0.66);
  font: 500 9px var(--font-ui);
  letter-spacing: 0.06em;
}

.intro-directions li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
}

.intro-directions span {
  color: rgba(249, 247, 241, 0.36);
  font-family: var(--font-mono);
}

.intro-gate.is-ready .intro-header,
.intro-gate.is-ready .intro-footer {
  opacity: 1;
  transform: translateY(0);
}

.intro-gate.is-ready .intro-hero {
  opacity: 1;
  transform: translate3d(calc(-50% + var(--intro-x) * 3px), calc(-50% + var(--intro-y) * 2px), 0);
}

.intro-gate.is-leaving {
  visibility: hidden;
  opacity: 0;
  transition: opacity 700ms cubic-bezier(.55,.08,.68,.53), visibility 700ms step-end;
}

.intro-gate.is-leaving .intro-atmosphere {
  transform: scale(1.055);
}

.intro-gate.is-leaving .intro-hero {
  transform: translate3d(-50%, calc(-50% - 12px), 0);
}

body.intro-active #app {
  filter: blur(8px);
  transform: scale(.992);
}

#app {
  transform-origin: 50% 50%;
  transition: filter 700ms ease-out, transform 700ms ease-out;
}

#reopen-intro-btn {
  margin-top: 2px;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-hint);
  cursor: pointer;
  font: 650 7px var(--font-mono);
  letter-spacing: .08em;
  transition: color 180ms ease-out, border-color 180ms ease-out;
}

#reopen-intro-btn:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

@media (max-width: 900px) {
  .intro-header {
    grid-template-columns: 1fr auto;
    padding: 25px 24px;
  }

  .intro-nav {
    display: none;
  }

  .intro-hero {
    width: calc(100% - 40px);
  }

  .intro-footer {
    right: 24px;
    bottom: 23px;
    left: 24px;
  }
}

@media (max-width: 620px) {
  .intro-header {
    padding: 20px 17px;
  }

  .intro-identity {
    display: grid;
    grid-template-columns: 1fr;
  }

  .intro-identity span,
  .intro-system > span:nth-child(2) {
    display: none;
  }

  .intro-transmitting {
    margin-bottom: 34px;
    font-size: 6px;
  }

  .intro-kicker {
    font-size: 11px;
  }

  .intro-hero h2 {
    font-size: clamp(49px, 15vw, 72px);
    line-height: .94;
    letter-spacing: -.07em;
  }

  .intro-subtitle {
    max-width: 330px;
    margin-top: 22px;
    font-size: 10px;
  }

  .intro-enter-btn {
    min-width: min(310px, 88vw);
    margin-top: 31px;
  }

  .intro-footer {
    right: 17px;
    bottom: 18px;
    left: 17px;
    grid-template-columns: 1fr auto;
  }

  .intro-data span:nth-child(2),
  .intro-directions {
    display: none;
  }

  .intro-compass {
    justify-self: end;
  }
}

@media (max-height: 720px) and (min-width: 621px) {
  .intro-transmitting {
    margin-bottom: 22px;
  }

  .intro-hero h2 {
    font-size: clamp(52px, 9vh, 82px);
  }

  .intro-subtitle {
    margin-top: 16px;
  }

  .intro-signal {
    margin-top: 15px;
  }

  .intro-enter-btn {
    margin-top: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-atmosphere,
  .intro-hero {
    transform: none !important;
  }

  .intro-hero {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
  }

  .intro-signal i,
  .intro-compass {
    animation: none;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 9px 14px;
  }

  .header-edition span,
  .app-desc .focus-mode-btn,
  .canvas-hud-center,
  .footer-feedback {
    display: none;
  }

  .header-edition strong {
    font-size: 9px;
  }

  .app-header .brand-lockup h1 {
    font-size: 28px;
  }

  .app-desc {
    display: block;
    min-height: 42px;
    padding: 0;
  }

  .workflow-index {
    width: 100%;
  }

  .workflow-index button {
    flex: 1;
    justify-content: center;
    padding: 0 5px;
    font-size: 7px;
  }

  .toolbar-left,
  #app.focus-mode .toolbar-left {
    display: block;
    padding: 20px 14px;
  }

  .toolbar-top {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .toolbar-section + .toolbar-section {
    padding: 20px 0 0;
    border-top: 1px solid rgba(17,18,15,.2);
    border-left: 0;
  }

  .canvas-workspace {
    min-height: 590px;
  }

  #drop-zone {
    height: 330px;
  }

  .canvas-transport {
    grid-template-columns: 1fr;
  }

  .canvas-transport .btn-toggle {
    min-height: 34px;
  }

  #workspace-canvas,
  #split-overlay-canvas,
  #anatomy-overlay-canvas {
    max-width: calc(100% - 24px);
    max-height: calc(100% - 160px);
  }

  .panel-right,
  #app.focus-mode .panel-right {
    padding: 18px 14px 28px;
  }

  .reference-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .candidate-board:has(.candidate-card) {
    display: flex;
  }

  .candidate-title-group {
    flex-direction: row;
  }

  .anatomy-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .anatomy-metrics div:nth-child(3) {
    border-left: 1px solid var(--ink);
  }

  .anatomy-metrics div:nth-child(n+3) {
    border-top: 0;
  }

  .app-footer {
    padding: 0 10px;
  }
}

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

/* ═══════════════════════════════════════════════════════════════
   Soft Cinema refinement
   Keep the editorial interaction model, soften the visual voice.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #eceae4;
  --surface: #fbfaf7;
  --surface-alt: #f1efe9;
  --border: #d5d1c8;
  --border-light: rgba(45, 43, 38, 0.1);
  --text: #25241f;
  --text-secondary: #77746c;
  --text-hint: #9d9990;
  --accent: #657f74;
  --accent-hover: #4f6c61;
  --accent-light: rgba(101, 127, 116, 0.09);
  --accent-medium: rgba(101, 127, 116, 0.17);
  --acid: #dfe9df;
  --coral: #bd755f;
  --ink: #1c1d1a;
  --paper: #f8f6f1;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(31, 30, 27, 0.04), 0 10px 30px rgba(31, 30, 27, 0.04);
  --shadow-hover: 0 16px 42px rgba(31, 30, 27, 0.1);
}

html {
  background: var(--paper);
}

body.editorial-lab,
#app {
  background: var(--paper);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline-color: rgba(101, 127, 116, 0.75);
}

.skip-link {
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
}

/* Quiet masthead */

.app-header {
  border-bottom-color: var(--border);
  background: rgba(248, 246, 241, 0.96);
}

.brand-code {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-secondary);
}

.app-header .brand-lockup h1 {
  letter-spacing: -0.055em;
}

.header-statement {
  border-left-color: var(--border);
}

.header-statement > span,
.header-edition span {
  color: var(--text-hint);
}

.header-edition strong {
  color: var(--accent-hover);
}

/* Workflow navigation should guide, not shout. */

.app-desc {
  min-height: 48px;
  border-bottom-color: var(--border);
  background: #eae7df;
}

.workflow-index {
  gap: 5px;
  padding: 6px 0;
}

.workflow-index button,
.workflow-index button:last-child {
  border: 0;
  border-radius: 9px;
  color: var(--text-secondary);
}

.workflow-index button:hover {
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
}

.workflow-index button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(30, 29, 26, 0.04), 0 5px 16px rgba(30, 29, 26, 0.05);
}

.workflow-index button.active span {
  color: var(--accent-hover);
  opacity: 1;
}

.app-desc .app-desc-body {
  color: var(--text-hint);
}

.focus-mode-btn {
  min-height: 31px;
  border-color: rgba(37, 36, 31, 0.2);
  border-radius: 999px;
  color: var(--text-secondary);
}

.focus-mode-btn kbd {
  border-left-color: rgba(37, 36, 31, 0.15);
}

.focus-mode-btn:hover,
.focus-mode-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Softer application surfaces */

.app-main {
  gap: 1px;
  background: var(--border);
}

.toolbar-left,
.panel-right {
  border-color: var(--border);
  background: var(--surface);
}

.toolbar-left {
  background: #f2f0ea;
}

.rail-heading,
.panel-heading {
  border-bottom-color: var(--border);
}

.toolbar-section + .toolbar-section {
  border-color: var(--border);
}

.btn-primary,
.btn-secondary,
.btn-toggle {
  border-radius: 10px;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 7px 18px rgba(79, 108, 97, 0.14);
}

.btn-primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  box-shadow: 0 9px 24px rgba(79, 108, 97, 0.2);
}

.btn-secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.34);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
}

.smart-mode-card {
  border-color: var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.rail-note {
  border-top-color: var(--border);
}

/* The image remains the visual anchor, with gentler framing. */

.canvas-workspace {
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    #20211f;
  background-size: 56px 56px;
}

.canvas-workspace::before {
  background: radial-gradient(circle at 50% 46%, rgba(255,255,255,.055), transparent 46%);
}

#drop-zone {
  border-color: rgba(248, 246, 241, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

#drop-zone::before,
#drop-zone::after {
  display: none;
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: rgba(205, 221, 211, 0.8);
  background: rgba(205, 221, 211, 0.055);
}

.drop-icon,
.drop-index {
  color: #cddbd2;
}

#workspace-canvas,
#split-overlay-canvas,
#anatomy-overlay-canvas {
  border-radius: 12px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.32);
}

.canvas-transport {
  border-color: rgba(248, 246, 241, 0.14);
  border-radius: 16px;
  background: rgba(34, 35, 32, 0.84);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.transport-heading .slider-value {
  color: #cddbd2;
}

.canvas-transport input[type="range"]::-webkit-slider-thumb {
  border-color: #20211f;
  background: #d7e2db;
  box-shadow: 0 0 0 1px rgba(215, 226, 219, 0.8);
}

.canvas-transport .btn-toggle {
  border-color: rgba(248, 246, 241, 0.22);
  border-radius: 10px;
}

.canvas-transport .btn-toggle:hover:not(:disabled) {
  border-color: #d7e2db;
  background: #d7e2db;
}

.toggle-mark {
  border-radius: 4px;
}

.processing-spinner {
  border-color: rgba(215, 226, 219, 0.4);
  border-radius: 14px;
  background: rgba(32, 33, 31, 0.9);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.25);
}

.spinner-ring {
  border-top-color: #cddbd2;
}

/* Reference library */

.reference-drawer {
  border-bottom-color: var(--border);
}

.reference-drawer summary {
  padding: 0 4px;
  border-radius: 8px;
}

.reference-drawer summary:hover {
  background: var(--surface-alt);
}

.reference-drawer summary small::after {
  color: var(--text-secondary);
}

.ref-thumb {
  border-radius: 10px;
}

.ref-thumb:hover {
  border-color: rgba(101, 127, 116, 0.52);
  box-shadow: 0 8px 20px rgba(37, 36, 31, 0.1);
}

.ref-thumb.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(101, 127, 116, 0.56);
}

/* The two modes read like a calm segmented control. */

.panel-mode-tabs {
  gap: 4px;
  padding: 4px;
  border-color: transparent;
  border-radius: 13px;
  background: var(--surface-alt);
}

.panel-mode-tab,
.panel-mode-tab + .panel-mode-tab {
  border: 0;
  border-radius: 9px;
}

.panel-mode-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(37, 36, 31, 0.04), 0 5px 16px rgba(37, 36, 31, 0.06);
}

/* Candidate cards: fewer outlines, clearer spatial hierarchy. */

.candidate-recommendation {
  border-color: rgba(101, 127, 116, 0.2);
  border-radius: 16px;
  background: #e7eee8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

#candidate-recommendation-confidence {
  border-radius: 999px;
  background: rgba(101, 127, 116, 0.14);
  color: var(--accent-hover);
}

.candidate-scene-tags span {
  border-color: rgba(79, 108, 97, 0.16);
  border-radius: 999px;
}

.candidate-empty {
  border-color: var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
}

.candidate-card {
  overflow: hidden;
  border-color: rgba(45, 43, 38, 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.candidate-card::before {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(248, 246, 241, 0.84);
  backdrop-filter: blur(8px);
}

.candidate-card:hover {
  box-shadow: var(--shadow-hover);
}

.candidate-card.recommended {
  border-color: rgba(101, 127, 116, 0.38);
  box-shadow: 0 0 0 1px rgba(101, 127, 116, 0.12), 0 14px 34px rgba(44, 61, 54, 0.08);
}

.candidate-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(101, 127, 116, 0.16), 0 16px 38px rgba(44, 61, 54, 0.12);
}

.candidate-badge {
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-hover);
}

.candidate-strength {
  border-color: var(--border-light);
  border-radius: 9px;
  background: var(--surface-alt);
}

.candidate-metric-track,
.candidate-metric-fill {
  border-radius: 999px;
}

.candidate-apply {
  border-color: var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
}

.candidate-apply:hover {
  background: var(--accent-hover);
  color: #fff;
}

.candidate-card.active .candidate-apply {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.candidate-loading span {
  border-color: var(--border-light);
  border-radius: 16px;
  background: linear-gradient(90deg, #efede7 25%, #f8f7f3 50%, #efede7 75%);
  background-size: 200% 100%;
}

/* Color Anatomy: technical, but not clinical. */

.color-anatomy-live {
  border-color: rgba(101, 127, 116, 0.2);
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-hover);
}

.color-anatomy-summary {
  border-left-color: var(--accent);
  border-radius: 0 12px 12px 0;
}

.anatomy-source-tabs,
.component-tabs,
.scope-tabs {
  gap: 4px;
}

.anatomy-source-tabs button,
.component-tabs button,
.scope-tabs button,
.anatomy-source-tabs button + button,
.component-tabs button + button,
.scope-tabs button + button {
  border: 1px solid var(--border);
  border-radius: 999px;
}

.anatomy-source-tabs button.active,
.component-tabs button.active,
.scope-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.anatomy-metrics {
  gap: 6px;
}

.anatomy-metrics div,
.anatomy-metrics div + div {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--surface-alt);
}

.anatomy-block {
  border-color: var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.anatomy-block-heading {
  border-bottom-color: var(--border-light);
}

.reference-recipe-panel {
  border-color: rgba(169, 126, 54, 0.2);
  background: #f7f1e5;
  box-shadow: 0 12px 34px rgba(118, 91, 45, 0.07);
}

.recipe-v2-title span,
.recipe-point-color,
.color-slice-controls button,
.waveform-mode-controls button,
.scope-legend button,
.color-recipe-layer {
  border-radius: 9px;
}

#color-component-map,
#color-scope-canvas,
#recipe-tone-curve {
  border-radius: 11px;
}

.scope-legend button,
.recipe-layer-toggle {
  border-radius: 999px;
}

.color-recipe-layer {
  border-left-color: rgba(101, 127, 116, 0.65);
  background: var(--surface-alt);
}

/* Output dock */

.app-footer {
  border-top-color: var(--border);
  background: var(--surface);
}

.download-menu {
  overflow: hidden;
  border-color: var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(31, 30, 27, 0.15);
}

.download-menu-item {
  border-radius: 8px;
}

.download-menu-item:hover {
  background: var(--accent-light);
}

.toast {
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #2a2c29;
  box-shadow: 0 12px 36px rgba(20, 21, 19, 0.22);
}

::selection {
  background: rgba(101, 127, 116, 0.32);
  color: var(--text);
}

@media (max-width: 920px) {
  .toolbar-left,
  .panel-right,
  #app.focus-mode .toolbar-left,
  #app.focus-mode .panel-right {
    border-bottom-color: var(--border);
  }
}

/* Warm studio palette — the opening's ember tones move forward while
   a restrained smoke-blue remains as a quiet counterpoint. */

:root {
  --bg: #eee9e1;
  --surface: #fcf9f3;
  --surface-alt: #f1ebe2;
  --border: #ddd3c7;
  --border-light: rgba(73, 55, 43, 0.1);
  --text: #342d28;
  --text-secondary: #7d7269;
  --text-hint: #aaa097;
  --accent: #a96d53;
  --accent-hover: #8d5742;
  --accent-light: rgba(169, 109, 83, 0.1);
  --accent-medium: rgba(169, 109, 83, 0.18);
  --acid: #efe2d5;
  --coral: #bd7048;
  --ink: #302923;
  --paper: #f7f2e9;
  --cool: #6f8083;
}

.app-header {
  background: rgba(248, 243, 235, 0.97);
}

.brand-code {
  border-color: #ccd7d8;
  background: #e4ebeb;
  color: #55717d;
}

.header-edition strong,
.smart-mode-kicker,
.rail-note > span {
  color: var(--coral);
}

.app-desc {
  background: linear-gradient(90deg, #ece4d9 0%, #f1eae1 56%, #eadfd5 100%);
}

.workflow-index button.active span {
  color: var(--cool);
}

.toolbar-left {
  background: #f0e9df;
}

.panel-right {
  background: #fbf7f0;
}

.canvas-workspace {
  background:
    linear-gradient(rgba(230,207,188,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,207,188,.022) 1px, transparent 1px),
    #292521;
  background-size: 56px 56px;
}

.canvas-workspace::before {
  background: radial-gradient(circle at 50% 46%, rgba(188, 142, 112, 0.1), transparent 48%);
}

#drop-zone {
  border-color: rgba(226, 204, 187, 0.27);
  background: rgba(169, 109, 83, 0.035);
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: rgba(222, 190, 168, 0.72);
  background: rgba(169, 109, 83, 0.075);
}

.drop-icon,
.drop-index,
.transport-heading .slider-value {
  color: #dec1ad;
}

.canvas-transport {
  border-color: rgba(229, 207, 190, 0.15);
  background: rgba(43, 37, 32, 0.9);
}

.canvas-transport input[type="range"]::-webkit-slider-thumb {
  border-color: #292521;
  background: #d99a72;
  box-shadow: 0 0 0 1px rgba(217, 154, 114, 0.76);
}

.canvas-transport .btn-toggle:hover:not(:disabled) {
  border-color: #e2c8b6;
  background: #e2c8b6;
}

.candidate-recommendation {
  border-color: rgba(169, 109, 83, 0.2);
  background: #f2e2d6;
}

.candidate-recommendation::before,
.candidate-score,
.candidate-insight.has-risk {
  color: var(--coral);
}

#candidate-recommendation-confidence {
  background: rgba(169, 109, 83, 0.12);
  color: #8d5742;
}

.candidate-card.recommended {
  border-color: rgba(169, 109, 83, 0.38);
  box-shadow: 0 0 0 1px rgba(169, 109, 83, 0.09), 0 14px 34px rgba(104, 67, 49, 0.09);
}

.candidate-card.recommended .candidate-badge {
  background: rgba(169, 109, 83, 0.11);
  color: #8d5742;
}

.reference-recipe-panel {
  border-color: rgba(169, 109, 83, 0.17);
  background: #f5e9dc;
  box-shadow: 0 12px 34px rgba(104, 67, 49, 0.06);
}

.footer-status i {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(169, 109, 83, 0.1);
}

.panel-mode-tab.active {
  background: #fffaf3;
  color: var(--accent-hover);
}

.reference-drawer summary:hover,
.candidate-strength,
.anatomy-metrics div,
.color-recipe-layer {
  background: #f2ebe1;
}

#color-scope-canvas,
#recipe-tone-curve {
  background: #24211e;
}

.waveform-mode-controls button {
  border-color: rgba(231, 208, 190, 0.08);
  background: #302b27;
  color: #a69b92;
}

.waveform-mode-controls button.active {
  border-color: rgba(194, 132, 94, 0.4);
  background: #43352c;
  color: #e4c3ae;
}

.download-menu,
.candidate-card,
.anatomy-block {
  background: #fcf9f3;
}

.toast {
  background: #382f29;
}

::selection {
  background: rgba(169, 109, 83, 0.28);
  color: var(--text);
}

/* Quiet workspace — information appears only when it helps the next action. */

.app-header {
  grid-template-columns: 1fr auto;
  gap: 18px;
  height: 62px;
  padding: 8px 18px;
}

.brand-lockup {
  display: block;
}

.app-header .brand-lockup h1 {
  font-size: clamp(28px, 2.5vw, 37px);
}

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

#reopen-intro-btn {
  margin: 0;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
}

#reopen-intro-btn:hover {
  background: var(--accent-light);
}

.app-desc {
  grid-template-columns: 1fr auto;
  min-height: 42px;
  padding: 0 18px;
}

.workflow-index {
  width: fit-content;
}

.workflow-index button {
  min-width: 78px;
  justify-content: center;
  padding: 0 15px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .02em;
}

.focus-mode-btn {
  padding-left: 11px;
}

.toolbar-left {
  gap: 22px;
}

.rail-heading {
  padding-bottom: 11px;
}

.rail-heading strong {
  font: 500 18px/1 var(--font-ui);
  letter-spacing: -.02em;
}

.toolbar-top {
  gap: 22px;
}

.toolbar-label {
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .02em;
  text-transform: none;
}

.btn-text {
  font-family: var(--font-ui);
  letter-spacing: 0;
}

.drop-zone-content {
  gap: 10px;
}

.drop-zone-content p {
  font-size: clamp(25px, 2.6vw, 36px);
}

.drop-hint {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .03em;
}

.processing-copy strong {
  font-size: 12px;
}

.transport-heading span,
.canvas-transport .slider-labels {
  font-family: var(--font-ui);
  letter-spacing: .02em;
}

.panel-right {
  padding-top: 16px;
}

.reference-drawer summary {
  min-height: 38px;
}

.reference-drawer summary span {
  font-size: 11px;
}

.reference-drawer summary::after {
  color: var(--text-hint);
  content: "+";
  font: 500 14px var(--font-ui);
}

.reference-drawer[open] summary::after {
  content: "−";
}

.panel-mode-tabs {
  margin-bottom: 12px;
}

.panel-mode-tab {
  min-height: 35px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0;
}

.candidate-section-heading {
  justify-content: flex-end;
  min-height: 18px;
}

.candidate-refresh {
  font-family: var(--font-ui);
  font-size: 10px;
}

.candidate-status {
  margin: -13px 45px 11px 0;
  font-size: 9px;
}

.candidate-status.hidden {
  display: none;
}

.candidate-recommendation::before {
  display: none;
}

.candidate-actions {
  justify-content: flex-end;
}

.candidate-evidence summary {
  font-family: var(--font-ui);
}

.color-anatomy-heading h3 {
  margin: 0;
  font: 500 18px/1.1 var(--font-ui);
  letter-spacing: -.02em;
}

.color-anatomy-summary {
  font-size: 9px;
}

.recipe-v2-title {
  gap: 0;
}

.app-footer {
  justify-content: flex-end;
  height: 44px;
  padding: 0 14px;
}

.footer-actions {
  margin-left: 0;
}

@media (max-width: 920px) {
  .app-header {
    grid-template-columns: 1fr auto;
    height: 62px;
  }

  .app-desc {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 640px) {
  .workflow-index button {
    min-width: 0;
  }

  .header-actions {
    display: flex;
  }

  #reopen-intro-btn {
    display: block;
  }
}
