/* ============================================================
   Telugu Study — styles. Layout, colours and Sentence Builder rules
   reused from the owner's Hangul Study; Telugu additions at the end.
   ============================================================ */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f7;
  --text: #1c1e26;
  --muted: #6b7180;
  --border: #e2e5ee;
  --accent: #3b5bdb;
  --accent-soft: #e7ecfd;
  --good: #2b8a3e;
  --good-soft: #e6f4ea;
  --bad: #c92a2a;
  --bad-soft: #fcebec;
  --np: #be185d;
  --np-bg: #fdf2f8;
  --shadow: 0 1px 3px rgba(20, 22, 40, .06), 0 6px 20px rgba(20, 22, 40, .05);
  --radius: 14px;
  --font: "Noto Sans Telugu", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --np-font: "Noto Sans Devanagari", "Kohinoor Devanagari", "Nirmala UI", var(--font);
  /* analyzer category colors */
  --c-subj:#2563eb; --c-topic:#0891b2; --c-obj:#d97706; --c-loc:#059669; --c-part:#4d7c0f;
  --c-conn:#e11d48; --c-tense:#ea580c; --c-mod:#c026d3; --c-final:#475569;
  --c-stemv:#7c3aed; --c-stemn:#334155; --c-adv:#0f766e; --c-other:#6b7280;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14151a; --surface: #1e2027; --surface-2: #262933; --text: #e8eaf0;
    --muted: #9aa0ad; --border: #2e313b; --accent: #748ffc; --accent-soft: #28304a;
    --good: #51cf66; --good-soft: #1c3025; --bad: #ff8787; --bad-soft: #3a2326;
    --np: #f9a8d4; --np-bg: #2a1220;
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
    --c-subj:#60a5fa; --c-topic:#22d3ee; --c-obj:#fbbf24; --c-loc:#34d399; --c-part:#a3e635;
    --c-conn:#fb7185; --c-tense:#fb923c; --c-mod:#e879f9; --c-final:#94a3b8;
    --c-stemv:#a78bfa; --c-stemn:#cbd5e1; --c-adv:#5eead4; --c-other:#9ca3af;
  }
}
:root[data-theme="dark"] {
  --bg: #14151a; --surface: #1e2027; --surface-2: #262933; --text: #e8eaf0;
  --muted: #9aa0ad; --border: #2e313b; --accent: #748ffc; --accent-soft: #28304a;
  --good: #51cf66; --good-soft: #1c3025; --bad: #ff8787; --bad-soft: #3a2326;
  --np: #f9a8d4; --np-bg: #2a1220;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
  --c-subj:#60a5fa; --c-topic:#22d3ee; --c-obj:#fbbf24; --c-loc:#34d399; --c-part:#a3e635;
  --c-conn:#fb7185; --c-tense:#fb923c; --c-mod:#e879f9; --c-final:#94a3b8;
  --c-stemv:#a78bfa; --c-stemn:#cbd5e1; --c-adv:#5eead4; --c-other:#9ca3af;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.np { font-family: var(--np-font); color: var(--np); }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 12px 28px;
  z-index: 40;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em;
  padding: 6px 8px 14px;
}
.sb-brand .logo {
  font-size: 1.3rem; background: var(--accent-soft); color: var(--accent);
  border-radius: 10px; width: 36px; height: 36px; display: grid; place-items: center; flex: none;
}
.sb-group { margin-top: 14px; }
.sb-group h4 {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 0 0 6px; padding: 0 10px; font-weight: 700;
}
.sb-link {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: transparent; color: var(--text);
  font-family: inherit; font-size: .94rem; font-weight: 600;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; text-align: left;
}
.sb-link .ic { width: 20px; text-align: center; flex: none; font-size: 1rem; }
.sb-link:hover { background: var(--surface-2); }
.sb-link.active { background: var(--accent); color: #fff; }
.sb-foot { margin-top: 22px; padding: 0 10px; color: var(--muted); font-size: .75rem; }

/* Main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.hamburger {
  display: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); width: 38px; height: 38px; border-radius: 10px;
  font-size: 1.1rem; cursor: pointer; flex: none;
}
.topbar .title { font-weight: 700; margin-right: auto; }
.theme-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; width: 38px; height: 38px; font-size: 1.1rem; cursor: pointer; flex: none;
}
.theme-btn:hover { background: var(--surface-2); }
.topbar { position: sticky; }
.voice-pop {
  position: absolute; top: calc(100% + 6px); right: 12px; z-index: 50;
  width: min(330px, calc(100vw - 24px)); padding: 14px; display: grid; gap: 6px;
}
.voice-pop[hidden] { display: none; }
.vp-h { font-weight: 800; }
.vp-l { font-size: .78rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.vp-l span { color: var(--accent); }
.vp-sel { width: 100%; text-align: left; }
.voice-pop input[type=range] { width: 100%; accent-color: var(--accent); }
.voice-pop #voiceTest { justify-self: start; margin-top: 2px; }
.vp-more { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.vp-more summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.vp-more ul { padding-left: 18px; margin: 6px 0; }
.vp-more li { margin-bottom: 4px; }
.vp-more p { margin: 0; }

main.content { max-width: 960px; width: 100%; margin: 0 auto; padding: 22px 16px 80px; }
.scrim {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35;
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .hamburger { display: grid; place-items: center; }
  .scrim.show { display: block; }
}

/* ---------- Views & typography ---------- */
section.view { display: none; animation: fade .25s ease; }
section.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
h1 { font-size: 1.6rem; margin: .2em 0 .1em; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1rem; }
.lede { color: var(--muted); margin: 0 0 1.2em; }
.hint { color: var(--muted); font-size: .9rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}

/* Home */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 18px; }
.home-card { text-align: left; cursor: pointer; font-family: inherit; color: inherit; }
.home-card:hover { border-color: var(--accent); transform: translateY(-2px); transition: .15s; }
.home-card .big { font-size: 1.8rem; }
.home-card h3 { margin: .4em 0 .2em; font-size: 1.05rem; }
.home-card p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Letter grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.letter { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px 8px; text-align: center; cursor: pointer; transition: .12s; }
.letter:hover { border-color: var(--accent); background: var(--accent-soft); }
.letter .glyph { font-size: 2rem; line-height: 1.1; font-weight: 600; }
.letter .rom { font-size: .82rem; color: var(--accent); font-weight: 700; }
.letter .name { font-size: .68rem; color: var(--muted); }
.letter .letter-np { font-size: .86rem; font-weight: 600; line-height: 1.3; }

/* Flashcards */
.fc-stage { display: grid; place-items: center; gap: 16px; margin-top: 10px; }
.flashcard { width: 100%; max-width: 320px; aspect-ratio: 3 / 2; perspective: 1000px; cursor: pointer; }
.fc-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; place-items: center; text-align: center; padding: 10px; }
.fc-face .glyph { font-size: 4.5rem; font-weight: 600; }
.fc-back { transform: rotateY(180deg); }
.fc-back .rom { font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.fc-back .note { color: var(--muted); font-size: .95rem; margin-top: 6px; max-width: 240px; }
.fc-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fc-progress { color: var(--muted); font-size: .9rem; }

/* Quiz */
.quiz-prompt { font-size: 3.4rem; text-align: center; font-weight: 600; margin: 8px 0 4px; }
.quiz-sub { text-align: center; color: var(--muted); margin-bottom: 14px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { padding: 16px; font-size: 1.3rem; font-weight: 700; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.correct { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.opt:disabled { cursor: default; }
.scorebar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--muted); font-size: .92rem; }

/* Letter-by-letter breakdown (Phrases, Daily, Analyzer) — reuses the Reading .rd-b / .rd-j blocks */
.lb { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.lb-w { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.lb .rd-b { font-size: .82rem; padding: 2px 6px; }
.lb .rd-b b { font-size: .95rem; }
.lb .rd-j i { font-size: .74rem; }
.ph-grid.no-letters .lb, body.hide-daily-letters .daily-item .lb, body.hide-daily-letters .turn .lb, body.hide-an-letters .t-br { display: none; }
.ph-grid.no-np .rd-j i, body.hide-np .t-br .rd-j i { display: none; }
.tile .t-br .lb { margin-top: 4px; }

/* Today's 5 */
.td-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.td-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; text-align: center; }
.td-stat b { display: block; font-size: 1.25rem; }
.td-stat span { font-size: .76rem; color: var(--muted); }
.td-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ph-search input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; margin-bottom: 10px; }
.ph-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ph-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; cursor: pointer; transition: border-color .12s; }
.ph-card:hover { border-color: var(--accent); }
.ph-ko { font-size: 1.12rem; font-weight: 700; line-height: 1.35; }
.ph-rom { font-size: .8rem; color: var(--accent); font-weight: 600; }
.ph-np { font-size: .82rem; font-weight: 600; }
.ph-en { font-size: .84rem; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.ph-grid.no-rom .ph-rom, .ph-grid.no-np .ph-np { display: none; }
@media (max-width: 480px) { .ph-grid { grid-template-columns: 1fr; gap: 6px; } }
/* 21 topics: one sideways-scrolling row on every screen size */
#phFilter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
#phFilter button { flex: none; white-space: nowrap; }

/* Reading — compact card grid with category filter */
.rd-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.rd-filter button { border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-family: inherit; font-weight: 600; font-size: .86rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.rd-filter button span { font-size: .72rem; opacity: .7; margin-left: 2px; }
.rd-filter button:hover { color: var(--text); }
.rd-filter button.active { background: var(--accent); color: #fff; border-color: transparent; }
.rd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rd-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 10px; cursor: pointer; transition: border-color .12s, transform .12s; }
.rd-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.rd-emoji { position: absolute; top: 8px; right: 10px; font-size: 1.6rem; line-height: 1; }
.rd-ko { font-size: 1.55rem; font-weight: 700; line-height: 1.25; padding-right: 30px; word-break: keep-all; }
.rd-rom { color: var(--accent); font-weight: 700; font-size: .84rem; }
.rd-np { font-size: .82rem; font-weight: 600; }
.rd-en { color: var(--muted); font-size: .82rem; line-height: 1.3; margin-top: 2px; }
.rd-syl { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.rd-b { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-size: .74rem; color: var(--muted); letter-spacing: .04em; }
.rd-b b { color: var(--text); margin-right: 3px; letter-spacing: 0; }
.rd-b { display: inline-flex; align-items: flex-end; gap: 5px; padding: 3px 7px; font-size: .9rem; color: var(--text); letter-spacing: 0; }
.rd-b b { align-self: center; font-size: 1.05rem; margin-right: 2px; }
.rd-j { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; min-width: 1.1em; }
.rd-j i { font-style: normal; font-size: .8rem; color: var(--np); font-family: var(--np-font); font-weight: 600; }
.rd-grid.no-np .rd-j i { display: none; }
.rd-grid.no-letters .rd-syl, .rd-grid.no-np .rd-np, .rd-grid.no-pt .rd-pt { display: none; }
.rd-pt { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rd-pt .chip { cursor: pointer; font-weight: 600; padding: 0 6px; font-size: .76rem; gap: 0; }
.rd-pt .chip b { font-weight: 800; }
@media (max-width: 480px) { .rd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .rd-ko { font-size: 1.35rem; } }
/* Phones: categories in one row you can swipe sideways, instead of five rows */
@media (max-width: 640px) {
  .rd-filter { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; margin-right: -16px; padding-right: 16px; }
  .rd-filter::-webkit-scrollbar { display: none; }
  .rd-filter button { flex: none; white-space: nowrap; }
}
/* Reading (old list layout) */
.word-list { display: grid; gap: 12px; }
.word { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.word .ko { font-size: 2.1rem; font-weight: 600; cursor: pointer; }
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.clause-l {
  position: absolute; top: -1px; left: 12px; transform: translateY(-50%);
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 9px; color: var(--muted);
}
.clause-l.cond { color: var(--c-conn); } .clause-l.conn { color: var(--c-tense); } .clause-l.main { color: var(--c-stemv); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--c, var(--c-other)); border-radius: 10px;
  padding: 6px 10px 8px; min-width: 64px; cursor: pointer; transition: box-shadow .15s;
}
.tile:hover { box-shadow: var(--shadow); }
.tile .t-np { font-size: .82rem; color: var(--np); font-weight: 600; }
.tile .t-en { font-size: .76rem; color: var(--text); line-height: 1.3; max-width: 150px; margin-top: 2px; }
.tile .t-en.none { color: var(--muted); }
.tile .tm { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.tile .tm .chip { font-size: .72rem; padding: 0 6px; }
.tile.low { border-style: dashed; border-top-style: solid; }
.tile .insp { display: none; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; font-size: .86rem; cursor: default; }
.tile.open .insp { display: block; }
.tile .insp .role { font-weight: 700; margin-bottom: 4px; }
.tile .insp .nt { color: var(--muted); }
.an-empty { color: var(--muted); text-align: center; padding: 26px 10px; }
.song-hint { margin-top: 10px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); padding: 10px 14px; font-size: .9rem; }
.gr-sec { margin-bottom: 14px; }
.gr-sec > summary {
  cursor: pointer; list-style: none; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-weight: 700; display: flex; align-items: center; gap: 10px;
}
.gr-sec > summary::-webkit-details-marker { display: none; }
.gr-sec > summary::before { content: "▸"; color: var(--accent); transition: transform .2s; }
.gr-sec[open] > summary::before { transform: rotate(90deg); }
.gr-sec > summary .gr-np { color: var(--np); font-weight: 600; font-size: .9rem; }
.gr-body { padding: 10px 2px 4px; }
.gr-formula { background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: .92rem; }
.gr-formula .np { display: block; margin-top: 3px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; }
table.gr-tbl { border-collapse: collapse; width: 100%; font-size: .88rem; min-width: 420px; }
table.gr-tbl th { background: var(--surface-2); text-align: left; padding: 8px 10px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); }
table.gr-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.gr-tbl td.ko { font-size: 1.05rem; font-weight: 600; }
table.gr-tbl .np { font-weight: 600; }
table.gr-tbl .t-ph { display: block; font-size: .8rem; font-weight: 600; margin-top: 2px; }
table.gr-tbl td.say, .ex dd.say { cursor: pointer; border-radius: 6px; }
table.gr-tbl td.say:hover, .ex dd.say:hover { background: var(--accent-soft); }
@media (max-width: 480px) {
  .fc-face .glyph { font-size: 3.6rem; }
  .quiz-prompt { font-size: 2.8rem; }
  .key .j { font-size: 1.05rem; }
  .ex-row { grid-template-columns: 1fr; }
  .ex-row dt { margin-top: 4px; }
}

/* ---------- Sentence Builder ---------- */
.sb-controls { margin: 10px 0; }
.sb-select { max-width: 100%; flex: 1 1 220px; min-width: 0; text-overflow: ellipsis; }
#sbMode { flex-wrap: wrap; }
.sb-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.sb-leg { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.sb-leg > b { font-size: 1.3rem; color: var(--c); line-height: 1.2; }
.sb-leg .nm { font-weight: 700; font-size: .92rem; }
.sb-leg .hint { font-size: .82rem; word-break: keep-all; overflow-wrap: break-word; }
.sb-legend-note { margin: 10px 2px 0; word-break: keep-all; }

.sb-en { font-size: 1.25rem; font-weight: 600; line-height: 2.1; margin: 4px 0 14px; }
.sb-en.plain { color: var(--muted); font-size: 1.05rem; line-height: 1.5; }
.sb-chunk { display: inline; padding: 2px 6px; border-radius: 6px; transition: background .2s, box-shadow .2s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sb-chunk.lit { background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 -3px 0 var(--c); }
.sb-chunk sub { font-size: .62rem; font-weight: 800; color: var(--c); margin-left: 3px; vertical-align: baseline; }
.sb-chunk.focus { background: color-mix(in srgb, var(--c) 32%, transparent); }

.sb-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sb-col { display: flex; flex-direction: column; border-left: 1px solid var(--border); min-width: 0; transition: box-shadow .2s, background .2s; }
.sb-col:first-child { border-left: 0; }
.sb-head { background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-bottom: 3px solid var(--c); padding: 8px 8px 6px; text-align: center; }
.sb-head b { display: block; font-size: 1.3rem; color: var(--c); line-height: 1.1; }
.sb-head .nm { display: block; font-size: .74rem; font-weight: 700; }
.sb-head small { display: block; font-size: .7rem; color: var(--muted); }
.sb-cell { flex: 1; min-height: 116px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; word-break: keep-all; overflow-wrap: anywhere; }
.sb-col.focus, .sb-col[data-asking] { background: color-mix(in srgb, var(--c) 9%, transparent); box-shadow: inset 0 0 0 2px var(--c); }
.sb-ko { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.sb-hear { cursor: pointer; border-radius: 8px; padding: 2px 6px; transition: background .15s; }
.sb-hear:hover, .sb-hear:focus-visible { background: color-mix(in srgb, var(--c, var(--accent)) 12%, transparent); outline: none; }
.sb-hear:active { transform: scale(.97); }
.sb-spk { font-size: .62em; margin-left: 5px; opacity: .45; vertical-align: middle; }
.sb-hear:hover .sb-spk { opacity: .9; }
.sb-rom { font-size: .76rem; color: var(--muted); font-style: italic; }
.sb-np { font-size: .84rem; font-weight: 600; }
.sb-q { font-size: 1.8rem; color: var(--border); font-weight: 800; }
.sb-x { font-size: 2.6rem; line-height: 1; color: var(--muted); font-weight: 300; }
.sb-note { font-size: .76rem; color: var(--muted); }
.sb-note .ko { font-weight: 700; color: var(--text); }
.sb-adv { display: flex; flex-direction: column; align-items: center; gap: 1px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px dashed var(--border); }
.sb-adv .sb-ko { font-size: 1.05rem; color: var(--c-adv); }
.sb-placed { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 4px; }
.sb-placed .sb-chunk { font-size: .85rem; font-weight: 600; }

.sb-say { margin-top: 14px; padding: 10px 14px; border-radius: 0 10px 10px 0; border-left: 3px solid var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 9%, var(--surface)); font-size: .95rem; }
.sb-say .ko, .sb-ask .ko, .sb-feed .ko { font-size: 1.05em; }
.sb-step { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c, var(--accent)); }
.sb-nav { margin-top: 12px; }
.btn:disabled { opacity: .45; cursor: default; }

.sb-info { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 14px; }
.sb-pattern, .sb-dict { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.sb-pattern { border: 2px solid var(--c-stemv); }
.sb-tag { display: inline-block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sb-pattern .sb-tag { background: color-mix(in srgb, var(--c-stemv) 15%, transparent); color: var(--c-stemv); border-radius: 4px; padding: 0 6px; }
.sb-pattern .form, .sb-dict .form { font-size: 1.3rem; font-weight: 800; }
.sb-pattern .mean, .sb-dict .mean { font-weight: 600; }
.sb-pattern .how { color: var(--muted); font-size: .86rem; margin-top: 4px; }
.sb-full { margin-top: 12px; box-shadow: none; }
.sb-full-ko { font-size: 1.45rem; font-weight: 700; }
.sb-full-np { display: inline-block; font-weight: 600; background: var(--np-bg); border-radius: 8px; padding: 2px 10px; margin: 2px 0; }
.sb-full-en { color: var(--muted); }
.sb-rows { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 8px 0 4px; align-items: baseline; }
.sb-rows dt { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sb-rows dt .np { text-transform: none; letter-spacing: 0; }
.sb-rows dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sb-rows .sb-rom { font-size: .9rem; }
.sb-approx { font-size: .66rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; padding: 0 5px; white-space: nowrap; }
.sb-npguide { margin-top: 8px; font-size: .86rem; }
.sb-npguide summary { cursor: pointer; font-weight: 600; color: var(--np); }
.sb-npguide ul { margin: 6px 0; padding-left: 18px; } .sb-npguide li { margin: 3px 0; }
.sb-npguide .np { font-weight: 600; }
.sb-say-ph { margin-top: 6px; font-size: .88rem; } .sb-say-ph i { color: var(--muted); } .sb-say-ph .np { font-weight: 600; }
@media (max-width: 480px) { .sb-rows { grid-template-columns: 1fr; gap: 0; } .sb-rows dd { margin-bottom: 4px; } }

.sb-instr { margin: 0 0 6px; }
.sb-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; min-height: 44px; }
.sb-pick { font-family: inherit; font-size: 1rem; font-weight: 600; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: grab; touch-action: manipulation; }
.sb-pick:hover { border-color: var(--accent); }
.sb-pick.sel { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 0 0 3px var(--accent-soft); }
.sb-board.clickable .sb-col { cursor: pointer; }
.sb-board.clickable .sb-col:hover, .sb-col.over { background: color-mix(in srgb, var(--c) 10%, transparent); }
.sb-col.shake { animation: sbShake .35s; box-shadow: inset 0 0 0 2px var(--bad); }
@keyframes sbShake { 0%,100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.sb-feed { min-height: 1.6em; margin: 10px 0; font-size: .95rem; }
.sb-feed.good { color: var(--good); }
.sb-feed.bad { color: var(--bad); }

.sb-ask { margin: 14px 0 8px; font-weight: 600; }
.sb-key { color: var(--c); font-size: 1.15rem; }
.sb-opts .opt { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.15rem; padding: 12px 10px; }
.sb-opts .opt .sb-rom { font-size: .74rem; font-weight: 400; }
.sb-opts .opt.wrong .sb-rom { color: inherit; }
.sb-opts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Longer sentences: a numbered row of slots that wraps */
.sb-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-slot { flex: 1 1 118px; min-width: 0; border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: 10px; background: var(--surface); overflow: hidden; transition: box-shadow .2s; }
.sb-slot.focus { box-shadow: 0 0 0 2px var(--c); }
.sb-slot-h { display: flex; align-items: baseline; gap: 5px; padding: 5px 8px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); font-size: .74rem; }
.sb-slot-h .n { font-weight: 800; color: var(--muted); font-size: .68rem; }
.sb-slot-h b { color: var(--c); font-size: .9rem; }
.sb-slot-h .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-slot-b { padding: 8px 6px 10px; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.sb-slot-b .sb-ko { font-size: 1.15rem; }

/* Phones: columns become rows, still read top → bottom in S · W · O · How · V order */
@media (max-width: 640px) {
  .sb-board { grid-template-columns: 1fr; }
  .sb-col { flex-direction: row; border-left: 0; border-top: 1px solid var(--border); }
  .sb-col:first-child { border-top: 0; }
  .sb-head { width: 92px; flex: none; border-bottom: 0; border-right: 3px solid var(--c); display: flex; flex-direction: column; justify-content: center; }
  .sb-cell { min-height: 72px; align-items: flex-start; text-align: left; padding: 10px 12px; }
  .sb-adv { align-items: flex-start; }
  .sb-placed { justify-content: flex-start; }
  .sb-x { font-size: 1.8rem; }
  .sb-info { grid-template-columns: 1fr; }
  .sb-en { font-size: 1.1rem; }
  .sb-head { width: 96px; padding: 8px 6px; }
  .sb-head small { display: none; }
  .sb-head .nm { font-size: .7rem; line-height: 1.3; }
  #sbMode { display: flex; width: 100%; }
  #sbMode { flex-wrap: wrap; }
  #sbMode button { flex: 1 1 45%; padding: 8px 6px; font-size: .82rem; }
  .sb-slot { flex-basis: 140px; }
  .sb-select { flex-basis: 150px; }
  #sbStage { padding: 14px; }
}

/* ▶ Play all */
.playall-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 6px 0 12px; }
.playall-row .hint { font-size: .84rem; }
.playing { outline: 3px solid var(--accent); outline-offset: 2px; background: var(--accent-soft) !important; transition: outline-color .15s; }
/* Analyzer tiles with a letter breakdown must wrap inside the screen on phones */
.tiles .tile { max-width: 100%; min-width: 0; }
.tile .t-br .lb, .tile .t-br .lb-w { flex-wrap: wrap; max-width: 100%; }
/* The song picker has long option names; never let it grow past the screen */
#anSamplePick { max-width: 100%; min-width: 0; flex: 1 1 200px; text-overflow: ellipsis; }
/* Today's 5: compact stats on phones (3 across) */
@media (max-width: 480px) {
  .td-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .td-stat { padding: 6px 4px; }
  .td-stat b { font-size: 1.05rem; }
  .td-stat span { font-size: .68rem; line-height: 1.2; display: block; }
}
/* Selected word-type button: keep the type label readable on the blue background */
.rd-types button.active .chip, #drMoods button.active .chip, #sbCats button.active .chip { color: #fff; background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.55); }
/* 🎬 Drama Korean */
.dr-when { font-size: .78rem; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.dr-card .ph-ko .btn.small { padding: 1px 6px; font-size: .75rem; vertical-align: middle; }
.dr-note { background: var(--surface); border-left: 3px solid var(--accent); border-radius: 8px; padding: 6px 10px; margin: 0 0 10px; font-size: .88rem; display: flex; flex-direction: column; gap: 2px; }
.dr-note span { color: var(--muted); font-size: .8rem; }
.dr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-items: start; }
.dr-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; transition: border-color .12s; min-width: 0; }
.dr-card:hover, .dr-card.open { border-color: var(--accent); }
.dr-card.open { grid-column: 1 / -1; }
.pt-topic{--pc:var(--c-topic)} .pt-subj{--pc:var(--c-subj)} .pt-obj{--pc:var(--c-obj)} .pt-with{--pc:var(--c-part)} .pt-at,.pt-to,.pt-time{--pc:var(--c-loc)} .pt-by,.pt-until,.pt-toward{--pc:var(--c-tense)} .pt-every{--pc:var(--c-part)} .pt-help{--pc:var(--c-mod)} .pt-neg{--pc:var(--c-conn)}
.mk-w { display: inline-flex; align-items: flex-start; gap: 3px; padding: 2px 4px; vertical-align: top; margin-bottom: 4px; }
.mk-stem { line-height: 1.25; }
.mk-pt { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 1px 5px 2px; border: 2px solid var(--pc); border-radius: 7px; background: var(--surface); color: var(--pc); font-weight: 800; }
.mk-pt small { font-family: inherit; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.mk-sent .mk-pt { font-size: .82em; }
.mk-sent .mk-pt small { font-size: .6rem; margin-top: 1px; }
.mk-dot { vertical-align: top; }
.mk-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 4px; }
.mk-key-h { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 2px; }
.mk-key .mk-pt { font-size: .85rem; opacity: .45; border-style: dashed; }
.mk-key .mk-pt.used { opacity: 1; border-style: solid; }
.mk-mark { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mk-mark > span { font-size: .78rem; font-weight: 700; color: var(--muted); }
.mk-mark button { font-family: inherit; font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 2px solid var(--pc); background: var(--surface); color: var(--pc); cursor: pointer; }
.mk-mark button.on { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); box-shadow: inset 0 0 0 1px var(--pc); }

/* Make your own — English, romanization and Nepali coloured to match the Korean pieces */
.mk-row-c .mk-c { color: var(--c); font-weight: 700; border-bottom: 2.5px solid color-mix(in srgb, var(--c) 55%, transparent); }
.mk-row-c .mk-cp { color: var(--pc); font-weight: 800; border: 1.5px solid var(--pc); border-radius: 5px; padding: 0 3px; margin-left: 1px; background: var(--surface); }
.sb-rom.mk-row-c { font-size: .95rem; }
.sb-full-np.mk-row-c { line-height: 1.9; }

/* Marker badges inside the column cards of the other Sentence Builder modes */
.mk-card { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 2px 4px; }
.mk-card .mk-w { background: none; box-shadow: none; padding: 0; margin: 0; }
.mk-card .mk-pt { font-size: .7em; }
.mk-card .mk-pt small { font-size: .5rem; }
.mk-card .sb-spk { align-self: center; }
.sb-rom.mk-row-c, .sb-np.mk-row-c { font-style: normal; }
.sb-cell .mk-row-c .mk-c, .sb-slot-b .mk-row-c .mk-c { border-bottom: none; font-weight: 600; }
.sb-cell .mk-row-c .mk-cp, .sb-slot-b .mk-row-c .mk-cp { padding: 0 2px; }

/* Helper verbs (want, like, will …) and 안/못 — a boxed word with its meaning underneath */
.mk-w.mk-hw { background: none; box-shadow: none; padding: 2px 0; }
.mk-sent .mk-help { font-size: .9em; }
.mk-help small { text-transform: none; letter-spacing: 0; }
.sb-wslots { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.sb-wslot { border-radius: 8px; padding: 3px 6px; text-align: center; }
.sb-wslot.on { border: 1.5px solid var(--pc); background: var(--surface); padding: 4px 6px 6px; }
.sb-wslot.off { display: flex; justify-content: space-between; align-items: center; border: 1px dashed var(--border); opacity: .55; }
.sb-wslot-h { display: block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--pc, var(--muted)); text-align: left; }
.sb-wslot-h i { font-style: normal; opacity: .8; }
.sb-wslot.off .sb-wslot-h { color: var(--muted); }
.sb-wslot-x { color: var(--muted); font-size: .8rem; }
.sb-wslot .sb-ko { font-size: 1.15rem; }

/* Verb column: Not → Action verb → Helper */
.pt-act{--pc:var(--c-stemv)} .pt-join{--pc:var(--c-stemv)}
.sb-vfrom { font-size: .7rem; color: var(--muted); margin-top: 2px; }

/* Buttons, segments, chips and colour groups (from Hangul Study) */
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; font-weight: 600; font-size: .92rem; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: 6px 11px; font-size: .84rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: none; background: var(--surface); color: var(--muted); padding: 8px 14px; font-family: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.seg button.active { background: var(--accent); color: #fff; }
.chip {
  --c: var(--c-other);
  display: inline-flex; align-items: center; gap: 4px; border-radius: 6px;
  padding: 1px 8px; font-size: .78rem; font-weight: 700; color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 38%, transparent); white-space: nowrap; line-height: 1.6;
}
.cat-subj{--c:var(--c-subj)} .cat-topic{--c:var(--c-topic)} .cat-obj{--c:var(--c-obj)} .cat-loc{--c:var(--c-loc)}
.cat-part{--c:var(--c-part)} .cat-conn{--c:var(--c-conn)} .cat-tense{--c:var(--c-tense)} .cat-mod{--c:var(--c-mod)}
.cat-final{--c:var(--c-final)} .cat-stemv{--c:var(--c-stemv)} .cat-stemn{--c:var(--c-stemn)} .cat-adv{--c:var(--c-adv)} .cat-other{--c:var(--c-other)}

/* ============================================================
   Telugu Study additions
   ============================================================ */
:root { --te-font: "Noto Sans Telugu", "Telugu Sangam MN", "Nirmala UI", "Gautami", system-ui, sans-serif;
  --c-per:#db2777; --c-q:#9333ea; --c-from:#b45309; }
:root[data-theme="dark"] { --c-per:#f472b6; --c-q:#c084fc; --c-from:#fbbf24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-per:#f472b6; --c-q:#c084fc; --c-from:#fbbf24; } }
.te, .glyph, .quiz-prompt, .sb-ko, .rd-ko, .ph-ko, .tx-te { font-family: var(--te-font); }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px 16px 30px; }
.h2np { font-size: .85rem; font-weight: 600; }
.main { overflow-x: clip; }

/* Marker colours (shared by badges, W/V boxes and the coloured rows) */
.pt-obj{--pc:var(--c-obj)} .pt-to{--pc:var(--c-loc)} .pt-in{--pc:var(--c-topic)} .pt-with{--pc:var(--c-part)}
.pt-from{--pc:var(--c-from)} .pt-time{--pc:var(--c-tense)} .pt-q{--pc:var(--c-q)} .pt-per{--pc:var(--c-per)}
.pt-help{--pc:var(--c-mod)} .pt-neg{--pc:var(--c-conn)} .pt-act{--pc:var(--c-stemv)} .pt-plain{--pc:var(--c-loc)}
.mk-pt .te { font-size: 1em; }
.mk-w { display: inline-flex; align-items: flex-start; gap: 2px; padding: 2px 4px; border-radius: 6px; vertical-align: top; margin-bottom: 4px;
  background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 -3px 0 var(--c); }
.mk-w.join { margin-left: -6px; }
.mk-sent { font-family: var(--te-font); }

/* Home: Telugu ↔ Nepali alphabet strip */
.home-compare { display: grid; gap: 4px; max-width: 420px; padding: 12px 16px; }
.hc-row { display: flex; align-items: baseline; gap: 12px; }
.hc-l { width: 58px; flex: none; font-size: .7rem; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.hc-te { font-family: var(--te-font); font-size: 1.6rem; font-weight: 700; letter-spacing: .25em; }
.hc-np { font-size: 1.45rem; font-weight: 600; letter-spacing: .25em; }
.hc-rom { color: var(--accent); font-weight: 700; letter-spacing: .1em; }

/* Alphabet */
.letter { position: relative; }
.letter .glyph { font-family: var(--te-font); }
.letter .apx { position: absolute; top: 3px; right: 5px; font-size: .62rem; font-weight: 800; color: var(--c-tense); }
.letter.approx { border-style: dashed; border-color: color-mix(in srgb, var(--c-tense) 55%, var(--border)); }
.cons-row { margin-bottom: 10px; }
.cons-row h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 6px; }
.al-note { margin: 10px 0; border-left: 4px solid var(--c-tense); }
.al-note b.te { font-size: 1.4rem; }
.cj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cj { text-align: left; cursor: pointer; padding: 10px 12px; }
.cj:hover { border-color: var(--accent); }
.cj-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.cj-c { font-family: var(--te-font); font-size: 2rem; font-weight: 700; line-height: 1.2; }
.cj-p { font-family: var(--te-font); font-size: .78rem; color: var(--muted); }
.cj-w { font-family: var(--te-font); font-size: 1.15rem; font-weight: 700; margin-top: 4px; }
.cj-w .pic { font-family: initial; margin-right: 4px; }

/* Flashcards */
.fc-np { font-size: 1.5rem; font-weight: 700; }
.fc-front .glyph { font-size: 4rem; line-height: 1.2; }
.fc-front .glyph.small { font-size: 2.4rem; }

/* Words — letter blocks */
.rd-ko { word-break: normal; }
.ak { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; padding: 2px 5px; border-radius: 6px; background: var(--surface-2); min-width: 1.6em; }
.ak b { font-family: var(--te-font); font-size: 1.02rem; color: var(--text); }
.ak i { font-style: normal; font-size: .66rem; color: var(--accent); font-weight: 700; }
.ak u { text-decoration: none; font-family: var(--np-font); font-size: .76rem; color: var(--np); font-weight: 600; }
.ak-row { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.ph-grid.no-letters .ak-row { display: none; }
.apx-line { font-size: .72rem; color: var(--c-tense); margin-top: 3px; }

/* Grammar */
.tx { display: inline-flex; flex-direction: column; cursor: pointer; border-radius: 8px; padding: 2px 6px; line-height: 1.25; vertical-align: top; }
.tx:hover { background: var(--accent-soft); }
.tx .tx-te { font-size: 1.15rem; font-weight: 700; }
.tx .tx-r { font-size: .74rem; color: var(--muted); font-style: italic; }
.tx .tx-n { font-size: .8rem; color: var(--np); font-family: var(--np-font); font-weight: 600; }
.tx.inl { display: inline-flex; background: var(--surface-2); }
.go-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.go-box { border: 1px solid var(--border); border-top: 4px solid var(--c, var(--accent)); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; background: var(--surface); min-width: 0; }
.go-box > b { color: var(--c); font-size: 1.1rem; }
.go-box small, .pm small, .tn small { color: var(--muted); font-size: .76rem; }
.go-arrow { font-size: 1.4rem; color: var(--muted); }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.pm { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 1px solid var(--border); border-left: 4px solid var(--pc, var(--accent)); border-radius: 10px; padding: 8px 10px; background: var(--surface); min-width: 0; }
.pm-np { font-size: .86rem; font-weight: 600; }
.tense-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.tn { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-left: 4px solid var(--c-stemv); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.tn.neg { border-left-color: var(--c-conn); } .tn.help { border-left-color: var(--c-mod); }
.tn > b { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.gr-tbl { min-width: 0; }
table.gr-tbl td { font-size: .86rem; }
.tbl-wrap { max-width: 100%; }

/* Voice panel */
.vp-warn { margin: 0; font-size: .78rem; color: var(--c-tense); }

/* Sentence Builder — Telugu */
.sb-legend .sb-leg b { font-family: inherit; }
.sb-pic { font-size: 1.3rem; line-height: 1; margin-bottom: 2px; }
.sb-wslot.on .sb-pic { font-size: 1.1rem; }
.sb-play { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.sb-col.speaking, .sb-wslot.speaking { box-shadow: inset 0 0 0 3px var(--accent); background: var(--accent-soft); }
.mk-sent .mk-w.speaking { box-shadow: inset 0 -3px 0 var(--c), 0 0 0 2px var(--accent); }
.sb-opts .opt .te { font-size: 1.15rem; }
.sb-full-ko { font-family: var(--te-font); }
.mk-card .mk-w.join { margin-left: -4px; }
.sb-hear .sb-ven { color: var(--text); }
.sb-ven { font-size: .78rem; color: var(--text); font-weight: 600; margin-top: 2px; }
.sb-cellnote { font-size: .72rem; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.sb-full-en.mk-row-c .mk-c { color: var(--c); }
.mk-make .mk-row { grid-template-columns: 120px 1fr; }
.mk-make select { width: 100%; }
@media (max-width: 640px) {
  .mk-make .mk-row { grid-template-columns: 1fr; gap: 4px; }
  .sb-board .sb-cell { align-items: stretch; }
  .sb-wslots { width: 100%; }
  .home-compare { max-width: 100%; }
  .hc-te, .hc-np { letter-spacing: .12em; font-size: 1.3rem; }
}
.mk-form { display: flex; flex-direction: column; gap: 8px; }
.mk-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.mk-lab { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; padding-top: 6px; }
.mk-lab b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--c); color: #fff; font-size: .85rem; flex: none; }
.mk-in { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mk-sel { width: 100%; max-width: 100%; text-align: left; font-size: .95rem; }
.mk-sub { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: center; }
.mk-sub > span { font-size: .78rem; font-weight: 700; color: var(--muted); }
.mk-x { font-size: .86rem; color: var(--muted); padding: 6px 0; }
.mk-tense { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-tense button { font-family: inherit; font-size: .84rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--c); background: var(--surface); color: var(--c); cursor: pointer; }
.mk-tense button.on { background: var(--c); color: #fff; }
.mk-note { margin-top: 10px; }
/* Keep a Telugu word and its marker badge together */
.mk-w, .mk-stem { white-space: nowrap; }
.mk-card { max-width: 100%; }
@media (max-width: 640px) { .sb-cell .mk-card { justify-content: flex-start; } .sb-cell .sb-pic { text-align: left; } }
