/* ============================================================================
   LumenLab — Outdoor LED Circuit Studio
   ==========================================================================*/

:root {
  --bg:            #0b0f16;
  --bg-1:          #111725;
  --bg-2:          #161d2e;
  --bg-3:          #1d2639;
  --bg-hi:         #232e45;
  --line:          #26314a;
  --line-soft:     #1c2438;

  --fg:            #e6ecf7;
  --fg-2:          #a8b6ce;
  --fg-3:          #6f7f9c;

  --accent:        #4da3ff;
  --accent-2:      #7bd3ff;
  --accent-dim:    #1e4a7a;

  --pos:           #ff5d5d;
  --neg:           #7c8aa3;
  --data:          #41d6a3;
  --ac:            #e0b040;

  --ok:            #3ddc97;
  --info:          #4da3ff;
  --warn:          #ffb23f;
  --error:         #ff5f6d;

  --radius:        10px;
  --radius-sm:     7px;
  --shadow:        0 8px 28px rgba(0,0,0,.42);
  --shadow-sm:     0 2px 10px rgba(0,0,0,.3);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: inherit; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a344c; border-radius: 6px; border: 3px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: #3a4767; }

/* ------------------------------------------------------------------ shell */

#app { display: flex; flex-direction: column; height: 100vh; }

header.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px; height: 54px; flex: none;
  background: linear-gradient(180deg, #131a29, #0e1420);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: conic-gradient(from 210deg, #ff5d5d, #ffb23f, #3ddc97, #4da3ff, #b06dff, #ff5d5d);
  box-shadow: 0 0 16px rgba(77,163,255,.45);
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; color: var(--fg-3); margin-top: -3px; }

nav.tabs { display: flex; gap: 2px; margin-left: 6px; }
nav.tabs button {
  background: none; border: 0; color: var(--fg-3); cursor: pointer;
  padding: 7px 13px; border-radius: 8px; font-weight: 550; font-size: 13px;
  transition: background .12s, color .12s; white-space: nowrap;
}
nav.tabs button:hover { color: var(--fg-2); background: var(--bg-2); }
nav.tabs button.active { color: var(--fg); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line); }
nav.tabs button .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn); margin-left: 6px; vertical-align: middle;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn {
  background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 550; font-size: 13px;
  transition: background .12s, color .12s, border-color .12s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--bg-hi); color: var(--fg); }
.btn.primary { background: var(--accent); color: #06131f; border-color: transparent; font-weight: 650; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn.danger { color: var(--error); border-color: #4a2733; }
.btn.danger:hover { background: #33202a; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ------------------------------------------------------------------ panes */

main.stage { flex: 1; min-height: 0; position: relative; }

/* Only the active pane is laid out. The per-pane classes below must NOT set
   `display` themselves — a single-class rule later in the file would beat
   `.pane { display: none }` and every pane would render stacked on top of the
   others. Display belongs to `.pane.active` and its two-class overrides. */
.pane { position: absolute; inset: 0; display: none; }
.pane.active { display: flex; }
.pane.analysis-pane.active,
.pane.parts-pane.active { display: block; }

/* --------------------------------------------------------- workbench pane */

.wb-left {
  width: 258px; flex: none; background: var(--bg-1);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
}
.wb-center { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.wb-right {
  width: 330px; flex: none; background: var(--bg-1);
  border-left: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden;
}

.panel-head {
  padding: 11px 14px 9px; font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--fg-3);
  border-bottom: 1px solid var(--line-soft); flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.panel-body { overflow-y: auto; overflow-x: hidden; padding: 12px; flex: 1; }
.panel-body.tight { padding: 8px; }

/* palette */
.pal-group { margin-bottom: 14px; }
.pal-group-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-3); margin: 0 0 6px 3px;
}
.pal-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 8px 9px; border-radius: var(--radius-sm); cursor: grab;
  border: 1px solid transparent; background: var(--bg-2); margin-bottom: 5px;
  transition: background .12s, border-color .12s, transform .08s;
}
.pal-item:hover { background: var(--bg-3); border-color: var(--line); }
.pal-item:active { cursor: grabbing; transform: scale(.985); }
.pal-item.disabled { opacity: .38; cursor: not-allowed; }
.pal-item.disabled:hover { background: var(--bg-2); border-color: transparent; }
.pal-icon {
  width: 26px; height: 26px; flex: none; border-radius: 6px; display: grid; place-items: center;
  background: var(--bg-hi); font-size: 13px;
}
.pal-text { min-width: 0; }
.pal-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.pal-sub { font-size: 11px; color: var(--fg-3); line-height: 1.35; margin-top: 1px; }
.pal-lock { font-size: 10.5px; color: var(--warn); margin-top: 3px; }

/* canvas */
.canvas-wrap { flex: 1; position: relative; overflow: hidden; background: #090d14; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: default; }
.canvas-toolbar {
  position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 5;
  background: rgba(17,23,37,.92); backdrop-filter: blur(8px);
  padding: 5px; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.canvas-hint {
  position: absolute; bottom: 10px; left: 10px; z-index: 5;
  font-size: 11.5px; color: var(--fg-3); background: rgba(17,23,37,.9);
  padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line-soft);
  pointer-events: none; max-width: 60%;
}
.readout-strip {
  flex: none; display: flex; gap: 0; border-top: 1px solid var(--line);
  background: var(--bg-1); overflow-x: auto;
}
.readout {
  padding: 8px 16px; border-right: 1px solid var(--line-soft); min-width: 108px; flex: none;
}
.readout .k { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); }
.readout .v { font-size: 16px; font-weight: 650; font-family: var(--mono); letter-spacing: -.02em; }
.readout .v small { font-size: 11px; color: var(--fg-3); font-weight: 500; }
.readout.ok .v { color: var(--ok); }
.readout.warn .v { color: var(--warn); }
.readout.error .v { color: var(--error); }

/* inspector */
.insp-empty { color: var(--fg-3); font-size: 12.5px; padding: 20px 6px; text-align: center; line-height: 1.6; }
.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: 11px; font-weight: 600; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px;
}
.field .hint { font-size: 11.5px; color: var(--fg-3); margin-top: 4px; line-height: 1.45; }
input[type=text], input[type=number], select, textarea {
  width: 100%; background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px;
  font-family: inherit; font-size: 13px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,163,255,.14); }
select { cursor: pointer; }
select option { background: var(--bg-2); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: -2px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }

.spec-table { width: 100%; font-size: 12px; border-collapse: collapse; margin: 6px 0 10px; }
.spec-table td { padding: 3px 0; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.spec-table td:first-child { color: var(--fg-3); width: 44%; padding-right: 8px; }
.spec-table td:last-child { font-family: var(--mono); font-size: 11.5px; }

.taps-list { display: flex; flex-direction: column; gap: 5px; }
.tap-row {
  display: flex; align-items: center; gap: 6px; background: var(--bg-2);
  padding: 4px 6px; border-radius: 6px; font-size: 12px;
}
.tap-row input { width: 64px; padding: 3px 6px; font-size: 12px; }

/* --------------------------------------------------------------- wizard */

.wizard-pane { width: 100%; overflow: hidden; }
.wiz-main { flex: 1; overflow-y: auto; padding: 28px 32px 60px; }
.wiz-inner { max-width: 720px; margin: 0 auto; }
.wiz-side {
  width: 400px; flex: none; background: var(--bg-1); border-left: 1px solid var(--line);
  overflow-y: auto; padding: 22px 24px 60px;
}
.wiz-hero { margin-bottom: 26px; }
.wiz-hero h1 { font-size: 25px; letter-spacing: -.025em; }
.wiz-hero p { color: var(--fg-2); margin: 8px 0 0; font-size: 14px; max-width: 620px; }

.wiz-progress { display: flex; gap: 4px; margin-bottom: 26px; }
.wiz-progress i {
  height: 3px; flex: 1; background: var(--bg-3); border-radius: 2px; transition: background .2s;
}
.wiz-progress i.done { background: var(--accent); }
.wiz-progress i.current { background: var(--accent-2); }

.wiz-q { margin-bottom: 30px; }
.wiz-q h2 { font-size: 17px; margin-bottom: 4px; }
.wiz-q .qhelp { color: var(--fg-2); font-size: 13px; margin-bottom: 13px; max-width: 640px; }
.wiz-opts { display: grid; gap: 8px; }
.wiz-opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; color: var(--fg);
  transition: border-color .13s, background .13s, transform .08s;
}
.wiz-opt:hover { border-color: #3a4a6d; background: var(--bg-2); }
.wiz-opt.sel { border-color: var(--accent); background: rgba(77,163,255,.09); }
.wiz-opt .radio {
  width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--line);
  flex: none; margin-top: 2px; display: grid; place-items: center;
}
.wiz-opt.sel .radio { border-color: var(--accent); }
.wiz-opt.sel .radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.wiz-opt .olabel { font-weight: 600; font-size: 13.5px; }
.wiz-opt .osub { color: var(--fg-3); font-size: 12.5px; margin-top: 2px; }

.wiz-number { display: flex; align-items: center; gap: 14px; }
.wiz-number input[type=range] { flex: 1; }
.wiz-number .numbox { width: 96px; flex: none; }
.wiz-number .unit { color: var(--fg-3); font-size: 13px; }

.rec-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
}
.rec-card h3 { font-size: 13px; color: var(--accent-2); margin-bottom: 7px; letter-spacing: .01em; }
.rec-card .big { font-size: 15px; font-weight: 620; margin-bottom: 3px; }
.rec-card p { margin: 5px 0 0; font-size: 12.5px; color: var(--fg-2); line-height: 1.55; }
.rec-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.rec-metric { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.rec-metric .k { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); }
.rec-metric .v { font-size: 17px; font-weight: 650; font-family: var(--mono); letter-spacing: -.02em; }

.reason { display: flex; gap: 9px; margin-bottom: 11px; font-size: 12.5px; color: var(--fg-2); line-height: 1.55; }
.reason .bullet { color: var(--accent); flex: none; margin-top: 1px; }
.note-item { display: flex; gap: 9px; margin-bottom: 11px; font-size: 12.5px; color: var(--fg-2); line-height: 1.55; }
.note-item .bullet { color: var(--warn); flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- code */

.code-pane { width: 100%; overflow: hidden; }
.code-left { width: 250px; flex: none; background: var(--bg-1); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.code-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.code-right { width: 340px; flex: none; background: var(--bg-1); border-left: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }

.preset-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; margin-bottom: 3px; border: 1px solid transparent; }
.preset-item:hover { background: var(--bg-2); }
.preset-item.sel { background: var(--bg-3); border-color: var(--line); }
.preset-item .pname { font-size: 12.5px; font-weight: 600; }
.preset-item .pblurb { font-size: 11px; color: var(--fg-3); line-height: 1.4; margin-top: 2px; }

.editor-shell { flex: 1; position: relative; min-height: 0; background: #0a0e16; overflow: hidden; }
.editor-scroll { position: absolute; inset: 0; overflow: auto; }
.editor-inner { position: relative; min-height: 100%; display: flex; }
.gutter {
  flex: none; padding: 12px 8px 12px 12px; text-align: right; color: #3a465f;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; user-select: none;
  background: #080c12; border-right: 1px solid var(--line-soft); min-width: 44px;
}
.editor-area { position: relative; flex: 1; min-width: 0; }
#code-input, #code-hl {
  margin: 0; padding: 12px 14px; border: 0; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.6; white-space: pre; overflow-wrap: normal;
  tab-size: 2;
}
#code-hl { position: absolute; inset: 0; pointer-events: none; color: var(--fg); }
#code-input {
  position: relative; width: 100%; height: 100%; min-height: 300px;
  background: transparent; color: transparent; caret-color: var(--accent-2);
  resize: none; outline: none; overflow: hidden;
}
#code-input::selection { background: rgba(77,163,255,.3); }

.tok-kw { color: #c792ea; } .tok-num { color: #f78c6c; } .tok-str { color: #c3e88d; }
.tok-com { color: #546e8a; font-style: italic; } .tok-fn { color: #82aaff; }
.tok-api { color: #7bd3ff; } .tok-op { color: #89ddff; }

.code-status {
  flex: none; padding: 7px 14px; font-size: 12px; font-family: var(--mono);
  border-top: 1px solid var(--line); background: var(--bg-1); color: var(--fg-3);
  display: flex; align-items: center; gap: 10px;
}
.code-status.err { color: var(--error); background: rgba(255,95,109,.08); }
.code-status.ok { color: var(--ok); }

.strip-preview { flex: none; border-top: 1px solid var(--line); background: #060a10; padding: 10px 14px; }
.strip-preview canvas { width: 100%; height: 44px; display: block; border-radius: 6px; }
.strip-preview .cap { font-size: 10.5px; color: var(--fg-3); margin-top: 6px; text-transform: uppercase; letter-spacing: .06em; }

.api-doc { font-size: 12px; line-height: 1.6; }
.api-doc code { font-family: var(--mono); background: var(--bg-2); padding: 1px 5px; border-radius: 4px; color: var(--accent-2); font-size: 11.5px; }
.api-doc dt { font-family: var(--mono); color: var(--accent-2); font-size: 11.5px; margin-top: 9px; }
.api-doc dd { margin: 2px 0 0; color: var(--fg-2); font-size: 12px; }

.export-out {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55; white-space: pre;
  background: #0a0e16; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; overflow: auto; max-height: 100%; color: var(--fg-2);
}

/* ------------------------------------------------------------- analysis */

.analysis-pane { overflow-y: auto; width: 100%; padding: 24px 28px 60px; }
.analysis-inner { max-width: 1080px; margin: 0 auto; }

.score-hero {
  display: flex; gap: 22px; align-items: center; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; margin-bottom: 22px;
}
.score-ring { width: 92px; height: 92px; flex: none; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 26px; font-weight: 700; font-family: var(--mono); letter-spacing: -.03em;
}
.score-text h2 { font-size: 19px; margin-bottom: 4px; }
.score-text p { color: var(--fg-2); margin: 0; font-size: 13px; max-width: 620px; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 24px; }
.metric-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.metric-card .k { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); }
.metric-card .v { font-size: 21px; font-weight: 650; font-family: var(--mono); letter-spacing: -.03em; margin-top: 2px; }
.metric-card .s { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; line-height: 1.4; }

.section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--fg-3); margin: 26px 0 11px;
}

.finding {
  display: flex; gap: 12px; background: var(--bg-1); border: 1px solid var(--line);
  border-left-width: 3px; border-radius: 10px; padding: 13px 15px; margin-bottom: 9px;
}
.finding.ok    { border-left-color: var(--ok); }
.finding.info  { border-left-color: var(--info); }
.finding.warn  { border-left-color: var(--warn); }
.finding.error { border-left-color: var(--error); }
.finding .ficon { flex: none; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.finding.ok .ficon    { background: rgba(61,220,151,.16); color: var(--ok); }
.finding.info .ficon  { background: rgba(77,163,255,.16); color: var(--info); }
.finding.warn .ficon  { background: rgba(255,178,63,.16); color: var(--warn); }
.finding.error .ficon { background: rgba(255,95,109,.16); color: var(--error); }
.finding .fbody { min-width: 0; flex: 1; }
.finding .ftitle { font-weight: 620; font-size: 13.5px; line-height: 1.4; }
.finding .fdetail { color: var(--fg-2); font-size: 12.5px; margin-top: 4px; line-height: 1.6; }
.finding .factions { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.finding .ftip { font-size: 11.5px; color: var(--fg-3); margin-top: 6px; font-style: italic; }
.grade-badge {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  font-weight: 800; font-size: 12px; margin-left: 6px; vertical-align: -4px;
}
.grade-A, .grade-B { background: rgba(61,220,151,.18); color: var(--ok); }
.grade-C { background: rgba(77,163,255,.18); color: var(--info); }
.grade-D, .grade-E { background: rgba(255,178,63,.18); color: var(--warn); }
.grade-F { background: rgba(255,95,109,.18); color: var(--error); }

.inject-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px; }
.inject-table th {
  text-align: left; font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--fg-3); padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.inject-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; }
.inject-table td:first-child, .inject-table th:first-child { font-family: var(--sans); }
.inject-table tr.best td { background: rgba(61,220,151,.07); }
.inject-table tr.best td:first-child::after { content: ' ← recommended'; color: var(--ok); font-size: 11px; font-family: var(--sans); }

.dropchart { width: 100%; height: 190px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; }

.topo-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 9px; }
.topo-card .verdict { font-weight: 700; font-size: 13px; color: var(--accent-2); letter-spacing: .01em; }
.topo-card p { margin: 5px 0 0; font-size: 12.5px; color: var(--fg-2); line-height: 1.6; }

/* --------------------------------------------------------------- parts */

.parts-pane { overflow-y: auto; width: 100%; padding: 24px 28px 60px; }
.parts-inner { max-width: 1080px; margin: 0 auto; }
.bom-cat { margin-bottom: 26px; }
.bom-cat h3 {
  font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--fg-3);
  padding-bottom: 7px; border-bottom: 1px solid var(--line); margin-bottom: 11px;
  display: flex; justify-content: space-between;
}
.bom-item {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 8px;
}
.bom-top { display: flex; gap: 14px; align-items: flex-start; }
.bom-qty {
  flex: none; min-width: 62px; text-align: center; background: var(--bg-3);
  border-radius: 8px; padding: 6px 8px;
}
.bom-qty .n { font-size: 17px; font-weight: 700; font-family: var(--mono); line-height: 1.1; }
.bom-qty .u { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .05em; }
.bom-main { flex: 1; min-width: 0; }
.bom-name { font-size: 14px; font-weight: 620; }
.bom-brand { font-size: 11.5px; color: var(--fg-3); }
.bom-price { flex: none; text-align: right; }
.bom-price .t { font-size: 15px; font-weight: 650; font-family: var(--mono); }
.bom-price .e { font-size: 10.5px; color: var(--fg-3); }
.bom-spec {
  font-family: var(--mono); font-size: 11px; color: var(--accent-2);
  background: rgba(77,163,255,.07); padding: 5px 9px; border-radius: 6px; margin-top: 8px;
  line-height: 1.55; word-break: break-word;
}
.bom-why { font-size: 12.5px; color: var(--fg-2); margin-top: 8px; line-height: 1.6; }
.bom-detail { font-size: 12px; color: var(--fg-3); margin-top: 6px; line-height: 1.55; }
.bom-note {
  font-size: 12px; color: var(--warn); margin-top: 7px; line-height: 1.55;
  padding-left: 10px; border-left: 2px solid rgba(255,178,63,.35);
}
.bom-buy { margin-top: 9px; }
.bom-total {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 20px; margin-top: 18px;
}
.bom-total .lbl { font-size: 13px; color: var(--fg-2); }
.bom-total .amt { font-size: 26px; font-weight: 700; font-family: var(--mono); letter-spacing: -.03em; }

.callout {
  background: rgba(77,163,255,.07); border: 1px solid var(--accent-dim);
  border-radius: 10px; padding: 13px 16px; margin-bottom: 18px; font-size: 12.5px;
  color: var(--fg-2); line-height: 1.6;
}
.callout strong { color: var(--fg); }
.callout.warn { background: rgba(255,178,63,.07); border-color: #5a4520; }

/* --------------------------------------------------------------- learn */

.learn-pane { width: 100%; overflow: hidden; }
.learn-nav { width: 250px; flex: none; background: var(--bg-1); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 10px 40px; }
.learn-nav .lsec { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); margin: 14px 0 5px 8px; font-weight: 700; }
.learn-nav a {
  display: block; padding: 6px 10px; border-radius: 7px; color: var(--fg-2);
  font-size: 12.5px; line-height: 1.4; cursor: pointer; text-decoration: none;
}
.learn-nav a:hover { background: var(--bg-2); color: var(--fg); text-decoration: none; }
.learn-nav a.active { background: var(--bg-3); color: var(--fg); }
.learn-body { flex: 1; overflow-y: auto; padding: 30px 40px 80px; }
.learn-inner { max-width: 760px; }
.lesson { margin-bottom: 52px; scroll-margin-top: 20px; }
.lesson h2 { font-size: 21px; letter-spacing: -.02em; margin-bottom: 4px; }
.lesson .lmeta { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px; }
.lesson p { color: var(--fg-2); font-size: 14px; line-height: 1.75; margin: 0 0 14px; }
.lesson strong { color: var(--fg); font-weight: 620; }
.lesson pre {
  background: #0a0e16; border: 1px solid var(--line); border-radius: 8px;
  padding: 13px 16px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px;
  color: var(--accent-2); line-height: 1.6; margin: 0 0 14px;
}
.lesson ul { color: var(--fg-2); font-size: 14px; line-height: 1.75; padding-left: 22px; margin: 0 0 14px; }
.lesson li { margin-bottom: 6px; }
.lesson ol { color: var(--fg-2); font-size: 14px; line-height: 1.8; padding-left: 22px; margin: 0 0 14px; }
.tryit {
  background: rgba(61,220,151,.07); border: 1px solid #24503c; border-radius: 9px;
  padding: 11px 15px; font-size: 12.5px; color: var(--fg-2); margin-bottom: 14px;
}
.tryit b { color: var(--ok); }

/* -------------------------------------------------------------- preview */

.preview-pane { flex-direction: column; width: 100%; overflow: hidden; }
.preview-canvas-wrap { flex: 1; position: relative; background: linear-gradient(180deg, #05070d 0%, #0a1020 55%, #0d1626 100%); min-height: 0; }
#house { position: absolute; inset: 0; width: 100%; height: 100%; }
.preview-controls {
  flex: none; display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  padding: 11px 18px; background: var(--bg-1); border-top: 1px solid var(--line);
}
.preview-controls .grp { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-2); }
.preview-controls input[type=range] { width: 130px; }

/* ------------------------------------------------------------- utilities */

.pill {
  display: inline-block; padding: 1.5px 8px; border-radius: 20px; font-size: 10.5px;
  font-weight: 650; letter-spacing: .03em; background: var(--bg-3); color: var(--fg-2);
}
.pill.ok { background: rgba(61,220,151,.16); color: var(--ok); }
.pill.warn { background: rgba(255,178,63,.16); color: var(--warn); }
.pill.error { background: rgba(255,95,109,.16); color: var(--error); }
.pill.accent { background: rgba(77,163,255,.16); color: var(--accent-2); }

.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }
.muted { color: var(--fg-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.nowrap { white-space: nowrap; }

.toast-host { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--fg);
  padding: 9px 18px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow);
  animation: toastIn .22s ease-out;
}
.toast.ok { border-color: #24503c; }
.toast.error { border-color: #5a2730; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,7,12,.72); backdrop-filter: blur(3px);
  z-index: 90; display: grid; place-items: center; padding: 30px;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); max-width: 620px; width: 100%; max-height: 84vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { padding: 16px 20px 13px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 650; }
.modal-body { padding: 18px 20px; overflow-y: auto; font-size: 13px; color: var(--fg-2); line-height: 1.65; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 1400px) {
  .wiz-side { width: 340px; }
  .code-right { width: 290px; }
  .wb-right { width: 300px; }
}
@media (max-width: 1150px) {
  .wb-left { width: 208px; }
  .code-left { width: 200px; }
}
