/* ============================================================
   RENOVATE — Stoll Office Console
   Design language ported from StokaTerminal 2.1 (dark / crimson glass)
   Design tokens live in public/tokens.css (ported from ST variables.css),
   loaded by page() BEFORE this file. This file holds feature CSS only and
   never redefines a token. See docs/DESIGN-CANON.md.
   ============================================================ */

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

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: var(--accent-primary); }

/* Ambient backdrop — deep radial wash + faint crimson bloom + grid */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1100px 700px at 50% -10%, rgba(220, 20, 60, 0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(139, 30, 50, 0.08), transparent 55%),
    linear-gradient(180deg, #0b0b11 0%, #08080d 100%);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(1000px 700px at 50% 30%, #000 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(1000px 700px at 50% 30%, #000 25%, transparent 80%);
}

/* ============================================================
   Wordmark
   ============================================================ */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.wordmark .mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow), 0 0 0 4px var(--accent-subtle);
  flex: none;
}
.wordmark .name { color: var(--text-primary); }
.wordmark .accent { color: var(--accent-primary); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 412px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-modal), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 38px 34px 30px;
  animation: rise 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-head { text-align: center; margin-bottom: 26px; }
.login-head .wordmark { font-size: 20px; }
.login-head .tagline {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-family);
  padding: 12px 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.field input::placeholder { color: var(--text-muted); }
.field input:focus {
  outline: none;
  border-color: var(--border-accent);
  background: rgba(0, 0, 0, 0.36);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.btn {
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent-secondary));
  border-radius: var(--radius-xl);
  padding: 13px 16px;
  margin-top: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-normal), filter var(--transition-fast);
  box-shadow: 0 4px 16px rgba(220, 20, 60, 0.22);
}
.btn:hover { box-shadow: var(--shadow-glow), 0 6px 20px rgba(220, 20, 60, 0.28); filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }

.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(242, 139, 130, 0.10);
  border: 1px solid rgba(242, 139, 130, 0.30);
  color: var(--error);
  font-size: 12.5px;
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: 18px;
  animation: rise 0.25s ease both;
}
.alert .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--error); flex: none; }

.login-foot {
  margin-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.login-foot .lock { opacity: 0.7; }

/* ============================================================
   APP SHELL
   ============================================================ */
/* ST app shell: a thin top chrome strip over a [scrollable main | 96px right
   rail] body. Ported from StokaTerminal-2.1 AppShell.css + TemporalRail.css. */
.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* --- top chrome strip (38px): wordmark left, Sign Out right --- */
.app-chrome {
  flex-shrink: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
}
.app-chrome-left { display: flex; align-items: center; min-width: 0; }
.app-chrome .wordmark { font-size: 12px; letter-spacing: 0.22em; }
.app-chrome .wordmark .mark { width: 7px; height: 7px; }
.chrome-controls { display: flex; align-items: center; gap: 4px; }
.app-chrome form { display: inline-flex; }
.chrome-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-family);
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}
.chrome-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hover);
}
.chrome-btn svg { width: 15px; height: 15px; stroke: currentColor; }

/* --- body: scrollable main + fixed-width right rail --- */
.app-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* --- right rail: crimson dot + floating circular modebar bubbles --- */
.app-rail {
  width: 96px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  border-left: 1px solid var(--border-default);
  position: relative;
}
.rail-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 16px;
}
.rail-brand .mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow), 0 0 0 4px var(--accent-subtle);
}
/* The bubble column floats, vertically centered to the rail, overhanging the
   rail's inner (left) edge — exactly the ST TemporalRail modebar geometry. */
.modebar {
  position: absolute;
  top: 50%;
  left: -18px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 8;
}
.modebar-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 14, 22, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.14s, background 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.modebar-btn svg { width: 14px; height: 14px; stroke: currentColor; }
.modebar-btn:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(20, 20, 28, 0.95);
  border-color: rgba(255, 255, 255, 0.18);
}
.modebar-btn.active {
  color: var(--accent-primary);
  background: rgba(40, 12, 18, 0.95);
  border-color: rgba(220, 20, 60, 0.55);
  box-shadow: 0 2px 14px rgba(220, 20, 60, 0.28);
}

/* The page content column, centered inside the scrolling .app-main. The wrapper
   owns flex + scroll, so .main is just a max-width-capped column. */
.main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 26px 40px;
}

/* Narrow viewport: the rail thins to 56px and the bubble column sits flush
   inside it (no overhang) so it stops colliding with content. */
@media (max-width: 640px) {
  .app-rail { width: 56px; }
  .modebar { left: 0; right: 0; }
  .app-chrome .wordmark .name { display: none; }
}

.hero { text-align: center; margin-bottom: 48px; animation: rise 0.5s ease both; }
.hero .eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent-hover), var(--accent-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 16px;
}
.panel {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: 22px;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}
.panel:hover { border-color: var(--border-hover); background: var(--card-bg-hover); transform: translateY(-2px); }
.panel .icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-lg);
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  margin-bottom: 14px;
}
.panel .icon svg { width: 18px; height: 18px; stroke: var(--accent-primary); }
.panel h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; letter-spacing: 0.01em; }
.panel p { color: var(--text-muted); font-size: 12.5px; line-height: 1.55; }
.panel .tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px dashed var(--border-default);
  border-radius: 9999px;
  padding: 4px 10px;
}

.foot {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 28px 0 12px;
  border-top: 1px solid var(--border-default);
  margin-top: 8px;
}

/* panels-as-links */
a.panel { text-decoration: none; color: inherit; display: block; }
a.panel:hover { color: inherit; }

/* ============================================================
   ASSETS PAGE
   ============================================================ */
.asset-section { margin-bottom: 44px; animation: rise 0.45s ease both; }
.section-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
}
.section-head h2 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.section-head .count {
  font-size: 11px; color: var(--accent-primary);
  background: var(--accent-subtle); border: 1px solid var(--border-accent);
  border-radius: 9999px; padding: 2px 9px; font-weight: 600;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.asset {
  display: flex; flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.asset:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-card); }

.asset-thumb {
  display: block; position: relative;
  aspect-ratio: 16 / 10;
  background: #08080d;
  border-bottom: 1px solid var(--border-default);
  overflow: hidden;
}
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--transition-slow, 0.4s ease); }
.asset:hover .asset-thumb img { transform: scale(1.03); }
.asset-thumb-doc {
  display: grid; place-items: center;
  background:
    radial-gradient(420px 200px at 50% 0%, rgba(220, 20, 60, 0.10), transparent 70%),
    linear-gradient(180deg, #101019, #0a0a12);
}
.asset-thumb-doc .doc-glyph svg { width: 46px; height: 46px; stroke: var(--accent-primary); opacity: 0.92; }
.asset-thumb-doc .doc-ext {
  position: absolute; bottom: 12px; right: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--text-secondary);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  padding: 2px 7px; background: rgba(0,0,0,0.35);
}

.asset-body { padding: 16px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.asset-body h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.asset-label { color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; margin-bottom: 8px; }
.asset-meta { color: var(--text-muted); font-size: 11px; margin-bottom: 14px; word-break: break-word; }
.asset-actions { display: flex; gap: 8px; margin-top: auto; }

.btn-sm {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  color: #fff; cursor: pointer;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent-secondary));
  border: 1px solid transparent; border-radius: var(--radius-lg);
  padding: 8px 13px; text-decoration: none;
  transition: filter var(--transition-fast), box-shadow var(--transition-normal), border-color var(--transition-fast);
}
.btn-sm svg { width: 14px; height: 14px; stroke: currentColor; }
.btn-sm:hover { filter: brightness(1.05); box-shadow: 0 4px 14px rgba(220, 20, 60, 0.22); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border-default);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-accent); background: var(--accent-subtle); box-shadow: none; }

@media (max-width: 560px) {
  .login-card { padding: 30px 24px 26px; }
  .hero h1 { font-size: 27px; }
  .main { padding: 40px 18px; }
  .asset-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   IN-APP PDF VIEWER  (ported from StokaTerminal 2.1 PdfViewer)
   Dark crimson chrome, white pages, lifted-paper shadow.
   ============================================================ */

/* --- viewer page header (back / title / download) --- */
.main--viewer {
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  padding: 28px 26px 32px;
}
.viewer-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.viewer-title { flex: 1 1 auto; min-width: 0; text-align: center; }
.viewer-title h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-title p {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- viewer root --- */
.pdfv {
  display: flex;
  flex-direction: column;
  height: 78vh;
  min-height: 480px;
  min-width: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  overflow: hidden;
}
.pdfv-doc { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* --- toolbar (slim, 42px) --- */
.pdfv-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 42px;
  padding: 0 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
}
.pdfv-tb-group { display: flex; align-items: center; gap: 4px; }
.pdfv-tb-spacer { flex: 1 1 auto; }

.pdfv-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.78rem;
  transition: background .12s, color .12s, border-color .12s;
}
.pdfv-tb-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.pdfv-tb-btn:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.14);
}
.pdfv-tb-btn:disabled { opacity: .35; cursor: default; }

.pdfv-tb-page, .pdfv-tb-zoom {
  font-size: 0.78rem;
  color: var(--text-primary);
  min-width: 64px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pdfv-tb-zoom { min-width: 46px; }
.pdfv-tb-dim { color: var(--text-muted); }
.pdfv-tb-zoom.is-custom { color: var(--accent-primary); }

/* --- fit segmented control (Width | Page) --- */
.pdfv-seg {
  display: inline-flex;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-right: 4px;
}
.pdfv-seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 4px 10px;
  height: 28px;
  cursor: pointer;
  font-family: var(--font-family);
  transition: background .12s, color .12s;
}
.pdfv-seg-btn + .pdfv-seg-btn { border-left: 1px solid var(--border-default); }
.pdfv-seg-btn:hover:not(.is-active) { background: var(--bg-tertiary); color: var(--text-primary); }
.pdfv-seg-btn.is-active { background: var(--accent-primary); color: #fff; }

/* --- body / scroll area --- */
.pdfv-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: row; }
.pdfv-scroll {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  padding: 16px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--bg-primary);
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) var(--bg-primary);
}
.pdfv-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-width: 100%;
}

/* --- the white page sheet with lifted-paper shadow --- */
.pdfv-page {
  position: relative;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  background: #fff;
  line-height: 0;
  max-width: 100%;
}
.pdfv-canvas { display: block; max-width: 100%; height: auto; }
.pdfv-page-skel {
  width: 100%;
  min-height: 480px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
}

/* --- loading / error / empty state --- */
.pdfv-state {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 40px;
}

/* --- pdf.js text layer (mandatory for correct selection geometry) --- */
.pdfv .textLayer {
  position: absolute;
  text-align: initial;
  inset: 0;
  overflow: hidden;
  opacity: 0.2;
  line-height: 1;
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  z-index: 2;
}
.pdfv .textLayer span,
.pdfv .textLayer br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}
.pdfv .textLayer span.markedContent { top: 0; height: 0; }
.pdfv .textLayer ::selection { background: rgba(220, 20, 60, 0.35); }
.pdfv .textLayer ::-moz-selection { background: rgba(220, 20, 60, 0.35); }

/* --- thin scrollbars inside the viewer --- */
.pdfv-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.pdfv-scroll::-webkit-scrollbar-track { background: var(--bg-primary); }
.pdfv-scroll::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 4px; }
.pdfv-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }

/* --- responsive height floors --- */
@media (max-width: 1024px) { .pdfv { min-height: 60vh; } }
@media (max-width: 768px) {
  .pdfv { min-height: 400px; }
  .pdfv-toolbar { gap: 8px; }
  .viewer-title h1 { font-size: 14px; }
}
@media (max-width: 560px) {
  .main--viewer { padding: 20px 12px 24px; }
  .pdfv-seg-btn { padding: 4px 7px; }
  .pdfv-tb-page { min-width: 0; }
}

/* ============================================================
   IMAGE VIEWER (/assets/view of a photo)
   ============================================================ */
.imgv {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 78vh;
  min-height: 480px;
}
.imgv-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(640px 320px at 50% 0%, rgba(220, 20, 60, 0.05), transparent 70%),
    #08080d;
}
.imgv-body.is-grabbing { cursor: grabbing; }
.imgv-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 34px rgba(0, 0, 0, 0.55);
  user-select: none;
  -webkit-user-drag: none;
}
.imgv-img.is-fit { cursor: zoom-in; }
.imgv-img:not(.is-fit) { max-width: none; max-height: none; cursor: grab; }
.imgv-body .pdfv-state {
  position: absolute; inset: 0; margin: auto; height: max-content; width: max-content;
}
.imgv-body::-webkit-scrollbar { width: 8px; height: 8px; }
.imgv-body::-webkit-scrollbar-track { background: var(--bg-primary); }
.imgv-body::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 4px; }
.imgv-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }
@media (max-width: 768px) { .imgv { min-height: 400px; } }

/* ============================================================
   COST ESTIMATE (/estimate)
   ============================================================ */
.est-summary {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 18px;
  background: linear-gradient(180deg, rgba(220,20,60,0.07), rgba(255,255,255,0.012));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-2xl);
  padding: 24px 26px;
  margin-bottom: 34px;
}
.est-total { display: flex; flex-direction: column; gap: 4px; }
.est-total-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-primary); }
.est-total-val { font-size: 40px; font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
.est-total-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.est-summary-actions { display: flex; gap: 8px; }

.est-section { margin-bottom: 34px; }
.est-list { display: flex; flex-direction: column; gap: 2px; }
.est-item {
  padding: 16px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.est-item:hover { border-color: var(--border-hover); background: var(--card-bg-hover); }
.est-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.est-scope { font-size: 14px; font-weight: 600; }
.est-amt { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.est-detail { color: var(--text-muted); font-size: 12.5px; line-height: 1.55; margin: 6px 0 12px; }
.est-bar { height: 4px; border-radius: 9999px; background: rgba(255,255,255,0.05); overflow: hidden; }
.est-bar span { display: block; height: 100%; border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent-hover)); }
.est-total-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding: 16px 18px;
  border-top: 1px solid var(--border-accent);
  font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums;
}

.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.pay-cell {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl); padding: 16px 18px;
}
.pay-pct { font-size: 22px; font-weight: 650; color: var(--accent-hover); line-height: 1; }
.pay-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.pay-amt { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.est-terms { color: var(--text-muted); font-size: 12px; line-height: 1.6; margin-top: 16px; max-width: 760px; }

@media (max-width: 560px) {
  .est-total-val { font-size: 32px; }
  .est-summary { padding: 20px; }
}

/* ============================================================
   UPLOADER + uploaded badge
   ============================================================ */
.uploader { margin-bottom: 30px; }
.dropzone {
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius-2xl);
  background: rgba(255,255,255,0.012);
  padding: 30px 24px;
  text-align: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.dropzone.is-over { border-color: var(--accent-primary); background: var(--accent-subtle); }
.dz-icon {
  width: 44px; height: 44px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: var(--radius-lg);
  background: var(--accent-subtle); border: 1px solid var(--border-accent);
}
.dz-icon svg { width: 20px; height: 20px; stroke: var(--accent-primary); }
.dz-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.dz-sub { font-size: 12.5px; color: var(--text-muted); }
.dz-browse {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
  color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px;
}
.dz-browse:hover { color: var(--accent-primary); }
.dz-status {
  margin-top: 12px; font-size: 12px; color: var(--text-secondary);
  background: var(--accent-subtle); border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg); padding: 8px 12px; display: inline-block;
}
.asset-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--accent-hover);
  background: rgba(10,10,15,0.78); border: 1px solid var(--border-accent);
  border-radius: 9999px; padding: 3px 9px;
}
.btn-icon { padding: 8px 10px; }
.btn-icon svg { width: 14px; height: 14px; }

/* ============================================================
   OVERVIEW DASHBOARD (console /)
   ============================================================ */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 30px;
}
.stat {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl); padding: 18px 20px;
}
.stat-val { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-primary); margin-top: 6px; }
.stat-sub { font-size: 11.5px; color: var(--text-muted); }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.see-all { font-size: 12px; color: var(--accent-hover); display: inline-flex; align-items: center; gap: 5px; }
.see-all svg { width: 12px; height: 12px; stroke: currentColor; }
.dash-card {
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl); padding: 22px;
}
.dash-budget { margin-bottom: 18px; }
.dash-budget-val { display: block; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
.dash-budget-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.mini-scope { margin-bottom: 12px; }
.mini-scope-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.mini-scope-head span:first-child { color: var(--text-secondary); }
.mini-scope-head span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-card .btn-sm { margin-top: 16px; }
.dash-empty { color: var(--text-muted); font-size: 13px; }

.qlinks { display: flex; flex-direction: column; gap: 8px; }
.qlink {
  display: flex; align-items: center; gap: 13px;
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl); padding: 13px 15px;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}
.qlink:hover { border-color: var(--border-hover); background: var(--card-bg-hover); transform: translateX(2px); }
.qlink-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-lg); background: var(--accent-subtle); border: 1px solid var(--border-accent); }
.qlink-ic svg { width: 16px; height: 16px; stroke: var(--accent-primary); }
.qlink-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.qlink-label { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.qlink-sub { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qlink-arrow { color: var(--text-muted); }
.qlink-arrow svg { width: 14px; height: 14px; stroke: currentColor; }
.qlink:hover .qlink-arrow { color: var(--accent-hover); }

@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }

/* ============================================================
   EMBED (chrome-less viewer) + COMPARE
   ============================================================ */
.embed { height: 100vh; }
.embed .pdfv, .embed .imgv { height: 100vh; min-height: 0; border: 0; border-radius: 0; }

.main--wide { max-width: 1440px; }
.cmp-controls {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
  margin-bottom: 16px;
}
.cmp-select {
  width: 100%; appearance: none;
  background: var(--bg-tertiary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  color: var(--text-primary); font: inherit; font-size: 13px; padding: 10px 32px 10px 13px; cursor: pointer;
}
.cmp-select:focus { outline: none; border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.cmp-swap {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  color: var(--text-secondary); font: inherit; font-size: 12px; padding: 9px 14px; cursor: pointer;
  transition: all var(--transition-fast);
}
.cmp-swap:hover { color: var(--text-primary); border-color: var(--border-accent); background: var(--accent-subtle); }
.cmp-swap svg { width: 14px; height: 14px; stroke: currentColor; transform: rotate(90deg); }

.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; height: calc(100vh - 250px); min-height: 460px; }
.cmp-pane {
  background: var(--bg-secondary); border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl); overflow: hidden;
}
.cmp-frame { width: 100%; height: 100%; border: 0; display: block; }
.cmp-empty { display: grid; place-items: center; height: 100%; color: var(--text-muted); font-size: 13px; }

@media (max-width: 860px) {
  .cmp { grid-template-columns: 1fr; height: auto; }
  .cmp-pane { height: 70vh; }
  .cmp-controls { grid-template-columns: 1fr; }
}

/* ============================================================
   PROJECT PROGRESS + NOTES (dashboard)
   ============================================================ */
.dash-section { margin-top: 34px; }
.phase-bar { height: 5px; border-radius: 9999px; background: rgba(255,255,255,0.05); overflow: hidden; margin-bottom: 16px; }
.phase-bar span { display: block; height: 100%; border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent-hover)); transition: width var(--transition-normal); }
.phases { display: flex; flex-wrap: wrap; gap: 10px; }
.phase {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl); padding: 10px 14px; font: inherit; text-align: left;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}
.phase:hover { border-color: var(--border-hover); background: var(--card-bg-hover); transform: translateY(-1px); }
.phase:disabled { opacity: 0.5; cursor: default; }
.phase-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-muted); box-shadow: 0 0 0 3px rgba(255,255,255,0.03); }
.phase-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.phase-state { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.phase--active { border-color: var(--border-accent); background: var(--accent-subtle); }
.phase--active .phase-dot { background: var(--accent-primary); box-shadow: 0 0 10px var(--accent-glow); }
.phase--active .phase-state { color: var(--accent-hover); }
.phase--done .phase-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(129,201,149,0.12); }
.phase--done .phase-state { color: var(--success); }
.phase--done .phase-label { color: var(--text-secondary); }

.note-add { display: flex; gap: 10px; margin-bottom: 16px; }
.note-input {
  flex: 1; background: rgba(0,0,0,0.28); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); color: var(--text-primary); font: inherit; font-size: 13px; padding: 11px 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.note-input::placeholder { color: var(--text-muted); }
.note-input:focus { outline: none; border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.note-add .btn-sm { white-space: nowrap; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.note {
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl); padding: 13px 15px;
}
.note-text { font-size: 13.5px; line-height: 1.5; color: var(--text-tertiary); }
.note-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.note-foot span { font-size: 11px; color: var(--text-muted); }
.note-del { background: none; border: none; padding: 0; cursor: pointer; font: inherit;
  font-size: 11px; color: var(--text-muted); transition: color var(--transition-fast); }
.note-del:hover { color: var(--error); }

/* ── Blueprint annotator ──────────────────────────────────────────────────
   Net-new region-drawing overlay (ST has none). The stage holds the rendered
   page plus an absolutely-positioned SVG; the panel carries scale, tag, and
   the live sqft readout. Tag colors mirror the Stage 3 region-tag palette. */
.annot { margin-top: 8px; }
.annot-back { margin-bottom: 14px; }
.annot-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-border);
}
.annot-tool-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.annot-mode.is-active {
  background: linear-gradient(180deg, var(--accent-hover), var(--accent-secondary));
  color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(220, 20, 60, 0.22);
}
.annot-save-state { font-size: 12px; color: var(--text-muted); }
.annot-save-state.is-ok { color: var(--success); }
.annot-save-state.is-err { color: var(--error); }

.annot-work { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }

.annot-stage {
  position: relative; display: inline-block; min-height: 300px;
  background: var(--bg-secondary); border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl); overflow: hidden; max-width: 100%;
}
.annot-canvas { display: block; max-width: 100%; height: auto; }
.annot-overlay { position: absolute; top: 0; left: 0; touch-action: none; }
.annot-overlay[data-mode="rect"], .annot-overlay[data-mode="polygon"], .annot-overlay[data-mode="calibrate"] { cursor: crosshair; }
.annot-overlay[data-mode="select"] { cursor: default; }

.annot-poly {
  fill: rgba(220, 20, 60, 0.12); stroke: var(--accent-primary); stroke-width: 2;
  cursor: pointer; transition: fill var(--transition-fast);
}
.annot-poly.is-selected { stroke-width: 3; fill: rgba(220, 20, 60, 0.2); }
.annot-poly.tag-new { fill: var(--accent-subtle); stroke: var(--accent-hover); }
.annot-poly.tag-renovate { fill: rgba(253, 214, 99, 0.14); stroke: var(--warning); }
.annot-poly.tag-demolition { fill: rgba(242, 139, 130, 0.14); stroke: var(--error); }
.annot-poly.tag-exclude { fill: rgba(255, 255, 255, 0.06); stroke: var(--text-muted); }
.annot-draft { fill: rgba(220, 20, 60, 0.08); stroke: var(--accent-hover); stroke-dasharray: 5 4; }
.annot-draft-line { fill: none; stroke: var(--accent-hover); stroke-width: 2; stroke-dasharray: 5 4; }
.annot-vertex { fill: var(--accent-primary); stroke: #fff; stroke-width: 1; }
.annot-cal-line { stroke: var(--accent-primary); stroke-width: 2.5; stroke-dasharray: 7 4; }
.annot-poly-label {
  fill: var(--text-primary); font-size: 11px; font-weight: 600;
  font-family: var(--font-mono); paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.7); stroke-width: 3px; text-anchor: middle; pointer-events: none;
}

/* Side panel */
.annot-panel { display: flex; flex-direction: column; gap: 18px; }
.annot-panel-block {
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl); padding: 16px 16px 18px;
}
.annot-panel-title {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-primary); margin-bottom: 12px;
}
.annot-scale-modes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.annot-radio { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.annot-radio input { accent-color: var(--accent-primary); }
.annot-scale-field { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.annot-scale-field label { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.annot-cal-feet, .annot-area-sqft, .annot-label-input, .annot-note-input {
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); color: var(--text-primary); font: inherit; font-size: 13px; padding: 9px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.annot-cal-feet:focus, .annot-area-sqft:focus, .annot-label-input:focus, .annot-note-input:focus {
  outline: none; border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-subtle);
}
.annot-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

.annot-tag-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.annot-tag {
  border: 1px solid var(--glass-border); background: var(--card-bg); color: var(--text-secondary);
  border-radius: var(--radius-full); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 10px;
  cursor: pointer; transition: all var(--transition-fast);
}
.annot-tag.tag-new { color: var(--accent-hover); }
.annot-tag.tag-renovate { color: var(--warning); }
.annot-tag.tag-demolition { color: var(--error); }
.annot-tag.tag-exclude { color: var(--text-muted); }
.annot-tag.is-active.tag-new { background: var(--accent-subtle); border-color: var(--accent-hover); }
.annot-tag.is-active.tag-renovate { background: rgba(253, 214, 99, 0.12); border-color: var(--warning); }
.annot-tag.is-active.tag-demolition { background: rgba(242, 139, 130, 0.12); border-color: var(--error); }
.annot-tag.is-active.tag-exclude { background: rgba(255, 255, 255, 0.06); border-color: var(--text-muted); }

.annot-field-label { display: block; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin: 10px 0 5px; }
.annot-region-edit .annot-label-input, .annot-region-edit .annot-note-input { width: 100%; }
.annot-region-del { margin-top: 14px; }
.annot-region-empty { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

.annot-region-list { display: flex; flex-direction: column; gap: 6px; }
.annot-region-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; cursor: pointer;
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: rgba(0, 0, 0, 0.18);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.annot-region-row:hover { border-color: var(--border-hover); background: var(--card-bg-hover); }
.annot-region-row.is-selected { border-color: var(--border-accent); background: var(--accent-subtle); }
.annot-region-tagdot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--accent-primary); }
.annot-region-tagdot.tag-new { background: var(--accent-hover); }
.annot-region-tagdot.tag-renovate { background: var(--warning); }
.annot-region-tagdot.tag-demolition { background: var(--error); }
.annot-region-tagdot.tag-exclude { background: var(--text-muted); }
.annot-region-name { flex: 1; font-size: 12.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.annot-region-sqft { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); flex: none; }
.annot-region-x { background: none; border: none; color: var(--text-muted); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; flex: none; }
.annot-region-x:hover { color: var(--error); }

.annot-sqft-readout { display: flex; gap: 22px; }
.annot-sqft { display: flex; flex-direction: column; gap: 4px; }
.annot-sqft-val { font-size: 20px; font-weight: 650; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.annot-sqft-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

@media (max-width: 860px) {
  .annot-work { grid-template-columns: 1fr; }
  .annot-panel { order: 2; }
}

/* ============================================================
   CITATIONS (Sources block, ST FileViewer SourcesPanel idiom)
   ============================================================ */
.ren-cite {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border-default);
  padding: 16px 0 4px; margin-top: 20px;
}
.ren-cite-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ren-cite-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.ren-cite-count {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; color: var(--text-muted);
}
.ren-cite-list { display: flex; flex-direction: column; gap: 6px; }
.ren-cite-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
/* Reconciled from ST's blue (#60a5fa) to renovate crimson. */
.ren-cite-link { color: var(--accent-hover); font-size: 0.82rem; font-weight: 500; text-decoration: none; }
.ren-cite-link:hover { color: var(--accent-primary); }
.ren-cite-meta { font-size: 0.72rem; color: var(--text-muted); flex: 1 1 220px; }

/* ============================================================
   ESTIMATOR (/estimator) — computed estimate cards
   ============================================================ */
.est-plan {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  padding: 22px 24px; margin-bottom: 22px;
}
.est-plan-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.est-plan-title { font-size: 17px; font-weight: 650; }
.est-plan-actions { display: flex; gap: 8px; }
.est-sample-flag { font-size: 11px; color: var(--warning); margin-left: 8px; }

.est-sqft-row { display: flex; gap: 22px; margin: 10px 0 18px; flex-wrap: wrap; }
.est-sqft { display: flex; flex-direction: column; gap: 4px; }
.est-sqft-val { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.est-sqft-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

.est-strat { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 18px 0; }
.est-strat-col h3 {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-primary); margin-bottom: 10px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.est-strat-total { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.est-strat-row { margin-bottom: 10px; }
.est-strat-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; font-size: 12.5px; margin-bottom: 4px;
}
.est-strat-row-head span:last-child { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.est-region-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 4px; }
.est-region-table th {
  text-align: left; text-transform: uppercase; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; color: var(--text-muted);
  padding: 8px 10px; border-bottom: 1px solid var(--glass-border);
}
.est-region-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--glass-border);
  font-variant-numeric: tabular-nums;
}
.est-region-table th:first-child, .est-region-table td:first-child { font-variant-numeric: normal; }
.est-region-tag {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-full);
  font-size: 10.5px; font-weight: 600;
}
.est-region-tag.tag-new { background: var(--accent-subtle); color: var(--accent-hover); }
.est-region-tag.tag-renovate { background: rgba(253, 214, 99, 0.12); color: var(--warning); }
.est-region-tag.tag-demolition { background: rgba(242, 139, 130, 0.12); color: var(--error); }
.est-region-tag.tag-exclude { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

.est-rollup { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 16px; max-width: 360px; }
.est-rollup-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; font-size: 12.5px; padding: 4px 0; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.est-rollup-grand {
  border-top: 1px solid var(--border-accent); margin-top: 4px; padding-top: 8px;
  font-size: 15px; font-weight: 650; color: var(--text-primary);
}

.est-calib {
  display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap;
  border: 1px solid var(--border-accent); border-radius: var(--radius-xl);
  background: var(--accent-subtle); margin: 14px 0; padding: 12px 16px; font-size: 12.5px;
}
.est-calib-cell { display: flex; flex-direction: column; gap: 2px; }
.est-calib-label { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.est-calib-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.est-calib .ok { color: var(--success); font-weight: 600; }
.est-calib .off { color: var(--warning); font-weight: 600; }
.est-calib-note { flex: 1 1 240px; color: var(--text-muted); }

.est-narrative { color: var(--text-tertiary); font-size: 13px; line-height: 1.6; margin: 12px 0; max-width: 820px; }
.est-plan-empty { color: var(--text-muted); font-size: 13px; }
.est-queued { font-size: 12.5px; color: var(--text-muted); }

@media (max-width: 640px) {
  .est-strat { grid-template-columns: 1fr; }
}
