/* Davinci-ProUser — wireframe cockpit
   palette: deep violet/navy base · magenta + gold accents (Lebz default) */

:root {
  --bg: #0d0b1a;
  --bg-2: #14102a;
  --panel: #181336;
  --panel-2: #1f1844;
  --line: #2c2358;
  --violet: #7c5cff;
  --magenta: #ff3d9a;
  --gold: #f5c451;
  --green: #3ddc97;
  --amber: #f5a851;
  --red: #ff5c7a;
  --blue: #57b3ff;
  --ink: #efeaff;
  --ink-dim: #9c92c7;
  --ink-faint: #5e5588;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.shell { display: flex; height: 100vh; }

/* ───────── sidebar ───────── */
.side {
  width: 252px; min-width: 252px;
  background: linear-gradient(180deg, var(--bg-2) 0%, #0f0c20 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 14px 14px 16px;
  -webkit-app-region: drag;
}
.side button, .side .conn { -webkit-app-region: no-drag; }

.brand { display: flex; gap: 11px; align-items: center; padding: 34px 6px 22px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px; letter-spacing: -1px;
  box-shadow: 0 4px 18px rgba(124, 92, 255, .35);
}
.brand-mark span { color: var(--gold); }
.brand-text h1 { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.brand-text .accent { color: var(--magenta); }
.brand-text p {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 2.2px;
  color: var(--ink-faint); margin-top: 2px;
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--ink-faint); padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--ink-dim);
  font-size: 13.5px; font-family: inherit; text-align: left;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: all .15s ease;
}
.nav-item i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
.nav-item:hover { background: rgba(124, 92, 255, .12); color: var(--ink); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(124, 92, 255, .22), rgba(255, 61, 154, .10));
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--violet);
}

.side-foot { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.conn { display: flex; gap: 9px; align-items: center; padding: 4px 6px; }
.conn .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: pulse 2.2s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.conn strong { font-size: 12px; display: block; }
.conn em { font-size: 10.5px; color: var(--ink-faint); font-style: normal; }
.ver { font-size: 10px; color: var(--ink-faint); padding: 8px 6px 0; letter-spacing: .4px; }

/* ───────── main ───────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 58px; min-height: 58px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 26px; border-bottom: 1px solid var(--line);
  -webkit-app-region: drag;
}
.crumb { font-size: 13px; color: var(--ink-dim); letter-spacing: .3px; }
.top-right { display: flex; gap: 8px; }
.pill {
  font-size: 10.5px; letter-spacing: .6px; padding: 5px 11px;
  border-radius: 99px; border: 1px solid;
}
.pill-gold { color: var(--gold); border-color: rgba(245, 196, 81, .4); background: rgba(245, 196, 81, .07); }
.pill-magenta { color: var(--magenta); border-color: rgba(255, 61, 154, .4); background: rgba(255, 61, 154, .07); }

.pane { display: none; padding: 26px 30px; overflow-y: auto; flex: 1; }
.pane.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* dashboard */
.hero { padding: 18px 0 26px; }
.hero h2 { font-size: 25px; font-weight: 650; line-height: 1.3; letter-spacing: .1px; }
.hero h2 em {
  font-style: italic; font-family: Georgia, serif; font-weight: 500;
  background: linear-gradient(90deg, var(--magenta), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--ink-dim); font-size: 13px; margin-top: 10px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px;
  padding: 16px 18px;
}
.stat b { font-size: 30px; font-weight: 750; display: block; }
.stat span { font-size: 11px; color: var(--ink-dim); letter-spacing: .5px; text-transform: uppercase; }
.s-green b { color: var(--green); } .s-amber b { color: var(--amber); }
.s-red b { color: var(--red); } .s-blue b { color: var(--blue); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px;
  padding: 18px 20px;
}
.card h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--gold); margin-bottom: 14px; font-weight: 650;
}
.doors { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.doors b { display: block; font-size: 13.5px; margin-bottom: 2px; color: var(--ink); }
.doors span { font-size: 12px; color: var(--ink-dim); line-height: 1.45; }
.doors em { color: var(--magenta); font-style: normal; }
.queue { list-style: none; counter-reset: q; display: flex; flex-direction: column; gap: 9px; }
.queue li { font-size: 12.5px; color: var(--ink-dim); line-height: 1.4; }
.queue code {
  color: var(--violet); background: rgba(124, 92, 255, .12);
  padding: 2px 7px; border-radius: 6px; font-size: 11px; margin-right: 7px;
}

/* wireframe primitives */
.wire-head { padding: 6px 0 18px; }
.wire-head h2 { font-size: 21px; font-weight: 650; }
.wire-head p { color: var(--ink-dim); font-size: 12.5px; margin-top: 5px; }
.wire-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; margin-bottom: 14px; }
.wire {
  border: 1.5px dashed rgba(124, 92, 255, .45);
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, rgba(124,92,255,.04) 0 14px, transparent 14px 28px);
  display: grid; place-items: center;
  color: var(--ink-faint); font-size: 12px; letter-spacing: .4px;
  padding: 10px 16px; text-align: center; line-height: 1.5;
  margin-bottom: 14px;
}
.wire-row .wire { margin-bottom: 0; }

/* console mock */
.console-mock {
  background: #0a0816; border: 1px solid var(--line); border-radius: 12px;
  font-family: "SF Mono", Menlo, monospace; font-size: 12.5px;
  padding: 18px 20px; margin-bottom: 14px; line-height: 2;
}
.console-mock .pr { color: var(--magenta); margin-right: 8px; }
.console-mock .out { color: var(--gold); opacity: .85; }
.cursor { animation: blink 1.1s steps(1) infinite; color: var(--violet); }
@keyframes blink { 50% { opacity: 0; } }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ═══════════ v0.4.0 — interactive ledger · bridge era ═══════════ */

/* bridge connection dot states */
.conn .dot-green { background: var(--green); box-shadow: 0 0 10px var(--green); }
.conn .dot-gold { background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* buttons */
.btn {
  font-family: inherit; font-size: 12px; letter-spacing: .3px;
  border-radius: 8px; padding: 7px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  transition: all .15s ease;
}
.btn:hover { border-color: var(--violet); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-run {
  background: linear-gradient(135deg, rgba(124,92,255,.30), rgba(255,61,154,.18));
  border-color: rgba(124,92,255,.55); font-weight: 600;
}
.btn-run:hover { box-shadow: 0 2px 14px rgba(124,92,255,.35); }
.btn-ghost { background: transparent; color: var(--ink-dim); font-size: 11px; }
.btn-probe { width: 100%; text-align: left; margin-bottom: 6px; }

.run-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.run-out {
  background: #0a0816; border: 1px solid var(--line); border-radius: 10px;
  font-family: "SF Mono", Menlo, monospace; font-size: 11.5px; line-height: 1.6;
  color: var(--ink-dim); padding: 12px 14px; margin-top: 10px;
  white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow-y: auto;
}
.probe-row { margin-bottom: 4px; }
.cmd-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.cmd-row code {
  background: #0a0816; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font-size: 11.5px; color: var(--gold); flex: 1;
  min-width: 0; overflow-wrap: anywhere;
}
.hint-inline { font-size: 10px; color: var(--ink-faint); text-transform: none; letter-spacing: .4px; }
code.inline {
  background: rgba(124,92,255,.12); color: var(--violet);
  padding: 1px 6px; border-radius: 5px; font-size: .92em;
}

/* dashboard stat cards become triggers */
.stat-click { cursor: pointer; text-align: left; font-family: inherit; color: var(--ink); transition: all .15s ease; }
.stat-click:hover { border-color: var(--violet); transform: translateY(-2px); }
.stat-click em { display: block; font-size: 10px; color: var(--ink-faint); font-style: normal; margin-top: 6px; line-height: 1.45; }
.exp-state { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-faint); }
.exp-state-running { color: var(--gold); border-color: rgba(245,196,81,.5); }
.exp-state-partial { color: var(--amber); border-color: rgba(245,168,81,.5); }
.exp-state-seeded { color: var(--violet); border-color: rgba(124,92,255,.5); }
.exp-state-proven { color: var(--green); border-color: rgba(61,220,151,.5); }
.exp-state-disproven { color: var(--red); border-color: rgba(255,92,122,.5); }
.bridge-line { font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; margin-bottom: 6px; }
.bridge-line.ok { color: var(--green); }
.bridge-line.warn { color: var(--amber); }
.bridge-line.dim { color: var(--ink-faint); font-size: 11.5px; }
.bridge-line b { color: var(--ink); }

/* ledger toolbar */
.ledger-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ledger-toolbar input[type="search"] {
  flex: 1; min-width: 220px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 14px; color: var(--ink); font-family: inherit; font-size: 12.5px;
}
.ledger-toolbar input[type="search"]:focus { outline: none; border-color: var(--violet); }
.ledger-toolbar select {
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; color: var(--ink); font-family: inherit; font-size: 12px;
}
.chips { display: flex; gap: 6px; }
.fchip {
  font-family: inherit; font-size: 11.5px; padding: 7px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-dim); cursor: pointer;
  transition: all .15s ease;
}
.fchip:hover { border-color: var(--violet); }
.fchip.on { border-color: var(--violet); background: rgba(124,92,255,.18); color: var(--ink); }
.fchip-green.on { border-color: var(--green); background: rgba(61,220,151,.14); }
.fchip-amber.on { border-color: var(--amber); background: rgba(245,168,81,.14); }
.fchip-red.on { border-color: var(--red); background: rgba(255,92,122,.14); }
.fchip-blue.on { border-color: var(--blue); background: rgba(87,179,255,.14); }

/* ledger rows */
.ledger-section {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 20px 4px 8px; flex-wrap: wrap;
}
.ledger-section b { font-size: 13px; letter-spacing: .4px; color: var(--gold); }
.ledger-section span { font-size: 11px; color: var(--ink-faint); }
.lrow {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  margin-bottom: 7px; overflow: hidden; transition: border-color .15s ease;
}
.lrow:hover { border-color: rgba(124,92,255,.55); }
.lrow.open { border-color: var(--violet); }
.lrow-green { box-shadow: inset 3px 0 0 var(--green); }
.lrow-amber { box-shadow: inset 3px 0 0 var(--amber); }
.lrow-red { box-shadow: inset 3px 0 0 var(--red); }
.lrow-blue { box-shadow: inset 3px 0 0 var(--blue); }
.lrow-head {
  display: flex; align-items: center; gap: 11px; padding: 11px 15px; cursor: pointer;
}
.lid { color: var(--violet); font-size: 11.5px; font-weight: 700; min-width: 28px; }
.lchip { font-size: 10px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.lchip-green { color: var(--green); border-color: rgba(61,220,151,.4); }
.lchip-amber { color: var(--amber); border-color: rgba(245,168,81,.4); }
.lchip-red { color: var(--red); border-color: rgba(255,92,122,.4); }
.lchip-blue { color: var(--blue); border-color: rgba(87,179,255,.4); }
.lwant { flex: 1; font-size: 13px; line-height: 1.4; }
.lexps code { color: var(--ink-faint); font-size: 10px; margin-left: 5px; }
.lcaret { color: var(--ink-faint); font-size: 11px; }
.lrow-detail { padding: 4px 16px 16px; border-top: 1px solid var(--line); margin: 0 0; background: rgba(10,8,22,.45); }
.lreal { font-size: 12.5px; color: var(--ink-dim); line-height: 1.65; padding-top: 12px; }
.lreal b { color: var(--ink); }
.lmeta { font-size: 11.5px; color: var(--ink-faint); margin-top: 9px; line-height: 1.8; }
.lmeta.dim { font-style: italic; }
.exp-chip {
  font-family: inherit; font-size: 10.5px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid rgba(124,92,255,.45); background: rgba(124,92,255,.10);
  color: var(--violet); cursor: pointer; transition: all .15s ease;
}
.exp-chip:hover { background: rgba(124,92,255,.25); color: var(--ink); }
.empty { color: var(--ink-faint); font-size: 12.5px; padding: 30px 6px; text-align: center; }

/* experiments kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kcol { background: rgba(10,8,22,.4); border: 1px solid var(--line); border-radius: 13px; padding: 12px; min-height: 120px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 2px; }
.kcol-head b { font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--gold); }
.kcol-head span { font-size: 11px; color: var(--ink-faint); }
.kcol-sub { font-size: 10px; color: var(--ink-faint); padding: 0 4px 10px; line-height: 1.4; }
.kcol-empty { color: var(--ink-faint); font-size: 11px; font-style: italic; padding: 10px 4px; line-height: 1.5; }
.kcard {
  display: block; width: 100%; text-align: left; font-family: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; color: var(--ink);
  transition: all .15s ease;
}
.kcard:hover { border-color: var(--violet); transform: translateY(-1px); }
.kcard.on { border-color: var(--magenta); box-shadow: 0 0 0 1px var(--magenta); }
.kcard code { color: var(--violet); font-size: 11px; font-weight: 700; margin-right: 7px; }
.kcard .kstate { float: right; }
.kcard p { font-size: 11.5px; line-height: 1.45; margin-top: 6px; color: var(--ink-dim); }
.kcard em { font-size: 10px; color: var(--ink-faint); font-style: normal; display: block; margin-top: 5px; }
.exp-detail-card { margin-bottom: 20px; }
.exp-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.exp-detail-head h3 { margin-bottom: 0; }

/* real console */
.console-real {
  background: #0a0816; border: 1px solid var(--line); border-radius: 12px 12px 0 0;
  font-family: "SF Mono", Menlo, monospace; font-size: 12.5px;
  padding: 16px 18px; line-height: 1.9; height: 320px; overflow-y: auto;
}
.cline-in { color: var(--ink); }
.cline-in .pr { color: var(--magenta); margin-right: 8px; }
.cline-out { color: var(--gold); opacity: .9; white-space: pre-wrap; }
.cline-err { color: var(--red); opacity: .9; white-space: pre-wrap; }
.console-input-row {
  display: flex; align-items: center; gap: 10px;
  background: #0a0816; border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 12px 12px; padding: 10px 18px;
}
.console-input-row .pr { color: var(--magenta); font-family: "SF Mono", Menlo, monospace; font-size: 12.5px; }
.console-input-row input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--ink); font-family: "SF Mono", Menlo, monospace; font-size: 12.5px;
}

/* LUT lab */
.lut-group { margin-top: 14px; }
.lut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.lut-chip {
  font-family: inherit; text-align: left; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  cursor: pointer; color: var(--ink); transition: all .15s ease;
}
.lut-chip:hover { border-color: var(--gold); }
.lut-chip.flash { border-color: var(--green); box-shadow: 0 0 10px rgba(61,220,151,.4); }
.lut-chip b { display: block; font-size: 11px; font-weight: 600; }
.lut-chip span { font-size: 9.5px; color: var(--ink-faint); }

/* module cards */
.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.module-card .lreal { padding-top: 0; }
.module-card h3 { margin-bottom: 8px; }

/* ═══════════ responsive — phone + tablet (390 / 768 verified) ═══════════ */

.shell { height: 100dvh; }

.menu-btn {
  display: none; font-family: inherit; font-size: 17px; line-height: 1;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); padding: 6px 11px; margin-right: 12px; cursor: pointer;
  -webkit-app-region: no-drag;
}
.scrim {
  position: fixed; inset: 0; z-index: 50; background: rgba(7, 5, 16, .6);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.scrim.show { opacity: 1; pointer-events: auto; }

@media (max-width: 860px) {
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: min(300px, 84vw); min-width: 0;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    box-shadow: 24px 0 60px rgba(0, 0, 0, .5);
  }
  .side.open { transform: translateX(0); }
  .menu-btn { display: inline-block; }
  .crumb { display: flex; align-items: center; }
  .brand { padding-top: 20px; }

  .topbar { padding: 0 16px; gap: 10px; }
  .pill-gold { display: none; }
  .top-right { min-width: 0; }
  .pill { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pane { padding: 18px 16px 30px; }
  .hero { padding: 8px 0 20px; }
  .hero h2 { font-size: 20px; }
  .hero h2 br { display: none; }

  .grid-2, .modules { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wire-row { grid-auto-flow: row; }
  .console-real { height: 240px; }

  /* 16px stops iOS Safari zoom-on-focus */
  .ledger-toolbar input[type="search"], .console-input-row input { font-size: 16px; }
  .chips { flex-wrap: wrap; }
  .ledger-toolbar select { flex: 1; min-width: 0; }
}

@media (max-width: 560px) {
  .topbar { height: 52px; min-height: 52px; }
  .kanban { grid-template-columns: 1fr; }
  .stat { padding: 13px 15px; }
  .stat b { font-size: 24px; }
  .lrow-head { flex-wrap: wrap; row-gap: 6px; padding: 11px 13px; }
  .lwant { order: 1; flex: 1 1 100%; }
}
