/* PLO HOM — Dark theme, CSS Grid floor plans, transitions */

:root {
  --bg: #0a0e17;
  --surface: #141a26;
  --surface-hover: #1c2435;
  --border: #1e2a3a;
  --text: #e8edf5;
  --text-muted: #7a8ba8;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --urgent: #ef4444;
  --urgent-glow: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --success: #22c55e;
  --gold: #d4a843;
  --radius: 8px;
  --expand-ms: 350ms;
  --easing: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────── */

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

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
#header-left, #header-center, #header-right { flex: 1; }
#header-left { display: flex; align-items: center; gap: 10px; }
#header-center { display: flex; align-items: center; justify-content: center; gap: 12px; position: relative; }
#header-right { text-align: right; }
#user-info { text-align: left; }
#logo { font-size: 18px; font-weight: 700; letter-spacing: 1px; color: var(--text); text-align: center; }

/* Back button */
.btn-back {
  background: var(--accent-glow); border: 2px solid var(--accent); border-radius: var(--radius);
  color: var(--accent); padding: 8px 20px; font-size: 15px; font-weight: 700;
  letter-spacing: 1px; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn-back:hover { background: var(--accent); color: #fff; }

/* AI button — larger, prominent, centered */
.btn-ai-main {
  padding: 10px 24px; border: 2px solid var(--accent); border-radius: var(--radius);
  background: var(--accent-glow); color: var(--accent); font-size: 15px;
  font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.btn-ai-main:hover { background: var(--accent); color: white; }

/* Header dropdown — anchored from center */
.header-dropdown {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 6px; z-index: 100;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); min-width: 300px; overflow: hidden;
}
.dd-actions { border-top: 1px solid var(--border); }
.dd-actions button {
  display: block; width: 100%; padding: 10px 14px; border: none;
  background: none; color: var(--text); font-size: 13px; text-align: left;
  cursor: pointer;
}
.dd-actions button:hover { background: var(--surface-hover); }

main { flex: 1; overflow: auto; padding: 16px; }

.screen { display: block; }
.screen.hidden { display: none !important; }

/* ── Auth ────────────────────────────────────────────────── */

#auth-screen {
  display: flex; justify-content: center; align-items: center;
  height: 100%; min-height: 400px;
}

.auth-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; text-align: center;
  max-width: 360px; width: 100%;
}

.auth-box h2 { font-size: 24px; margin-bottom: 8px; }
.auth-box p { color: var(--text-muted); margin-bottom: 24px; }

#auth-form input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-size: 14px; margin-bottom: 12px; outline: none;
}
#auth-form input:focus { border-color: var(--accent); }

#auth-form button {
  width: 100%; padding: 10px; border: none; border-radius: var(--radius);
  background: var(--accent); color: white; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
#auth-form button:hover { opacity: 0.9; }

.hidden { display: none; }

.auth-link {
  display: inline-block; margin-top: 8px; font-size: 13px;
  color: var(--text-muted); text-decoration: none; cursor: pointer;
}
.auth-link:hover { color: var(--accent); }

#reset-form input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-size: 14px; margin-bottom: 12px; outline: none;
}
#reset-form input:focus { border-color: var(--accent); }
#reset-form button {
  width: 100%; padding: 10px; border: none; border-radius: var(--radius);
  background: var(--accent); color: white; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
#reset-form button:hover { opacity: 0.9; }

.msg { margin-top: 12px; font-size: 13px; }
.msg.error { color: var(--urgent); }
.msg.success { color: var(--success); }

/* ── Dashboard Grid ──────────────────────────────────────── */

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ── Path to 1st Dollar Panel ─────────────────────────── */
.first-dollar-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-self: start;
}
.fd-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.fd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  font-size: 16px;
  font-weight: 700;
}
.fd-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text);
}
.fd-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.fd-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.fd-step:last-child { border-bottom: none; }
.fd-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.fd-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.fd-done .fd-num {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}
.fd-done .fd-text {
  color: var(--text-muted);
  text-decoration: line-through;
}
.fd-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.5px;
}

.fd-research-btn {
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 6px;
  color: #4caf50;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.fd-research-btn:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
}

/* ── Turnover Flow (cleaner-facing, mobile-first) ───── */
.to-wrapper { max-width: 480px; margin: 0 auto; padding: 16px; }
.to-header { text-align: center; margin-bottom: 20px; }
.to-property { font-size: 18px; font-weight: 700; color: var(--text); }
.to-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.to-checkin { font-size: 12px; color: var(--accent); margin-top: 6px; }
.to-progress { width: 100%; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.to-progress-bar { height: 100%; background: #22c55e; border-radius: 3px; transition: width 0.3s; }
.to-progress-text { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 4px; }
.to-name-prompt { text-align: center; margin: 24px 0; }
.to-name-prompt label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.to-name-prompt input {
  width: 100%; padding: 10px 14px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); box-sizing: border-box; margin-bottom: 10px;
}
.to-name-prompt button {
  width: 100%; padding: 12px; font-size: 15px; font-weight: 600;
  background: var(--accent); border: none; border-radius: var(--radius);
  color: white; cursor: pointer;
}
.to-area { margin-bottom: 20px; }
.to-area-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.to-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.to-item-status {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.06);
  font-size: 14px; color: var(--text-muted);
}
.to-item-done .to-item-status { background: rgba(34,197,94,0.2); color: #22c55e; }
.to-item-label { flex: 1; font-size: 13px; color: var(--text); line-height: 1.4; }
.to-item-done .to-item-label { color: var(--text-muted); }
.to-snap-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3);
  border-radius: 8px; cursor: pointer; font-size: 18px;
}
.to-snap-btn:active { background: rgba(59,130,246,0.3); }
.to-uploading { font-size: 10px; color: var(--text-muted); }
.to-submit-section { text-align: center; margin: 24px 0; }
.to-submit-btn {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700;
  background: rgba(34,197,94,0.2); border: 2px solid #22c55e;
  border-radius: var(--radius); color: #22c55e; cursor: pointer;
}
.to-error, .to-done { text-align: center; padding: 60px 20px; }
.to-error h2 { color: #ef4444; }
.to-done h2 { color: #22c55e; }
.to-rejected h2 { color: #f59e0b; }

.btn-add-property {
  display: block; margin: 16px auto 0; padding: 8px 20px;
  background: none; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.btn-add-property:hover { border-color: var(--accent); color: var(--accent); }

.property-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: all var(--expand-ms) var(--easing);
  overflow: hidden;
}
.property-card:hover { border-color: var(--accent); background: var(--surface-hover); }

/* ── Card Satellite Thumbnail ──────────────────────────────── */

.card-satellite {
  height: 200px; border-radius: var(--radius) var(--radius) 0 0;
  background-size: cover; background-position: center;
  margin: -16px -16px 12px -16px;
}

/* ── Expanded Layout ──────────────────────────────────────── */

.expanded-layout {
  display: flex; gap: 16px; min-height: calc(100vh - 100px);
}
.exp-sidebar {
  width: 180px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px;
}
.exp-sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; overflow: hidden;
  transition: border-color 0.15s;
}
.exp-sidebar-card:hover { border-color: var(--accent); }
.exp-sat-thumb {
  height: 90px; background-size: cover; background-position: center;
}
.exp-sidebar-name {
  display: block; padding: 8px 10px; font-size: 13px; font-weight: 500;
}
.exp-main {
  flex: 1; overflow-y: auto;
}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-name { font-size: 15px; font-weight: 600; }
.card-lifecycle { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

.card-floorplan { margin-bottom: 12px; min-height: 100px; }

.card-stats { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.card-stats .hint-click { margin-left: auto; text-align: right; }
.stat { color: var(--text-muted); }
.stat.urgent { color: var(--urgent); font-weight: 600; }
.stat.attention { color: var(--warning); }
.stat.clear { color: var(--success); }
.stat.burn { color: var(--gold); }

#summary-bar { margin-top: 16px; }
.summary { color: var(--text-muted); font-size: 13px; text-align: center; padding: 12px; }

/* ── Property View ───────────────────────────────────────── */

#property-screen { display: flex; gap: 16px; height: 100%; }

#property-sidebar {
  width: 200px; flex-shrink: 0; overflow-y: auto;
  border-right: 1px solid var(--border); padding-right: 12px;
}

.back-btn { width: 100%; text-align: left; margin-bottom: 12px; }

.sidebar-list { display: flex; flex-direction: column; gap: 8px; }

.sidebar-card {
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-size: 13px;
  transition: border-color 0.15s;
}
.sidebar-card:hover { border-color: var(--accent); }
.sidebar-name { font-weight: 500; }

#property-main { flex: 1; overflow-y: auto; }

#floorplan-container { position: relative; margin-bottom: 16px; }

/* ── Satellite View ─────────────────────────────────────── */

.satellite-view {
  position: relative; width: 100%; height: 400px;
  overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  margin-bottom: 12px;
}
.sat-tile {
  position: absolute;
  image-rendering: auto; pointer-events: none;
}
.sat-toolbar {
  display: flex; gap: 8px; padding: 8px 0; flex-wrap: wrap;
}
.btn-sat-tool {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 8px 16px; border-radius: var(--radius);
  cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s;
}
.btn-sat-tool:hover { border-color: var(--accent); color: var(--accent); }
.btn-sat-tool.active { background: var(--accent); color: white; border-color: var(--accent); }
.btn-pin-filter { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.btn-place-landscape { margin-left: auto; }
.sat-info-pane {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline;
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin: 8px 0 12px; font-size: 13px; color: var(--text-muted);
}
.sat-info-pane strong { color: var(--text); font-size: 14px; }
.satellite-view { cursor: grab; }
.satellite-view:active { cursor: grabbing; }
.satellite-view.placing-pin { cursor: crosshair; }
.satellite-view.placing-pin:active { cursor: crosshair; }
.sat-footprint { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none; }
.sat-pid { font-size: 11px; opacity: 0.6; }

/* ── AI Property Summary Bar ─────────────────────────────── */
.prop-summary-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin: 0 0 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; color: var(--text-muted);
  line-height: 1.4; min-height: 36px;
}
.prop-summary-text { flex: 1; }
.prop-summary-refresh {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px;
  opacity: 0.5; transition: opacity 0.2s;
}
.prop-summary-refresh:hover { opacity: 1; background: var(--hover); }
.card-summary { padding: 6px 10px 2px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.portfolio-summary-bar { margin-bottom: 12px; font-size: 13px; }

/* ── Floor Plan (Blueprint) ──────────────────────────────── */

.floorplan {
  display: grid;
  gap: 0;
  border: 3px solid #5a7a9a;
  border-radius: 4px;
  overflow: hidden;
  background: #5a7a9a;
}

.floorplan.mini { height: 140px; }
.floorplan.full { min-height: 320px; position: relative; }

.room {
  position: relative; padding: 8px; cursor: default;
  background: #0f1e2e;
  border: 1.5px solid #5a7a9a;
  transition: all 0.15s ease;
  overflow: hidden;
}
.room:hover { background: #162a3e; }
.room.focused { background: #162a3e; box-shadow: inset 0 0 0 2px var(--accent); }
.room.has-urgent { box-shadow: inset 0 0 0 2px var(--urgent); }
.room.has-items::after {
  content: ''; position: absolute; bottom: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

.room-label {
  font-size: 10px; color: #7a9ab8;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500;
}
.floorplan.full .room-label { font-size: 11px; }

.room-count {
  position: absolute; top: 4px; right: 6px;
  font-size: 10px; color: var(--accent); font-weight: 700;
  background: rgba(59, 130, 246, 0.2); border-radius: 50%;
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
}

/* ── Reno badges on rooms ────────────────────────────────── */
.room.has-reno { border-color: var(--warning); }
.room-reno-bar {
  display: flex; flex-wrap: wrap; gap: 3px;
  margin-top: 4px;
}
.room-reno-badge {
  font-size: 9px; font-weight: 600; padding: 1px 5px;
  border-radius: 4px; white-space: nowrap;
  line-height: 1.4;
}

/* ── Pins ────────────────────────────────────────────────── */

.pin {
  position: absolute; width: 24px; height: 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%); cursor: pointer; z-index: 2;
  transition: transform 0.15s; font-size: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.pin:hover { transform: translate(-50%, -50%) scale(1.2); z-index: 10; }
.pin-urgent { animation: pulse-urgent 2s infinite; }

.pin-icon { line-height: 1; }

.pin-cluster {
  position: absolute; width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%); cursor: pointer; z-index: 3;
  font-size: 12px; font-weight: 700; color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}
.pin-cluster:hover { transform: translate(-50%, -50%) scale(1.15); }
.pin-cluster.pin-urgent { background: var(--urgent); }

.cluster-count { font-size: 12px; }

@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 0 var(--urgent-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* ── Pin Popover ─────────────────────────────────────────── */

.pin-popover {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; min-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.pop-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.pop-type { font-size: 11px; text-transform: uppercase; font-weight: 600; }
.pop-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.pop-status.urgent { background: var(--urgent-glow); color: var(--urgent); }
.pop-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.pop-status.active { background: var(--accent-glow); color: var(--accent); }
.pop-title { font-weight: 600; margin-bottom: 4px; }
.pop-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.pop-amount { font-weight: 600; color: var(--gold); }
.pop-vendor { font-size: 12px; color: var(--text-muted); }
.pop-open-btn {
  margin-top: 8px; width: 100%; padding: 6px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); border-radius: var(--radius);
  cursor: pointer; font-size: 13px; font-weight: 600;
}
.pop-open-btn:hover { background: var(--accent); color: #fff; }

.pop-cluster-item { display: flex; gap: 8px; padding: 6px 4px; font-size: 13px; border-radius: 4px; }
.pop-cluster-item:hover { background: var(--surface-hover); }

/* ── Property Sections ───────────────────────────────────── */

.prop-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.prop-section h3 { font-size: 14px; margin-bottom: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.item-list { display: flex; flex-direction: column; gap: 6px; }

.item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.doc-entry {
  border-radius: 8px; padding: 2px 0; transition: background 0.15s;
}
.doc-entry:hover { background: rgba(59, 130, 246, 0.08); }
.doc-summary {
  padding: 2px 10px 8px; font-size: 12px; line-height: 1.5;
  color: var(--text-muted); opacity: 0.85;
}
.item-row.urgent { background: var(--urgent-glow); }
.item-row.attention { background: rgba(245, 158, 11, 0.1); }
.item-type {
  font-size: 11px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px;
  color: var(--text-muted); flex-shrink: 0;
}
.item-status { font-size: 12px; font-weight: 500; flex-shrink: 0; color: var(--text-muted); }

/* ── Item Cards ────────────────────────────────────────────── */

.item-card {
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 8px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.item-card:hover { border-color: var(--accent); background: rgba(59, 130, 246, 0.05); }
.item-card.urgent { border-left: 3px solid var(--urgent); background: var(--urgent-glow); }
.item-card.resolved { opacity: 0.6; }

.item-card-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.item-type-badge {
  font-size: 10px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 4px; color: var(--accent);
  background: var(--accent-glow); flex-shrink: 0;
}
.item-title { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; }
.item-amount { font-size: 14px; color: var(--gold); font-weight: 600; flex-shrink: 0; }
.item-age { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

.item-desc {
  font-size: 13px; color: var(--text-muted); margin: 6px 0 0;
  line-height: 1.4;
}

.item-card-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap;
}
.item-detail {
  font-size: 12px; color: var(--text-muted);
  padding: 2px 6px; background: rgba(255,255,255,0.04); border-radius: 4px;
}
.item-file-link {
  font-size: 12px; color: var(--accent); text-decoration: none;
}
.item-file-link:hover { text-decoration: underline; }

/* Photo thumbnail on item cards */
.item-thumb {
  width: 40px; height: 40px; min-width: 40px; border-radius: 6px;
  background-size: cover; background-position: center;
  background-color: var(--surface); margin-right: 8px;
}

/* Missing receipt badge */
.missing-receipt-badge {
  font-size: 11px; color: var(--warning); background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}

/* Pending/unprocessed badge */
.pending-badge {
  font-size: 11px; color: var(--text-muted); background: rgba(122, 139, 168, 0.12);
  padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}

/* Contractor match badge in confirm card */
.contractor-match-badge {
  font-size: 12px; color: var(--success); background: rgba(34, 197, 94, 0.12);
  padding: 4px 10px; border-radius: 6px; margin-bottom: 8px;
}

/* Toast notification */
.toast-msg {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 10px 20px; border-radius: var(--radius); font-size: 13px;
  z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toast-in 0.3s ease;
}
.toast-msg.fade-out { opacity: 0; transition: opacity 0.4s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* Enrichment progress */
.enrichment-progress {
  font-size: 12px; color: var(--text-muted); margin-top: 6px;
}

/* Enrichment admin button */
.btn-enrich {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--accent-glow); border: 1px solid var(--accent);
  border-radius: var(--radius); color: var(--accent); font-size: 13px; cursor: pointer;
}
.btn-enrich:hover { background: var(--accent); color: #fff; }
.enrich-count {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}

.btn-resolve {
  margin-left: auto; padding: 4px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: none; color: var(--success);
  font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.btn-resolve:hover { background: rgba(34, 197, 94, 0.1); border-color: var(--success); }
.btn-resolve:disabled { opacity: 0.5; cursor: not-allowed; }

.resolved-list.hidden { display: none; }

/* Delete button inside edit modals — small, right-aligned, understated */
.btn-delete-item {
  display: block; margin-left: auto; padding: 3px 10px; border: none;
  border-radius: var(--radius); background: none; color: var(--text-muted);
  font-size: 11px; cursor: pointer; transition: color 0.15s;
}
.btn-delete-item:hover { color: var(--urgent); }
.btn-delete-item:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Decisions ───────────────────────────────────────────── */

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-header h3 { margin: 0; }

.decision-card {
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.decision-card.resolved { opacity: 0.6; }
.decision-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.decision-title { font-weight: 600; font-size: 14px; }
.decision-resolved {
  font-size: 11px; color: var(--success); border: 1px solid var(--success);
  padding: 1px 6px; border-radius: 4px;
}
.decision-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; line-height: 1.4; }

.decision-options { display: flex; flex-direction: column; gap: 6px; }
.decision-option {
  position: relative; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s;
}
.decision-option:hover { border-color: var(--accent); }
.decision-option.selected { border-color: var(--accent); background: var(--accent-glow); }
.option-bar {
  position: absolute; top: 0; left: 0; height: 100%;
  background: rgba(59, 130, 246, 0.1); transition: width 0.3s;
}
.option-label { position: relative; font-weight: 500; font-size: 13px; }
.option-count { position: relative; float: right; font-size: 12px; color: var(--text-muted); }
.option-voters { display: block; position: relative; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.decision-your-vote {
  margin-top: 8px; font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 8px;
}

.decision-form-inline {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}

.stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }

.activity-list { display: flex; flex-direction: column; gap: 4px; }
.activity-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.activity-action { text-transform: capitalize; }

/* ── Room Detail ─────────────────────────────────────────── */

.room-detail { padding: 16px 0; }
.room-detail h3 { font-size: 16px; margin-bottom: 16px; }
.room-detail h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; }

.room-items { margin-bottom: 16px; }
.room-protocols { margin-bottom: 16px; }
.room-photos { margin-bottom: 16px; }

.room-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-bottom: 1px solid var(--border);
}
.room-item-row.urgent { background: var(--urgent-glow); }

.item-icon { font-size: 16px; width: 24px; text-align: center; }
.item-info { flex: 1; }
.item-info .item-title { font-weight: 500; }
.item-info .item-desc { font-size: 12px; color: var(--text-muted); display: block; }
.item-meta { text-align: right; }

.protocol-card {
  display: flex; gap: 10px; padding: 12px;
  background: var(--urgent-glow); border: 1px solid var(--urgent);
  border-radius: var(--radius); margin-bottom: 8px;
}
.protocol-icon { font-size: 20px; }
.protocol-card p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.photo-thumb {
  aspect-ratio: 1; background-size: cover; background-position: center;
  border-radius: 6px; position: relative; overflow: hidden;
}
.photo-caption, .photo-date {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, 0.7); font-size: 10px; padding: 2px 4px;
}
.photo-date { bottom: auto; top: 0; }

/* ── Room Deselect Bar ───────────────────────────────────── */

.room-deselect-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius); margin-top: 8px;
}
.room-deselect-bar span { font-weight: 600; color: var(--accent); font-size: 14px; }
.btn-deselect {
  padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: none; color: var(--text-muted); font-size: 12px; cursor: pointer;
}
.btn-deselect:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

/* ── Overlay Toggle ──────────────────────────────────────── */

.overlay-toggle {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  font-size: 12px;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn-ghost {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 6px 12px; border-radius: var(--radius); cursor: pointer;
  font-size: 13px; transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.user-menu { position: relative; }
.user-name { font-size: 13px; color: var(--text-muted); margin-right: 12px; }
.user-trigger { cursor: pointer; transition: color 0.15s; display: flex; flex-direction: column; align-items: flex-start; }
.user-trigger:hover { color: var(--accent); }
.user-hint { display: block; font-size: 10px; color: var(--text-muted); opacity: 0.6; letter-spacing: 0.3px; }
.user-dropdown {
  position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 100;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); min-width: 180px; overflow: hidden;
}
.user-dropdown-info {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.user-dropdown-email { font-size: 12px; color: var(--text-muted); }
.user-dropdown-role { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }
.user-dropdown-item {
  display: block; width: 100%; padding: 10px 14px; border: none;
  background: none; color: var(--text); font-size: 13px; text-align: left;
  cursor: pointer;
}
.user-dropdown-item:hover { background: var(--surface-hover); }

/* ── Section Actions ─────────────────────────────────────── */

.section-actions {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}

/* ── Action Buttons ─────────────────────────────────────── */

.btn-action {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.btn-action:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.btn-primary {
  padding: 10px 16px; border: none; border-radius: var(--radius);
  background: var(--accent); color: white; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Form Controls ──────────────────────────────────────── */

.form-label {
  display: block; font-size: 12px; color: var(--text-muted);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.3px;
}
.form-input {
  display: block; width: 100%; padding: 8px 10px; margin-top: 4px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-size: 14px;
  outline: none; font-family: inherit;
}
.form-input:focus { border-color: var(--accent); }
select.form-input { appearance: auto; }
textarea.form-input { resize: vertical; min-height: 100px; max-height: 300px; overflow-y: auto; }

/* ── Expandable Detail Fields ────────────────────────────── */

.expandable-fields { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.detail-toggle { flex-shrink: 0; }
.detail-toggle-btn {
  padding: 4px 10px; border: 1px dashed var(--border); border-radius: var(--radius);
  background: none; color: var(--text-muted); font-size: 12px; cursor: pointer;
}
.detail-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.detail-toggle-content { display: none; margin-top: 4px; }
.detail-toggle.expanded { width: 100%; }
.detail-toggle.expanded .detail-toggle-btn { display: none; }
.detail-toggle.expanded .detail-toggle-content { display: block; }

/* ── Dropdown Chat (inline in header dropdown) ──────────── */

.dd-chat { min-width: 280px; }
.dd-chat-hint {
  padding: 8px 14px; font-size: 12px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.dd-chat-messages {
  overflow-y: auto; padding: 8px 12px;
  min-height: 40px; max-height: 180px;
}
.chat-msg {
  padding: 6px 10px; border-radius: 6px; margin-bottom: 6px;
  font-size: 13px; max-width: 90%; word-wrap: break-word;
}
.chat-user { background: var(--accent-glow); color: var(--text); margin-left: auto; }
.chat-assistant { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.chat-error { background: var(--urgent-glow); color: var(--urgent); font-size: 12px; }
.dd-chat-form {
  display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border);
}
.dd-chat-form input {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-size: 13px; outline: none;
}
.dd-chat-form input:focus { border-color: var(--accent); }
.dd-chat-form button {
  padding: 8px 14px; border: none; border-radius: var(--radius);
  background: var(--accent); color: white; font-size: 13px; cursor: pointer;
}

/* ── Confirm Card (Upload) ──────────────────────────────── */

.confirm-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; max-width: 360px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.confirm-card h4 { margin-bottom: 12px; }
.confirm-fields label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); }
.confirm-fields strong { color: var(--text); }
.confirm-actions { display: flex; gap: 8px; margin-top: 16px; }

/* (add-property card removed — replaced with small button) */

/* ── Modal Overlay ─────────────────────────────────────── */

.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; max-width: 400px;
  width: 90%; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.modal-box h3 { margin-bottom: 8px; }

/* ── Document Viewer Overlay ─────────────────────────── */
.doc-viewer-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  display: flex; flex-direction: column;
}
.doc-viewer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.doc-viewer-title {
  font-weight: 600; font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.doc-viewer-actions { display: flex; gap: 8px; flex-shrink: 0; }
.doc-viewer-btn {
  background: rgba(255,255,255,0.1); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 6px 12px;
  cursor: pointer; font-size: 16px; text-decoration: none;
  display: flex; align-items: center; justify-content: center;
}
.doc-viewer-btn:hover { background: rgba(255,255,255,0.2); }
/* ── Document Options Popover ────────────────────────── */
.doc-options-popover {
  position: fixed; z-index: 150; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,0.6);
  padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
.doc-options-title {
  padding: 10px 12px 8px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 2px;
}
.doc-opt-btn {
  background: rgba(255,255,255,0.05); border: none; color: var(--text);
  padding: 12px 14px; text-align: left; font-size: 15px; font-weight: 500;
  cursor: pointer; font-family: inherit; border-radius: 6px;
  display: flex; align-items: center; gap: 10px;
}
.doc-opt-btn:hover { background: rgba(59, 130, 246, 0.18); }
.doc-opt-btn:active { background: rgba(59, 130, 246, 0.3); }
.doc-opt-delete { color: #ef4444; }
.doc-opt-delete:hover { background: rgba(239, 68, 68, 0.18); }
.doc-opt-delete:active { background: rgba(239, 68, 68, 0.3); }

/* ── Archive Section ─────────────────────────────────── */
.archive-section { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.archive-toggle {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: inherit; padding: 6px 10px;
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
}
.archive-toggle::before { content: '▸'; transition: transform 0.2s; }
.archive-toggle.open::before { transform: rotate(90deg); }
.archive-toggle:hover { color: var(--text); }
.archive-list { padding-left: 4px; }
.archive-group { margin-top: 8px; }
.archive-group-label {
  font-size: 11px; text-transform: uppercase; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.5px; padding: 4px 10px;
  opacity: 0.7;
}
.archive-group .doc-entry { opacity: 0.7; }
.archive-group .doc-entry:hover { opacity: 1; }
.doc-viewer-frame {
  flex: 1; width: 100%; border: none; background: #fff;
}
.doc-viewer-img {
  flex: 1; object-fit: contain; max-width: 100%; max-height: calc(100vh - 52px);
  margin: auto; display: block;
}
.doc-viewer-fallback {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; color: var(--text-muted);
}
.item-file-link {
  background: none; border: 1px solid var(--accent, #3b82f6); color: var(--accent, #3b82f6);
  border-radius: 4px; padding: 2px 8px; font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.item-file-link:hover { background: rgba(59, 130, 246, 0.15); }

/* ── Property Confirm Card ────────────────────────────── */

.confirm-field-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.confirm-field-row:last-child { border-bottom: none; }
.confirm-label { color: var(--text-muted); }
.confirm-value { font-weight: 500; text-align: right; max-width: 60%; word-break: break-word; }

/* ── Photo Timeline ─────────────────────────────────────── */

.photo-timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-entry { display: flex; gap: 10px; align-items: center; }
.timeline-entry .photo-thumb { width: 48px; height: 48px; border-radius: 6px; flex-shrink: 0; background-size: cover; background-position: center; }
.timeline-info { font-size: 13px; }

/* ── Vote Actions ───────────────────────────────────────── */

.vote-summary { display: flex; gap: 10px; font-size: 12px; margin-top: 4px; }
.vote-actions { display: flex; gap: 6px; }

/* ── Checklist Panel ─────────────────────────────────────── */

.checklist-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px;
}
.checklist-title {
  font-size: 13px; color: var(--warning); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 8px; font-weight: 600;
}
.checklist-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid var(--border); border-radius: 4px;
  position: relative;
}
.checklist-row:last-child { border-bottom: none; }
.checklist-row:hover { background: rgba(245, 158, 11, 0.08); }
.checklist-row:active { background: rgba(245, 158, 11, 0.15); }
.checklist-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.checklist-label { flex: 1; font-size: 13px; color: var(--text); }
.checklist-action {
  font-size: 12px; color: var(--accent); font-weight: 500; flex-shrink: 0;
}

/* ── Landscaping Pins (3D) ──────────────────────────────── */

.landscaping-pin {
  position: absolute; z-index: 3; transform: translate(-50%, -100%);
  pointer-events: auto; cursor: pointer;
}
.pin-3d {
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.pin-head {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--urgent); border: 2px solid white;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.6);
  position: relative; z-index: 2;
}
.pin-stem {
  width: 2px; height: 14px; background: var(--urgent);
  position: relative; z-index: 1;
}
.pin-shadow {
  width: 10px; height: 4px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(1px);
}

/* Landscaping popover */
.ls-popover {
  position: absolute; transform: translate(-50%, -100%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; min-width: 200px; max-width: 280px;
  z-index: 20; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.ls-popover .pop-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.ls-popover .pop-type { font-size: 11px; text-transform: uppercase; font-weight: 600; color: var(--success); }
.ls-popover .pop-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.ls-popover .pop-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.ls-popover .pop-status.active { background: var(--accent-glow); color: var(--accent); }
.ls-popover .pop-status.completed { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.ls-popover .pop-title { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.ls-popover .pop-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.btn-ls-status {
  display: block; width: 100%; padding: 6px; border: 1px solid var(--accent);
  border-radius: var(--radius); background: var(--accent-glow); color: var(--accent);
  font-size: 12px; font-weight: 600; cursor: pointer; margin-bottom: 4px; transition: all 0.15s;
}
.btn-ls-status:hover { background: var(--accent); color: white; }
.btn-ls-status:disabled { opacity: 0.5; cursor: not-allowed; }
.ls-pop-actions { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.btn-ls-undo {
  display: block; width: 100%; padding: 5px; border: 1px solid var(--border);
  border-radius: var(--radius); background: none; color: var(--text-muted);
  font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.btn-ls-undo:hover { border-color: var(--warning); color: var(--warning); }
.btn-ls-undo:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ls-edit {
  display: block; width: 100%; padding: 5px; border: 1px solid var(--border);
  border-radius: var(--radius); background: none; color: var(--accent);
  font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.btn-ls-edit:hover { border-color: var(--accent); background: var(--accent-glow); }
.btn-ls-close {
  display: block; width: 100%; padding: 4px; border: none;
  background: none; color: var(--text-muted); font-size: 11px; cursor: pointer;
}
.btn-ls-close:hover { color: var(--text); }

/* Pin placement mode */
.satellite-view.placing-pin { cursor: crosshair; }
.btn-place-pin {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: rgba(10, 14, 23, 0.85);
  color: var(--text-muted); font-size: 11px; cursor: pointer;
  margin-top: 4px; transition: all 0.15s;
}
.btn-place-pin:hover { border-color: var(--success); color: var(--success); }
.btn-place-pin.active {
  border-color: var(--success); color: var(--success);
  background: rgba(34, 197, 94, 0.15);
}

/* ── Member Panel (slide-over) ───────────────────────────── */

.member-panel {
  position: fixed; top: 0; left: 0; bottom: 0; width: 70%;
  max-width: 480px; background: var(--bg); border-right: 1px solid var(--border);
  z-index: 50; transform: translateX(-100%); transition: transform 300ms var(--easing);
  display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}
.member-panel.open { transform: translateX(0); }

.mp-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.mp-name { font-size: 16px; font-weight: 600; }
.mp-role { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.mp-close {
  background: none; border: none; color: var(--text-muted); font-size: 24px;
  cursor: pointer; padding: 4px 8px; line-height: 1;
}
.mp-close:hover { color: var(--text); }

.mp-content { flex: 1; overflow-y: auto; padding: 16px 20px; }

.mp-section { margin-bottom: 20px; }
.mp-section h4 {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px;
}

.mp-note-form { margin-bottom: 12px; }
.mp-note-input { min-height: 50px; max-height: 120px; }

.mp-notes-list { display: flex; flex-direction: column; gap: 8px; }
.mp-note {
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mp-note-text { font-size: 13px; line-height: 1.5; }
.mp-note-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.mp-empty { font-size: 13px; color: var(--text-muted); }
.mp-loading { font-size: 13px; color: var(--text-muted); padding: 20px 0; }

.mp-activity-list { display: flex; flex-direction: column; gap: 4px; }
.mp-activity-row {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted);
  padding: 4px 0; border-bottom: 1px solid var(--border);
}
.mp-activity-row:last-child { border-bottom: none; }
.mp-activity-action { text-transform: capitalize; }

.mp-votes-list { display: flex; flex-direction: column; gap: 6px; }
.mp-vote-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.mp-vote-row:last-child { border-bottom: none; }
.mp-vote-item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-vote-choice {
  font-weight: 600; color: var(--accent); flex-shrink: 0;
  padding: 2px 8px; background: var(--accent-glow); border-radius: 4px; font-size: 12px;
}
.mp-vote-date { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* ── Sidebar: Family Members ─────────────────────────────── */

.exp-sidebar-divider {
  height: 1px; background: var(--border); margin: 8px 0 4px;
}
.exp-sidebar-label {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 4px 0;
}
.exp-sidebar-member {
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.exp-sidebar-member:hover { border-color: var(--accent); background: var(--accent-glow); }

/* ── Decision Group Labels ───────────────────────────────── */

.decision-group-label {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 8px 0 4px; margin-top: 4px;
  border-top: 1px solid var(--border);
}
.decision-group-label:first-child { border-top: none; margin-top: 0; }

/* ── Dashboard Sidebar Layout ──────────────────────────── */

.dash-layout {
  display: flex; gap: 16px; min-height: calc(100vh - 100px);
}
.dash-sidebar {
  width: 180px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px;
}
.dash-main-col {
  flex: 1; min-width: 0; overflow: hidden;
}
.dash-main-col .home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.family-avatar-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: white; font-size: 11px; font-weight: 700;
  flex-shrink: 0; vertical-align: middle; margin-right: 4px;
}

/* ── Network Map ───────────────────────────────────────── */

#network-map-section { margin-top: 16px; overflow: hidden; }

.net-viewport {
  overflow: hidden; position: relative;
  min-height: 200px;
}
/* Preview mode: static, no interaction trapping — height set dynamically in JS */
.net-preview { cursor: default; }
.net-preview .net-canvas { pointer-events: auto; }

/* ── Explore overlay (fullscreen pan+zoom) ──────────────── */
.net-explore-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg); display: flex; flex-direction: column;
}
.net-explore-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.net-explore-topbar h3 { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.net-explore-actions { display: flex; gap: 6px; flex: 1; justify-content: center; }
.net-explore-close {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 22px; line-height: 1; padding: 4px 10px;
  cursor: pointer; flex-shrink: 0;
}
.net-explore-close:hover { background: var(--urgent-glow); color: var(--urgent); border-color: var(--urgent); }
.net-explore-viewport {
  flex: 1; overflow: hidden; cursor: grab; position: relative;
}
.net-explore-viewport:active { cursor: grabbing; }

.net-canvas {
  position: relative; min-height: 200px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: visible;
}
.net-svg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

.net-hub {
  position: absolute; z-index: 2; cursor: pointer;
  background: var(--bg); border: 2px solid var(--accent);
  border-radius: var(--radius); padding: 0;
  transition: all 0.15s; white-space: nowrap;
  display: flex; align-items: center; gap: 0; overflow: hidden;
}
.net-hub:hover { background: var(--accent-glow); border-color: var(--accent); }
.net-hub-thumb { width: 50px; height: 40px; flex-shrink: 0; }
.net-hub-name { font-size: 12px; font-weight: 600; color: var(--text); padding: 6px 12px; }
.net-hub-brain { border-color: var(--gold, #d4a843); }
.net-hub-brain-icon {
  width: 50px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212, 168, 67, 0.15); color: var(--gold, #d4a843);
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
}

.net-node {
  position: absolute; z-index: 2; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px;
  display: flex; align-items: center; gap: 6px;
  max-width: 140px; transition: all 0.15s;
}
.net-node:hover { border-color: var(--accent); background: var(--accent-glow); transform: scale(1.05); }

.net-status-urgent { border-color: var(--urgent); }
.net-status-resolved, .net-status-completed { opacity: 0.5; }

.net-badge {
  font-size: 9px; text-transform: uppercase; font-weight: 700;
  letter-spacing: 0.3px; padding: 1px 5px; border-radius: 3px;
  background: var(--accent-glow); color: var(--accent); flex-shrink: 0;
}
.net-status-urgent .net-badge { background: var(--urgent-glow); color: var(--urgent); }

.net-label {
  font-size: 11px; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.net-amount { color: var(--gold); font-weight: 600; }
.net-above { border-color: var(--gold); border-style: dashed; }

/* ── Dashboard Button ───────────────────────────────────── */

.btn-dashboard {
  padding: 8px 20px; border: 2px solid var(--accent); border-radius: var(--radius);
  background: var(--accent-glow); color: var(--accent); font-size: 15px;
  font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: all 0.15s;
}
.btn-dashboard:hover { background: var(--accent); color: #fff; }

/* ── Profile Overlay ───────────────────────────────────── */

.profile-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.5); z-index: 60;
  display: flex; justify-content: flex-end;
}
.profile-panel {
  width: 100%; max-width: 480px; background: var(--bg);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 300ms var(--easing);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}
.profile-overlay.profile-open .profile-panel { transform: translateX(0); }

.profile-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.profile-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: white; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.profile-header-info { flex: 1; min-width: 0; }
.profile-name { font-size: 16px; font-weight: 600; }
.profile-role { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.profile-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.profile-close {
  background: none; border: none; color: var(--text-muted); font-size: 24px;
  cursor: pointer; padding: 4px 8px; line-height: 1;
}
.profile-close:hover { color: var(--text); }

.profile-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

.profile-section { margin-bottom: 20px; }
.profile-section h4 {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px;
}
.profile-muted { font-size: 13px; color: var(--text-muted); }

.profile-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.profile-info-row:last-child { border-bottom: none; }

.profile-note-form { margin-bottom: 12px; }
.profile-notes-list { display: flex; flex-direction: column; gap: 8px; }
.profile-note {
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.profile-note-text { font-size: 13px; line-height: 1.5; }

.profile-activity-row {
  display: flex; justify-content: space-between; font-size: 12px;
  color: var(--text-muted); padding: 4px 0; border-bottom: 1px solid var(--border);
}
.profile-activity-row:last-child { border-bottom: none; }

.profile-vote-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.profile-vote-row:last-child { border-bottom: none; }
.profile-vote-item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-vote-choice {
  font-weight: 600; color: var(--accent); flex-shrink: 0;
  padding: 2px 8px; background: var(--accent-glow); border-radius: 4px; font-size: 12px;
}

.profile-cal-row {
  display: flex; gap: 12px; font-size: 13px; padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.profile-cal-row:last-child { border-bottom: none; }
.profile-cal-date { color: var(--text-muted); flex-shrink: 0; font-size: 12px; }

/* ── Profile Certifications ────────────────────────────── */

.profile-cert-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.profile-cert-row:last-of-type { border-bottom: none; }
.cert-type { font-weight: 500; flex: 1; }
.cert-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.cert-status-active { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.cert-status-expired { background: var(--urgent-glow); color: var(--urgent); }
.cert-status-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.cert-detail { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.cert-other-label.hidden { display: none; }

/* ── Profile Vault ─────────────────────────────────────── */

.profile-vault-list { display: flex; flex-direction: column; gap: 8px; }
.profile-vault-item {
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.vault-item-header { display: flex; align-items: center; gap: 8px; }
.vault-type-badge {
  font-size: 10px; text-transform: uppercase; font-weight: 600;
  padding: 2px 6px; border-radius: 4px; color: var(--accent);
  background: var(--accent-glow); flex-shrink: 0;
}
.vault-title { font-size: 13px; font-weight: 500; flex: 1; }
.vault-delete {
  background: none; border: none; color: var(--text-muted); font-size: 18px;
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.vault-delete:hover { color: var(--urgent); }
.vault-content { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.vault-file-link { font-size: 12px; color: var(--accent); text-decoration: none; display: block; margin-top: 4px; }
.vault-file-link:hover { text-decoration: underline; }

.profile-signout {
  width: 100%; margin-top: 16px; text-align: center;
  border-color: var(--urgent); color: var(--urgent);
}
.profile-signout:hover { background: var(--urgent-glow); }
.profile-password-msg { font-size: 13px; margin-top: 6px; min-height: 18px; }
.profile-password-msg.form-error { color: var(--urgent); }
.profile-password-msg.form-success { color: #22c55e; }

/* ── Family (used in dashboard sidebar + expanded sidebar) ─ */


/* ── Property Financial Panel ────────────────────────────── */

.fin-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  margin: 8px 0 12px;
}
.fin-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.fin-panel-title {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.fin-row-group {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px 16px; margin-bottom: 10px;
}
.fin-metric {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; border-bottom: 1px solid var(--border);
}
.fin-metric:nth-last-child(-n+2) { border-bottom: none; }
.fin-metric-label { font-size: 12px; color: var(--text-muted); }
.fin-metric-value { font-size: 14px; font-weight: 600; color: var(--text); }

.fin-cats {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.fin-cat-chip {
  font-size: 11px; color: var(--text-muted);
  padding: 3px 8px; background: rgba(255, 255, 255, 0.04);
  border-radius: 4px; text-transform: capitalize;
}
.fin-cat-chip strong { color: var(--gold); margin-left: 4px; }

.fin-revenue {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
  padding-top: 8px; border-top: 1px solid var(--border);
}

.fin-breakeven {
  padding-top: 8px; border-top: 1px solid var(--border);
}
.fin-breakeven-label {
  font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 6px;
}
.fin-breakeven-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.fin-be-chip {
  font-size: 12px; color: var(--text-muted);
  padding: 4px 8px; background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.fin-be-chip strong { color: var(--accent); }

/* ── Project Budgets ─────────────────────────────────────── */
.fin-budgets { margin-top: 12px; }
.budget-over { color: var(--urgent) !important; }
.budget-over-card { border-left: 3px solid var(--urgent); }

/* ── Section Labels ──────────────────────────────────────── */

.section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.5;
  float: right;
  margin-top: 2px;
}

/* ── Approval Panel ─────────────────────────────────────── */

.approval-card {
  background: var(--surface); border: 1px solid var(--warning);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.approval-card-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.approval-badge {
  font-size: 11px; font-weight: 600; color: var(--warning);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.approval-title { font-size: 14px; font-weight: 500; flex: 1; }
.approval-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.approval-actions { display: flex; gap: 8px; }
.btn-approve {
  padding: 6px 16px; border: 1px solid var(--success); border-radius: var(--radius);
  background: rgba(34, 197, 94, 0.1); color: var(--success); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-approve:hover { background: var(--success); color: white; }
.btn-approve:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-reject {
  padding: 6px 16px; border: 1px solid var(--urgent); border-radius: var(--radius);
  background: none; color: var(--urgent); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-reject:hover { background: var(--urgent-glow); }
.btn-reject:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-preview {
  padding: 6px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: none; color: var(--text-muted); font-size: 13px;
  cursor: pointer; transition: all 0.15s;
}
.btn-preview:hover { border-color: var(--accent); color: var(--accent); }
.approval-preview {
  margin-top: 10px; padding: 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; color: var(--text-muted); max-height: 200px; overflow-y: auto;
}

/* ── Inline Help Text ──────────────────────────────────── */

.hint {
  font-size: 11px; color: var(--text-muted); opacity: 0.6;
  font-style: italic; display: block;
}
.hint-inline {
  font-size: 11px; color: var(--text-muted); opacity: 0.6;
  font-style: italic; margin-left: 6px;
}
.hint-click {
  font-size: 10px; color: var(--text-muted); opacity: 0;
  transition: opacity 0.2s; text-align: center; padding: 2px 0;
}
.property-card:hover .hint-click,
.net-node:hover .hint-click,
.item-card:hover .hint-click,
.exp-sidebar-member:hover .hint-click,
.pf-stat-link:hover .hint-click { opacity: 0.6; }

/* ── Decision Vote Modal ──────────────────────────────── */

.decision-modal-title {
  font-size: 15px; font-weight: 600; margin: 8px 0;
}

/* ── Guide Page ────────────────────────────────────────── */

.guide-overlay {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 70; overflow-y: auto;
}
.guide-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 1;
}
.guide-header h2 { font-size: 18px; }
.guide-close {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.guide-close:hover { border-color: var(--accent); color: var(--accent); }
.guide-toc {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 24px;
  border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 52px; z-index: 1;
}
.guide-toc a {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-size: 12px; text-decoration: none; white-space: nowrap;
}
.guide-toc a:hover { border-color: var(--accent); color: var(--accent); }
.guide-body { max-width: 720px; margin: 0 auto; padding: 24px; }
.guide-section { margin-bottom: 32px; scroll-margin-top: 110px; }
.guide-section h3 {
  font-size: 16px; color: var(--accent); margin-bottom: 12px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.guide-section h4 {
  font-size: 14px; color: var(--text); margin: 16px 0 8px; font-weight: 600;
}
.guide-section p { font-size: 14px; line-height: 1.7; margin-bottom: 10px; color: var(--text); }
.guide-section ul { padding-left: 20px; margin-bottom: 10px; }
.guide-section li { font-size: 13px; line-height: 1.6; margin-bottom: 4px; color: var(--text-muted); }
.guide-section li strong { color: var(--text); }
.guide-source {
  font-size: 12px; color: var(--accent); text-decoration: none;
  padding: 2px 6px; background: var(--accent-glow); border-radius: 4px;
}
.guide-source:hover { text-decoration: underline; }
.guide-calc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin: 8px 0;
  font-size: 13px; color: var(--text-muted); font-family: monospace;
}
.btn-guide {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: none; color: var(--text-muted); font-size: 12px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn-guide:hover { border-color: var(--accent); color: var(--accent); }

/* ── Knowledge Base Overlay ─────────────────────────────── */
.knowledge-overlay {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 60; overflow-y: auto;
}
.kb-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 3;
}
.kb-header h2 { font-size: 18px; white-space: nowrap; }
.kb-header-controls { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }
.kb-search {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 6px 14px; font-size: 13px; width: 280px; max-width: 50vw;
  outline: none; transition: border-color 0.15s;
}
.kb-search:focus { border-color: var(--accent); }
.kb-search::placeholder { color: var(--text-muted); }
.kb-close {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.kb-close:hover { border-color: var(--accent); color: var(--accent); }
.kb-layout {
  display: flex; min-height: calc(100vh - 52px);
}
.kb-toc {
  width: 200px; flex-shrink: 0; padding: 16px 12px;
  border-right: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.kb-toc-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin-bottom: 6px; padding: 0 8px;
}
.kb-toc a {
  padding: 5px 8px; border-radius: 4px; font-size: 12px;
  color: var(--text-muted); text-decoration: none; white-space: nowrap;
  transition: all 0.12s;
}
.kb-toc a:hover { background: var(--accent-glow); color: var(--accent); }
.kb-body { flex: 1; max-width: 780px; margin: 0 auto; padding: 24px 32px; }
.kb-section { margin-bottom: 36px; scroll-margin-top: 70px; }
.kb-section h3 {
  font-size: 16px; color: var(--accent); margin-bottom: 14px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.kb-section ul { padding-left: 20px; margin-bottom: 10px; list-style: disc; }
.kb-section li {
  font-size: 13px; line-height: 1.7; margin-bottom: 6px; color: var(--text-muted);
}
.kb-cite {
  font-size: 11px; color: var(--accent); text-decoration: none;
  padding: 1px 5px; background: var(--accent-glow); border-radius: 3px;
  margin-left: 3px; white-space: nowrap;
}
.kb-cite:hover { text-decoration: underline; }
.kb-verify {
  border-left: 3px solid #eab308; padding-left: 8px;
  background: rgba(234, 179, 8, 0.08); border-radius: 0 4px 4px 0;
}
@media (max-width: 768px) {
  .kb-toc { display: none; }
  .kb-body { padding: 16px; }
  .kb-header { padding: 10px 14px; }
  .kb-search { width: 160px; max-width: 40vw; }
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Prevent ANY horizontal overflow */
  #app, main, #dashboard-screen, #property-grid { max-width: 100vw; overflow-x: hidden; }

  /* Header: single row on mobile — hide user info (shown in FAMILY section) */
  header { flex-wrap: nowrap; padding: 8px 10px; gap: 6px; }
  #header-left { flex: 0 0 auto; min-width: 0; }
  #header-center { flex: 1; gap: 8px; }
  #header-right { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
  #user-info { display: none; } /* redundant with FAMILY sidebar on mobile */
  .btn-back { padding: 6px 10px; font-size: 12px; }
  .btn-ai-main { padding: 6px 12px; font-size: 12px; }
  .btn-guide { font-size: 11px; padding: 4px 8px; }
  .btn-dashboard { padding: 6px 10px; font-size: 12px; letter-spacing: 0; }

  /* Layouts */
  .expanded-layout { flex-direction: column; }
  .dash-layout { flex-direction: column; gap: 10px; min-height: auto; }
  .dash-sidebar { width: 100%; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .dash-sidebar .exp-sidebar-label { flex-shrink: 0; align-self: center; }
  .dash-main-col { min-width: 0; max-width: 100%; }
  .exp-sidebar { width: 100%; flex-direction: row; overflow-x: auto; gap: 8px; }
  .exp-sidebar-card { min-width: 140px; flex-shrink: 0; }
  .exp-sat-thumb { height: 60px; }
  .home-grid { grid-template-columns: 1fr; }
  .dash-main-col .home-grid { grid-template-columns: 1fr; }
  .member-panel { width: 90%; }
  .profile-panel { max-width: 100%; }
  .wb-anchor { width: 180px; }

  /* Property cards */
  .property-card { padding: 12px; }
  .card-satellite { height: 180px; margin: -12px -12px 10px -12px; }
  .card-header { gap: 8px; }
  .card-name { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-floorplan { min-height: 80px; margin-bottom: 8px; }
  .card-stats { flex-wrap: wrap; gap: 8px; font-size: 12px; }
  .hint-click { display: none; } /* no hover on touch — hide "Click for detailed view" */

  /* Section labels */
  .section-label { float: none; display: block; text-align: right; }

  /* Toolbars */
  .sat-toolbar { gap: 4px; flex-wrap: wrap; }
  .btn-sat-tool { padding: 6px 10px; font-size: 11px; min-height: 36px; }

  /* Network explore overlay — touch-friendly */
  .net-explore-viewport { cursor: default; }
  .net-explore-topbar { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .net-explore-topbar h3 { font-size: 13px; }
  .net-explore-actions { flex-wrap: wrap; gap: 4px; }
  .pf-panel { max-width: 100%; overflow: hidden; }

  /* Portfolio financials waterfall */
  .pf-header { flex-wrap: wrap; gap: 8px; }
  .pf-header h3 { font-size: 13px; }
  .pf-section { padding: 12px 14px; }

  /* Guide */
  .guide-toc { padding: 8px 12px; gap: 4px; top: 48px; }
  .guide-toc a { font-size: 11px; padding: 4px 8px; }
  .guide-body { padding: 16px; }
  .guide-header { padding: 12px 16px; }

  /* Tap targets: min 44px for interactive nodes */
  .net-hub { min-height: 36px; padding: 8px 12px; }
  .net-node { min-height: 32px; }
  .wb-card-delete { padding: 8px; min-width: 36px; min-height: 36px; }

  /* Modals */
  .modal-box { max-width: calc(100vw - 32px); }
  .header-dropdown { min-width: calc(100vw - 40px); left: 50%; right: auto; }
}

@media (max-width: 480px) {
  main { padding: 8px; }
  .auth-box { padding: 24px 16px; }
  .pin-popover { min-width: 160px; max-width: calc(100vw - 32px); }
  .header-dropdown { min-width: calc(100vw - 24px); }
  .family-member-card { padding: 8px 10px; }
  .wb-toolbar { flex-direction: column; gap: 6px; align-items: flex-start; }
  .wb-toolbar-actions { flex-wrap: wrap; gap: 4px; }
  .pf-form-row { grid-template-columns: 1fr; }
  .card-satellite { height: 150px; }
  .card-name { font-size: 13px; }
  .btn-sat-tool { padding: 4px 8px; font-size: 10px; }
  .pf-panel { padding: 10px; }
  .pf-section { padding: 10px 12px; }
  .pf-row-name { font-size: 12px; }
  .exp-sidebar-member { font-size: 12px; padding: 6px 8px; }
  #logo { font-size: 16px; }
}

/* ── Portfolio Financials Panel ─────────────────────────── */

.pf-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}
.pf-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.pf-header h3 { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.pf-actions { display: flex; gap: 8px; }
.pf-btn {
  padding: 5px 12px; border-radius: var(--radius);
  background: var(--surface-hover); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 12px;
  transition: all 0.2s;
}
.pf-btn:hover { border-color: var(--accent); color: var(--accent); }
.pf-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.pf-btn-primary:hover { opacity: 0.9; color: #fff; }
.pf-btn-delete { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 2px 6px; }
.pf-btn-delete:hover { color: var(--urgent); }

.pf-stale-warning {
  background: rgba(245, 158, 11, 0.1); border: 1px solid var(--warning);
  border-radius: var(--radius); padding: 8px 12px;
  font-size: 12px; color: var(--warning); margin-bottom: 12px;
}

/* Waterfall layout */
.pf-waterfall { display: flex; flex-direction: column; }

.pf-section {
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--surface-hover);
  border-left: 3px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.pf-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.pf-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, rgba(255,255,255,0.08), transparent);
}

/* Rows */
.pf-row {
  display: flex; align-items: center; padding: 6px 0; gap: 12px;
}
.pf-row + .pf-row { border-top: 1px solid rgba(255,255,255,0.04); }
.pf-row-name {
  font-size: 13px; color: var(--text-muted); flex: 1;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-row-value { font-size: 15px; font-weight: 600; white-space: nowrap; min-width: 80px; text-align: right; }
.pf-row-secondary { font-size: 12px; color: var(--text-muted); white-space: nowrap; min-width: 70px; text-align: right; }
.pf-row-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.06); color: var(--text-muted); white-space: nowrap;
}
.pf-section-total {
  display: flex; align-items: center; padding: 10px 0 2px; margin-top: 6px;
  border-top: 1px solid var(--border); gap: 12px;
}
.pf-section-total .pf-row-name { font-weight: 700; color: var(--text); font-size: 13px; }
.pf-section-total .pf-row-value { font-size: 16px; font-weight: 700; }

/* Timeline connector */
.pf-connector {
  display: flex; flex-direction: column; align-items: center;
  height: 28px; padding: 0;
}
.pf-connector::before {
  content: ''; width: 1.5px; flex: 1;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
}
.pf-connector::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.12); border: 1.5px solid rgba(255,255,255,0.2);
}

/* Income section — green accent */
.pf-section-income {
  border-left-color: var(--success);
  background: linear-gradient(135deg, rgba(34,197,94,0.05) 0%, var(--surface-hover) 60%);
}
.pf-section-income .pf-row-value { color: var(--success); }
.pf-section-income .pf-row-tag { background: rgba(34,197,94,0.1); color: var(--success); }

/* Costs section — red/warm accent */
.pf-section-costs {
  border-left-color: rgba(239,68,68,0.6);
  background: linear-gradient(135deg, rgba(239,68,68,0.03) 0%, var(--surface-hover) 60%);
}
.pf-section-costs .pf-row-value { color: var(--text); }
.pf-section-costs .pf-section-total .pf-row-value { color: rgba(239,68,68,0.8); }

/* Deductions section — revenue knocked down to net */
.pf-section-deductions {
  border-left-color: var(--success);
  background: linear-gradient(135deg, rgba(34,197,94,0.04) 0%, var(--surface-hover) 40%);
}
.pf-section-deductions.pf-negative {
  border-left-color: var(--urgent);
  background: linear-gradient(135deg, rgba(239,68,68,0.04) 0%, var(--surface-hover) 40%);
}
.pf-row-start { padding-bottom: 8px; }
.pf-row-start .pf-row-name { font-weight: 600; color: var(--text); }
.pf-row-deduct .pf-row-name { color: var(--text-muted); }
.pf-row-deduct .pf-row-value { color: rgba(239,68,68,0.7); }
.pf-row-deduct .pf-row-secondary { color: rgba(239,68,68,0.4); }
.pf-row-net {
  margin-top: 6px; padding-top: 10px;
  border-top: 2px solid var(--border);
}
.pf-row-net .pf-row-name {
  font-weight: 800; font-size: 14px; color: var(--text);
}

/* Secondary sections */
.pf-section-secondary {
  padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.pf-section-secondary + .pf-section-secondary { margin-top: 8px; }

.pf-stat-link { cursor: pointer; border-radius: 6px; transition: background 0.15s; }
.pf-stat-link:hover { background: rgba(255,255,255,0.06); }

.pf-runway-red { color: var(--urgent); }
.pf-runway-yellow { color: var(--warning); }
.pf-runway-ok { color: var(--success); }

/* Portfolio Financials modals */
.pf-form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;
}
.pf-form-row label {
  display: flex; flex-direction: column; font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; gap: 4px;
}
.pf-form-row input, .pf-form-row select, .pf-form-row textarea {
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: 13px; outline: none;
}
.pf-form-row input:focus, .pf-form-row select:focus, .pf-form-row textarea:focus { border-color: var(--accent); }
.pf-form-actions { display: flex; gap: 8px; margin-top: 16px; }

.pf-balance-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pf-balance-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.pf-balance-label { flex: 1; font-size: 13px; }
.pf-balance-type { display: block; font-size: 11px; color: var(--text-muted); }
.pf-balance-input {
  width: 120px; padding: 6px 8px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: 13px; text-align: right; outline: none;
}
.pf-balance-input:focus { border-color: var(--accent); }

/* Breakdown modal */
.pf-breakdown-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; max-height: 400px; overflow-y: auto; }
.pf-breakdown-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.pf-breakdown-group { padding: 10px 0 4px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border); }
.pf-breakdown-name { font-size: 13px; font-weight: 600; min-width: 120px; }
.pf-breakdown-detail { font-size: 12px; color: var(--text-muted); }
.pf-breakdown-total { font-size: 13px; margin-left: auto; }
.pf-breakdown-input {
  width: 110px; padding: 5px 8px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: 13px; text-align: right; outline: none;
}
.pf-breakdown-input:focus { border-color: var(--accent); }
.pf-breakdown-delete { padding: 2px 6px; font-size: 14px; line-height: 1; }
