/*
 * PlanYourTax.in — css/app.css
 * ------------------------------------------------------------------
 * Design system: navy + saffron + green, 18–24px radii, system fonts,
 * AA contrast, visible focus, responsive 320px → desktop, print CSS.
 */

:root {
  --navy: #0B1B33;
  --navy-2: #14294A;
  --navy-3: #1E3A66;
  --saffron: #FF7A1A;
  --saffron-soft: #FFF3E9;
  --green: #0E9F6E;
  --green-soft: #E6F7F0;
  --amber: #F59E0B;
  --amber-soft: #FEF6E7;
  --red: #DC2626;
  --red-soft: #FDECEC;
  --bg: #F7F8FB;
  --card: #FFFFFF;
  --text: #111827;
  --muted: #4B5563;
  --line: #E5E7EB;
  --line-2: #D1D5DB;
  --ring: rgba(255, 122, 26, 0.35);
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 27, 51, 0.05), 0 4px 16px rgba(11, 27, 51, 0.06);
  --shadow-lg: 0 8px 32px rgba(11, 27, 51, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- reset & base ---------- */

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { display: inline-block; vertical-align: middle; }
button { font-family: inherit; }
a { color: var(--navy-3); }

h1 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }

.sub { color: var(--muted); margin-top: 6px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px; top: -48px;
  z-index: 200;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 8px; }

/* ---------- focus ---------- */

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
}
.brand svg { width: 30px; height: 30px; }
.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 8px 30px 8px 12px;
  font-size: 0.92rem;
  color: var(--text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  cursor: pointer;
  max-width: 100%;
}
.select-sm { padding: 6px 26px 6px 10px; font-size: 0.85rem; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { border-color: var(--navy); }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.badge-demo { background: var(--amber-soft); color: #92600A; border-color: #F3D9A4; }
.badge-draft { background: var(--red-soft); color: #9B1C1C; border-color: #F5B5B5; }
.badge-verified { background: var(--green-soft); color: #065F46; border-color: #A7E3CB; cursor: default; }

/* ---------- progress ---------- */

.progress-wrap {
  height: 4px;
  background: var(--line);
}
.progress-bar {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, var(--saffron), #FF9A4D);
  border-radius: 0 2px 2px 0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-text {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  padding: 2px 16px 0;
  margin: 0;
}

/* ---------- layout ---------- */

main { flex: 1; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 22px 16px 56px;
}
.container-narrow { max-width: 720px; }

.screen { display: none; }
.screen.active { display: block; animation: screenIn 0.3s ease; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ---------- hero ---------- */

.hero { padding: 34px 28px; }
.kicker {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--saffron);
  margin-bottom: 10px;
}
.hero h1 { font-size: 1.9rem; max-width: 21ch; }
.hero .sub { font-size: 1.02rem; max-width: 60ch; margin-top: 10px; }

.home-controls { margin-top: 22px; }
.field-label { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; display: block; }
.lang-quick { display: flex; flex-wrap: wrap; gap: 10px; }
.lang-quick .btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.hero-cta .hint { flex-basis: 100%; }
.trust-line {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}
.trust-line svg { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.feature-card { text-align: left; }
.feature-icon { font-size: 1.5rem; }
.feature-card h2 { margin: 10px 0 6px; }
.feature-card p { color: var(--muted); font-size: 0.92rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 11px 20px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  min-height: 46px;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 16px; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; min-height: 36px; border-radius: 10px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }

.btn-secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: #F1F4F9; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #B91C1C; }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #0B7F58; }

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.nav-row-center { justify-content: center; }

/* ---------- choice cards ---------- */

.choice-group { border: none; margin: 22px 0 6px; }
.choice-group legend {
  font-weight: 800;
  font-size: 0.98rem;
  margin-bottom: 10px;
  padding: 0;
}

.choice-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}
.choice-grid-2 { grid-template-columns: repeat(2, 1fr); }
.choice-grid-3 { grid-template-columns: repeat(3, 1fr); }
.choice-grid-4 { grid-template-columns: repeat(4, 1fr); }

.choice { position: relative; display: block; }
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.choice-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  padding: 13px 15px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.94rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 48px;
  justify-content: center;
}
.choice-card:hover { border-color: var(--line-2); }
.choice input:checked + .choice-card {
  border-color: var(--saffron);
  box-shadow: 0 0 0 2px var(--ring);
  background: var(--saffron-soft);
}
.choice input:focus-visible + .choice-card {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.income-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.income-card svg {
  width: 22px; height: 22px;
  color: var(--navy-3);
  margin-bottom: 6px;
}
.income-card .ic-t { font-weight: 700; }
.income-card .ic-d { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

/* advanced-mode-only items */
.adv-only { display: none; }
body.mode-advanced .adv-only { display: block; }
body.mode-advanced .income-grid .adv-only { display: block; }

.adv-block { display: none; }
.adv-block.show { display: block; border-top: 1px dashed var(--line-2); padding-top: 18px; margin-top: 18px; }
.adv-title { font-size: 1rem; margin-bottom: 8px; }

/* ---------- fields ---------- */

.field { margin: 18px 0; }
.field label { font-weight: 700; font-size: 0.92rem; display: block; margin-bottom: 6px; }

.input {
  width: 100%;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px var(--ring);
}

.money-wrap { position: relative; }
.money-wrap .input { padding-left: 32px; font-variant-numeric: tabular-nums; }
.money-prefix {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}

.hint { color: var(--muted); font-size: 0.84rem; margin-top: 6px; }
.cap { color: var(--navy-3); font-size: 0.84rem; font-weight: 700; margin-top: 3px; }

.section-h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 26px 0 10px;
}

/* ---------- switch ---------- */

.switch-row { margin: 18px 0; }
.switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  flex-shrink: 0;
  width: 46px; height: 27px;
  background: var(--line-2);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
  margin-top: 2px;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--ring); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 1px; }
.switch-text strong { font-size: 0.95rem; }
.switch-text span { font-size: 0.82rem; color: var(--muted); }
.switch-sm { margin-top: 8px; }
.switch-sm .switch-label { font-size: 0.88rem; color: var(--muted); font-weight: 600; }

/* ---------- sliders ---------- */

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  outline-offset: 4px;
  margin: 10px 0;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--saffron);
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--saffron);
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* ---------- previews / breakdown rows ---------- */

.preview {
  margin-top: 20px;
  border-top: 1px dashed var(--line-2);
  padding-top: 16px;
}

.bd-rows { display: flex; flex-direction: column; gap: 2px; }
.bd-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.93rem;
  border-bottom: 1px solid #F1F2F6;
}
.bd-row:last-child { border-bottom: none; }
.bd-l { color: var(--text); }
.bd-v {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bd-strong .bd-l { font-weight: 800; }
.bd-strong .bd-v { font-weight: 800; }

.ref {
  font-size: 0.72rem;
  color: var(--muted);
  background: #F1F2F6;
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 600;
  white-space: nowrap;
}

.why {
  background: none;
  border: none;
  color: var(--saffron);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  text-decoration: underline dotted;
}
.why:hover { background: var(--saffron-soft); }

/* ---------- pills & boxes ---------- */

.pill-row { margin-bottom: 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}
.pill svg { width: 14px; height: 14px; }
.pill-ok { background: var(--green-soft); color: #065F46; }
.pill-bad { background: var(--red-soft); color: #9B1C1C; }

.info-box {
  background: #EFF4FB;
  border-left: 4px solid var(--navy-3);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-top: 14px;
  color: var(--navy-2);
}
.info-box.ok { background: var(--green-soft); border-left-color: var(--green); color: #065F46; }

.warn-box {
  background: var(--red-soft);
  border-left: 4px solid var(--red);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-top: 14px;
  color: #7F1D1D;
  display: none;
}
.warn-box.show { display: block; }
.nri-warn { margin-top: 8px; }

/* ---------- total line ---------- */

.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  border-top: 2px solid var(--navy);
  margin-top: 14px;
  padding-top: 12px;
}
.total-line strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }

.ded-live-box {
  background: var(--green-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 8px;
}
.ded-live-box strong { color: #065F46; font-size: 0.9rem; }
.ded-live-box p { color: #065F46; font-size: 0.92rem; margin-top: 2px; }

/* ---------- result ---------- */

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.demo-note {
  display: none;
  background: var(--amber-soft);
  color: #92600A;
  border: 1px solid #F3D9A4;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 14px;
  margin-top: 12px;
}
.demo-note.show { display: block; }

.banner {
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin: 18px 0;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.banner.win {
  background: var(--green-soft);
  border: 1.5px solid #A7E3CB;
  color: #065F46;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.banner.win strong { font-size: 1.2rem; font-weight: 800; display: block; }
.banner.win span { font-size: 0.95rem; }
.banner.win svg { width: 28px; height: 28px; color: var(--green); flex-shrink: 0; }
.banner.neutral {
  background: #EFF4FB;
  border: 1.5px solid #C9D8EE;
  color: var(--navy-2);
}
.banner.neutral strong { font-size: 1.05rem; }

.regime-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.regime-card { position: relative; border: 1.5px solid transparent; }
.regime-card.winner {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.18), var(--shadow);
}

.regime-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.winner-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.winner-tag svg { width: 12px; height: 12px; }

.payable {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}
.payable.zero { color: var(--green); }
.payable-sub {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.regime-meta {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}
.regime-card .bd-rows { border-top: 1px dashed var(--line-2); padding-top: 8px; }

/* recommendations */

.recs h2 { margin-bottom: 12px; }
.rec {
  display: flex;
  gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid #F1F2F6;
}
.rec:last-of-type { border-bottom: none; }
.rec-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--saffron-soft);
  color: var(--saffron);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rec-icon svg { width: 19px; height: 19px; }
.rec strong { display: block; font-size: 0.96rem; }
.rec span { color: var(--muted); font-size: 0.88rem; }

/* tables */

.table-wrap { overflow-x: auto; }
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.mini-table th, .mini-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.mini-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.mini-table td:last-child, .mini-table th:last-child,
.mini-table td:nth-child(3), .mini-table th:nth-child(3) { text-align: right; }

/* ---------- playground ---------- */

.pg-slider { margin: 18px 0; }
.pg-slider label { display: block; font-weight: 700; font-size: 0.92rem; }
.pg-slider strong { color: var(--saffron); font-variant-numeric: tabular-nums; }

.pg-bars { margin: 20px 0; display: flex; flex-direction: column; gap: 14px; }
.pg-bar-group {
  display: grid;
  grid-template-columns: 90px 1fr 100px;
  align-items: center;
  gap: 10px;
}
.pg-bar-label { font-size: 0.85rem; font-weight: 700; }
.pg-bar-value { font-size: 0.85rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.bar-wrap {
  position: relative;
  height: 26px;
  background: #F1F2F6;
  border-radius: 8px;
  overflow: hidden;
}
.bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 8px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-old { background: linear-gradient(90deg, var(--navy-3), var(--navy)); z-index: 2; }
.bar-new { background: linear-gradient(90deg, #FF9A4D, var(--saffron)); z-index: 2; }
.bar-base { background: #D6DAE3; z-index: 1; }
.bar-legend {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 4px;
  background: #D6DAE3;
  margin-right: 4px;
  vertical-align: -2px;
}
.pg-summary { min-height: 28px; margin: 8px 0 4px; }
.save-note { color: var(--green); font-size: 1.1rem; font-weight: 800; }

/* ---------- spend plan ---------- */

.spend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.spend-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 5px solid var(--navy-3);
}
.spend-card.net { border-left-color: var(--navy-3); }
.spend-card.buffer { border-left-color: var(--red); }
.spend-card.save { border-left-color: var(--amber); }
.spend-card.safe { border-left-color: var(--green); background: var(--green-soft); }
.spend-card.emerg { border-left-color: var(--navy); }
.spend-label { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.spend-value { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--navy); }
.spend-card.safe .spend-value { color: var(--green); }
.spend-hint { font-size: 0.8rem; color: var(--muted); }

/* ---------- ledger ---------- */

.led-form {
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  margin-top: 16px;
}
.led-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.led-grid .field { margin: 0; }
.led-form .choice-group { margin: 14px 0; }
.led-form .btn { margin-top: 4px; }

.led-summary-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.led-stat {
  background: #EFF4FB;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.led-stat span { font-size: 0.76rem; color: var(--muted); font-weight: 700; }
.led-stat strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.led-list { margin-top: 18px; display: flex; flex-direction: column; }
.led-row {
  display: grid;
  grid-template-columns: 64px 1fr 62px 100px 1fr 34px;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  border-bottom: 1px solid #F1F2F6;
  font-size: 0.88rem;
}
.led-row .led-date { color: var(--muted); white-space: nowrap; }
.led-row .led-cat { font-weight: 600; }
.led-row .led-method {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
}
.led-method.digital { background: var(--green-soft); color: #065F46; }
.led-method.cash { background: var(--amber-soft); color: #92600A; }
.led-row .led-amt { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.led-row.income .led-amt { color: var(--green); }
.led-row.expense .led-amt { color: var(--red); }
.led-row .led-note { color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.led-row .icon-btn { width: 28px; height: 28px; border: none; color: var(--muted); }
.led-empty { text-align: center; padding: 18px; }

/* ---------- report ---------- */

.rep-meta {
  background: #EFF4FB;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--navy-2);
  margin-top: 12px;
}
.rep-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.rep-item {
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rep-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rep-item h2 { font-size: 1rem; }
.rep-item p { color: var(--muted); font-size: 0.88rem; }
.rep-item-danger { border-color: #F5B5B5; }

/* ---------- settings / verify meta ---------- */

.verify-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.verify-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid #F1F2F6;
  padding-bottom: 6px;
}
.verify-k { color: var(--muted); font-weight: 600; }

/* ---------- footer ---------- */

.app-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: auto;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-note { font-size: 0.8rem; color: var(--muted); }
.app-footer .badge {
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

/* ---------- modal ---------- */

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 51, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  position: relative;
  padding: 26px;
  animation: modalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border: none;
  border-radius: 10px;
  background: #F1F2F6;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.modal-close:hover { background: var(--line); color: var(--text); }
.modal-title { font-size: 1.15rem; margin-bottom: 12px; padding-right: 36px; }
.modal-h3 { font-size: 0.92rem; margin: 16px 0 6px; }
.modal-text { font-size: 0.94rem; color: var(--text); line-height: 1.6; }
.modal-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--amber-soft);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.verify-status-text { font-size: 0.88rem; }
.verify-list { margin: 6px 0 0 18px; font-size: 0.88rem; color: var(--text); }
.verify-list li { margin: 4px 0; }
.verify-list a { word-break: break-word; }
.confirm-text { font-size: 0.98rem; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- toast ---------- */

#toast-root {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.toast {
  background: var(--navy);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  max-width: 92vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok { background: var(--green); }
.toast-warn { background: var(--red); }

/* ---------- confetti ---------- */

#confetti-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 90;
}
.confetti-piece {
  position: absolute;
  top: -12px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(105vh) rotate(660deg); opacity: 0.6; }
}

/* ---------- animations off / reduced motion ---------- */

body.no-anim *,
body.no-anim *::before,
body.no-anim *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
  .led-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .regime-grid { grid-template-columns: 1fr; }
  .spend-grid { grid-template-columns: 1fr; }
  .led-summary-box { grid-template-columns: repeat(2, 1fr); }
  .brand-name { display: none; }
  .choice-grid-3, .choice-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .led-row { grid-template-columns: 60px 1fr 58px 90px 30px; }
  .led-row .led-note { display: none; }
}

@media (max-width: 520px) {
  .container { padding: 14px 12px 44px; }
  .card { padding: 18px; border-radius: var(--r-md); }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 1.5rem; }
  h1 { font-size: 1.3rem; }
  .income-grid { grid-template-columns: 1fr; }
  .choice-grid, .choice-grid-2 { grid-template-columns: 1fr; }
  .pg-bar-group { grid-template-columns: 70px 1fr 84px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .topbar-controls { gap: 6px; }
  .select-sm { max-width: 108px; }
  #rules-badge { display: none; }
  .led-grid { grid-template-columns: 1fr; }
  .payable { font-size: 2rem; }
}

/* ---------- print (A4) ---------- */

#print-report { display: none; }

@media print {
  @page { size: A4; margin: 13mm; }
  body { background: #fff; }
  .skip-link, .topbar, .progress-wrap, .progress-text,
  main, .app-footer, #modal-root, #toast-root, #confetti-root { display: none !important; }
  #print-report { display: block !important; color: #000; font-size: 12px; }

  .pr-head { border-bottom: 3px solid #000; margin-bottom: 10px; }
  .pr-head h1 { font-size: 17px; margin: 0; }
  .pr-meta {
    display: flex; flex-wrap: wrap; gap: 4px 26px;
    margin: 8px 0 6px;
    font-size: 11px;
  }
  .pr-meta span { display: block; color: #444; }
  .pr-meta strong { font-size: 12px; }
  .pr-h2 {
    font-size: 13px;
    margin: 14px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #999;
    padding-bottom: 3px;
  }
  .pr-table { width: 100%; border-collapse: collapse; margin: 4px 0; }
  .pr-table th, .pr-table td {
    border: 1px solid #999;
    padding: 4px 8px;
    text-align: left;
    font-size: 11.5px;
  }
  .pr-table .num { text-align: right; white-space: nowrap; }
  .pr-table .pr-total td { font-weight: 700; background: #F0F0F0; }
  .pr-line { font-size: 12px; margin: 4px 0; }
  .pr-rec {
    border: 1.5px solid #000;
    padding: 8px 10px;
    font-weight: 700;
    font-size: 12px;
    margin: 6px 0;
  }
  .pr-list { margin: 4px 0 4px 18px; font-size: 11px; }
  .pr-list li { margin: 2px 0; }
  .pr-disclaimer { font-size: 10.5px; color: #333; margin-top: 10px; font-style: italic; }
  .pr-sources { font-size: 10.5px; margin-top: 6px; }
  .pr-sign { margin-top: 26px; display: flex; flex-direction: column; gap: 22px; }
  .pr-sign > span { font-size: 11.5px; font-weight: 600; }
  .pr-line-sign { display: block; border-bottom: 1px solid #000; width: 60%; }
}
