/* InsureBarometer — Core Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

:root {
  --navy:       #08122A;
  --navy2:      #0F1F45;
  --navy3:      #162850;
  --gold:       #C9A84C;
  --gold2:      #F0CC7A;
  --gold3:      #FAEEDA;
  --teal:       #1A9B7B;
  --teal2:      #22C79E;
  --red:        #E05252;
  --amber:      #E5A03C;
  --blue:       #5B9BD5;
  --purple:     #8B6AB8;
  --muted:      rgba(255,255,255,0.55);
  --muted2:     rgba(255,255,255,0.35);
  --border:     rgba(201,168,76,0.18);
  --border2:    rgba(255,255,255,0.08);
  --card:       rgba(15,31,69,0.75);
  --card2:      rgba(22,40,80,0.6);
  --surface:    rgba(255,255,255,0.04);
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  18px;
  --shadow:     0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --transition: 0.18s ease;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
  --safe-top:   env(safe-area-inset-top, 0px);
  --safe-bot:   env(safe-area-inset-bottom, 0px);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--navy);
  color: #fff;
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--navy);
}

/* ─── SCROLLABLE CONTENT ─── */
.scroll-view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: calc(72px + var(--safe-bot));
}
.scroll-view::-webkit-scrollbar { display: none; }

/* ─── TYPOGRAPHY ─── */
h1, h2, h3 { font-family: var(--font-serif); }
h1 { font-size: clamp(28px, 7vw, 40px); line-height: 1.1; }
h2 { font-size: clamp(20px, 5vw, 26px); line-height: 1.2; }
h3 { font-size: clamp(16px, 4vw, 20px); line-height: 1.3; }
p  { font-size: 14px; line-height: 1.7; color: var(--muted); }

.serif { font-family: var(--font-serif); }
.label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  display: block;
  margin-bottom: 5px;
}
.caption { font-size: 12px; color: var(--muted2); }
.mono { font-family: 'Courier New', monospace; letter-spacing: .04em; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  -webkit-appearance: none;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold2); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-ghost:hover { background: rgba(201,168,76,0.1); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 15px 32px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ─── INPUTS ─── */
.input-group { margin-bottom: 16px; }
.input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border var(--transition);
  -webkit-appearance: none;
}
.input:focus { border-color: var(--gold); background: rgba(201,168,76,0.04); }
.input::placeholder { color: var(--muted2); }
.input-prefix {
  position: relative;
}
.input-prefix .input { padding-left: 54px; }
.input-prefix .prefix-label {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 12px;
  color: var(--gold);
  border-right: 1px solid var(--border2);
  font-weight: 500;
}
select.input {
  background-color: var(--navy2);
  cursor: pointer;
}
select.input option { background: var(--navy2); color: #fff; }
textarea.input { resize: vertical; min-height: 80px; }

.range-wrap { width: 100%; }
.range-input {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: var(--border2);
  border-radius: 4px;
  outline: none;
  margin: 12px 0 6px;
  accent-color: var(--gold);
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(201,168,76,0.4);
}

/* ─── CARDS ─── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.card-sm { padding: 14px 16px; border-radius: var(--radius-sm); }
.card-glass {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
}
.card-accent-left { border-left: 3px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; }
.card-accent-teal { border-left: 3px solid var(--teal2); border-radius: 0 var(--radius) var(--radius) 0; }
.card-highlight { border-color: rgba(201,168,76,0.4); background: rgba(201,168,76,0.06); }

/* ─── BADGES & TAGS ─── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}
.tag-gold { background: rgba(201,168,76,.15); color: var(--gold2); }
.tag-teal { background: rgba(26,155,123,.2); color: var(--teal2); }
.tag-red  { background: rgba(224,82,82,.15); color: #f08080; }
.tag-blue { background: rgba(91,155,213,.15); color: #8fc5f5; }
.tag-amber { background: rgba(229,160,60,.15); color: #f5c07a; }

/* ─── NAVIGATION ─── */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(8,18,40,0.98);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + var(--safe-bot));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  color: var(--muted2);
  font-family: var(--font-sans);
  -webkit-appearance: none;
}
.nav-item .nav-icon { font-size: 18px; transition: transform var(--transition); }
.nav-item .nav-label { font-size: 10px; letter-spacing: .03em; }
.nav-item.active { color: var(--gold); }
.nav-item.active .nav-icon { transform: translateY(-2px); }
.nav-item:hover { color: #fff; }

/* ─── PAGE HEADERS ─── */
.page-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,18,40,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.back-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all var(--transition);
  -webkit-appearance: none;
}
.back-btn:hover,
.back-btn:active { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.2); }

/* ─── PROGRESS BAR ─── */
.progress-bar {
  height: 3px;
  background: var(--border2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--teal2));
  border-radius: 4px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* ─── DIVIDERS ─── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-subtle { height: 1px; background: var(--border2); margin: 10px 0; }

/* ─── GRID ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

/* ─── METRIC CARDS ─── */
.metric-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.metric-value { font-size: clamp(18px,5vw,26px); font-weight: 700; color: var(--gold2); line-height: 1.1; }
.metric-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.metric-sub { font-size: 11px; color: var(--muted2); margin-top: 3px; }

/* ─── RISK RING ─── */
.risk-ring-container {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.risk-ring-container svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.risk-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.risk-score-num { font-size: 26px; font-weight: 700; line-height: 1; }
.risk-score-sub { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; }

/* ─── ALLOCATION BARS ─── */
.alloc-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.alloc-label { font-size: 12px; color: var(--muted); min-width: 110px; }
.alloc-track { flex: 1; height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.alloc-fill { height: 100%; border-radius: 4px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.alloc-pct { font-size: 12px; font-weight: 600; min-width: 32px; text-align: right; }

/* ─── TABS ─── */
.tab-bar { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-weight: 500;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover:not(.active) { color: #fff; }

/* ─── SCENARIO BUTTONS ─── */
.scenario-btn {
  flex: 1;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  font-family: var(--font-sans);
  transition: all var(--transition);
}
.scenario-btn.active {
  background: rgba(201,168,76,.12);
  border-color: var(--gold);
  color: var(--gold);
}

/* ─── TRACKING NUMBER ─── */
.tracking-badge {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: inline-block;
}
.tracking-num { font-size: 15px; font-weight: 600; color: var(--gold2); letter-spacing: .06em; font-family: 'Courier New', monospace; }

/* ─── INSTALL BANNER ─── */
.install-banner {
  position: fixed;
  bottom: calc(72px + var(--safe-bot) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  box-shadow: var(--shadow);
  max-width: 440px;
  width: calc(100% - 32px);
  animation: slideUp .4s ease;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.install-banner .install-icon { font-size: 28px; flex-shrink: 0; }
.install-banner .install-text { flex: 1; }
.install-banner .install-title { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.install-banner .install-sub { font-size: 11px; color: var(--muted); }
.install-banner .install-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  flex-shrink: 0;
}

/* ─── EDUCATION CARDS ─── */
.edu-content { font-size: 13px; color: var(--muted); line-height: 1.8; }
.edu-content b { color: var(--gold2); font-weight: 600; }
.edu-content .formula-box {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 14px;
  text-align: center;
  color: #fff;
  font-weight: 500;
}

/* ─── ONBOARDING ─── */
.hero-section {
  background: linear-gradient(160deg, #08122A 0%, #0F2050 55%, #0A2240 100%);
  padding: calc(28px + var(--safe-top)) 24px 36px;
  position: relative;
  overflow: hidden;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.1);
  pointer-events: none;
}

/* ─── PARTNER CARDS ─── */
.partner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.partner-card:hover { border-color: var(--gold); background: rgba(201,168,76,.04); }
.partner-avatar {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ─── REPORT ─── */
.report-section { margin-bottom: 20px; }
.report-header {
  background: linear-gradient(135deg, var(--navy2), var(--navy3));
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

/* ─── NOTIFICATION TOAST ─── */
.toast {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26,155,123,0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  animation: fadeInDown .3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(26,155,123,0.4);
}
.toast.error { background: rgba(224,82,82,0.95); box-shadow: 0 4px 16px rgba(224,82,82,0.4); }
@keyframes fadeInDown {
  from { transform: translateX(-50%) translateY(-10px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ─── TABLE ─── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  padding: 8px 10px;
  text-align: left;
  color: var(--gold);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border2);
  color: var(--muted);
  vertical-align: middle;
}
.data-table td b { color: #fff; }
.data-table tr:last-child td { border-bottom: none; }

/* ─── STEP INDICATOR ─── */
.step-dots { display: flex; gap: 6px; align-items: center; }
.step-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border2);
  transition: all var(--transition);
}
.step-dot.active { background: var(--gold); width: 20px; border-radius: 4px; }
.step-dot.done { background: var(--teal2); }

/* ─── ANIMATIONS ─── */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.slide-in { animation: slideIn .25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ─── CHART CONTAINER ─── */
.chart-wrap { position: relative; width: 100%; }

/* ─── RESPONSIVE ─── */
@media (max-width: 360px) {
  .alloc-label { min-width: 90px; font-size: 11px; }
  h1 { font-size: 26px; }
  .card { padding: 14px; }
}

@media (min-width: 768px) {
  body { background: #050E1F; }
  #app {
    height: 100vh;
    border-radius: 0;
    box-shadow: 0 0 80px rgba(0,0,0,0.6);
  }
}

/* ─── POLICY CHECKER ─── */
.pc-check-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid var(--border2);
  transition: all var(--transition);
  margin-bottom: 10px;
}
.pc-check-label.checked {
  background: rgba(34, 199, 158, 0.08);
  border-color: var(--teal2);
}
.pc-checkbox {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border2);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  font-size: 13px;
}
.pc-checkbox.checked { background: var(--teal2); border-color: var(--teal2); color: #fff; }

/* ─── BLOG ─── */
.blog-featured-card {
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(8,18,42,0.95));
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition), background var(--transition);
}
.blog-featured-card:hover { border-color: var(--gold); background: rgba(201,168,76,0.1); }

.blog-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--transition), background var(--transition);
}
.blog-card:hover { border-color: var(--border); background: rgba(255,255,255,0.03); }

/* Blog article body typography */
.blog-content p  { font-size: 14px; line-height: 1.8; color: rgba(255,255,255,0.75); margin-bottom: 14px; }
.blog-content h3 { font-family: var(--font-serif); margin: 20px 0 8px; }
.blog-content b  { color: #fff; }
.blog-content .formula-box { margin: 12px 0; }
.blog-content .edu-callout  { margin: 16px 0; }

/* ─── SIMULATION — income waterfall ─── */
.sim-waterfall-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border2);
}

/* ─── PARTNERS PAGE ─── */
.partner-trust-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(34, 199, 158, 0.06);
  border: 1px solid rgba(34, 199, 158, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.partner-featured-card {
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(8,18,42,0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.partner-featured-card:hover { border-color: var(--gold); }

.partner-avatar-lg {
  width: 52px;
  height: 52px;
  background: rgba(201, 168, 76, 0.12);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.partner-verified-badge {
  font-size: 10px;
  color: var(--teal2);
  border: 1px solid var(--teal2);
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
  font-weight: 600;
}

/* ─── WHATSAPP FLOATING BUTTON ─── */
#wa_float {
  position: fixed;
  bottom: calc(80px + var(--safe-bot) + 12px);
  right: 12px;
  width: 52px;
  height: 52px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  z-index: 200;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: wa-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
#wa_float:hover,
#wa_float:active {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.6);
}
@keyframes wa-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
/* Tooltip label */
#wa_float::before {
  content: 'Chat with us';
  position: absolute;
  right: 60px;
  background: #1a1a2e;
  color: #fff;
  font-size: 11px;
  font-family: var(--font-sans);
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border: 1px solid rgba(255,255,255,0.1);
}
#wa_float:hover::before { opacity: 1; }

/* On mobile hide the tooltip — too cramped */
@media (max-width: 959px) {
  #wa_float::before { display: none; }
}

/* ─── EDUCATION CALLOUT BOX ─── */
.edu-callout {
  background: rgba(201, 168, 76, 0.07);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}
.edu-callout b { color: var(--gold2); }

/* ─── PROTECTION GAP BAR ─── */
.gap-bar-track {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  height: 14px;
  overflow: hidden;
}
.gap-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--teal), var(--teal2));
  transition: width 0.8s cubic-bezier(0.25,1,0.5,1);
}

/* ─── AI ADVISOR ─── */
.ai-bubble {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.65;
  animation: fadeSlideUp 0.2s ease both;
}
.ai-bubble-bot {
  background: rgba(15, 31, 69, 0.9);
  border: 1px solid var(--border);
  align-self: flex-start;
  color: var(--muted);
  border-radius: 4px 14px 14px 14px;
}
.ai-bubble-user {
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.25);
  align-self: flex-end;
  color: #fff;
  border-radius: 14px 4px 14px 14px;
  margin-left: auto;
}
.ai-chip {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.ai-chip:hover { border-color: var(--gold); color: var(--gold); }

/* AI typing indicator */
.ai-typing { display: flex; align-items: center; gap: 4px; padding: 14px 18px; }
.ai-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: aiDot 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}
.ai-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bot));
  background: var(--navy2);
  border-top: 1px solid var(--border2);
  position: sticky;
  bottom: 72px;
}
.ai-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 10px 16px;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
}
.ai-input:focus { border-color: var(--gold); }
.ai-send-btn {
  width: 40px;
  height: 40px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  color: var(--navy);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}
.ai-send-btn:hover { transform: scale(1.1); }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── MODALS ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.15s ease;
}
.modal-card {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.2s cubic-bezier(0.25,1,0.5,1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── QUIZ ─── */
.quiz-opt-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-size: 13px;
  text-align: left;
  font-family: var(--font-sans);
  cursor: pointer;
  line-height: 1.45;
  transition: all var(--transition);
}

/* ─── LOADING SPINNER ─── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── ONBOARDING SPLASH ─── */
#splash {
  position: fixed;
  inset: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity .6s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
.splash-logo { width: 80px; height: 80px; background: var(--gold); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; color: var(--navy); font-family: var(--font-sans); margin-bottom: 20px; animation: pulse 2s ease infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,.4); } 50% { box-shadow: 0 0 0 16px rgba(201,168,76,0); } }
.splash-title { font-family: var(--font-serif); font-size: 28px; color: #fff; margin-bottom: 6px; }
.splash-sub { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.splash-bar { width: 160px; height: 3px; background: var(--border2); border-radius: 4px; overflow: hidden; }
.splash-progress { height: 100%; background: linear-gradient(90deg, var(--gold), var(--teal2)); border-radius: 4px; animation: loadBar 1.8s ease forwards; }
@keyframes loadBar { from { width: 0; } to { width: 100%; } }

/* ══════════════════════════════════════════════════════════
   TABLET LAYOUT  (600px – 959px)
══════════════════════════════════════════════════════════ */
@media (min-width: 600px) and (max-width: 959px) {
  #app { max-width: 100%; }
  .grid-2 { grid-template-columns: repeat(3, 1fr); }
  .hero-section { padding: 36px 32px 32px; }
  .page-header  { padding: 20px 28px 16px; }
  body { user-select: text; -webkit-user-select: text; }
}

/* ══════════════════════════════════════════════════════════
   DESKTOP LAYOUT  (960px+)
   Bottom nav → Left sidebar · Phone column → Full canvas
══════════════════════════════════════════════════════════ */
@media (min-width: 960px) {

  /* ── Allow text selection on desktop ── */
  body {
    overflow: hidden;
    user-select: text;
    -webkit-user-select: text;
  }

  /* ── App shell: full-width row layout ── */
  #app {
    max-width: 100%;
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
  }

  /* ════ SIDEBAR (was .bottom-nav) ════ */
  .bottom-nav {
    position: static;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 240px;
    min-width: 240px;
    height: 100%;
    padding: 0 0 0;
    gap: 0;
    border-top: none;
    border-right: 1px solid var(--border);
    background: rgba(5, 12, 28, 0.98);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    z-index: 100;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }

  /* Sidebar brand block (hidden on mobile, shown on desktop) */
  .sidebar-brand {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    text-decoration: none;
    cursor: default;
  }
  .sidebar-brand-icon {
    width: 36px; height: 36px;
    background: var(--gold);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; color: var(--navy);
    flex-shrink: 0;
  }
  .sidebar-brand-name {
    font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2;
  }
  .sidebar-brand-sub {
    font-size: 10px; color: var(--muted); margin-top: 1px;
  }

  /* Sidebar nav items */
  .nav-item {
    flex: none;
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 20px;
    gap: 14px;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
  }
  .nav-item .nav-icon { font-size: 17px; line-height: 1; flex-shrink: 0; }
  .nav-item .nav-label { font-size: 13px; font-weight: 500; letter-spacing: 0; }
  .nav-item.active {
    background: rgba(201,168,76,0.10);
    border-left-color: var(--gold);
    color: var(--gold);
  }
  .nav-item.active .nav-icon { transform: none; }
  .nav-item:hover:not(.active) { background: rgba(255,255,255,0.04); color: #fff; }

  /* Sidebar quick-links section (hidden on mobile, shown desktop) */
  .sidebar-section {
    display: block !important;
    padding: 10px 18px 6px;
    font-size: 10px;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 600;
    margin-top: 8px;
  }
  .sidebar-quick-link {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
    transition: color 0.15s, background 0.15s;
    border-left: 3px solid transparent;
  }
  .sidebar-quick-link:hover { color: #fff; background: rgba(255,255,255,0.03); }
  .sidebar-quick-link.active { color: var(--gold); background: rgba(201,168,76,0.08); border-left-color: var(--gold); }

  /* Sidebar footer (hidden on mobile) */
  .sidebar-footer {
    display: flex !important;
    flex-direction: column;
    margin-top: auto;
    padding: 14px 20px;
    border-top: 1px solid var(--border2);
    gap: 3px;
  }
  .sidebar-footer-text { font-size: 10px; color: var(--muted2); }

  /* ════ MAIN CONTENT AREA ════ */
  .scroll-view {
    flex: 1;
    min-width: 0;
    height: 100%;
    max-width: 100%;
    padding-bottom: 60px;
    /* Show scrollbar on desktop */
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
  }
  .scroll-view::-webkit-scrollbar { display: block; width: 5px; }
  .scroll-view::-webkit-scrollbar-track { background: transparent; }
  .scroll-view::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
  .scroll-view::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

  /* Full-width hero and headers — no centre-cap */
  .hero-section  { padding: 48px 60px 44px !important; }
  .page-header   { padding: 28px 48px 20px !important; }

  /* Sync badge repositioned */
  .bottom-nav > [style*="position:absolute"] { display: none; }

  /* ════ TYPOGRAPHY SCALE ════ */
  h1 { font-size: clamp(32px, 3.5vw, 52px); }
  h2 { font-size: clamp(22px, 2.5vw, 32px); }
  p  { font-size: 15px; }

  /* ════ GRID — 4 columns on desktop ════ */
  .grid-2 { grid-template-columns: repeat(4, 1fr); gap: 14px; }

  /* ════ INNER CONTENT PADDING — breathes on wide screens ════ */
  .scroll-view > .fade-in > div[style*="padding:20px"],
  .scroll-view > .fade-in > div[style*="padding: 20px"] {
    padding: 28px 48px !important;
  }

  /* ════ CARD SIZING ════ */
  .card { padding: 20px 22px; }
  .metric-value { font-size: 22px; }

  /* ════ HERO ORBS — scale up ════ */
  .hero-orb { display: none; } /* Remove phone-sized orbs on desktop */

  /* ════ ALLOC ROWS — wider ════ */
  .alloc-row { gap: 16px; }
  .alloc-track { flex: 1; }

  /* ════ AI INPUT BAR ════ */
  .ai-input-bar {
    position: sticky;
    bottom: 0;
    padding-bottom: 12px;
  }

  /* ════ WHATSAPP FLOAT ════ */
  #wa_float {
    right: 24px;
    bottom: 32px;
  }
  #wa_float::before { display: block; }

  /* ════ PAGE CONTENT WIDTH ════ */
  /* Wrap inner content sections in a max-width container */
  /* Full-width content — fills all available space after sidebar */
  .scroll-view > .fade-in,
  .scroll-view > .slide-in {
    width: 100%;
    min-height: 100%;
  }

  /* ════ BACK BTN — visible on all screen sizes ════ */
  .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 6px 14px 6px 10px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 14px;
  }
  .back-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
  }

  /* ════ PARTNER FEATURED CARD wider ════ */
  .partner-featured-card { padding: 20px 24px; }

  /* ════ STEP DOTS ════ */
  .step-dots { gap: 8px; }
}

/* ══════════════════════════════════════════════════════════
   WIDE DESKTOP  (1400px+)  — wider sidebar, more columns, deeper padding
══════════════════════════════════════════════════════════ */
@media (min-width: 1400px) {
  .bottom-nav { width: 280px; min-width: 280px; }
  .grid-2 { grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .hero-section { padding: 60px 80px 52px !important; }
  .scroll-view > .fade-in > div[style*="padding:20px"],
  .scroll-view > .fade-in > div[style*="padding: 20px"] {
    padding: 36px 72px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   ULTRA-WIDE  (1800px+)
══════════════════════════════════════════════════════════ */
@media (min-width: 1800px) {
  .grid-2 { grid-template-columns: repeat(6, 1fr); gap: 18px; }
  .hero-section { padding: 72px 100px 60px !important; }
}
