/* Static pages (home, languages, designs, tools, guides). Phone first.
   System fonts keep pages fast; only the logo uses a 3 KB font. */
/* Scripts many phones lack: downloaded only when a page shows these letters. */
@font-face { font-family: 'BB Ol Chiki'; src: url(/site/olck.woff2) format('woff2'); unicode-range: U+1C50-1C7F; font-display: swap; }
@font-face { font-family: 'BB Meetei'; src: url(/site/mtei.woff2) format('woff2'); unicode-range: U+ABC0-ABFF, U+AAE0-AAFF; font-display: swap; }
@font-face {
  font-family: 'BB Brand';
  src: url(/site/brand.woff2) format('woff2');
  font-display: swap;
}
:root {
  --ink: #142628;
  --muted: #55696b;
  --line: #e0e6e5;
  --bg: #fbfaf7;
  --card: #ffffff;
  --accent: #0c5a61;
  --accent-dark: #08474d;
  --accent-soft: #e2f0ef;
  --gold: #c27a06;
  --gold-soft: #fbefd6;
  --r: 14px;
  --shadow: 0 1px 2px rgba(15, 40, 42, 0.06), 0 6px 20px rgba(15, 40, 42, 0.07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.62 system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Devanagari', 'Nirmala UI', 'BB Ol Chiki', 'BB Meetei', sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.8rem); margin-top: 0.2em; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 9; background: #fff; padding: 8px 12px; }

/* Header */
.sh { background: var(--card); border-bottom: 1px solid var(--line); }
.sh-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 8px; }
.logo { font-family: 'BB Brand', serif; font-size: 25px; color: var(--accent); text-decoration: none; line-height: 1.1; white-space: nowrap; }
.logo b { color: #a35f00; font-weight: 400; }
.sf .logo b { color: #f5b841; }
.nav { border-top: 1px solid var(--line); }
.nav-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-in::-webkit-scrollbar { display: none; }
.nav a { flex: none; padding: 9px 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a[aria-current='page'] { border-bottom-color: var(--gold); color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-head { min-height: 40px; padding: 6px 16px; font-size: 0.95rem; }
.btn-big { min-height: 54px; padding: 12px 28px; font-size: 1.08rem; box-shadow: 0 6px 18px rgba(12, 90, 97, 0.25); }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn-small { min-height: 40px; padding: 6px 16px; font-size: 0.95rem; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 1.2em 0; }
.cta-sub { color: var(--muted); font-size: 0.95rem; }

/* Sections */
main { display: block; }
.sec { padding-top: 28px; padding-bottom: 28px; }
.sec + .sec { border-top: 1px solid var(--line); }
.lead { font-size: 1.12rem; color: #2d4446; }
.muted { color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 0 0; margin: 0; font-size: 0.88rem; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 4px; }
.crumbs a { color: var(--muted); }

/* Hero */
.hero { padding: 28px 0 22px; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 24px; align-items: center; }
.hero .native { font-size: 1.25rem; color: #9a5800; font-weight: 700; margin: -0.2em 0 0.6em; }
.hero-art { position: relative; justify-self: center; max-width: 360px; width: 100%; }
.hero-art img { border-radius: 6px; box-shadow: 0 18px 40px rgba(20, 38, 40, 0.22); }
.hero-art .back { position: absolute; width: 66%; top: 7%; transform: rotate(-6deg); left: 2%; z-index: 0; }
.hero-art .front { position: relative; z-index: 1; width: 74%; margin-left: 24%; }
.ticks { list-style: none; padding: 0; margin: 0.6em 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: #2d4446; font-weight: 600; font-size: 0.97rem; }
.ticks li::before { content: '✓'; color: var(--accent); margin-right: 6px; font-weight: 800; }
.continue { display: none; }
.has-draft .continue { display: inline; }
@media (min-width: 860px) {
  .hero { padding: 48px 0 36px; }
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; }
}

/* Language chips */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.chip {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  line-height: 1.3;
}
.chip:hover { border-color: var(--accent); color: var(--ink); box-shadow: var(--shadow); }
.chip b { font-size: 1.15rem; }
.chip span { font-size: 0.85rem; color: var(--muted); }
.chip small { font-size: 0.8rem; color: var(--accent); margin-top: 2px; }

/* Picture grids */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.gallery.big { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
@media (min-width: 860px) { .gallery.big { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.gallery figure { margin: 0; }
.gallery a { text-decoration: none; color: var(--ink); display: block; }
.gallery img { display: block; width: 100%; border-radius: 4px; box-shadow: 0 3px 12px rgba(20, 38, 40, 0.16); background: #fff; transition: transform 0.15s; }
.gallery a:hover img { transform: translateY(-3px); }
.gallery figcaption { font-size: 0.88rem; color: var(--muted); padding-top: 6px; line-height: 1.35; }
.gallery figcaption b { color: var(--ink); }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: start; }
.pair figure { margin: 0; }
.pair img { border-radius: 4px; box-shadow: 0 8px 28px rgba(20, 38, 40, 0.18); background: #fff; display: block; }
.pair figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 8px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card h3 { margin-bottom: 0.35em; }
.card p { margin: 0; color: #36504f; font-size: 0.97rem; }
a.card { text-decoration: none; color: var(--ink); display: block; }
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card .ico { font-size: 1.6rem; line-height: 1; display: block; margin-bottom: 8px; }
.card img { display: block; border-radius: 4px; margin-bottom: 10px; box-shadow: 0 3px 12px rgba(20, 38, 40, 0.14); }

/* Steps */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 16px 60px; position: relative; }
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 800;
  display: grid;
  place-items: center;
}
.steps b { display: block; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f2f6f5; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td[lang], .native-text { font-size: 1.08rem; }
td.group { background: var(--gold-soft); font-weight: 700; color: #6b4303; }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; position: relative; padding-right: 40px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 16px; top: 10px; font-size: 1.4rem; color: var(--accent); }
.faq details[open] summary::after { content: '−'; }
.faq .ans { padding: 0 16px 14px; color: #2d4446; }
.faq .ans p:last-child { margin: 0; }

/* Notes and boxes */
.callout { background: var(--gold-soft); border-radius: var(--r); padding: 14px 18px; border-left: 5px solid #e2a530; }
.callout p:last-child { margin: 0; }
.note { background: var(--accent-soft); border-radius: var(--r); padding: 14px 18px; }
.copybox { display: grid; gap: 10px; }
.copybox textarea { width: 100%; font: inherit; font-size: 0.97rem; line-height: 1.5; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; resize: vertical; }
.copybox .btn { justify-self: start; }
.copy-ok { color: var(--accent); font-weight: 700; }
.two { display: grid; gap: 24px; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; } .two.wide-left { grid-template-columns: 1.3fr 0.7fr; } }
.prose { max-width: 760px; }
.prose li { margin-bottom: 0.4em; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 700; background: var(--gold-soft); color: #6b4303; border-radius: 6px; padding: 1px 8px; vertical-align: middle; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0.6em 0 0; padding: 0; list-style: none; }
.jump a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.jump a:hover { border-color: var(--accent); }

/* Tools */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.tool label { display: block; font-weight: 700; margin-bottom: 6px; }
.tool input, .tool select { font: inherit; font-size: 1.05rem; padding: 10px 12px; border: 1.5px solid #c9d4d3; border-radius: 10px; width: 100%; background: #fff; color: var(--ink); min-height: 48px; }
.tool .row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.result { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); font-size: 1.08rem; min-height: 1.6em; }
.result:empty { display: none; }
.result .big { font-size: 1.6rem; font-weight: 800; color: var(--accent); display: block; line-height: 1.3; }
.search { margin-bottom: 12px; }

/* Footer */
.sf { background: #0b3c40; color: #d7e6e5; margin-top: 40px; padding: 34px 0 20px; font-size: 0.95rem; }
.sf a { color: #e9f3f2; text-decoration: none; }
.sf a:hover { text-decoration: underline; color: #fff; }
.sf h2 { font-size: 1rem; color: #fff; margin-bottom: 10px; }
.sf ul { list-style: none; padding: 0; margin: 0; }
.sf li { margin-bottom: 6px; }
.sf-grid { display: grid; gap: 26px; }
.sf .logo { color: #fff; }
.sf-brand p { margin: 8px 0 12px; }
.sf-small { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.sf-langs { columns: 2; column-gap: 16px; }
.sf-copy { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.15); font-size: 0.85rem; color: #a9c3c1; }
@media (min-width: 860px) { .sf-grid { grid-template-columns: 1.2fr 1.4fr 1fr 1fr; } }
figure.hero-art { margin: 0; }
.hero-art .solo { width: 100%; display: block; }

/* ---------- Word review pages (/review/…) ---------- */
.rv-page h1 { font-size: 1.6rem; }
.rv-progress { position: sticky; top: 0; z-index: 2; background: var(--accent); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; margin: 1em 0; }
.rv-group { margin: 26px 0; }
.rv-group h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.rv-count { font-size: 0.8rem; background: var(--line); border-radius: 999px; padding: 1px 9px; color: var(--muted); }
.rv-done h2::after { content: '✓'; color: var(--accent); font-weight: 800; }
.rv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rv { display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rv-meaning { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 0.93rem; }
.rv-en { color: var(--muted); }
.rv-hi { font-weight: 600; }
.rv-word { width: 100%; box-sizing: border-box; font-size: 1.15rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-family: inherit; }
.rv-word:lang(sat) { font-family: 'BB Ol Chiki', sans-serif; }
.rv-word:lang(mni) { font-family: 'BB Meetei', sans-serif; }
.rv-doubt { border-color: #e2a530; }
.rv-fixed .rv-word { background: #fff6d8; border-color: #e2a530; }
.rv-done .rv { opacity: 0.75; }
.rv-ok-row { margin: 10px 0 0; }
.rv-send label { display: grid; gap: 4px; margin-bottom: 12px; font-weight: 600; }
.rv-send input, .rv-send textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
#rv-text { width: 100%; box-sizing: border-box; font-size: 0.85rem; color: var(--muted); }
.rv-summary { font-weight: 700; }
.rv-langs { columns: 2; padding-left: 1.1em; }
@media (min-width: 720px) {
  .rv { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; }
  .rv-langs { columns: 3; }
}

/* ---------- Pages written in a regional language (/mr/, /ta/ …) ---------- */
.native-link { margin: 0.4em 0 0.8em; font-weight: 700; }
.native-page .lead { font-size: 1.15rem; }
.native-page[dir='rtl'] .lead, .native-page[dir='rtl'] h1, .native-page[dir='rtl'] h2, .native-page[dir='rtl'] p, .native-page[dir='rtl'] li, .native-page[dir='rtl'] summary { line-height: 2; }
.native-page[dir='rtl'] .faq summary { padding-right: 16px; padding-left: 40px; }
.native-page[dir='rtl'] .faq summary::after { right: auto; left: 16px; }
ul.cards.plain { list-style: none; padding: 0; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
