/* ============================================================
   3D Studio — Workspace UI
   Single-layer dark workspace. No floating promotions.
   ============================================================ */

:root {
  /* Surface — slightly cooler graphite with more layered depth */
  --bg: #0a0b0f;
  --surface: #13151b;
  --surface-2: #1a1d25;
  --surface-3: #232733;
  --surface-raised: #2a2e3d;

  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(167, 139, 250, 0.36);

  --text: #ecedf4;
  --text-dim: #9499a8;
  --text-mute: #5c6070;

  /* Accent — violet. Distinctive, premium, doesn't fight status colors */
  --accent: #a78bfa;
  --accent-2: #c4b5fd;
  --accent-deep: #8b5cf6;
  --accent-soft: rgba(167, 139, 250, 0.12);
  --accent-line: rgba(167, 139, 250, 0.38);
  --accent-glow: rgba(167, 139, 250, 0.55);

  /* Secondary highlight — cyan, for occasional contrast */
  --highlight: #67e8f9;
  --highlight-soft: rgba(103, 232, 249, 0.10);

  /* Status — distinctly hued so they never compete with the accent */
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.10);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.10);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.10);

  --kbd-bg: rgba(255, 255, 255, 0.06);

  --font-ui: "SF Pro Text", "Inter", "Helvetica Neue", system-ui, sans-serif;
  --font-display: "SF Pro Display", "Inter Tight", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, "Menlo", monospace;

  /* Width system — three canonical sizes used consistently */
  --shell-max: 1440px;   /* workspace + cmdbar + statusbar */
  --reading-max: 1140px; /* home, SEO body, prose */
  --side-gutter: 28px;   /* min horizontal padding at the edges */

  --bar-h: 52px;
  --statusbar-h: 30px;
  --pane-pad: 22px;
  --pane-pad-y: 22px;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 0 0 1px rgba(167, 139, 250, 0.18), 0 16px 36px rgba(167, 139, 250, 0.18);

  color-scheme: dark;
}

/* Focus ring shared across all interactive elements */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--text); }

/* ============== Command bar (global chrome) ============== */

.cmdbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  height: var(--bar-h);
  /* Full-bleed bar; content aligns to shell-max */
  padding-left: max(var(--side-gutter), calc((100vw - var(--shell-max)) / 2 + var(--side-gutter)));
  padding-right: max(var(--side-gutter), calc((100vw - var(--shell-max)) / 2 + var(--side-gutter)));
  background: rgba(10, 11, 15, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
}

.cmd-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.cmd-brand-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 55%, var(--accent-deep) 100%);
  color: #1a0f33;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 4px 14px rgba(139, 92, 246, 0.45);
}

.cmd-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.cmd-crumbs .sep {
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.cmd-crumbs .now {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.cmd-pkg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-pkg::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  flex-shrink: 0;
}

.cmd-pkg.live::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(94, 215, 166, 0.18); }
.cmd-pkg em { color: var(--text); font-style: normal; }

/* ============== Package switcher (replaces single .cmd-pkg) ============== */

.pkg-switcher {
  position: relative;
}

.pkg-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.pkg-switcher__trigger:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); }

.pkg-switcher__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  flex-shrink: 0;
}

.pkg-switcher__dot.live {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(94, 215, 166, 0.18);
}

.pkg-switcher__label {
  display: grid;
  gap: 1px;
  text-align: left;
  max-width: 200px;
  overflow: hidden;
}

.pkg-switcher__label strong {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pkg-switcher__label small {
  display: block;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pkg-switcher__caret {
  color: var(--text-mute);
  font-size: 11px;
  margin-left: 2px;
}

.pkg-switcher__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-height: 70vh;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 30;
}

.pkg-switcher.open .pkg-switcher__menu { display: block; }

.pkg-switcher__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pkg-switcher__new {
  color: var(--accent-2);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

.pkg-switcher__new:hover { color: var(--text); }

.pkg-switcher__storage {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.pkg-switcher__storage-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.pkg-switcher__storage-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.pkg-switcher__storage.mid .pkg-switcher__storage-bar span {
  background: linear-gradient(90deg, var(--accent), var(--warn));
}

.pkg-switcher__storage.over .pkg-switcher__storage-bar span {
  background: linear-gradient(90deg, var(--warn), var(--bad));
}

.pkg-switcher__storage-text {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.pkg-switcher__storage.over .pkg-switcher__storage-text { color: var(--bad); }
.pkg-switcher__storage.mid .pkg-switcher__storage-text { color: var(--warn); }

.pkg-switcher__list {
  display: grid;
  gap: 2px;
}

.pkg-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-radius: 10px;
  background: transparent;
  transition: background 0.14s ease;
}

.pkg-row:hover { background: rgba(255, 255, 255, 0.05); }
.pkg-row.active { background: var(--accent-soft); }

.pkg-row__main {
  display: grid;
  gap: 2px;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  min-width: 0;
}

.pkg-row__main strong {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pkg-row__main small {
  display: block;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pkg-row.active .pkg-row__main strong { color: var(--accent-2); }
.pkg-row.active .pkg-row__main strong::after {
  content: " ✓";
  color: var(--ok);
  font-family: var(--font-mono);
  font-size: 11px;
}

.pkg-row__del {
  width: 28px;
  height: 28px;
  margin-right: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-mute);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.pkg-row:hover .pkg-row__del { opacity: 1; }
.pkg-row__del:hover { background: rgba(243, 123, 123, 0.14); color: var(--bad); }

.pkg-row--empty {
  display: grid;
  gap: 4px;
  padding: 18px 14px 16px;
  text-align: center;
  background: transparent;
}

.pkg-row--empty strong { color: var(--text-dim); font-size: 13px; }
.pkg-row--empty small { color: var(--text-mute); font-family: var(--font-mono); font-size: 11px; }

/* ============== Report row · stale variant ============== */

.mini-row.stale {
  color: var(--warn);
}

.mini-row.stale strong { color: var(--warn); }
.mini-row.stale span { color: var(--warn); }
.mini-row.stale span::before { content: "⚠ "; font-family: var(--font-mono); }

.mini-row.ok strong { color: var(--text); }
.mini-row.ok span { color: var(--ok); }
.mini-row.ok span::before { content: "✓ "; font-family: var(--font-mono); }

.cmd-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.cmd-lang:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-2);
}

.cmd-menu {
  position: relative;
}

.cmd-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}

.cmd-menu-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.cmd-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 240px;
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: none;
}

.cmd-menu.open .cmd-menu-list { display: block; }

.cmd-menu-group {
  padding: 8px 10px 4px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cmd-menu-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.cmd-menu-list a:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.cmd-menu-list a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }

.cmd-menu-list a kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-mute);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--kbd-bg);
}

/* ============== App shell ============== */

.app {
  min-height: calc(100vh - var(--bar-h) - var(--statusbar-h));
  max-width: var(--shell-max);
  margin: 0 auto;
  background: var(--bg);
}

.app--workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
}

.app--workspace.no-right { grid-template-columns: 320px minmax(0, 1fr); }
.app--workspace.no-left { grid-template-columns: minmax(0, 1fr) 320px; }
.app--single { display: block; }

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}

.pane + .pane { border-left: 1px solid var(--border); }

.pane--canvas { background: #0a0a0c; }
.pane--meta { background: var(--surface); }

.pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px var(--pane-pad) 12px;
  border-bottom: 1px solid var(--border);
}

.pane__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text);
}

.pane__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pane__head--stacked { display: block; }
.pane__head--stacked .pane__title { margin-top: 2px; }

.pane__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px var(--pane-pad) 22px;
  flex: 1 1 auto;
  overflow: auto;
}

.pane__body--flush { padding: 0; gap: 0; }
.pane__body--center { align-items: stretch; justify-content: stretch; }

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

.pane__section + .pane__section {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.pane__section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============== Stage section (consistent workspace padding) ============== */

.stage-section {
  padding: 28px 38px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.stage-section--flush { padding-top: 22px; }
.stage-section--soft { background: rgba(255, 255, 255, 0.015); }

.stage-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.stage-split > .stage-section {
  border-top: 0;
}

.stage-section + .stage-section { border-top: 1px solid var(--border); }

.stage-section > .tools__head,
.stage-section > h3.pane__section-title {
  margin-bottom: 14px;
}

.stage-section h3.pane__section-title:not(:first-child) {
  margin-top: 18px;
}

.stage-section .pane__section-title { margin-bottom: 10px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 4px;
}

.detail-grid > section .pane__section-title { margin-bottom: 10px; }

@media (max-width: 900px) {
  .stage-section { padding: 22px 22px 26px; }
  .stage-split { grid-template-columns: 1fr; }
  .detail-grid { gap: 20px; }
}

/* ============== Hero / Stage banner (single per page, restrained) ============== */

.stage-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  padding: 36px 38px 28px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 280px at 0% 0%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 220px at 100% 0%, var(--highlight-soft), transparent 60%),
    var(--bg);
}

.stage-banner__eyebrow {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stage-banner__title {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}

.stage-banner__lead {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}

.stage-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ============== Buttons ============== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.08s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary {
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 60%, var(--accent-deep) 100%);
  border-color: var(--accent);
  color: #150c2e;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 20px rgba(139, 92, 246, 0.28);
}
.btn--primary:hover {
  background: linear-gradient(180deg, #d8ccff 0%, var(--accent-2) 60%, var(--accent) 100%);
  border-color: var(--accent-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 12px 28px rgba(139, 92, 246, 0.42);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}
.btn--ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); border-color: transparent; }

.btn--row {
  width: 100%;
  justify-content: space-between;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
}
.btn--row::after {
  content: "→";
  font-family: var(--font-mono);
  color: var(--text-mute);
  font-size: 14px;
}
.btn--row:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.btn--row:hover::after { color: var(--accent-2); }

.btn-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Legacy alias kept so unchanged page scripts continue to render usable buttons. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.08s;
}
.button:hover { background: rgba(255, 255, 255, 0.06); }
.button:active { transform: scale(0.98); }
.button.dark {
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 60%, var(--accent-deep) 100%);
  border-color: var(--accent);
  color: #150c2e;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 18px rgba(139, 92, 246, 0.24);
}
.button.dark:hover { filter: brightness(1.08); }
.button.secondary { color: var(--text-dim); }
.button.light { color: var(--text); }

/* ============== Dropzone ============== */

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 132px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.dropzone::before {
  content: "↑";
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 30px;
}

.dropzone strong { color: var(--text); font-weight: 600; }
.dropzone .drop-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.dropzone.dragover::before { background: var(--accent); color: #0a0a14; }

/* Upload summary */
.upload-summary { margin: 0; }
.upload-summary ul { list-style: none; display: grid; gap: 4px; padding: 0; margin: 0; }
.upload-summary li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}
.upload-summary li strong { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.upload-summary li.bad { background: rgba(243, 123, 123, 0.10); color: var(--bad); }

/* ============== Form field ============== */

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

.field label,
.small-label {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="search"],
.field input:not([type]),
.field select,
.field textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.field textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-line);
  background: rgba(122, 147, 255, 0.05);
}

.field input[type="color"] {
  padding: 3px;
  height: 38px;
  width: 100%;
  cursor: pointer;
  background: transparent;
}

.field input[type="range"] {
  width: 100%;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  accent-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* ============== Stat lists ============== */

.stat-list {
  display: grid;
  grid-template-columns: minmax(80px, auto) 1fr;
  gap: 7px 16px;
  margin: 0;
  font-size: 13px;
}

.stat-list dt {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: center;
}

.stat-list dd {
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.metric-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface);
}

.metric-grid strong {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}

.metric-grid span {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============== Check list ============== */

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.check-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
}

.check-list li::before {
  content: "•";
  width: 14px;
  text-align: center;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.check-list li.ok { border-color: rgba(94, 215, 166, 0.28); background: rgba(94, 215, 166, 0.06); color: var(--text); }
.check-list li.ok::before { color: var(--ok); content: "✓"; }
.check-list li.warn { border-color: rgba(240, 196, 106, 0.28); background: rgba(240, 196, 106, 0.06); color: var(--text); }
.check-list li.warn::before { color: var(--warn); content: "!"; }
.check-list li.bad { border-color: rgba(243, 123, 123, 0.28); background: rgba(243, 123, 123, 0.06); color: var(--text); }
.check-list li.bad::before { color: var(--bad); content: "✕"; }
.check-list li strong { color: var(--text); font-weight: 500; margin-right: 2px; }

/* ============== Status (inline) ============== */

.status {
  min-height: 18px;
  margin: 0;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.4;
}

.status:not(:empty)::before {
  content: "› ";
  color: var(--text-mute);
}

/* ============== Progress ============== */

.progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.18s ease;
}

/* ============== Canvas / Viewer ============== */

.viewer,
.canvas-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 520px;
  background:
    radial-gradient(900px 360px at 50% 110%, var(--accent-soft), transparent 65%),
    radial-gradient(500px 220px at 50% -10%, var(--highlight-soft), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 36px),
    #07080c;
}

.viewer canvas,
.canvas-box canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.canvas-box canvas {
  width: min(100%, 760px);
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

canvas.preview-canvas {
  width: 100%;
  height: auto;
  min-height: 220px;
  border-radius: 10px;
  background: var(--surface);
}

.viewer-message {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}

/* ============== Reference board ============== */

.board {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 600px;
  background:
    radial-gradient(900px 400px at 50% 50%, rgba(122, 147, 255, 0.06), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 40px),
    #0a0a0c;
  overflow: hidden;
}

.ref-item {
  position: absolute;
  width: 220px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  cursor: grab;
  user-select: none;
}

.ref-item.selected { outline: 2px solid var(--accent); outline-offset: 3px; }
.ref-item.locked { cursor: default; opacity: 0.85; }
.ref-item:active { cursor: grabbing; }
.ref-item img { display: block; width: 100%; height: auto; }
.ref-caption { padding: 6px 10px; color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); }

.ref-note {
  position: absolute;
  min-width: 200px;
  min-height: 80px;
  padding: 12px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* ============== Swatches ============== */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.swatch {
  display: flex;
  align-items: end;
  min-height: 100px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

/* ============== Tables / rows ============== */

.row-list {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
}

.row strong { display: block; color: var(--text); font-size: 13px; font-weight: 500; }
.row small { display: block; margin-top: 2px; color: var(--text-mute); font-family: var(--font-mono); font-size: 11px; }
.row .meta { font-family: var(--font-mono); color: var(--text-dim); font-size: 11.5px; white-space: nowrap; }

/* Legacy alias used by shared-global renderExports/report renderers */
.table-list {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
}
.table-row strong { display: block; color: var(--text); font-size: 13px; font-weight: 500; }
.table-row small { display: block; margin-top: 2px; color: var(--text-mute); font-family: var(--font-mono); font-size: 11px; }

/* ============== Next-action list (renderNextActions output) ============== */

.next-actions {
  display: grid;
  gap: 6px;
}

.next-actions .button,
.next-actions .btn {
  width: 100%;
  justify-content: space-between;
  height: 40px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
}

.next-actions .button::after,
.next-actions .btn::after {
  content: "→";
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.next-actions .button:hover,
.next-actions .btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.next-actions .button:hover::after,
.next-actions .btn:hover::after { color: var(--accent-2); }

/* ============== Timeline (workflow steps) ============== */

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.timeline .step {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 16px 16px 18px;
  background: var(--surface);
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  min-height: 110px;
}

.timeline .step:last-child { border-right: 0; }

.step-index {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.timeline .step.ok { background: linear-gradient(180deg, rgba(122,147,255,0.10), transparent 70%), var(--surface); color: var(--text); }
.timeline .step.ok .step-index { background: var(--accent); color: #0a0a14; }
.timeline .step.todo { opacity: 0.85; }

.timeline .step strong {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.timeline .step small,
.timeline .step span {
  display: block;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.45;
}

/* ============== Tool grid (index) ============== */

.workspace-index {
  display: grid;
  gap: 36px;
  padding: 32px 42px 60px;
}

.tools {
  display: grid;
  gap: 16px;
}

.tools__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.tools__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}

.tools__kicker {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 168px;
  padding: 22px 22px 24px;
  background: var(--surface);
  color: var(--text-dim);
  transition: background 0.18s ease, color 0.18s ease;
}

.tool::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.tool:hover { background: var(--surface-2); color: var(--text); }
.tool:hover::before { opacity: 1; }

.tool__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tool__title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}

.tool__desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  flex: 1 1 auto;
}

.tool__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
}

.tool__meta .arrow { color: var(--text-dim); }
.tool:hover .tool__meta .arrow { color: var(--accent-2); }

/* ============== Status bar (replaces task queue overlay & toast) ============== */

.statusbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--statusbar-h);
  /* Full-bleed; inner content aligned to shell-max */
  padding-left: max(var(--side-gutter), calc((100vw - var(--shell-max)) / 2 + var(--side-gutter)));
  padding-right: max(var(--side-gutter), calc((100vw - var(--shell-max)) / 2 + var(--side-gutter)));
  background: rgba(10, 11, 15, 0.92);
  border-top: 1px solid var(--border);
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.statusbar__slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.statusbar__slot--task { flex: 0 0 auto; }
.statusbar__slot--toast { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.statusbar__slot--right { margin-left: auto; }

.statusbar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
}

.statusbar__dot.running { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1.4s ease-in-out infinite; }
.statusbar__dot.done { background: var(--ok); }
.statusbar__dot.failed { background: var(--bad); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.statusbar__btn {
  background: transparent;
  border: 0;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-mute);
  font: inherit;
  cursor: pointer;
}
.statusbar__btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.task-panel {
  position: fixed;
  right: 16px;
  bottom: calc(var(--statusbar-h) + 12px);
  z-index: 26;
  width: min(360px, calc(100vw - 32px));
  max-height: 50vh;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: none;
}

.task-panel.open { display: block; }

.task-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.task-panel__body { padding: 8px; display: grid; gap: 6px; }

.task-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}
.task-item strong { color: var(--text); font-size: 12.5px; font-weight: 500; }
.task-item small { color: var(--text-mute); font-family: var(--font-mono); font-size: 11px; }
.task-item.done { background: rgba(94, 215, 166, 0.08); }
.task-item.failed { background: rgba(243, 123, 123, 0.10); }

/* ============== File rail / pills (workflow) ============== */

.file-rail {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

.file-pill {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: var(--surface);
  font-size: 13px;
}

.file-pill span { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.file-pill small { color: var(--text-mute); font-family: var(--font-mono); font-size: 11px; }

.empty-note { color: var(--text-mute); font-family: var(--font-mono); font-size: 11.5px; }

/* Workflow PBR strip / pairs */
.pbr-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.pbr-slot {
  display: grid;
  gap: 4px;
  padding: 12px 12px 14px;
  background: var(--surface);
  min-height: 80px;
}
.pbr-slot span { color: var(--text-mute); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.pbr-slot strong { color: var(--text); font-family: var(--font-mono); font-size: 11.5px; overflow-wrap: anywhere; }
.pbr-slot.ok { background: linear-gradient(180deg, rgba(122,147,255,0.10), transparent 80%), var(--surface); }
.pbr-slot.ok strong { color: var(--accent-2); }

/* Summary hero (workflow inspector) */
.summary-hero {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.summary-hero strong { color: var(--text); font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.summary-hero span { color: var(--text-dim); font-size: 12.5px; }
.summary-hero.ok { border-color: var(--accent-line); background: var(--accent-soft); }

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.summary-metrics > div { display: grid; gap: 4px; padding: 12px; background: var(--surface); }
.summary-metrics strong { font-family: var(--font-mono); color: var(--text); font-size: 18px; }
.summary-metrics span { color: var(--text-mute); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row strong { color: var(--text); font-weight: 500; }
.mini-row span { font-family: var(--font-mono); color: var(--text-mute); }

/* Texture slot used by material-viewer */
.texture-slot {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.texture-slot input[type="file"] { font-size: 12px; color: var(--text-dim); }

.texture-slots { display: grid; gap: 8px; }

/* ============== Misc ============== */

.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }

.hint {
  margin: 0;
  color: var(--text-mute);
  font-size: 12.5px;
  line-height: 1.5;
}

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

/* Legacy classnames from the old design are intentionally left unstyled.
   All page markup has been rewritten and should not reference them anymore. */

/* ============== Home page (intent-first) ============== */

.home {
  display: grid;
  gap: 56px;
  padding: 48px var(--side-gutter) 72px;
}

.home > section {
  width: 100%;
  max-width: var(--reading-max);
  margin: 0 auto;
}

.home-hero {
  text-align: center;
  padding-top: 24px;
}

.home-hero__eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.014em;
  color: var(--text);
  max-width: 14ch;
  margin-left: auto;
  margin-right: auto;
}

.home-hero h1 .accent {
  background: linear-gradient(110deg, var(--accent-2) 0%, var(--accent) 55%, var(--accent-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}

.home-hero h1 .accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

.home-hero__lead {
  max-width: 620px;
  margin: 20px auto 36px;
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.6;
}

.home-drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  width: 100%;
  max-width: 760px;
  min-height: 200px;
  margin: 0 auto;
  padding: 32px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 20px;
  background:
    radial-gradient(700px 240px at 50% 0%, var(--accent-soft), transparent 65%),
    radial-gradient(400px 180px at 80% 100%, var(--highlight-soft), transparent 70%),
    var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.16s ease, box-shadow 0.18s ease;
}

.home-drop:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(139, 92, 246, 0.18);
}

.home-drop.dragover {
  border-color: var(--accent);
  border-style: solid;
  background:
    radial-gradient(700px 240px at 50% 0%, rgba(167, 139, 250, 0.22), transparent 65%),
    var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.18), 0 18px 40px rgba(139, 92, 246, 0.25);
}

.home-drop__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(167, 139, 250, 0.04));
  border: 1px solid var(--accent-line);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.18);
}

.home-drop strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.home-drop span {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.home-hero__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

/* Resume strip */
.home-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 14px 18px 14px 20px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background:
    linear-gradient(90deg, var(--accent-soft), transparent 70%),
    var(--surface);
}

.home-resume__label {
  margin: 0 0 3px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-resume strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.home-resume__meta {
  display: inline-block;
  margin-left: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.home-resume .btn { margin-left: auto; }

/* Task cards (intent-first) */
.home-pick__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
}

/* Featured workflow card — full width, primary visual weight */
.task-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  padding: 30px 34px 32px;
  background:
    radial-gradient(900px 360px at 0% 0%, var(--accent-soft), transparent 60%),
    radial-gradient(600px 240px at 100% 100%, var(--highlight-soft), transparent 70%),
    var(--surface);
  border-color: var(--accent-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 36px rgba(139, 92, 246, 0.18);
}

.task-card--featured::before {
  background: linear-gradient(135deg, transparent 40%, rgba(167, 139, 250, 0.18));
}

.task-card--featured:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 48px rgba(139, 92, 246, 0.34), 0 0 0 1px var(--accent);
}

.task-card--featured > div { display: grid; gap: 10px; align-content: end; }

.task-card--featured .task-card__num {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.18);
  color: var(--accent-2);
  letter-spacing: 0.14em;
}

.task-card--featured h3 {
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1.12;
  max-width: 26ch;
}

.task-card--featured p {
  font-size: 14.5px;
  max-width: 56ch;
}

.task-card--featured .task-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 22px;
  border-radius: 11px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent) 60%, var(--accent-deep));
  color: #150c2e;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 10px 24px rgba(139, 92, 246, 0.32);
}

.task-card--featured .task-card__cta::after { content: "→"; }

@media (max-width: 760px) {
  .task-card--featured { grid-template-columns: 1fr; padding: 26px 22px 28px; }
  .task-card--featured .task-card__cta { width: 100%; justify-content: center; }
}

.task-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 26px 28px 28px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(167, 139, 250, 0.06), transparent 70%),
    var(--surface);
  color: var(--text);
  overflow: hidden;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(167, 139, 250, 0.12));
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.task-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-line);
}

.task-card:hover::before { opacity: 1; }

.task-card__num {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.task-card h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}

.task-card p {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
}

.task-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 500;
}

.task-card__cta::after { content: "→"; font-family: var(--font-mono); }

/* Why list */
.why-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--border);
  overflow: hidden;
}

.why-list li {
  display: grid;
  gap: 6px;
  padding: 20px 22px;
  background: var(--surface);
}

.why-list li strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.why-list li span {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
}

/* All tools compact directory */
.home-all__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--border);
  overflow: hidden;
}

.home-all__group {
  background: var(--surface);
  padding: 18px 18px 20px;
}

.home-all__group h3 {
  margin: 0 0 12px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-all__group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1px;
  background: var(--border);
}

.home-all__group li {
  background: var(--surface);
}

.home-all__group a {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
}

.home-all__group a:hover { color: var(--accent-2); }

.home-all__group a span {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
}

@media (max-width: 1100px) {
  .home-all__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .home { gap: 44px; padding: 32px 18px 56px; }
  .home-pick__grid { grid-template-columns: 1fr; }
  .why-list { grid-template-columns: 1fr; }
  .home-all__grid { grid-template-columns: 1fr; }
  .home-resume { flex-direction: column; align-items: flex-start; }
  .home-resume .btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* ============== FAQ accordion (workflow page + blog posts) ============== */

.workflow-faq {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.workflow-faq details {
  background: var(--surface);
  padding: 14px 18px;
}

.workflow-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 500;
  list-style: none;
}

.workflow-faq summary::-webkit-details-marker { display: none; }

.workflow-faq summary::after {
  content: "+";
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 18px;
  transition: transform 0.18s ease;
}

.workflow-faq details[open] summary { color: var(--accent-2); }
.workflow-faq details[open] summary::after { content: "−"; color: var(--accent-2); transform: rotate(180deg); }

.workflow-faq p {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ============== Keyboard shortcut help dialog ============== */

.kbd-help {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 11, 15, 0.7);
  backdrop-filter: blur(8px);
}

.kbd-help__panel {
  width: min(440px, 100%);
  padding: 20px 22px 22px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.kbd-help__panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.kbd-help__panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}

.kbd-help__panel li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.kbd-help__panel li:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }

.kbd-help__panel kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--kbd-bg);
  color: var(--text);
}

/* ============== SEO footer (content for indexing + internal links) ============== */

.seo-foot {
  border-top: 1px solid var(--border);
  background: var(--surface);
  /* Full-bleed background; inner content sits at reading-max centered to viewport */
  padding-top: 40px;
  padding-bottom: 56px;
  padding-left: max(var(--side-gutter), calc((100vw - var(--shell-max)) / 2 + var(--side-gutter)));
  padding-right: max(var(--side-gutter), calc((100vw - var(--shell-max)) / 2 + var(--side-gutter)));
}

.seo-foot__inner {
  width: 100%;
  max-width: var(--reading-max);
  margin: 0 auto;
}

.seo-foot h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}

.seo-foot h2 + p {
  margin: 0 0 28px;
  max-width: 880px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.7;
}

.seo-foot h2:not(:first-child) {
  margin-top: 4px;
}

.related-tools {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.related-tools li { display: block; background: var(--surface); }

.related-tools a {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  color: var(--text-dim);
  transition: background 0.18s ease, color 0.18s ease;
}

.related-tools a:hover { background: var(--surface-2); color: var(--text); }
.related-tools a strong { color: var(--text); font-weight: 500; font-size: 14px; }
.related-tools a span { color: var(--text-mute); font-size: 12.5px; line-height: 1.45; }

@media (max-width: 760px) {
  .seo-foot { padding: 28px 18px 48px; }
  .related-tools { grid-template-columns: 1fr; }
}


/* ============== Responsive ============== */

@media (max-width: 1180px) {
  .app--workspace,
  .app--workspace.no-right,
  .app--workspace.no-left {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .pane--inspector { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 760px) {
  :root { --pane-pad: 18px; --side-gutter: 16px; }
  .app--workspace,
  .app--workspace.no-right,
  .app--workspace.no-left { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--border); }
  .stage-banner { padding: 28px 22px 20px; grid-template-columns: 1fr; }
  .stage-banner__actions { justify-content: flex-start; }
  .workspace-index { padding: 24px 22px 48px; }
  .timeline { grid-template-columns: 1fr; }
  .timeline .step { border-right: 0; border-bottom: 1px solid var(--border); }
  .pbr-strip, .summary-metrics { grid-template-columns: 1fr 1fr; }
  .cmdbar { padding-left: 12px; padding-right: 12px; gap: 10px; }
  .cmd-pkg { max-width: 180px; }
  /* Hide breadcrumb chain on small screens — keep brand + meta */
  .cmd-crumbs { display: none; }
  /* Collapse pkg-switcher label to icon only on phone */
  .pkg-switcher__label { max-width: 100px; }
  .pkg-switcher__label small { display: none; }
  .cmd-menu-btn { padding: 0 8px; font-size: 11px; }
  .cmd-lang { min-width: 32px; padding: 0 8px; font-size: 11px; }
  /* Status bar tighter */
  .statusbar { padding-left: 12px; padding-right: 12px; gap: 10px; font-size: 10px; }
  .statusbar__slot--right { display: none; }
}

@media (max-width: 480px) {
  /* Phone-specific tweaks */
  .home { gap: 36px; padding: 24px 14px 48px; }
  .home-hero { padding-top: 8px; }
  .home-hero__eyebrow { font-size: 10px; padding: 4px 9px; }
  .home-hero h1 { font-size: 30px; line-height: 1.08; max-width: 100%; }
  .home-hero__lead { font-size: 14px; margin: 16px auto 24px; }
  .home-drop { min-height: 170px; padding: 22px 18px; }
  .home-drop__icon { width: 40px; height: 40px; font-size: 18px; }
  .home-drop strong { font-size: 15px; }
  .home-hero__chips { gap: 8px; }
  .home-hero__chips .btn { font-size: 12px; padding: 0 12px; height: 32px; }
  .home-pick__grid { gap: 12px; }
  .task-card { padding: 22px 20px; }
  .task-card--featured { padding: 24px 22px; }
  .task-card--featured h3 { font-size: 20px; }
  .task-card__cta { font-size: 12px; }
  .task-card--featured .task-card__cta { height: 40px; padding: 0 18px; font-size: 13px; }
  .why-list li { padding: 16px 18px; }
  .home-all__group { padding: 14px 16px 16px; }
  /* Workspace stage banner narrower text */
  .stage-banner__title { font-size: 22px; }
  .stage-banner__lead { font-size: 13px; }
  /* Hide pkg switcher caret to save space */
  .pkg-switcher__caret { display: none; }
  /* SEO foot a bit denser */
  .seo-foot { padding-top: 28px; padding-bottom: 44px; }
  .seo-foot h2 { font-size: 16px; }
  /* Tighter stage section padding */
  .stage-section { padding: 18px 18px 22px; }
  /* Keyboard help dialog scales */
  .kbd-help__panel { padding: 16px 18px 18px; }
}
