/* Bilqo theme: the colours of the ₹2000 note - rani magenta with gold. */
:root {
  --brand: #a3127f;
  --brand-dark: #750b5b;
  --brand-soft: #f5d0e8;
  --brand-tint: #fdf3f9;
  --gold: #c9a24a;
  --gold-dark: #8a6a1f;
  --gold-soft: #f7ecd1;
  --grad: linear-gradient(135deg, #b8178f 0%, #8e0f6e 55%, #640a4d 100%);
  --grad-gold: linear-gradient(135deg, #e9cf86 0%, #c9a24a 50%, #a07c2c 100%);
  --ink: #1f0a1a;
  --ink-2: #4b3245;
  --muted: #7c6576;
  --line: #efe3eb;
  --bg: #faf6f8;
  --card: #ffffff;
  --ok: #15803d; --ok-bg: #dcfce7;
  --warn: #b45309; --warn-bg: #fef3c7;
  --bad: #b91c1c; --bad-bg: #fee2e2;
  --info: #1d4ed8; --info-bg: #dbeafe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 10, 45, .05), 0 8px 24px rgba(60, 10, 45, .06);
  --shadow-lg: 0 20px 50px rgba(100, 10, 77, .18);
  --display: Fraunces, Georgia, 'Noto Sans Devanagari', serif;
  /* Fine engraved lines, like the guilloche pattern on a banknote. */
  --guilloche: repeating-radial-gradient(circle at 100% 0, rgba(233, 207, 134, .07) 0 1px, transparent 1px 9px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: .6em 1.05em; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--brand-tint); border-color: var(--brand-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: #8e0f6e; color: #fff; box-shadow: 0 4px 14px rgba(163, 18, 127, .28), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.lg { padding: .85em 1.4em; font-size: 1.02rem; }
.btn.sm { padding: .35em .7em; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3em; color: var(--ink-2); }
.field { margin-bottom: 1rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .25em; font-weight: 400; }
.hint .gst-ok { color: var(--ok); font-weight: 600; }
.hint .gst-bad { color: var(--bad); font-weight: 600; }
.hint .gst-record { margin-top: .4em; padding-top: .4em; border-top: 1px dashed var(--line, #ddd); }
.gst-fetch { margin-top: .4rem; }
.auth-card.setup-card { max-width: 720px; }
.setup-card h3 { margin: 1.4rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.setup-card form > h3:first-child { margin-top: .6rem; padding-top: 0; border-top: 0; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #e2d3dd; border-radius: 10px; padding: .6em .75em; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 70px; resize: vertical; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.choice label {
  border: 2px solid var(--line); border-radius: 12px; padding: .9rem; cursor: pointer; margin: 0;
  font-weight: 500; background: #fff;
}
.choice input { width: auto; margin-right: .4em; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.choice b { display: block; color: var(--ink); }

/* ---------- landing */
.landing { background: radial-gradient(1100px 520px at 85% -10%, rgba(201, 162, 74, .16), transparent 60%), radial-gradient(900px 600px at -10% 10%, rgba(163, 18, 127, .10), transparent 60%), #fff; }
.l-nav { display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1rem, 4vw, 3rem); max-width: 1200px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 4px 12px rgba(163, 18, 127, .25); }
.hero { max-width: 1200px; margin: 0 auto; padding: 3rem clamp(1rem, 4vw, 3rem) 4rem; display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.02em; }
.hero h1 span { background: linear-gradient(100deg, var(--brand) 10%, #c2185b 50%, var(--gold-dark) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; }
.pill { display: inline-block; background: var(--gold-soft); color: var(--gold-dark); border: 1px solid #ead7a4; padding: .25em .8em; border-radius: 999px; font-weight: 600; font-size: .82rem; margin-bottom: 1rem; }
.ticks { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: grid; gap: .45rem; }
.ticks li::before { content: '✓'; color: var(--gold-dark); font-weight: 800; margin-right: .55em; }
.mock { background: var(--grad); background-image: var(--guilloche), var(--grad); border-radius: 22px; padding: 1.4rem; box-shadow: var(--shadow-lg); border: 1px solid rgba(201, 162, 74, .5); transform: rotate(1.2deg); }
.mock .paper { background: #fff; border-radius: 12px; padding: 1.3rem; font-size: .82rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); border-top: 4px solid var(--gold); transform: rotate(-1.2deg); }
.mock .bar { height: 8px; background: var(--line); border-radius: 4px; margin: .4rem 0; }
.section { max-width: 1200px; margin: 0 auto; padding: 3.5rem clamp(1rem, 4vw, 3rem); }
.section.alt { background: var(--bg); max-width: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section.alt > div { max-width: 1200px; margin: 0 auto; }
.section h2 { font-size: 2.1rem; text-align: center; }
.section .sub { text-align: center; color: var(--muted); margin-bottom: 2rem; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.step-card .num { width: 34px; height: 34px; border-radius: 50%; background: var(--grad-gold); color: #3d2a05; display: grid; place-items: center; font-family: var(--display); font-weight: 700; margin-bottom: .8rem; box-shadow: 0 3px 10px rgba(160, 124, 44, .35); }
.price-card { position: relative; max-width: 420px; margin: 0 auto; background: linear-gradient(#fff, #fff) padding-box, var(--grad-gold) border-box; border: 2px solid transparent; border-radius: 22px; padding: 2.2rem 2rem 2rem; text-align: center; box-shadow: var(--shadow-lg); }
.price-card::before { content: "PRO"; position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #f7ecd1; font-size: .72rem; font-weight: 700; letter-spacing: .2em; padding: .3em 1.1em; border-radius: 999px; border: 1px solid var(--gold); }
.price-card .amt { font-family: var(--display); font-size: 3.2rem; font-weight: 700; color: var(--brand-dark); }
.price-card .amt small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.price-card .ticks { text-align: left; }
footer.l-foot { text-align: center; padding: 2rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

/* ---------- auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--guilloche), radial-gradient(800px 500px at 90% 0, rgba(201, 162, 74, .25), transparent 60%), var(--grad); }
.auth-card { width: 100%; max-width: 520px; background: #fff; border-radius: 22px; padding: 2.2rem; box-shadow: 0 30px 80px rgba(30, 0, 25, .45); border-top: 4px solid var(--gold); }
.auth-card .brand { margin-bottom: 1.2rem; }

/* ---------- app shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--guilloche), linear-gradient(180deg, #4a0b3b 0%, #2c0623 100%); color: #f3dcea; border-right: 1px solid rgba(201, 162, 74, .25); padding: 1rem .8rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .brand { color: #fff; padding: .3rem .5rem 1.2rem; margin-bottom: .8rem; border-bottom: 1px solid rgba(201, 162, 74, .25); }
.side nav a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 9px;
  color: #ecc9df; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s;
}
.side nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.side nav a.active { background: linear-gradient(90deg, rgba(201, 162, 74, .28), rgba(201, 162, 74, .06)); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.side nav a .ico { width: 20px; text-align: center; }
.side .sub-box { margin-top: auto; background: rgba(201, 162, 74, .12); border: 1px solid rgba(201, 162, 74, .35); border-radius: 12px; padding: .85rem; font-size: .82rem; }
.side .sub-box a { color: #e9cf86; }
.side .sub-box b { color: #e9cf86; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.6rem; background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .cname { font-weight: 700; }
.content { padding: 1.6rem; max-width: 1150px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.banner { border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; }
.banner.flex { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--warn-bg); color: #78350f; }
.banner.bad { background: var(--bad-bg); color: #7f1d1d; }
.banner.info { background: var(--info-bg); color: #1e3a8a; }
.banner.tip { background: var(--brand-tint); color: var(--brand-dark); border: 1px solid var(--brand-soft); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; }
.card + .card { margin-top: 1rem; }
.card h3 { margin-bottom: .8rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.15rem; box-shadow: var(--shadow); }
.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad-gold); }
.stat .k { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat .v { font-size: 1.5rem; font-weight: 800; color: var(--ink); margin-top: .15rem; font-variant-numeric: tabular-nums; }
.stat .s { font-size: .8rem; color: var(--muted); }
.stat.bad .v { color: var(--bad); }
.stat.ok .v { color: var(--ok); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fbf6f9; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--brand-tint); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.4rem; }

.badge { display: inline-block; padding: .15em .65em; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: capitalize; }
.badge.draft { background: #e2e8f0; color: #334155; }
.badge.sent { background: var(--info-bg); color: var(--info); }
.badge.partial { background: var(--warn-bg); color: var(--warn); }
.badge.paid, .badge.active, .badge.completed { background: var(--ok-bg); color: var(--ok); }
.badge.overdue, .badge.expired { background: var(--bad-bg); color: var(--bad); }
.badge.on_hold { background: #f1f5f9; color: #64748b; }
.badge.void { background: #334155; color: #fff; }
.badge.credited { background: #ede9fe; color: #6d28d9; }
.badge.issued { background: #ede9fe; color: #6d28d9; }
.badge.trial { background: var(--info-bg); color: var(--info); }

.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { background: none; border: none; font: inherit; padding: .6rem .9rem; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

/* bar chart */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; align-items: end; height: 170px; padding-top: .5rem; }
.bars .col { display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; }
.bars .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .b { width: 40%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b.billed { background: var(--grad); }
.bars .b.recv { background: var(--grad-gold); }
.bars .lbl { font-size: .75rem; color: var(--muted); }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35em; }

/* ---------- invoice editor */
.wizard-step { display: grid; grid-template-columns: 40px 1fr; gap: 1rem; padding: 1.2rem; }
.wizard-step + .wizard-step { border-top: 1px dashed var(--line); }
.wizard-step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; }
.wizard-step h3 { margin: .25rem 0 .2rem; }
.wizard-step .help { color: var(--muted); font-size: .88rem; margin-bottom: .9rem; }
.items { width: 100%; }
.items th { background: none; padding: .4rem; }
.items td { padding: .35rem .3rem; border: none; vertical-align: top; }
.items input, .items select { padding: .5em .55em; }
.items select[data-k=unit] { min-width: 78px; }
.items select[data-k=gstRate] { min-width: 72px; }
.items input[data-k=description] { min-width: 180px; }
.items .amt { padding-top: .75em; font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-card { display: contents; }
.totals { margin-left: auto; max-width: 380px; width: 100%; }
.totals .tr { display: flex; justify-content: space-between; padding: .3rem 0; font-variant-numeric: tabular-nums; }
.totals .tr.grand { border-top: 2px solid var(--ink); margin-top: .4rem; padding-top: .6rem; font-size: 1.2rem; font-weight: 800; }
.editor-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.sticky-sum { position: sticky; top: 76px; }
.tip-box { background: var(--brand-tint); border: 1px solid var(--brand-soft); border-radius: 10px; padding: .85rem 1rem; font-size: .87rem; color: var(--brand-dark); }
.tip-box b { color: var(--ink); }
.qmark { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: .7rem; font-weight: 800; cursor: help; margin-left: .3em; vertical-align: middle; position: relative; }
.qmark:hover::after, .qmark:focus::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: 130%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .55rem .7rem; border-radius: 8px; width: 240px;
  font-weight: 400; font-size: .8rem; line-height: 1.4; z-index: 20; text-transform: none; letter-spacing: 0;
}

/* ---------- invoice document (screen + print) */
.doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 2.2rem; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); font-size: .86rem; color: #111827; }
.doc .d-head { display: flex; justify-content: space-between; gap: 1.5rem; border-bottom: 3px solid var(--brand); padding-bottom: 1rem; margin-bottom: 1rem; }
.doc .d-title { font-size: 1.5rem; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; text-align: right; }
.doc .d-logo { max-height: 60px; max-width: 180px; margin-bottom: .4rem; }
.doc .seller-name { font-size: 1.15rem; font-weight: 800; }
.doc .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.doc .box { border: 1px solid var(--line); border-radius: 6px; padding: .7rem .85rem; }
.doc .box .cap { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: .25rem; }
.doc table th { background: #f1f5f9; color: #334155; font-size: .72rem; padding: .5rem; }
.doc table td { padding: .5rem; font-size: .84rem; }
.doc .words { background: #f8fafc; border-radius: 6px; padding: .6rem .8rem; margin: .8rem 0; }
.doc .foot { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1rem; }
.doc .sign { text-align: right; margin-top: 1rem; }
.doc .sig-img { height: 56px; display: flex; justify-content: flex-end; align-items: flex-end; margin: .3rem 0 .2rem; }
.doc .sig-img img { max-height: 56px; max-width: 200px; }
.reason-opt { border: 2px solid var(--line); border-radius: 10px; padding: .6rem .8rem; cursor: pointer; margin: 0; font-weight: 400; }
.reason-opt input { width: auto; margin-right: .3em; }
.reason-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.sig-field { max-width: 480px; }
.sig-tabs { display: flex; gap: .4rem; margin-bottom: .5rem; }
.sig-tabs .btn.on { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); }
.sig-canvas { width: 100%; max-width: 480px; height: 160px; display: block; border: 2px dashed #cbd5e1; border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.sig-current { margin-top: .6rem; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.sig-current img { max-height: 60px; max-width: 220px; border-bottom: 1px solid var(--line); }
.doc .sign .line { border-top: 1px solid #94a3b8; display: inline-block; padding-top: .3rem; min-width: 200px; text-align: center; }
.doc .stamp { position: absolute; }
.doc .paid-stamp { display: inline-block; border: 3px solid var(--ok); color: var(--ok); font-weight: 800; padding: .2rem .8rem; border-radius: 6px; transform: rotate(-8deg); font-size: 1.1rem; letter-spacing: .1em; }
.doc .tiny { font-size: .72rem; color: var(--muted); text-align: center; margin-top: 1.5rem; }

/* ---------- learn */
.learn-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1.2rem; align-items: start; }
.learn-nav { position: sticky; top: 76px; }
.learn-nav a { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--ink-2); font-size: .92rem; }
.learn-nav a.on { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
.lesson h2 { margin-top: 0; }
.lesson h3 { margin-top: 1.4rem; }
.lesson ul, .lesson ol { padding-left: 1.3rem; }
.lesson li { margin-bottom: .35rem; }
.lesson .example { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: .8rem 1rem; border-radius: 0 8px 8px 0; margin: 1rem 0; }
.lesson table { margin: .8rem 0; }
.flow { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.flow span { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .7rem; font-weight: 600; font-size: .85rem; }
.flow i { color: var(--muted); font-style: normal; }

/* ---------- modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(40, 5, 32, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 1rem; z-index: 50; }
.modal { background: #fff; border-radius: 18px; border-top: 4px solid var(--gold); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal .actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: #fff; padding: .75rem 1.2rem; border-radius: 10px; transition: transform .25s; z-index: 60; max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--bad); }

.mobile-only { display: none; }

/* ---------- responsive */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .steps3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: 1fr; }
  .sticky-sum { position: static; }
  .learn-grid { grid-template-columns: 1fr; }
  .learn-nav { position: static; display: flex; overflow-x: auto; gap: .3rem; }
  .learn-nav a { white-space: nowrap; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .shell { grid-template-columns: 1fr; padding-bottom: 64px; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: 62px; z-index: 30; padding: 0; flex-direction: row; }
  .side .brand, .side .sub-box { display: none; }
  .side nav { display: flex; width: 100%; }
  .side nav a { flex: 1; flex-direction: column; gap: 0; font-size: .66rem; padding: .45rem .1rem; margin: 0; border-radius: 0; text-align: center; }
  .side nav a .ico { font-size: 1.15rem; }
  .side nav a.desk-only { display: none; }
  .mobile-only { display: inline-flex; }
  .topbar { padding: .7rem 1rem; }
  .content { padding: 1rem; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .choice { grid-template-columns: 1fr; }
  .wizard-step { grid-template-columns: 1fr; padding: 1rem .2rem; }
  .wizard-step .n { display: none; }
  .doc { padding: 1rem; }
  .doc .meta, .doc .foot { grid-template-columns: 1fr; }
  .doc .d-head { flex-direction: column; }
  .doc .d-title { text-align: left; }
  /* Item rows become stacked cards on phones */
  .items thead { display: none; }
  .items tr { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; border: 1px solid var(--line); border-radius: 10px; padding: .6rem; margin-bottom: .6rem; }
  .items td { padding: 0; }
  .items td.desc { grid-column: 1 / -1; }
  .items td[data-l]::before { content: attr(data-l); display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
  .items td.amt { text-align: left; }
  .stats .stat .v { font-size: 1.15rem; }
}

/* Our own page margin boxes replace the browser's header/footer
   (date-time, page title, URL), so none of that appears on the PDF. */
@page {
  size: A4;
  margin: 10mm 10mm 12mm;
  @top-left { content: ""; }
  @top-center { content: ""; }
  @top-right { content: ""; }
  @bottom-left { content: "This is a computer generated document."; font: 7.5pt Inter, Arial, sans-serif; color: #64748b; }
  @bottom-center { content: ""; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7.5pt Inter, Arial, sans-serif; color: #64748b; }
}

@media print {
  body { background: #fff; font-size: 10pt; }
  .side, .topbar, .no-print, .toast, .banner, #modal-root { display: none !important; }
  .shell { display: block; min-height: 0; }
  .main, .content { padding: 0; max-width: none; }
  .doc { border: none; box-shadow: none; padding: 0; max-width: none; border-radius: 0; font-size: 8.6pt; line-height: 1.38; }
  .doc .meta, .doc .foot { grid-template-columns: 1fr 1fr !important; }
  .doc .d-head { flex-direction: row !important; padding-bottom: .6rem; margin-bottom: .7rem; }
  .doc .d-title { text-align: right !important; font-size: 15pt; }
  .doc .meta { margin-bottom: .7rem; gap: .7rem; }
  .doc table th, .doc table td { padding: .32rem .45rem; font-size: 8.3pt; }
  .doc .words { margin: .5rem 0; padding: .45rem .7rem; }
  .doc .foot { margin-top: .6rem; }
  .doc .tiny { display: none; }
  .table-wrap { overflow: visible; }
  /* Long invoices continue on the next page with all details: column
     headings repeat, and rows / totals / signature are never cut in half. */
  .doc thead { display: table-header-group; }
  .doc tr, .doc .box, .doc .totals, .doc .words, .doc .sign, .doc .tax-sum { break-inside: avoid; }
  .doc .foot { break-inside: avoid; }
  .doc .paid-stamp { font-size: 10pt; }
  .doc .small, .doc p { font-size: 8.3pt; }
}

/* ---------- installed phone app (PWA) */
.install-hint {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: .7rem; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: .75rem .8rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); font-size: .88rem;
  max-width: 520px; margin: 0 auto;
}
.install-hint img { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.install-hint > div { flex: 1; }
.ios-share { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--info); color: var(--info); border-radius: 5px; font-size: .75rem; }
@media (max-width: 760px) {
  /* Keep the bottom menu above the iPhone home bar. */
  .side { height: auto; padding-bottom: env(safe-area-inset-bottom); }
  .shell { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) {
  .install-hint { display: none; }
}

/* ---------- legal pages & consent */
.legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.side .side-legal { font-size: .72rem; color: #d9b3cb; margin-top: .6rem; padding: 0 .3rem; line-height: 1.6; }
.side .side-legal a { color: #d9b3cb; }
.legal-doc { max-width: 820px; }
.legal-doc h3 { margin-top: 1.4rem; }
.legal-doc li { margin-bottom: .35rem; }
.legal-doc table td { vertical-align: top; }
.legal-doc .ph { background: #fef3c7; color: #92400e; border-radius: 4px; padding: 0 .3em; font-weight: 600; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .86rem; margin: .4rem 0 1rem; color: var(--ink-2); }
.consent input { width: auto; margin-top: .25rem; flex: none; }
@media (max-width: 760px) { .side .side-legal { display: none; } }

/* Hindi / English switch */
.lang-btn { font-weight: 600; white-space: nowrap; }
