/* Build Your Book by Klavoza
   Design plan: the site is a ledger. Pale green account-book paper, feint blue rulings,
   a red double margin rule down the left with statute-style marginal notes beside it.
   Type: Times New Roman throughout (Tinos, its metric twin, only where a device lacks it).
   Layout: left-aligned, margin column + one text column. One theme by choice. */
:root {
  color-scheme: light;
  --paper: #ECF1EA;      /* ledger paper */
  --sheet: #F9FBF7;      /* a clean page laid on the paper */
  --ink: #16223A;        /* blue-black ink */
  --ink-2: #4B5770;      /* faded ink for notes */
  --feint: #B7CBDD;      /* feint blue horizontal rulings */
  --red: #BE2F2A;        /* margin rule and actions */
  --red-deep: #9A211D;
  --cloth: #0F3A33;      /* green cloth binding */
  --cloth-ink: #E6F0EA;
  --display: "Times New Roman", Times, Tinos, "Liberation Serif", serif;
  --text: "Times New Roman", Times, Tinos, "Liberation Serif", serif;
  --mono: "Times New Roman", Times, Tinos, "Liberation Serif", serif;
  --measure: 68ch;
  --margin-col: 10.5rem;
  --gutter: clamp(1rem, 3vw, 2.25rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.1875rem/1.6 var(--text); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
img, svg { max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--red-deep); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.12; text-wrap: balance; margin: 0 0 .6em; letter-spacing: -.005em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.55rem); line-height: 1.05; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.05rem; font-family: var(--text); font-weight: 700; }
p, ul, ol, dl, blockquote, table { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: .35em; }
strong { font-weight: 700; }
small, .small { font-size: .875rem; }
.muted { color: var(--ink-2); }
.lede { font-size: 1.22rem; line-height: 1.5; max-width: 60ch; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 0; background: var(--sheet); padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- binding (header) ---------- */
.binding { background: var(--cloth); color: var(--cloth-ink); position: sticky; top: 0; z-index: 20; }
.binding a { color: var(--cloth-ink); text-decoration: none; }
.binding .bar { max-width: 1240px; margin: 0 auto; padding: .7rem var(--gutter); display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.wordmark { display: flex; align-items: baseline; gap: .55rem; font-family: var(--display); font-size: 1.28rem; font-weight: 700; letter-spacing: -.01em; margin-right: auto; }
.wordmark .by { font-family: var(--text); font-weight: 400; font-size: .8rem; opacity: .8; }
.wordmark svg { align-self: center; flex: none; }
.nav { display: flex; gap: 1.15rem; flex-wrap: wrap; align-items: center; font-size: .95rem; }
.nav a { padding: .2rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--red); color: #fff; }
.nav .btn { margin-left: .25rem; }
.menu-btn { display: none; background: none; border: 1px solid rgba(255,255,255,.4); color: inherit; font: inherit; font-size: .9rem; padding: .35rem .7rem; border-radius: 3px; cursor: pointer; }
.tabs { background: var(--cloth); border-top: 1px solid rgba(255,255,255,.14); }
.tabs ul { list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: 1240px; display: flex; gap: .3rem; overflow-x: auto; }
.tabs li { margin: 0; flex: none; }
.tabs a { display: block; padding: .42rem .9rem .5rem; font-size: .88rem; color: var(--cloth-ink); text-decoration: none; border-radius: 5px 5px 0 0; margin-top: .3rem; background: rgba(255,255,255,.08); }
.tabs a:hover { background: rgba(255,255,255,.18); }
.tabs a[aria-current="true"] { background: var(--paper); color: var(--ink); font-weight: 700; }
@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: .55rem; padding: .4rem 0 .6rem; }
  .nav.open { display: flex; }
}

/* ---------- ledger layout: margin note | red rule | column ---------- */
.ledger { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.row { display: grid; grid-template-columns: var(--margin-col) minmax(0, 1fr); }
.row > .note { padding: 3.1rem 1.1rem 0 0; text-align: right; font-size: .84rem; line-height: 1.35; color: var(--ink-2); font-style: italic; }
.row > .col { border-left: 4px double var(--red); padding: 2.75rem 0 2.75rem clamp(1.1rem, 3vw, 2.5rem); min-width: 0; }
.row.tight > .col { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.row.tight > .note { padding-top: 1.75rem; }
.row.first > .col { padding-top: 3.5rem; }
.row.first > .note { padding-top: 3.9rem; }
.row + .row > .col { border-top: 1px solid var(--feint); }
@media (max-width: 860px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .row > .note { text-align: left; padding: 1.6rem 0 0 calc(1.1rem + 4px); border-left: 4px double var(--red); font-size: .8rem; }
  .row > .col { padding-top: .5rem; padding-bottom: 2rem; }
  .row.first > .col { padding-top: .75rem; }
  .row.first > .note { padding-top: 2rem; }
  .row + .row > .col { border-top: 0; }
  .row + .row > .note { border-top: 1px solid var(--feint); }
  .row.nonote > .note { display: none; }
  .row.nonote > .col { padding-top: 2rem; }
}
.measure { max-width: var(--measure); }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 1020px) { .split { grid-template-columns: minmax(0, 1fr); } }
.cols-2, .cols-3, .cols-4 { display: grid; gap: 1.25rem; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); }
.stack > * + * { margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1.5rem 0 0; }

/* ---------- buttons ---------- */
.btn { display: inline-block; font: 700 1rem/1.2 var(--text); padding: .78rem 1.2rem; border-radius: 3px; border: 2px solid var(--red); background: var(--red); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--sheet); }
.btn.small { padding: .45rem .8rem; font-size: .9rem; }
.binding .btn { border-color: #fff; background: #fff; color: var(--cloth); }
.binding .btn:hover { background: var(--paper); color: var(--cloth); }

/* ---------- the ledger table (signature) ---------- */
.book { background: var(--sheet); border: 1px solid var(--feint); border-radius: 2px; box-shadow: 0 1px 0 #fff inset, 6px 6px 0 rgba(15, 58, 51, .12); }
.book caption { caption-side: top; text-align: left; font-family: var(--display); font-size: 1.05rem; padding: .85rem 1rem .7rem; border-bottom: 2px solid var(--ink); }
.book table, table.book { width: 100%; border-collapse: collapse; margin: 0; }
.book th, .book td { padding: .62rem 1rem; border-bottom: 1px solid var(--feint); text-align: left; vertical-align: baseline; }
.book thead th { font-size: .8rem; font-weight: 500; color: var(--ink-2); font-style: italic; border-bottom: 1px solid var(--ink); }
.book td.amt, .book th.amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; border-left: 3px double var(--red); width: 1%; }
.book td.amt { font-weight: 700; }
.book tr.sub td { background: color-mix(in srgb, var(--feint) 22%, transparent); font-size: .85rem; font-style: italic; color: var(--ink-2); padding-top: .35rem; padding-bottom: .35rem; }
.book tr:last-child td { border-bottom: 0; }
.book a { font-weight: 500; }
.book .what { display: block; font-size: .86rem; color: var(--ink-2); }

/* ---------- cards and tabs ---------- */
.card { background: var(--sheet); border: 1px solid var(--feint); border-radius: 2px; padding: 1.25rem 1.35rem 1.35rem; display: flex; flex-direction: column; gap: .5rem; }
.card > * { margin: 0; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-color: var(--red); }
.card .foot { margin-top: auto; padding-top: .6rem; font-size: .9rem; }
.card.tabbed { border-top: 0; position: relative; margin-top: 1.9rem; border-radius: 0 2px 2px 2px; }
.card.tabbed::before { content: attr(data-tab); position: absolute; left: -1px; top: -1.9rem; height: 1.9rem; padding: .3rem .9rem 0; background: var(--cloth); color: var(--cloth-ink); font-size: .84rem; border-radius: 5px 5px 0 0; }
.card.tabbed { border-top: 3px solid var(--cloth); }
.card.featured { border: 2px solid var(--ink); }
.price { font-family: var(--display); font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.price small { font-family: var(--text); font-size: .9rem; color: var(--ink-2); }
.checks { list-style: none; padding: 0; }
.checks li { padding-left: 1.5rem; position: relative; }
.checks li::before { content: ""; position: absolute; left: .1rem; top: .5em; width: .7rem; height: .38rem; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }
.prose li.box { list-style: none; position: relative; margin-left: -1.25rem; padding-left: 1.6rem; }
.prose li.box::before { content: ""; position: absolute; left: 0; top: .32em; width: .85rem; height: .85rem; border: 1.5px solid var(--ink); background: var(--sheet); }
.pill { display: inline-block; font-size: .8rem; padding: .12rem .55rem; border: 1px solid var(--ink-2); border-radius: 99px; color: var(--ink-2); white-space: nowrap; }
.pill.solid { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { border-bottom: 1px solid var(--feint); margin: 0; padding: .7rem 0; }
.linklist li:first-child { border-top: 1px solid var(--feint); }
.linklist a { font-family: var(--display); font-size: 1.08rem; text-decoration: none; }
.linklist a:hover { text-decoration: underline; text-decoration-color: var(--red); }
.linklist .what { display: block; font-size: .92rem; color: var(--ink-2); }
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
ol.steps > li { counter-increment: s; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: .25rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--feint); margin: 0; }
ol.steps > li::before { content: counter(s); font-family: var(--display); font-size: 1.7rem; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
ol.steps > li > * { grid-column: 2; margin: 0; }
ol.steps > li > h3 { margin-bottom: .25rem; }

/* ---------- prose (articles, guide, rules, legal) ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.2em; padding-top: .9em; border-top: 1px solid var(--feint); }
.prose h3 { margin-top: 1.7em; }
.prose > :first-child { margin-top: 0; }
.prose blockquote { margin-left: 0; padding: .2rem 0 .2rem 1.1rem; border-left: 3px solid var(--feint); color: var(--ink-2); }
.prose code { font-family: var(--mono); font-size: .9em; background: color-mix(in srgb, var(--feint) 30%, transparent); padding: .05em .3em; border-radius: 2px; }
.prose pre { background: var(--sheet); border: 1px solid var(--feint); padding: 1rem; overflow-x: auto; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; }
.prose pre code { background: none; padding: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1.3em; max-width: calc(100vw - 2 * var(--gutter)); }
.prose table, .matrix { border-collapse: collapse; width: 100%; font-size: .93rem; background: var(--sheet); margin: 0; }
.prose th, .prose td, .matrix th, .matrix td { border: 1px solid var(--feint); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.prose thead th, .matrix thead th { border-bottom: 2px solid var(--ink); font-weight: 700; }
.matrix th[scope="row"] { font-family: var(--display); font-weight: 500; white-space: nowrap; }
.wide { max-width: none; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .9rem; color: var(--ink-2); margin: 0 0 1.5rem; padding: 0; list-style: none; }
.meta li { margin: 0; }
.brief { background: var(--sheet); border: 1px solid var(--feint); border-left: 4px solid var(--cloth); padding: 1.1rem 1.3rem; margin: 0 0 2rem; max-width: var(--measure); }
.brief h2 { font-size: 1.1rem; margin: 0 0 .5rem; border: 0; padding: 0; }
.brief ul { margin: 0; }
.notice { font-size: .9rem; color: var(--ink-2); border: 1px dashed var(--ink-2); padding: .8rem 1rem; max-width: var(--measure); background: color-mix(in srgb, var(--sheet) 70%, transparent); }
.notice strong { color: var(--ink); }
.crumbs { font-size: .85rem; color: var(--ink-2); margin: 0 0 1.2rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: .3rem; color: var(--feint); }
.crumbs a { color: var(--ink-2); }
.toc { font-size: .93rem; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; padding: .28rem 0; border-bottom: 1px solid var(--feint); }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--red); }
.with-aside { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(13rem, 17rem); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.with-aside aside { position: sticky; top: 7.2rem; display: grid; gap: 1.25rem; }
@media (max-width: 1100px) { .with-aside { grid-template-columns: minmax(0, 1fr); } .with-aside aside { position: static; } }
details.faq { border-bottom: 1px solid var(--feint); max-width: var(--measure); }
details.faq:first-of-type { border-top: 1px solid var(--feint); }
details.faq summary { cursor: pointer; padding: .85rem 1.8rem .85rem 0; font-weight: 700; list-style: none; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: .2rem; top: .7rem; font-family: var(--display); font-size: 1.3rem; color: var(--red); }
details.faq[open] summary::after { content: "\2212"; }
details.faq > div { padding: 0 0 1rem; }
.sources { font-size: .9rem; max-width: var(--measure); }
.sources ol { padding-left: 1.3rem; }
.sources a { word-break: break-word; }

/* ---------- glossary ---------- */
.az { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.az li { margin: 0; }
.az a { display: inline-block; min-width: 2rem; text-align: center; padding: .25rem .4rem; background: var(--sheet); border: 1px solid var(--feint); text-decoration: none; font-family: var(--display); }
.az a:hover { border-color: var(--red); }
.terms { max-width: var(--measure); }
.terms h2 { font-size: 1.3rem; color: var(--red); margin: 2rem 0 .3rem; }
.terms dt { font-family: var(--display); font-size: 1.15rem; padding-top: 1rem; border-top: 1px solid var(--feint); margin-top: 1rem; }
.terms dd { margin: .3rem 0 0; }
.terms dd p:last-child { margin-bottom: 0; }
.terms .see { font-size: .9rem; color: var(--ink-2); margin-top: .35rem; }
.filter { width: 100%; max-width: 26rem; font: inherit; padding: .65rem .8rem; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--sheet); color: var(--ink); margin: 0 0 1.2rem; }

/* ---------- forms ---------- */
form.inline { display: flex; flex-wrap: wrap; gap: .6rem; max-width: 34rem; }
form.inline input[type="email"], .field input, .field select, .field textarea { flex: 1 1 14rem; font: inherit; padding: .72rem .8rem; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--sheet); color: var(--ink); min-width: 0; width: 100%; }
.field { display: grid; gap: .3rem; margin-bottom: 1rem; }
.field label { font-weight: 700; font-size: .95rem; }
form .consent { flex: 1 1 100%; display: flex; gap: .55rem; align-items: baseline; font-size: .9rem; cursor: pointer; }
form .consent input { accent-color: var(--red); flex: none; transform: translateY(2px); }
.form-note { font-size: .85rem; color: var(--ink-2); margin-top: .6rem; max-width: 34rem; }
.form-msg { margin-top: .8rem; padding: .7rem .9rem; border-left: 4px solid var(--cloth); background: var(--sheet); max-width: 34rem; }
[hidden] { display: none !important; }

/* ---------- prompts ---------- */
.prompt { background: var(--sheet); border: 1px solid var(--feint); margin: 0 0 1.5rem; max-width: 52rem; }
.prompt header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; align-items: baseline; padding: .85rem 1.1rem; border-bottom: 1px solid var(--ink); }
.prompt header h3 { margin: 0; }
.prompt pre { margin: 0; padding: 1rem 1.1rem; white-space: pre-wrap; word-break: break-word; font: 1.02rem/1.55 var(--mono); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.55em - 1px), color-mix(in srgb, var(--feint) 45%, transparent) calc(1.55em - 1px), color-mix(in srgb, var(--feint) 45%, transparent) 1.55em); background-position: 0 1rem; }
.prompt footer { padding: .7rem 1.1rem; border-top: 1px solid var(--feint); display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; font-size: .9rem; color: var(--ink-2); }
.prompt footer p { margin: 0; flex: 1 1 18rem; }

/* ---------- scorecard ---------- */
.sc-q { background: var(--sheet); border: 1px solid var(--feint); padding: 1.1rem 1.25rem; margin: 0 0 1rem; max-width: 46rem; }
.sc-q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.sc-q legend { font-weight: 700; padding: 0; margin-bottom: .6rem; }
.sc-q .dim { display: block; font-weight: 400; font-style: italic; font-size: .82rem; color: var(--ink-2); }
.sc-q label { display: flex; gap: .6rem; padding: .4rem .5rem; border-radius: 2px; cursor: pointer; align-items: baseline; }
.sc-q label:hover { background: color-mix(in srgb, var(--feint) 30%, transparent); }
.sc-q input { accent-color: var(--red); flex: none; transform: translateY(2px); }
.sc-result { max-width: 46rem; }
.meter { height: .7rem; background: color-mix(in srgb, var(--feint) 50%, transparent); border: 1px solid var(--feint); position: relative; }
.meter > i { position: absolute; inset: 0 auto 0 0; background: var(--cloth); }
.meter.low > i { background: var(--red); }
.sc-dim { padding: .9rem 0; border-bottom: 1px solid var(--feint); }
.sc-dim h3 { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; }
.sc-dim p { margin: .55rem 0 0; }

/* ---------- footer ---------- */
.colophon { background: var(--cloth); color: var(--cloth-ink); margin-top: 0; }
.colophon a { color: var(--cloth-ink); text-decoration-color: rgba(255,255,255,.4); }
.colophon .inner { max-width: 1240px; margin: 0 auto; padding: 2.75rem var(--gutter) 2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr)); gap: 2rem; }
.colophon h2 { font-size: 1rem; font-family: var(--text); font-weight: 700; margin-bottom: .6rem; }
.colophon ul { list-style: none; padding: 0; margin: 0; font-size: .93rem; }
.colophon li { margin-bottom: .4rem; }
.colophon .fine { max-width: 1240px; margin: 0 auto; padding: 1.25rem var(--gutter) 2.25rem; border-top: 1px solid rgba(255,255,255,.18); font-size: .82rem; line-height: 1.5; opacity: .88; }
.colophon .fine p { max-width: 90ch; margin-bottom: .6rem; }

/* ---------- two currencies: INR for India, USD elsewhere ---------- */
html[data-cur="inr"] .cur-usd, html[data-cur="usd"] .cur-inr { display: none !important; }
html:not([data-cur]) .money .cur-inr::before { content: " / "; }
.money .gst { font-size: .62em; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.cur-switch { display: inline-flex; align-items: center; gap: .3rem; font: 400 .85rem/1 var(--text); color: var(--ink-2); vertical-align: middle; }
.cur-switch button { font: 700 .82rem/1 var(--text); padding: .32rem .55rem; border: 1.5px solid var(--ink); background: var(--sheet); color: var(--ink); border-radius: 2px; cursor: pointer; min-height: 2rem; min-width: 2.6rem; }
.cur-switch button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.book caption .cap { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.book { max-width: 100%; overflow-x: auto; }
@media (max-width: 560px) {
  .book th, .book td { padding: .55rem .7rem; }
  .book td.amt .gst { display: block; }
  .book .col-licence { display: none; }
  .book td.amt { font-size: .95rem; }
}
.colophon .cur-switch { color: var(--cloth-ink); }
.colophon .cur-switch button { border-color: var(--cloth-ink); background: transparent; color: var(--cloth-ink); }
.colophon .cur-switch button[aria-pressed="true"] { background: var(--cloth-ink); color: var(--cloth); }
