/* Lithuanian tables review — one stylesheet for the three pages and for the HTML that Wiktionary returns. */

@font-face {
  font-family: "Noto Sans LT";
  src: url("../fonts/noto-sans-lt.woff2") format("woff2-variations"), url("../fonts/noto-sans-lt.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif LT";
  src: url("../fonts/noto-serif-lt.woff2") format("woff2-variations"), url("../fonts/noto-serif-lt.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
}

:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1f1d18;
  --ink-2: #5d574d;
  --ink-3: #8a8377;
  --line: #e6e0d4;
  --line-strong: #d2c9b8;
  --accent: #0a6b4d;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --gold: #d9a400;
  --gold-soft: #fdf5dc;
  --wrong: #c1272d;
  --wrong-ink: #8f1218;
  --wrong-soft: #fde6e4;
  --hover: #f3efe6;
  --head-bg: #f2ede3;
  --head-bg-2: #f8f5ef;
  --title-bg: #ebe4d6;
  --focus: #2f6fdf;
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 4px 14px rgba(40, 30, 10, .05);
  --font-ui: "Noto Sans LT", "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --font-lt: "Noto Serif LT", "Noto Serif", "Charis SIL", "Times New Roman", serif;
  --wikt-palette-red: var(--wrong);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --surface: #1d1b16;
    --surface-2: #23211b;
    --ink: #ede8dd;
    --ink-2: #b1a999;
    --ink-3: #847d70;
    --line: #34302a;
    --line-strong: #4a4539;
    --accent: #52c49a;
    --accent-ink: #0b1d16;
    --accent-soft: #173328;
    --gold: #e7b928;
    --gold-soft: #2e2713;
    --wrong: #ff7d74;
    --wrong-ink: #ffb3ad;
    --wrong-soft: #3d1c1a;
    --hover: #29261f;
    --head-bg: #29261f;
    --head-bg-2: #221f19;
    --title-bg: #302c23;
    --focus: #79a6ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14130f; --surface: #1d1b16; --surface-2: #23211b; --ink: #ede8dd; --ink-2: #b1a999; --ink-3: #847d70;
  --line: #34302a; --line-strong: #4a4539; --accent: #52c49a; --accent-ink: #0b1d16; --accent-soft: #173328;
  --gold: #e7b928; --gold-soft: #2e2713; --wrong: #ff7d74; --wrong-ink: #ffb3ad; --wrong-soft: #3d1c1a;
  --hover: #29261f; --head-bg: #29261f; --head-bg-2: #221f19; --title-bg: #302c23; --focus: #79a6ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}
:lang(lt) { font-family: var(--font-lt); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; }
small { font-size: .85em; color: var(--ink-2); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand-flag {
  width: 22px; height: 15px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08);
  background: linear-gradient(#f2b705 0 33.4%, #006a44 33.4% 66.7%, #c1272d 66.7%);
}
.topnav { display: flex; gap: 4px; }
.topnav a { color: var(--ink-2); text-decoration: none; padding: 5px 12px; border-radius: 999px; font-weight: 500; }
.topnav a:hover { background: var(--hover); color: var(--ink); }
.topnav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.save-status {
  margin-left: auto; font-size: 13px; color: var(--accent);
  padding: 3px 10px; border-radius: 999px; background: var(--accent-soft);
}
.save-status:empty { display: none; }
.save-status.is-busy { color: var(--ink-2); background: var(--hover); }
.save-status.is-bad { color: var(--wrong-ink); background: var(--wrong-soft); }
.save-status.is-off { color: var(--ink-2); background: var(--hover); }

.footer { max-width: 1280px; margin: 40px auto 0; padding: 18px 24px 30px; color: var(--ink-3); font-size: 12.5px; border-top: 1px solid var(--line); }
.footer a { color: inherit; }

/* ------------------------------------------------------------ buttons, chips, notices */
.btn {
  font: inherit; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: var(--hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-big { font-size: 16px; padding: 10px 26px; }
.btn-ok.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-flag { color: var(--ink-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.6;
  cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); background: var(--hover); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.chip.st-ok .dot { background: var(--accent); }
.chip.st-marked .dot { background: var(--wrong); }
.chip.is-on { border-color: var(--accent); background: var(--accent-soft); }
.chip.demo { font-family: var(--font-ui); font-size: 12px; padding: 0 8px; cursor: default; background: transparent; border-color: transparent; color: var(--ink-2); }

.notice { margin: 0 0 14px; padding: 9px 14px; border-radius: 10px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.notice.is-bad { background: var(--wrong-soft); border-color: color-mix(in srgb, var(--wrong) 40%, transparent); color: var(--wrong-ink); }
.loading { color: var(--ink-3); font-style: italic; margin: 10px 0; }
.loading::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.calm-box { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--gold); }
.calm-box p { margin: 0 0 6px; }
.calm-title { font-size: 13px; color: var(--ink-2); }
.calm-msg { font-family: var(--font-lt); font-size: 16.5px; line-height: 1.55; }
.calm-foot { font-size: 13px; color: var(--ink-3); margin-top: 8px !important; }

/* ------------------------------------------------------------ home */
.home { max-width: 920px; margin: 0 auto; padding: 32px 24px 0; }
.hero h1 { font-family: var(--font-lt); font-size: clamp(30px, 5vw, 44px); font-weight: 650; margin: 18px 0 12px; letter-spacing: -.01em; }
.lede { font-size: 17px; color: var(--ink-2); max-width: 680px; margin: 0 0 26px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-bottom: 30px; }
.choice {
  display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .12s, border-color .12s;
}
.choice:hover { transform: translateY(-2px); border-color: var(--accent); }
.choice-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.choice-title { font-family: var(--font-lt); font-size: 24px; font-weight: 650; }
.choice-text { color: var(--ink-2); flex: 1; }
.choice-go { color: var(--accent); font-weight: 600; }
.known { padding: 16px 20px; background: var(--gold-soft); border-radius: 14px; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.known h2 { font-size: 15px; margin: 0 0 8px; }
.known ul, .known-inline ul { margin: 0; padding-left: 20px; }
.known li, .known-inline li { margin: 3px 0; }
.small-print { color: var(--ink-3); font-size: 13px; margin-top: 18px; }

/* ------------------------------------------------------------ review layout */
.review-layout {
  max-width: 1320px; margin: 0 auto; padding: 20px 24px 0;
  display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start;
}
.sidebar { position: sticky; top: 66px; max-height: calc(100vh - 80px); overflow: auto; padding-bottom: 20px; }
.tabs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.tab {
  font: inherit; display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--ink-2); cursor: pointer; text-align: left;
}
.tab:hover { background: var(--hover); color: var(--ink); }
.tab.is-on { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.tab-count { font-size: 12.5px; color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.index-wrap > summary { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); cursor: pointer; margin: 4px 0 8px; }
.idx-legend { margin: 0 0 6px; }
.idx-head { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 12px 0 6px; }
.idx-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.review-main { min-width: 0; }
.howto { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; margin-bottom: 22px; }
.howto > summary { font-weight: 600; cursor: pointer; }
.howto ol { margin: 10px 0 12px; padding-left: 22px; }
.howto li { margin: 4px 0; }
.known-inline { background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 4px; font-size: 14px; }
.known-title { font-weight: 600; margin: 0 0 4px; }

.group-head { font-family: var(--font-lt); font-size: 22px; font-weight: 650; margin: 30px 0 14px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.group-head:first-child { margin-top: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 16px 20px 14px; margin-bottom: 22px; scroll-margin-top: 74px; min-height: 140px;
}
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 10px; }
.lemma { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: .005em; }
.cell-tag { font-size: 12.5px; color: var(--ink-2); background: var(--head-bg); border-radius: 999px; padding: 2px 10px; }
.call { font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 2px 8px; overflow-wrap: anywhere; }
.card-head .call { margin-left: auto; }
.note { margin: 0 0 12px; padding: 8px 12px; background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; font-size: 14px; }
.card-foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.foot-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.foot-hint { font-size: 13px; color: var(--ink-3); }
.foot-label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; }
.foot-comment { display: flex; gap: 8px; align-items: flex-start; }
.foot-comment textarea { flex: 1; }
textarea, input[type="text"] {
  font: inherit; font-family: var(--font-lt); font-size: 16px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 8px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); background: var(--surface); }
.flash { margin: 0 0 8px; font-size: 13px; color: var(--accent); }
.my-marks, .earlier { margin-top: 12px; font-size: 14px; }
.earlier { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-strong); }
.mm-head { margin: 0 0 4px; font-size: 13px; color: var(--ink-2); }
.my-marks ul, .earlier ul { margin: 0; padding-left: 20px; }
.mm-form { font-weight: 600; color: var(--wrong-ink); }
.mm-where { color: var(--ink-3); font-size: 13px; }
.mm-comment { font-style: italic; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pager-pos { color: var(--ink-3); font-size: 14px; }

/* ------------------------------------------------------------ the HTML from Wiktionary */
.wiki-output { max-width: 100%; overflow-x: auto; padding: 2px 2px 6px; }
.wiki-output p { margin: 0 0 8px; }
.inflection-table-block { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; max-width: 100%; width: auto !important; }
.inflection-table-wrapper {
  max-width: 100%; overflow-x: auto; margin: 0 0 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
}
.inflection-table-block > .inflection-table-wrapper { margin-bottom: 0; }
table.inflection-table, table.inflection-box-content { border-collapse: collapse; border-style: hidden; margin: 0; }
.inflection-table caption, .inflection-box-content > caption {
  caption-side: top; text-align: left; padding: 9px 14px; font-weight: 600; font-size: 14.5px;
  background: var(--title-bg); border-bottom: 1px solid var(--line-strong);
}
.inflection-table caption small, .inflection-box-content > caption small { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.inflection-table caption a, .inflection-box-content > caption a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.mention { font-style: normal; font-weight: 700; font-family: var(--font-lt); }
.inflection-table th, .inflection-table td { border: 1px solid var(--line); padding: 5px 12px; vertical-align: middle; }
.inflection-table th {
  background: var(--head-bg); color: var(--ink-2); font-weight: 600; font-size: 13px; text-align: left; white-space: nowrap;
}
.inflection-table th a { color: inherit; text-decoration: none; }
.inflection-table th a:hover { text-decoration: underline; }
.inflection-table th.secondary { background: var(--head-bg-2); font-weight: 500; font-style: italic; text-align: center; }
.inflection-table th.outer { background: var(--title-bg); text-align: center; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.inflection-table td { font-size: 16.5px; line-height: 1.75; color: var(--ink); background: var(--surface); }
.inflection-table td.separator { background: var(--surface-2); border-top-color: transparent; border-bottom-color: transparent; padding: 0; width: 10px; }
.inflection-table sup, .inflection-table-notes sup { color: var(--wrong); font-family: var(--font-ui); font-size: 10.5px; font-weight: 600; margin-left: 1px; }
.inflection-table-notes { padding: 8px 14px 10px; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-top: 1px solid var(--line); }
.inflection-table-notes p { margin: 0; line-height: 1.7; }
.inflection-box-content > tbody > tr > td { padding: 12px; border: none; vertical-align: top; }
.inflection-box-content .inflection-table-wrapper { margin-bottom: 0; }
.inflection-box.flow-vertical .inflection-box-content > tbody > tr > td { display: block; }
.wiki-output ul { margin: 0; padding-left: 22px; }
.wiki-output .IPA { font-family: var(--font-lt); font-size: 17px; }

/* links inside the playground output: quiet, a missing entry looks like any other */
.play-output td a, .play-output li a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.play-output td a:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------ marking forms */
.rv-form {
  cursor: pointer; border-radius: 5px; padding: 1px 3px; margin: 0 -3px;
  transition: background .1s, box-shadow .1s; outline: none;
}
.rv-form a { color: inherit; text-decoration: none; cursor: inherit; }
.rv-form:hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--line-strong); }
.rv-form:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.rv-form.is-wrong { background: var(--wrong-soft); color: var(--wrong-ink); box-shadow: inset 0 0 0 1.5px var(--wrong); }
.rv-note {
  display: none; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; margin: 0 2px 0 4px; vertical-align: -3px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.rv-note:hover { color: var(--ink); border-color: var(--ink-3); }
/* only on a marked or commented form: a button that appeared on hover would widen the column and move the table */
.rv-note.is-shown { display: inline-flex; }
.rv-note.has-note { background: var(--wrong); border-color: var(--wrong); color: #fff; }

.note-pop {
  position: absolute; z-index: 60; width: 340px; padding: 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.np-head { display: flex; flex-direction: column; margin-bottom: 8px; }
.np-form { font-family: var(--font-lt); font-weight: 700; font-size: 18px; }
.np-where { font-size: 12.5px; color: var(--ink-3); }
.np-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ------------------------------------------------------------ playground */
.play { max-width: 1320px; margin: 0 auto; padding: 22px 24px 0; }
.play-intro h1 { font-family: var(--font-lt); font-size: clamp(28px, 4vw, 38px); margin: 8px 0 8px; font-weight: 650; }
.play-grid { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; }
.play-form { display: flex; flex-direction: column; gap: 14px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-btn { font: inherit; font-size: 14px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.kind-btn:hover { color: var(--ink); background: var(--hover); }
.kind-btn.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.markbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.markbar-label { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-right: 2px; }
.mark-btn { font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 8px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.mark-btn:hover { border-color: var(--accent); }
.mark-btn:active { background: var(--accent-soft); }
.mark-btn .mk { font-size: 24px; line-height: 1; padding-top: 2px; }
.markbar-help { flex-basis: 100%; margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 5px; border: none; padding: 0; margin: 0; }
.field > label, .field > legend, .page-field > summary { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field input[type="text"] { font-size: 19px; padding: 7px 12px; }
.radios { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
.radios legend { margin-bottom: 4px; width: 100%; }
.radios label { display: inline-flex; align-items: center; gap: 5px; font-size: 15px; cursor: pointer; }
.radios input { accent-color: var(--accent); width: 16px; height: 16px; }
.help-link { font-weight: 400; margin-left: 6px; font-size: 12.5px; }
.hint { margin: 0; font-size: 13px; color: var(--ink-3); }
.page-field > summary { cursor: pointer; }
.page-field[open] > summary { margin-bottom: 6px; }
.call-row { display: flex; flex-direction: column; gap: 4px; }
.call-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.call-row .call { font-size: 15px; padding: 6px 10px; color: var(--ink); }
.examples-wrap { border-top: 1px solid var(--line); padding-top: 12px; }
.ex-label { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-chip { font-family: var(--font-lt); }
.result-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.result { min-width: 0; }
.result-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 12px; }
.result-page { font-size: 13px; color: var(--ink-3); }
.report { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.report-box textarea { margin-bottom: 8px; }
.thanks { color: var(--accent); margin: 0; }
.word-box h2 { font-size: 17px; margin: 0 0 4px; }
.word-box label { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; margin: 10px 0 4px; }
.word-box .foot-row { margin-top: 10px; }

/* ------------------------------------------------------------ option controls (playground) */
.fields { display: flex; flex-direction: column; gap: 14px; }
.seg { display: flex; flex-wrap: wrap; gap: 0; }
.seg-btn {
  font: inherit; font-size: 14px; padding: 5px 12px; cursor: pointer; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-strong); margin: 0 -1px -1px 0;
}
.seg-btn:first-child { border-radius: 9px 0 0 9px; }
.seg-btn:last-child { border-radius: 0 9px 9px 0; }
.seg-btn:only-child { border-radius: 9px; }
.seg-btn:hover { background: var(--hover); color: var(--ink); }
.seg-btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; position: relative; z-index: 1; }
.seg-btn :lang(lt), .seg-btn { font-family: inherit; }
.check { display: flex; align-items: baseline; gap: 8px; font-size: 14.5px; cursor: pointer; padding: 3px 0; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; transform: translateY(2px); }
.check-hint { color: var(--ink-3); }
.more { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.more > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.more[open] > summary { border-bottom: 1px solid var(--line); }
.more-count { font-weight: 400; color: var(--accent); font-size: 13px; }
.more-body { padding: 4px 14px 12px; }
.opt-group { padding: 10px 0; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.opt-group:last-child { border-bottom: none; }
.opt-title { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.stem-field.is-needed > label::after { content: " — needed for this word"; color: var(--wrong); font-weight: 500; }
.stem-field.is-needed input { border-color: color-mix(in srgb, var(--wrong) 55%, var(--line-strong)); }
.variant { display: flex; gap: 6px; align-items: center; }
.variant + .variant { margin-top: 6px; }
.link-btn { font: inherit; font-size: 13px; background: none; border: none; color: var(--accent); cursor: pointer; padding: 2px 0; text-align: left; align-self: flex-start; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { font: inherit; font-size: 16px; line-height: 1; width: 28px; height: 28px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); cursor: pointer; }
.icon-btn:hover { color: var(--wrong); border-color: var(--wrong); }
.btn-small { font-size: 13px; padding: 5px 11px; align-self: flex-start; }
.sec-cases { display: flex; flex-direction: column; gap: 8px; }
.sec-case { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sec-name { width: 90px; font-size: 14px; }
.ovr { display: flex; flex-direction: column; gap: 10px; }
.ovr-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.ovr-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ovr-head select, .ovr-head .icon-btn { flex: none; }
.ovr-head .icon-btn { margin-left: auto; }
select {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 8px; max-width: 100%;
}
.ovr-values { display: flex; flex-direction: column; gap: 6px; }
.ovr-value { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.ovr-value input[type="text"] { font-size: 16px; padding: 5px 9px; }
.markbar-extra { display: inline-flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------ narrow screens */
@media (max-width: 1000px) {
  .play-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .review-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 12px; }
  .sidebar { position: static; max-height: none; overflow: visible; padding-bottom: 0; }
  .tabs { flex-direction: row; overflow-x: auto; }
  .tab { flex: 1; flex-direction: column; align-items: flex-start; gap: 0; }
  .index-wrap:not([open]) { margin-bottom: 4px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 8px 16px; gap: 10px; }
  .save-status { margin-left: 0; flex-basis: 100%; text-align: center; }
  .home, .review-layout, .play { padding-left: 16px; padding-right: 16px; }
  .card { padding: 14px 14px 12px; border-radius: 14px; }
  .card-head .call { margin-left: 0; }
  .lemma { font-size: 23px; }
  .panel { padding: 14px; }
  .inflection-table td { font-size: 16px; padding: 4px 9px; }
  .inflection-table th { padding: 4px 9px; }
  .foot-comment { flex-direction: column; align-items: stretch; }
  .note-pop { position: fixed; left: 10px !important; right: 10px; bottom: 10px; top: auto !important; width: auto; }
  .footer { padding-left: 16px; padding-right: 16px; }
}
