:root {
  --bg: #f4f7f7;
  --surface: rgba(255,255,255,.88);
  --surface-solid: #ffffff;
  --surface-2: #eef4f3;
  --text: #12211f;
  --muted: #667774;
  --line: #dfe8e6;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #dff6f1;
  --fix: #526b84;
  --green: #0e8a67;
  --green-soft: #e4f6ef;
  --amber: #b7791f;
  --amber-soft: #fff4d9;
  --orange: #c65d19;
  --orange-soft: #fff0e6;
  --red: #b93838;
  --red-soft: #fdeaea;
  --shadow: 0 18px 50px rgba(18, 46, 43, .08);
  --radius: 24px;
  --radius-sm: 15px;
  --nav-h: 82px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1111;
  --surface: rgba(20,29,28,.88);
  --surface-solid: #141d1c;
  --surface-2: #192624;
  --text: #ecf6f4;
  --muted: #98aaa6;
  --line: #293a37;
  --accent: #38c4b1;
  --accent-2: #53d5c4;
  --accent-soft: #153e38;
  --fix: #8da9c4;
  --green-soft: #153b31;
  --amber-soft: #453817;
  --orange-soft: #452b1c;
  --red-soft: #442020;
  --shadow: 0 18px 55px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(20,184,166,.09), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(82,107,132,.08), transparent 28%),
    var(--bg);
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 2px;
}
.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 calc(var(--nav-h) + 30px);
}
.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px rgba(15,118,110,.24);
}
.brand-mark svg { width: 27px; height: 27px; fill: none; stroke: white; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand h1 { margin: 0; font-size: 22px; line-height: 1.08; letter-spacing: -.03em; }
.eyebrow, .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .10em;
}
.icon-button {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); cursor: pointer; box-shadow: var(--shadow);
}
.demo-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px 16px; margin-bottom: 18px; border-radius: 16px;
  background: var(--amber-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--amber) 20%, transparent);
}
.demo-banner div { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.demo-banner strong { font-size: 13px; }
.demo-banner span { color: var(--muted); font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; padding: 6px; }

.page { display: none; animation: fade .22s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.hero-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 18px; }
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 26px;
}
.metric-card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 18px;
}
.status-card { padding: 26px; }
.status-topline, .section-title-row, .metric-head, .status-actions, .rate-meta, .comparison-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.updated {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 22%, transparent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .02em;
  line-height: 1.25;
  white-space: nowrap;
}
.status-core { display: flex; align-items: center; gap: 28px; margin: 26px 0; }
.score-ring {
  --size: 132px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--score) * 1%), var(--surface-2) 0);
  position: relative;
}
.score-ring::after {
  content: ""; position: absolute; inset: 10px; border-radius: 50%;
  background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line);
}
.score-ring > div { z-index: 1; display: flex; align-items: baseline; }
.score-ring strong { font-size: 36px; letter-spacing: -.05em; }
.score-ring span { color: var(--muted); font-size: 12px; margin-left: 3px; }
.status-pill {
  display: inline-flex; padding: 7px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 900; letter-spacing: .08em;
}
.status-pill.green { background: var(--green-soft); color: var(--green); }
.status-pill.amber { background: var(--amber-soft); color: var(--amber); }
.status-pill.orange { background: var(--orange-soft); color: var(--orange); }
.status-pill.red { background: var(--red-soft); color: var(--red); }
.status-copy h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; margin: 10px 0 7px; }
.status-copy p { color: var(--muted); margin: 0; max-width: 520px; line-height: 1.55; }
.status-actions { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.primary-button, .secondary-button, .small-button {
  border: 0; cursor: pointer; font-weight: 800;
  border-radius: 14px; transition: transform .15s ease, opacity .15s ease;
}
.primary-button:hover, .secondary-button:hover, .small-button:hover { transform: translateY(-1px); }
.primary-button { padding: 12px 17px; background: var(--accent); color: white; }
.secondary-button { padding: 12px 17px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.small-button { padding: 8px 10px; background: var(--surface-2); color: var(--muted); }

.mortgage-card { padding: 26px; }
.section-title-row h3, .mortgage-card h3 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.035em; }
.split-bar { height: 12px; border-radius: 999px; overflow: hidden; display: flex; margin: 26px 0 18px; background: var(--surface-2); }
.split-saron { background: var(--accent); width: 40%; }
.split-fix { background: var(--fix); width: 60%; }
.split-legend { display: grid; gap: 12px; }
.split-legend > div { display: grid; grid-template-columns: 12px 58px 1fr; align-items: center; gap: 8px; font-size: 13px; }
.split-legend strong { text-align: right; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.saron { background: var(--accent); }
.dot.fix { background: var(--fix); }
.cost-box { margin-top: 24px; padding: 16px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 4px; }
.cost-box span, .cost-box small { color: var(--muted); font-size: 12px; }
.cost-box strong { font-size: 22px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.metric-head { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card > strong { display: block; margin: 12px 0 4px; font-size: 26px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); }
.trend { font-size: 18px; font-weight: 900; }
.trend.up { color: var(--orange); }
.trend.down { color: var(--green); }
.trend.flat { color: var(--muted); }

.chart-card { padding: 26px; }
.chart-wrap { height: 260px; margin-top: 14px; }
.chart-wrap.tall { height: 360px; }
canvas { width: 100%; height: 100%; }
.chart-legend { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 18px; height: 3px; border-radius: 99px; }
.legend-line.saron { background: var(--accent); }
.legend-line.fix { background: var(--fix); }

.page-heading { margin: 20px 0 22px; }
.page-heading h2 { margin: 5px 0 6px; font-size: 34px; letter-spacing: -.045em; }
.page-heading p { color: var(--muted); margin: 0; }
.rates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.rate-detail-card { padding: 22px 26px; }
.rate-detail-card > strong { display: block; font-size: 32px; letter-spacing: -.05em; margin: 12px 0 22px; }
.rate-meta { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.rate-meta b { color: var(--text); }
.select { border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: var(--surface-2); color: var(--text); }
.footnote { color: var(--muted); font-size: 11px; margin: 10px 0 0; }

.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sim-control, .sim-result { padding: 26px; }
.sim-control > label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.sim-control > label strong { font-size: 26px; letter-spacing: -.03em; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.quick-scenarios { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 24px; }
.quick-scenarios button {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 10px 4px; border-radius: 12px; cursor: pointer; font-size: 12px; font-weight: 800;
  transition: all .15s ease;
}
.quick-scenarios button:hover { background: var(--surface); border-color: var(--accent); }
.quick-scenarios button.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25); }
.sim-result h3 { margin: 6px 0 24px; font-size: 27px; }
.sim-highlight { padding: 20px; border-radius: 18px; background: linear-gradient(145deg, var(--accent-soft), var(--surface-2)); display: grid; gap: 4px; margin-bottom: 18px; }
.sim-highlight span, .sim-highlight small { color: var(--muted); font-size: 12px; }
.sim-highlight strong { font-size: 32px; letter-spacing: -.04em; }
.comparison-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.comparison-row:last-child { border-bottom: none; }
.table-card { padding: 26px; margin-top: 18px; }
.scenario-table { display: grid; gap: 8px; margin-top: 18px; }
.scenario-row { display: grid; grid-template-columns: 110px 1fr 150px; gap: 16px; align-items: center; padding: 12px 14px; background: var(--surface-2); border-radius: 14px; border: 1px solid transparent; transition: all .15s ease; }
.scenario-row.active-scenario { background: var(--accent-soft); border-color: var(--accent); }
.scenario-row .saron-col, .scenario-row .amount-col { display: flex; flex-direction: column; gap: 2px; }
.scenario-row .saron-col strong, .scenario-row .amount-col strong { font-size: 14px; }
.scenario-row .saron-col small, .scenario-row .amount-col small { font-size: 11px; }
.scenario-row .amount-col { text-align: right; }
.scenario-row .bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.scenario-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.alerts-list { display: grid; gap: 12px; }
.alert-row { padding: 18px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.alert-copy { display: flex; align-items: center; gap: 14px; }
.alert-icon {
  min-width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 900;
}
.alert-copy h3 { margin: 0 0 3px; font-size: 15px; }
.alert-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.alert-controls { display: flex; align-items: center; gap: 12px; }
.threshold { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.threshold input { width: 76px; border: 0; background: transparent; color: var(--text); padding: 9px 8px; text-align: right; outline: none; }
.threshold span { padding-right: 8px; color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 48px; height: 28px; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.save-wide {
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 16px;
  display: block;
  text-align: center;
}
.toast { display: none; position: fixed; left: 50%; bottom: 105px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 999px; font-weight: 800; z-index: 99; }
.toast.show { display: block; }

.settings-card { padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-grid label { display: grid; gap: 8px; }
.form-grid label > span { font-size: 12px; color: var(--muted); font-weight: 700; }
.form-grid input,
.form-grid select {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  border-radius: 13px; padding: 12px 13px;
}
.input-prefix, .input-suffix { display: flex; align-items: center; border: 1px solid var(--line); background: var(--surface-2); border-radius: 13px; overflow: hidden; }
.input-prefix i, .input-suffix i { font-style: normal; color: var(--muted); font-size: 12px; font-weight: 800; padding: 0 12px; }
.input-prefix input, .input-suffix input { border: 0; border-radius: 0; background: transparent; }
.input-suffix i { order: 2; }
.settings-note { margin: 22px 0; padding: 16px; border-radius: 14px; background: var(--surface-2); display: flex; gap: 10px; align-items: baseline; }
.settings-note strong { font-size: 12px; }
.settings-note span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.connection-card { margin-top: 18px; padding: 24px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.connection-card h3 { margin: 5px 0 5px; }
.connection-state {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.connection-state:hover { opacity: .9; transform: translateY(-1px); }
.connection-state:active { transform: scale(.97); }
.connection-state.demo { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.connection-state.live { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.connection-state.error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }

.bottom-nav {
  position: fixed; z-index: 50; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(650px, calc(100% - 24px)); height: 68px;
  display: grid; grid-template-columns: repeat(5,1fr); align-items: stretch;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  backdrop-filter: blur(24px); box-shadow: 0 16px 50px rgba(0,0,0,.14);
  border-radius: 22px; padding: 6px;
}
.bottom-nav button {
  border: 0; border-radius: 16px; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer;
}
.bottom-nav button span { font-size: 18px; line-height: 1; }
.bottom-nav button small { font-size: 10px; font-weight: 800; }
.bottom-nav button.active { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 900px) {
  .hero-grid, .sim-grid { grid-template-columns: 1fr; }
  .metrics-grid, .rates-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  :root { --radius: 20px; }
  .app-shell { width: 100%; max-width: 1180px; padding-left: 14px; padding-right: 14px; padding-top: 8px; }
  .topbar { height: 64px; margin-bottom: 12px; }
  .brand h1 { font-size: 20px; }
  .brand-mark { width: 40px; height: 40px; }
  .demo-banner { align-items: flex-start; }
  .card, .status-card, .mortgage-card, .chart-card, .settings-card, .sim-control, .sim-result, .table-card, .provider-card, .push-card, .expiry-card, .health-overall-card, .health-sources-card, .production-card, .connection-card, .install-card, .health-detail-card, .rate-detail-card { padding: 18px; }
  .status-core { align-items: flex-start; gap: 18px; }
  .score-ring { --size: 100px; }
  .score-ring strong { font-size: 28px; }
  .status-copy h2 { font-size: 25px; }
  .status-copy p { font-size: 13px; }
  .metrics-grid, .rates-grid { gap: 10px; }
  .metric-card { padding: 15px; }
  .metric-card > strong { font-size: 22px; }
  .chart-wrap { height: 220px; }
  .chart-wrap.tall { height: 300px; }
  .page-heading h2 { font-size: 30px; }
  .rate-detail-card > strong { font-size: 27px; }
  .alert-row { align-items: stretch; flex-direction: column; gap: 14px; padding: 18px; }
  .alert-controls { width: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-left: 0; }
  .alert-controls .threshold { margin-right: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .scenario-row { grid-template-columns: 80px 1fr 115px; gap: 10px; font-size: 12px; }
  .quick-scenarios { grid-template-columns: repeat(3, 1fr); }
  .connection-card { align-items: flex-start; }
  .bottom-nav { bottom: max(8px, env(safe-area-inset-bottom)); border-radius: 20px; }
}
@media (max-width: 420px) {
  .status-core { flex-direction: column; }
  .score-ring { --size: 92px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card small { font-size: 10px; }
  .chart-legend { display: none; }
}

.top-actions { display:flex; align-items:center; gap:8px; }
.logout-form { margin:0; }
.connection-state.live { background: var(--green-soft); color: var(--green); }

.personal-radar-card { margin: 18px 0; }
.personal-radar-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-top:20px; }
.personal-kpi { padding:16px; background:var(--surface-2); border:1px solid var(--line); border-radius:17px; display:grid; gap:6px; min-width:0; }
.personal-kpi span { color:var(--muted); font-size:11px; font-weight:700; }
.personal-kpi strong { font-size:23px; letter-spacing:-.04em; white-space:nowrap; }
.personal-kpi small { color:var(--muted); font-size:11px; line-height:1.35; }
.personal-advice { margin-top:14px; padding:15px 16px; border:1px solid var(--line); border-radius:17px; display:flex; gap:12px; align-items:flex-start; background:var(--surface-solid); }
.personal-advice-dot { width:10px; height:10px; margin-top:5px; border-radius:50%; background:var(--green); flex:0 0 auto; }
.personal-advice.amber .personal-advice-dot { background:var(--amber); }
.personal-advice.orange .personal-advice-dot { background:var(--orange); }
.personal-advice.red .personal-advice-dot { background:var(--red); }
.personal-advice strong { font-size:13px; }
.personal-advice p { margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }

.provider-card { padding:26px; margin-bottom:18px; }
.provider-note { color:var(--muted); font-size:11px; }
.provider-table { display:grid; gap:8px; margin-top:18px; }
.provider-row { display:grid; grid-template-columns:minmax(130px,1.5fr) minmax(80px,.7fr) minmax(80px,.7fr); gap:10px; align-items:center; padding:12px 14px; background:var(--surface-2); border-radius:14px; font-size:13px; }
.provider-row.header { background:transparent; color:var(--muted); padding-top:0; padding-bottom:7px; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.provider-row strong { text-align:right; }
.provider-row .best { color:var(--green); }
.provider-row .provider-name { font-weight:800; }
.provider-row .source-note { display:block; color:var(--muted); font-size:10px; margin-top:2px; font-weight:500; }
.provider-empty { color:var(--muted); padding:12px 0; }

@media (max-width:900px) {
  .personal-radar-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:520px) {
  .personal-radar-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .personal-kpi { padding:13px; }
  .personal-kpi strong { font-size:19px; }
  .provider-row { grid-template-columns:minmax(105px,1.4fr) 70px 70px; padding:11px 10px; gap:7px; font-size:12px; }
}

.toast.error { background: var(--red); color: #fff; border: 1px solid color-mix(in srgb, var(--red) 75%, #fff); }

.push-card { padding:26px; margin-bottom:18px; }
.push-card-head { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.push-brand { display:flex; align-items:center; gap:12px; }
.push-brand h3 { margin:3px 0 0; font-size:22px; letter-spacing:-.035em; }
.push-icon { width:42px; height:42px; border-radius:14px; display:grid; place-items:center; background:linear-gradient(145deg,var(--accent),var(--accent-2)); color:#fff; font-size:19px; font-weight:900; }
.push-state { padding:7px 10px; border-radius:999px; font-size:10px; font-weight:900; letter-spacing:.07em; }
.push-state.off { background:var(--surface-2); color:var(--muted); }
.push-state.ready { background:var(--green-soft); color:var(--green); }
.push-intro { margin:18px 0; color:var(--muted); font-size:13px; line-height:1.55; max-width:760px; }
.push-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.push-form-grid > label { display:grid; gap:7px; min-width:0; }
.push-form-grid > label > span:first-child { color:var(--muted); font-size:11px; font-weight:750; }
.push-form-grid input[type="url"],
.push-form-grid input[type="text"],
.push-form-grid input[type="password"] { width:100%; border:1px solid var(--line); background:var(--surface-2); color:var(--text); border-radius:13px; padding:12px 13px; }
.push-form-grid label small { color:var(--muted); font-size:10px; line-height:1.45; }
.push-form-grid em { font-style:normal; font-weight:500; color:var(--muted); }
.push-toggle-row { grid-column:1/-1; display:flex !important; align-items:center; justify-content:space-between; gap:18px; padding:14px 16px; border-radius:15px; background:var(--surface-2); border:1px solid var(--line); }
.push-toggle-row > span:first-child { display:grid; gap:3px; color:var(--text) !important; }
.push-toggle-row strong { font-size:13px; }
.push-toggle-row small { font-size:10px; color:var(--muted); font-weight:500; }
.push-topic-field { grid-column:1/-1; }
.push-inline-input { display:flex; gap:8px; }
.push-inline-input input { flex:1; min-width:0; }
.push-subscribe-box { margin-top:15px; padding:15px 16px; border-radius:16px; border:1px solid var(--line); background:var(--surface-2); display:flex; align-items:center; justify-content:space-between; gap:18px; }
.push-subscribe-box > div { display:grid; gap:3px; min-width:0; }
.push-subscribe-box strong { font-size:14px; overflow-wrap:anywhere; }
.push-subscribe-box small { color:var(--muted); font-size:10px; overflow-wrap:anywhere; }
.push-actions { margin-top:14px; display:flex; gap:9px; flex-wrap:wrap; }

@media (max-width:620px) {
  .push-card { padding:18px; }
  .push-form-grid { grid-template-columns:1fr; }
  .push-topic-field { grid-column:auto; }
  .push-toggle-row { grid-column:1 / -1; }
  .push-toggle-row { flex-direction:row; }
  .push-subscribe-box { align-items:flex-start; flex-direction:column; }
  .push-subscribe-box .secondary-button { width:100%; }
  .push-actions > button { flex:1; min-width:135px; }
}

@media (max-width:420px) {
  .push-inline-input { display:grid; grid-template-columns:1fr; }
  .push-inline-input .small-button { width:100%; padding:11px 12px; }
  .push-card-head { align-items:flex-start; }
  .push-state { flex:0 0 auto; }
}

.expiry-card { padding:26px; margin:18px 0; overflow:hidden; }
.expiry-title-row { align-items:flex-start; }
.expiry-phase { padding:7px 10px; border-radius:999px; font-size:10px; font-weight:900; letter-spacing:.08em; white-space:nowrap; }
.expiry-phase.neutral { background:var(--surface-2); color:var(--muted); }
.expiry-phase.green { background:var(--green-soft); color:var(--green); }
.expiry-phase.amber { background:var(--amber-soft); color:var(--amber); }
.expiry-phase.orange { background:var(--orange-soft); color:var(--orange); }
.expiry-phase.red { background:var(--red-soft); color:var(--red); }

.expiry-grid { display:grid; grid-template-columns:1.25fr repeat(3,1fr); gap:11px; margin-top:20px; }
.expiry-countdown, .expiry-kpi { min-width:0; padding:16px; border-radius:17px; border:1px solid var(--line); background:var(--surface-2); display:grid; gap:5px; }
.expiry-countdown strong { font-size:28px; letter-spacing:-.045em; }
.expiry-kpi > span, .expiry-countdown small, .expiry-kpi small { color:var(--muted); font-size:11px; line-height:1.4; }
.expiry-kpi strong { font-size:22px; letter-spacing:-.04em; }
.expiry-kpi small.positive { color:var(--red); }
.expiry-kpi small.negative { color:var(--green); }

.expiry-timeline { margin:20px 0 16px; }
.expiry-track { height:9px; border-radius:99px; background:var(--surface-2); border:1px solid var(--line); overflow:hidden; }
.expiry-progress { display:block; height:100%; width:0%; border-radius:inherit; background:linear-gradient(90deg,var(--green),var(--accent-2),var(--amber),var(--orange),var(--red)); transition:width .35s ease; }
.expiry-marks { display:grid; grid-template-columns:repeat(5,1fr); margin-top:7px; color:var(--muted); font-size:10px; }
.expiry-marks span:nth-child(2),
.expiry-marks span:nth-child(3),
.expiry-marks span:nth-child(4) { text-align:center; }
.expiry-marks span:last-child { text-align:right; }

.expiry-advice { display:flex; align-items:flex-start; gap:12px; padding:15px 16px; border-radius:17px; border:1px solid var(--line); background:var(--surface-solid); }
.expiry-advice-icon { width:34px; height:34px; flex:0 0 auto; border-radius:11px; display:grid; place-items:center; font-size:16px; background:var(--surface-2); color:var(--muted); }
.expiry-advice strong { font-size:13px; }
.expiry-advice p { margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.expiry-advice.green .expiry-advice-icon { background:var(--green-soft); color:var(--green); }
.expiry-advice.amber .expiry-advice-icon { background:var(--amber-soft); color:var(--amber); }
.expiry-advice.orange .expiry-advice-icon { background:var(--orange-soft); color:var(--orange); }
.expiry-advice.red .expiry-advice-icon { background:var(--red-soft); color:var(--red); }

.expiry-footer { margin-top:13px; display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--muted); font-size:11px; }

.expiry-alert-card { padding:18px 26px; }
.expiry-alert-head { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.expiry-alert-months { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:15px 0 10px 0; }
.expiry-alert-months label { position:relative; cursor:pointer; }
.expiry-alert-months input { position:absolute; opacity:0; pointer-events:none; }
.expiry-alert-months span { display:block; padding:9px 8px; text-align:center; border:1px solid var(--line); background:var(--surface-2); color:var(--muted); border-radius:12px; font-size:11px; font-weight:800; transition:.18s; }
.expiry-alert-months input:checked + span { background:var(--accent-soft); color:var(--accent); border-color:color-mix(in srgb,var(--accent) 35%,var(--line)); }
.expiry-alert-note { display:block; margin:0; color:var(--muted); font-size:10px; line-height:1.4; }

@media (max-width:900px) {
  .expiry-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:620px) {
  .expiry-card { padding:18px; }
  .expiry-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .expiry-countdown, .expiry-kpi { padding:13px; }
  .expiry-countdown strong { font-size:23px; }
  .expiry-kpi strong { font-size:19px; }
  .expiry-footer { align-items:flex-start; flex-direction:column; }
  .expiry-alert-card { padding:18px; }
  .expiry-alert-head { display:flex; flex-direction:column; align-items:stretch; gap:14px; }
  .expiry-alert-head .alert-controls { width:100%; display:flex; justify-content:flex-end; }
  .expiry-alert-months { grid-template-columns:repeat(2,1fr); margin:12px 0 10px 0; }
  .expiry-alert-note { margin:0; }
}
@media (max-width:420px) {
  .expiry-title-row { flex-direction:column; align-items:flex-start; }
  .expiry-grid { grid-template-columns:1fr 1fr; }
}

.connection-actions { display:flex; flex-direction:column; align-items:flex-end; gap:8px; }

.system-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.health-overall-card { padding:24px 26px; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:16px; }
.health-overall-icon { width:46px; height:46px; border-radius:15px; display:grid; place-items:center; background:var(--surface-2); font-size:22px; font-weight:900; }
.health-overall-card h3 { margin:4px 0 3px; font-size:22px; }
.health-overall-card p { margin:0; color:var(--muted); font-size:12px; }
.health-badge { padding:8px 11px; border-radius:999px; font-size:10px; font-weight:900; letter-spacing:.08em; }
.health-badge.ok { background:var(--green-soft); color:var(--green); }
.health-badge.warning { background:var(--amber-soft); color:var(--amber); }
.health-badge.error { background:var(--red-soft); color:var(--red); }
.health-badge.unknown { background:var(--surface-2); color:var(--muted); }

.health-kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin:16px 0; }
.health-kpi { padding:17px; display:grid; gap:5px; }
.health-kpi > span { color:var(--muted); font-size:11px; font-weight:750; }
.health-kpi strong { font-size:22px; letter-spacing:-.04em; }
.health-kpi small { color:var(--muted); font-size:10px; line-height:1.4; }

.health-sources-card { padding:24px 26px; }
.health-source-list { display:grid; gap:8px; margin-top:17px; }
.health-source-row { display:grid; grid-template-columns:12px minmax(130px,1fr) auto; gap:10px; align-items:center; padding:12px 13px; border-radius:14px; background:var(--surface-2); }
.health-source-dot { width:9px; height:9px; border-radius:50%; background:var(--muted); }
.health-source-dot.ok { background:var(--green); }
.health-source-dot.warning { background:var(--amber); }
.health-source-dot.error { background:var(--red); }
.health-source-main { min-width:0; }
.health-source-main strong { display:block; font-size:13px; }
.health-source-main small { display:block; margin-top:2px; color:var(--muted); font-size:10px; line-height:1.35; overflow-wrap:anywhere; }
.health-source-state { font-size:10px; font-weight:900; letter-spacing:.06em; color:var(--muted); white-space:nowrap; }

.health-detail-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:16px; }
.health-detail-card { padding:22px 26px; }
.health-detail-card h3 { margin:5px 0 5px; font-size:17px; }
.health-detail-card p { margin:0; color:var(--muted); font-size:11px; line-height:1.45; }

@media (max-width:780px) {
  .health-kpi-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:620px) {
  .system-heading { flex-direction:column; }
  .system-heading .secondary-button { width:100%; }
  .health-overall-card { grid-template-columns:auto 1fr; }
  .health-overall-card .health-badge { grid-column:1/-1; justify-self:start; }
  .health-detail-grid { grid-template-columns:1fr; }
  .connection-actions { align-items:flex-start; }
  .connection-card { flex-direction:column; }
}

.decision-card { position:relative; overflow:hidden; }
.decision-hero { display:flex; align-items:center; gap:20px; margin:24px 0 20px; position:relative; }
.decision-symbol {
  width:78px; height:78px; flex:0 0 auto; border-radius:24px; display:grid; place-items:center;
  font-size:34px; font-weight:900; background:var(--surface-2); color:var(--muted); border:1px solid var(--line);
}
.decision-symbol.green { background:var(--green-soft); color:var(--green); }
.decision-symbol.amber { background:var(--amber-soft); color:var(--amber); }
.decision-symbol.orange { background:var(--orange-soft); color:var(--orange); }
.decision-symbol.red { background:var(--red-soft); color:var(--red); }
.status-pill.neutral { background:var(--surface-2); color:var(--muted); }

.decision-economics { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin-bottom:18px; }
.decision-economics > div { min-width:0; padding:13px 14px; background:var(--surface-2); border:1px solid var(--line); border-radius:15px; display:grid; gap:4px; }
.decision-economics span { color:var(--muted); font-size:10px; font-weight:750; line-height:1.3; }
.decision-economics strong { font-size:19px; letter-spacing:-.04em; }
.decision-economics small { color:var(--muted); font-size:9px; line-height:1.35; }

.decision-score-grid { display:grid; gap:10px; padding:15px 16px; border-radius:17px; border:1px solid var(--line); background:var(--surface-solid); }
.decision-score-row { display:grid; grid-template-columns:155px 1fr; gap:12px; align-items:center; }
.decision-score-row > div:first-child { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.decision-score-row span { color:var(--muted); font-size:10px; font-weight:750; }
.decision-score-row strong { font-size:11px; }
.decision-score-track { height:7px; border-radius:99px; background:var(--surface-2); overflow:hidden; }
.decision-score-track i { display:block; height:100%; width:0%; border-radius:inherit; background:var(--accent); transition:width .35s ease; }
.decision-score-row:nth-child(2) .decision-score-track i { background:var(--orange); }
.decision-score-row:nth-child(3) .decision-score-track i { background:var(--fix); }

.decision-reasons { display:flex; gap:7px; flex-wrap:wrap; margin:16px 0 0; }
.decision-reasons:empty { display:none; margin:0; }
.decision-reason { display:flex; align-items:center; gap:6px; padding:7px 9px; border-radius:999px; background:var(--surface-2); border:1px solid var(--line); font-size:10px; }
.decision-reason span { color:var(--muted); }
.decision-reason strong { font-size:10px; }
.decision-reason.good strong { color:var(--green); }
.decision-reason.watch strong { color:var(--amber); }
.decision-reason.alert strong { color:var(--red); }
.decision-method-note { margin:16px 0 0; color:var(--muted); font-size:9px; line-height:1.4; }

.decision-key-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0 14px;
}
.key-rate-box {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.key-rate-box.saron {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
}
.key-rate-box.fix {
  border-color: color-mix(in srgb, var(--fix) 30%, var(--line));
  background: color-mix(in srgb, var(--fix) 6%, var(--surface-2));
}
.key-rate-box .label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.key-rate-box strong {
  font-size: 24px;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
}
.key-rate-box.saron strong {
  color: var(--accent);
}
.key-rate-box.fix strong {
  color: var(--fix);
}
.key-rate-box small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.decision-details-toggle {
  margin: 8px 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.decision-details-toggle > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  user-select: none;
  transition: background .15s ease, color .15s ease;
}
.decision-details-toggle > summary::-webkit-details-marker { display: none; }
.decision-details-toggle > summary:hover { color: var(--text); background: var(--surface-2); }
.decision-details-toggle[open] > summary { border-bottom: 1px solid var(--line); color: var(--text); }
.decision-details-toggle[open] .disclosure-chevron { transform: rotate(180deg); }
.decision-details-content {
  padding: 16px;
  display: grid;
  gap: 14px;
  background: var(--surface-solid);
}

.mortgage-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.mortgage-kpi-row .cost-box,
.mortgage-kpi-row .expiry-summary-box {
  margin: 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mortgage-kpi-row .expiry-summary-box span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 750;
}
.mortgage-kpi-row strong {
  font-size: 17px;
  letter-spacing: -0.03em;
}
.mortgage-kpi-row small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width:620px) {
  .decision-hero { align-items:flex-start; gap:14px; }
  .decision-symbol { width:58px; height:58px; border-radius:18px; font-size:27px; }
  .decision-key-rates { grid-template-columns: 1fr; gap: 8px; }
  .mortgage-kpi-row { grid-template-columns: 1fr; gap: 8px; }
  .decision-economics { grid-template-columns:1fr 1fr; }
  .decision-economics > div:first-child { grid-column:1/-1; }
  .decision-score-row { grid-template-columns:1fr; gap:5px; }
  .status-actions { flex-direction:column; align-items:stretch; width:100%; margin-top:20px; gap:10px; }
  .status-actions button { width:100%; text-align:center; }
}
@media (max-width:390px) {
  .decision-economics { grid-template-columns:1fr; }
  .decision-economics > div:first-child { grid-column:auto; }
}

/* v12 final UX */
.top-live-chip {
  display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 10px;
  border-radius:999px; border:1px solid var(--line); background:var(--surface);
  color:var(--muted); font-size:10px; font-weight:850; letter-spacing:.04em;
  cursor:pointer; user-select:none;
  transition: transform .15s ease, opacity .15s ease, border-color .15s ease;
}
.top-live-chip:hover { opacity:.9; transform:translateY(-1px); border-color:color-mix(in srgb, var(--accent) 40%, var(--line)); }
.top-live-chip:active { transform:scale(.96); }
.top-live-chip i { width:7px; height:7px; border-radius:50%; background:var(--muted); }
.top-live-chip.live i { background:var(--green); }
.top-live-chip.live { color:var(--green); }
.top-live-chip.warning i { background:var(--amber); }
.top-live-chip.warning { color:var(--amber); }
.top-live-chip.error i { background:var(--red); }
.top-live-chip.error { color:var(--red); }

.info-dot {
  width:17px; height:17px; display:inline-grid; place-items:center; vertical-align:middle;
  margin-left:3px; padding:0; border-radius:50%; border:1px solid var(--line);
  background:var(--surface-2); color:var(--muted); font-size:9px; font-weight:900;
  cursor:help; position:relative;
}
.info-dot::after {
  content:attr(data-tip); position:absolute; z-index:90; left:50%; bottom:calc(100% + 8px);
  transform:translateX(-50%); width:min(260px,75vw); padding:9px 10px;
  border-radius:11px; background:var(--text); color:var(--bg); font-size:10px;
  line-height:1.45; font-weight:550; letter-spacing:0; text-transform:none;
  box-shadow:0 10px 30px rgba(0,0,0,.22); opacity:0; pointer-events:none;
  transition:opacity .15s ease;
}
.info-dot:hover::after,
.info-dot:focus-visible::after,
.info-dot.tip-open::after { opacity:1; }

.detail-disclosure { padding:0; margin:18px 0; overflow:hidden; }
.detail-disclosure > summary {
  list-style:none; cursor:pointer; padding:18px 26px; display:flex; align-items:center;
  justify-content:space-between; gap:15px;
}
.detail-disclosure > summary::-webkit-details-marker { display:none; }
.detail-disclosure > summary > div { display:grid; gap:4px; }
.detail-disclosure > summary strong { font-size:16px; }
.disclosure-chevron { font-size:22px; color:var(--muted); transition:transform .2s ease; }
.detail-disclosure[open] .disclosure-chevron { transform:rotate(180deg); }
.detail-disclosure-body { border-top:1px solid var(--line); padding:18px 26px 26px; }
.detail-disclosure .personal-radar-grid { margin-top:0; }

.install-card {
  margin-top:18px; padding:22px 26px; display:grid; grid-template-columns:auto 1fr auto;
  align-items:center; gap:14px;
}
.install-card.hidden { display:none; }
.install-card-icon {
  width:42px; height:42px; border-radius:14px; display:grid; place-items:center;
  background:var(--accent-soft); color:var(--accent); font-size:20px; font-weight:900;
}
.install-card-copy h3 { margin:4px 0 4px; font-size:16px; }
.install-card-copy p { margin:0; color:var(--muted); font-size:11px; line-height:1.4; }

.form-validation {
  display:none; margin:0 0 15px; padding:11px 12px; border-radius:12px;
  background:var(--red-soft); color:var(--red); font-size:11px; line-height:1.5;
}
.form-validation.show { display:block; }

.production-card { padding:24px 26px; margin-top:16px; }
.production-score {
  min-width:55px; text-align:center; padding:8px 10px; border-radius:999px;
  background:var(--surface-2); color:var(--muted); font-size:11px; font-weight:900;
}
.production-score.ok { background:var(--green-soft); color:var(--green); }
.production-score.warning { background:var(--amber-soft); color:var(--amber); }
.production-check-list { display:grid; gap:8px; margin-top:17px; }
.production-check {
  display:grid; grid-template-columns:24px 1fr; gap:10px; align-items:flex-start;
  padding:11px 12px; border-radius:13px; background:var(--surface-2);
}
.production-check-icon {
  width:22px; height:22px; border-radius:8px; display:grid; place-items:center;
  font-size:11px; font-weight:900; background:var(--surface-solid); color:var(--muted);
}
.production-check.ok .production-check-icon { background:var(--green-soft); color:var(--green); }
.production-check.warning .production-check-icon { background:var(--amber-soft); color:var(--amber); }
.production-check.error .production-check-icon { background:var(--red-soft); color:var(--red); }
.production-check strong { display:block; font-size:12px; }
.production-check small { display:block; margin-top:2px; color:var(--muted); font-size:10px; line-height:1.4; }

.app-footer {
  display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap;
  margin:24px 0 4px; color:var(--muted); font-size:9px;
}
.app-footer span + span::before { content:"·"; margin-right:8px; }
.app-footer strong { color:var(--text); }

@media (max-width:620px) {
  .top-live-chip { display:none; }
  .status-card.decision-card { padding:18px; }
  .status-card .status-copy h2 { font-size:29px; line-height:1.08; }
  .status-card .status-copy p { line-height:1.48; }
  .decision-economics > div { padding:12px; }
  .decision-economics strong { font-size:17px; }
  .detail-disclosure > summary { padding:15px 18px; }
  .detail-disclosure-body { padding:15px 18px 18px; }
  .install-card { grid-template-columns:auto 1fr; padding:18px; }
  .install-card .primary-button { grid-column:1/-1; width:100%; }
  .production-card { padding:18px; }
}

/* v12.1 usability fixes */

/* Compact snackbar/toast — never a giant pill/circle on mobile. */
.toast {
  display:none;
  position:fixed;
  z-index:120;
  left:50%;
  bottom:calc(88px + env(safe-area-inset-bottom));
  transform:translate(-50%, 10px);
  width:min(420px, calc(100vw - 24px));
  max-width:420px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--surface-solid);
  color:var(--text);
  box-shadow:0 18px 55px rgba(0,0,0,.22);
  font-size:12px;
  font-weight:700;
  line-height:1.4;
  text-align:left;
  white-space:normal;
  overflow-wrap:anywhere;
  opacity:0;
}
.toast.show {
  display:block;
  animation:toastIn .18s ease forwards;
}
.toast.error {
  background:var(--red-soft);
  color:var(--red);
  border-color:color-mix(in srgb,var(--red) 30%,var(--line));
}
@keyframes toastIn {
  from { opacity:0; transform:translate(-50%, 10px); }
  to { opacity:1; transform:translate(-50%, 0); }
}

/* Generic disclosure cards */
.detail-disclosure,
.push-disclosure {
  padding:0;
  overflow:hidden;
}
.detail-disclosure > summary,
.push-disclosure > summary {
  list-style:none;
  cursor:pointer;
  user-select:none;
}
.detail-disclosure > summary::-webkit-details-marker,
.push-disclosure > summary::-webkit-details-marker { display:none; }

.detail-disclosure > summary {
  padding:18px 26px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.detail-disclosure > summary > div {
  display:grid;
  gap:4px;
}
.detail-disclosure > summary strong {
  font-size:15px;
}
.detail-disclosure-body {
  border-top:1px solid var(--line);
  padding:18px 26px 26px;
}
.detail-disclosure .personal-radar-grid {
  margin-top:0;
}
.disclosure-chevron {
  display:inline-block;
  color:var(--muted);
  font-size:20px;
  transition:transform .18s ease;
}
.detail-disclosure[open] .disclosure-chevron,
.push-disclosure[open] .disclosure-chevron {
  transform:rotate(180deg);
}

/* ntfy as a compact disclosure */
.push-disclosure {
  margin-bottom:18px;
}
.push-disclosure > summary {
  min-height:72px;
  padding:16px 26px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.push-disclosure .push-brand strong {
  display:block;
  margin-top:3px;
  font-size:14px;
}
.push-summary-right {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.push-disclosure-body {
  border-top:1px solid var(--line);
  padding:18px 26px 26px;
}
.push-disclosure .push-intro {
  margin-top:0;
}
.push-validation {
  display:none;
  margin:14px 0 0;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid color-mix(in srgb,var(--red) 25%,var(--line));
  background:var(--red-soft);
  color:var(--red);
  font-size:11px;
  font-weight:700;
  line-height:1.45;
}
.push-validation.show {
  display:block;
}

@media (max-width:620px) {
  .detail-disclosure > summary { padding:15px 18px; }
  .detail-disclosure-body { padding:15px 18px 18px; }

  .push-disclosure > summary {
    padding:13px 18px;
    min-height:66px;
  }
  .push-disclosure-body { padding:15px 18px 18px; }
  .push-summary-right { gap:7px; }
  .push-state {
    font-size:9px;
    padding:6px 8px;
    max-width:150px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .toast {
    bottom:calc(82px + env(safe-area-inset-bottom));
    width:calc(100vw - 20px);
    padding:11px 12px;
    border-radius:13px;
    font-size:11px;
  }
}

/* v12.6.2 — real scroll spacer below page content on mobile.
   The fixed navigation is outside normal document flow, so the footer
   itself creates enough trailing space to scroll the final card above it. */
@media (max-width: 620px) {
  .app-shell {
    padding-bottom: 0;
  }

  .app-footer {
    margin-bottom: calc(
      var(--nav-h) + 72px + env(safe-area-inset-bottom)
    );
  }

  html,
  body {
    scroll-padding-bottom: calc(
      var(--nav-h) + 72px + env(safe-area-inset-bottom)
    );
  }
}

/* v12.6.6 — one canonical mobile page gutter.
   All cards/pages now share the same 14px distance from the viewport edge. */
@media (max-width: 620px) {
  .app-shell {
    width: 100%;
    max-width: 1180px;
    padding-left: 14px;
    padding-right: 14px;
  }
}
