@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  --bg-canvas: #ebedf2;
  --bg-panel: #ffffff;
  --bg-subtle: #f4f5f8;
  --bg-dark: #13161d;
  --bg-dark-2: #1d222d;
  --ink-primary: #14171f;
  --ink-secondary: #4a5162;
  --ink-muted: #7b8396;
  --border-line: #d7dce6;
  --border-strong: #b8c0d0;
  --accent: #e04f2e;
  --accent-hover: #c63f20;
  --accent-soft: rgba(224, 79, 46, 0.1);
  --blue-tech: #2563eb;
  --green-ok: #10b981;
  --amber-warn: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 2px 10px rgba(19, 22, 29, 0.05);
  --shadow-float: 0 14px 36px rgba(19, 22, 29, 0.16);
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html,
body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--ink-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* === TOP STUDIO HEADER === */
.studio-topbar {
  height: 58px;
  background: var(--bg-dark);
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #282e3d;
  z-index: 40;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
}

.rust-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  background: #1f2430;
  border: 1px solid #32394a;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.project-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-select {
  background: #1e2330;
  color: #f3f4f6;
  border: 1px solid #343c4f;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  min-width: 230px;
  outline: none;
}

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

.api-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #1e2432;
  border: 1px solid #323a4e;
  color: #f3f4f6;
  cursor: pointer;
  transition: 0.15s ease;
}

.api-status-pill:hover {
  border-color: #6b7280;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber-warn);
}

.status-dot.connected {
  background: var(--green-ok);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
}

/* === MAIN APP SHELL === */
.studio-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 58px);
}

/* === LEFT PIPELINE SIDEBAR === */
.pipeline-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  padding: 15px 13px;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 9px;
  padding: 0 6px;
}

.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.step-nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 11px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.15s ease;
}

.step-nav-btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-line);
}

.step-nav-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
  box-shadow: var(--shadow-card);
}

.step-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  flex-shrink: 0;
  margin-top: 1px;
}

.step-nav-btn.active .step-num {
  background: var(--accent);
  color: #ffffff;
}

.step-nav-btn.done:not(.active) .step-num {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.step-meta {
  flex: 1;
}

.step-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.step-desc {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.step-nav-btn.active .step-desc {
  color: #9ca3af;
}

.confirmed-mini-card {
  margin-top: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 10px;
}

.confirmed-mini-card img {
  width: 100%;
  height: 108px;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
  margin: 6px 0;
}

.vault-counter-btn {
  width: 100%;
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: var(--bg-panel);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vault-counter-btn:hover {
  border-color: var(--ink-primary);
}

/* === WORKSPACE CONTENT AREA === */
.studio-workspace {
  overflow-y: auto;
  padding: 22px 26px 110px 26px;
  position: relative;
  background-image: radial-gradient(#cfd5e2 1px, transparent 1px);
  background-size: 22px 22px;
}

.workspace-container {
  max-width: 1380px;
  margin: 0 auto;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
}

.stage-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stage-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stage-subtitle {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-top: 4px;
  line-height: 1.45;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-dark {
  background: var(--bg-dark);
  color: #ffffff;
}

.btn-dark:hover:not(:disabled) {
  background: #272d3d;
}

.btn-outline {
  background: var(--bg-panel);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--ink-primary);
  background: var(--bg-subtle);
}

.btn-ghost-dark {
  background: #1f2432;
  color: #e5e7eb;
  border-color: #343c4f;
  padding: 7px 12px;
  font-size: 12px;
}

.btn-ghost-dark:hover {
  background: #2b3245;
}

.btn-lg {
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
}

/* === CARDS & PANELS === */
.panel-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-title {
  font-size: 15.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  color: var(--ink-secondary);
}

/* === STAGE 1: VISUAL CATEGORY CARDS & VISUAL MOOD PRESET CARDS === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.cat-card {
  background: var(--bg-panel);
  border: 2px solid var(--border-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex;
  flex-direction: column;
}

.cat-card:hover {
  border-color: #8c96ab;
  transform: translateY(-2px);
}

.cat-card.selected {
  border-color: var(--accent);
  background: #fffaf8;
  box-shadow: 0 6px 20px rgba(224, 79, 46, 0.14);
}

.cat-thumb-wrap {
  position: relative;
  height: 158px;
  background: #eaecf0;
  overflow: hidden;
  border-bottom: 1px solid var(--border-line);
}

.cat-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.cat-card:hover .cat-thumb-wrap img {
  transform: scale(1.03);
}

.cat-check-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(19, 22, 29, 0.8);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
}

.cat-card.selected .cat-check-badge {
  background: var(--accent);
}

.cat-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.cat-en {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.cat-ko {
  font-size: 16.5px;
  font-weight: 800;
  margin: 3px 0 5px;
}

.cat-sub {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.cat-specs {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--border-line);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

/* Visual Moodboard Cards */
.mood-preset-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 12px 0 16px;
}

.mood-card {
  border: 2px solid var(--border-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.mood-card:hover {
  border-color: #8c96ab;
  transform: translateY(-2px);
}

.mood-card.selected {
  border-color: var(--accent);
  background: #fff9f7;
  box-shadow: 0 4px 14px rgba(224, 79, 46, 0.14);
}

.mood-thumb {
  width: 100%;
  height: 98px;
  object-fit: cover;
  background: #e5e7eb;
  border-bottom: 1px solid var(--border-line);
}

.mood-card-body {
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.mood-title {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.3;
}

.mood-sub {
  font-size: 11px;
  color: var(--ink-secondary);
  line-height: 1.35;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.chip-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: 0.14s;
}

.chip-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff5f2;
}

.text-input,
.select-input,
.textarea-input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: #ffffff;
  color: var(--ink-primary);
  outline: none;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* === STAGE 2: HYBRID LINEAGE CANVAS & DESIGN CARDS === */
.view-mode-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented-tabs {
  display: inline-flex;
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
}

.seg-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
}

/* Lineage Node Tree Canvas (Infinite horizontal scroll workbench) */
.lineage-workbench {
  background: #e3e6ee;
  background-image:
    linear-gradient(to right, rgba(20, 23, 31, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 23, 31, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  min-height: 540px;
}

.lineage-canvas-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 88px;
  min-width: max-content;
  padding-bottom: 12px;
}

.lineage-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.gen-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 300px;
  position: relative;
  z-index: 2;
}

.gen-col-header {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg-dark);
  color: #f9fafb;
  padding: 7px 12px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 18px;
}

.design-card {
  background: var(--bg-panel);
  border: 2px solid var(--border-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.16s ease;
  display: flex;
  flex-direction: column;
}

.design-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 8px 24px rgba(19, 22, 29, 0.09);
}

.design-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 79, 46, 0.18);
}

.design-card.confirmed {
  border-color: var(--green-ok);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eaecf0;
  overflow: hidden;
}

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

.card-top-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.gen-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(19, 22, 29, 0.84);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}

.card-icon-actions {
  display: flex;
  gap: 5px;
}

.icon-pill-btn {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: var(--ink-primary);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.icon-pill-btn.saved {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.select-overlay-btn {
  position: absolute;
  bottom: 10px;
  left: 10px;
  border: 1.5px solid rgba(19, 22, 29, 0.2);
  background: rgba(255, 255, 255, 0.94);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.design-card.selected .select-overlay-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.card-body {
  padding: 14px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.3;
}

.swatch-row {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.swatch-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: inline-block;
}

.card-summary {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  padding: 2px 7px;
  border-radius: 4px;
}

.card-footer-btns {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  gap: 7px;
}

.card-footer-btns .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
}

/* === PREFERENCE DNA & EVOLUTION FLOATING DOCK === */
.preference-dna-box {
  background: #161a23;
  color: #f3f4f6;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 1px solid #2e3648;
}

.dna-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.dna-cell {
  background: #1f2533;
  border: 1px solid #313a4f;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.dna-cell-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.dna-cell-val {
  font-size: 12.5px;
  line-height: 1.4;
  color: #e5e7eb;
}

.evolution-dock {
  position: sticky;
  bottom: 16px;
  z-index: 30;
  background: rgba(19, 22, 29, 0.96);
  backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid #363f54;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-float);
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dock-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dock-input {
  flex: 1;
  min-width: 240px;
  background: #232938;
  border: 1px solid #3b445c;
  color: #ffffff;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.dock-input:focus {
  border-color: var(--accent);
}

/* === STAGE 3: VISUAL MATERIAL CARDS, PHYSICS RADAR & 4-VARIATION STUDIO === */
.eng-top-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-shoe-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: #eaecf0;
  border: 1px solid var(--border-line);
}

.colorway-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.3fr;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.color-picker-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
}

.color-picker-chip input[type="color"] {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
}

.kpi-4-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-mini-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.kpi-mini-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
}

.kpi-mini-val {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  margin-top: 3px;
  color: var(--ink-primary);
}

.radar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.part-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.part-tab-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-line);
  background: var(--bg-subtle);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: 0.15s;
}

.part-tab-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

/* Visual Option Cards with Reference Thumbnail */
.option-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.mat-option-card {
  border: 2px solid var(--border-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.mat-option-card:hover {
  border-color: #8c96ab;
  transform: translateY(-1px);
}

.mat-option-card.selected {
  border-color: var(--accent);
  background: #fff9f7;
  box-shadow: 0 4px 14px rgba(224, 79, 46, 0.12);
}

.mat-thumb-wrap {
  position: relative;
  height: 122px;
  background: #e7eaf0;
  overflow: hidden;
  border-bottom: 1px solid var(--border-line);
}

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

.mat-zoom-btn {
  position: absolute;
  bottom: 7px;
  right: 7px;
  background: rgba(19, 22, 29, 0.78);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  cursor: pointer;
}

.mat-zoom-btn:hover {
  background: var(--accent);
}

.mat-selected-pill {
  position: absolute;
  top: 7px;
  left: 7px;
  background: var(--accent);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.mat-card-inner {
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mat-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.mat-name {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.3;
}

.mat-cost-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.mat-desc {
  font-size: 12px;
  color: var(--ink-secondary);
  margin: 6px 0 9px;
  line-height: 1.42;
  flex: 1;
}

.mat-meta-line {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  padding-top: 7px;
  border-top: 1px dashed var(--border-line);
}

/* Stage 3: Baseline Spec 01 + AI Design Variations 02..04 Grid */
.variation-studio-banner {
  background: linear-gradient(135deg, #161a24 0%, #22293a 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
  border: 1px solid #313a4f;
}

.variation-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.variation-card {
  background: #ffffff;
  color: var(--ink-primary);
  border: 2.5px solid #333c52;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.16s ease;
}

.variation-card.active-master {
  border-color: var(--green-ok);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.variation-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eaecf0;
  overflow: hidden;
}

.variation-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.variation-slot-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(19, 22, 29, 0.88);
  color: #ffffff;
}

.variation-slot-badge.ai-creative {
  background: var(--accent);
}

.variation-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.variation-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.variation-proposal {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.45;
  flex: 1;
}

.usp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.usp-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.usp-part {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
}

.usp-head {
  font-size: 14.5px;
  font-weight: 800;
  margin: 5px 0 7px;
}

.usp-tech {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.45;
  margin-bottom: 6px;
}

.usp-benefit {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

/* === STAGE 4: MULTI-ANGLE 6-VIEW STUDIO & GTSGLOBAL WORK ORDER (작업지시서) === */
.angle-preset-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.angle-preset-card {
  border: 2px solid var(--border-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  transition: 0.15s ease;
}

.angle-preset-card.selected {
  border-color: var(--accent);
  background: #fff9f7;
}

.angle-preset-card img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  background: #eaecf0;
  border-bottom: 1px solid var(--border-line);
}

.angle-preset-meta {
  padding: 8px 9px;
}

.multiview-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.multiview-card {
  background: var(--bg-panel);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.multiview-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef0f4;
  cursor: zoom-in;
  border-bottom: 1px solid var(--border-line);
}

.multiview-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* GTSGLOBAL Factory Work Order / Techpack Sheet */
.workorder-sheet {
  background: #ffffff;
  border: 2px solid #181b22;
  border-radius: 6px;
  padding: 24px;
  color: #14171f;
}

.wo-top-banner {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border-bottom: 2px solid #181b22;
  padding-bottom: 14px;
  margin-bottom: 16px;
  gap: 16px;
}

.wo-signoff-table {
  border-collapse: collapse;
  font-size: 11px;
  text-align: center;
}

.wo-signoff-table th,
.wo-signoff-table td {
  border: 1px solid #181b22;
  padding: 4px 12px;
}

.wo-signoff-table th {
  background: #f3f4f6;
  font-weight: 700;
}

.wo-signoff-table td {
  height: 36px;
  font-family: var(--font-mono);
  color: #059669;
  font-weight: 700;
}

.wo-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid #181b22;
  margin-bottom: 16px;
}

.wo-meta-cell {
  border: 0.5px solid #cbd5e1;
  padding: 8px 10px;
  font-size: 12px;
}

.wo-meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 2px;
}

.wo-meta-val {
  font-weight: 700;
  color: var(--ink-primary);
}

.wo-ortho-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.wo-ortho-cell {
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  overflow: hidden;
  background: #f8fafc;
}

.wo-ortho-cell img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.wo-ortho-caption {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 4px;
  border-top: 1px solid var(--border-line);
  background: #ffffff;
}

.wo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}

.wo-table th {
  background: #181b22;
  color: #ffffff;
  text-align: left;
  padding: 8px 9px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.wo-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 9px;
  vertical-align: top;
  line-height: 1.45;
}

.wo-grading-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: var(--font-mono);
  text-align: center;
  margin-bottom: 16px;
}

.wo-grading-table th {
  background: #f1f5f9;
  border: 1px solid #94a3b8;
  padding: 6px 8px;
  font-weight: 700;
}

.wo-grading-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
}

.wo-grading-table tr.base-row {
  background: #fff7ed;
  font-weight: 700;
}

/* === STAGE 5: BOM TABLE, PRICING SLIDERS & MARKETING === */
.pricing-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.price-kpi-card {
  background: var(--bg-dark);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 15px 16px;
}

.price-kpi-card.highlight {
  background: linear-gradient(135deg, #e04f2e, #b93316);
}

.price-kpi-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.72);
}

.price-kpi-val {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 800;
  margin-top: 5px;
}

.price-kpi-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
}

.bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bom-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  border-bottom: 1.5px solid var(--border-strong);
  padding: 9px 10px;
}

.bom-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-line);
  vertical-align: middle;
}

.share-bar-track {
  width: 90px;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 99px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.share-bar-fill {
  height: 100%;
  background: var(--accent);
}

.story-hero-banner {
  background: linear-gradient(135deg, #151922 0%, #242b3b 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 18px;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.persona-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

/* === STAGE 6: VISUAL EDITORIAL LOOKBOOK STUDIO === */
.editorial-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.ed-preset-card {
  border: 2px solid var(--border-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  transition: 0.15s ease;
}

.ed-preset-card.selected {
  border-color: var(--accent);
  background: #fff9f7;
}

.ed-preset-thumb {
  width: 100%;
  height: 118px;
  object-fit: cover;
  background: #1f2430;
  border-bottom: 1px solid var(--border-line);
}

.ed-preset-body {
  padding: 11px 13px;
}

.editorial-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 18px;
}

.editorial-shot-card {
  background: var(--bg-dark);
  color: #f9fafb;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.editorial-shot-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.editorial-shot-meta {
  padding: 15px 18px;
}

/* === MODALS & OVERLAYS === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 15, 22, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-box {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-float);
}

.modal-box.wide {
  max-width: 1120px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 5px;
}

.form-help {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.loading-banner {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 90;
  background: var(--bg-dark);
  color: #ffffff;
  border: 1px solid var(--accent);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  font-weight: 600;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  background: #14171f;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-float);
  border-left: 4px solid var(--accent);
}

@media (max-width: 1160px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }
  .pipeline-sidebar {
    display: none;
  }
  .category-grid,
  .mood-preset-grid,
  .variation-grid,
  .angle-preset-grid,
  .multiview-gallery,
  .eng-top-grid,
  .pricing-kpi-strip,
  .editorial-preset-grid,
  .dna-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  .studio-topbar,
  .pipeline-sidebar,
  .no-print {
    display: none !important;
  }
  html,
  body,
  .studio-shell,
  .studio-workspace {
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    padding: 0 !important;
  }
  /* When a modal (Work Order print modal or Master Deck modal) is open, print ONLY the modal cleanly */
  body.modal-print-open .studio-shell {
    display: none !important;
  }
  .modal-backdrop {
    position: static !important;
    background: #ffffff !important;
    padding: 0 !important;
    display: block !important;
  }
  .modal-box.wide {
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    padding: 8px !important;
  }
}
