:root {
  color-scheme: dark;
  --bg: #030711;
  --bg-soft: #07111d;
  --panel: rgba(10, 18, 31, 0.88);
  --panel-strong: rgba(13, 25, 44, 0.94);
  --line: rgba(126, 161, 214, 0.18);
  --line-strong: rgba(129, 213, 255, 0.32);
  --text: #eef5ff;
  --text-soft: #96abc7;
  --accent: #72d9ff;
  --success: #5fe3b1;
  --warning: #ffc76b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --radius: 24px;
  --control-surface: linear-gradient(180deg, #3e434b 0%, #292e36 48%, #1c2027 100%);
  --control-surface-large: linear-gradient(145deg, #30353d 0%, #20252d 44%, #151920 100%);
  --control-shadow-raised:
    inset 0 2px 1px rgba(255, 255, 255, 0.2),
    inset 1px 0 0 rgba(255, 255, 255, 0.07),
    inset -1px 0 0 rgba(0, 0, 0, 0.32),
    inset 0 -3px 2px rgba(0, 0, 0, 0.4),
    0 7px 0 #090b0f,
    0 12px 22px rgba(0, 0, 0, 0.42);
  --control-shadow-pressed:
    inset 0 6px 10px rgba(0, 0, 0, 0.58),
    inset 2px 0 4px rgba(0, 0, 0, 0.2),
    inset 0 -2px 1px rgba(255, 255, 255, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(16, 159, 209, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(114, 217, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #050a13 0%, #02050a 100%);
  color: var(--text);
  font-family: "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.9), transparent 82%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(7, 13, 24, 0.9);
  color: var(--text);
  padding: 14px 16px;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
}

.content-shell,
.stack-list,
.admin-sections {
  display: grid;
  gap: 24px;
}

.shell-header {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: rgba(5, 10, 18, 0.78);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand-block,
.header-actions,
.top-nav,
.cta-row,
.card-actions,
.list-inline,
.card-badges,
.chip-row,
.metric-strip,
.section-grid,
.dashboard-grid,
.workspace-grid,
.auth-grid,
.viewer-shell,
.key-value,
.section-head,
.plan-meta,
.list-row {
  display: flex;
  gap: 16px;
}

.brand-block {
  align-items: center;
}

.brand-block--compact {
  gap: 0;
}

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

.brand-logo {
  width: auto;
  height: 44px;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
}

.eyebrow,
.surface-label {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.top-nav {
  justify-content: center;
  flex-wrap: wrap;
}

.top-nav a,
.ghost-link,
.primary-link,
.ghost-button,
.primary-button,
.chip,
.catalog-card {
  transition: 180ms ease;
}

.top-nav a {
  padding: 10px 14px;
  color: var(--text-soft);
}

.top-nav a.is-active,
.top-nav a:hover {
  color: var(--text);
}

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

.user-pill {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(12, 21, 35, 0.9);
  border: 1px solid var(--line);
}

.user-pill span {
  color: var(--text-soft);
  font-size: 12px;
}

.ghost-link,
.primary-link,
.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 16px;
  min-height: 46px;
}

.ghost-link,
.ghost-button {
  background: rgba(9, 16, 27, 0.94);
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost-link:hover,
.ghost-button:hover,
.chip:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.danger-button {
  border-color: rgba(255, 103, 123, 0.42);
  color: #ff9baa;
}

.danger-button:hover {
  border-color: rgba(255, 103, 123, 0.78);
  background: rgba(94, 20, 34, 0.34);
}

.primary-link,
.primary-button {
  color: #04111a;
  font-weight: 700;
  background: linear-gradient(135deg, #86e6ff, #36c9f6);
  box-shadow: 0 10px 28px rgba(54, 201, 246, 0.26);
}

.notice,
.surface-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
}

.notice--success {
  border-color: rgba(95, 227, 177, 0.34);
}

.page-sections,
.page-section {
  display: grid;
}

.page-sections {
  gap: 24px;
}

.page-section {
  min-width: 0;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 420px);
  gap: 20px;
}

.hero-panel--compact {
  display: block;
}

.hero-panel--centered {
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  align-items: center;
  padding: 0;
}

.hero-copy,
.surface-card,
.catalog-card,
.plan-card,
.payment-sheet {
  padding: 24px;
}

.hero-copy {
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(114, 217, 255, 0.12), rgba(3, 7, 17, 0.28)),
    rgba(7, 13, 23, 0.82);
  border: 1px solid rgba(129, 213, 255, 0.16);
  box-shadow: var(--shadow);
}

.hero-copy--compact {
  padding: 18px 22px;
}

.hero-copy--centered {
  width: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(20px, 3vw, 36px);
  text-align: center;
  padding: clamp(38px, 5vw, 64px) clamp(22px, 4vw, 56px);
}

.hero-copy h1,
.surface-card h1,
.surface-card h2,
.catalog-card h2,
.catalog-card h3,
.plan-card h3,
.payment-sheet h2,
.admin-brand h1,
.admin-header h2 {
  margin: 0 0 14px;
  line-height: 1.06;
}

.hero-copy h1 {
  max-width: 13ch;
  font-size: clamp(34px, 4.8vw, 54px);
}

.hero-copy--compact h1 {
  max-width: 18ch;
  margin-bottom: 10px;
  font-size: clamp(28px, 3vw, 40px);
}

.hero-copy--centered h1 {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  font-size: clamp(30px, 3.6vw, 48px);
  white-space: pre-line;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.hero-copy--compact .lede {
  margin: 0;
  max-width: 90ch;
  font-size: 15px;
}

.hero-copy--centered .lede {
  margin: 0 auto;
  max-width: 62ch;
  font-size: clamp(15px, 1.45vw, 18px);
  white-space: pre-line;
  text-wrap: balance;
}

.catalog-title-separator {
  color: var(--text-soft);
}

.lede,
.surface-card p,
.catalog-card p,
.payment-sheet p,
.admin-brand span {
  color: var(--text-soft);
  line-height: 1.65;
}

.metric-strip,
.section-grid,
.dashboard-grid,
.workspace-grid,
.auth-grid,
.viewer-shell {
  flex-wrap: wrap;
}

.metric-strip article,
.surface-card,
.catalog-card,
.plan-card,
.hero-mini {
  min-width: 0;
}

.metric-strip article {
  flex: 1 1 180px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(8, 14, 24, 0.84);
  border: 1px solid var(--line);
}

.metric-strip strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
}

.metric-strip span,
.card-meta,
.hero-mini,
.list-row p {
  color: var(--text-soft);
}

.section-grid > *,
.dashboard-grid > *,
.workspace-grid > *,
.auth-grid > * {
  flex: 1 1 320px;
}

.auth-grid--single {
  justify-content: center;
}

.auth-grid--single > .surface-card {
  flex: 0 1 692px;
  width: 100%;
}

.section-head {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

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

.card-grid--home {
  margin-top: -4px;
}

.catalog-card,
.plan-card,
.muted-card,
.admin-form-card {
  background: rgba(8, 15, 26, 0.82);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.catalog-card--link {
  display: block;
  height: 100%;
}

.catalog-card--link:hover {
  border-color: var(--line-strong);
  transform: translateY(3px);
  box-shadow: var(--control-shadow-pressed);
}

.catalog-card--locked {
  opacity: 0.72;
}

.card-badges,
.card-meta {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 16, 27, 0.94);
  color: var(--text-soft);
  font-size: 12px;
}

.badge--accent,
.chip--active {
  color: white;
  border-color: rgba(114, 217, 255, 0.36);
  background: rgba(17, 86, 110, 0.48);
}

.badge--success {
  border-color: rgba(95, 227, 177, 0.32);
  color: var(--success);
}

.badge--warning {
  border-color: rgba(255, 199, 107, 0.28);
  color: var(--warning);
}

.chip-row {
  flex-wrap: wrap;
}

.chip-row--secondary {
  margin-top: -8px;
}

.chip--sub {
  opacity: 0.88;
}

.card-cta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.inline-link {
  color: var(--text);
  font-weight: 600;
}

.inline-link--muted {
  color: var(--text-soft);
  font-weight: 400;
}

.plan-card--highlighted {
  border-color: rgba(114, 217, 255, 0.3);
  box-shadow: inset 0 0 0 1px rgba(114, 217, 255, 0.1), var(--shadow);
}

.plan-meta,
.key-value,
.list-row {
  align-items: center;
  justify-content: space-between;
}

.key-value {
  padding: 10px 0;
  border-bottom: 1px solid rgba(126, 161, 214, 0.09);
}

.key-value:last-child,
.list-row:last-child {
  border-bottom: 0;
}

.list-row {
  padding: 14px 0;
  border-bottom: 1px solid rgba(126, 161, 214, 0.09);
}

.stack-form,
.admin-form-card {
  display: grid;
  gap: 14px;
}

.stack-form label,
.admin-form-card label {
  display: grid;
  gap: 8px;
}

.stack-form span,
.admin-form-card span {
  color: var(--text-soft);
  font-size: 14px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-unit,
.field-hint {
  color: var(--text-soft);
}

.field-unit {
  font-size: 13px;
  white-space: nowrap;
}

.field-hint {
  display: block;
  margin-top: -2px;
  font-size: 13px;
  line-height: 1.5;
}

.field-hint--checkbox {
  margin: -8px 0 0 30px;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 12px !important;
}

.checkbox-row--disabled {
  opacity: 0.55;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-group {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(5, 10, 18, 0.76);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.viewer-shell {
  display: grid;
  gap: 14px;
  align-items: stretch;
}

.mesh-canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  border: 0;
  background: linear-gradient(180deg, #08111d, #03060d);
}

.viewer-stage {
  position: relative;
  height: clamp(360px, 52vh, 540px);
  min-height: 360px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(126, 161, 214, 0.14);
  background: linear-gradient(180deg, #08111d, #03060d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.viewer-editor-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.viewer-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(4, 8, 14, 0.74);
  backdrop-filter: blur(8px);
}

.viewer-overlay[hidden] {
  display: none;
}

.viewer-overlay strong {
  font-size: 18px;
}

.viewer-overlay span {
  max-width: 44ch;
  color: var(--text-soft);
  line-height: 1.6;
}

.viewer-overlay--error strong {
  color: #ffd0c7;
}

.viewer-selection-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(114, 217, 255, 0.28);
  background: rgba(5, 11, 19, 0.92);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.viewer-gizmo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.viewer-gizmo__axis-hit,
.viewer-gizmo__axis,
.viewer-gizmo__arrow,
.viewer-gizmo__ring {
  pointer-events: auto;
  cursor: grab;
  transition: 160ms ease;
}

.viewer-gizmo__axis-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  stroke-linecap: round;
}

.viewer-gizmo__axis {
  fill: none;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-dasharray: 5 4;
  opacity: 0.96;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.06));
}

.viewer-gizmo__axis--x {
  stroke: #ff4d63;
}

.viewer-gizmo__axis--y {
  stroke: #56d80f;
}

.viewer-gizmo__axis--z {
  stroke: #3b93ff;
}

.viewer-gizmo__arrow {
  stroke: none;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.08));
}

.viewer-gizmo__arrow--x {
  fill: #ff4d63;
}

.viewer-gizmo__arrow--y {
  fill: #56d80f;
}

.viewer-gizmo__arrow--z {
  fill: #3b93ff;
}

.viewer-gizmo__ring {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.07));
}

.viewer-gizmo__ring--x {
  stroke: rgba(255, 123, 119, 0.82);
}

.viewer-gizmo__ring--y {
  stroke: rgba(95, 227, 177, 0.78);
}

.viewer-gizmo__ring--z {
  stroke: rgba(124, 199, 255, 0.82);
}

.viewer-gizmo__axis.is-active,
.viewer-gizmo__arrow.is-active,
.viewer-gizmo__ring.is-active,
.viewer-gizmo__axis:hover,
.viewer-gizmo__arrow:hover,
.viewer-gizmo__ring:hover {
  filter: drop-shadow(0 0 12px rgba(255, 198, 107, 0.46));
}

.viewer-gizmo__center {
  pointer-events: none;
  fill: rgba(255, 255, 255, 0.98);
  stroke: rgba(3, 7, 17, 0.64);
  stroke-width: 2;
}

.viewer-toolbar,
.workspace-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.viewer-toolbar {
  justify-content: space-between;
  align-items: flex-start;
}

.viewer-toolbar--compact {
  gap: 8px;
}

.viewer-toolbar--overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 4;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.viewer-toolbar__group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  pointer-events: auto;
}

.viewer-toolbar__group--end {
  margin-left: auto;
}

.viewer-toolbar__group--camera {
  max-width: calc(100% - 220px);
}

.viewer-toolbar__group--history {
  justify-content: flex-end;
}

.viewer-toolbar__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(9, 16, 27, 0.94);
  color: var(--text);
  transition: 180ms ease;
}

.viewer-toolbar--compact .viewer-toolbar__button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 11px;
  font-size: 12px;
}

.viewer-toolbar__button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.viewer-toolbar__button--active {
  border-color: var(--line-strong);
  background: rgba(15, 43, 58, 0.42);
}

.viewer-color-button {
  gap: 10px;
}

.color-picker {
  position: relative;
}

.color-picker__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.color-picker__button--active {
  border-color: var(--line-strong);
  background: rgba(15, 43, 58, 0.42);
}

.color-picker__swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--color-picker-swatch);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.color-picker__popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 3;
  display: grid;
  gap: 12px;
  width: min(300px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(126, 161, 214, 0.16);
  background: rgba(8, 14, 24, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(14px);
}

.color-picker__popover[hidden] {
  display: none;
}

.color-picker__sv {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  cursor: crosshair;
  border: 1px solid rgba(126, 161, 214, 0.16);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1)),
    linear-gradient(90deg, rgba(255, 255, 255, 1), hsl(var(--picker-hue) 100% 50%));
  overflow: hidden;
}

.color-picker__sv::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.14));
  pointer-events: none;
}

.color-picker__sv-thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 6px 12px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-picker__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.color-picker__field span {
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.color-picker__field input {
  padding: 12px 14px;
  border-radius: 14px;
}

.color-picker__field--hex,
.color-picker__field--slider {
  grid-column: 1 / -1;
}

.color-picker__field--slider input[type="range"] {
  padding: 0;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(126, 161, 214, 0.14);
  background:
    linear-gradient(
      90deg,
      #ff0000 0%,
      #ffff00 16.6%,
      #00ff00 33.3%,
      #00ffff 50%,
      #0000ff 66.6%,
      #ff00ff 83.3%,
      #ff0000 100%
    );
  appearance: none;
}

.color-picker__field--slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid white;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.color-picker__field--slider input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid white;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.color-picker__reset {
  width: 100%;
}

.viewer-hint {
  margin: -2px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.viewer-meta {
  display: grid;
  gap: 12px;
}

.viewer-meta--full {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(5, 10, 18, 0.62);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.workspace-layout {
  display: grid;
  gap: 20px;
}

.workspace-layout--compact {
  gap: 16px;
}

.workspace-layout__top {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

.workspace-layout--compact .workspace-layout__top {
  gap: 16px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.workspace-layout__top--triple {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(240px, 300px);
  gap: 14px;
}

.workspace-layout--compact .workspace-layout__top.workspace-layout__top--triple {
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: start;
}

.workspace-panel {
  display: grid;
  gap: 18px;
}

.workspace-layout--compact .workspace-panel {
  gap: 14px;
}

.workspace-panel--sidebar {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  align-self: start;
}

@media (min-width: 981px) {
  .workspace-panel--result {
    position: sticky;
    top: 104px;
    align-self: start;
    overflow: visible;
  }

  .workspace-panel--result .viewer-stage {
    height: clamp(320px, calc(100vh - 430px), 540px);
    min-height: 320px;
  }

  .workspace-layout--compact .workspace-panel--result .viewer-stage {
    height: clamp(340px, calc(100vh - 440px), 620px);
    min-height: 340px;
  }
}

.workspace-aux-panel {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.62);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.workspace-aux-panel__head {
  display: grid;
  gap: 4px;
}

.workspace-aux-panel__head h3,
.workspace-aux-panel__head p {
  margin: 0;
}

.workspace-aux-panel__head h3 {
  font-size: 14px;
}

.workspace-aux-panel__body {
  display: grid;
  gap: 8px;
}

.workspace-editor {
  display: grid;
  gap: 12px;
}

.workspace-editor--add-only,
.workspace-editor--details {
  gap: 10px;
}

.workspace-editor__section {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.62);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.workspace-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-editor__head h3 {
  margin: 0;
  font-size: 14px;
}

.workspace-editor__history,
.workspace-editor__add-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-editor__history .ghost-button,
.workspace-editor__add-button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.1;
  border-radius: 9px;
}

.workspace-editor__add-button {
  flex: 1 1 76px;
}

.workspace-editor__list,
.workspace-editor__fields {
  display: grid;
  gap: 8px;
}

.workspace-editor__list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(126, 161, 214, 0.12);
  background: rgba(8, 15, 26, 0.82);
  color: var(--text);
}

.workspace-editor__list-select {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.workspace-editor__list-select strong {
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-editor__list-delete {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 8px;
  border: 1px solid rgba(126, 161, 214, 0.12);
  background: rgba(5, 10, 18, 0.8);
  color: var(--text-soft);
}

.workspace-editor__list-delete:hover {
  color: #ffd0c7;
  border-color: rgba(255, 123, 119, 0.28);
}

.workspace-editor__empty {
  color: var(--text-soft);
}

.workspace-editor__list-item--active,
.workspace-editor__list-item:hover {
  border-color: var(--line-strong);
  background: rgba(15, 43, 58, 0.34);
}

.workspace-editor__empty {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(126, 161, 214, 0.18);
  background: rgba(4, 9, 16, 0.56);
}

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

.workspace-editor__field {
  display: grid;
  gap: 5px;
}

.workspace-editor__field-label {
  color: var(--text-soft);
  font-size: 11px;
}

.workspace-editor__field input,
.workspace-editor__field select {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 9px;
}

.workspace-grid-editor {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
  min-width: 0;
}

.workspace-grid-editor__viewport {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.workspace-grid-editor__canvas {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  gap: var(--grid-gap, 4px);
  padding: 10px;
  box-sizing: border-box;
  width: min(100%, var(--grid-max-width));
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(248, 249, 251, 0.96), rgba(230, 234, 239, 0.92));
  border: 1px solid rgba(126, 161, 214, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -8px 18px rgba(112, 128, 144, 0.08);
}

.workspace-grid-editor__cell {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  overflow: visible;
  border-radius: 9px;
  border: 1px solid rgba(36, 47, 58, 0.22);
  color: #202833;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #eef1f4, #dfe4ea);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.9),
    inset 0 -2px 3px rgba(65, 78, 92, 0.18),
    0 2px 3px rgba(19, 30, 48, 0.24);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.workspace-grid-editor__cell:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.workspace-grid-editor__cell:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(65, 78, 92, 0.22),
    0 1px 1px rgba(19, 30, 48, 0.16);
}

.workspace-grid-editor__cell--join-right::after,
.workspace-grid-editor__cell--join-down::before {
  content: "";
  position: absolute;
  z-index: 2;
  background: inherit;
  pointer-events: none;
}

.workspace-grid-editor__cell--join-right::after {
  top: -1px;
  right: calc(-1px - var(--grid-gap));
  bottom: -1px;
  width: calc(var(--grid-gap) + 2px);
}

.workspace-grid-editor__cell--join-down::before {
  right: -1px;
  bottom: calc(-1px - var(--grid-gap));
  left: -1px;
  height: calc(var(--grid-gap) + 2px);
}

.workspace-grid-editor__cell--idle {
  background: linear-gradient(180deg, #eef1f4, #dfe4ea);
}

.workspace-grid-editor__cell--grouped {
  background: linear-gradient(180deg, #dff4d9, #caebc0);
}

.workspace-grid-editor__cell--selected {
  background: linear-gradient(180deg, #fff4af, #f6e681);
  border-color: rgba(149, 118, 12, 0.38);
}

.workspace-grid-editor__footer,
.workspace-grid-editor__summary,
.workspace-grid-editor__actions,
.workspace-grid-editor__field-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.workspace-grid-editor__footer {
  justify-content: space-between;
  width: 100%;
}

.workspace-grid-editor__status,
.workspace-grid-editor__info {
  font-size: 11px;
  color: var(--text-soft);
}

.workspace-grid-editor__action-button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 11px;
  border-radius: 9px;
}

.workspace-panel__head {
  display: grid;
  gap: 6px;
}

.workspace-back-row {
  margin-bottom: 2px;
}

.workspace-back-link {
  width: fit-content;
}

.workspace-panel__head p {
  margin: 0;
}

.workspace-panel__head--result {
  gap: 14px;
}

.workspace-form {
  gap: 12px;
}

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

.workspace-form--sidebar {
  gap: 10px;
}

.workspace-field__issue {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.workspace-field__issue--error {
  color: #ffb7ab;
}

.workspace-field__issue--warning {
  color: #ffd7a6;
}

.workspace-field--error input,
.workspace-field--error select,
.workspace-inline-field--error input,
.workspace-inline-field--error select,
.workspace-inline-toggle--error,
.checkbox-row--error {
  border-color: rgba(255, 123, 119, 0.54) !important;
  box-shadow: 0 0 0 1px rgba(255, 123, 119, 0.18);
}

.workspace-field--warning input,
.workspace-field--warning select,
.workspace-inline-field--warning input,
.workspace-inline-field--warning select,
.workspace-inline-toggle--warning,
.checkbox-row--warning {
  border-color: rgba(255, 198, 107, 0.48) !important;
  box-shadow: 0 0 0 1px rgba(255, 198, 107, 0.14);
}

.workspace-form--sidebar input,
.workspace-form--sidebar select,
.workspace-form--sidebar textarea {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.workspace-result-shell {
  display: grid;
  gap: 12px;
}

.workspace-compact-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.72);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.workspace-compact-panel__fields,
.workspace-compact-panel__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-compact-panel__fields {
  flex: 1 1 560px;
}

.workspace-inline-field,
.workspace-inline-toggle,
.workspace-compact-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(8, 15, 26, 0.82);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.workspace-inline-field {
  flex: 1 1 116px;
}

.workspace-inline-field[data-field-key="magnetDiameter"],
.workspace-inline-field[data-field-key="magnetDepth"] {
  flex: 1 1 132px;
}

.workspace-inline-field span,
.workspace-compact-metric span {
  color: var(--text-soft);
  font-size: 11px;
}

.workspace-inline-field input,
.workspace-inline-field select {
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 8px;
  min-width: 0;
  font-size: 12px;
}

.workspace-inline-toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 0;
  flex: 0 0 auto;
}

.workspace-inline-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.workspace-inline-toggle span {
  color: var(--text);
  font-size: 12px;
}

.workspace-compact-metric {
  flex: 1 1 148px;
}

.workspace-compact-metric strong {
  font-size: 13px;
}

.workspace-compact-panel__actions {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
}

.workspace-compact-panel--nameplate {
  gap: 10px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
}

.workspace-compact-panel--nameplate .workspace-compact-panel__fields {
  gap: 10px;
}

.workspace-compact-panel--nameplate .workspace-inline-field {
  flex-basis: 148px;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 13px;
}

.workspace-compact-panel--nameplate .workspace-inline-field span {
  font-size: 13px;
}

.workspace-compact-panel--nameplate .workspace-inline-field input,
.workspace-compact-panel--nameplate .workspace-inline-field select {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 14px;
}

.workspace-panel--params .workspace-primary-fields:not(:has(.workspace-compact-panel)) {
  display: none;
}

.workspace-panel--params .workspace-compact-panel {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border-radius: 12px;
}

.workspace-panel--params .workspace-compact-panel__fields,
.workspace-panel--params .workspace-compact-panel__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.workspace-panel--params .workspace-inline-field,
.workspace-panel--params .workspace-inline-toggle,
.workspace-panel--params .workspace-compact-metric,
.workspace-panel--params .workspace-compact-panel--nameplate .workspace-inline-field {
  padding: 6px 7px;
  border-radius: 9px;
}

.workspace-panel--params .workspace-inline-field span,
.workspace-panel--params .workspace-compact-panel--nameplate .workspace-inline-field span,
.workspace-panel--params .workspace-compact-metric span {
  font-size: 10px;
}

.workspace-panel--params .workspace-inline-field input,
.workspace-panel--params .workspace-inline-field select,
.workspace-panel--params .workspace-compact-panel--nameplate .workspace-inline-field input,
.workspace-panel--params .workspace-compact-panel--nameplate .workspace-inline-field select {
  min-height: 28px;
  padding: 5px 6px;
  font-size: 12px;
}

.workspace-panel--params .workspace-inline-toggle {
  grid-template-columns: auto 1fr;
}

.workspace-messages {
  display: grid;
  gap: 8px;
}

.workspace-message {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(126, 161, 214, 0.12);
  background: rgba(7, 13, 22, 0.82);
}

.workspace-message strong,
.workspace-message p {
  margin: 0;
}

.workspace-message--error {
  border-color: rgba(255, 123, 119, 0.28);
  background: rgba(42, 12, 10, 0.56);
}

.workspace-message--warning {
  border-color: rgba(255, 198, 107, 0.24);
  background: rgba(45, 28, 7, 0.42);
}

.workspace-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-tab {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(9, 16, 27, 0.94);
  color: var(--text-soft);
  font-size: 12px;
}

.workspace-tab--active,
.workspace-tab:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(15, 43, 58, 0.42);
}

.workspace-tab-panel {
  display: grid;
  gap: 14px;
}

.workspace-result-actions {
  justify-content: flex-end;
}

.workspace-result-actions--top {
  margin-top: -4px;
  margin-bottom: -2px;
}

.workspace-panel--params h1,
.workspace-panel--result h2 {
  font-size: 24px;
}

.workspace-panel--sidebar h3,
.workspace-panel--params h3 {
  font-size: 14px;
}

.workspace-layout--compact .viewer-stage {
  height: clamp(420px, 60vh, 620px);
  min-height: 420px;
}

.workspace-layout--compact .viewer-meta--full {
  padding: 12px 14px;
}

.workspace-layout--compact .viewer-hint {
  font-size: 12px;
}

.workspace-note {
  padding: 16px;
  border-radius: 18px;
  background: rgba(5, 10, 18, 0.72);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.workspace-note p,
.workspace-note h3 {
  margin: 0;
}

.workspace-note h3 {
  margin-bottom: 8px;
}

.workspace-actions-card {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 3, 8, 0.74);
  backdrop-filter: blur(14px);
}

.payment-sheet {
  width: min(100%, 520px);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  display: grid;
  gap: 10px;
}

.empty-state {
  text-align: center;
  justify-items: center;
}

.subtle-empty {
  padding: 18px 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.admin-sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 20px;
  background: rgba(5, 10, 18, 0.86);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.admin-brand {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(126, 161, 214, 0.1);
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-nav a,
.admin-nav-button {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text-soft);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
}

.admin-nav a:hover,
.admin-nav-button:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(9, 16, 27, 0.82);
}

.admin-nav a.is-active {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(15, 43, 58, 0.42);
}

.admin-logout {
  width: 100%;
}

/* Unified raised controls: navigation, generator cards and every button use the same physical interaction. */
button,
.top-nav a,
.ghost-link,
.primary-link,
.chip,
.catalog-card--link,
.admin-nav a {
  position: relative;
  border-color: var(--line-strong);
  box-shadow: var(--control-shadow-raised);
  transform: translateY(0);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease,
    filter 120ms ease,
    color 120ms ease,
    background 120ms ease;
}

.top-nav a,
.admin-nav a {
  border: 1px solid rgba(179, 187, 199, 0.24);
  background: var(--control-surface);
}

.ghost-button,
.ghost-link,
.chip,
.viewer-toolbar__button,
.admin-nav-button {
  border-color: rgba(179, 187, 199, 0.24);
  background: var(--control-surface);
}

.catalog-card--link {
  border-color: rgba(179, 187, 199, 0.3);
  background: var(--control-surface-large);
}

button:not(:disabled):hover,
.top-nav a:hover,
.ghost-link:hover,
.primary-link:hover,
.chip:hover,
.catalog-card--link:hover,
.admin-nav a:hover,
button:not(:disabled):active,
.top-nav a:active,
.ghost-link:active,
.primary-link:active,
.chip:active,
.catalog-card--link:active,
.admin-nav a:active {
  transform: translateY(6px);
  box-shadow: var(--control-shadow-pressed);
  filter: brightness(0.96);
}

.top-nav a.is-active,
.chip--active,
.admin-nav a.is-active,
.viewer-toolbar__button--active,
.color-picker__button--active {
  transform: translateY(5px);
  box-shadow: var(--control-shadow-pressed);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 0 rgba(0, 3, 9, 0.62);
}

button:focus-visible,
.top-nav a:focus-visible,
.ghost-link:focus-visible,
.primary-link:focus-visible,
.chip:focus-visible,
.catalog-card--link:focus-visible,
.admin-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.admin-main {
  display: grid;
  gap: 18px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background: rgba(6, 11, 19, 0.78);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.admin-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-screen-head h3 {
  margin: 0;
  font-size: 24px;
}

.admin-screen-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.admin-metric-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(8, 15, 26, 0.82);
  border: 1px solid var(--line);
}

.admin-metric-card strong {
  font-size: 30px;
}

.admin-list {
  display: grid;
  gap: 14px;
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-module-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  min-height: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(8, 15, 26, 0.82);
  border: 1px solid var(--line);
}

.admin-module-card__published {
  justify-self: end;
  white-space: nowrap;
}

.admin-module-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.admin-module-card__edit {
  justify-self: end;
}

.admin-list-row,
.admin-entity-card,
.admin-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(8, 15, 26, 0.82);
  border: 1px solid var(--line);
}

.admin-entity-card {
  display: grid;
  gap: 14px;
}

.admin-entity-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-list-main,
.admin-entity-head > div:first-child,
.admin-subitem > div:first-child {
  min-width: 0;
}

.admin-list-main strong,
.admin-entity-head h4,
.admin-subitem strong {
  display: block;
  margin: 0 0 4px;
  font-size: 16px;
}

.admin-list-main p,
.admin-entity-head p,
.admin-subitem p,
.admin-empty-line {
  margin: 0;
  color: var(--text-soft);
}

.admin-list-tags,
.admin-sublist {
  display: grid;
  gap: 10px;
}

.admin-list-tags {
  justify-items: end;
}

.admin-sublist {
  padding-top: 4px;
}

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

.is-hidden-field {
  display: none !important;
}

.is-disabled-field {
  opacity: 0.72;
}

.admin-inline-note {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(126, 161, 214, 0.2);
  background: rgba(5, 10, 18, 0.56);
  color: var(--text-soft);
}

.admin-form-card--editor {
  max-width: 880px;
}

.admin-field-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(5, 10, 18, 0.62);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

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

.admin-field-section__head h4,
.admin-field-card h5 {
  margin: 0;
}

.admin-field-section__head p {
  margin: 0;
  color: var(--text-soft);
}

.admin-field-list {
  display: grid;
  gap: 12px;
}

.admin-field-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(8, 15, 26, 0.82);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.admin-field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-quick-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.admin-quick-column {
  display: grid;
  gap: 12px;
}

.admin-quick-column h5 {
  margin: 0;
}

.admin-quick-toggle-list,
.admin-sort-list {
  display: grid;
  gap: 10px;
}

.admin-checkbox-card,
.admin-sort-card,
.admin-sort-dropzone {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(8, 15, 26, 0.82);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.admin-checkbox-card {
  justify-content: flex-start;
}

.admin-sort-card,
.admin-sort-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: grab;
}

.admin-sort-card__main {
  min-width: 0;
}

.admin-sort-card__main strong,
.admin-sort-dropzone strong,
.admin-sort-dropzone h4 {
  margin: 0 0 4px;
}

.admin-sort-card__main p,
.admin-sort-dropzone p {
  margin: 0;
  color: var(--text-soft);
}

.is-dragging {
  opacity: 0.6;
}

.is-drop-target {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(114, 217, 255, 0.18);
}

.admin-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

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

.media-slot {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(5, 10, 18, 0.76);
  border: 1px solid rgba(126, 161, 214, 0.12);
}

.branding-preview {
  width: 100%;
  max-height: 100px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(2, 6, 12, 0.92);
  border: 1px solid var(--line);
  padding: 14px;
}

.branding-preview--icon {
  width: 72px;
  height: 72px;
}

.branding-empty {
  display: grid;
  place-items: center;
  min-height: 92px;
  border-radius: 16px;
  border: 1px dashed rgba(126, 161, 214, 0.22);
  color: var(--text-soft);
  background: rgba(2, 6, 12, 0.74);
}

.branding-empty--icon {
  min-height: 72px;
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 980px) {
  .shell-header,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel--centered {
    min-height: 0;
    padding: 0;
  }

  .hero-copy--centered {
    width: 100%;
    padding: 28px 24px;
  }

  .workspace-layout__top {
    grid-template-columns: 1fr;
  }

  .workspace-layout__top--triple {
    grid-template-columns: 1fr;
  }

  .workspace-layout--compact .workspace-layout__top {
    grid-template-columns: 1fr;
  }

  .workspace-layout--compact .workspace-layout__top.workspace-layout__top--triple {
    grid-template-columns: 1fr;
  }

  .viewer-toolbar--overlay {
    position: static;
    margin-bottom: 10px;
    pointer-events: auto;
  }

  .viewer-toolbar__group--camera {
    max-width: none;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .mesh-canvas {
    min-height: 0;
  }

  .viewer-stage {
    height: 320px;
    min-height: 320px;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-grid-2 {
    grid-template-columns: 1fr;
  }

  .admin-module-grid {
    grid-template-columns: 1fr;
  }

  .admin-field-grid {
    grid-template-columns: 1fr;
  }

  .admin-quick-grid {
    grid-template-columns: 1fr;
  }

  .admin-list-row,
  .admin-subitem {
    flex-direction: column;
    align-items: flex-start;
  }

  .workspace-result-actions {
    justify-content: flex-start;
  }

  .admin-list-tags {
    justify-items: start;
  }

  .workspace-editor__fields--compact {
    grid-template-columns: 1fr;
  }
}

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

  .shell-header,
  .hero-copy,
  .surface-card,
  .catalog-card,
  .plan-card,
  .payment-sheet,
  .admin-sidebar,
  .admin-header {
    padding: 20px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .hero-copy--centered {
    padding: 22px 18px;
    text-align: left;
    place-items: start;
  }

  .hero-copy--centered h1,
  .hero-copy--centered .lede {
    margin-left: 0;
    margin-right: 0;
  }

  .hero-copy--centered h1 {
    width: 100%;
    max-width: none;
    font-size: clamp(24px, 7vw, 34px);
    white-space: pre-line;
    overflow-wrap: normal;
    word-break: normal;
  }

  .hero-copy--centered .lede {
    max-width: 34ch;
    font-size: 15px;
  }

  .viewer-toolbar {
    gap: 8px;
  }

  .viewer-toolbar__button {
    padding: 9px 12px;
  }

  .viewer-toolbar--compact .viewer-toolbar__button {
    min-height: 30px;
    padding: 6px 9px;
  }

  .card-cta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
.texturizer-host {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.texturizer-workspace {
  width: 100%;
  min-width: 0;
}

.texturizer-workspace__surface {
  width: 100%;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.75rem);
}

.texturizer-workspace__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.texturizer-workspace__title {
  flex: 1 1 auto;
  min-width: 0;
}

.texturizer-workspace__title h1 {
  margin: 0 0 0.9rem;
}

.texturizer-workspace__name {
  display: grid;
  gap: 0.4rem;
  max-width: 32rem;
}

.texturizer-workspace__name span {
  color: var(--muted-color, #93a4ba);
  font-size: 0.82rem;
}

.texturizer-workspace__name input {
  width: 100%;
}

.texturizer-workspace__navigation {
  display: grid;
  justify-items: stretch;
  gap: 0.65rem;
  flex: 0 0 auto;
}

.texturizer-workspace__navigation > * {
  text-align: center;
}

.texturizer-host__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.texturizer-host__toolbar .is-error { color: #dc5f5f; }

.texturizer-host__frame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 250px);
  border: 1px solid var(--border-color, rgba(127, 127, 127, 0.25));
  border-radius: 14px;
  background: #181a1f;
}

@media (max-width: 720px) {
  .texturizer-workspace__header {
    flex-direction: column;
  }

  .texturizer-workspace__navigation {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .texturizer-host__frame {
    min-height: 75vh;
  }
}
