/* ─────────────────────────────────────────────────────────────
   RELIEFLAB — 3D Laser Engraving AI Pipeline Companion
   Tokens: industrial charcoal + neon teal/blue laser accents
   ───────────────────────────────────────────────────────────── */

:root {
  --void: #0a0c0f;
  --bg: #0f1217;
  --panel: #161b22;
  --elevated: #1c232d;
  --border: #2a3441;
  --border-bright: #3a4a5c;
  --text: #e9eef5;
  --muted: #8b9aab;
  --faint: #5c6b7c;
  --teal: #00e8c4;
  --teal-dim: rgba(0, 232, 196, 0.14);
  --teal-glow: rgba(0, 232, 196, 0.45);
  --blue: #3d9eff;
  --blue-dim: rgba(61, 158, 255, 0.14);
  --amber: #ffb020;
  --amber-dim: rgba(255, 176, 32, 0.12);
  --rose: #ff6b8a;
  --peak: #f0f4f8;
  --mid: #8a96a4;
  --deep: #1a2030;
  --sidebar-w: 280px;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 232, 196, 0.06), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(61, 158, 255, 0.05), transparent 50%),
    var(--void);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Shell ── */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #12161c 0%, #0e1116 100%);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem 1.5rem;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--elevated);
  border: 1px solid var(--border-bright);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-beam {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  opacity: 0.85;
  transform: translateX(-100%) skewX(-18deg);
  animation: scan 2.8s var(--ease) infinite;
}

@keyframes scan {
  0% { transform: translateX(-120%) skewX(-18deg); }
  55%, 100% { transform: translateX(120%) skewX(-18deg); }
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  display: block;
}

.brand-accent {
  color: var(--teal);
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  font-size: 1.5rem;
  color: var(--muted);
  line-height: 1;
  padding: 0.25rem;
}

.nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin: 0 0.5rem 0.6rem;
  font-weight: 600;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nav-item:hover {
  background: var(--elevated);
  border-color: var(--border);
}

.nav-item.active {
  background: var(--teal-dim);
  border-color: rgba(0, 232, 196, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 232, 196, 0.08), inset 0 0 24px rgba(0, 232, 196, 0.04);
}

.nav-step {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--faint);
  min-width: 1.5rem;
  padding-top: 0.15rem;
}

.nav-item.active .nav-step {
  color: var(--teal);
}

.nav-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.nav-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.depth-legend {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.legend-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-weight: 600;
}

.legend-bar {
  height: 8px;
  border-radius: 4px;
  margin: 0.55rem 0 0.35rem;
  background: linear-gradient(90deg, #0a0a0c, #6a7380, #f5f7fa);
  box-shadow: 0 0 12px rgba(0, 232, 196, 0.15);
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ── Main ── */

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.75rem 0.5rem;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  margin-top: 0.2rem;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.topbar-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Progress rail (signature) ── */

.progress-rail {
  position: relative;
  margin: 1rem 1.75rem 0.5rem;
  padding: 1.25rem 1rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rail-track {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 2.15rem;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  z-index: 0;
}

.rail-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  box-shadow: 0 0 12px var(--teal-glow);
  transition: width 0.5s var(--ease);
}

.rail-beam {
  position: absolute;
  top: -2px;
  left: 0;
  width: 40px;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, #fff, var(--teal));
  opacity: 0.9;
  filter: blur(0.5px);
  transition: left 0.5s var(--ease);
  pointer-events: none;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem;
  color: var(--muted);
  transition: color 0.2s;
}

.progress-step:hover {
  color: var(--text);
}

.progress-step.active {
  color: var(--text);
}

.progress-step.done .ps-dot {
  background: var(--teal-dim);
  border-color: var(--teal);
  color: var(--teal);
}

.ps-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-bright);
  background: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.progress-step.active .ps-dot {
  border-color: var(--teal);
  background: rgba(0, 232, 196, 0.12);
  color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 232, 196, 0.12), 0 0 20px rgba(0, 232, 196, 0.25);
}

.ps-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  max-width: 11rem;
  line-height: 1.3;
}

/* ── Content ── */

.content {
  flex: 1;
  padding: 1.25rem 1.75rem 2rem;
}

.step-panel[hidden] {
  display: none !important;
}

.step-panel {
  animation: panelIn 0.4s var(--ease);
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.panel-header {
  margin-bottom: 1.5rem;
  max-width: 52rem;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}

.panel-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.text-peak { color: #f0f4f8; }
.text-mid { color: #9aa6b4; }
.text-deep { color: #6a7a8c; }

/* ── Grid / cards ── */

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.badge-teal {
  background: var(--teal-dim);
  border-color: rgba(0, 232, 196, 0.35);
  color: var(--teal);
}

.badge-blue {
  background: var(--blue-dim);
  border-color: rgba(61, 158, 255, 0.35);
  color: var(--blue);
}

/* ── Forms ── */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.field-help {
  margin: -0.4rem 0 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="text"],
textarea,
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
  line-height: 1.45;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238b9aab' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(0, 232, 196, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 232, 196, 0.12);
}

/* Toggles */

.toggles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}

.toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.toggle:hover {
  border-color: var(--border-bright);
}

.toggle:has(input:checked) {
  border-color: rgba(0, 232, 196, 0.4);
  background: var(--teal-dim);
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--elevated);
  border: 1px solid var(--border-bright);
  position: relative;
  flex-shrink: 0;
  margin-top: 0.1rem;
  transition: background 0.2s, border-color 0.2s;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s var(--ease), background 0.2s;
}

.toggle input:checked + .toggle-ui {
  background: rgba(0, 232, 196, 0.25);
  border-color: var(--teal);
}

.toggle input:checked + .toggle-ui::after {
  transform: translateX(18px);
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal-glow);
}

.toggle input:focus-visible + .toggle-ui {
  box-shadow: 0 0 0 3px rgba(0, 232, 196, 0.2);
}

.toggle-text strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
}

.toggle-text small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
  line-height: 1.35;
}

/* Prompt box */

.prompt-box {
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  max-height: 12rem;
  overflow: auto;
}

.prompt-box pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c5d4e4;
}

/* Buttons */

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.05rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  text-decoration: none !important;
  color: var(--text);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #00c9aa, #00a8e8);
  color: #041018;
  box-shadow: 0 4px 20px rgba(0, 232, 196, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(0, 232, 196, 0.4);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--elevated);
  border-color: var(--border-bright);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--teal);
  background: var(--teal-dim);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  margin-top: 0.75rem;
}

.btn-arrow {
  font-size: 0.95rem;
  opacity: 0.85;
}

.hint {
  min-height: 1.25rem;
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.hint.ok {
  color: var(--teal);
}

/* Tips */

.card-tips {
  background:
    linear-gradient(145deg, rgba(0, 232, 196, 0.04), transparent 40%),
    var(--panel);
}

.tips-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tips-list li {
  padding-left: 1rem;
  border-left: 2px solid rgba(0, 232, 196, 0.4);
  font-size: 0.9rem;
  color: var(--muted);
}

.tips-list strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.88rem;
}

/* Checks */

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(42, 52, 65, 0.6);
}

.check-item:last-of-type {
  border-bottom: none;
}

.check-item input {
  margin-top: 0.2rem;
  accent-color: var(--teal);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.checklist-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.cp-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 0.35s var(--ease);
}

/* Recommend */

.recommend-panel {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 232, 196, 0.3);
  background: linear-gradient(160deg, var(--teal-dim), transparent 70%), var(--bg);
  padding: 1.1rem 1.15rem;
  margin-bottom: 1.1rem;
}

.recommend-panel .rec-tool {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--teal);
  margin: 0 0 0.4rem;
  letter-spacing: 0.04em;
}

.recommend-panel .rec-why {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.recommend-panel .rec-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.rec-chip {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--muted);
}

.rec-chip.cost {
  border-color: rgba(255, 176, 32, 0.4);
  color: var(--amber);
  background: var(--amber-dim);
}

/* Table */

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 420px;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.compare-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--bg);
}

.compare-table th:nth-child(2) {
  color: var(--teal);
}

.compare-table th:nth-child(3) {
  color: var(--blue);
}

.compare-table td:first-child {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.compare-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Dropzone / preview */

.dropzone {
  border: 1.5px dashed var(--border-bright);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(0, 232, 196, 0.02) 8px,
      rgba(0, 232, 196, 0.02) 16px
    ),
    var(--bg);
  min-height: 220px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(0, 232, 196, 0.15);
}

.dropzone.dragover {
  border-color: var(--teal);
  background: var(--teal-dim);
  box-shadow: 0 0 30px rgba(0, 232, 196, 0.15);
}

.dropzone-idle {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}

.dropzone-idle p {
  margin: 0.2rem 0;
}

.dropzone-idle .muted {
  font-size: 0.8rem;
  color: var(--faint);
}

.drop-icon {
  font-size: 1.5rem;
  color: var(--teal);
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.dropzone-preview {
  width: 100%;
  padding: 0.75rem;
}

#depthCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  background: #050608;
  image-rendering: auto;
}

.preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1;
}

.inline-field input[type="range"] {
  flex: 1;
  accent-color: var(--teal);
}

.height-scale {
  margin-top: 0.9rem;
}

.hs-bar {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #050608 0%, #5a6570 50%, #f4f7fa 100%);
  border: 1px solid var(--border);
}

.hs-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--faint);
}

/* Config output */

.config-output {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 1.15rem 1.2rem;
  margin-top: 0.25rem;
}

.config-output h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  color: var(--teal);
}

.config-output .mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--teal-dim);
  border: 1px solid rgba(0, 232, 196, 0.4);
  color: var(--teal);
  margin-bottom: 0.9rem;
}

.config-output ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.config-output ol li {
  margin-bottom: 0.45rem;
}

.config-output ol strong {
  color: var(--text);
}

.warning-box {
  border-left: 3px solid var(--amber);
  background: var(--amber-dim);
  padding: 0.75rem 0.9rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: #e8c98a;
}

.warning-box strong {
  color: var(--amber);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.material-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.material-note em {
  color: var(--text);
  font-style: normal;
  font-weight: 600;
}

/* Footer */

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--faint);
  font-family: var(--font-mono);
}

/* Toast */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  background: var(--elevated);
  border: 1px solid rgba(0, 232, 196, 0.45);
  color: var(--text);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 232, 196, 0.15);
  font-size: 0.88rem;
  animation: toastIn 0.3s var(--ease);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.sidebar-backdrop {
  display: none;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar-w), 88vw);
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: none;
  }

  .sidebar-close {
    display: block;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 35;
    backdrop-filter: blur(2px);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar,
  .content,
  .app-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .progress-rail {
    margin-left: 1rem;
    margin-right: 1rem;
    padding: 1rem 0.5rem 0.85rem;
  }

  .rail-track {
    left: 8%;
    right: 8%;
    top: 1.9rem;
  }

  .ps-label {
    font-size: 0.65rem;
    max-width: 5.5rem;
  }

  .ps-dot {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
  }

  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .brand-beam {
    animation: none;
    transform: none;
    opacity: 0.5;
  }
}
