/* Brown Forces Plans — obsidian / gold / bone.
   No external fonts, no CDN. Everything here loads offline.

/* Kelex Interior Designer extensions – high‑end, luxury, neutral palette */
/* ------------------------------------------------------------ */
/* Color palette additions */
:root {
  --kelex-accent: #5a8d8d; /* muted teal for accents */
  --kelex-soft-gray: #f5f4f1; /* light neutral for backgrounds */
  --kelex-highlight: var(--gold); /* reuse gold as highlight */
  --kelex-border: var(--line); /* base border color */
  --kelex-shadow: rgba(0,0,0,0.15); /* subtle shadow */
  /* spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
}

/* ------------------------------------------------------------ responsive */
/* Tablet and mobile breakpoints for capture, summary, and export panels */
@media (max-width: 768px) {
  /* Tighten padding on small screens */
  main { padding: 12px; }
  .topbar { padding: 10px 12px; }
  .banner { padding: 10px 12px; gap: 10px; }

  /* Stack tabs vertically on very small screens, keep scrollable on tablets */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab {
    padding: 12px 14px;
    font-size: 0.72rem;
    min-height: 44px;
  }

  /* Grid collapses to single column on mobile */
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Cards get full width on mobile */
  .card { padding: 14px 16px 16px; }

  /* Form fields stack vertically */
  .field-row { grid-template-columns: 1fr; gap: 12px; }
  .field-row.four { grid-template-columns: 1fr 1fr; }

  /* Inputs stay touch-friendly */
  input[type="text"], input[type="number"], select, textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    min-height: 48px;
  }

  /* Buttons get full width on mobile */
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; }
  .actions .hint { text-align: center; }

  /* Summary cards stack vertically */
  .summary-card { margin-bottom: 12px; }

  /* Export actions stack on mobile */
  .export-actions { flex-direction: column; }
  .export-actions .btn { width: 100%; }

  /* Chat log adjusts for small screens */
  .chat-log { max-height: 40vh; }
  .msg { max-width: 100%; }
}

@media (max-width: 480px) {
  /* Extra small screens */
  body { font-size: 14px; }
  h2 { font-size: 0.95rem; }

  /* Brand shrinks */
  .brand-name { font-size: 0.88rem; }

  /* Tabs get smaller */
  .tab { padding: 10px 12px; font-size: 0.68rem; }

  /* Single column for four-field rows */
  .field-row.four { grid-template-columns: 1fr; }

  /* Capture tiers stack */
  .capture-tiers { grid-template-columns: 1fr; }
  .tier-item { padding: 12px; }

  /* Findings pills wrap */
  .findings-summary { flex-direction: column; gap: 6px; }
  .pill { width: 100%; text-align: center; }

  /* Sheet table scrolls horizontally */
  .sheet-table { display: block; overflow-x: auto; }

  /* Cost table scrolls horizontally */
  .cost-table { display: block; overflow-x: auto; }

  /* Export content wraps */
  .export-content pre { white-space: pre-wrap; word-break: break-word; }
}

/* Landscape orientation for tablets */
@media (max-width: 1024px) and (orientation: landscape) {
  .chat-log { max-height: 50vh; }
  .panel { max-height: 80vh; overflow-y: auto; }
}

/* New token for room card background */
:root {
  --kelex-card-bg: var(--panel);
  --kelex-card-border: var(--line);
}

/* Existing variables continue */
:root {
  --obsidian:      #08080a;
  --obsidian-2:    #0e0e12;
  --panel:         #14141a;
  --panel-2:       #1a1a21;
  --line:          #272730;
  --line-soft:     #1e1e26;

  --bone:          #ece7dd;
  --bone-dim:      #a8a294;
  --bone-faint:    #6f6b60;

  --gold:          #c9a227;
  --gold-bright:   #e9c65c;
  --gold-dim:      #7a6318;

  --error:         #ff4d3d;
  --error-deep:    #4a0f0a;
  --error-edge:    #8e2018;
  --warn:          #e0a531;
  --warn-deep:     #3a2b06;
  --info:          #58a08c;
  --info-deep:     #0f2b25;

  --serif: 'Cinzel', 'Optima', 'Palatino Linotype', 'Book Antiqua', Palatino,
           'Hoefler Text', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --r: 3px;
  --pad: 18px;
}

* { box-sizing: border-box; }

/* The `hidden` attribute is how this UI hides the offline bar, the blocking
   alert and the empty states. Several of those elements are flex containers,
   and `display:flex` beats the UA's `[hidden]{display:none}`. Without this rule
   the offline banner shows while the service is online. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 64px;
}

h1, h2, h3, legend, .brand-name, .tab, .dl-kind {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.06em;
}

h2 { font-size: 1.05rem; text-transform: uppercase; color: var(--bone); margin: 0 0 12px; }

a { color: var(--gold-bright); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: #000; padding: 10px 16px; font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* ----------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px var(--pad);
  background: linear-gradient(180deg, #101016 0%, var(--obsidian-2) 100%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { color: var(--gold); font-size: 0.85rem; }
.brand-name { font-size: 1rem; text-transform: uppercase; color: var(--bone-dim); }
.brand-name strong { color: var(--gold); font-weight: 700; }
.topbar-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--bone-dim); background: var(--panel);
  max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bone-faint); flex: none; }
.chip-ok      { color: var(--info); border-color: #23483f; }
.chip-ok .dot { background: var(--info); }
.chip-down      { color: var(--error); border-color: var(--error-edge); background: #1c0b09; }
.chip-down .dot { background: var(--error); }
.chip-pending .dot { background: var(--warn); }
.chip-project { color: var(--gold-bright); border-color: var(--gold-dim); }

/* ----------------------------------------------------- scope banner */
.banner {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px var(--pad);
  background: #16120a;
  border-bottom: 1px solid var(--gold-dim);
  border-top: 1px solid #241c0c;
}
.banner-label {
  font-family: var(--serif); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold-dim); padding: 3px 8px; border-radius: var(--r);
  flex: none; margin-top: 1px;
}
.banner-text { margin: 0; font-size: 0.85rem; color: #ddd3bd; max-width: 105ch; }

/* --------------------------------------------------- blocking alert */
.blocking-alert {
  margin: 0; padding: 14px var(--pad);
  background: var(--error-deep);
  border-top: 2px solid var(--error);
  border-bottom: 2px solid var(--error);
  box-shadow: inset 0 0 40px rgba(255, 77, 61, 0.14);
}
.blocking-alert-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.blocking-badge {
  font-family: var(--serif); font-weight: 700; letter-spacing: 0.18em;
  background: var(--error); color: #170603; padding: 3px 10px; border-radius: var(--r);
  font-size: 0.75rem;
}
.blocking-alert-head strong { color: #ffd9d4; font-size: 0.95rem; }
.blocking-alert-text { margin: 8px 0 0; font-size: 0.85rem; color: #f3c9c3; max-width: 105ch; }

.offline-alert {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 12px var(--pad);
  background: #1c0b09; border-bottom: 1px solid var(--error-edge);
  font-size: 0.88rem; color: #f3c9c3;
}
.offline-alert strong { color: var(--error); }

/* --------------------------------------------------- as-built alert */
.as-built-alert {
  margin: 0; padding: 14px var(--pad);
  background: #1a150a;
  border-top: 2px solid var(--gold-dim);
  border-bottom: 2px solid var(--gold-dim);
  box-shadow: inset 0 0 40px rgba(201, 162, 39, 0.08);
}
.as-built-alert-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.as-built-badge {
  font-family: var(--serif); font-weight: 700; letter-spacing: 0.18em;
  background: var(--gold); color: var(--obsidian); padding: 3px 10px; border-radius: var(--r);
  font-size: 0.75rem;
}
.as-built-alert-head strong { color: var(--gold-bright); font-size: 0.95rem; }
.as-built-alert-text { margin: 8px 0 0; font-size: 0.85rem; color: #d4c9a8; max-width: 105ch; white-space: pre-line; }

/* ------------------------------------------------ scan link */
.scan-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--r);
  color: var(--gold);
  font-size: 0.88rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.scan-link:hover {
  background: #1e1a0f;
  border-color: var(--gold);
  color: var(--gold-bright);
}
.scan-icon { font-size: 1.1rem; }

/* --------------------------------------------------- capture tiers */
.capture-tiers {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  /* 140px floor: at 200px the grid forced two columns onto a 310px viewport
     and the panel overflowed sideways on small phones. */
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.tier-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: var(--r);
  transition: transform 180ms ease;
}
.tier-item:hover {
  transform: translateY(-2px);
}
.tier-icon {
  color: var(--gold);
  font-size: 0.85rem;
  margin-top: 2px;
  flex: none;
}
.tier-item strong {
  display: block;
  font-size: 0.82rem;
  color: var(--bone);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tier-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--bone-dim);
  margin-top: 2px;
}

/* ---------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 0 var(--pad); background: var(--obsidian-2);
  border-bottom: 1px solid var(--line);
}
.tab {
  appearance: none; background: transparent; border: 0;
  border-bottom: 2px solid transparent;
  color: var(--bone-faint); font-size: 0.78rem; text-transform: uppercase;
  padding: 14px 16px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px;
}
.tab:hover { color: var(--bone-dim); }
.tab[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.tab-badge {
  font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--bone-dim); border-radius: 999px; padding: 1px 7px;
}
.tab-badge-error { background: var(--error); border-color: var(--error); color: #170603; font-weight: 700; }

/* ---------------------------------------------------------- panels */
main { padding: var(--pad); max-width: 1500px; margin: 0 auto; }
.panel:focus { outline: none; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px 18px;
  margin: 0;
}
.card legend {
  font-size: 0.75rem; text-transform: uppercase; color: var(--gold);
  padding: 0 8px; margin-left: -8px;
}

.field { margin-top: 14px; min-width: 0; }
.field:first-of-type { margin-top: 6px; }
.field label {
  display: block; font-size: 0.74rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--bone-dim); margin-bottom: 6px;
}
.field .unit, .field .opt { color: var(--bone-faint); text-transform: none; letter-spacing: 0; }
.field-row { display: grid; gap: 14px 12px; grid-template-columns: 1fr 1fr; align-items: start; margin-top: 14px; }
.field-row.four { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Inputs inside a row must share one baseline — the per-field top margin would
   stagger them because :first-of-type only matches the first cell. */
.field-row > .field, .field-row > .field:first-of-type { margin-top: 0; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; font: inherit; font-size: 0.95rem;
  color: var(--bone); background: var(--obsidian);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; min-height: 44px;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--bone-faint) 50%),
                    linear-gradient(135deg, var(--bone-faint) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
input[aria-invalid="true"] { border-color: var(--error); background: #170908; }
textarea { resize: vertical; min-height: 60px; }

.hint { font-size: 0.78rem; color: var(--bone-faint); margin: 6px 0 0; }
.empty { color: var(--bone-faint); font-size: 0.88rem; font-style: italic; }

.form-errors {
  margin: 16px 0 0; padding: 12px 14px;
  background: var(--error-deep); border-left: 3px solid var(--error);
  color: #f3c9c3; font-size: 0.88rem;
}
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }

.actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.actions .hint { margin: 0; flex: 1 1 240px; }

/* --------------------------------------------------------- buttons */
.btn {
  appearance: none; font: inherit; font-family: var(--serif);
  font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bone); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 20px; min-height: 44px; cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--gold-dim); color: var(--gold-bright); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #16120a; border-color: var(--gold); font-weight: 700;
}
.btn-primary:hover:not(:disabled) { color: #000; filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--error-edge); color: #ffd9d4; }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: 0.7rem; }
.btn.is-busy { position: relative; color: transparent; }
.btn.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.3); border-top-color: #16120a;
  animation: spin 0.7s linear infinite;
}
.btn:not(.btn-primary).is-busy::after { border-color: rgba(236,231,221,.25); border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ chat */
.chat-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px 18px;
  display: flex; flex-direction: column;
  max-width: 980px;
}
.chat-head h2 { margin-bottom: 4px; }
.chat-head .hint { max-width: 90ch; }
.chat-log {
  margin: 16px 0; min-height: 260px; max-height: 58vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding-right: 4px;
}
.msg { max-width: 92%; }
.msg-role {
  font-family: var(--serif); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--bone-faint); margin-bottom: 5px;
}
.msg-body {
  padding: 11px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--obsidian-2);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem;
}
.msg-user { align-self: flex-end; }
.msg-user .msg-role { text-align: right; color: var(--gold-dim); }
.msg-user .msg-body { background: #1b1710; border-color: var(--gold-dim); }
.msg-lara .msg-role { color: var(--gold); }
.msg-error .msg-body { background: var(--error-deep); border-color: var(--error-edge); color: #f3c9c3; }

.tools { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.tool {
  font-family: var(--mono); font-size: 0.75rem;
  border: 1px solid var(--line); border-left: 2px solid var(--info);
  background: #0c1512; color: var(--bone-dim);
  padding: 7px 10px; border-radius: var(--r);
  overflow-wrap: anywhere;
}
.tool-name { color: var(--info); }
.tool-args { color: var(--bone-faint); }
.tool-result { display: block; margin-top: 4px; color: var(--bone-dim); }
.tool-pending { border-left-color: var(--warn); }
.tool-pending .tool-name { color: var(--warn); }

.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; }
.chat-hint { margin-top: 8px; }
.typing::after {
  content: "\2588"; color: var(--gold); animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* -------------------------------------------------------- findings */
.findings-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.findings-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill {
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--bone-dim);
}
.pill-error { background: var(--error-deep); border-color: var(--error-edge); color: #ffb7ae; }
.pill-warning { background: var(--warn-deep); border-color: #6b5313; color: #f0cd7f; }
.pill-info { background: var(--info-deep); border-color: #23483f; color: #8fcbba; }

.findings-list { display: flex; flex-direction: column; gap: 24px; }
.finding-group h3 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--bone-dim); margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.finding {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  border: 1px solid var(--line); border-left-width: 4px;
  background: var(--panel); bor
…[truncated]

:root {
  --obsidian:      #08080a;
  --obsidian-2:    #0e0e12;
  --panel:         #14141a;
  --panel-2:       #1a1a21;
  --line:          #272730;
  --line-soft:     #1e1e26;

  --bone:          #ece7dd;
  --bone-dim:      #a8a294;
  --bone-faint:    #6f6b60;

  --gold:          #c9a227;
  --gold-bright:   #e9c65c;
  --gold-dim:      #7a6318;

  --error:         #ff4d3d;
  --error-deep:    #4a0f0a;
  --error-edge:    #8e2018;
  --warn:          #e0a531;
  --warn-deep:     #3a2b06;
  --info:          #58a08c;
  --info-deep:     #0f2b25;

  --serif: 'Cinzel', 'Optima', 'Palatino Linotype', 'Book Antiqua', Palatino,
           'Hoefler Text', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --r: 3px;
  --pad: 18px;
}

* { box-sizing: border-box; }

/* The `hidden` attribute is how this UI hides the offline bar, the blocking
   alert and the empty states. Several of those elements are flex containers,
   and `display:flex` beats the UA's `[hidden]{display:none}`. Without this rule
   the offline banner shows while the service is online. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 64px;
}

h1, h2, h3, legend, .brand-name, .tab, .dl-kind {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.06em;
}

h2 { font-size: 1.05rem; text-transform: uppercase; color: var(--bone); margin: 0 0 12px; }

a { color: var(--gold-bright); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: #000; padding: 10px 16px; font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* ----------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px var(--pad);
  background: linear-gradient(180deg, #101016 0%, var(--obsidian-2) 100%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { color: var(--gold); font-size: 0.85rem; }
.brand-name { font-size: 1rem; text-transform: uppercase; color: var(--bone-dim); }
.brand-name strong { color: var(--gold); font-weight: 700; }
.topbar-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--bone-dim); background: var(--panel);
  max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bone-faint); flex: none; }
.chip-ok      { color: var(--info); border-color: #23483f; }
.chip-ok .dot { background: var(--info); }
.chip-down      { color: var(--error); border-color: var(--error-edge); background: #1c0b09; }
.chip-down .dot { background: var(--error); }
.chip-pending .dot { background: var(--warn); }
.chip-project { color: var(--gold-bright); border-color: var(--gold-dim); }

/* ----------------------------------------------------- scope banner */
.banner {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px var(--pad);
  background: #16120a;
  border-bottom: 1px solid var(--gold-dim);
  border-top: 1px solid #241c0c;
}
.banner-label {
  font-family: var(--serif); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold-dim); padding: 3px 8px; border-radius: var(--r);
  flex: none; margin-top: 1px;
}
.banner-text { margin: 0; font-size: 0.85rem; color: #ddd3bd; max-width: 105ch; }

/* --------------------------------------------------- blocking alert */
.blocking-alert {
  margin: 0; padding: 14px var(--pad);
  background: var(--error-deep);
  border-top: 2px solid var(--error);
  border-bottom: 2px solid var(--error);
  box-shadow: inset 0 0 40px rgba(255, 77, 61, 0.14);
}
.blocking-alert-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.blocking-badge {
  font-family: var(--serif); font-weight: 700; letter-spacing: 0.18em;
  background: var(--error); color: #170603; padding: 3px 10px; border-radius: var(--r);
  font-size: 0.75rem;
}
.blocking-alert-head strong { color: #ffd9d4; font-size: 0.95rem; }
.blocking-alert-text { margin: 8px 0 0; font-size: 0.85rem; color: #f3c9c3; max-width: 105ch; }

.offline-alert {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 12px var(--pad);
  background: #1c0b09; border-bottom: 1px solid var(--error-edge);
  font-size: 0.88rem; color: #f3c9c3;
}
.offline-alert strong { color: var(--error); }

/* --------------------------------------------------- as-built alert */
.as-built-alert {
  margin: 0; padding: 14px var(--pad);
  background: #1a150a;
  border-top: 2px solid var(--gold-dim);
  border-bottom: 2px solid var(--gold-dim);
  box-shadow: inset 0 0 40px rgba(201, 162, 39, 0.08);
}
.as-built-alert-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.as-built-badge {
  font-family: var(--serif); font-weight: 700; letter-spacing: 0.18em;
  background: var(--gold); color: var(--obsidian); padding: 3px 10px; border-radius: var(--r);
  font-size: 0.75rem;
}
.as-built-alert-head strong { color: var(--gold-bright); font-size: 0.95rem; }
.as-built-alert-text { margin: 8px 0 0; font-size: 0.85rem; color: #d4c9a8; max-width: 105ch; white-space: pre-line; }

/* ------------------------------------------------ scan link */
.scan-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--r);
  color: var(--gold);
  font-size: 0.88rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.scan-link:hover {
  background: #1e1a0f;
  border-color: var(--gold);
  color: var(--gold-bright);
}
.scan-icon { font-size: 1.1rem; }

/* --------------------------------------------------- capture tiers */
.capture-tiers {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  /* 140px floor: at 200px the grid forced two columns onto a 310px viewport
     and the panel overflowed sideways on small phones. */
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.tier-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: var(--r);
  transition: transform 180ms ease;
}
.tier-item:hover {
  transform: translateY(-2px);
}
.tier-icon {
  color: var(--gold);
  font-size: 0.85rem;
  margin-top: 2px;
  flex: none;
}
.tier-item strong {
  display: block;
  font-size: 0.82rem;
  color: var(--bone);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tier-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--bone-dim);
  margin-top: 2px;
}

/* ---------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 0 var(--pad); background: var(--obsidian-2);
  border-bottom: 1px solid var(--line);
}
.tab {
  appearance: none; background: transparent; border: 0;
  border-bottom: 2px solid transparent;
  color: var(--bone-faint); font-size: 0.78rem; text-transform: uppercase;
  padding: 14px 16px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px;
}
.tab:hover { color: var(--bone-dim); }
.tab[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.tab-badge {
  font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--bone-dim); border-radius: 999px; padding: 1px 7px;
}
.tab-badge-error { background: var(--error); border-color: var(--error); color: #170603; font-weight: 700; }

/* ---------------------------------------------------------- panels */
main { padding: var(--pad); max-width: 1500px; margin: 0 auto; }
.panel:focus { outline: none; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px 18px;
  margin: 0;
}
.card legend {
  font-size: 0.75rem; text-transform: uppercase; color: var(--gold);
  padding: 0 8px; margin-left: -8px;
}

.field { margin-top: 14px; min-width: 0; }
.field:first-of-type { margin-top: 6px; }
.field label {
  display: block; font-size: 0.74rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--bone-dim); margin-bottom: 6px;
}
.field .unit, .field .opt { color: var(--bone-faint); text-transform: none; letter-spacing: 0; }
.field-row { display: grid; gap: 14px 12px; grid-template-columns: 1fr 1fr; align-items: start; margin-top: 14px; }
.field-row.four { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Inputs inside a row must share one baseline — the per-field top margin would
   stagger them because :first-of-type only matches the first cell. */
.field-row > .field, .field-row > .field:first-of-type { margin-top: 0; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; font: inherit; font-size: 0.95rem;
  color: var(--bone); background: var(--obsidian);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; min-height: 44px;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--bone-faint) 50%),
                    linear-gradient(135deg, var(--bone-faint) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
input[aria-invalid="true"] { border-color: var(--error); background: #170908; }
textarea { resize: vertical; min-height: 60px; }

.hint { font-size: 0.78rem; color: var(--bone-faint); margin: 6px 0 0; }
.empty { color: var(--bone-faint); font-size: 0.88rem; font-style: italic; }

.form-errors {
  margin: 16px 0 0; padding: 12px 14px;
  background: var(--error-deep); border-left: 3px solid var(--error);
  color: #f3c9c3; font-size: 0.88rem;
}
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }

.actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.actions .hint { margin: 0; flex: 1 1 240px; }

/* --------------------------------------------------------- buttons */
.btn {
  appearance: none; font: inherit; font-family: var(--serif);
  font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bone); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 20px; min-height: 44px; cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--gold-dim); color: var(--gold-bright); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #16120a; border-color: var(--gold); font-weight: 700;
}
.btn-primary:hover:not(:disabled) { color: #000; filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--error-edge); color: #ffd9d4; }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: 0.7rem; }
.btn.is-busy { position: relative; color: transparent; }
.btn.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.3); border-top-color: #16120a;
  animation: spin 0.7s linear infinite;
}
.btn:not(.btn-primary).is-busy::after { border-color: rgba(236,231,221,.25); border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ chat */
.chat-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px 18px;
  display: flex; flex-direction: column;
  max-width: 980px;
}
.chat-head h2 { margin-bottom: 4px; }
.chat-head .hint { max-width: 90ch; }
.chat-log {
  margin: 16px 0; min-height: 260px; max-height: 58vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding-right: 4px;
}
.msg { max-width: 92%; }
.msg-role {
  font-family: var(--serif); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--bone-faint); margin-bottom: 5px;
}
.msg-body {
  padding: 11px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--obsidian-2);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem;
}
.msg-user { align-self: flex-end; }
.msg-user .msg-role { text-align: right; color: var(--gold-dim); }
.msg-user .msg-body { background: #1b1710; border-color: var(--gold-dim); }
.msg-lara .msg-role { color: var(--gold); }
.msg-error .msg-body { background: var(--error-deep); border-color: var(--error-edge); color: #f3c9c3; }

.tools { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.tool {
  font-family: var(--mono); font-size: 0.75rem;
  border: 1px solid var(--line); border-left: 2px solid var(--info);
  background: #0c1512; color: var(--bone-dim);
  padding: 7px 10px; border-radius: var(--r);
  overflow-wrap: anywhere;
}
.tool-name { color: var(--info); }
.tool-args { color: var(--bone-faint); }
.tool-result { display: block; margin-top: 4px; color: var(--bone-dim); }
.tool-pending { border-left-color: var(--warn); }
.tool-pending .tool-name { color: var(--warn); }

.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; }
.chat-hint { margin-top: 8px; }
.typing::after {
  content: "\2588"; color: var(--gold); animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* -------------------------------------------------------- findings */
.findings-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.findings-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill {
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--bone-dim);
}
.pill-error { background: var(--error-deep); border-color: var(--error-edge); color: #ffb7ae; }
.pill-warning { background: var(--warn-deep); border-color: #6b5313; color: #f0cd7f; }
.pill-info { background: var(--info-deep); border-color: #23483f; color: #8fcbba; }

.findings-list { display: flex; flex-direction: column; gap: 24px; }
.finding-group h3 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--bone-dim); margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.finding {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  border: 1px solid var(--line); border-left-width: 4px;
  background: var(--panel); border-radius: var(--r);
  padding: 13px 16px; margin-bottom: 10px;
}
.finding-error   { border-left-color: var(--error); }
.finding-warning { border-left-color: var(--warn); }
.finding-info    { border-left-color: var(--info); }
.finding-blocking {
  border-color: var(--error); border-left-width: 6px;
  background: linear-gradient(90deg, var(--error-deep), var(--panel) 45%);
  box-shadow: 0 0 0 1px rgba(255,77,61,.3);
}
.f-sev {
  font-family: var(--serif); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 3px 8px; border-radius: var(--r);
  align-self: start; white-space: nowrap;
  background: var(--panel-2); color: var(--bone-dim); border: 1px solid var(--line);
}
.finding-error .f-sev   { background: var(--error); color: #170603; border-color: var(--error); font-weight: 700; }
.finding-warning .f-sev { background: var(--warn); color: #241a03; border-color: var(--warn); }
.finding-info .f-sev    { background: var(--info-deep); color: #8fcbba; border-color: #23483f; }
.f-msg { font-size: 0.94rem; color: var(--bone); }
.f-meta {
  grid-column: 2; display: flex; gap: 8px 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.75rem; color: var(--bone-faint);
}
.f-cite { color: var(--gold); }
.f-cite-missing { color: var(--error); }
.f-blocking-tag {
  grid-column: 2; margin-top: 4px;
  font-family: var(--serif); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--error);
}

/* ---------------------------------------------------------- sheets */
.sheets-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}
.sheet-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.sheet-table th {
  text-align: left; font-family: var(--serif); font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-faint);
  border-bottom: 1px solid var(--line); padding: 8px 10px;
}
.sheet-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.sheet-table tr:hover td { background: var(--panel); }
.sheet-num { font-family: var(--mono); color: var(--gold); white-space: nowrap; }
.sheet-scale { font-family: var(--mono); color: var(--bone-faint); font-size: 0.8rem; white-space: nowrap; }

.download-disclaimer {
  background: #16120a; border: 1px solid var(--gold-dim); border-radius: var(--r);
  padding: 12px 14px; margin-bottom: 16px;
}
.dl-label {
  display: block; font-family: var(--serif); font-size: 0.66rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.download-disclaimer p { margin: 0; font-size: 0.82rem; color: #ddd3bd; }

.downloads { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-dl { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; min-width: 150px; }
.dl-desc { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0; text-transform: none; opacity: 0.8; }

.as-built { margin-top: 18px; border: 1px solid var(--warn); background: var(--warn-deep); padding: 12px 14px; border-radius: var(--r); }
.as-built .dl-label { color: var(--warn); }

.cover-scope { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.cover-scope summary {
  cursor: pointer; padding: 12px 14px; font-size: 0.82rem; color: var(--bone-dim);
  min-height: 44px; display: flex; align-items: center;
}
.cover-scope summary:hover { color: var(--gold-bright); }
.cover-scope pre, .as-built pre {
  margin: 0; padding: 0 14px 14px; font-family: var(--mono); font-size: 0.74rem;
  line-height: 1.55; color: var(--bone-dim); white-space: pre-wrap; overflow-wrap: anywhere;
}
.as-built pre { padding: 0; color: #f0cd7f; }

/* ---------------------------------------------------------- footer */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px var(--pad);
  background: var(--obsidian-2); border-top: 1px solid var(--line);
  font-family: var(--serif); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--bone-faint);
}

.toast {
  position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--gold-dim);
  color: var(--bone); padding: 11px 18px; border-radius: var(--r);
  font-size: 0.85rem; z-index: 50; max-width: 90vw;
  box-shadow: 0 8px 30px rgba(0,0,0,.6);
}
.toast-error { border-color: var(--error-edge); background: var(--error-deep); color: #f3c9c3; }

/* --------------------------------------------------------- narrow */
@media (max-width: 700px) {
  :root { --pad: 12px; }
  .field-row { grid-template-columns: 1fr; }
  .banner { flex-direction: column; gap: 8px; }
  .msg { max-width: 100%; }
  .actions .hint { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition: none !important; }
}


/* Generation failure panel — the engine's refusal, stated plainly. */
.gen-failure {
  border: 1px solid rgba(214, 122, 92, .55);
  border-left: 6px solid #d67a5c;
  background: rgba(214, 122, 92, .08);
  border-radius: 10px;
  padding: 18px 20px;
}
.gen-failure-title {
  font-weight: 600;
  letter-spacing: .02em;
  color: #e8a488;
  margin-bottom: 8px;
}
.gen-failure-detail {
  margin: 0;
  color: var(--bone, #e8e3da);
  line-height: 1.55;
  white-space: pre-wrap;
}

/* ---------------------------------------------------------------- 3D view */
.view-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 12px;
}
.view-stats { color: var(--bone-dim, #a9a294); font-size: 13px; }
.view-stats-error { color: #d67a5c; }
.view-actions { display: flex; align-items: center; gap: 14px; }
.view-toggle { font-size: 13px; color: var(--bone-dim, #a9a294); cursor: pointer; }
.view-canvas {
  width: 100%; height: min(68vh, 720px); min-height: 380px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(201, 162, 39, .18);
  background: #0d0d0f;
}
.view-canvas canvas { display: block; width: 100%; height: 100%; }
.view-note {
  margin-top: 12px; font-size: 12px; line-height: 1.6;
  color: var(--bone-dim, #a9a294); max-width: 78ch;
}

.view-select {
  background: rgba(255,255,255,.04);
  color: var(--bone, #e8e3da);
  border: 1px solid rgba(201,162,39,.28);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 13px;
}

.room-detail {
  margin-top: 14px; padding: 16px 18px;
  border: 1px solid rgba(201,162,39,.22); border-radius: 12px;
  background: rgba(255,255,255,.02); max-width: 62ch;
}
.room-detail h3 {
  margin: 0 0 10px; font-size: 16px; color: var(--gold, #c9a227);
  font-weight: 600; letter-spacing: .02em;
}
.room-detail dl { margin: 0; display: grid; grid-template-columns: 8.5rem 1fr; gap: 6px 14px; }
.room-detail dt { color: var(--bone-dim, #a9a294); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.room-detail dd { margin: 0; color: var(--bone, #e8e3da); font-size: 13.5px; }

/* ------------------------------------------------------------------ costing
 *
 * The visual job here is one distinction: a priced line versus an unpriced
 * one. An unpriced line is dimmed and says "not priced" in words, because a
 * blank cell reads as zero at a glance and this screen decides whether someone
 * buys a house.
 */

.cost-summary {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--bone-faint);
}
.cost-summary.cost-partial  { border-left-color: var(--warn); }
.cost-summary.cost-complete { border-left-color: var(--gold); }

.cost-total { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; }
.cost-total-label {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--bone-dim);
}
.cost-total-value {
  font-size: 2rem; font-weight: 600; color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.cost-caveat { margin: 0; font-size: .85rem; color: var(--bone-dim); line-height: 1.5; }

.cost-warning {
  padding: .85rem 1rem; margin: 0 0 1.25rem;
  background: var(--error-deep); border: 1px solid var(--error-edge);
  color: var(--bone); font-size: .87rem; line-height: 1.5;
}

.cost-table {
  width: 100%; border-collapse: collapse; margin: 0 0 1.75rem;
  font-size: .88rem;
}
.cost-table caption {
  text-align: left; padding: 0 0 .5rem;
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
.cost-table th, .cost-table td {
  padding: .55rem .7rem; border-bottom: 1px solid var(--line-soft);
  text-align: left; vertical-align: middle;
}
.cost-table thead th {
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bone-faint); font-weight: 600; border-bottom-color: var(--line);
}
.cost-table tbody th { font-weight: 400; color: var(--bone); }
.cost-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cost-table td.num { color: var(--bone); }

.cost-row-unpriced tbody th, .cost-row-unpriced th, .cost-row-unpriced td {
  color: var(--bone-faint);
}
.cost-blank {
  font-size: .78rem; font-style: italic; color: var(--bone-faint);
}
.cost-extended { font-weight: 600; }

.cost-input-wrap { display: inline-flex; align-items: center; gap: .15rem; }
.cost-currency { color: var(--bone-faint); font-size: .85rem; }
.cost-input {
  width: 6.5rem; padding: .35rem .5rem; text-align: right;
  background: var(--obsidian-2); color: var(--bone);
  border: 1px solid var(--line); border-radius: 3px;
  font: inherit; font-variant-numeric: tabular-nums;
}
.cost-input:focus {
  outline: none; border-color: var(--gold); background: var(--obsidian);
}
.cost-input-saving { border-color: var(--gold-dim); }
.cost-input-bad    { border-color: var(--error); background: var(--error-deep); }

/* The number spinners steal width and nobody nudges a price by 0.01. */
.cost-input::-webkit-outer-spin-button,
.cost-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cost-input[type=number] { -moz-appearance: textfield; appearance: textfield; }

@media (max-width: 640px) {
  .cost-table { font-size: .82rem; }
  .cost-table th, .cost-table td { padding: .45rem .4rem; }
  .cost-input { width: 5rem; }
  .cost-total-value { font-size: 1.6rem; }
}

/* --------------------------------------------------- capture form */
.capture-status {
  margin-top: 16px; padding: 12px 14px;
  background: var(--info-deep); border-left: 3px solid var(--info);
  color: var(--bone); font-size: 0.88rem;
}
.capture-status.success { background: #0f2b25; border-left-color: var(--info); }
.capture-status.error { background: var(--error-deep); border-left-color: var(--error); color: #f3c9c3; }

.field .req { color: var(--error); font-weight: 700; }

.file-input {
  width: 100%; font: inherit; font-size: 0.88rem;
  color: var(--bone-dim); background: var(--obsidian);
  border: 1px dashed var(--line); border-radius: var(--r);
  padding: 12px; cursor: pointer;
}
.file-input:hover { border-color: var(--gold-dim); }
.file-input:focus { border-color: var(--gold); outline: none; }

.photo-preview {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px; margin-top: 10px;
}
.photo-preview img {
  width: 100%; height: 80px; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--r);
}

.palette-inputs {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.color-input {
  width: 48px; height: 48px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--obsidian); cursor: pointer;
}
.color-input:focus { border-color: var(--gold); outline: none; }

/* --------------------------------------------------- room summary */
.summary-captures {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 16px;
}
.summary-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px;
}
.summary-card h3 {
  font-family: var(--serif); font-size: 1rem;
  color: var(--gold); margin: 0 0 8px;
}
.summary-meta { font-size: 0.88rem; color: var(--bone-dim); margin: 0 0 8px; }
.summary-notes { font-size: 0.88rem; color: var(--bone); font-style: italic; margin: 8px 0; }
.summary-dims { font-size: 0.85rem; color: var(--bone-dim); margin: 6px 0; }
.summary-colors { display: flex; gap: 8px; margin: 8px 0; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--line); flex: none;
}
.summary-finishes, .summary-materials, .summary-tags,
.summary-presets, .summary-contractor {
  font-size: 0.85rem; color: var(--bone-dim); margin: 6px 0;
}
.summary-presets strong { color: var(--gold); }

.summary-export { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.export-actions { display: flex; gap: 12px; margin-bottom: 16px; }
.export-content { background: var(--obsidian); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.export-content pre {
  margin: 0 0 12px; white-space: pre-wrap; word-break: break-all;
  font-family: var(--mono); font-size: 0.82rem; color: var(--bone);
  max-height: 400px; overflow-y: auto;
}
