:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --navy: #1a2744;
  --navy2: #243562;
  --link: #2563eb;
  --gold: #b8962e;
  --green: #1a6b47;
  --green-bg: #e8f5ee;
  --red: #b52b2b;
  --red-bg: #fdeaea;
  --amber: #b07a10;
  --amber-bg: #fdf3dc;
  --border: #e4e1d9;
  --muted: #7a7870;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(26,39,68,0.08);
  --shadow-hover: 0 8px 32px rgba(26,39,68,0.14);
}

a { text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

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

body {
  background: var(--bg);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 15px;
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
}

/* -- TOPBAR -- */
.topbar {
  background: var(--navy);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start; 
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo img {
  height: 36px;
  width: auto;
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand span { color: var(--gold); }
.brand-tag { font-size: 10px; color: rgba(255,255,255,0.4); letter-spacing: 0.15em; text-transform: uppercase; font-family: var(--font-data);  padding-left: 0; margin-left: 4px; }

.topbar-right { margin-left: auto; 
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-family: var(--font-data);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.status-dot.live {
  background: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
}

.key-field {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-family: var(--font-data);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 6px;
  width: 200px;
  outline: none;
}

.key-field::placeholder { color: rgba(255,255,255,0.25); }

.connect-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* -- SCREENS -- */
.screen { display: none; min-height: calc(100vh - 56px); min-height: calc(var(--vh, 1vh) * 100 - 56px); background: var(--bg); }
.screen.active { display: block; }

/* -- LOGIN -- */
.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  min-height: calc(var(--vh, 1vh) * 100 - 56px);
  padding: 40px 24px;
  text-align: center;
  gap: 24px;
  background: linear-gradient(160deg, #f8f9fc 0%, #eef1f8 100%);
}

.login-logo {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -1px;
}

.login-logo span { color: var(--gold); }

.login-tagline {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: -8px;
}

.login-sub {
  font-size: 15px;
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 600;
  max-width: 380px;
  line-height: 1.4;
}

.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(10,20,60,0.08);
  text-align: left;
}

.login-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-family: var(--font-data);
  font-size: 14px;
  padding: 13px 16px;
  border-radius: 8px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.login-input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,20,60,0.06); }

.login-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  margin-top: 4px;
}

.login-btn:hover { background: var(--navy2); }

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-label {
  font-size: 13px;
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--navy);
}
.login-input-wrap {
  position: relative;
}
.login-input-wrap .login-input {
  padding-right: 44px;
  width: 100%;
}
.login-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  z-index: 2;
}
.login-eye:hover { color: var(--navy); }
.login-eye svg, .login-eye svg * { pointer-events: none; }
.login-forgot {
  text-align: right;
  margin-top: -2px;
}
.login-forgot span {
  font-size: 12px;
  color: inherit;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
@media (hover: hover) {
  .forgot-password-link:hover,
  .forgot-password-link:focus {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.forgot-password-link:active {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-bottom-switch {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-ui);
  text-align: center;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.login-switch-action {
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
@media (hover: hover) {
  .login-switch-action:hover,
  .login-switch-action:focus {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.login-switch-action:active {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-switch {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-ui);
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.login-switch span {
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.login-switch span:hover,
.login-switch span:focus {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-err {
  font-size: 13px;
  font-family: var(--font-ui);
  min-height: 16px;
  margin-top: 12px;
  color: var(--red);
}

.login-err:not(:empty) {
  background: #fdf2f2;
  border: 1px solid rgba(181,43,43,0.2);
  border-radius: 8px;
  padding: 10px 14px;
  color: #b52b2b;
}

.topbar-logout {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: none;
}

.topbar-logout:hover { border-color: var(--red); color: var(--red); }

/* -- FLOW SCREENS (home, city, cat) -- */
.flow-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}

.flow-question {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.flow-sub {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 36px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 32px;
  display: block;
  font-family: var(--font-ui);
  transition: color 0.15s;
}

.back-btn:hover { color: var(--navy); }

/* -- GOAL CARDS -- */
.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.goal-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

/* Differentiate the two cards */
.goal-card:first-child {
  border-left: 4px solid var(--navy);
}

.goal-card:last-child {
  border-left: 4px solid var(--gold);
}

/* Shorten descriptions - edit HTML directly */
/* Change desc to bullet points */


.goal-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.goal-icon {
  font-size: 28px;
  color: var(--gold);
  margin-bottom: 16px;
}

.goal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.goal-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.goal-arrow {
  font-size: 20px;
  color: var(--navy);
  position: absolute;
  bottom: 24px;
  right: 24px;
  transition: transform 0.2s;
}

.goal-card:hover .goal-arrow { transform: translateX(4px); }

.explore-link {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.15s;
}

.explore-link:hover { color: var(--navy); background: var(--surface); }

/* -- CHOICE GRID (city / category) -- */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.choice-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 22px 20px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-family: var(--font-ui);
}

.choice-btn:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.choice-btn-icon { font-size: 22px; margin-bottom: 10px; color: var(--gold); }
.choice-btn-label { font-size: 15px; font-weight: 600; color: var(--navy); }
.choice-btn-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }


/* Disabled button styles */
.filter-apply-btn:disabled,
.filter-skip-btn:disabled,
.filter-skip-btn2:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.filter-skip-btn:disabled {
  background: transparent;
  color: var(--muted);
}

/* -- RESULTS -- */
.result-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.result-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.result-breadcrumb {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--muted);
}

/* -- PRICE RESULT COMPONENTS -- */
.verdict-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 4px;
}

.verdict-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-data);
  margin-bottom: 8px;
}

.verdict-price {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 6px;
  white-space: nowrap;
}

.verdict-price span {
  font-size: 18px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 400;
}

.verdict-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 24px;
}

.verdict-range {
  display: flex;
  gap: 24px;
  padding-top: 20px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.verdict-range-item { flex: 1; }
.vri-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-data); margin-bottom: 4px; }
.vri-value { font-family: var(--font-data); font-size: 18px; font-weight: 600; color: var(--navy); }

.price-bar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.pbc-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.price-range-track {
  position: relative;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  margin: 24px 0;
  border: 1px solid var(--border);
}

.price-range-fill {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, var(--green-bg), var(--navy));
  border-radius: 4px;
  opacity: 0.4;
}

.price-range-median {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.price-labels {
  display: flex;
  justify-content: flex-start; 
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--muted);
}

.health-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.health-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.hm-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-data); margin-bottom: 6px; }
.hm-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--navy); }
.hm-value.green { color: var(--green); }
.hm-value.amber { color: var(--amber); }
.hm-value.red { color: var(--red); }
.hm-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.insight-card {
  background: var(--green-bg);
  border: 1px solid rgba(26,107,71,0.15);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.insight-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.insight-text { font-size: 14px; color: var(--navy); line-height: 1.6; }
.insight-text strong { font-weight: 600; }

.neg-insight {
  background: var(--amber-bg);
  border-color: rgba(176,122,16,0.15);
}

/* -- NEGOTIATION RANGE CARD -- */
.neg-range-card {
  background: var(--surface);
  border: 1px solid rgba(176,122,16,0.22);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.neg-range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.neg-range-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.neg-range-scope { font-size: 10px; color: var(--muted); }
.neg-range-median-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.neg-range-pct {
  font-size: 30px;
  font-weight: 800;
  color: #b07a10;
  line-height: 1;
}
.neg-range-sublabel { font-size: 11px; color: var(--muted); }
.neg-range-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  position: relative;
  margin-bottom: 6px;
}
.neg-range-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: #b07a10;
  opacity: 0.3;
  border-radius: 3px;
}
.neg-range-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #b07a10;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #b07a10;
}
.neg-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}
.neg-range-bias {
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 6px;
}

/* -- DEAL CARDS -- */
.deals-header {
  display: flex;
  align-items: center;
  justify-content: flex-start; 
  margin-bottom: 20px;
}

.deals-count {
  font-size: 14px;
  color: var(--muted);
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  cursor: default;
}

.deal-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.deal-card-top {
  background: var(--navy);
  padding: 20px 20px 16px;
  position: relative;
}

.deal-discount {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.deal-discount-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.deal-badge-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.deal-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-data);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}

.deal-badge.hot {
  background: rgba(184,150,46,0.3);
  color: #f5d78e;
}

.deal-card-body {
  padding: 18px 20px;
}

.deal-district {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.deal-cat {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-data);
  margin-bottom: 16px;
}

.deal-prices {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.dp-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-data); }
.dp-value { font-family: var(--font-data); font-size: 13px; font-weight: 500; color: var(--navy); margin-top: 2px; }

/* -- EXPLORE (full market) -- */
.explore-wrap { min-height: calc(100vh - 56px); min-height: calc(var(--vh, 1vh) * 100 - 56px); }

.explore-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 56px;
  z-index: 50;
}

.explore-tabs { display: flex; gap: 4px; flex: 1; }

.etab {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.etab:hover { color: var(--navy); background: var(--bg); }
.etab.active { color: var(--navy); background: var(--bg); font-weight: 600; }

.explore-controls { display: flex; gap: 8px; }

.eselect {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

#exploreContent { padding: 28px 32px 60px; max-width: 1100px; }

/* -- SHARED -- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.stat-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-family: var(--font-data); margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 3px;
  margin-bottom: 25px; }

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.thead { display: flex; align-items: center; justify-content: flex-start;  padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ttitle { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.tsub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tbadge { font-size: 11px; font-family: var(--font-data); color: var(--muted); background: var(--bg); padding: 3px 10px; border-radius: 3px; border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 16px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-family: var(--font-data); background: var(--bg); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid rgba(228,225,217,0.6); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(247,247,245,0.8); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-family: var(--font-data); }
.tag.s { background: var(--green-bg); color: var(--green); }
.tag.m { background: var(--amber-bg); color: var(--amber); }
.tag.w { background: var(--red-bg); color: var(--red); }

.ygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.ycard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; text-align: center; }
.ycat { font-size: 11px; color: var(--muted); font-family: var(--font-data); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.ypct { font-family: var(--font-display); font-size: 38px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.ypct span { font-size: 16px; color: var(--muted); }
.ylabel { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.ydet { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; border-top: 1px solid var(--border); padding-top: 12px; }
.ydl { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-data); }
.ydv { font-family: var(--font-data); font-size: 12px; font-weight: 500; margin-top: 2px; }

.nrow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid rgba(228,225,217,0.5); }
.nrow:last-child { border-bottom: none; }
.ncat { width: 150px; font-size: 12px; font-family: var(--font-data); flex-shrink: 0; color: var(--navy); }
.ntrack { flex: 1; height: 7px; background: var(--bg); border-radius: 4px; position: relative; border: 1px solid var(--border); }
.nfill { position: absolute; top: 0; height: 100%; border-radius: 4px; background: rgba(26,39,68,0.15); }
.ndot { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--navy); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.nlabels { display: flex; gap: 14px; font-size: 11px; font-family: var(--font-data); color: var(--muted); flex-shrink: 0; width: 160px; justify-content: flex-end; }
.nval { font-size: 13px; font-weight: 500; color: var(--navy); display: block; }

.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px; }
.hcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; position: relative; overflow: hidden; }
.hcard::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.hcard.STRONG::before { background: var(--green); }
.hcard.STABLE::before { background: var(--gold); }
.hcard.WEAK::before { background: var(--red); }
.hcard-cat { font-size: 12px; color: var(--muted); font-family: var(--font-data); margin-bottom: 8px; }
.hbadge { display: inline-block; padding: 3px 10px; border-radius: 3px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--font-data); margin-bottom: 10px; }
.hbadge.STRONG { background: var(--green-bg); color: var(--green); }
.hbadge.STABLE { background: var(--amber-bg); color: var(--amber); }
.hbadge.WEAK { background: var(--red-bg); color: var(--red); }
.hmetrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.hml { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-family: var(--font-data); }
.hmv { font-family: var(--font-data); font-size: 14px; font-weight: 500; margin-top: 2px; }

.score-bar { margin-top: 8px; }
.score-row { display: flex; justify-content: flex-start;  align-items: center; margin-bottom: 4px; }
.score-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-data); }
.score-num { font-family: var(--font-data); font-size: 15px; font-weight: 600; }
.score-track { height: 4px; background: var(--border); border-radius: 2px; }
.score-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }

.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--muted); gap: 10px; flex-direction: column; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ltext { font-family: var(--font-data); font-size: 12px; letter-spacing: 0.1em; text-align: center; }
.empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--muted, #7a7870);
  font-size: 13px;
  line-height: 1.75;
  background: var(--bg, #faf9f7);
  border: 1px dashed var(--border, #e4e1d9);
  border-radius: 10px;
  margin: 8px 0;
}
.empty-comparator {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted, #7a7870);
  font-size: 13px;
  line-height: 1.75;
  background: var(--bg, #faf9f7);
  border: 1px dashed var(--border, #e4e1d9);
  border-radius: 10px;
}
.empty-alerts {
  padding: 20px 24px;
  text-align: center;
  color: var(--muted, #7a7870);
  font-size: 13px;
  background: var(--bg, #faf9f7);
  border: 1px dashed var(--border, #e4e1d9);
  border-radius: 8px;
}
.err { background: var(--red-bg); border: 1px solid rgba(181,43,43,0.2); color: var(--red); padding: 12px 16px; border-radius: 8px; font-size: 13px; }

@media (max-width: 600px) {
  .goal-grid { grid-template-columns: 1fr; }
  .verdict-range { flex-direction: column; gap: 16px; }
  .health-row { grid-template-columns: 1fr; }
  .deals-grid { grid-template-columns: 1fr; }
  .flow-question { font-size: 26px; }
  .verdict-price { font-size: 36px; }
  .explore-topbar { flex-direction: column; align-items: flex-start; }
  #exploreContent { padding: 20px 16px 40px; }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* -- CITY DROPDOWN -- */
.city-select-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.city-dropdown {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  padding: 10px 36px 10px 16px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a2744' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.city-dropdown:focus { 
  border-color: var(--navy); 
}

.city-dropdown:hover {
  border-color: var(--gold);
}

/* -- FILTER SCREEN -- */
.filter-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.filter-topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 24px;
}

.filter-heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-optional {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fg {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.fg:last-child { border-bottom: none; }

.fg-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-family: var(--font-data);
  margin-bottom: 12px;
}

.f-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.f-pills-wrap { gap: 6px; }

.fpill {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.fpill:hover { border-color: var(--navy); }

.fpill.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.fpill-st {
  padding: 7px 13px;
  font-size: 13px;
}

.f-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.f-input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-family: var(--font-data);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  width: 140px;
  outline: none;
  transition: border-color 0.2s;
}

.f-input:focus { border-color: var(--navy); }
.f-sep { color: var(--muted); font-size: 18px; }

.filter-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  z-index: 50;
}

.filter-apply-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 16px 32px;
  border-radius: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  letter-spacing: 0.01em;
  transition: background 0.2s, transform 0.15s;
}

.filter-apply-btn:hover { background: var(--navy2); transform: translateY(-1px); }
.filter-apply-btn:active { transform: translateY(0); }

.filter-skip-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-align: center;
  transition: color 0.15s;
}

.filter-skip-btn:hover { color: var(--navy); }

.filter-skip-btn2 {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-align: center;
  width: 100%;
  transition: color 0.15s;
}

.filter-skip-btn2:hover { color: var(--navy); }

/* -- DUAL RANGE SLIDER -- */
.rs-wrap { padding: 8px 0 4px; }

.rs-track {
  position: relative;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  margin: 18px 0 10px;
}

.rs-fill {
  position: absolute;
  height: 100%;
  background: var(--navy);
  border-radius: 4px;
  pointer-events: none;
}

.rs-thumb {
  position: absolute;
  width: 100%;
  height: 6px;
  top: 0;
  left: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  outline: none;
  margin: 0;
}

.rs-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
  cursor: pointer;
  pointer-events: all;
  margin-top: -8px;
  transition: transform 0.15s;
}

.rs-thumb::-webkit-slider-thumb:hover { transform: scale(1.15); }

.rs-thumb::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
  cursor: pointer;
  pointer-events: all;
}

.rs-vals {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  margin-top: 4px;
}

/* -- FILTER NOTE BADGE -- */
.filter-note {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--navy);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 18px;
  display: inline-block;
}

/* -- DISTRICT DROPDOWN IN FILTER -- */
.filter-district-sel {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a2744' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  transition: border-color 0.2s;
}
.filter-district-sel:focus { border-color: var(--navy); }
.filter-district-sel:disabled { opacity: 0.5; cursor: wait; }

/* -- CITY DROPDOWN IN FILTER (same style as district) -- */
.filter-city-sel {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a2744' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  transition: border-color 0.2s;
}

.filter-city-sel:focus { border-color: var(--navy); }
.filter-city-sel:disabled { opacity: 0.5; cursor: wait; }


/* -- DATA TIMESTAMP -- */
.data-timestamp {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--muted);
  text-align: left;
  margin-top: 3px;
  margin-bottom: 20px;
  padding-left: 2px;
  letter-spacing: 0.04em;
}

/* -- PRICE LABELS GRID -- */
.price-labels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 12px;
}
.plg-item { display: flex; flex-direction: column; gap: 3px; }
.plg-center { text-align: center; }
.plg-right  { text-align: right; }
.plg-label {
  font-family: var(--font-data);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.plg-value {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
}
.plg-median {
  color: var(--navy);
  font-weight: 700;
}

/* -- PRICE BAR REDESIGN -- */
.pbc-track-wrap {
  position: relative;
  margin: 48px 0 16px;
}
.pbc-bubble {
  position: absolute;
  transform: translateX(-50%);
  bottom: 28px;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.pbc-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--navy);
}
.pbc-track {
  position: relative;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
}
.pbc-fill {
  position: absolute;
  height: 100%;
  background: var(--navy);
  opacity: 0.25;
  border-radius: 4px;
}
.pbc-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--navy);
  border: 3px solid #fff;
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}
.mkt-cta-btn {
  width: 100%;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  letter-spacing: .02em;
  transition: opacity .15s;
}
.mkt-cta-btn:hover { opacity: .85; }

.plg-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.plg-item { display: flex; flex-direction: column; gap: 3px; }
.plg-right { text-align: right; }
.plg-label {
  font-family: var(--font-data);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.plg-value {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
}
.pbc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.pbc-meta-item { display: flex; flex-direction: column; gap: 3px; }

/* -- FILTER TAGS -- */
.filter-note-wrap {
  margin-bottom: 20px;
}
.filter-note-label {
  font-family: var(--font-data);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-tag {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
}


/* ============================================================
   PREMIUM FEATURE STYLES - Add at the end of file
   ============================================================ */

/* PDF Download Button */
.result-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.pdf-download-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pdf-download-btn:hover {
  background: var(--gold);
  transform: translateY(-1px);
}

/* Simulation Card */
.simulation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.simulation-header {
  background: var(--navy);
  color: #fff;
  padding: 20px 24px;
}

.simulation-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.simulation-header p {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin: 0;
  line-height: 1.4;
}

.simulation-body {
  padding: 24px;
}

.inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: var(--font-data);
  font-weight: 500;
}

.input-group input,
.input-group select {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(26,39,68,0.1);
}

.simulate-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
}

.simulate-btn:hover {
  background: var(--navy2);
  transform: translateY(-1px);
}

.simulation-results {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.ranked-opportunities {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.rank-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  border-left: 4px solid var(--gold);
  transition: all 0.2s ease;
}

.rank-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.rank-card h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--navy);
}

.rank-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.rank-metric {
  flex: 1;
  min-width: 100px;
}

.rank-metric .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-family: var(--font-data);
  margin-bottom: 3px;
}

.rank-metric .value {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-data);
}

.rank-metric .value.green { color: var(--green); }
.rank-metric .value.red { color: var(--red); }
.rank-metric .value.gold { color: var(--gold); }

.strategy-box {
  background: var(--green-bg);
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
  border: 1px solid rgba(26,107,71,0.15);
}

.strategy-box .title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  margin-bottom: 8px;
}

.strategy-box .text {
  font-size: 14px;
  color: var(--navy);
  line-height: 1.5;
}

/* Scenario Analysis Card */
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 24px;
  overflow: hidden;
}

.scenario-header {
  background: var(--navy);
  color: #fff;
  padding: 20px 24px;
}

.scenario-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.scenario-header p {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin: 0;
}

.scenario-body {
  padding: 24px;
}

.scenario-sliders {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

.scenario-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scenario-item label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.scenario-item input {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 4px;
  outline: none;
}

.scenario-item input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 0.1s ease;
}

.scenario-item input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.scenario-values {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-data);
}

.scenario-impact {
  background: var(--bg);
  border-radius: 10px;
  padding: 18px;
  margin-top: 16px;
}

.scenario-impact .impact-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--navy);
}

.scenario-impact .impact-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}

.scenario-impact .impact-detail {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.break-point {
  background: var(--amber-bg);
  border-left: 4px solid var(--amber);
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 14px;
}

.break-point .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 4px;
}

.break-point .value {
  font-size: 14px;
  color: var(--navy);
  line-height: 1.4;
}

.exit-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
}

.exit-table th {
  text-align: left;
  padding: 10px 8px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border-radius: 6px;
}

.exit-table td {
  padding: 10px 8px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-data);
}

.exit-table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 600px) {
  .inputs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .rank-metrics {
    flex-direction: column;
    gap: 10px;
  }
  
  .rank-metric {
    min-width: auto;
  }
  
  .simulation-header h3,
  .scenario-header h3 {
    font-size: 16px;
  }
  
  .simulation-header p,
  .scenario-header p {
    font-size: 11px;
  }
  
  .pdf-download-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  
  .result-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  @page {
    margin: 1.5cm;
    size: A4;
  }
  
  body {
    background: white;
    font-size: 12px;
  }
  
  .topbar,
  .result-nav .back-btn,
  .pdf-download-btn,
  .filter-note-wrap,
  .simulate-btn,
  .scenario-item input,
  .scenario-item .scenario-values,
  .back-btn,
  .explore-link,
  .status-pill {
    display: none !important;
  }
  
  .result-nav {
    margin-bottom: 20px;
  }
  
  .result-breadcrumb {
    font-size: 10px;
  }
  
  .verdict-card,
  .price-bar-card,
  .health-row,
  .insight-card,
  .simulation-card,
  .scenario-card {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 15px;
  }
  
  .verdict-price {
    font-size: 28px;
  }
  
  .data-timestamp {
    position: fixed;
    bottom: 15px;
    right: 15px;
    font-size: 9px;
  }
  
  .rank-card {
    break-inside: avoid;
  }
  
  .section-title {
    margin-top: 20px;
  }
}


/* ============================================================
   PROFESSIONAL INVESTMENT SELECTION STYLES
   ============================================================ */

.selection-header {
  text-align: center;
  margin-bottom: 40px;
}

.selection-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.selection-subtitle {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.investment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}

.investment-card {
  position: relative;
  padding: 32px 28px 28px;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  overflow: hidden;
}

.investment-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Distinct visual differentiation */
.rent-card {
  border-top: 4px solid #10b981;
}

.sale-card {
  border-top: 4px solid #f59e0b;
}

/* Badge styling */
.card-badge {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-data);
}

.rent-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.sale-badge {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

/* Icon styling */
.investment-icon {
  font-size: 42px;
  margin-bottom: 20px;
}

.rent-icon {
  color: #10b981;
}

.sale-icon {
  color: #f59e0b;
}

/* Typography */
.investment-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.investment-subtitle {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-data);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.investment-desc {
  font-size: 14px;
  color: var(--navy);
  line-height: 1.6;
  margin-bottom: 20px;
}

.investment-desc strong {
  font-weight: 700;
  color: var(--navy);
}

/* Feature tags */
.investment-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.feature-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-ui);
}

/* Responsive */
@media (max-width: 600px) {
  .investment-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .selection-title {
    font-size: 26px;
  }
  
  .investment-card {
    padding: 28px 24px 24px;
  }
  
  .investment-title {
    font-size: 18px;
  }
}



/* ============================================================
   PROFESSIONAL HOME SCREEN REDESIGN
   ============================================================ */

.welcome-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.welcome-pills span {
  background: rgba(10,20,60,0.06);
  border: 1px solid rgba(10,20,60,0.12);
  color: var(--navy);
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.welcome-section {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.welcome-subtitle {
  font-size: 15px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.professional-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 40px;
}

.professional-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (hover: hover) {
  .professional-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);
    border-color: transparent;
  }
}

.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.valuation-card .card-accent {
  background: linear-gradient(90deg, var(--navy), #4a6fa5);
}

.opportunities-card .card-accent {
  background: linear-gradient(90deg, var(--gold), #d4af37);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.valuation-icon {
  background: rgba(26, 39, 68, 0.08);
  color: var(--navy);
}

.opportunities-icon {
  background: rgba(184, 150, 46, 0.08);
  color: var(--gold);
}

.card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 30px;
  font-family: var(--font-data);
}

.valuation-badge {
  background: rgba(26, 39, 68, 0.1);
  color: var(--navy);
}

.opportunities-badge {
  background: rgba(184, 150, 46, 0.1);
  color: var(--gold);
}

.card-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  line-height: 1.3;
}

.card-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.card-features {
  margin-bottom: 28px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.feature-check {
  width: 18px;
  height: 18px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.feature-text {
  font-size: 13px;
  color: var(--navy);
}

.card-footer {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: auto;
}

.card-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}

@media (hover: hover) {
  .professional-card:hover .card-action {
    gap: 10px;
  }
}

.valuation-card .card-action {
  color: var(--navy);
}

.opportunities-card .card-action {
  color: var(--gold);
}

.explore-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.explore-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 12px 28px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-ui);
}

.explore-btn:hover {
  background: var(--surface);
  border-color: var(--navy);
  transform: translateY(-2px);
}

.explore-icon {
  font-size: 16px;
}

.explore-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
}

.explore-arrow {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.explore-btn:hover .explore-arrow {
  transform: translateX(4px);
  color: var(--navy);
}

/* Responsive */
@media (max-width: 700px) {
  .professional-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .welcome-title {
    font-size: 26px;
  }
  
  .professional-card {
    padding: 24px;
  }
  
  .card-title {
    font-size: 20px;
  }
  
  .card-features {
    margin-bottom: 20px;
  }
}



/* ============================================================
   EXPLORE DASHBOARD - PROFESSIONAL MARKET INTELLIGENCE
   ============================================================ */

.explore-dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dashboard-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}

.header-right {
  display: flex;
  gap: 12px;
}

.city-selector, .month-selector {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--navy);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a2744' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.type-selector, .category-selector {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--navy);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a2744' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}


.dashboard-section {
  margin-bottom: 48px;
}

.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-data);
}

/* Pulse Grid - Full Width */
.pulse-grid {
  width: 100%;
  margin-bottom: 48px;
}

#pulseGrid {
  width: 100%;
  margin-bottom: 48px;
}

.pulse-card {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border);
}

.pulse-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Card Header */
.pulse-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 28px 16px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(26, 39, 68, 0.02) 0%, transparent 100%);
}

.pulse-location {
  flex: 1;
}

.pulse-city {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.pulse-category {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-data);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* City selection cards */
.city-option.selected {
  border-color: var(--gold) !important;
  background: rgba(184, 150, 46, 0.05) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.city-option:hover {
  transform: translateY(-2px);
  border-color: var(--navy) !important;
}

/* City selector buttons */
.city-selector-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.city-selector-btn:hover {
  border-color: var(--navy);
  background: rgba(26, 39, 68, 0.04);
}

.city-selector-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

/* Status Badge */
.pulse-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
}

.pulse-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pulse-status.strong {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.pulse-status.strong .pulse-status-dot {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.pulse-status.moderate {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.pulse-status.moderate .pulse-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.pulse-status.limited {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.pulse-status.limited .pulse-status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Card Body */
.pulse-card-body {
  padding: 24px 28px;
}

.pulse-metrics-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.pulse-metric-item {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: 12px;
}

.pulse-metric-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

.pulse-metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  font-family: var(--font-ui);
  line-height: 1.2;
  margin-bottom: 4px;
}

.pulse-metric-value.trend-up {
  color: #10b981;
}

.pulse-metric-value.trend-down {
  color: #ef4444;
}

.pulse-metric-value.trend-flat {
  color: var(--muted);
}

.pulse-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: var(--font-data);
  margin-bottom: 4px;
}

/* ── Pulse metric trend label ──────────────────────────────────────────── */
.pulse-metric-trend {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Discount signal states */
.pulse-metric-trend.signal-opportunity { color: #16a34a; }
.pulse-metric-trend.signal-moderate    { color: #d97706; }
.pulse-metric-trend.signal-tight       { color: var(--muted); }
/* Near-list-price is a market condition, not a warning */
.pulse-metric-trend.signal-hot { color: var(--muted); }


/* Price trend value states */
.pulse-metric-value.trend-up   { color: #16a34a; }
.pulse-metric-value.trend-down { color: #dc2626; }
.pulse-metric-value.trend-flat { color: var(--muted); }

/* ── Insight card ──────────────────────────────────────────────────────── */
.pulse-card .pulse-insight-card {
  display: block;           /* was flex - no longer needed without icon */
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--navy);
  border-radius: 12px;
}


.pulse-card .pulse-insight-card .insight-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.pulse-card .pulse-insight-card .insight-text {
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

/* ── Confidence bar ────────────────────────────────────────────────────── */
.pulse-card-footer {
  margin-top: 16px;
}

.confidence-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.confidence-fill.high     { background: #22c55e; }
.confidence-fill.moderate { background: #f59e0b; }
.confidence-fill.low      { background: #ef4444; }


.pulse-metric-trend.trend-up {
  color: #10b981;
}

.pulse-metric-trend.trend-down {
  color: #ef4444;
}

.pulse-metric-trend.trend-flat {
  color: var(--muted);
}

/* Card Footer */
.pulse-card-footer {
  padding: 16px 28px 24px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.pulse-confidence {
  display: flex;
  align-items: center;
  gap: 12px;
}

.confidence-label {
  font-size: 11px;
  font-family: var(--font-data);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.confidence-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.confidence-fill.high {
  width: 85%;
  background: #10b981;
}

.confidence-fill.moderate {
  width: 50%;
  background: #f59e0b;
}

.confidence-fill.low {
  width: 25%;
  background: #ef4444;
}

.confidence-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-ui);
  min-width: 45px;
  text-align: right;
}

/* Responsive */
@media (max-width: 600px) {
  .pulse-card-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .pulse-status {
    align-self: flex-start;
  }
  
  .pulse-metrics-grid {
    flex-direction: column;
    gap: 12px;
  }
  
  .pulse-metric-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 12px 16px;
  }
  
  .pulse-metric-icon {
    margin-bottom: 0;
  }
  
  .pulse-metric-value {
    font-size: 28px !important;
  }
  
  .pulse-card-header,
  .pulse-card-body,
  .pulse-card-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}


/* Heatmap Grid */
.heatmap-grid {
  display: block;
}

.heatmap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.heatmap-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.heatmap-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 8px;
}

.heatmap-discount {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}

.heatmap-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.heatmap-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.fill-high { background: #10b981; width: 70%; }
.fill-moderate { background: #f59e0b; width: 40%; }
.fill-low { background: #ef4444; width: 20%; }

/* Comparator */
.comparator-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.comparator-selectors {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.compare-select {
  width: 180px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--navy);
  cursor: pointer;
}

.comparator-table {
  overflow-x: auto;
}

.comparator-table table {
  width: 100%;
  border-collapse: collapse;
}

.comparator-table th {
  text-align: left;
  padding: 12px;
  background: var(--bg);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-data);
}

.comparator-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
}

.empty-comparator {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

/* Alerts */
.alerts-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.create-alert {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.alert-select, .alert-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
}

.alert-select {
  min-width: 140px;
}

.alert-input {
  width: 120px;
}

.alert-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.alert-btn:hover {
  background: var(--navy2);
}

.active-alerts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.alert-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.alert-info strong {
  color: var(--navy);
}

.alert-info span {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-data);
}

.remove-alert {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.remove-alert:hover {
  background: var(--red-bg);
}

.empty-alerts {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 13px;
}

.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

@media (max-width: 700px) {
  .explore-dashboard {
    padding: 16px;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .pulse-grid, .heatmap-grid {
    grid-template-columns: 1fr;
  }
  
  .comparator-selectors {
    flex-direction: column;
  }
  
  .create-alert {
    flex-direction: column;
  }
  
  .alert-select, .alert-input, .alert-btn {
    width: 100%;
  }
}

.pulse-footnote {
  font-size: 10px;
  color: var(--muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: var(--font-data);
  letter-spacing: 0.02em;
}


.explore-filter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  appearance: none;
  width: auto;
  max-width: 180px;
  min-width: 110px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a2744' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all 0.2s ease;
}

.explore-filter:hover {
  border-color: var(--navy);
}

.explore-filter:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(26,39,68,0.1);
}


/* ============================================================
   WORLD-CLASS CATEGORY SELECTION PAGE WITH REAL IMAGES
   ============================================================ */

/* Header with city selector */
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.city-context {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  padding: 6px 16px 6px 12px;
  border-radius: 40px;
  border: 1px solid var(--border);
}

.city-label {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.city-selector-modern {
  background: transparent;
  border: none;
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 4px 0;
}

.city-selector-modern:hover {
  color: var(--gold);
}

.property-context {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 6px 16px;
}

.property-type-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
}


/* Title Section */
.category-title-section {
  margin-bottom: 32px;
}

.category-main-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.category-subtitle {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.category-subtitle span {
  font-weight: 600;
  color: var(--navy);
}

/* Category Card with Real Images */
.category-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 100px;
}

.category-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--navy);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.category-card.selected {
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(184, 150, 46, 0.15);
}

.category-card.selected::after {
  content: '✓';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: var(--gold);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.category-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.category-card:hover .category-card-image {
  transform: scale(1.05);
}

.category-card-image-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.category-card-content {
  padding: 16px;
}

.category-card-name {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}

.category-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.category-card-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 20px;
  font-size: 10px;
  font-family: var(--font-data);
  color: var(--gold);
  font-weight: 500;
}

/* Floating Continue Button */
.floating-continue {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.98);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.selected-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-preview img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.selected-preview-text {
  font-family: var(--font-ui);
}

.selected-preview-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.selected-preview-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.continue-btn {
  background: var(--navy);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 48px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.continue-btn:hover {
  background: var(--gold);
  transform: scale(1.02);
  gap: 16px;
}

.continue-arrow {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.continue-btn:hover .continue-arrow {
  transform: translateX(4px);
}

/* Loading & Empty States */
.category-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 16px;
}

.category-loading .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.category-empty {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}

.category-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.category-empty-text {
  font-size: 14px;
}

/* Responsive */
@media (max-width: 700px) {
  .category-visual-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
  
  .category-card-image {
    height: 140px;
  }
}

@media (max-width: 500px) {
  .category-visual-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .category-card {
    display: flex;
    flex-direction: row;
  }
  
  .category-card-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
  }
  
  .category-card-content {
    flex: 1;
  }
  
  .floating-continue {
    padding: 12px 20px;
    flex-direction: column;
    gap: 12px;
  }
  
  .continue-btn {
    width: 100%;
    justify-content: center;
  }
  
  .category-main-title {
    font-size: 24px;
  }
  
  .category-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .selected-preview {
    width: 100%;
    justify-content: space-between;
  }
}



/* Trust & Methodology */
.methodology-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 20px;
  cursor: help;
  margin-left: 12px;
}

.sample-size {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.tooltip-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  color: white;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

/* Comps Section */
.comps-section {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.comps-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-weight: 600;
}

.comps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
}

.comp-card {
  background: var(--surface);
  padding: 16px;
  transition: background 0.2s;
}

.comp-card:hover {
  background: var(--bg);
}

.comp-price {
  font-weight: 700;
  font-size: 16px;
  color: var(--navy);
}

.comp-detail {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  font-family: var(--font-data);
}

.comp-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--green-bg);
  color: var(--green);
}

.district-map-container {
  min-height: 300px;
  transition: all 0.2s;
}

/* Historical Trend */
.trend-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 20px;
  height: 120px;
}

.trend-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.trend-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--navy) 0%, var(--gold) 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s;
  min-height: 4px;
}

.trend-label {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-data);
}

.trend-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
}

.confidence-info {
  cursor: help;
  border-bottom: 1px dashed var(--muted);
}


/* Loading States */
.loading-overlay {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.loading-spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* ── Opportunity Heatmap Redesign ──────────────────────────────────────── */
.hm-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.hm-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.hm-stat {
  background: var(--surface);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hm-stat-label {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hm-stat-value {
  font-family: var(--font-ui) !important;
  font-size: 28px !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  color: var(--navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.hm-legend { gap: 8px; justify-content: center; }

.hm-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--navy);
}

.hm-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hm-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

.hm-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.hm-header {
  display: grid;
  grid-template-columns: 48px 1fr 130px 44px;
  padding: 10px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: var(--font-data);
}

.hm-row {
  display: grid;
  grid-template-columns: 48px 1fr 130px 44px;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(228,225,217,0.5);
  align-items: center;
  transition: background 0.15s;
}

.hm-row:last-child { border-bottom: none; }
.hm-row:hover { background: var(--bg); }

.hm-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-data);
}

.hm-rank.hm-rank-top {
  background: #1a4d2e;
  border-color: #1a4d2e;
  color: #fff;
}

.hm-district { font-size: 14px; font-weight: 500; color: var(--navy); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hm-bar-cell { display: flex; align-items: center; gap: 8px; overflow: hidden; min-width: 0; flex-shrink: 0; }

.hm-pct {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  width: 36px;
  flex-shrink: 0;
  text-align: right;
}

.hm-track {
  flex: 1;
  min-width: 0;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.hm-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

.hm-view-all {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  border-top: 1px solid var(--border);
  transition: color 0.15s;
}

.hm-view-all:hover { color: var(--gold); }

.hm-right { display: flex; flex-direction: column; gap: 16px; }

.hm-map-placeholder {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex: 1;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
}

.hm-insight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hm-insight-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-data);
}

.hm-insight-text { font-size: 13px; color: var(--muted); margin-top: 4px; }

.hm-insight-pct {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
  margin-top: 4px;
}

.hm-insight-sub { font-size: 12px; color: var(--muted); }

@media (max-width: 700px) {
  .hm-summary { grid-template-columns: 1fr 1fr; }
  .hm-content { grid-template-columns: 1fr; }
}

#heatmapGrid { display: block !important; width: 100%; }

.hm-stat-label { opacity: 0.65; }

.district-map-container { display: none; }

.hm-map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.hm-stat-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 1;
}
.hm-insight {
  display: grid !important;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 8px 12px;
  align-items: start;
}
.hm-insight-icon { grid-column: 1; grid-row: 1; align-self: start; padding-top: 2px; }
.hm-insight-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-column: 2;
  grid-row: 1;
}
.hm-insight-right-wrap {
  grid-column: 2;
  grid-row: 2;
}
.hm-insight-pct {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}
.hm-view-all {
  color: var(--navy);
  font-weight: 500;
  font-size: 14px;
  padding: 16px 24px;
}

.hm-insight-icon {
  font-size: 28px;
  color: var(--green);
  flex-shrink: 0;
  opacity: 0.7;
}
.hm-insight-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  text-align: left !important;
  grid-column: 2;
  grid-row: 2;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.hm-header {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}
.hm-insight-title {
  text-transform: none;
  font-size: 14px;
  letter-spacing: 0;
}
.hm-view-all {
  color: var(--navy);
}
.hm-view-all:hover {
  color: var(--navy);
  text-decoration: underline;
}

.hm-view-all,
.hm-view-all:hover {
  text-decoration: none;
}

.compare-select {
  font-family: var(--font-ui);
}

.compare-select option {
  color: var(--navy);
}

.hm-view-all,
.hm-view-all:hover {
  color: var(--navy) !important;
  text-decoration: none;
}

.compare-select {
  color: var(--navy) !important;
  font-family: var(--font-ui);
}

.compare-select option {
  color: var(--navy);
}

.alert-select,
.alert-input {
  color: var(--navy) !important;
  font-family: var(--font-ui);
}

.alert-select option {
  color: var(--navy);
}

.hm-view-all,
.hm-view-all:hover {
  color: var(--navy) !important;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: gap 0.2s ease;
  text-decoration: none;
  width: 100%;
}

.hm-view-all:hover {
  gap: 10px !important;
  color: var(--gold) !important;
}

.hm-view-all,
.hm-view-all:hover {
  color: var(--navy) !important;
  gap: 6px;
}

.hm-view-all:hover {
  gap: 10px !important;
}


/* ============================================================
   TYPOGRAPHY SYSTEM OVERHAUL
   Inter for UI labels, IBM Plex Mono only for data/codes
   ============================================================ */

/* Global tabular figures for all numeric displays */
.stat-value, .hm-stat-value, .pulse-metric-value,
.verdict-price, .hm-value, .dp-value, .vri-value,
.hm-pct, .heatmap-discount, .deal-discount,
.confidence-value, .ypct, .hmv, .ydv, .score-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* KPI numbers - Playfair 800 for maximum impact */
.stat-value, .verdict-price,
.hm-insight-pct, .ypct {
  font-weight: 800;
}

/* Pulse metric values - Inter bold for screen clarity */
.pulse-metric-value {
  font-family: var(--font-ui) !important;
  font-weight: 500 !important;
  font-variant-numeric: tabular-nums;
}

/* UI labels - switch from IBM Plex Mono to Inter */
.stat-label,
.pulse-metric-label,
.pulse-category,
.confidence-label,
.plg-label,
.vri-label,
.verdict-title,
.hm-label,
.hml,
.ncat,
.ycat,
.hcard-cat,
.score-label,
.fg-label,
.filter-note-label,
.deal-cat,
.deal-discount-label,
.section-subtitle,
.tbadge,
.hbadge,
.dp-label {
  font-family: var(--font-ui);
  letter-spacing: 0.03em;
}

/* All-caps labels get proper tracking */
.stat-label,
.pulse-metric-label,
.pulse-category,
.verdict-title,
.hm-insight-title,
.confidence-label {
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* List items - Inter medium for clarity */
.hm-district,
.deal-district,
.hcard-cat,
.ncat {
  font-family: var(--font-ui);
  font-weight: 500;
  line-height: 1.45;
}

/* Percentages in heatmap - Inter tabular */
.hm-pct {
  font-family: var(--font-ui);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Table headers in heatmap */
.hm-header {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.05em;
}

/* Interactive links - semi-bold, clear */
.hm-view-all,
.card-action,
.explore-link,
.filter-skip-btn,
.filter-skip-btn2 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
}

/* Body list rows - proper line height */
.hm-row,
.nrow,
.deal-card-body,
td {
  line-height: 1.45;
}

/* Keep IBM Plex Mono ONLY where it makes sense */
.brand-tag,
.status-pill,
.result-breadcrumb,
.data-timestamp,
.ltext,
.login-sub,
.filter-note,
.tbadge {
  font-family: var(--font-data);
}


/* ============================================================
   TYPOGRAPHY GOVERNANCE - ENTERPRISE DESIGN SYSTEM
   Single source of truth for all font decisions
   ============================================================ */

:root {
  --font-ui:      'DM Sans', sans-serif;
  --font-data:    'IBM Plex Mono', monospace;
  --font-display: 'Playfair Display', serif;
}

/* Font smoothing - crisp rendering on all screens */
body,
body * {
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering:          optimizeLegibility;
}

/* Remove Inter - revert all Inter assignments to tokens */
.hm-district,
.hm-pct,
.hm-header,
.hm-view-all,
.pulse-metric-value,
.stat-label,
.pulse-metric-label,
.pulse-category,
.confidence-label,
.plg-label,
.vri-label,
.verdict-title,
.hm-label,
.hml,
.ncat,
.ycat,
.hcard-cat,
.score-label,
.fg-label,
.filter-note-label,
.deal-cat,
.deal-discount-label,
.section-subtitle,
.hbadge,
.dp-label,
.card-action,
.filter-skip-btn,
.filter-skip-btn2 {
  font-family: var(--font-ui);
}

/* Data values stay on font-data token */
.brand-tag,
.status-pill,
.result-breadcrumb,
.data-timestamp,
.ltext,
.login-sub,
.filter-note,
.tbadge,
.tag,
.vri-value,
.dp-value,
.hmv,
.ydv,
.nlabels,
.confidence-value,
.pbc-meta-item .plg-value,
.rs-vals,
.rs-thumb {
  font-family: var(--font-data);
}

/* Display font token for hero/strategic elements */
.brand,
.flow-question,
.section-title,
.welcome-title,
.selection-title,
.verdict-price,
.stat-value,
.hm-insight-pct,
.hm-insight-pct,
.ypct,
.deal-discount,
.category-main-title,
.card-title,
.simulation-header h3,
.scenario-header h3 {
  font-family: var(--font-display);
}

/* Tabular figures - prevent layout jump on number change */
.stat-value,
.hm-stat-value,
.verdict-price,
.pulse-metric-value,
.hm-pct,
.heatmap-discount,
.deal-discount,
.confidence-value,
.vri-value,
.dp-value,
.hm-insight-pct,
.ypct,
.hmv,
.ydv,
.score-num,
.rs-vals {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* Mono line-height - prevent cramped data labels */
.vri-label,
.hm-label,
.stat-label,
.pulse-metric-label,
.dp-label,
.hml,
.plg-label,
.score-label {
  line-height: 1.5;
}

/* Weight governance */
.stat-value,
.verdict-price,
.verdict-price,
.hm-insight-pct { font-weight: 700; }

.pulse-metric-value,
.hm-pct,
.deal-discount   { font-weight: 700; }

.hm-view-all,
.card-action,
.filter-apply-btn { font-weight: 600; }

.stat-label,
.pulse-metric-label,
.confidence-label,
.hm-header        { font-weight: 500; }


/* ── DEFINITIVE pulse-metric-value - overrides all conflicts above ── */
.pulse-metric-value {
  font-family: var(--font-ui) !important;
  font-size: 28px !important;
  font-weight: 500 !important;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: 'tnum' !important;
  letter-spacing: -0.01em !important;
}


/* ── Section titles - Playfair restores institutional authority ── */
.section-title,
.dashboard-title,
.flow-question,
.welcome-title,
.selection-title,
.category-main-title,
.filter-heading {
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
}

/* Self-hosted trial fonts (not on Google Fonts) */
@font-face {
  font-family: 'AbdoJoodyBold';
  src: url('/static/fonts/abdo_joody_bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'AeAlYermook';
  src: url('/static/fonts/ae_alyermook_regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* Font trial - Arabic welcome-title only. Swap font-family value to test
   Beiruti / Zain / AbdoJoodyBold / AeAlYermook. English/.welcome-title in
   LTR mode is untouched. */
html[dir="rtl"] .welcome-title {
  font-family: 'Zain', 'Noto Sans Arabic', sans-serif !important;
  font-weight: 700 !important;
}
html[dir="rtl"] .card-title,
html[dir="rtl"] .mic-title {
  font-family: 'Beiruti', 'Noto Sans Arabic', sans-serif !important;
  font-weight: 700 !important;
}

/* ── Heatmap % values - Playfair (strategic insight metrics) ── */
.hm-stat-value {
  font-family: var(--font-ui) !important;
  font-variant-numeric: tabular-nums;
}

/* ── Heatmap count value - IBM Plex Mono (operational count) ── */
.hm-stat-count {
  font-family: var(--font-data) !important;
  font-weight: 500 !important;
  font-size: 28px !important;
  letter-spacing: -0.02em;
}

/* ── Rank numbers - enterprise format, not consumer circles ── */
.hm-rank {
  width: 32px;
  height: 24px;
  border-radius: 3px !important;
  border: 1px solid var(--border) !important;
  font-family: var(--font-data) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
  letter-spacing: 0.03em;
  background: transparent !important;
}

.hm-rank.hm-rank-top {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
  color: rgba(255,255,255,0.9) !important;
  border-radius: 3px !important;
}

/* ── Top opportunities - flat report strip, not widget card ── */
.hm-insight {
  background: transparent !important;
  border: none !important;
  border-top: 2px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 16px 4px !important;
}

.hm-insight-title {
  font-family: var(--font-data) !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: 0.12em !important;
  color: var(--green) !important;
  text-transform: uppercase !important;
}

.hm-insight-text {
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  color: var(--muted) !important;
}

/* ── View all - enterprise text link, not consumer button ── */
.hm-view-all,
.hm-view-all:hover {
  font-family: var(--font-data) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--navy) !important;
  padding: 16px 20px !important;
  border-top: 1px solid var(--border) !important;
  background: transparent !important;
}
@media (hover: hover) {
  .hm-view-all:hover {
    color: var(--gold) !important;
    transition: none !important;
  }
}
.hm-view-all:active {
  color: var(--gold) !important;
  transition: none !important;
}


/* ── Market Pulse - left-align for operational scanning ── */
.pulse-metric-item {
  text-align: left !important;
  padding: 16px !important;
}

.pulse-metric-value {
  text-align: left !important;
}

.pulse-metric-label {
  text-align: left !important;
}

.pulse-metric-trend {
  text-align: left !important;
}

/* Confidence value - data font, consistent with system */
.confidence-value {
  font-family: var(--font-data) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}


/* ── Heatmap final polish - locking as component standard ── */

/* 38% - reduce visual dominance, integrate with system */
.hm-insight-pct {
  font-size: 28px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
}

/* Row density - tighter for analytical feel */
.hm-row {
  padding: 8px 20px !important;
}

/* Green palette - muted mineral tones, less SaaS saturation */
.hm-fill[style*='#1a4d2e'] { filter: saturate(0.82); }
.hm-fill[style*='#1e5c35'] { filter: saturate(0.85); }
.hm-fill[style*='#2d7a4f'] { filter: saturate(0.88); }


/* ── Heatmap MoM trend column ──────────────────────────────────────────── */
.hm-header,
.hm-row {
  grid-template-columns: 52px 1fr 130px 80px !important;
}

.hm-trend-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hm-trend      { font-family: var(--font-data); font-size: 10px; font-weight: 600; }
.hm-trend-up   { color: #2d7a4f; }
.hm-trend-down { color: #b52b2b; }
.hm-trend-flat { color: var(--muted); }

/* ── Yield sub-metric ───────────────────────────────────────────────────── */
.hm-stat-yield {
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.04em;
  margin-top: 4px;
  text-transform: uppercase;
}

/* ── Data timestamp ─────────────────────────────────────────────────────── */
.hm-timestamp {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 8px 2px;
  margin-bottom: 4px;
}


/* ── Insight sub - align under percentage, not left edge ── */
.hm-insight-sub {
  text-align: right !important;
  max-width: 100px;
  line-height: 1.3;
  font-size: 10px !important;
}

.hm-insight-right {
  align-items: flex-start !important;
  text-align: left !important;
}


/* ── Insight sub - single line directly under % ── */
.hm-insight-sub {
  text-align: left !important;
  white-space: nowrap !important;
  max-width: none !important;
  font-size: 11px !important;
}


/* ── Insight right - wide enough to contain subtitle on one line ── */
.hm-insight-right {
  min-width: unset !important;
  align-items: flex-start !important;
  text-align: left !important;
}


/* ── Yield spread benchmark ─────────────────────────────────────────────── */
.hm-yield-spread {
  color: var(--green);
  opacity: 0.75;
  font-size: 9px;
  letter-spacing: 0.03em;
}

/* ── MoM column header with legend ─────────────────────────────────────── */
.hm-mom-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hm-mom-legend {
  font-size: 8px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.8;
  white-space: nowrap;
}


/* ── Tooltip system ─────────────────────────────────────────────────────── */
.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
  vertical-align: middle;
  line-height: 1;
  margin-left: 4px;
  flex-shrink: 0;
  position: relative;
}

.tip-icon:hover {
  opacity: 1;
  color: var(--navy);
}
html[dir="rtl"] .tip-icon svg {
  transform: scaleX(-1);
}

.tip-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: rgba(255,255,255,0.92);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 8px;
  width: 230px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  display: none;
  text-transform: none;
  letter-spacing: 0;
  pointer-events: none;
}

.tip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--navy);
}

.tip-popup.tip-visible {
  display: block;
}


/* ── Tooltip global (body-appended, escapes overflow) ── */
.tip-popup-global {
  background: var(--navy);
  color: rgba(255,255,255,0.92);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  pointer-events: none;
  text-transform: none;
  letter-spacing: 0;
}




/* ── Signal column - wide enough for picker button ── */
.hm-header,
.hm-row {
  grid-template-columns: 52px 1fr 130px 80px !important;
}



/* ── MoM header aligned with trend symbols below ── */
.hm-header span:last-child {
  text-align: center;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
}


/* ── Yield two-line layout ── */
.hm-stat-yield {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hm-yield-values {
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.03em;
}


/* ── Yield spread - secondary context, muted ── */
.hm-yield-values {
  font-family: var(--font-data) !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  color: var(--muted) !important;
  letter-spacing: 0.03em;
}


/* ================================================================
   MARKET PULSE V2 - Institutional Design
   ================================================================ */

.pulse-card-v2 {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

/* Centered header */
.pulse-header-v2 {
  display: none;
}

.pulse-city-v2 {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 0;
}

.pulse-subtitle-v2 {
  font-family: var(--font-data);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Three metric cards */
.pulse-metrics-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
}

.pulse-metric-v2 {
  background: var(--surface);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  position: relative;
}

.pulse-metric-top-v2 {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Circular icon */
.pulse-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.pulse-metric-v2:hover .pulse-icon-wrap {
  transform: scale(1.06);
}

/* Metric value inside v2 */
.pulse-metric-v2 .pulse-metric-value {
  font-family: var(--font-ui) !important;
  font-size: 28px !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Label row */
.pulse-metric-label-v2 {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Description text */
.pulse-metric-desc-v2 {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.pulse-metric-desc-v2.signal-opportunity { color: #16a34a; }
.pulse-metric-desc-v2.signal-moderate    { color: #d97706; }
.pulse-metric-desc-v2.signal-tight       { color: var(--muted); }
.pulse-metric-desc-v2.signal-hot         { color: #dc2626; }

/* Insight bar */
.pulse-insight-v2 {
  display: flex;
  align-items: center;
  gap: 0;
  background: #243550;
  padding: 12px 24px;
  position: relative;
  overflow: hidden;
}

.pulse-insight-v2::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 0;
  pointer-events: none;
}

.pulse-insight-icon-v2 {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.9);
}

.pulse-insight-divider-v2 {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  margin: 0 22px;
  flex-shrink: 0;
}

.pulse-insight-text-v2 {
  font-family: var(--font-ui);
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

/* Confidence footer */
.pulse-confidence-v2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.pulse-conf-icon-v2 {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}

@media (max-width: 700px) {
  .pulse-metrics-v2 { grid-template-columns: 1fr; }
  .pulse-city-v2 { font-size: 32px; }
}


/* ── Market Pulse V2 Polish ─────────────────────────────────────────────── */

/* 1. Description text always muted in V2 - no signal color override */
.pulse-metric-desc-v2,
.pulse-metric-desc-v2.signal-hot,
.pulse-metric-desc-v2.signal-moderate,
.pulse-metric-desc-v2.signal-tight,
.pulse-metric-desc-v2.signal-opportunity {
  color: var(--muted) !important;
  font-size: 13px !important;
}

/* 2. Label centered under icon+value row */
.pulse-metric-label-v2 {
  justify-content: center !important;
  text-align: center !important;
}

/* 3. Confidence HIGH/MODERATE/LOW - larger, colored */
.pulse-confidence-v2 .confidence-value {
  font-family: var(--font-data) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  min-width: auto !important;
}

/* 4. Deviation value - always navy (direction shown by icon) */
.pulse-metric-v2:first-child .pulse-metric-value {
  color: var(--navy) !important;
}

/* 5. Confidence label - navy, more prominent */
.pulse-confidence-v2 .confidence-label {
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--navy) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

/* 6. Insight icon - slightly larger */
.pulse-insight-icon-v2 {
  width: 52px !important;
  height: 52px !important;
}

.pulse-insight-icon-v2 svg {
  width: 24px !important;
  height: 24px !important;
}


/* ── Market Pulse V2 - Final Polish ────────────────────────────────────── */

/* 1. Title bigger */
.pulse-city-v2 {
  font-size: 58px !important;
}

/* 2. Metric values bigger */
.pulse-metric-v2 .pulse-metric-value {
  font-family: var(--font-ui) !important;
  font-size: 28px !important;
  font-weight: 500 !important;
}

/* 3. Absorption rate value - green */
.pulse-metric-v2:last-child .pulse-metric-value {
  color: var(--green) !important;
}

/* 4. Description text bigger */
.pulse-metric-desc-v2 {
  font-size: 14px !important;
  line-height: 1.6 !important;
}

/* 5. Confidence shield bigger */
.pulse-conf-icon-v2 {
  width: 44px !important;
  height: 44px !important;
}

.pulse-conf-icon-v2 svg {
  width: 18px !important;
  height: 18px !important;
}

/* 6. HIGH value larger and green */
.pulse-confidence-v2 .confidence-value {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--green) !important;
}

/* More breathing room in metric cards */
.pulse-metric-v2 {
  padding: 32px 28px !important;
}

/* Insight bar text slightly larger */
.pulse-insight-text-v2 {
  font-size: 15px !important;
}


/* ================================================================
   UNIFIED TYPE SCALE - Market Pulse + Heatmap
   Both sections on same page must share proportional sizing
   ================================================================ */

/* Card hero title */
.pulse-city-v2 {
  font-size: 48px !important;
}

/* Operational values (live signals - IBM Plex Mono) */
.pulse-metric-v2 .pulse-metric-value {
  /* font-size handled by final rule below */
  font-weight: 500 !important;
}

/* Strategic KPI values (summary - Playfair) */
.hm-stat-value {
  font-family: var(--font-ui) !important;
  font-size: 28px !important;
  font-weight: 500 !important;
}
/* Operational count (IBM Plex Mono - smaller than Playfair KPIs) */
.hm-stat-count {
  font-size: 28px !important;
  font-weight: 500 !important;
}

/* Unified label scale - both sections */
.pulse-metric-label-v2,
.hm-stat-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

/* Unified description/sub text - both sections */
.pulse-metric-desc-v2,
.hm-stat-sub {
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: var(--muted) !important;
}

/* Unified caption scale */
.pulse-subtitle-v2,
.hm-timestamp {
  font-size: 11px !important;
  letter-spacing: 0.1em !important;
}


/* ── Deviation icon - teal regardless of value (spec: pale blue/gray) ── */
.pulse-metric-v2:first-child .pulse-icon-wrap {
  background: #e8f2f5 !important;
  color: #2d6e7e !important;
}

/* ── Topographic background pattern on pulse card ── */
.pulse-card-v2 {
  position: relative;
}

.pulse-header-v2 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cg fill='none' stroke='%231a2744' stroke-opacity='0.04' stroke-width='1'%3E%3Ccircle cx='300' cy='300' r='50'/%3E%3Ccircle cx='300' cy='300' r='100'/%3E%3Ccircle cx='300' cy='300' r='150'/%3E%3Ccircle cx='300' cy='300' r='200'/%3E%3Ccircle cx='300' cy='300' r='250'/%3E%3Ccircle cx='300' cy='300' r='300'/%3E%3Ccircle cx='300' cy='300' r='350'/%3E%3Ccircle cx='300' cy='300' r='400'/%3E%3Ccircle cx='0' cy='0' r='100'/%3E%3Ccircle cx='0' cy='0' r='200'/%3E%3Ccircle cx='600' cy='600' r='100'/%3E%3Ccircle cx='600' cy='600' r='200'/%3E%3Ccircle cx='0' cy='600' r='150'/%3E%3Ccircle cx='600' cy='0' r='150'/%3E%3C/g%3E%3C/svg%3E") !important;
  background-size: 600px 600px !important;
  background-position: center !important;
}


/* ── KPI value color corrections ───────────────────────────────────────── */

/* Deviation (+15.0%) - navy, no signal color */
.pulse-metric-v2:first-child .pulse-metric-value {
  color: var(--navy) !important;
}

/* Absorption (33.3%) - navy, same as deviation */
.pulse-metric-v2:last-child .pulse-metric-value {
  color: var(--navy) !important;
}

/* Price Trend - MUST respect signal class (red/green/muted) */
.pulse-metric-v2:nth-child(2) .pulse-metric-value.trend-down { color: #dc2626 !important; }
.pulse-metric-v2:nth-child(2) .pulse-metric-value.trend-up   { color: #16a34a !important; }
.pulse-metric-v2:nth-child(2) .pulse-metric-value.trend-flat { color: var(--muted) !important; }

/* ── KPI block dividers - more visible ──────────────────────────────────── */
.pulse-metrics-v2 {
  gap: 1px !important;
  background: #d8d5ce !important;
}

.pulse-metric-v2 {
  border: none !important;
}


/* ── Icons fill circles properly ── */
.pulse-icon-wrap svg {
  width: 28px !important;
  height: 28px !important;
}


/* ── All 5 circle icons - larger fill ── */
.pulse-icon-wrap svg {
  width: 34px !important;
  height: 34px !important;
}

.pulse-insight-icon-v2 svg {
  width: 30px !important;
  height: 30px !important;
}

.pulse-conf-icon-v2 svg {
  width: 22px !important;
  height: 22px !important;
}


/* ── Center icon+value row to align with centered label below ── */
.pulse-metric-top-v2 {
  justify-content: center !important;
}


/* ── Revert full row centering ── */
.pulse-metric-top-v2 {
  justify-content: flex-start !important;
}

/* ── Value text centers over label - icon stays left ── */
.pulse-metric-top-v2 .pulse-metric-value {
  flex: 1 !important;
  text-align: center !important;
}


/* ── Value truly centered over label ──
   Grid: [icon 52px] [value 1fr] [spacer 52px]
   Center of value column = center of full card = center of label ── */
.pulse-metric-top-v2 {
  display: grid !important;
  grid-template-columns: 52px 1fr 52px !important;
  column-gap: 16px !important;
  align-items: center !important;
  justify-content: unset !important;
}

.pulse-metric-top-v2 .pulse-icon-wrap {
  grid-column: 1 !important;
}

.pulse-metric-top-v2 .pulse-metric-value {
  grid-column: 2 !important;
  text-align: center !important;
  flex: unset !important;
  margin-right: 0 !important;
}


/* ── pulse-city-v2 - recalibrated to page hierarchy ──
   Page title (Market Intelligence): 28px
   Card hero (Riyadh | Apartments): 36px = 1.28× - prominent in card, 
   not competing with page ── */
.pulse-city-v2 {
  font-size: 36px !important;
}


/* ── Three KPI cards as individual elevated white blocks ── */
.pulse-metrics-v2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 16px !important;
  padding: 24px !important;
  background: var(--bg) !important;
}

.pulse-metric-v2 {
  background: #ffffff !important;
  border-radius: 14px !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
  border-right: 1px solid var(--border) !important;
}

/* Remove old divider lines between cards */
.pulse-metric-v2:last-child {
  border-right: 1px solid var(--border) !important;
}


/* ── Insight bar in its own elevated block ── */
.pulse-insight-v2 {
  margin: 0 24px 24px 24px !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1) !important;
}


/* ── Mobile responsive - stack KPI cards vertically ── */
@media (max-width: 768px) {
  .pulse-metrics-v2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  .pulse-city-v2 {
    font-size: 28px !important;
  }

  .pulse-metric-v2 {
    padding: 20px 16px !important;
  }

  .pulse-insight-v2 {
    margin: 0 16px 16px 16px !important;
    padding: 16px !important;
  }

  .pulse-header-v2 {
    padding: 24px 16px 20px !important;
  }

  .pulse-confidence-v2 {
    padding: 14px 16px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .pulse-metric-top-v2 {
    grid-template-columns: 44px 1fr 44px !important;
  }
}


/* ── Metrics area background - pure white ── */
.pulse-metrics-v2 {
  background: #ffffff !important;
}


/* ── Data confidence footer - pure white ── */
.pulse-confidence-v2 {
  background: #ffffff !important;
}


/* ── Data confidence bar - mobile fix ── */
@media (max-width: 768px) {
  .pulse-confidence-v2 {
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 16px !important;
  }

  .pulse-confidence-v2 .confidence-label {
    flex-shrink: 0 !important;
  }

  .pulse-confidence-v2 .confidence-bar {
    width: 100% !important;
    flex: none !important;
    order: 3 !important;
    min-width: 0 !important;
    height: 6px !important;
  }

  .pulse-confidence-v2 .confidence-value {
    margin-left: auto !important;
  }

  .pulse-conf-icon-v2 {
    flex-shrink: 0 !important;
  }
}


/* ── All icons unified size ── */
.pulse-icon-wrap svg {
  width: 38px !important;
  height: 38px !important;
}

.pulse-insight-icon-v2 svg {
  width: 38px !important;
  height: 38px !important;
}

.pulse-conf-icon-v2 svg {
  width: 24px !important;
  height: 24px !important;
}


/* ── Insight icon - transparent circle with white border ── */
.pulse-insight-icon-v2 {
  background: transparent !important;
  border: 1.5px solid rgba(255,255,255,0.8) !important;
}

/* ── Insight divider - white ── */
.pulse-insight-divider-v2 {
  background: rgba(255,255,255,0.8) !important;
}


/* ── Insight bar - dot grid decoration (right side, fading in) ── */
.pulse-insight-v2 {
  overflow: hidden !important;
  position: relative !important;
}

.pulse-insight-v2::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 65%;
  background-image: radial-gradient(circle, rgba(82,183,200,0.35) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 60%);
  mask-image: linear-gradient(to right, transparent 0%, black 60%);
  pointer-events: none;
  z-index: 0;
}

/* Keep content above the dot pattern */
.pulse-insight-icon-v2,
.pulse-insight-divider-v2,
.pulse-insight-text-v2 {
  position: relative;
  z-index: 1;
}


/* ── DM Mono for pulse values - final override ── */
.pulse-card-v2 .pulse-metric-v2 .pulse-metric-value {
  font-family: 'DM Mono', monospace !important;
  /* font-size handled by final rule below */
  font-weight: 500 !important;
}


/* ── HIGH badge - bolder ── */
.pulse-confidence-v2 .confidence-value {
  font-weight: 800 !important;
  letter-spacing: 0.15em !important;
}

/* ── Topographic pattern - more visible ── */
.pulse-header-v2 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cg fill='none' stroke='%231a2744' stroke-opacity='0.09' stroke-width='1.2'%3E%3Ccircle cx='300' cy='300' r='50'/%3E%3Ccircle cx='300' cy='300' r='100'/%3E%3Ccircle cx='300' cy='300' r='150'/%3E%3Ccircle cx='300' cy='300' r='200'/%3E%3Ccircle cx='300' cy='300' r='250'/%3E%3Ccircle cx='300' cy='300' r='300'/%3E%3Ccircle cx='300' cy='300' r='350'/%3E%3Ccircle cx='300' cy='300' r='400'/%3E%3Ccircle cx='0' cy='0' r='100'/%3E%3Ccircle cx='0' cy='0' r='200'/%3E%3Ccircle cx='0' cy='0' r='300'/%3E%3Ccircle cx='600' cy='600' r='100'/%3E%3Ccircle cx='600' cy='600' r='200'/%3E%3Ccircle cx='600' cy='600' r='300'/%3E%3Ccircle cx='0' cy='600' r='150'/%3E%3Ccircle cx='0' cy='600' r='280'/%3E%3Ccircle cx='600' cy='0' r='150'/%3E%3Ccircle cx='600' cy='0' r='280'/%3E%3C/g%3E%3C/svg%3E") !important;
  background-size: 600px 600px !important;
  background-position: center !important;
}


/* ── KPI card - tip icon positioned top-right corner ── */
.pulse-metric-v2 {
  position: relative !important;
}

.pulse-metric-label-v2 .tip-icon {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  margin: 0 !important;
}


/* ── Header pattern - dot grid matching insight bar style ── */
.pulse-header-v2 {
  background-image:
    radial-gradient(circle, rgba(26,39,68,0.12) 1px, transparent 1px) !important;
  background-size: 18px 18px !important;
  background-position: center !important;
  background-color: #ffffff !important;
}


/* ── Metric values - larger ── */
.pulse-metric-v2 .pulse-metric-value {
  /* font-size handled by final rule below */
}

/* ── Metric labels - larger + closer to value ── */
.pulse-metric-label-v2 {
  font-size: 12px !important;
  margin-top: -6px !important;
  padding-bottom: 10px !important;
}


/* ── Data confidence icon - larger ── */
.pulse-conf-icon-v2 svg {
  width: 30px !important;
  height: 30px !important;
}


/* ── Mobile dropdown fix - wrap to 2x2 grid ── */
@media (max-width: 768px) {
  .header-right {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 0 16px 12px !important;
  }

  .explore-filter {
    width: 100% !important;
    font-size: 13px !important;
  }

  .dashboard-header,
  .explore-header {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
}


/* ── Confidence value - toned down ── */
.pulse-confidence-v2 .confidence-value {
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  color: var(--green) !important;
}

@keyframes toastIn {
  from { opacity:0; transform:translateX(-50%) translateY(10px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

.scope-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: #fffbf0;
  border: 1px solid #e8d48a;
  border-left: 4px solid #b8962e;
  border-radius: 8px;
  font-size: 13px;
  color: #6b4f0a;
  line-height: 1.55;
}
.scope-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #b8962e;
}
.scope-notice strong {
  color: #4a3500;
}

.modify-btn {
  background: transparent;
  border: 1px solid var(--border, #e4e1d9);
  color: var(--muted, #7a7870);
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  margin-left: 0;
}
.modify-btn:hover {
  border-color: var(--navy, #1a2744);
  color: var(--navy, #1a2744);
}

/* Back button when inside result nav - override standalone style */
.result-nav .back-btn {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  padding: 6px 13px;
  border: 1px solid var(--border, #e4e1d9);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.result-nav .back-btn:hover {
  border-color: var(--navy, #1a2744);
  color: var(--navy, #1a2744);
}



.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #e4e1d9);
}
.action-btn {
  flex: 1;
  min-width: 160px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border, #e4e1d9);
  background: var(--bg, #faf9f7);
  color: var(--text, #2a2820);
  transition: all 0.15s;
  text-align: center;
}
.action-btn:hover {
  border-color: var(--navy, #1a2744);
  background: var(--navy, #1a2744);
  color: #fff;
}
.action-btn.action-primary {
  background: var(--navy, #1a2744);
  color: #fff;
  border-color: var(--navy, #1a2744);
}
.action-btn.action-primary:hover {
  background: var(--gold, #b8962e);
  border-color: var(--gold, #b8962e);
}

.filter-loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg, #faf9f7);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.25s ease;
}
.filter-loading-overlay .flo-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border, #e4e1d9);
  border-top-color: var(--navy, #1a2744);
  border-radius: 50%;
  animation: floSpin 0.7s linear infinite;
}
.filter-loading-overlay .flo-text {
  font-size: 13px;
  color: var(--muted, #7a7870);
  font-family: inherit;
}
@keyframes floSpin {
  to { transform: rotate(360deg); }
}
.filter-wrap {
  position: relative;
}

.nav-action-btn {
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border, #e4e1d9);
  background: transparent;
  color: var(--muted, #7a7870);
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-action-btn:hover {
  border-color: var(--navy, #1a2744);
  color: var(--navy, #1a2744);
  background: transparent;
}
.nav-action-btn.nav-action-primary {
  border-color: var(--navy, #1a2744);
  color: var(--navy, #1a2744);
  font-weight: 600;
  background: transparent;
}
.nav-action-btn.nav-action-primary:hover {
  background: var(--navy, #1a2744);
  color: #fff;
  border-color: var(--navy, #1a2744);
}
#priceNavActions, #dealsNavActions {
  display: contents;
}

.result-breadcrumb {
  margin-left: auto;
}

.pdf-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--border, #e4e1d9);
  border-radius: 7px;
  background: transparent;
  color: var(--muted, #7a7870);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 14px;
  white-space: nowrap;
}
.pdf-inline-btn:hover {
  border-color: var(--navy, #1a2744);
  color: var(--navy, #1a2744);
}
.pdf-inline-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.fg-loading .fg-label::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--border, #e4e1d9);
  border-top-color: var(--navy, #1a2744);
  border-radius: 50%;
  animation: fgSpin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes fgSpin { to { transform: rotate(360deg); } }
.fg-loading select {
  opacity: 0.45;
  pointer-events: none;
}

.ilf-panel {
  background: var(--bg, #faf9f7);
  border: 1px solid var(--border, #e4e1d9);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}
.ilf-notice {
  border-bottom: 1px solid var(--border, #e4e1d9);
}
.ilf-notice .scope-notice {
  border-radius: 0;
  border: none;
  border-left: 4px solid #b8962e;
  margin: 0;
  padding: 10px 16px;
  font-size: 12px;
}
.ilf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border, #e4e1d9);
  background: var(--surface, #fff);
}
.ilf-arrow {
  font-size: 10px;
  margin-left: 6px;
  color: var(--muted, #7a7870);
  vertical-align: middle;
  transition: transform 0.2s;
}
.ilf-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, #1a2744);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ilf-meta {
  font-size: 11px;
  color: var(--muted, #7a7870);
}
.ilf-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ilf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ilf-row.ilf-row-range .rs-wrap {
  flex: 1;
  min-width: 0;
}
.ilf-row-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text, #2a2820);
  min-width: 90px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ilf-select {
  flex: 1;
  min-width: 160px;
  padding: 7px 10px;
  border: 1px solid var(--border, #e4e1d9);
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--text, #2a2820);
  cursor: pointer;
}
.ilf-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border, #e4e1d9);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--surface, #fff);
}
.ilf-apply-btn {
  padding: 8px 20px;
  background: var(--navy, #1a2744);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
@media (hover: hover) {
  .ilf-apply-btn:hover {
    background: var(--gold, #b8962e);
  }
}
.ilf-apply-btn.no-hover,
.ilf-apply-btn.no-hover:hover {
  background: var(--navy, #1a2744) !important;
  pointer-events: none;
}
.ilf-new-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border, #e4e1d9);
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  color: var(--muted, #7a7870);
  cursor: pointer;
  transition: all 0.15s;
}
.ilf-new-btn:hover {
  border-color: var(--navy, #1a2744);
  color: var(--navy, #1a2744);
}

.ilf-apply-btn.loading {
  opacity: 0.75;
  pointer-events: none;
  cursor: wait;
}
.ilf-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--border, #e4e1d9);
  border-top-color: var(--navy, #1a2744);
  border-radius: 50%;
  animation: fgSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 2px;
}

.dal-link {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
@media (hover: hover) {
  .dal-link:hover,
  .dal-link:focus {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.dal-link:active {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ilf-reset-link {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.ilf-reset-link:hover {
  opacity: 1;
}

.ilf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 10px;
  background: var(--bg, #faf9f7);
  color: var(--text, #2a2820);
  border: 1px solid var(--border, #e4e1d9);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.ilf-chip-x {
  background: none;
  border: none;
  color: var(--muted, #7a7870);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.ilf-chip-x:hover {
  color: var(--navy, #1a2744);
}

/* ── Market Intelligence Card ───────────────────────── */
.market-intel-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--navy);
  border-radius: 16px;
  padding: 22px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  margin-top: 16px;
  box-shadow: var(--shadow-hover);
}
.market-intel-card:hover {
  background: var(--navy2);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(26,39,68,0.22), 0 8px 16px rgba(26,39,68,0.14);
}
.market-intel-card:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.mic-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.mic-icon {
  color: var(--gold);
  display: flex;
  align-items: center;
}
.mic-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: rgba(184,150,46,0.18);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.mic-body {
  flex: 1;
}
.mic-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 4px;
}
.mic-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.60);
  margin: 0;
  line-height: 1.5;
}
.mic-cta {
  flex-shrink: 0;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mic-cta-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mic-cta-arrow {
  font-size: 15px;
  transition: transform 0.2s;
}
.market-intel-card:hover .mic-cta {
  opacity: 0.92;
}
.market-intel-card:hover .mic-cta-arrow {
  transform: translateX(4px);
}

/* ── Market Intel Card - responsive ────────────────── */
@media (max-width: 700px) {
  .market-intel-card {
    gap: 14px;
    padding: 16px 16px;
  }
  .mic-desc {
    display: none;
  }
  .mic-cta {
    padding: 8px 12px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .market-intel-card {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
  }
  .mic-left {
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }
  .mic-body {
    width: 100%;
  }
  .mic-desc {
    display: block;
    font-size: 12px;
  }
  .mic-cta {
    width: 100%;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
  }
}

/* ── Methodology disclaimer note ───────────────────── */
.methodology-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  padding: 8px 12px;
  border-left: 2px solid var(--border);
  margin-bottom: 16px;
  font-style: italic;
}

/* ── Tip icon on dark/navy backgrounds ─────────────── */
.strategy-box .tip-icon {
  border-color: rgba(255,255,255,0.6);
  color: rgba(255,255,255,0.6);
  opacity: 1;
}
.strategy-box .tip-icon:hover {
  border-color: #ffffff;
  color: #ffffff;
  opacity: 1;
}
.verdict-card .tip-icon {
  border-color: rgba(0,0,0,0.18);
  color: rgba(0,0,0,0.32);
  opacity: 1;
}
.verdict-card .tip-icon:hover {
  border-color: var(--navy);
  color: var(--navy);
  opacity: 1;
}
.vri-label .tip-icon {
  border-color: var(--muted);
  color: var(--muted);
  opacity: 0.7;
}
.vri-label .tip-icon:hover {
  border-color: var(--navy);
  color: var(--navy);
}


/* ══ PERSISTENT CONTEXT BAR ══ */
.ctx-bar {
  display: none;
  align-items: center;
  padding: 0 28px;
  height: 34px;
  background: #111827;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 210;
  letter-spacing: 0.02em;
  gap: 0;
  flex-shrink: 0;
}
.ctx-bar.ctx-on  { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctx-left        { display: flex; align-items: center; gap: 0; flex: 1; min-width: 0; overflow: hidden; }
.ctx-right       { display: flex; align-items: center; flex-shrink: 0; padding-left: 8px; }
.ctx-export-btn {
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 6px;
  align-self: center;
  color: #7a8fa6;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ctx-export-btn:hover { color: #d1dae8; }
.ctx-export-btn:active { color: #fff; }

/* ── Context bar responsive ── */
@media (max-width: 480px) {
  .ctx-bar { padding: 0 16px; font-size: 10.5px; }
  .ctx-sep { margin: 0 3px; }
  .ctx-crumb-btn { padding: 2px 6px; font-size: 10.5px; }
}
@media (max-width: 390px) {
  .ctx-bar { padding: 0 12px; font-size: 10px; }
  .ctx-sep { margin: 0 3px; }
  .ctx-crumb-btn { padding: 2px 6px; font-size: 10px; }
  .ctx-crumb-goal { display: none; }
  .ctx-crumb-goal + .ctx-sep { display: none; }
}
.ctx-crumb       { color: #cbd5e1; font-weight: 500; font-size: 11.5px; }
.ctx-sep         { margin: 0 4px; color: #2d3f55; font-size: 12px; line-height: 1; }
.ctx-month       { color: #64748b; font-size: 11px; font-family: 'DM Mono', monospace; letter-spacing: 0.03em; }

/* ══ VALUATION HERO NUMBER ══ */
.verdict-price {
  font-size: 36px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  line-height: 1 !important;
  color: var(--navy) !important;
  margin-bottom: 4px;
}
.verdict-price span {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--muted) !important;
  letter-spacing: 0 !important;
  margin-left: 5px;
}
.verdict-hero-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: #475569;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: 10px;
  margin-bottom: 4px;
}
/* ══ RESULT ACTION BAR ══ */
.result-action-bar {
  display: flex;
  gap: 8px;
  margin: 18px 0 2px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.rab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.65);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rab-btn:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.rab-btn-copy.copied {
  background: rgba(16,185,129,0.15);
  border-color: rgba(16,185,129,0.45);
  color: #34d399;
}
.verdict-card .rab-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--navy);
}
.verdict-card .rab-btn:hover {
  background: transparent;
  color: var(--navy);
  border-color: rgba(0,0,0,0.35);
}
.verdict-card .rab-btn:focus,
.verdict-card .rab-btn:focus-visible {
  outline: none;
  box-shadow: none;
  background: transparent;
}
.verdict-card .rab-btn-copy.copied {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.4);
  color: #059669;
}

/* ══ HOME SCREEN CARD - OUTCOME LANGUAGE ══ */
.card-description {
  font-size: 15px !important;
  line-height: 1.45 !important;
  font-weight: 500 !important;
  margin-bottom: 6px !important;
}
.card-description-sub {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 0;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
}
.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.01em;
  background: transparent;
  transition: background 0.18s, border-color 0.18s;
  box-sizing: border-box;
}
.valuation-card .card-action-btn {
  color: var(--navy);
  border: 1.5px solid rgba(26,39,68,0.22);
}
@media (hover: hover) {
  .valuation-card:hover .card-action-btn {
    background: rgba(26,39,68,0.06);
    border-color: rgba(26,39,68,0.38);
  }
}
.opportunities-card .card-action-btn {
  color: var(--gold);
  border: 1.5px solid rgba(184,150,46,0.28);
}
@media (hover: hover) {
  .opportunities-card:hover .card-action-btn {
    background: rgba(184,150,46,0.07);
    border-color: rgba(184,150,46,0.45);
  }
}

/* ══ FILTER PRIMARY / SECONDARY SPLIT ══ */
.secondary-filters-wrap { border-top: 1px dashed var(--border); padding-top: 4px; }

/* ══ SIMULATION MODAL DRAWER ══ */
#sim-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  justify-content: flex-end;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(3px);
  animation: simFadeIn 0.2s ease;
}
@keyframes simFadeIn { from { opacity:0; } to { opacity:1; } }
.sim-modal-drawer {
  width: min(580px, 100%);
  height: 100%;
  background: #faf9f7;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0,0,0,0.18);
  animation: simSlideIn 0.25s cubic-bezier(0.2,0,0,1);
}
@keyframes simSlideIn { from { transform:translateX(100%); } to { transform:translateX(0); } }
.smd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border, #e4e1d9);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}
.smd-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy, #1a2744);
}
.smd-meta {
  font-size: 11px;
  color: var(--muted, #7a7870);
  margin-top: 3px;
  font-family: 'DM Mono', monospace;
}
.smd-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border, #e4e1d9);
  background: transparent;
  font-size: 20px;
  color: var(--muted, #7a7870);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s;
}
.smd-close:hover { background: #f0f0f0; color: var(--navy, #1a2744); }
.smd-body { padding: 24px 28px; flex: 1; }
.smd-divider { border-top: 1px solid var(--border, #e4e1d9); margin: 24px 0; }
.smd-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy, #1a2744);
  margin-bottom: 14px;
}
/* ══ SIMULATION TRIGGER CARD ══ */
.sim-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  margin-top: 16px;
  background: linear-gradient(135deg, #1a2744 0%, #243461 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,39,68,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  user-select: none;
}
.sim-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,39,68,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
}
.sim-trigger:active { transform: translateY(0); }
.stc-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.stc-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  font-family: 'DM Sans', sans-serif;
}
.stc-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(255,255,255,0.8);
  flex-shrink: 0;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.sim-trigger:hover .stc-arrow {
  transform: translateX(3px);
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
}

/* ══ CLICKABLE DISTRICT CARDS ══ */
.stat-card-drill {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.stat-card-drill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.3) !important;
}
.stat-drill-hint {
  font-size: 10.5px;
  color: #10b981;
  margin-top: 6px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s;
}
.stat-card-drill:hover .stat-drill-hint { opacity: 1; }

/* ══ CLICKABLE HEATMAP ROWS ══ */
.hm-row-drill {
  cursor: pointer;
  transition: background 0.15s ease, padding-left 0.15s ease;
  border-radius: 6px;
  position: relative;
}
.hm-row-drill::after {
  content: '›';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transition: color 0.15s;
}
.hm-row-drill:hover {
  background: rgba(16,185,129,0.06);
  padding-left: 6px;
}
.hm-row-drill:hover::after,
.hm-row-drill:active::after { color: var(--green); }

/* ══ FILTER TYPE TOGGLE (replaces type selection screen) ══ */

.ftt-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #7a7870);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.ftt-pills { display: flex; gap: 10px; width: 100%; }
.ftt-pill {
  flex: 1;
  padding: 14px 24px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #e4e1d9);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy, #1a2744);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.ftt-pill:hover {
  border-color: var(--navy, #1a2744);
  background: rgba(26,39,68,0.04);
}
.ftt-pill.active {
  background: var(--navy, #1a2744);
  color: #fff;
  border-color: var(--navy, #1a2744);
}

.ftt-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--muted, #7a7870);
  margin-top: 10px;
  text-align: center;
  font-style: italic;
}

/* ── Verdict card metadata hierarchy ── */
.verdict-meta {
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
  line-height: 1.6;
}
.verdict-context {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.verdict-meta-sub {
  margin-top: 4px !important;
  padding-top: 0 !important;
  border-top: none !important;
}

/* ── hm-right consistent card widths ── */
.hm-right > * { box-sizing: border-box; width: 100%; }
@media (max-width: 700px) {
  .hm-table, .hm-map-placeholder, .hm-insight { width: 100%; box-sizing: border-box; }
  .explore-dashboard { padding: 16px 16px 60px; overflow-x: hidden; overflow-y: visible; }
}

/* ── Heatmap full-width constraints ── */
.hm-summary, .hm-table { box-sizing: border-box; width: 100%; }
@media (max-width: 700px) {
  .hm-wrapper, .hm-content, .hm-table, .hm-summary, .hm-right {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden;
  }

  .hm-insight { padding: 16px 16px; }
  .hm-insight-pct { font-size: 26px !important; }
  .hm-insight-right { flex-shrink: 0; }
}

@media (max-width: 700px) {
  .hm-insight {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .hm-insight-right {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    align-self: flex-start !important;
    text-align: left !important;
    width: 100% !important;
    gap: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 2px;
  }
  .hm-insight-pct { text-align: left !important; }
  .hm-insight-sub { text-align: left !important; }
  .hm-insight { align-items: flex-start !important; }
  .hm-insight-pct {
    font-size: 26px !important;
    line-height: 1 !important;
  }
  .hm-insight-sub {
    font-size: 12px;
    color: var(--muted);
  }
}
/* hm-insight-mobile-col */

/* ── Empty states ─────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 12px;
  margin: 8px 0;
}
.es-icon {
  font-size: 28px;
  opacity: 0.35;
  line-height: 1;
  margin-bottom: 2px;
}
.es-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.es-msg {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 320px;
}
.es-btn {
  margin-top: 6px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  border: 1.5px solid var(--navy);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.es-btn:hover { background: var(--navy); color: #fff; }
/* ─────────────────────────────────────────────────────────────── */

/* ── Switchable signal column ─────────────────────────────────── */
.hm-sig-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  min-width: 72px;
  transition: background 0.15s;
  user-select: none;
}
.hm-sig-picker-btn:hover { background: var(--border); }

.hm-sig-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
  min-width: 170px;
  z-index: 9999;
}
.hm-sig-opt {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.hm-sig-opt:last-child { border-bottom: none; }
.hm-sig-opt:hover { background: var(--bg); }
.hm-sig-opt-active .hm-sig-opt-label { color: var(--green); }
.hm-sig-opt-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
}
.hm-sig-opt-active .hm-sig-opt-label { color: var(--green); }
.hm-sig-opt-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-left: 1.2em;
}

/* Signal cell styles */
.hm-sig-strong { color: var(--green); font-weight: 700; letter-spacing: 1px; }
.hm-sig-mod    { color: var(--amber); font-weight: 700; letter-spacing: 1px; }
.hm-sig-weak   { color: var(--muted); font-weight: 700; letter-spacing: 1px; }
.hm-sig-val    { font-family: var(--font-data); font-size: 12px; color: var(--navy); font-weight: 600; }
/* ─────────────────────────────────────────────────────────────── */

/* ── Small phone heatmap table (<480px) ─────────────────────── */
@media (max-width: 480px) {
  .hm-header, .hm-row {
    grid-template-columns: 36px minmax(0,60px) 44px 1fr !important;
    padding: 10px 12px !important;
    font-size: 12px !important;
  }
  .hm-track { display: none !important; }
  .hm-bar-cell { justify-content: flex-end; }
  .hm-pct { width: auto !important; text-align: center !important; font-size: 12px !important; }
  .hm-district { max-width: 100%; }
  .hm-header { column-gap: 20px !important; }
  .hm-row { column-gap: 20px !important; }
  .hm-header span:nth-child(3) { text-align: center; overflow: hidden; white-space: nowrap; font-size: 0; }
  .hm-header span:nth-child(3)::before { content: attr(data-short); font-size: 12px; }
}
/* ─────────────────────────────────────────────────────────────── */

/* ── District context card ────────────────────────────────────── */
.district-context-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.dcc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dcc-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-family: var(--font-data);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.dcc-district {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.dcc-rank {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.dcc-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 4px;
}
.dcc-badge-strong { background: rgba(16,185,129,0.1); color: var(--green); }
.dcc-badge-mod    { background: rgba(245,158,11,0.1);  color: var(--amber); }
.dcc-badge-weak   { background: rgba(239,68,68,0.1);   color: var(--red); }
.dcc-why {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.65;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.scope-chip {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
}
/* ─────────────────────────────────────────────────────────────── */

/* ══════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR
   ══════════════════════════════════════════════════════════════ */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #07121d;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: stretch;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(0);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
#bottom-nav.bn-hidden {
  transform: translateY(110%);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  position: relative;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border-radius: 0;
  padding: 8px 0 6px;
  box-sizing: border-box;
}
.bn-item:active { background: rgba(255,255,255,0.04); }
.bn-item.active {
  background: rgba(74,222,128,0.06);
}
html[dir="rtl"] .bn-item {
  gap: 0px;
}
html[dir="rtl"] .bn-label {
  font-family: 'Beiruti', 'Noto Sans Arabic', sans-serif !important;
  letter-spacing: normal !important;
}
.bn-dot {
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 2.5px;
  background: #4ade80;
  border-radius: 0 0 4px 4px;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.bn-item.active .bn-dot { opacity: 1; }
.bn-icon {
  width: 18px;
  height: 18px;
  margin-top: 5px;
  color: rgba(255,255,255,0.52);
  stroke: currentColor;
  flex-shrink: 0;
  transition: color 0.2s;
}
.bn-label {
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.52);
  font-family: var(--font-ui);
  transition: color 0.2s;
}
.bn-item.active .bn-icon { color: #4ade80; font-size: 18px; }
.bn-item.active .bn-label { color: #4ade80; letter-spacing: 0.11em; }
.bn-item.disabled {
  pointer-events: none;
  opacity: 0.2;
}
.bn-divider {
  width: 1px;
  background: rgba(255,255,255,0.05);
  margin: 18px 0;
  flex-shrink: 0;
}

/* Content padding so nothing hides behind bar */
#screen-price-result,
#screen-deals-result,
#screen-explore {
  padding-bottom: 76px;
}
/* ══════════════════════════════════════════════════════════════ */

/* ── Explore screen loader ──────────────────────────────────── */
.explore-loader {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.explore-loader.fading { opacity: 0; pointer-events: none; }
/* ─────────────────────────────────────────────────────────────── */

/* ── PLG row mobile stack ── */
@media (max-width: 480px) {
  .plg-row { flex-direction: column; gap: 10px; }
  .plg-right { text-align: left; }
}

/* ── Bedroom Box Plot ─────────────────────────────────────── */
.bp-row {
  display: grid;
  grid-template-columns: 52px 1fr 48px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.bp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-data);
  text-align: right;
}
.bp-track-wrap { position: relative; height: 20px; }
.bp-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0; right: 0;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: visible;
}
.bp-box {
  position: absolute;
  top: 0; height: 100%;
  background: var(--navy);
  opacity: 0.15;
  border-radius: 2px;
}
.bp-median {
  position: absolute;
  top: -4px;
  width: 2.5px;
  height: 14px;
  background: var(--green);
  border-radius: 2px;
  transform: translateX(-50%);
}
.bp-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  font-family: var(--font-data);
}
.bp-axis {
  display: flex;
  justify-content: space-between;
  padding: 6px 0 4px 62px;
  font-size: 9.5px;
  color: var(--muted);
  font-family: var(--font-data);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.bp-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 10px;
  padding-left: 62px;
}
.bp-lgbox {
  display: inline-block;
  width: 14px; height: 8px;
  background: var(--navy);
  opacity: 0.15;
  border-radius: 2px;
}
.bp-lgmed {
  display: inline-block;
  width: 3px; height: 12px;
  background: var(--green);
  border-radius: 2px;
}
.bp-row-active .bp-label,
.bp-label-sel { color: var(--green) !important; font-weight: 700 !important; }
.bp-row-dimmed { opacity: 0.35; }
.bp-box-active { background: var(--green) !important; opacity: 0.25 !important; }
.bp-median-active { background: var(--green) !important; width: 3px !important; height: 18px !important; top: -6px !important; }
.bp-value-active { color: var(--green) !important; font-size: 12px !important; }
.bp-row-active .bp-track { background: rgba(26,107,71,0.12) !important; }
/* ─────────────────────────────────────────────────────────── */

/* ── pm2 card active/dimmed - mirrors bp-row-active exactly ─── */
.pm2-label-active { color: var(--green) !important; font-weight: 700 !important; }
.pm2-value-active { color: var(--green) !important; font-size: 12px !important; }
.pm2-bar-active   { background: var(--green) !important; opacity: 0.25 !important; }
.pm2-track-active { background: rgba(26,107,71,0.12) !important; }
.pm2-row-dimmed   { opacity: 0.35; }
/* ─────────────────────────────────────────────────────────────── */

/* ── Investment Simulation Redesign ───────────────── */
.sim-signal-bar{display:flex;flex-wrap:wrap;gap:12px 24px;background:rgba(16,185,129,0.06);border:1px solid rgba(16,185,129,0.2);border-radius:8px;padding:12px 16px;margin-bottom:20px;}
.ssb-item{display:flex;flex-direction:column;gap:2px;}
.ssb-label{font-size:10px;color:var(--muted);font-weight:500;text-transform:uppercase;letter-spacing:0.04em;}
.ssb-val{font-size:13px;font-weight:700;color:var(--navy);}
.ssb-val.green{color:var(--green);}
.sim-section{margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid var(--border);}
.sim-section:last-of-type{border-bottom:none;margin-bottom:0;}
.sim-section-title{font-size:10px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:12px;}
.sim-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.sim-field{display:flex;flex-direction:column;gap:5px;}
.sim-field.wide{grid-column:1/-1;}
.sim-label{font-size:11px;color:var(--muted);font-weight:500;line-height:1.4;}
.sim-input{border:1px solid var(--border);border-radius:6px;padding:8px 10px;font-size:13px;font-family:inherit;color:var(--navy);background:#fff;width:100%;box-sizing:border-box;transition:border-color 0.15s;}
.sim-input:focus{outline:none;border-color:var(--green);}
.sim-input-row{display:flex;align-items:center;gap:6px;}
.sim-input-row .sim-input{flex:1;}
.sim-unit{font-size:12px;color:var(--muted);flex-shrink:0;}
.sim-toggle-row{display:flex;gap:6px;}
.sim-tab{padding:6px 16px;border:1px solid var(--border);border-radius:6px;background:#fff;font-size:12px;font-weight:500;color:var(--muted);cursor:pointer;transition:all 0.15s;}
.sim-tab.active{background:var(--navy);color:#fff;border-color:var(--navy);font-weight:600;}
.sim-tab:hover:not(.active){border-color:var(--navy);color:var(--navy);}
.sim-regulatory-note{font-size:10px;color:var(--muted);line-height:1.5;margin-top:10px;padding:7px 10px;background:rgba(0,0,0,0.03);border-radius:5px;}
.sim-acq-summary{margin-top:8px;min-height:20px;}
.sim-run-btn{width:100%;padding:13px;background:var(--navy);color:#fff;border:none;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;letter-spacing:0.02em;transition:background 0.15s;margin-top:4px;}
.sim-run-btn:hover{background:#0f1e3d;}
.sim-run-btn:disabled{opacity:0.6;cursor:not-allowed;}
.sim-disclaimer{margin-top:16px;padding:10px 12px;background:rgba(0,0,0,0.03);border-radius:6px;font-size:10px;color:var(--muted);line-height:1.6;}



/* ─── Interactive ctx crumbs ─────────────────────────────── */
.ctx-crumb-btn {
  cursor: pointer;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 9px 2px;
  align-self: center;
  border-radius: 6px;
  color: #d1dae8;
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.ctx-crumb-btn:hover { background: rgba(255,255,255,0.13); color: #fff; border-color: rgba(255,255,255,0.18); }
.ctx-crumb-btn:active { background: rgba(255,255,255,0.18); }
html[dir="rtl"] .ctx-crumb-btn {
  font-family: 'Beiruti', 'Noto Sans Arabic', sans-serif !important;
  letter-spacing: normal !important;
  line-height: 15px !important;
}
html[dir="rtl"] .ctx-crumb-btn .ctx-chevron {
  line-height: 15px !important;
}
.ctx-chevron { font-size: 13px; opacity: 0.65; flex-shrink: 0; align-self: center; line-height: 1; }

/* ─── Ctx popover ─────────────────────────────────────────── */
.ctx-pop {
  position: fixed;
  background: #1a2437;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 6px;
  z-index: 9999;
  min-width: 160px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  animation: ctxPopIn 0.13s ease;
}
@keyframes ctxPopIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.ctx-pop-item {
  position: relative;
  padding: 9px 12px 9px 30px;
  border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #7d8fa8;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  background: transparent;
}
.ctx-pop-item:hover { background: #22304a; color: #c8d4e3; }
.ctx-pop-item.ctx-pop-on { color: #e8eef7; font-weight: 600; background: #1e2d43; }
.ctx-pop-item.ctx-pop-on::before {
  content: '✓';
  position: absolute;
  left: 11px;
  font-size: 10px;
  color: #10b981;
  top: 50%;
  transform: translateY(-50%);
}
html[dir="rtl"] .ctx-pop-item {
  font-family: 'Beiruti', 'Noto Sans Arabic', sans-serif !important;
}

/* Hide explore header dropdowns and title - crumbs handle this now */
#screen-explore .header-right { display: none !important; }
#screen-explore .dashboard-title { display: none; }
#screen-explore .dashboard-header { display: none; }

/* ─── Pulse header mobile fix ─────────────────────────── */
@media (max-width: 480px) {
  .pulse-header-v2 {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 12px 16px;
  }
  .pulse-city-v2 { font-size: 15px; }
  .pulse-subtitle-v2 { font-size: 10px; letter-spacing: 0.08em; }
}

/* -- AUTH MODAL -- */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,16,48,0.72);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: authFadeIn 0.2s ease;
}
.auth-overlay.open { display: flex; }
@keyframes authFadeIn { from { opacity:0; } to { opacity:1; } }

.auth-card {
  display: flex;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 840px;
  margin: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 64px rgba(8,16,48,0.28);
  animation: authSlideUp 0.25s ease;
  max-height: 90vh;
  max-height: calc(var(--vh, 1vh) * 90);
}
@keyframes authSlideUp { from { transform:translateY(16px); opacity:0; } to { transform:translateY(0); opacity:1; } }

.auth-left {
  flex: 0 0 400px;
  position: relative;
  overflow: hidden;
  min-height: 540px;
  background: #040c28;
}
.auth-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.auth-left-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(4,12,40,0.62) 0%, rgba(4,12,40,0.38) 60%, rgba(4,12,40,0.55) 100%);
  z-index: 1;
}
.auth-left-inner {
  position: relative;
  z-index: 2;
  padding: 40px 36px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 540px;
  box-sizing: border-box;
}
.auth-left-logo {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -1px;
}
.auth-left-logo span { color: var(--gold); }
.auth-left-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.auth-left-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.7;
  margin-bottom: 22px;
}
.auth-left-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-left-pills span {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}
.auth-right {
  flex: 1;
  padding: 40px;
  position: relative;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 1;
}
.auth-close:hover { background: var(--surface); color: var(--navy); }
.auth-right-brand {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.auth-right-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.auth-right-pills span {
  background: rgba(10,20,60,0.06);
  border: 1px solid rgba(10,20,60,0.12);
  color: var(--navy);
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}
.auth-left-logo {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}
.auth-left-logo span { color: var(--gold); }
.auth-left-sub {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.auth-left-tagline {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 500;
  line-height: 1.6;
}
@media (max-width: 680px) {
  .auth-left { display: none; }
  .auth-card { max-width: 420px; }
}

.topbar-signin {
  white-space: nowrap;
  background: var(--navy);
  color: #fff;
  border: none;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  display: none;
}
.topbar-signin:hover { background: var(--navy2); }

/* -- EMAIL VERIFICATION SCREEN -- */
.verify-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  min-height: calc(var(--vh, 1vh) * 100 - 56px);
  padding: 40px 24px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  gap: 16px;
}
.verify-icon {
  line-height: 1;
  margin-bottom: 8px;
  color: var(--navy);
  display: flex;
  justify-content: center;
}
.verify-icon svg {
  width: 56px;
  height: 56px;
}
.verify-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.verify-sub {
  font-size: 15px;
  color: var(--muted);
  font-family: var(--font-ui);
  line-height: 1.7;
  margin: 0;
}
.verify-note {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-ui);
  margin-top: 8px;
}

/* -- TOPBAR MENU -- */
.topbar-menu {
  position: relative;
}
.topbar-menu-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
}
.topbar-menu-btn:hover { background: rgba(255,255,255,0.1); }
.topbar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(8,16,48,0.14);
  min-width: 200px;
  overflow: hidden;
  z-index: 10001;
}
.topbar-dropdown.open { display: block; }
.topbar-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s;
}
.topbar-dd-item:hover { background: var(--surface); }
.topbar-dd-item svg { flex-shrink: 0; color: var(--muted); }
.topbar-dd-divider { height: 1px; background: var(--border); margin: 2px 0; }
.topbar-dd-signout { color: #dc2626; }
.topbar-dd-signout svg { color: #dc2626; }
@media (hover: hover) { .topbar-dd-signout:hover { background: #fef2f2; } }



/* -- UPGRADE MODAL -- */
.upgrade-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  margin: 16px;
  padding: 32px 24px;
  position: relative;
  box-shadow: 0 24px 64px rgba(8,16,48,0.22);
  animation: authSlideUp 0.25s ease;
  text-align: center;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.upgrade-icon {
  font-size: 40px;
  margin-bottom: 16px;
}
#survey-q1-modal, #survey-q2-modal {
  z-index: 9500;
}
.survey-card {
  text-align: left;
  max-width: 460px;
}
html[dir="rtl"] .survey-card {
  text-align: right;
}
.survey-card .acct-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  margin-top: 8px;
  text-align: left;
}
html[dir="rtl"] .survey-card .acct-title {
  text-align: right;
}
.survey-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.survey-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.survey-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.survey-option:hover {
  border-color: var(--gold);
  background: rgba(184,150,46,0.04);
}
.survey-option input {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--gold);
  width: 17px;
  height: 17px;
}
.survey-option-text {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.4;
}
.survey-option-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.survey-other-text {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 12px;
}
.survey-submit-btn {
  width: 100%;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.survey-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.upgrade-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.upgrade-desc {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-ui);
  line-height: 1.6;
  margin-bottom: 24px;
}
.upgrade-features {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upgrade-feat {
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--navy);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.uf-check {
  color: #059669;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* -- ACCOUNT SETTINGS MODAL -- */
.acct-card {
  text-align: left;
  max-width: 480px;
  padding: 28px 28px 32px;
}
.acct-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}
.acct-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}
.acct-tab {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.acct-tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}
.acct-field {
  margin-bottom: 18px;
}
.acct-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.acct-input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  box-sizing: border-box;
}
.acct-input:focus {
  outline: none;
  border-color: var(--navy);
}
.acct-input:-webkit-autofill,
.acct-input:-webkit-autofill:hover,
.acct-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--navy);
  box-shadow: 0 0 0 1000px #fff inset;
}
.acct-value {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--navy);
}
.acct-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.acct-badge-verified {
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
}
.acct-badge-unverified {
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
}
.acct-btn {
  width: 100%;
  margin-top: 8px;
}
.acct-err {
  font-family: var(--font-ui);
  font-size: 12px;
  color: #b91c1c;
  margin-bottom: 8px;
  min-height: 16px;
}
.acct-ok {
  font-family: var(--font-ui);
  font-size: 12px;
  color: #059669;
  margin-bottom: 8px;
}
.acct-plan-badge {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.acct-plan-badge.free {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.acct-plan-badge.pro {
  background: var(--gold);
  color: #fff;
  letter-spacing: 0.06em;
}
.acct-plan-desc {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.acct-sub-rows {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 16px;
  margin-bottom: 20px;
}
.acct-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 13px;
}
.acct-sub-row:last-child { border-bottom: none; }
.acct-sub-label { color: var(--muted); }
.acct-sub-val { color: var(--navy); font-weight: 500; }
.acct-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 6px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
}
.acct-status-pill.active {
  background: #dcfce7;
  color: #15803d;
}
.acct-status-pill.cancelled {
  background: #fef9c3;
  color: #854d0e;
}
.acct-status-pill svg {
  flex-shrink: 0;
}
.acct-renewal-notice {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.acct-cancel-link {
  font-family: var(--font-ui);
  font-size: 12px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  margin-top: 4px;
}
@media (hover: hover) {
  .acct-cancel-link:hover,
  .acct-cancel-link:focus {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.acct-cancel-link:active {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.acct-cancel-confirm {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
}
.acct-cancel-msg {
  font-family: var(--font-ui);
  font-size: 13px;
  color: #7f1d1d;
  line-height: 1.5;
}

/* -- PRICING MODAL -- */
.pricing-card {
  text-align: left;
  max-width: 440px;
  padding: 32px 28px;
}
html[dir="rtl"] .pricing-card {
  text-align: right;
}
.pricing-v3-sub {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
  margin-top: -8px;
}
.pricing-divider {
  border-top: 1px solid var(--border);
  margin: 18px 0 16px;
}
.pricing-badge {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 10px;
}
.pricing-headline {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 20px;
}
.pricing-features {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pricing-feat {
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--navy);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pricing-price {
  font-family: var(--font-data);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.pricing-currency {
  font-size: 18px;
  font-weight: 600;
}
.pricing-period {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}
.pricing-sub {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.pricing-paypal-btn {
  width: 100%;
  margin-bottom: 8px;
}
.pricing-trust {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 16px;
}
.pricing-maybe {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}
.pricing-maybe:hover,
.pricing-maybe:focus {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-style: dotted;
}
.pricing-currency-note {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.pricing-currency-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.pricing-currency-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.pricing-currency-label {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
}
.pricing-currency-sar {
  font-family: var(--font-data);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.pricing-currency-usd {
  font-family: var(--font-data);
  font-size: 15px;
  font-weight: 700;
  color: #059669;
}
.pricing-currency-loading {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.pricing-currency-divider {
  border-top: 1px solid var(--border);
  margin: 8px 0;
}
.pricing-currency-rate {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}
.pricing-currency-disclaimer {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}
.pricing-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: pricingSpin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes pricingSpin {
  to { transform: rotate(360deg); }
}
.pricing-loading-text {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.5;
}
.pricing-loading-sub {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.pricing-reopen {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* -- COMMUNICATION MODAL -- */
.comm-trigger-row {
  margin-top: 14px;
  text-align: left;
}
.comm-trigger {
  font-family: var(--font-data);
  font-size: 11px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.04em;
}
@media (hover: hover) {
  .comm-trigger:hover,
  .comm-trigger:focus {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.comm-trigger:active {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.comm-card {
  text-align: left;
  max-width: 440px;
}
.comm-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.3;
}
.comm-sub {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.comm-identity {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.comm-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.comm-chip {
  flex: 1;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.comm-chip.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.comm-context-strip {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.comm-context-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.comm-message {
  width: 100%;
  min-height: 96px;
  max-height: 160px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.comm-message:focus {
  outline: none;
  border-color: var(--navy);
}
.comm-attach-row {
  margin-bottom: 14px;
}
.comm-attach-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
@media (hover: hover) {
  .comm-attach-btn:hover,
  .comm-attach-btn:focus {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.comm-attach-btn:active {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.comm-email-row {
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.comm-email-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.comm-email-input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  box-sizing: border-box;
}
.comm-email-input:focus {
  outline: none;
  border-color: var(--navy);
}
.comm-email-helper {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.comm-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.comm-send-btn {
  width: auto;
  padding: 11px 26px;
  font-size: 14px;
  margin-left: auto;
}
@media (max-width: 480px) {
  .comm-footer-row { justify-content: flex-end; }
}

@keyframes commShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

#screen-home .comm-trigger-row {
  text-align: center;
  margin-top: 28px;
}
.upgrade-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  margin-bottom: 12px;
}
.upgrade-btn:hover { background: var(--navy2); }
.upgrade-sub {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-ui);
}

/* -- TIER LOCK -- */
.tier-lock {
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tier-lock-badge {
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.tier-lock-link {
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
@media (hover: hover) {
  .tier-lock-link:hover,
  .tier-lock-link:focus {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
  }
}
.tier-lock-link:active {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ilf-district-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--muted);
  padding: 6px 0;
}

/* -- FILTER ATTRIBUTE LOCK -- */
.filter-attr-lock {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}
.filter-attr-lock-preview {
  filter: blur(3px);
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  max-height: 180px;
  overflow: hidden;
}
.filter-attr-lock-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}
.filter-attr-lock-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.filter-attr-lock-desc {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.ilf-attr-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--muted);
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* -- SIGNALS TEASER (free tier) -- */
.signals-teaser {
  max-width: 600px;
  margin: 0 auto;
  padding: 32px 24px;
  text-align: center;
}
.signals-teaser-header {
  margin-bottom: 28px;
}
.signals-teaser-count {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -2px;
}
.signals-teaser-label {
  font-size: 15px;
  color: var(--muted);
  font-family: var(--font-ui);
  margin-top: 8px;
}
.signals-teaser-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}
.signals-teaser-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.stc-blur {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stc-district {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
}
.stc-cat {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-data);
}
.stc-badge {
  background: rgba(5,150,105,0.1);
  color: #059669;
  font-size: 12px;
  font-family: var(--font-data);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.signals-teaser-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}
.signals-teaser-cta-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.signals-teaser-cta-desc {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-ui);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* -- SIGNALS TEASER V2 -- */
.st-active-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(5,150,105,0.06);
  border: 1px solid rgba(5,150,105,0.15);
  border-radius: 8px;
  margin-bottom: 20px;
}
.st-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #059669;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:0.4; transform:scale(0.8); }
}
.st-active-text {
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--navy);
}
.st-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.st-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.st-card-label {
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.st-card-value {
  margin-bottom: 8px;
}
.st-blurred {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.st-verdict-shape {
  display: inline-block;
  background: #059669;
  color: #fff;
  font-size: 12px;
  font-family: var(--font-ui);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
}
.st-district-shape {
  display: inline-block;
  font-size: 15px;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--navy);
}
.st-gap-shape {
  display: inline-block;
  font-size: 22px;
  font-family: var(--font-display);
  font-weight: 700;
  color: #059669;
}
.st-card-lock {
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--muted);
}
@media (max-width: 520px) {
  .st-cards { grid-template-columns: 1fr; }
}

/* -- LOCKED INSIGHT CARD -- */
.insight-locked {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}
.insight-lock-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.insight-lock-body {
  flex: 1;
}
.insight-lock-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.insight-lock-desc {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

/* -- PRICE BLUR (free tier) -- */
.price-blur {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}
.price-blur-inner {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.price-blur-lock {
  background: var(--gold);
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-ui);
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  cursor: pointer;
}

/* -- CHART LOCK OVERLAY -- */
.chart-lock-overlay {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin: 8px 0;
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--muted);
}

/* -- PRO badge size fix inside large price elements -- */
.verdict-price .price-blur-lock,
.verdict-price .price-blur .price-blur-lock {
  font-size: 9px !important;
  font-family: var(--font-ui) !important;
  font-weight: 700 !important;
  color: var(--navy) !important;
  background: var(--gold) !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  letter-spacing: 0.05em !important;
  vertical-align: middle !important;
  position: relative !important;
  top: -2px !important;
  line-height: 1 !important;
}

#upgrade-modal.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px;
  overflow: hidden;
}


/* ── FINAL: pulse metric value font size ── */
.pulse-metric-v2 .pulse-metric-value {
  /* font-size handled by final rule below */
}
@media (max-width: 900px) {
  .pulse-metric-v2 .pulse-metric-value {
  /* font-size handled by final rule below */
  }
}
@media (max-width: 600px) {
  .pulse-metric-v2 .pulse-metric-value {
  /* font-size handled by final rule below */
  }
}


/* ── Filter screen as centered modal overlay ── */
#screen-filter {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,16,48,0.72);
  z-index: 9000;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}
#screen-filter.active {
  display: flex;
}
#screen-filter.active {
  display: flex !important;
  min-height: unset !important;
  background: rgba(8,16,48,0.72) !important;
}
#screen-filter .filter-wrap {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 24px 64px rgba(8,16,48,0.22);
  padding: 32px 24px !important;
  position: relative;
  margin: 16px !important;
  animation: authSlideUp 0.25s ease;
}

/* ── Filter footer inside modal ── */
#screen-filter.active .filter-footer {
  position: static;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding: 16px 0 0;
  background: transparent;
  z-index: auto;
}


/* ============================================================
   ARABIC / RTL FOUNDATION
   ============================================================ */

/* Language toggle button */
.topbar-lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-ui);
  letter-spacing: 0.08em;
  margin-right: 6px;
  transition: all 0.15s;
  line-height: 1;
  height: 28px;
}
.topbar-lang-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.topbar-lang-btn-svg {
  padding: 3px;
  width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
}
.topbar-lang-btn-svg:hover {
  background: transparent;
  border: none;
}
.topbar-lang-btn-svg svg { display: block; }
.topbar-lang-btn-svg .lang-highlight-box {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 0.15s, stroke 0.15s;
}
.topbar-lang-btn-svg .lang-highlight-box.active {
  fill: var(--gold);
}
#langDropdownItem svg { flex-shrink: 0; }
#langDropdownItem .lang-highlight-box-dd {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 0.15s, stroke 0.15s;
}
#langDropdownItem .lang-highlight-box-dd.active {
  fill: var(--gold);
}

/* RTL base — applied to <html> element */
html[dir="rtl"] {
  font-family: 'Noto Sans Arabic', var(--font-ui), sans-serif;
}

html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  font-family: 'Noto Sans Arabic', var(--font-ui), sans-serif;
}

/* Topbar RTL — mirror layout */
html[dir="rtl"] .topbar {
  direction: rtl;
}
html[dir="rtl"] .topbar-right {
  margin-left: 0;
  margin-right: auto;
  direction: rtl;
}
html[dir="rtl"] .brand-logo {
  margin-right: 0;
  margin-left: auto;
}
html[dir="rtl"] .topbar-lang-btn {
  margin-right: 0;
  margin-left: 6px;
}
[dir="rtl"] .topbar-dropdown {
  left: 0;
  right: auto;
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .topbar-dd-item {
  direction: rtl;
  text-align: right;
}

/* Bottom nav RTL */
html[dir="rtl"] .bottom-nav {
  direction: rtl;
}

/* Screens RTL */
html[dir="rtl"] .screen {
  direction: rtl;
  text-align: right;
}

/* Form fields RTL */
html[dir="rtl"] .acct-input,
html[dir="rtl"] .auth-input {
  text-align: right;
  direction: rtl;
}

/* Flip left/right padding on cards */
html[dir="rtl"] .acct-sub-row {
  flex-direction: row;
  direction: rtl;
}
html[dir="rtl"] .acct-sub-label {
  text-align: right;
}
html[dir="rtl"] .acct-sub-val {
  text-align: left;
}

/* Back arrows flip */
.pricing-currency-ar, .pricing-cardbadge-ar { display: none !important; }
html[dir="rtl"] .pricing-currency-en, html[dir="rtl"] .pricing-cardbadge-en { display: none !important; }
html[dir="rtl"] .pricing-currency-ar, html[dir="rtl"] .pricing-cardbadge-ar { display: inline !important; }
html[dir="rtl"] .pricing-maybe {
  direction: ltr;
}

/* Modals RTL */
html[dir="rtl"] .modal-overlay,
html[dir="rtl"] .auth-overlay {
  direction: rtl;
  text-align: right;
}

/* Auth modal inputs */
html[dir="rtl"] .auth-label {
  text-align: right;
}

/* Tabs */
html[dir="rtl"] .acct-tabs {
  flex-direction: row;
  justify-content: flex-start;
  direction: rtl;
}
html[dir="rtl"] .acct-tab {
  direction: rtl;
  text-align: right;
}

/* Ctx bar */
html[dir="rtl"] .ctx-bar {
  flex-direction: row-reverse;
}
html[dir="rtl"] .ctx-select {
  text-align: right;
}

/* Keep numbers LTR even in RTL mode */
html[dir="rtl"] .pricing-price,
html[dir="rtl"] .acct-sub-val,
html[dir="rtl"] [class*="data-"],
html[dir="rtl"] [class*="-val"],
html[dir="rtl"] [class*="-num"],
html[dir="rtl"] [class*="-price"],
html[dir="rtl"] [class*="-sar"],
html[dir="rtl"] [class*="-pct"] {
  direction: ltr;
  unicode-bidi: embed;
}


/* ============================================================
   ARABIC TYPOGRAPHY SYSTEM — RTL MODE
   Institutional standard derived from Ehsan.sa analysis
   ============================================================ */

/* Body and general text */
html[dir="rtl"] body,
html[dir="rtl"] p,
html[dir="rtl"] span,
html[dir="rtl"] div,
html[dir="rtl"] li {
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: 0;
  word-spacing: 0.04em;
}

/* Data values: preserve their own sizes, kill letter-spacing only */
html[dir="rtl"] [class*="-val"],
html[dir="rtl"] [class*="-num"],
html[dir="rtl"] [class*="-price"],
html[dir="rtl"] [class*="-pct"],
html[dir="rtl"] .stat-value,
html[dir="rtl"] .hm-value,
html[dir="rtl"] .vri-value,
html[dir="rtl"] .neg-range-value {
  line-height: 1;
  letter-spacing: 0;
  word-spacing: 0;
}

/* Headings */
html[dir="rtl"] h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}
html[dir="rtl"] h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}
html[dir="rtl"] h3 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
}
html[dir="rtl"] h4 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}

/* Buttons and nav — semibold, not bold */
html[dir="rtl"] button,
html[dir="rtl"] .btn,
html[dir="rtl"] .nav-btn,
html[dir="rtl"] .bottom-nav-item {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.5;
}

/* Form labels and inputs */
html[dir="rtl"] label,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0;
}

/* Upper labels / captions — keep text-transform but kill letter-spacing */
html[dir="rtl"] .stat-label,
html[dir="rtl"] .hm-label,
html[dir="rtl"] .vri-label,
html[dir="rtl"] .dp-label,
html[dir="rtl"] .brand-tag,
html[dir="rtl"] small {
  font-size: 11px;
  line-height: 1.65;
  letter-spacing: 0;
  word-spacing: 0;
}

/* Modal and auth titles */
html[dir="rtl"] .modal-title,
html[dir="rtl"] .auth-title,
html[dir="rtl"] .pricing-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.45;
}

/* Insight / body copy text */
html[dir="rtl"] .insight-text {
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 0;
}

/* Card and section titles */
html[dir="rtl"] .card-title,
html[dir="rtl"] .goal-title,
html[dir="rtl"] .hm-title,
html[dir="rtl"] .section-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
}

/* Tabs */
html[dir="rtl"] .tab-btn,
html[dir="rtl"] .etab {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

/* Choice buttons */
html[dir="rtl"] .choice-btn-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.5;
}

/* ============================================================
   ARROW FLIP — RTL MODE
   CSS-classed CTA arrows mirror with scaleX(-1)
   Data/trend arrows (up down right) are semantic — not flipped
   ============================================================ */

html[dir="rtl"] .goal-arrow,
html[dir="rtl"] .explore-arrow,
html[dir="rtl"] .continue-arrow,
html[dir="rtl"] .mic-cta-arrow,
html[dir="rtl"] .stc-arrow {
  transform: scaleX(-1);
  display: inline-block;
}

/* Hover: move left (RTL forward direction) while keeping flip */
html[dir="rtl"] .goal-card:hover .goal-arrow,
html[dir="rtl"] .explore-btn:hover .explore-arrow,
html[dir="rtl"] .continue-btn:hover .continue-arrow,
html[dir="rtl"] .market-intel-card:hover .mic-cta-arrow,
html[dir="rtl"] .sim-trigger:hover .stc-arrow {
  transform: scaleX(-1) translateX(-4px);
}

/* Badge corner flip — RTL */
html[dir="rtl"] .card-badge {
  right: auto;
  left: 24px;
}

/* Override font variables in RTL — forces Noto Sans Arabic everywhere */
html[dir="rtl"] {
  --font-ui:      'Noto Sans Arabic', sans-serif;
  --font-display: 'Noto Sans Arabic', sans-serif;
  --font-data:    'Noto Sans Arabic', sans-serif;
}

/* ============================================================
   RTL STRUCTURAL FIXES — positions, margins, text-align
   ============================================================ */

/* Auth modal */
html[dir="rtl"] .login-card { text-align: right; }
/* .login-eye intentionally NOT mirrored in RTL - password fields are always LTR-typed, icon stays at right edge matching the input's forced dir="ltr" content */
html[dir="rtl"] .auth-close { right: auto; left: 16px; }

/* Table headers */
html[dir="rtl"] th { text-align: right; }

/* Category card selected checkmark */
html[dir="rtl"] .category-card.selected::after { right: auto; left: 16px; }

/* Methodology badge */
html[dir="rtl"] .methodology-badge { margin-left: 0; margin-right: 12px; }

/* Filter arrow */
html[dir="rtl"] .ilf-arrow { margin-left: 0; margin-right: 6px; }

/* Heatmap drill row — flip chevron to left side */
html[dir="rtl"] .hm-row-drill::after { content: '‹'; right: auto; left: 14px; }
html[dir="rtl"] .hm-row-drill:hover { padding-left: 0; padding-right: 6px; }

/* Signal option description indent */
html[dir="rtl"] .hm-sig-opt-desc { margin-left: 0; margin-right: 1.2em; }

/* Benchmark legend */
html[dir="rtl"] .bp-legend { padding-left: 0; padding-right: 62px; }

/* Context popup checkmark */
html[dir="rtl"] .ctx-pop-item.ctx-pop-on::before { left: auto; right: 11px; }

/* Data timestamp */
html[dir="rtl"] .data-timestamp { right: auto; left: 15px; direction: rtl; text-align: right; }

/* RTL FONT OVERRIDE — hardcoded DM Sans / DM Mono UI elements */
html[dir="rtl"] .card-action-btn,
html[dir="rtl"] .smd-title,
html[dir="rtl"] .smd-section-title,
html[dir="rtl"] .stc-title,
html[dir="rtl"] .stc-sub,
html[dir="rtl"] .ftt-label,
html[dir="rtl"] .ftt-pill,
html[dir="rtl"] .ftt-hint,
html[dir="rtl"] .verdict-hero-sub,
html[dir="rtl"] .ctx-month,
html[dir="rtl"] .smd-meta { font-family: 'Noto Sans Arabic', sans-serif; letter-spacing: 0; }

/* Preserve DM Mono ONLY for pure numeric pulse metric values */
html[dir="rtl"] .pulse-card-v2 .pulse-metric-v2 .pulse-metric-value { font-family: 'DM Mono', monospace !important; }

/* card-description-sub RTL font fix */
html[dir="rtl"] .card-description-sub { font-family: 'Noto Sans Arabic', sans-serif; }

/* Comm modal RTL */
html[dir="rtl"] .comm-card { text-align: right; }
html[dir="rtl"] .comm-chips { flex-direction: row-reverse; }
html[dir="rtl"] .comm-message { text-align: right; direction: rtl; }
html[dir="rtl"] .comm-email-input { text-align: right; direction: rtl; }
html[dir="rtl"] .comm-email-label { text-align: right; }
html[dir="rtl"] .comm-email-helper { text-align: right; }
html[dir="rtl"] .comm-footer-row { flex-direction: row-reverse; }

/* Account settings modal RTL */
html[dir="rtl"] .acct-card { text-align: right; }
html[dir="rtl"] .acct-title { text-align: right; }
html[dir="rtl"] .acct-label { text-align: right; }
html[dir="rtl"] .acct-field { text-align: right; }
html[dir="rtl"] .acct-plan-desc { text-align: right; }
html[dir="rtl"] .acct-cancel-msg { text-align: right; }
html[dir="rtl"] .acct-renewal-notice { text-align: right; }
html[dir="rtl"] .acct-cancel-link { text-align: right; }

/* Subscription rows RTL — override number-preservation rule for text values */
html[dir="rtl"] .acct-sub-row {
  direction: rtl;
}
html[dir="rtl"] .acct-sub-label {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .acct-sub-val {
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
}
html[dir="rtl"] .acct-status-pill {
  direction: ltr;
  display: inline-flex;
  align-items: center;
}
html[dir="rtl"] .acct-cancel-link { text-align: center; }
html[dir="rtl"] .acct-renewal-notice { text-align: right; direction: rtl; }
html[dir="rtl"] .acct-plan-badge { text-align: center; }
html[dir="rtl"] .acct-reactivate-desc { text-align: right; }

/* Profile email row RTL */
html[dir="rtl"] .acct-value-row { flex-direction: row-reverse; justify-content: flex-start; }

/* Home screen card titles — uniform size in RTL */
html[dir="rtl"] .goal-title { font-size: 22px; }
html[dir="rtl"] .card-title { font-size: 22px; }
html[dir="rtl"] .mic-title  { font-size: 22px; font-weight: 700; }

/* ============================================================
   MARKET SCREEN RTL TYPOGRAPHY — Noto Sans Arabic standard
   ============================================================ */

/* Dashboard title */
html[dir="rtl"] .dashboard-title {
  font-size: 1.8rem;
  letter-spacing: 0;
  font-weight: 700;
}

/* Section titles & subtitles */
html[dir="rtl"] .section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0;
  font-family: 'Noto Sans Arabic', sans-serif;
}
html[dir="rtl"] .section-subtitle {
  font-size: 13px;
  letter-spacing: 0;
  font-family: 'Noto Sans Arabic', sans-serif;
}

/* Pulse metric labels */
html[dir="rtl"] .pulse-metric-label,
html[dir="rtl"] .pulse-metric-label-v2 {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Pulse insight text */
html[dir="rtl"] .pulse-insight-text-v2 {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 0;
  text-align: right;
}

/* Confidence bar */
html[dir="rtl"] .confidence-label {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
html[dir="rtl"] .confidence-value {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}
html[dir="rtl"] .pulse-confidence-v2 {
  direction: rtl;
  text-align: right;
}

/* Heatmap labels */
html[dir="rtl"] .hm-label {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
html[dir="rtl"] .hm-stat-label {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
html[dir="rtl"] .hm-insight-title {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}
html[dir="rtl"] .hm-insight-text {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.65;
}

/* Heatmap table header */
html[dir="rtl"] .hm-header {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  direction: rtl;
}

/* Heatmap row district name */
html[dir="rtl"] .hm-district {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
}

/* Comparator table */
html[dir="rtl"] .comparator-table th,
html[dir="rtl"] .comparator-table td {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
  direction: rtl;
  text-align: right;
}

/* Signal picker */
html[dir="rtl"] .hm-sig-opt-label {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
}

/* Smart Alerts context */
html[dir="rtl"] #alertsContext {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  direction: rtl;
  text-align: right;
}

/* Pulse metric label-v2 RTL */
html[dir="rtl"] .pulse-metric-label-v2 {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Pulse metric desc RTL */
html[dir="rtl"] .pulse-metric-desc-v2 {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  text-align: right;
  line-height: 1.75;
}

/* Confidence value RTL */
html[dir="rtl"] .pulse-confidence-v2 .confidence-value {
  font-family: 'Noto Sans Arabic', sans-serif !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Tooltip popup RTL */
html[dir="rtl"] .tip-popup,
html[dir="rtl"] .tip-popup-global {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  line-height: 1.75;
  direction: rtl;
  text-align: right;
}

/* ============================================================
   MARKET SCREEN RTL — comprehensive font & spacing fixes
   ============================================================ */

/* Heatmap header */
html[dir="rtl"] .hm-header {
  font-family: 'Noto Sans Arabic', sans-serif;
  text-transform: none;
  letter-spacing: 0;
  direction: rtl;
}

/* Heatmap stat labels */
html[dir="rtl"] .hm-stat-label {
  font-family: 'Noto Sans Arabic', sans-serif;
  text-transform: none;
  letter-spacing: 0;
}

/* Confidence label */
html[dir="rtl"] .confidence-label {
  font-family: 'Noto Sans Arabic', sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

/* All uppercase label classes */
html[dir="rtl"] .stat-label,
html[dir="rtl"] .pulse-metric-label,
html[dir="rtl"] .pulse-category,
html[dir="rtl"] .verdict-title,
html[dir="rtl"] .hm-insight-title,
html[dir="rtl"] .hm-label,
html[dir="rtl"] .hml,
html[dir="rtl"] .ncat,
html[dir="rtl"] .ycat,
html[dir="rtl"] .hcard-cat,
html[dir="rtl"] .score-label,
html[dir="rtl"] .fg-label,
html[dir="rtl"] .deal-cat,
html[dir="rtl"] .deal-discount-label,
html[dir="rtl"] .section-subtitle,
/* .plg-value holds mixed Arabic+number content (e.g. area/size values) -
   the wildcard [class*="-val"] LTR-forcing rule above was designed for pure
   numeric values (prices, percentages) and unintentionally also matches
   plg-value via substring, forcing the whole container (Arabic suffix
   included) into direction:ltr. Override scoped specifically to plg-value. */
html[dir="rtl"] .plg-value {
  direction: rtl;
  unicode-bidi: normal;
  text-align: right;
}

html[dir="rtl"] .tbadge,
html[dir="rtl"] .hbadge,
html[dir="rtl"] .dp-label,
html[dir="rtl"] .plg-label,
html[dir="rtl"] .vri-label,
html[dir="rtl"] .filter-note-label {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

/* Tip icon — RTL margin flip */
html[dir="rtl"] .tip-icon {
  margin-left: 0;
  margin-right: 4px;
}

/* Pulse metric label tip icon position flip */
html[dir="rtl"] .pulse-metric-label-v2 .tip-icon {
  right: auto !important;
  left: 12px !important;
}

/* Heatmap row district text */
html[dir="rtl"] .hm-row {
  direction: rtl;
}

/* Insight title */
html[dir="rtl"] .hm-insight-title {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
  font-weight: 700;
}

/* Smart alerts context bar */
html[dir="rtl"] #alertsContext {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
  direction: rtl;
  text-align: center;
}

/* Scatter chart avg label */
html[dir="rtl"] .hm-dist-avg-label {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
}

/* RTL fixes for range slider filter component */
html[dir="rtl"] .rs-wrap {
  direction: ltr;
}

/* Saudi Riyal currency symbol - uses dedicated webfont for guaranteed rendering */
.sar-symbol {
  font-family: 'saudi_riyal_bold', 'saudi_riyal', sans-serif !important;
  font-weight: normal;
  font-size: 1.2em;
  vertical-align: -0.08em;
  display: inline-block;
}

.verdict-price .sar-symbol {
  font-size: 1.8em !important;
}
