:root {
  --bg: #07110f;
  --panel: rgba(12, 22, 20, 0.72);
  --panel-strong: rgba(19, 32, 29, 0.82);
  --stroke: rgba(144, 196, 182, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --text-soft: rgba(214, 231, 227, 0.64);
  --primary: #37e6c3;
  --primary-soft: #73f0d2;
  --warm: #c78b52;
  --danger: #ff8a5b;
  --violet: #6b72ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 28%, rgba(55, 230, 195, 0.15), transparent 34%),
    radial-gradient(circle at 20% 20%, rgba(115, 240, 210, 0.07), transparent 28%),
    linear-gradient(180deg, #081311 0%, #060d0c 100%);
  color: var(--text);
  font-family: "Plus Jakarta Sans", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(115, 240, 210, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 240, 210, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  mask-image: radial-gradient(circle at center, black 45%, transparent 92%);
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 16px;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(19, 32, 29, 0.86), rgba(10, 18, 17, 0.74));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.glass-panel::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.03), transparent 50%);
  content: "";
  pointer-events: none;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  min-height: 104px;
  padding: 18px 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(115, 240, 210, 0.1), transparent 27%),
    linear-gradient(180deg, rgba(18, 31, 28, 0.86), rgba(7, 14, 13, 0.82));
}

.topbar-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.topbar h1,
.stage-copy h2,
.panel-heading h2,
.card-header h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

.topbar h1 {
  font-size: clamp(1.12rem, 1.65vw, 1.58rem);
  line-height: 0.98;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-soft);
  font-size: 0.54rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.topbar-meta,
.dock-actions,
.progress-copy,
.card-header,
.toggle-row,
.texture-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-meta {
  position: relative;
  z-index: 1;
  justify-self: end;
  gap: 10px;
  align-items: center;
}

.topbar-button {
  align-self: center;
}

.topbar-mark {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-self: center;
  padding: 7px 20px 8px;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0.12em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.topbar-mark span,
.topbar-mark strong {
  display: block;
}

.topbar-mark strong {
  font-weight: 800;
}

.status-pill,
.ghost-button,
.secondary-button,
.outline-button,
.preset-chip,
select,
.number-input {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.88rem;
}

.status-pill,
.ghost-button,
.secondary-button,
.primary-button,
.outline-button,
.preset-chip {
  padding: 9px 13px;
}

.ghost-button,
.secondary-button,
.outline-button,
.preset-chip,
.segmented button,
.toggle {
  cursor: pointer;
  transition: 180ms ease;
}

.ghost-button:hover,
.secondary-button:hover,
.outline-button:hover,
.preset-chip:hover,
.segmented button:hover {
  border-color: rgba(115, 240, 210, 0.36);
  background: rgba(115, 240, 210, 0.08);
}

.workspace-grid {
  display: block;
  min-height: calc(100vh - 110px);
  margin-top: 16px;
}

.left-rail,
.control-card {
  padding: 16px;
}

.pipeline-list {
  display: grid;
  gap: 5px;
  padding: 0;
  margin: 8px 0 8px;
  list-style: none;
}

.pipeline-item {
  position: relative;
  padding: 6px 8px 6px 26px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.pipeline-item::before {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.02);
  content: "";
  transform: translateY(-50%);
}

.pipeline-item.is-active::before,
.pipeline-item.is-done::before {
  background: var(--primary);
  box-shadow: 0 0 20px rgba(55, 230, 195, 0.55);
}

.pipeline-item.is-error::before {
  background: var(--danger);
  box-shadow: 0 0 20px rgba(255, 138, 91, 0.45);
}

.pipeline-item span,
.mini-stat span,
.stage-copy p,
.hint,
.dock-stat span,
.upload-card p,
.control-row small,
.segmented-wrap small {
  color: var(--text-soft);
}

.panel-heading h2 {
  font-size: 0.74rem;
  font-weight: 600;
}

.pipeline-item strong {
  display: block;
  font-size: 0.6rem;
  line-height: 1.2;
  font-weight: 600;
}

.pipeline-item span {
  font-size: 0.48rem;
  line-height: 1.15;
}

.card-header h3 {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.rail-section {
  display: grid;
  gap: 5px;
}

.mini-stat {
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.mini-stat strong {
  font-size: 0.6rem;
  line-height: 1.2;
}

.mini-stat span {
  font-size: 0.46rem;
}

.stage-wrap {
  position: relative;
  min-height: calc(100vh - 110px);
  padding: 22px;
  isolation: isolate;
  overflow: hidden;
}

.stage-copy {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
  max-width: 26%;
}

.stage-copy h2 {
  font-size: clamp(0.82rem, 1vw, 0.96rem);
  line-height: 1.2;
}

.stage-copy p {
  max-width: 280px;
  margin: 4px 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
}

.stage-halo {
  position: absolute;
  inset: 12% 20% 18%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(55, 230, 195, 0.18), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

#stage-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 780px;
}

.viewer-mode-strip {
  position: absolute;
  left: 50%;
  top: calc(var(--bottom-dock-top, 100%) - 62px);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(9, 15, 14, 0.72);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.viewer-mode-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.24), transparent 48%),
    rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.viewer-mode-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viewer-mode-button circle {
  fill: currentColor;
  fill-opacity: 0.16;
}

.viewer-mode-button[data-display-mode="points"] circle {
  fill-opacity: 0.86;
  stroke: none;
}

.viewer-mode-button:hover {
  border-color: rgba(115, 240, 210, 0.3);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.28), transparent 48%),
    rgba(55, 230, 195, 0.12);
}

.viewer-mode-button.is-active {
  border-color: rgba(115, 240, 210, 0.38);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.32), transparent 48%),
    linear-gradient(180deg, rgba(88, 103, 255, 0.78), rgba(49, 208, 184, 0.42));
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(115, 240, 210, 0.16),
    0 0 18px rgba(107, 114, 255, 0.24);
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.upload-preview {
  overflow: hidden;
  width: 100%;
  min-height: 148px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  min-height: 148px;
  object-fit: cover;
}

textarea {
  font: inherit;
}

.progress-panel {
  position: absolute;
  left: 50%;
  top: calc(var(--bottom-dock-top, 100%) - 112px);
  z-index: 8;
  width: min(320px, calc(100% - 40px));
  padding: 8px 10px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(4, 8, 8, 0.62);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.progress-copy {
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 0.62rem;
  line-height: 1;
}

.progress-track {
  overflow: hidden;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(55, 230, 195, 0.25), rgba(55, 230, 195, 1), rgba(115, 240, 210, 0.45));
  box-shadow: 0 0 18px rgba(55, 230, 195, 0.35);
  transition: width 240ms ease;
}

#progress-step {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(214, 231, 227, 0.66);
}

#progress-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.floating-panel {
  position: absolute;
  z-index: 7;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.floating-panel::after {
  display: none;
}

.left-rail {
  top: 124px;
  left: 20px;
  width: 210px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(10, 18, 17, 0.54), rgba(7, 12, 11, 0.34));
  backdrop-filter: blur(14px);
}

.right-rail {
  top: 94px;
  right: 20px;
  width: 276px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 430px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  padding-bottom: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.right-rail::-webkit-scrollbar {
  display: none;
}

.control-card {
  display: grid;
  gap: 12px;
}

.card-header {
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.card-index {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(107, 114, 255, 0.42);
  border-radius: 999px;
  color: #c8ccff;
  font-size: 0.72rem;
}

.control-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
}

.control-row div span,
.segmented-wrap div span {
  display: block;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.82);
}

.control-row small,
.segmented-wrap small {
  margin-top: 3px;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(214, 231, 227, 0.46);
}

.number-input,
select {
  width: 100%;
  padding: 9px 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

select {
  appearance: none;
  padding-right: 34px;
  background-color: rgba(255, 255, 255, 0.045);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2373F0D2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 12px center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 rgba(55, 230, 195, 0);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.custom-select {
  position: relative;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 34px 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 rgba(55, 230, 195, 0);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2373F0D2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 180ms ease;
}

.custom-select.is-open .custom-select-trigger {
  border-color: rgba(115, 240, 210, 0.42);
  background-color: rgba(55, 230, 195, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 3px rgba(55, 230, 195, 0.08),
    0 0 20px rgba(55, 230, 195, 0.08);
}

.custom-select.is-open .custom-select-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(115, 240, 210, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(14, 24, 22, 0.96), rgba(8, 14, 13, 0.98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.custom-select-option {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.76rem;
  text-align: left;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.custom-select-option:hover {
  border-color: rgba(115, 240, 210, 0.18);
  background: rgba(55, 230, 195, 0.08);
  transform: translateY(-1px);
}

.custom-select-option.active {
  border-color: rgba(115, 240, 210, 0.24);
  background: linear-gradient(180deg, rgba(55, 230, 195, 0.14), rgba(55, 230, 195, 0.08));
  color: var(--primary-soft);
}

select:hover {
  border-color: rgba(115, 240, 210, 0.24);
  background-color: rgba(55, 230, 195, 0.065);
}

select:focus {
  outline: none;
  border-color: rgba(115, 240, 210, 0.42);
  background-color: rgba(55, 230, 195, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 3px rgba(55, 230, 195, 0.08),
    0 0 20px rgba(55, 230, 195, 0.08);
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(107, 114, 255, 0.9), rgba(255, 255, 255, 0.12));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(13, 17, 17, 0.95);
  border-radius: 50%;
  background: #6b72ff;
  box-shadow: 0 0 14px rgba(107, 114, 255, 0.9);
}

.segmented-wrap {
  display: grid;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.segmented button {
  padding: 8px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
}

.segmented button.active {
  background: linear-gradient(180deg, rgba(107, 114, 255, 0.95), rgba(85, 92, 234, 0.88));
  box-shadow: 0 0 18px rgba(107, 114, 255, 0.34);
}

.segmented-dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.segmented-dual button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.segmented-dual button.active {
  border-color: rgba(107, 114, 255, 0.75);
}

.dock-segmented {
  gap: 8px;
}

.dock-segmented button {
  min-height: 36px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.86);
}

.dock-segmented button.active {
  background: linear-gradient(180deg, rgba(107, 114, 255, 0.94), rgba(92, 98, 245, 0.84));
  box-shadow:
    0 0 0 1px rgba(107, 114, 255, 0.78),
    0 0 18px rgba(107, 114, 255, 0.28);
  color: #ffffff;
}

.toggle-row {
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

.toggle {
  position: relative;
  width: 40px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  content: "";
  transition: transform 180ms ease;
}

.toggle.active {
  background: linear-gradient(90deg, rgba(107, 114, 255, 0.96), rgba(120, 130, 255, 0.92));
  box-shadow: 0 0 18px rgba(107, 114, 255, 0.35);
}

.toggle.active::after {
  transform: translateX(16px);
}

.primary-button,
.secondary-button {
  width: 100%;
}

.primary-button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(55, 230, 195, 0.95), rgba(72, 174, 255, 0.82));
  color: #04110f;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: 0 12px 30px rgba(55, 230, 195, 0.28);
}

.secondary-button,
.outline-button,
.preset-chip,
.ghost-button {
  font-size: 0.78rem;
}

.hint {
  font-size: 0.66rem;
  line-height: 1.45;
}

.bottom-dock {
  position: absolute;
  right: 20px;
  left: 20px;
  top: var(--bottom-dock-top, auto);
  bottom: auto;
  z-index: 6;
  display: grid;
  grid-template-columns: 150px minmax(280px, 340px) minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(18, 27, 24, 0.7), rgba(9, 15, 14, 0.84));
  backdrop-filter: blur(26px);
}

.preset-column,
.dock-settings,
.prompt-card {
  display: grid;
  gap: 8px;
}

.preset-column {
  align-content: start;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dock-settings {
  grid-template-columns: 1fr;
  align-items: start;
  column-gap: 0;
}

.preset-list {
  display: grid;
  gap: 6px;
}

.preset-chip {
  text-align: left;
}

.preset-chip.active {
  border-color: rgba(55, 230, 195, 0.32);
  background: rgba(55, 230, 195, 0.12);
  color: var(--primary-soft);
}

.upload-card,
.prompt-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 140px;
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  transition: 180ms ease;
}

.prompt-card {
  border-style: solid;
  gap: 12px;
}

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

.prompt-card-copy strong {
  font-size: 0.78rem;
}

.runtime-key-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.runtime-key-field input {
  min-height: 38px;
  border-color: rgba(115, 240, 210, 0.18);
  background: rgba(115, 240, 210, 0.045);
}

.runtime-key-field input:focus {
  outline: none;
  border-color: rgba(115, 240, 210, 0.42);
  box-shadow: 0 0 0 3px rgba(115, 240, 210, 0.08);
}

.prompt-field {
  display: grid;
  gap: 6px;
}

.prompt-field span {
  color: rgba(214, 231, 227, 0.56);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-field textarea,
.prompt-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.prompt-field textarea {
  min-height: 156px;
  resize: vertical;
  line-height: 1.45;
}

.classifier-result {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.classifier-result-label {
  color: rgba(214, 231, 227, 0.56);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.classifier-result strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--primary-soft);
}

.classifier-result p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.upload-card .upload-preview {
  margin-top: 8px;
}

.upload-card.has-preview {
  padding: 0;
  border-style: solid;
  background: rgba(255, 255, 255, 0.02);
}

.upload-card.has-preview .upload-card-copy {
  display: none;
}

.upload-card.has-preview .upload-preview {
  margin-top: 0;
  min-height: 100%;
  border: 0;
  border-radius: 16px;
  box-shadow: none;
}

.upload-card:hover,
.upload-card.is-dragging,
.prompt-card:hover {
  border-color: rgba(55, 230, 195, 0.4);
  background: rgba(55, 230, 195, 0.06);
}

.outline-switcher-card {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.outline-switcher-head {
  display: grid;
  gap: 6px;
}

.outline-switcher-head span {
  color: rgba(214, 231, 227, 0.56);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.outline-switcher-head strong {
  font-size: 0.76rem;
  line-height: 1.3;
}

.outline-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.outline-tab {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.76rem;
  cursor: pointer;
  transition: 180ms ease;
}

.outline-tab:hover {
  border-color: rgba(115, 240, 210, 0.3);
  background: rgba(115, 240, 210, 0.08);
}

.outline-tab.active {
  border-color: rgba(107, 114, 255, 0.75);
  background: linear-gradient(180deg, rgba(107, 114, 255, 0.94), rgba(92, 98, 245, 0.84));
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(107, 114, 255, 0.78),
    0 0 18px rgba(107, 114, 255, 0.28);
}

.upload-title {
  color: var(--primary-soft);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.dock-grid label,
.dock-option-card,
.dock-stat {
  display: grid;
  gap: 8px;
}

.dock-grid span {
  color: rgba(214, 231, 227, 0.56);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dock-grid label {
  position: relative;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.dock-grid label:hover {
  border-color: rgba(115, 240, 210, 0.18);
  background: linear-gradient(180deg, rgba(55, 230, 195, 0.045), rgba(255, 255, 255, 0.02));
  transform: translateY(-1px);
}

.dock-grid label:focus-within {
  border-color: rgba(115, 240, 210, 0.3);
  background: linear-gradient(180deg, rgba(55, 230, 195, 0.065), rgba(255, 255, 255, 0.02));
}

.dock-option-card {
  align-content: start;
  padding: 9px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.dock-actions {
  display: grid;
  justify-content: flex-end;
  align-self: start;
  gap: 6px;
  padding-bottom: 2px;
}

.dock-actions .primary-button,
.dock-actions .secondary-button {
  width: auto;
  min-width: 132px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1280px) {
  .stage-wrap {
    padding-top: 96px;
    padding-bottom: 320px;
  }

  .stage-copy {
    position: relative;
    top: auto;
    left: auto;
    max-width: 100%;
  }

  .left-rail,
  .right-rail,
  .bottom-dock,
  .progress-panel,
  .viewer-mode-strip {
    position: relative;
    inset: auto;
    width: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .left-rail,
  .right-rail,
  .bottom-dock,
  .viewer-mode-strip {
    margin-top: 18px;
  }

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

  .bottom-dock {
    grid-template-columns: 1fr;
  }

  .dock-settings {
    grid-template-columns: 1fr;
  }

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

  .runtime-key-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
    text-align: center;
  }

  .topbar-meta {
    justify-self: center;
  }

  .topbar-mark {
    order: -1;
  }

  .stage-copy,
  .dock-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .viewer-mode-strip {
    justify-content: center;
  }

  .right-rail,
  .dock-grid {
    grid-template-columns: 1fr;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  #stage-canvas {
    min-height: 520px;
    height: 520px;
  }
}
