:root {
  --ink: #111111;
  --muted: #6b7280;
  --bg: #fafafa;
  --card: #ffffff;
  --line: #ebebeb;
  --navy: #111111;
  --navy-2: #111111;
  --accent: #0f766e;
  --accent-soft: #f0fdfa;
  --accent-2: #0f766e;
  --loss: #e11d48;
  --gain: #059669;
  --shadow: none;
  --radius: 12px;
  --radius-sm: 8px;
  font-family: Inter, "Noto Sans Devanagari", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); }
img, svg, video { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Shell */
body.app-body { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; min-height: 100dvh; }
aside {
  background: #111111;
  color: #fafafa; padding: 16px 10px; position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 18px;
}
.side-bar { display: flex; flex-direction: column; gap: 10px; }
.side-drawer { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }
button.nav-toggle {
  display: none; width: 44px; height: 44px; flex: 0 0 auto; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: #fafafa;
  align-items: center; justify-content: center;
}
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
aside.nav-open .nav-toggle-icon { background: transparent; }
aside.nav-open .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
aside.nav-open .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }
.brand {
  display: flex; align-items: center; gap: 10px; color: white; font-weight: 600;
  letter-spacing: -0.03em; text-decoration: none; font-size: 0.95rem; padding: 4px 8px;
}
.brand:hover { text-decoration: none; }
.logo {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: #ffffff; color: #111111; font-weight: 600; font-size: 0.8rem;
}
aside nav { display: flex; flex-direction: column; gap: 2px; }
aside nav a {
  color: #a3a3a3; text-decoration: none; padding: 7px 10px; border-radius: 8px; font-weight: 500; font-size: 0.875rem;
}
aside nav a:hover { background: rgba(255, 255, 255, 0.06); color: white; text-decoration: none; }
aside nav a.active { background: #ffffff; color: #111111; text-decoration: none; }
.side-end { margin-top: auto; }
.side-foot { margin-top: auto; color: #737373; font-size: 0.78rem; padding: 8px; }
.lang-switch { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.lang-switch label { font-size: 0.72rem; color: #737373; }
.lang-switch select {
  width: 100%; background: #1c1c1c; color: #fafafa; border: 1px solid #3f3f3f;
  border-radius: 8px; padding: 6px 8px; font: inherit;
}
.lang-switch.light { width: 11rem; align-self: flex-end; margin-bottom: 0; }
.lang-switch.light label { color: var(--muted); }
.lang-switch.light select { background: #fff; color: #111; border-color: var(--line); }
.auth-stack { width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; }
.auth-stack .login { width: 100%; max-width: none; }
html[lang="hi"] body, html[lang="mr"] body {
  font-family: "Noto Sans Devanagari", Inter, ui-sans-serif, system-ui, sans-serif;
}
.side-foot button.link { background: none; border: 0; color: #fafafa; padding: 0; font: inherit; font-weight: 500; cursor: pointer; }

.content { min-width: 0; }
main { max-width: 1440px; margin: 0 auto; padding: 20px 24px 64px; }

/* Type */
h1 { font-weight: 600; font-size: 1.5rem; letter-spacing: -0.035em; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 0.95rem; margin: 0 0 10px; letter-spacing: -0.02em; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 0.92rem; line-height: 1.45; }
.page-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.page-header .sub { margin: 0; }
.page-header .actions, .header-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.header-tools { flex-direction: column; align-items: flex-end; }
.quiet-links { display: flex; gap: 12px; font-size: 0.82rem; flex-wrap: wrap; }
.quiet-links a { color: var(--muted); font-weight: 500; }

/* Cards & KPIs */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.grid.impact { grid-template-columns: repeat(3, 1fr); }
.kpi-strip { display: grid; grid-template-columns: 1.4fr 1fr 1fr 0.8fr; gap: 12px; margin-bottom: 16px; }
.kpi-strip .hero .value { font-size: 1.85rem; font-weight: 600; letter-spacing: -0.045em; }
.charts { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; margin: 0 0 18px; }
.book-split {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px; align-items: start; margin-bottom: 22px;
}
.book-split > :only-child { grid-column: 1 / -1; }
.metric-bar {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 0.75fr;
  background: white; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 14px; overflow: hidden;
}
.metric-bar.since { grid-template-columns: 1.25fr 1fr 1.15fr; }
.metric { padding: 12px 16px; border-left: 1px solid var(--line); min-width: 0; }
.metric:first-child { border-left: 0; }
.metric .value { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.03em; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric.hero .value { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.045em; }
.metric .hint { margin-top: 2px; }
.suggest-list { border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.suggest-row { border-bottom: 1px solid var(--line); background: white; }
.suggest-row:last-child { border-bottom: 0; }
.suggest-row summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 12px; cursor: pointer; list-style: none;
}
.suggest-row summary::-webkit-details-marker { display: none; }
.suggest-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.84rem; color: var(--ink); }
.suggest-amt { font-size: 0.84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.suggest-body { padding: 0 12px 10px; font-size: 0.84rem; line-height: 1.45; color: #374151; }
.suggest-body p { margin: 6px 0; }
.chart-band { max-height: 180px; overflow: auto; margin-bottom: 16px; }
.chart-band .bar-row { margin: 4px 0; }
.suggest .advice { max-height: 520px; overflow: auto; padding-right: 2px; }
.admin-split {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.75fr);
  gap: 16px; align-items: start;
}
.admin-split > :only-child { grid-column: 1 / -1; }
.tool-list { display: grid; gap: 12px; }
.tool-card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.tool-card .sub { margin: 0 0 12px; }
.toolbar { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.toolbar .search { flex: 1; margin: 0; align-items: center; }
.toolbar .search input { max-width: none; }
.toolbar details.tools { flex: 0 0 280px; margin: 0; padding: 0; }
.card, .panel, form.card, .chart-card, .offer-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.section { margin-bottom: 22px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.card .label, .label {
  color: var(--muted); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
}
.card .value { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 0.84rem; margin-top: 4px; line-height: 1.4; }
.plan-card h2 { font-size: 1.25rem; margin: 4px 0 0; font-weight: 600; }
.plan-step {
  display: flex; justify-content: space-between; gap: 16px; align-items: end;
  margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line);
}
.plan-step .value { font-size: 1.25rem; }
.plan-step p { margin: 0; max-width: 280px; color: var(--ink); font-weight: 500; text-align: right; font-size: 0.9rem; }
.reading { font-size: 1rem; line-height: 1.55; margin: 12px 0 0; white-space: pre-line; color: #1e293b; }
.follow-up { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 500; font-size: 0.95rem; }
.gain { color: var(--gain); }
.loss { color: var(--loss); }

/* Tables */
.table-wrap, .overflow-x-auto {
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: auto; box-shadow: var(--shadow); max-height: min(70vh, 720px); max-width: 100%;
  min-width: 0; -webkit-overflow-scrolling: touch;
}
.overflow-x-auto { background: transparent; border: 0; box-shadow: none; max-height: none; }
.table-wrap table, .overflow-x-auto table { width: max-content; min-width: 100%; }
.table-wrap th, .table-wrap td, .overflow-x-auto th, .overflow-x-auto td { white-space: nowrap; }
table.analyse .why { white-space: normal; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
th {
  font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 500;
  background: #fafafa; position: sticky; top: 0; z-index: 1;
}
th a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th a:hover { color: var(--ink); }
.arrow { color: var(--accent); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #fafafa; }
td form { margin: 0; }
td.wrap { white-space: normal; min-width: 160px; max-width: 280px; }
.table-wrap + .pager, .pager + .table-wrap { margin-top: 10px; }
.fund-cards { display: none; }
.fund-card {
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow);
}
.fund-card a { font-weight: 600; }
.fund-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 8px 0 0; }
.fund-card dt { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; }
.fund-card dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .fund-table { display: none; }
  .fund-cards { display: grid; gap: 10px; }
}

form.bracket { display: flex; gap: 6px; align-items: center; margin: 0; }
td form.bracket select { min-width: 140px; padding: 4px 8px; }
form.bracket select { width: auto; min-width: 220px; padding: 6px 8px; }
form.bracket button { padding: 6px 12px; }
form.bracket label { margin: 0; }
form.sale { display: flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
form.sale input { width: 130px; padding: 6px 8px; }

/* Charts */
.chart { min-height: 180px; }
.donut-chart { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; }
.donut { width: 150px; height: 150px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 0.88rem; }
.legend li span { overflow-wrap: anywhere; }
.legend i { width: 10px; height: 10px; border-radius: 99px; display: block; }
.legend b { font-variant-numeric: tabular-nums; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 0.86rem; }
.bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bar-row b { font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.bar-track { background: #eef2f7; border-radius: 99px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; }

/* Advice */
.advice { display: grid; gap: 10px; margin: 0 0 8px; }
.advice article { border-left: 3px solid var(--accent); }
.advice-more { margin-top: 8px; }
.advice-more summary {
  cursor: pointer; font-weight: 700; color: var(--muted); font-size: 0.9rem; padding: 8px 0;
}
.pill {
  display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--accent-soft);
  color: #115e59; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
}
.pill.add { background: #dcfce7; color: #166534; }
.pill.trim { background: #ffedd5; color: #9a3412; }
.pill.book { background: #e0e7ff; color: #3730a3; }
.pill.exit { background: #ffe4e6; color: #9f1239; }
.advice .at_target .pill, .advice .too_small .pill, .advice .too_small_new .pill,
.advice .too_many .pill, .advice .no_price .pill, .advice .no_base .pill { background: #ffedd5; color: #9a3412; }

/* Pager / search */
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 12px 0; color: var(--muted); font-size: 0.88rem; }
.pager a, .pager .current {
  min-width: 32px; text-align: center; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line);
  background: white; color: var(--ink); text-decoration: none; font-weight: 500;
}
.pager .current { background: var(--navy); color: white; border-color: var(--navy); }
.search { display: flex; gap: 8px; align-items: end; margin-bottom: 14px; }
.search input { max-width: 360px; }

/* Buttons & forms */
button, .button {
  background: var(--accent); color: white; border: 0; border-radius: 8px;
  padding: 8px 14px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block;
}
button:disabled { background: #e2e8f0; color: #64748b; cursor: not-allowed; }
button.secondary, a.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: #fef2f2; color: #9f1239; border: 1px solid #fecdd3; }
button.small, a.small { padding: 5px 10px; font-size: 0.82rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
a.small { display: inline-block; margin-left: 8px; border-radius: 10px; font-weight: 700; text-decoration: none; vertical-align: middle; }
label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: white; font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 118, 110, 0.25); border-color: #5eead4; }
textarea { min-height: 110px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error, .flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 0.92rem; }
.error { background: #ffe4e6; color: #9f1239; }
.flash { background: #d1fae5; color: #065f46; }
.preview { background: #eef2ff; border: 1px solid #c7d2fe; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-size: 0.9rem; }
.empty {
  text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line);
  border-radius: var(--radius); background: #fafbfc;
}

/* Auth */
.login { width: min(560px, 100%); max-width: 560px; padding: 36px 40px; }
.login h1 { font-size: 2rem; }
.login input { padding: 14px 16px; font-size: 1.05rem; }
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: #fafafa;
}
.auth-body .card { box-shadow: none; }
.auth-kicker { color: var(--muted); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; margin: 0 0 8px; }
.auth-links { margin-top: 16px; font-size: 0.9rem; color: var(--muted); }
.auth-links a { font-weight: 500; }

/* Check / questions */
.check { margin-bottom: 18px; }
.question { border: 0; margin: 0 0 16px; padding: 0; }
.question legend { font-weight: 600; margin-bottom: 6px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; background: #fafafa;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-weight: 500;
}
.choice input { width: auto; flex: 0 0 auto; margin-top: 3px; }
.check form + form { margin-top: 10px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.plan-grid .fit { border: 2px solid var(--accent); }
.progress-line { height: 4px; background: #ebebeb; border-radius: 99px; overflow: hidden; margin: 0 0 18px; }
.progress-line span { display: block; height: 100%; background: var(--accent); }
details.card summary { cursor: pointer; font-weight: 600; }
details.tools { margin-bottom: 16px; }
details.tools summary {
  cursor: pointer; font-weight: 500; padding: 12px 14px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
details.tools summary::-webkit-details-marker { display: none; }
details.tools[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tools-body { padding: 0 16px 16px; }

/* Guest marketing */
.offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 22px; }
.offer-card h3 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: -0.02em; }
.offer-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.steps { display: grid; gap: 10px; margin: 12px 0 20px; }
.step-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white;
}
.step-num {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: #115e59; font-weight: 600; font-size: 0.82rem;
}
.step-row.done { border-color: #a7f3d0; background: #f0fdf4; }
.step-row .meta { color: var(--muted); font-size: 0.84rem; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 12px 0; }
.slot-grid label {
  margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white;
  font-weight: 650; color: var(--ink); cursor: pointer; text-align: center; font-size: 0.88rem;
}
.slot-grid input { display: none; }
.slot-grid label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.run-banner {
  background: #fff7ed; border: 1px solid #fdba74; color: #9a3412;
  border-radius: 16px; padding: 14px 16px; margin: 0 0 16px;
}
.run-banner strong { display: block; margin-bottom: 4px; }
.run-banner p { margin: 0; }
table.analyse { min-width: 880px; }
table.analyse td { vertical-align: top; }
table.analyse .name { font-weight: 600; letter-spacing: -0.02em; }
table.analyse .meta { color: var(--muted); font-size: 0.78rem; margin-top: 3px; }
table.analyse .why { min-width: 240px; max-width: 360px; line-height: 1.45; }
table.analyse .move { margin-top: 8px; font-weight: 600; }
.row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.call-strip { margin-bottom: 16px; }
.call-strip .count { font-weight: 600; color: var(--ink); }
.health-panel { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.health-score {
  flex: 1 1 180px; min-width: min(200px, 100%); text-align: center;
  border-right: 1px solid var(--line); padding-right: 20px;
}
.health-score-num { font-size: 3rem; font-weight: 700; line-height: 1.1; }
.health-score-num span { font-size: 1.2rem; color: var(--muted); font-weight: 600; }
.health-recs { flex: 2 1 240px; min-width: min(280px, 100%); }
.health-recs ul { margin: 8px 0 0; padding-left: 18px; }
.shock-scale {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  flex-wrap: wrap; font-weight: 600; margin-bottom: 4px;
}
.shock-scale .down { color: var(--loss); }
.shock-scale .up { color: var(--gain); }
.shock-now { font-size: 1.05rem; }
input[type="range"] { width: 100%; height: 32px; accent-color: var(--accent); padding: 0; }
.shock-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; text-align: center; }
.shock-result small { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.shock-result strong { display: block; margin-top: 4px; font-size: 1.05rem; overflow-wrap: anywhere; }
.family-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.d-flex { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 100%; }
.d-flex > * { min-width: 0; max-width: 100%; }
.d-flex.justify-content-between { justify-content: space-between; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 980px) {
  body.app-body { display: block; }
  body.nav-open { overflow: hidden; }
  aside {
    position: sticky; top: 0; height: auto; z-index: 30; display: block;
    padding: 0; gap: 0; overflow: visible;
  }
  .side-bar {
    flex-direction: row; align-items: center; gap: 8px; width: 100%;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px 12px;
    background: #111111;
  }
  .brand { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  button.nav-toggle { display: inline-flex; border: 1px solid rgba(255,255,255,0.35); background: #1c1c1c; }
  .side-drawer {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #111111; max-height: calc(100dvh - 60px - env(safe-area-inset-top));
    overflow: auto; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    padding: 4px 8px calc(12px + env(safe-area-inset-bottom));
  }
  aside.nav-open .side-drawer { display: block; }
  aside nav { flex-direction: column; }
  aside nav a { min-height: 44px; display: flex; align-items: center; padding: 10px 12px; font-size: 1rem; }
  .side-end { margin-top: 8px; }
  .side-foot { display: block; padding: 8px; }
  .side-foot button.link {
    display: flex; align-items: center; width: 100%; min-height: 44px;
    margin-top: 6px; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.08);
  }
  .lang-slot { flex: 0 0 auto; }
  .lang-slot .lang-switch { flex-direction: row; align-items: center; margin: 0; }
  .lang-slot .lang-switch label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  }
  .lang-slot .lang-switch select { width: auto; max-width: 7.2rem; min-height: 40px; font-size: 16px; padding: 6px 8px; }
  .grid, .kpi-strip, .charts, .donut-chart, .row, .plan-grid, .offer-grid { grid-template-columns: 1fr 1fr; }
  .book-split, .admin-split, .toolbar { display: block; }
  .metric-bar { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(odd) { border-left: 0; }
  .header-tools { align-items: stretch; width: 100%; }
  .toolbar details.tools { margin-top: 12px; }
  .content, main, .section, .card, .panel, .chart-card, .metric, .page-header, .page-header > * { min-width: 0; max-width: 100%; }
  main { padding: 16px 14px calc(32px + env(safe-area-inset-bottom)); }
  .login { padding: 24px 18px; }
  .auth-body { padding: max(16px, env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px; }
  .card .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .grid, .kpi-strip, .charts, .donut-chart, .row, .plan-grid, .offer-grid { grid-template-columns: 1fr; }
  .card .grid { grid-template-columns: 1fr 1fr; }
  .book-split, .admin-split { display: block; }
  .metric-bar { grid-template-columns: 1fr; }
  .metric { border-left: 0; border-top: 1px solid var(--line); }
  .metric:first-child { border-top: 0; }
  .metric.hero .value, .kpi-strip .hero .value { font-size: 1.35rem; }
  .page-header, .header-tools { align-items: stretch; }
  .plan-step { flex-direction: column; align-items: start; }
  .plan-step p { text-align: left; }
  .step-row { grid-template-columns: 36px 1fr; }
  .step-row .button, .step-row button { grid-column: 2; justify-self: start; }
  .health-panel { flex-direction: column; align-items: stretch; }
  .health-score { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 16px; }
  .health-score-num { font-size: 2.5rem; }
  .shock-scale { flex-direction: column; align-items: center; text-align: center; }
  .shock-result { grid-template-columns: 1fr; }
  .suggest-row summary { grid-template-columns: auto minmax(0, 1fr); }
  .suggest-note { white-space: normal; }
  .suggest-amt { grid-column: 1 / -1; justify-self: start; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name value" "bar bar"; }
  .bar-row span { grid-area: name; }
  .bar-row .bar-track { grid-area: bar; }
  .bar-row b { grid-area: value; }
  form.bracket, form.sale, .search { flex-wrap: wrap; }
  form.bracket select, form.sale input, .search input { min-width: 0; width: 100%; max-width: none; }
  .login { padding: 22px 16px; }
  .login h1 { font-size: 1.6rem; }
  .auth-body {
    min-height: 100dvh; align-items: start; padding: max(16px, env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom));
  }
  .lang-switch.light { width: min(100%, 12rem); }
  button, .button { min-height: 44px; }
  button.small, a.small, .pager a, .pager .current { min-height: 40px; }
  .pager a, .pager .current { min-width: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .choice { min-height: 44px; }
  h1 { overflow-wrap: anywhere; }
  .card, .panel, form.card, .chart-card, .offer-card { padding: 14px 12px; }
}
