/* ============================================================
   CMA Studio — Dark Dashboard System
   Near-black canvas, lime-chartreuse accent, rounded cards.
   ============================================================ */

:root {
  --bg:        #0C0D0F;
  --surface:   #15171B;   /* cards */
  --surface-2: #1B1E23;   /* nested panels */
  --surface-3: #22262C;   /* chips / hover */
  --border:    #262A30;
  --border-soft:#1E2228;

  --text:      #F2F4F6;
  --dim:       #9CA3AD;
  --faint:     #646B73;

  --lime:      #B6F23D;   /* primary accent */
  --lime-2:    #A4E22B;
  --lime-deep: #8FCC1F;
  --lime-soft: rgba(182,242,61,.13);
  --lime-line: rgba(182,242,61,.30);

  --amber:     #F5B33D;
  --sky:       #4FB6F5;
  --violet:    #A78BFA;
  --rose:      #F5638C;
  --up:        #7CE38B;
  --down:      #F5638C;

  --r:    16px;
  --r-sm: 11px;
  --font: 'Inter', -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2A2E35; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
a { color: inherit; text-decoration: none; }

.dim { color: var(--dim); }
.faint { color: var(--faint); }

/* ============================================================
   APP GRID
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 244px 1fr 312px;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.side {
  background: var(--bg);
  border-right: 1px solid var(--border-soft);
  padding: 22px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--lime);
  display: grid; place-items: center; color: #11140A; font-weight: 800; font-size: 16px; }
.brand .name { font-weight: 600; font-size: 15px; }
.brand .name span { display: block; font-size: 11px; color: var(--faint); font-weight: 500; }

.search { display: flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; margin-bottom: 22px; color: var(--faint); }
.search input { background: none; border: 0; outline: 0; color: var(--text); font-family: var(--font); font-size: 13px; width: 100%; }
.search kbd { margin-left: auto; background: var(--surface-3); border-radius: 5px; padding: 2px 6px; font-size: 10px; color: var(--dim); }

.nav-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 0 8px; margin: 14px 0 8px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--dim);
  font-weight: 500; font-size: 13.5px; cursor: pointer; transition: background .14s, color .14s; }
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--lime); color: #11140A; font-weight: 600; }
.nav-item .tag { margin-left: auto; background: var(--surface-3); color: var(--dim); font-size: 10.5px; padding: 1px 7px; border-radius: 20px; }
.nav-item.active .tag { background: rgba(17,20,10,.18); color: #11140A; }

.side__foot { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 12px 8px 2px; color: var(--faint); font-size: 12px; }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 28px; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; background: rgba(12,13,15,.86); backdrop-filter: blur(8px); z-index: 20; }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; }
.crumb b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; color: var(--dim); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: #333842; }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 13px;
  border: 1px solid transparent; cursor: pointer; font-family: var(--font); }
.btn-lime { background: var(--lime); color: #11140A; }
.btn-lime:hover { background: var(--lime-2); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: #353b45; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Main scroll area ---------- */
.canvas { padding: 24px 28px 40px; overflow: visible; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--dim); font-size: 13px; margin-top: 3px; }
.page-head .spacer { flex: 1; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r); padding: 20px; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card__head h3 { font-size: 15px; font-weight: 600; }
.card__head .spacer { flex: 1; }
.card__head .more { color: var(--faint); cursor: pointer; }
.pill { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--surface-3); color: var(--dim); }
.pill-lime { background: var(--lime-soft); color: var(--lime); }

.grid { display: grid; gap: 16px; }

/* KPI cards */
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r); padding: 17px 18px; }
.kpi .label { color: var(--dim); font-size: 12.5px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.kpi .label .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--lime); }
.kpi .label .dot svg { width: 14px; height: 14px; }
.kpi .figure { font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.kpi .delta { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; font-weight: 600; }
.kpi .delta.up { color: var(--up); }
.kpi .delta.flat { color: var(--dim); }
.kpi .delta svg { width: 13px; height: 13px; }
.kpi .delta .vs { color: var(--faint); font-weight: 500; }

/* Layout rows */
.row-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; min-width: 0; }
.card { min-width: 0; }
.chart-box { min-width: 0; }
.chart-box canvas { max-width: 100% !important; }

/* Donut + legend */
.overview { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: center; }
.donut-wrap { position: relative; width: 200px; height: 200px; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-size: 27px; font-weight: 700; display: block; line-height: 1; }
.donut-center span { font-size: 11.5px; color: var(--dim); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.legend .it { display: flex; align-items: flex-start; gap: 9px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; margin-top: 4px; flex: none; }
.legend .it .k { color: var(--dim); font-size: 12px; }
.legend .it .v { font-size: 15px; font-weight: 600; }

/* mini stat cards */
.ministat { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm); padding: 15px; }
.ministat .k { color: var(--dim); font-size: 12px; margin-bottom: 8px; }
.ministat .v { font-size: 20px; font-weight: 700; }
.ministat .sub { font-size: 11.5px; color: var(--up); margin-top: 4px; font-weight: 600; }

/* Value range gauge (dark) */
.gauge2 { margin-top: 6px; }
.gauge2 .track { position: relative; height: 8px; border-radius: 5px; margin: 30px 0 10px;
  background: linear-gradient(90deg, #2A2E35 0%, var(--lime-deep) 42%, var(--lime) 50%, var(--lime-deep) 58%, #2A2E35 100%); }
.gauge2 .needle { position: absolute; top: -6px; width: 3px; height: 20px; background: #fff; border-radius: 2px; transform: translateX(-50%); }
.gauge2 .needle::after { content: attr(data-v); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--lime); }
.gauge2 .ends { display: flex; justify-content: space-between; font-size: 12px; }
.gauge2 .ends b { display: block; font-size: 14px; font-weight: 600; }
.gauge2 .ends .r { text-align: right; }

/* Area chart card */
.chart-box { position: relative; width: 100%; }
.chart-box.area { height: 180px; }
.chart-box.bars { height: 170px; }

/* Histograms (dark) */
.histos2 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.histos2 .h { min-width: 0; }
.histos2 .h .lab { font-size: 11px; color: var(--dim); margin-bottom: 6px; }
.histos2 .h .cw { height: 64px; min-width: 0; width: 100%; position: relative; }
.histos2 canvas { max-width: 100% !important; }
.histos2 .h .me { font-size: 10.5px; color: var(--lime); margin-top: 5px; font-weight: 600; }

/* Comps table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { text-align: left; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 0 12px 12px 0; }
.tbl thead th.num, .tbl td.num { text-align: right; padding-right: 0; }
.tbl tbody td { padding: 12px 12px 12px 0; border-top: 1px solid var(--border-soft); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.015); }
.cell-name { display: flex; align-items: center; gap: 11px; }
.cell-name img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: none; }
.cell-name .who b { font-weight: 600; font-size: 13.5px; display: block; }
.cell-name .who span { color: var(--faint); font-size: 11.5px; }
.tag-status { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.tag-status.sold { background: var(--lime-soft); color: var(--lime); }
.tag-status.active { background: rgba(245,179,61,.14); color: var(--amber); }
.tag-status.pending { background: rgba(79,182,245,.14); color: var(--sky); }
.tag-status.subject { background: var(--surface-3); color: var(--text); }
.chip2 { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 3px 9px; font-weight: 600; font-variant-numeric: tabular-nums; }
.adjval { font-weight: 700; color: var(--lime); font-variant-numeric: tabular-nums; }

/* Map card */
.mapbox { height: 300px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); position: relative; }
#map { height: 100%; width: 100%; background: #0E0F12; }
.leaflet-container { background: #0E0F12; }
.mpin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: translate(-50%,-100%) rotate(-45deg);
  display: grid; place-items: center; border: 2px solid #0C0D0F; box-shadow: 0 3px 9px rgba(0,0,0,.5); }
.mpin span { transform: rotate(45deg); font-size: 11px; font-weight: 700; color: #11140A; }
.mpin.subj { background: var(--lime); width: 32px; height: 32px; z-index: 600; }
.mpin.comp { background: var(--amber); }
.mapcap { position: absolute; left: 12px; bottom: 12px; z-index: 600; background: rgba(21,23,27,.92); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px; font-size: 11px; color: var(--dim); display: flex; gap: 12px; }
.mapcap i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 0; }

/* CTA card (lime) */
.cta { background: linear-gradient(150deg, var(--lime) 0%, #C9F95B 100%); color: #11140A; border-radius: var(--r); padding: 22px; position: relative; overflow: hidden; }
.cta::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; background: rgba(17,20,10,.06); }
.cta .pill-d { display: inline-block; background: rgba(17,20,10,.14); border-radius: 20px; padding: 4px 11px; font-size: 11px; font-weight: 700; margin-bottom: 14px; }
.cta h3 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.cta h3 small { font-size: 13px; font-weight: 600; opacity: .7; }
.cta p { font-size: 12.5px; margin: 8px 0 16px; opacity: .82; line-height: 1.5; max-width: 92%; }
.cta .btn-d { background: #11140A; color: var(--lime); display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 11px 18px; font-weight: 700; font-size: 13px; }
.cta .btn-d svg { width: 15px; height: 15px; }

/* ---------- Right rail ---------- */
.rail { background: var(--bg); border-left: 1px solid var(--border-soft); padding: 22px 18px; display: flex; flex-direction: column; gap: 26px; height: 100vh; position: sticky; top: 0; overflow-y: auto; }
.rail h4 { font-size: 13px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; }
.rail h4 a { margin-left: auto; color: var(--faint); font-size: 11.5px; font-weight: 500; }
.feed { display: flex; flex-direction: column; gap: 15px; }
.feed .it { display: flex; gap: 11px; }
.feed .ic { width: 32px; height: 32px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border-soft); display: grid; place-items: center; color: var(--lime); flex: none; }
.feed .ic svg { width: 15px; height: 15px; }
.feed .tx { font-size: 12.5px; line-height: 1.4; }
.feed .tx b { font-weight: 600; }
.feed .tx span { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; }
.check .it .ic { color: var(--up); }
.check .it.todo .ic { color: var(--faint); }

.contact { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 11px; }
.contact img { width: 34px; height: 34px; border-radius: 50%; }
.contact .nm { font-size: 13px; font-weight: 600; }
.contact .nm span { display: block; font-size: 11px; color: var(--faint); font-weight: 400; }
.contact .acts { margin-left: auto; display: flex; gap: 7px; }
.contact .acts a { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.contact.hl { background: var(--lime); color: #11140A; }
.contact.hl .nm span { color: rgba(17,20,10,.6); }
.contact.hl .acts a { background: rgba(17,20,10,.16); color: #11140A; }
.contact:not(.hl) .acts a { background: var(--surface); border: 1px solid var(--border-soft); color: var(--dim); }
.contact .acts svg { width: 14px; height: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .app { grid-template-columns: 244px 1fr; }
  .rail { display: none; }
}
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .row-2, .row-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   HOLOGRAPHIC / AMBIENT / GLASS LAYER — slick tech feel
   (appended overrides — later rules win)
   ============================================================ */
:root {
  --holo: linear-gradient(120deg,#67E8F9 0%,#A78BFA 28%,#F472B6 52%,#B6F23D 78%,#67E8F9 100%);
  --glass:        rgba(255,255,255,.040);
  --glass-2:      rgba(255,255,255,.022);
  --glass-border: rgba(255,255,255,.085);
}

/* Ambient light blobs behind everything */
body { position: relative; background: #0A0B0D; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(620px 460px at 10% -4%, rgba(103,232,249,.10), transparent 60%),
    radial-gradient(720px 520px at 92% 6%, rgba(167,139,250,.12), transparent 62%),
    radial-gradient(640px 520px at 62% 104%, rgba(182,242,61,.09), transparent 60%),
    radial-gradient(520px 420px at 30% 70%, rgba(244,114,182,.06), transparent 60%);
}
.app { position: relative; z-index: 1; }
.side, .rail { background: transparent; }
.topbar { background: rgba(10,11,13,.72); }

/* Glass cards with holographic hairline + ambient depth */
.card, .kpi, .ministat {
  background: linear-gradient(180deg, var(--glass) 0%, var(--glass-2) 100%);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 24px 48px -24px rgba(0,0,0,.7);
  position: relative; overflow: hidden;
}
/* Holographic sheen line along the top edge */
.card::before, .kpi::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--holo); opacity: .5; mix-blend-mode: screen;
}
/* Ambient corner glow inside feature cards */
.card::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(182,242,61,.16), transparent 68%);
  pointer-events: none; filter: blur(8px);
}
.row-2 > .card:nth-child(2)::after,
.stack .card::after { background: radial-gradient(circle, rgba(103,232,249,.16), transparent 68%); }

/* KPI ambient hues — each card a different glow + holographic icon tile */
.kpi { overflow: hidden; }
.kpi::after {
  content: ""; position: absolute; left: -50px; bottom: -60px; width: 180px; height: 180px;
  border-radius: 50%; pointer-events: none; filter: blur(10px); opacity: .9;
}
.kpis .kpi:nth-child(1)::after { background: radial-gradient(circle, rgba(182,242,61,.20), transparent 70%); }
.kpis .kpi:nth-child(2)::after { background: radial-gradient(circle, rgba(103,232,249,.20), transparent 70%); }
.kpis .kpi:nth-child(3)::after { background: radial-gradient(circle, rgba(167,139,250,.22), transparent 70%); }
.kpis .kpi:nth-child(4)::after { background: radial-gradient(circle, rgba(244,114,182,.18), transparent 70%); }
.kpi .label .dot {
  background: linear-gradient(140deg, rgba(255,255,255,.10), rgba(255,255,255,.02));
  border: 1px solid var(--glass-border); box-shadow: 0 0 14px rgba(182,242,61,.25);
}
.kpis .kpi:nth-child(2) .label .dot { box-shadow: 0 0 14px rgba(103,232,249,.30); color: var(--sky); }
.kpis .kpi:nth-child(3) .label .dot { box-shadow: 0 0 14px rgba(167,139,250,.30); color: var(--violet); }
.kpis .kpi:nth-child(4) .label .dot { box-shadow: 0 0 14px rgba(244,114,182,.28); color: var(--rose); }
.kpi .figure { background: linear-gradient(180deg,#fff,#C9CED6); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Brand mark — holographic */
.brand .logo { background: var(--holo); background-size: 200% 200%; color: #0B0D08;
  box-shadow: 0 0 18px rgba(167,139,250,.5); }

/* Active nav pill + lime glow */
.nav-item.active { box-shadow: 0 0 22px rgba(182,242,61,.45); }
.btn-lime { box-shadow: 0 0 20px rgba(182,242,61,.40); }
.pill-lime { box-shadow: 0 0 14px rgba(182,242,61,.25); border: 1px solid rgba(182,242,61,.25); }

/* CTA — holographic ambient */
.cta { background: linear-gradient(135deg, #B6F23D 0%, #7BE3C9 48%, #67E8F9 100%);
  box-shadow: 0 0 40px -8px rgba(103,232,249,.5), 0 24px 48px -24px rgba(0,0,0,.7); }
.cta::before { content: ""; position: absolute; inset: 0; background: var(--holo); opacity: .18; mix-blend-mode: overlay; }

/* Glass chips / tiles get a subtle inner light */
.icon-btn { background: var(--glass); border-color: var(--glass-border); backdrop-filter: blur(10px); }
.chip2, .tag-status, .pill { backdrop-filter: blur(6px); }

/* Map glass frame + neon ring */
.mapbox { border: 1px solid var(--glass-border); box-shadow: 0 0 0 1px rgba(103,232,249,.10), 0 18px 40px -22px rgba(0,0,0,.7); }
.mpin.subj { box-shadow: 0 0 16px rgba(182,242,61,.8), 0 3px 9px rgba(0,0,0,.5); }
.mpin.comp { box-shadow: 0 0 12px rgba(245,179,61,.6), 0 3px 9px rgba(0,0,0,.5); }

/* Neon glow on chart canvases */
#trend { filter: drop-shadow(0 0 7px rgba(182,242,61,.45)); }
#donut { filter: drop-shadow(0 0 10px rgba(182,242,61,.30)); }
#adj   { filter: drop-shadow(0 0 6px rgba(182,242,61,.30)); }

/* Highlighted contact — holographic */
.contact.hl { background: linear-gradient(135deg, #B6F23D, #67E8F9); box-shadow: 0 0 26px -4px rgba(103,232,249,.6); position: relative; overflow: hidden; }
.contact.hl::before { content: ""; position: absolute; inset: 0; background: var(--holo); opacity: .16; mix-blend-mode: overlay; }

/* ============================================================
   LIVE EDITING — drawer, controls, comp editor (Tier 0/1)
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(5,6,8,.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 94vw; z-index: 100;
  background: linear-gradient(180deg, #14161A, #101216); border-left: 1px solid var(--glass-border);
  box-shadow: -30px 0 60px -20px rgba(0,0,0,.7); transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border-soft); }
.drawer__head h3 { font-size: 16px; font-weight: 700; }
.drawer__head .x { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--dim); cursor: pointer; }
.drawer__tabs { display: flex; gap: 6px; padding: 12px 18px 0; }
.drawer__tabs button { flex: 1; padding: 9px; border-radius: 9px 9px 0 0; border: 0; background: transparent; color: var(--dim);
  font-family: var(--font); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.drawer__tabs button.on { background: var(--glass); color: var(--lime); }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }
.tabpane { display: none; }
.tabpane.on { display: block; }

/* form rows */
.frow { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.frow label { font-size: 13px; color: var(--text); }
.frow label span { display: block; font-size: 11px; color: var(--faint); }
.inp { background: #0E1014; border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-family: var(--font); font-size: 13px; padding: 8px 10px; width: 100%; outline: none; }
.inp:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(182,242,61,.12); }
.inp.money { text-align: right; font-variant-numeric: tabular-nums; }
select.inp { appearance: none; cursor: pointer; }
.hint { font-size: 11.5px; color: var(--faint); margin: 6px 0 14px; line-height: 1.5; }
.subhead { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 18px 0 8px; }

/* slider rule rows */
.rule-row { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.rule-row .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rule-row .top .nm { font-size: 13px; }
.rule-row .top .val { font-size: 13px; font-weight: 700; color: var(--lime); font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; width: 100%; height: 4px; border-radius: 3px; background: #2A2E35; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--lime); cursor: pointer; box-shadow: 0 0 10px rgba(182,242,61,.5); }

/* comp editor cards */
.cedit { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px; padding: 13px; margin-bottom: 12px; }
.cedit.off { opacity: .45; }
.cedit__top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cedit__top img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.cedit__top .nm { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; }
.cedit__top .nm span { display: block; font-size: 11px; color: var(--faint); }
.cedit__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cedit__grid .f label { font-size: 10px; color: var(--faint); display: block; margin-bottom: 3px; }
.cedit__adj { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; align-items: center; font-size: 12px; }
.cedit__adj .net { color: var(--dim); }
.cedit__adj .net b { color: var(--gold); }
.cedit__adj .final { margin-left: auto; font-weight: 700; color: var(--lime); }
.cedit__del { color: var(--rose); cursor: pointer; font-size: 11px; background: none; border: 0; }

/* toggle switch */
.sw { position: relative; width: 38px; height: 22px; border-radius: 20px; background: #2A2E35; cursor: pointer; transition: background .15s; flex: none; }
.sw.on { background: var(--lime); }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw.on::after { left: 18px; }

/* comps table: match score + recency */
.match { display: flex; align-items: center; gap: 8px; }
.match .bar { width: 54px; height: 5px; border-radius: 3px; background: #2A2E35; overflow: hidden; }
.match .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--lime), #67E8F9); }
.match .pct { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; width: 26px; }
.rec { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; }
.rec.fresh { background: var(--lime); } .rec.ok { background: var(--gold); } .rec.stale { background: var(--rose); }
.flag-warn { color: var(--gold); font-size: 11px; margin-left: 6px; }

/* secondary button */
.btn-mini { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text); cursor: pointer; font-family: var(--font); }
.btn-mini:hover { border-color: #3a4049; }
.btn-mini svg { width: 14px; height: 14px; }
.btn-add { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; border-style: dashed; color: var(--lime); }
.drawer__foot { padding: 16px 22px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; }
.drawer__foot .btn { flex: 1; justify-content: center; }

/* ============================================================
   TIER 2 — pricing strategy + Zestimate rebuttal
   ============================================================ */
.pill.v-good { background: rgba(124,227,139,.14); color: var(--up); box-shadow: 0 0 12px rgba(124,227,139,.2); }
.pill.v-warn { background: rgba(245,179,61,.15); color: var(--amber); box-shadow: 0 0 12px rgba(245,179,61,.2); }
.pill.v-bad  { background: rgba(245,99,140,.15); color: var(--rose); box-shadow: 0 0 12px rgba(245,99,140,.2); }

.ps-price { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.ps-price b { font-family: var(--font); font-size: 23px; font-weight: 700; min-width: 118px; }
.ps-price input[type=range] { flex: 1; }
.ps-readouts { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 18px 0 14px; }
.ro { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px; padding: 13px 14px; }
.ro .k { font-size: 11px; color: var(--faint); margin-bottom: 7px; }
.ro .v { font-size: 21px; font-weight: 700; }
.ro .sub { font-size: 11px; color: var(--dim); margin-top: 3px; }
.ps-pool .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-bottom: 7px; }
.ps-pool .top span:last-child { font-weight: 700; color: var(--text); }
.ps-pool .bar { height: 8px; border-radius: 5px; background: #2A2E35; overflow: hidden; }
.ps-pool .bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--lime), var(--amber)); transition: width .2s; }
.scen { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; }
.sc { border: 1px solid var(--border-soft); border-radius: 12px; padding: 13px; }
.sc .lab { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.sc .p { font-size: 17px; font-weight: 700; }
.sc .d { color: var(--dim); font-size: 11.5px; margin-top: 5px; }
.sc.on { border-color: var(--lime); box-shadow: 0 0 18px -5px rgba(182,242,61,.45); background: var(--lime-soft); }

.zest__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--border-soft); }
.zlab { font-size: 13px; }
.zlab span { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.zest__row .inp { width: 132px; }
.zest__vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.zb { border-radius: 13px; padding: 16px; border: 1px solid var(--border-soft); }
.zb .k { font-size: 11px; color: var(--faint); margin-bottom: 9px; }
.zb .v { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.zb .sub { font-size: 11px; color: var(--dim); margin-top: 6px; }
.zb-z { background: rgba(245,99,140,.07); border-color: rgba(245,99,140,.26); }
.zb-z .v { color: var(--rose); }
.zb-o { background: var(--lime-soft); border-color: rgba(182,242,61,.3); }
.zb-o .v { color: var(--lime); }
.zest__note { font-size: 12.5px; color: var(--dim); line-height: 1.6; }
.zest__note b { color: var(--text); }

/* ============================================================
   TIER 3 — net sheet + buyer financing + appraisal gap
   ============================================================ */
.bignum { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.bignum.lime-num { color: var(--lime); }
.bignum small { font-size: 14px; color: var(--dim); font-weight: 600; }

.break { margin: 14px 0 4px; }
.break .r { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--border-soft); }
.break .r .k { color: var(--dim); }
.break .r .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.break .r .v.neg { color: var(--rose); }
.break .r.tot { border-bottom: 0; border-top: 1px solid var(--line-2, #2A2E35); margin-top: 4px; padding-top: 11px; }
.break .r.tot .k { color: var(--text); font-weight: 600; }
.break .r.tot .v { color: var(--lime); font-size: 16px; font-weight: 800; }

.miniform { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 10px; }
.miniform .f label { font-size: 10.5px; color: var(--faint); display: block; margin-bottom: 4px; }
.miniform .inp { padding: 7px 10px; font-size: 12.5px; }
.tip { cursor: help; color: var(--faint); border-bottom: 1px dotted var(--faint); }

.fin-break { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 14px 0 4px; }
.fin-break .b { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 11px; }
.fin-break .b .k { font-size: 10px; color: var(--faint); }
.fin-break .b .v { font-size: 14px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

.gapbox { margin-top: 14px; border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.gapbox.warn { border-color: rgba(245,179,61,.4); background: rgba(245,179,61,.07); }
.gapbox.ok { border-color: rgba(124,227,139,.35); background: rgba(124,227,139,.06); }
.gapbox .k { font-size: 11px; color: var(--faint); }
.gapbox .v { font-size: 18px; font-weight: 800; margin-top: 4px; }
.gapbox.warn .v { color: var(--amber); }
.gapbox.ok .v { color: var(--up); }
.gapbox .note { font-size: 11.5px; color: var(--dim); margin-top: 8px; line-height: 1.55; }
.gapbox .note b { color: var(--text); }
.pill-lime[href]:hover { filter: brightness(1.1); }

/* ---------- toast ---------- */
.toast { position:fixed; bottom:26px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--lime); color:#11140A; font-weight:700; font-size:13px; padding:11px 20px; border-radius:11px;
  box-shadow:0 8px 30px -6px rgba(182,242,61,.5); opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:200; }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
