:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f4f5f2;
  background: #0d0f0e;
  font-synthesis: none;
  --bg: #0d0f0e;
  --panel: #131614;
  --panel-2: #181c19;
  --line: #29302b;
  --line-soft: #202521;
  --muted: #8f9a92;
  --text: #f4f5f2;
  --accent: #c6f36b;
  --accent-soft: rgba(198, 243, 107, .11);
  --danger: #ff9c9c;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 310px minmax(500px, 1fr) 390px;
  grid-template-rows: 82px 1fr;
  background: radial-gradient(circle at 50% 20%, #182019 0, var(--bg) 46%);
}
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 20, 18, .96);
  backdrop-filter: blur(14px);
}
.brand-block { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 950; font-size: 19px; color: #11140f; background: var(--accent);
  box-shadow: 0 0 28px rgba(198,243,107,.14);
}
.eyebrow, .section-label, .story-kicker {
  color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
}
h1 { margin: 3px 0 0; font-size: clamp(17px, 1.7vw, 23px); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h2 { margin: 7px 0 10px; font-size: 18px; line-height: 1.18; }
.top-actions { display: flex; gap: 7px; align-items: center; flex-shrink: 0; }
button, .file-button {
  border: 1px solid #343c36; border-radius: 10px; padding: 9px 11px; color: #eef1ec; background: #1a1f1b;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
button:hover, .file-button:hover { transform: translateY(-1px); border-color: #5e6a61; }
.primary { background: var(--accent); color: #10130e; border-color: var(--accent); font-weight: 850; }
.ghost { background: #171b18; }
.danger { background: #2b1818; border-color: #673535; color: #ffcccc; }
.small { padding: 7px 9px; border-radius: 8px; font-size: 12px; }
.panel { background: rgba(18, 21, 19, .96); padding: 18px; overflow: auto; scrollbar-width: thin; scrollbar-color: #343b36 transparent; }
.left-panel { border-right: 1px solid var(--line); }
.right-panel { border-left: 1px solid var(--line); }
.left-panel section + section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.project-story h2 { font-size: 20px; margin-bottom: 6px; }
.project-subtitle { display: inline-flex; color: #d8e0da; font-size: 12px; padding: 5px 8px; border: 1px solid #354039; border-radius: 999px; background: #171c18; }
.project-story p { color: #929d95; font-size: 12px; line-height: 1.55; margin: 10px 0 0; }
.section-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.tiny-note { color: #69736c; font-size: 10px; }
.preset-stack { display: grid; gap: 8px; }
.preset-card { width: 100%; text-align: left; padding: 11px; background: #161a17; border-color: #29312b; position: relative; overflow: hidden; }
.preset-card strong, .preset-card span { display: block; }
.preset-card strong { font-size: 13px; }
.preset-card span { color: #818c84; font-size: 10px; line-height: 1.4; margin-top: 4px; }
.preset-card.active { border-color: rgba(198,243,107,.7); background: var(--accent-soft); }
.preset-card.active::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.pipeline { display: grid; gap: 9px; margin-top: 11px; }
.pipeline-step { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.pipeline-step > span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 9px; font-weight: 900; background: #1b211c; color: var(--accent); border: 1px solid #33402f; }
.pipeline-step strong, .pipeline-step small { display: block; }
.pipeline-step strong { font-size: 12px; }
.pipeline-step small { color: #737f76; font-size: 10px; margin-top: 2px; }
.project-facts { display: grid; gap: 9px; }
.metric { display: flex; align-items: center; justify-content: space-between; color: #9aa39c; font-size: 12px; }
.metric strong { color: #f2f4f0; font-size: 12px; }
.hint { color: #7e8981; font-size: 12px; line-height: 1.55; margin-top: 10px; }
.hidden { display: none !important; }
.selection-card { display: grid; gap: 7px; padding: 12px; margin-top: 10px; border: 1px solid #303b33; border-radius: 11px; background: #161b17; }
.selection-title-row { display: flex; justify-content: space-between; gap: 8px; }
.selection-card strong, .selection-card span { display: block; }
.selection-card span { color: #879189; font-size: 10px; margin-top: 3px; }
.object-price { color: var(--accent); font-size: 11px; font-weight: 800; white-space: nowrap; }
.object-meta { color: #7f8a82; font-size: 10px; }
.selection-actions { display: flex; gap: 7px; margin-top: 4px; }
.viewport-wrap { position: relative; min-width: 0; background: #0f1310; overflow: hidden; }
#viewport { position: absolute; inset: 0; }
#viewport canvas { display: block; width: 100%; height: 100%; }
.viewport-toolbar { position: absolute; z-index: 5; top: 13px; left: 13px; right: 13px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.viewport-toolbar > * { pointer-events: auto; }
.view-switcher { display: flex; gap: 5px; padding: 4px; border-radius: 12px; background: rgba(17,21,18,.9); border: 1px solid #303830; backdrop-filter: blur(10px); }
.tool { padding: 7px 10px; background: transparent; border: 0; border-radius: 8px; font-size: 11px; }
.tool:hover { transform: none; background: #202620; }
.tool.active { background: #f0f3ed; color: #10130f; }
.status-pill { margin-left: auto; padding: 7px 10px; border-radius: 999px; background: rgba(17, 21, 18, .9); color: #acb6ae; font-size: 10px; border: 1px solid #303a32; backdrop-filter: blur(10px); }
.viewport-legend { position: absolute; z-index: 3; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 12px; padding: 7px 10px; border-radius: 999px; background: rgba(11, 14, 12, .78); color: #7f8b82; font-size: 9px; pointer-events: none; white-space: nowrap; border: 1px solid rgba(58,67,60,.6); }
kbd { font: inherit; color: #cfd7d1; }
.demo-badge { position: absolute; left: 14px; bottom: 15px; max-width: 225px; color: #69746c; font-size: 9px; line-height: 1.4; }
.estimate-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.estimate-heading h2 { margin-bottom: 0; }
.estimate-total { font-size: 21px; font-weight: 900; white-space: nowrap; color: var(--accent); }
.subtotal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 15px 0 13px; }
.subtotal-card { padding: 9px; background: #171c18; border: 1px solid #29322b; border-radius: 10px; min-width: 0; }
.subtotal-card span, .subtotal-card strong { display: block; }
.subtotal-card span { color: #778179; font-size: 9px; margin-bottom: 5px; }
.subtotal-card strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.estimate-note { color: #8b958d; font-size: 11px; line-height: 1.5; margin: 13px 0 15px; }
.estimate-table-wrap { overflow: auto; max-height: calc(100vh - 315px); }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { color: #727d75; font-weight: 700; text-align: left; border-bottom: 1px solid #303930; padding: 8px 5px; position: sticky; top: 0; background: #121513; z-index: 1; }
td { padding: 9px 5px; border-bottom: 1px solid #222822; vertical-align: top; }
th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3) { text-align: right; }
.line-kind { display: inline-flex; margin-top: 3px; color: #707a72; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.estimate-footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: #646e66; font-size: 9px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #252d27; }
.text-action { padding: 0; border: 0; background: transparent; color: #aeb8b0; font-size: 10px; }
.text-action:hover { transform: none; color: var(--accent); }
@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 270px minmax(480px, 1fr) 340px; }
  .panel { padding: 14px; }
  .top-actions .ghost:nth-child(1) { display: none; }
}
@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 250px 1fr; }
  .right-panel { display: none; }
  .top-actions .ghost { display: none; }
}
