/* Mera Vakil - editorial identity: ink indigo on warm ivory, marigold as a quiet accent only.
   Mobile-first (360px+), legible to 1440px. System fonts only (strict CSP, offline); Devanagari has its own
   stacks, size and leading so both scripts read with equal weight. */
:root {
  --ink: #1b1f3b; --ink-2: #2e3566; --ink-soft: #e9e8f1;
  --ivory: #f7f2e8; --ivory-2: #efe8da; --surface: #fffdf8; --line: #ddd4c3; --line-strong: #8a7e66;
  --marigold: #e0a030; --marigold-ink: #8a5a00; --marigold-soft: #fbefd6;
  --leaf: #2d6a4c; --leaf-soft: #e5f0ea; --sindoor: #a8271f; --sindoor-soft: #f9e8e5;
  --text: #1d2033; --muted: #545a6e; --focus: #9a5f00;
  --radius: 16px; --measure: 46rem;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --deva: "Noto Serif Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", "Mangal", "Noto Sans Devanagari", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.6 var(--sans); background: var(--ivory); color: var(--text); min-width: 320px; }
:lang(hi) body, body:lang(hi) { line-height: 1.8; font-size: 18px; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); letter-spacing: -.005em; font-weight: 600; }
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3 { font-family: var(--deva), var(--serif); line-height: 1.45; letter-spacing: 0; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: .4rem 0 .8rem; }
h2 { font-size: 1.12rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .35rem; }
a { color: var(--ink-2); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Header */
.top { position: sticky; top: 0; z-index: 3; background: var(--ink); color: #fff; padding-top: env(safe-area-inset-top); }
.top-in { max-width: 72rem; margin: 0 auto; display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; }
.top :focus-visible { outline-color: #f3c46a; }
.brand { display: flex; align-items: baseline; gap: .5rem; color: #fff; text-decoration: none; min-height: 44px; align-items: center; }
.wm-en { font: 600 1.15rem/1 var(--serif); letter-spacing: .01em; }
.wm-hi { font: 500 1.08rem/1.2 var(--deva); }
.wm-sep { width: 1px; height: 1.1rem; background: var(--marigold); }
.beta { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f3d9a4; border: 1px solid rgba(243,217,164,.5); padding: .05rem .4rem; border-radius: 999px; }
.lang-switch { margin-left: auto; display: flex; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; overflow: hidden; flex: none; }
.seg { margin: 0; min-height: 40px; padding: .25rem .8rem; border: 0; border-radius: 0; background: transparent; color: #fff; font-weight: 600; font-size: .92rem; box-shadow: none; }
.seg[lang="hi"] { font-family: var(--deva); }
.seg[aria-pressed="true"] { background: var(--ivory); color: var(--ink); }
@media (max-width: 400px) { .wm-sep, .wm-hi { display: none; } .seg { padding: .25rem .6rem; } }

.banner { margin: 0; padding: .45rem 1rem; font-weight: 600; font-size: .88rem; text-align: center; }
.banner.demo, .banner.rules { background: var(--marigold-soft); color: #5a3b00; }
.banner.claude { background: var(--leaf-soft); color: var(--leaf); }

main { max-width: var(--measure); margin: 0 auto; padding: 1rem 1rem 2.5rem; }
.hint, .muted { color: var(--muted); font-size: .92rem; }

/* Progress */
.stepper { display: flex; gap: .3rem; list-style: none; padding: 0; margin: .2rem 0 1.2rem; counter-reset: s; overflow-x: auto; }
.stepper li { flex: 1; min-width: 4.2rem; font-size: .74rem; color: var(--muted); border-top: 3px solid var(--line); padding-top: .3rem; counter-increment: s; }
.stepper li::before { content: counter(s) ". "; font-weight: 700; }
.stepper li.done { border-color: var(--ink-2); color: var(--ink-2); }
.stepper li.current { border-color: var(--marigold); color: var(--ink); font-weight: 700; }

/* Forms and buttons */
label, legend { display: block; font-weight: 650; margin: .9rem 0 .3rem; color: var(--ink); }
label.check { font-weight: 500; display: flex; align-items: center; gap: .6rem; min-height: 48px; }
input[type=text], input[type=number], input:not([type]), textarea, select {
  width: 100%; font: inherit; padding: .75rem .85rem; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); }
textarea { resize: vertical; }
textarea.paper { font: 16px/1.65 var(--serif); background: #fffefa; }
:lang(hi) textarea.paper { font-family: var(--deva), var(--serif); line-height: 1.9; }
input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--ink); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; }
button { font: inherit; font-weight: 650; min-height: 48px; padding: .6rem 1.1rem; border-radius: 12px; border: 1.5px solid var(--ink);
  background: var(--surface); color: var(--ink); cursor: pointer; margin-top: .8rem; }
button:hover { background: var(--ink-soft); }
button.primary { background: var(--ink); color: #fff; width: 100%; }
button.primary:hover { background: var(--ink-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: .6rem; } .row > * { flex: 1; } .row.wrap { flex-wrap: wrap; }
.linkish { background: none; border: 0; min-height: 44px; padding: .3rem .1rem; margin: 0; text-decoration: underline; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.linkish:hover { background: none; color: var(--ink); }

/* Home: greeting + conversation composer (the hero) */
.greet { margin: clamp(2.5rem, 12vh, 7rem) 0 1.4rem; text-align: center; }
.greet-en { font: 600 clamp(1.65rem, 5vw, 2.45rem)/1.2 var(--sans); letter-spacing: -.035em; }
.greet-hi { font: 600 clamp(1.65rem, 5vw, 2.45rem)/1.45 var(--deva); }
html[lang="hi"] .greet-en, html:not([lang="hi"]) .greet-hi { display: none; }

.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 6px 22px rgba(27,31,59,.08); }
.composer:focus-within { border-color: var(--line-strong); }
.composer textarea { display: block; border: 0; background: transparent; border-radius: 26px 26px 0 0; padding: .9rem 1rem .25rem; min-height: 3.8rem; font-size: 1rem; resize: none; }
@supports (field-sizing: content) { .composer textarea { field-sizing: content; max-height: 12rem; } }
#classify-result { scroll-margin-top: 5rem; }
#classify-result:focus { outline: none; }
.composer textarea:focus-visible { outline: none; }
.composer textarea::placeholder { color: #686d7e; }
.composer-bar { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem .6rem; flex-wrap: wrap; }
.composer-bar button { margin: 0; }
.ico { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; flex: none; }
.attach { border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.attach:hover { border-color: var(--ink); background: var(--surface); }
.mic { border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); }
.mic .rec-dot { display: none; width: .7rem; height: .7rem; border-radius: 50%; background: #fff; flex: none; }
.mic.recording { background: var(--sindoor); border-color: var(--sindoor); color: #fff; }
.mic.recording .ico { display: none; }
.mic.recording .rec-dot { display: inline-block; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mic.recording .rec-dot { animation: none; } }
.send-terms { margin: 0 0 .5rem; padding: 0; font-size: .8rem; color: var(--muted); text-align: center; }
.send-terms a { color: inherit; }
.terms h2 { font-size: 1.05rem; margin-top: 1.4rem; }
.terms h1:focus { outline: none; }
.composer-bar .mic, .composer-bar .send { margin-left: auto; }
.attachments { position: relative; }
.attachments summary { cursor: pointer; list-style: none; }
.attachments summary::-webkit-details-marker { display: none; }
.attachment-options { position: absolute; z-index: 2; top: calc(100% + .35rem); left: 0; min-width: max-content; padding: .3rem .6rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: .75rem; }
.attachment-options button { display: block; min-height: 44px; }
.start-free { margin: 0; flex: none; }
.start-free a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .65rem; border-radius: 999px; background: var(--marigold-soft); color: var(--ink); font-size: .86rem; font-weight: 650; text-decoration: none; }
@media (max-width: 520px) {
  .top-in { gap: .35rem; padding-inline: .6rem; }
  .wm-sep, .wm-hi { display: none; }
  .wm-en { font-size: 1rem; }
  .seg { padding-inline: .38rem; font-size: .79rem; }
  .start-free a { font-size: .76rem; padding-inline: .55rem; }
}
.send { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (hover: hover) { .send:not(:disabled):hover { background: var(--ink-2); } }
.send:not(:disabled):active { transform: scale(.96); }
.send[aria-busy="true"] { opacity: 1; cursor: progress; }
.send-feedback { margin: .55rem .25rem 0; color: var(--muted); font-size: .9rem; }
.send-feedback a { display: inline-flex; align-items: center; min-height: 44px; margin: .45rem 0 0; padding: .35rem .8rem; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 650; text-decoration: none; }
#send-status { display: block; }

.examples { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin: .85rem 0 0; }
.ex { margin: 0; min-height: 44px; padding: .4rem .95rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 550; font-size: .84rem; }
.ex:hover { background: var(--surface); border-color: var(--ink); }
:lang(hi) .ex { font-family: var(--deva), var(--sans); }

/* Voice transcript review */
.voice { margin-top: .6rem; }
#voice-status { margin: .5rem .2rem 0; }
#voice-status:empty { display: none; }
#transcript-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1rem 1rem; margin-top: .6rem; }

.more { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.more summary { cursor: pointer; color: var(--muted); padding: .5rem 0; min-height: 44px; }
.pathways { display: grid; gap: .6rem; }
.pathway { text-align: left; display: flex; flex-direction: column; gap: .2rem; margin: 0; padding: 1rem; border: 1px solid var(--line); background: var(--surface); }
.pathway strong { font: 600 1.05rem var(--serif); }
:lang(hi) .pathway strong { font-family: var(--deva), var(--serif); }
.pathways.compact .pathway { padding: .65rem .9rem; }
.pathway.suggested { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--marigold); }

/* Cards, pills, lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: .8rem 0; }
.card.warn { border-left: 4px solid var(--marigold); }
.card.alert { border: 2px solid var(--sindoor); background: var(--sindoor-soft); }
.card.alert h2 { color: var(--sindoor); }
.pill { display: inline-block; font-size: .84rem; font-weight: 600; padding: .3rem .75rem; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf); margin: .4rem 0 0; }
.pill.warn { background: var(--marigold-soft); color: #5a3b00; }
.chips { list-style: none; padding: 0; margin: 0 0 .3rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li { background: var(--ink-soft); color: var(--ink); border-radius: 999px; padding: .2rem .75rem; font-size: .9rem; font-weight: 600; }
.facts { display: grid; grid-template-columns: minmax(7rem, 40%) 1fr; gap: .3rem .8rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .9rem; } .facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ticks { padding-left: 0; list-style: none; } .ticks li { padding-left: 1.6rem; position: relative; margin-bottom: .35rem; }
.ticks li::before { content: ""; position: absolute; left: .2rem; top: .5em; width: .75rem; height: .75rem; border: 2px solid var(--ink-2); border-radius: 3px; }
.dash { padding-left: 1.1rem; margin: 0; } .dash li { margin-bottom: .3rem; }
.claims { list-style: none; padding: 0; margin: 0 0 .5rem; }
.claims li { border-left: 2px solid var(--marigold); padding: .15rem 0 .15rem .85rem; margin-bottom: .75rem; }
.claims cite { display: block; font-style: normal; font-size: .82rem; font-weight: 700; color: var(--ink-2); margin-top: .15rem; }
.src { border-top: 1px dashed var(--line); padding-top: .6rem; margin-top: .6rem; font-size: .92rem; }
.src .meta { color: var(--muted); font-size: .84rem; margin: .1rem 0 .2rem; }
.badge { font-size: .72rem; font-weight: 800; padding: .05rem .45rem; border-radius: 6px; background: var(--sindoor-soft); color: var(--sindoor); }
.links { padding-left: 1.1rem; }
.sources { padding-left: 1.1rem; } .sources li { margin-bottom: .75rem; } .sources small { color: var(--muted); word-break: break-all; }
.error { color: var(--sindoor); font-weight: 650; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border: 2px solid var(--sindoor); }
.field.invalid legend, .field.invalid label { color: var(--sindoor); }

/* Guidance: question, then the answer (next step first), then progressive detail */
.asked { margin: .4rem 0 1rem; display: flex; flex-direction: column; align-items: flex-end; }
.asked-label { margin: 0 .3rem .25rem; font-size: .8rem; color: var(--muted); }
.asked-text { margin: 0; max-width: 92%; background: var(--ink); color: #fff; padding: .8rem 1rem; border-radius: 18px 18px 4px 18px;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12rem; overflow-y: auto; }
.asked .linkish { margin-right: .2rem; }
.answer { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 20px 20px 20px; padding: 1.1rem 1.15rem 1rem; margin: .8rem 0; box-shadow: 0 10px 30px -22px rgba(27,31,59,.45); }
.answer-label { font: 700 .75rem/1 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--marigold-ink); margin: 0 0 .7rem; }
:lang(hi) .answer-label { font: 700 .85rem/1.4 var(--sans); letter-spacing: .02em; }
.answer h3 { font-size: .98rem; margin: 0 0 .3rem; }
.next { border-left: 3px solid var(--marigold); padding: .1rem 0 .1rem .9rem; margin-bottom: 1rem; }
.next-text { font: 500 1.2rem/1.45 var(--serif); color: var(--ink); margin: 0; }
:lang(hi) .next-text { font-family: var(--deva), var(--serif); line-height: 1.7; }
.ans-block { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.opts { margin: 0; padding-left: 1.3rem; } .opts li { margin-bottom: .4rem; }
.juris { margin: 0; font-size: .95rem; }
.state-row label { margin-top: .6rem; }
.detail { margin: 1.2rem 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.detail > summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 650; color: var(--ink); min-height: 48px; }
.detail-body { padding: 0 1.1rem 1rem; }
.detail-body section { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .4rem; }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.6rem 1rem calc(1.6rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--ivory-2); }
.foot a { color: inherit; }
.foot-line { margin: .35rem 0 0; }
.foot .linkish { font-size: .8rem; }

table { width: 100%; border-collapse: collapse; font-size: .85rem; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: .4rem; text-align: left; vertical-align: top; }
.table-wrap { overflow-x: auto; }
dialog#invite { border: 1px solid var(--line); border-radius: var(--radius); max-width: min(28rem, 92vw); padding: 1.2rem; background: var(--surface); color: var(--text); }
dialog#invite::backdrop { background: rgba(27, 31, 59, .5); }
#invite input { width: 100%; letter-spacing: .08em; }

@media (min-width: 640px) {
  .pathways { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 2rem; }
  main { padding: 1.5rem 1.5rem 3rem; }
  button.primary { width: auto; min-width: 16rem; }
}
@media (min-width: 1024px) { :root { --measure: 50rem; } }
@media (prefers-reduced-motion: no-preference) { .view:not([hidden]) { animation: rise .18s ease-out; } @keyframes rise { from { opacity: 0; transform: translateY(4px); } } }

/* Christmas gift (seasonal page) */
.gift-promo { margin: .6rem 0; }
.gift-promo a { display: inline-block; padding: .45rem .8rem; border-radius: 999px; background: var(--sindoor-soft); border: 1px solid var(--marigold); font-weight: 600; text-decoration: none; }
.gift-price { font-size: 1.2rem; font-weight: 700; }
.gift-list { list-style: none; padding: 0; }
.gift-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.gift-item .row { display: flex; flex-wrap: wrap; gap: .5rem; }
.lead { font-size: 1.05rem; }
