:root {
  --navy-900: #0b1f3a;
  --navy-800: #12305a;
  --navy-700: #1a3f73;
  --brand: #1f5eff;
  --brand-dark: #1747c7;
  --brand-soft: #eaf0ff;
  --accent: #0e9f6e;
  --accent-soft: #e7f6ef;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #0f1b2d;
  --text-2: #4a5a70;
  --text-3: #7a889c;
  --border: #e3e8ef;
  --border-strong: #cfd7e3;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06);
  --shadow: 0 1px 3px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.06);
  --shadow-lg: 0 24px 64px rgba(11, 31, 58, 0.24);

  --header-h: 56px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy-900);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--navy-800));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg);
}

.site-nav a.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--navy-900);
}

/* ---------- Hero ---------- */
.hero {
  padding: 32px 0 64px;
  color: #fff;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(31, 94, 255, 0.45), transparent 60%),
    linear-gradient(160deg, var(--navy-900), var(--navy-700));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 500;
  color: #d6e2ff;
}

.eyebrow .icon {
  width: 16px;
  height: 16px;
}

.hero h1 {
  max-width: 820px;
  margin: 0 0 6px;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.hero-sub {
  max-width: 600px;
  margin: 0;
  font-size: 15px;
  color: #b9c8e4;
}

/* ---------- Search panel ---------- */
.search-panel {
  position: relative;
  margin-top: -40px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 0.9fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.field select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5a70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.field input::placeholder {
  color: var(--text-3);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.15);
}

.input-icon {
  position: relative;
}

.input-icon .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.input-icon input {
  padding-left: 36px;
}

.form-actions {
  display: flex;
  gap: 8px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.site-nav a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg);
}

/* ---------- Results ---------- */
.results-bar {
  margin: 20px 0 12px;
}

.result-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.result-summary strong {
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  transition: opacity 0.15s;
}

/* Pagination */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px 0 40px;
}

.pager:empty {
  padding: 0 0 40px;
}

.pager-btn {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pager-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.pager-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.pager-btn[aria-current='page'] {
  opacity: 1;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.pager-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.pager-btn .icon {
  width: 16px;
  height: 16px;
}

.pager-prev .icon {
  transform: rotate(180deg);
}

.pager-gap {
  min-width: 20px;
  text-align: center;
  color: var(--text-3);
}

.card-grid.is-loading {
  opacity: 0.55;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

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

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.avatar-lg {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 16px;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.card-meta {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  flex: 1;
}

.card-meta li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.card-meta li[hidden] {
  display: none;
}

.card-meta .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--text-3);
}

.card-action {
  width: 100%;
  height: 36px;
}

.card-action .icon {
  width: 16px;
  height: 16px;
}

/* Skeleton loading */
.card.skeleton {
  pointer-events: none;
}

.skeleton .bar {
  height: 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6 25%, #e3e8ef 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  margin: 0 0 40px;
  padding: 36px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-2);
}

.empty-state .icon {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.empty-state h2 {
  margin: 16px 0 4px;
  font-size: 18px;
  color: var(--text);
}

.empty-state p {
  margin: 0;
}

/* ---------- Cost saving ---------- */
.step {
  margin-bottom: 28px;
}

.panel {
  position: relative;
  margin-top: -40px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.step-head h2 {
  margin: 1px 0 0;
  font-size: 16px;
  letter-spacing: -0.015em;
}

.step-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}

.field-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.fund-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.fund-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: opacity 0.15s;
}

.fund-card.is-loading {
  opacity: 0.6;
}

.fund-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fund-label {
  font-weight: 600;
  color: var(--text);
}

.icon-btn-sm {
  width: 28px;
  height: 28px;
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fund-remove:hover:not(:disabled) {
  color: #c2410c;
  border-color: #fdba74;
  background: #fff7ed;
}

/* Combobox */
.combo {
  position: relative;
}

.combo-list {
  position: absolute;
  z-index: 15;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.combo-list li {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.combo-list li:hover,
.combo-list li.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.combo-list li.combo-empty {
  color: var(--text-3);
  cursor: default;
  background: none;
}

.field input.invalid {
  border-color: #dc2626;
}

.field input.invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  color: #dc2626;
}

/* Inputs with ₹ / % affix */
.affix {
  position: relative;
  display: block;
}

.affix-text {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--text-3);
  font-weight: 500;
  pointer-events: none;
}

.affix input {
  padding-left: 28px;
}

.affix-end .affix-text {
  left: auto;
  right: 14px;
}

.affix-end input {
  padding-left: 14px;
  padding-right: 34px;
}

.field input {
  font-variant-numeric: tabular-nums;
}

/* Fund result */
.fund-result {
  display: grid;
  gap: 10px;
}

.fund-result[hidden] {
  display: none;
}

.fund-category {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
}

.ter-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ter {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.ter span {
  display: block;
  font-size: 11px;
  color: var(--text-3);
}

.ter strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.ter-regular strong {
  color: #b45309;
}

.ter-direct strong {
  color: var(--accent);
}

.ter.na strong {
  font-size: 14px;
  color: var(--text-3);
}

.fund-costs {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.fund-costs div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.fund-costs dt {
  color: var(--text-2);
}

.fund-costs dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fund-costs .saving {
  padding-top: 6px;
  border-top: 1px dashed var(--border-strong);
}

.fund-costs .saving dd {
  color: var(--accent);
}

.btn-dashed {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--brand);
}

.btn-dashed:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* Fees */
.fee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fee-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.fee-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.fee-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-2);
}

.fee-calc {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.fee-calc strong {
  color: var(--text);
}

.fee-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--navy-900);
  color: #d6e2ff;
  border-radius: var(--radius);
}

.fee-total strong {
  color: #fff;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* Summary */
.summary-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  color: var(--text-2);
}

.summary-empty p {
  margin: 0;
}

.summary-empty .icon {
  color: var(--brand);
}

.sum-breakdown {
  padding: 18px 20px;
}

.sum-caption {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-3);
}

.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 4px 0;
}

.sum-row span {
  color: var(--text-2);
}

.sum-row strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sum-regular strong {
  font-size: 16px;
}

.sum-breakdown hr {
  margin: 8px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.sum-sub {
  margin: -4px 0 6px;
  font-size: 13px;
  color: var(--text-3);
}

.sum-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}

.sum-total span {
  color: var(--text);
  font-weight: 600;
}

.sum-total strong {
  font-size: 16px;
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
}

.bar-track {
  display: flex;
  height: 10px;
  background: var(--bg);
  border-radius: 7px;
  overflow: hidden;
}

.bar {
  height: 100%;
  transition: width 0.3s ease;
}

.bar-regular,
.dot-regular {
  background: #f59e0b;
}

.bar-direct,
.dot-direct {
  background: var(--accent);
}

.bar-adviser,
.dot-adviser {
  background: var(--brand);
}

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.bar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.verdict {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
  border-left: 1px solid var(--border);
}

.verdict-direct {
  background: linear-gradient(160deg, #ecfdf5, #f0fdf9);
}

.verdict-regular {
  background: linear-gradient(160deg, #fffbeb, #fff7ed);
}

.verdict-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.verdict-direct .verdict-kicker {
  color: var(--accent);
}

.verdict-regular .verdict-kicker {
  color: #b45309;
}

.verdict h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.verdict-amount {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-2);
}

.verdict-amount strong {
  font-size: 18px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.verdict-note {
  display: flex;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

.verdict-note .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--text-3);
}

.disclaimer {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

.rp-disclaimer {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #b42318;
  color: #fff;
  font-size: 13px;
}

/* ---------- Details dialog ---------- */
.details-dialog {
  width: min(680px, calc(100% - 32px));
  max-width: none;
  max-height: min(880px, calc(100% - 48px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.details-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialog-in 0.2s ease-out;
}

.details-dialog::backdrop {
  background: rgba(11, 31, 58, 0.5);
  backdrop-filter: blur(2px);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.details-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.details-heading {
  flex: 1;
  min-width: 0;
}

.details-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.details-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.details-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.details-sub .icon {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}

.details-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-2);
}

.badge-success {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge .icon {
  width: 14px;
  height: 14px;
}

.detail-section + .detail-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0;
}

.detail-grid dt {
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--text-3);
}

.detail-grid dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.detail-grid dd a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--brand);
  text-decoration: none;
}

.detail-grid dd a:hover {
  text-decoration: underline;
}

.detail-grid dd a .icon {
  width: 15px;
  height: 15px;
}

.detail-grid dd.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.detail-grid dd.muted {
  font-weight: 400;
  color: var(--text-3);
}

.phone-hidden {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--text-2);
  cursor: pointer;
}

.phone-hidden span {
  filter: blur(5px);
  user-select: none;
}

.phone-hidden .icon {
  width: 15px;
  height: 15px;
}

.phone-note {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--text-3);
}

.details-loading,
.details-error {
  padding: 32px 0;
  text-align: center;
  color: var(--text-2);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-3);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

.site-footer a:hover {
  color: var(--brand);
}

/* ---------- FAQ ---------- */
.faq {
  margin: 36px 0 40px;
}

.faq-title {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: -0.015em;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.faq-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.faq-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.faq-answer p {
  margin: 0;
  color: var(--text-2);
}

.faq-answer p + p {
  margin-top: 8px;
}

/* ---------- Risk profile game ---------- */
a.btn {
  text-decoration: none;
}

.btn-lg {
  height: 48px;
  padding: 0 22px;
  font-size: 15px;
  border-radius: var(--radius);
}

.rp-game {
  /* Stage colours: seed, sapling, tree */
  --zone-0: #b45309;
  --zone-0-soft: #fdf3e2;
  --zone-1: #65a30d;
  --zone-1-soft: #eef7e0;
  --zone-2: #0e7a4f;
  --zone-2-soft: #e3f3ea;
  --balloon: var(--zone-0);
  overflow: hidden;
}

.rp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rp-progress {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* Journey: three zones over a row of stepping stones */
.rp-journey:empty {
  display: none;
}

.rp-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.rp-zone {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--text-3);
  background: var(--bg);
  transition: color 0.3s, background 0.3s;
}

.rp-zone.current.rp-zone-0 {
  color: var(--zone-0);
  background: var(--zone-0-soft);
}

.rp-zone.current.rp-zone-1 {
  color: var(--zone-1);
  background: var(--zone-1-soft);
}

.rp-zone.current.rp-zone-2 {
  color: var(--zone-2);
  background: var(--zone-2-soft);
}

.rp-stones {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 18px;
  padding: 30px 4px 4px;
  list-style: none;
}

.rp-stones::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(50% + 5px);
  border-top: 2px dashed var(--border-strong);
}

.rp-stone {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.rp-stone.done.rp-zone-0 {
  background: var(--zone-0);
  border-color: var(--zone-0);
}

.rp-stone.done.rp-zone-1 {
  background: var(--zone-1);
  border-color: var(--zone-1);
}

.rp-stone.done.rp-zone-2 {
  background: var(--zone-2);
  border-color: var(--zone-2);
}

.rp-stone.current {
  transform: scale(1.35);
  border-color: var(--navy-900);
}

/* The plant grows with progress: --grow runs from 0 to 1 */
.rp-plant {
  --size: calc(20px + 8px * var(--grow, 0));
  position: absolute;
  bottom: 15px;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  margin-left: calc(var(--size) / -2 + 4px);
  border-radius: 50%;
  background: var(--plant, var(--zone-0));
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: left 0.5s cubic-bezier(0.34, 1.4, 0.64, 1), width 0.4s, height 0.4s, background 0.4s;
  animation: rp-sway 2.4s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.rp-plant .icon {
  width: 62%;
  height: 62%;
}

.rp-plant.rp-zone-1 {
  --plant: var(--zone-1);
}

.rp-plant.rp-zone-2 {
  --plant: var(--zone-2);
}

@keyframes rp-sway {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

/* Stage colours follow the zone */
.rp-stage {
  position: relative;
  min-height: 320px;
}

.rp-stage[data-zone='1'] {
  --balloon: var(--zone-1);
}

.rp-stage[data-zone='2'] {
  --balloon: var(--zone-2);
}

.rp-intro,
.rp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 0 12px;
  text-align: center;
}

.rp-intro h2,
.rp-question h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  outline: none;
}

.rp-intro p,
.rp-loading p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}

.rp-intro-balloons {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.rp-intro-balloons .rp-balloon-body {
  animation: rp-bob 3s ease-in-out infinite;
}

.rp-intro-balloons .rp-balloon-body:nth-child(2) {
  --balloon: var(--zone-1);
  animation-delay: -1s;
  margin-top: -10px;
}

.rp-intro-balloons .rp-balloon-body:nth-child(3) {
  --balloon: var(--zone-2);
  animation-delay: -2s;
}

.rp-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.rp-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: rp-spin 0.8s linear infinite;
}

.rp-loading .rp-spinner {
  margin-bottom: 12px;
}

.btn .rp-spinner {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes rp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Question */
.rp-question {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.rp-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.rp-balloons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.rp-balloon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.45s ease-in, opacity 0.45s ease-in;
}

.rp-balloon-body {
  position: relative;
  display: block;
  width: 64px;
  height: 78px;
  border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.7) 0 9%, transparent 22%),
    radial-gradient(circle at 50% 60%, transparent 40%, rgba(0, 0, 0, 0.18)),
    var(--balloon);
  box-shadow: inset -6px -8px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s, opacity 0.2s;
}

/* Knot */
.rp-balloon-body::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-bottom: 7px solid var(--balloon);
  border-top: 0;
}

.rp-balloon .rp-balloon-body {
  animation: rp-bob 3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.rp-string {
  display: block;
  width: 2px;
  height: 22px;
  margin-top: 6px;
  background: var(--border-strong);
}

.rp-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.rp-balloon:hover .rp-tag,
.rp-balloon:focus-visible .rp-tag {
  border-color: var(--balloon);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--balloon) 18%, transparent);
}

.rp-balloon:hover .rp-balloon-body {
  transform: scale(1.06);
}

.rp-balloon:focus-visible {
  outline: none;
}

.rp-balloon.chosen .rp-tag {
  border-color: var(--balloon);
  background: color-mix(in srgb, var(--balloon) 8%, var(--surface));
}

/* Pop: the chosen balloon bursts, the others float away */
.rp-balloon.popped .rp-balloon-body {
  animation: rp-burst 0.25s ease-out forwards;
}

.rp-balloon.popped .rp-string {
  opacity: 0;
  transition: opacity 0.2s;
}

.rp-balloon.popped .rp-tag {
  border-color: var(--balloon);
  background: color-mix(in srgb, var(--balloon) 10%, var(--surface));
  transform: scale(1.03);
}

.rp-balloon.away {
  transform: translateY(-60px);
  opacity: 0;
  pointer-events: none;
}

@keyframes rp-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes rp-burst {
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}

.rp-confetti {
  position: absolute;
  left: 50%;
  top: 40px;
  pointer-events: none;
}

.rp-confetti i {
  position: absolute;
  width: 7px;
  height: 10px;
  border-radius: 2px;
  background: hsl(var(--h) 80% 58%);
  animation: rp-fly 0.8s ease-out forwards;
}

@keyframes rp-fly {
  to {
    transform: translate(var(--x), var(--y)) rotate(var(--r));
    opacity: 0;
  }
}

.rp-nav {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
}

.rp-nav .btn:disabled {
  visibility: hidden;
}

.rp-toast {
  position: absolute;
  left: 50%;
  top: 12px;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--navy-900);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.rp-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Ready */
.rp-grown {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--zone-2-soft);
  color: var(--zone-2);
}

.rp-grown .icon {
  width: 28px;
  height: 28px;
}

.rp-calc {
  min-width: 240px;
}

.rp-calc:not(.is-loading) {
  animation: rp-pulse 1.8s ease-in-out infinite;
}

@keyframes rp-pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(31, 94, 255, 0.15);
  }
}

/* Result */
.rp-result {
  max-width: 860px;
  margin: 0 auto;
}

.rp-result-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rp-gauge {
  width: 100%;
  max-width: 280px;
}

.rp-gauge-seg {
  fill: none;
  stroke-width: 18;
  opacity: 0.35;
}

.rp-gauge-seg.current {
  opacity: 1;
}

.rp-needle {
  fill: var(--navy-900);
  transform-origin: 120px 120px;
  transition: transform 1.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.rp-result-hero h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.03em;
  color: var(--profile, var(--text));
  outline: none;
}

.rp-gauge-ends {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 300px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}

.rp-note {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  text-align: left;
}

.rp-note strong {
  display: block;
  margin-bottom: 2px;
}

.rp-note p {
  margin: 0;
  color: var(--text-2);
}

.rp-note .icon {
  margin-top: 2px;
}

.rp-note-gap {
  border-color: #f5d9a8;
  background: #fdf8ee;
}

.rp-note-gap .icon {
  color: #b45309;
}

.rp-note-mismatch {
  border-color: #c9d8ff;
  background: var(--brand-soft);
}

.rp-note-mismatch .icon {
  color: var(--brand);
}

.rp-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.rp-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rp-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.rp-meter + .rp-meter {
  margin-top: 14px;
}

.rp-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 6px;
}

.rp-meter-head strong {
  display: block;
  font-weight: 600;
}

.rp-meter-head small {
  color: var(--text-3);
  font-size: 12px;
}

.rp-meter-head b {
  font-size: 13px;
  white-space: nowrap;
}

.rp-meter-track {
  display: flex;
  gap: 4px;
}

.rp-meter-track span {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
}

.rp-meter-track span.on {
  background: var(--brand);
}

.rp-mix-bar {
  display: flex;
  height: 18px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--border);
}

.rp-mix-equity {
  background: var(--brand);
}

.rp-mix-range {
  background: repeating-linear-gradient(135deg, var(--brand) 0 5px, #8fb0ff 5px 10px);
}

.rp-mix-debt {
  background: var(--accent);
}

.rp-mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  color: var(--text-2);
}

.rp-mix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rp-mix-legend strong {
  color: var(--text);
}

.rp-dot-equity {
  background: var(--brand);
}

.rp-dot-debt {
  background: var(--accent);
}

.rp-share {
  margin-top: 14px;
}

.rp-share .field {
  display: block;
  max-width: 420px;
}

.rp-share input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}

.rp-share input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.rp-share input.invalid {
  border-color: #d64545;
}

.rp-hint {
  display: flex;
  gap: 6px;
  max-width: 560px;
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
}

.rp-hint .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--accent);
}

.rp-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.rp-report-status {
  margin: 10px 0 0;
  color: var(--text-2);
}

.rp-report-status.is-error {
  color: #b42318;
}

.rp-report-status:empty {
  display: none;
}

.btn-outline .rp-spinner {
  border-color: var(--brand-soft);
  border-top-color: var(--brand);
}

.rp-fine {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

@media (max-width: 760px) {
  .rp-balloons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }

  .rp-result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .rp-stage {
    min-height: 0;
  }

  .rp-intro h2,
  .rp-question h2 {
    font-size: 17px;
  }

  .rp-balloon-body {
    width: 48px;
    height: 58px;
  }

  .rp-string {
    height: 14px;
  }

  .rp-tag {
    min-height: 0;
    padding: 9px 10px;
    font-size: 13px;
  }

  .rp-actions .btn,
  .rp-share-actions .btn {
    width: 100%;
  }

  .rp-zone {
    font-size: 10px;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .fund-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    grid-template-columns: 1fr;
  }

  .verdict {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .search-panel {
    grid-template-columns: 1fr 1fr;
  }

  .field-name {
    grid-column: 1 / -1;
  }

  .form-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (min-width: 641px) and (max-width: 760px) {
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .container,
  .header-inner {
    padding: 0 16px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px 16px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 10px 12px;
  }

  .hero {
    padding: 24px 0 56px;
  }

  .hero-sub {
    font-size: 14px;
  }

  .search-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .form-actions .btn {
    flex: 1;
  }

  .panel {
    padding: 14px;
  }

  .fund-card {
    padding: 12px;
  }

  .fee-grid {
    grid-template-columns: 1fr;
  }

  .sum-breakdown,
  .verdict {
    padding: 16px 14px;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .verdict h3 {
    font-size: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pager {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .pager-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
  }

  .pager-gap {
    min-width: 12px;
  }

  /* Details become a bottom sheet on phones. */
  .details-dialog {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .details-dialog[open] {
    animation-name: sheet-in;
  }

  .details-header {
    gap: 10px;
    padding: 16px 14px 12px;
  }

  .avatar-lg {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .details-heading h2 {
    font-size: 16px;
  }

  .details-body {
    padding: 16px 14px 24px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  .details-dialog[open] {
    animation: none !important;
    transition: none !important;
  }
}
