:root {
  --bg: #fafafa;
  --card: #fff;
  --line: #e4e4e4;
  --muted: #777;
  --text: #111;
  --hl: #fff3c4;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body { margin: 0; }
.page { max-width: 920px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.9rem; font-weight: 500; margin: 0 0 16px; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 24px 0 12px; }
a { color: inherit; }
.muted { color: var(--muted); font-weight: 400; }
.loading { color: var(--muted); }

.back a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.back { margin-bottom: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.card > h2:first-child { margin-top: 0; }

/* stressed vowel */
u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
u.sec { text-decoration-style: dotted; }

header.site { text-align: center; color: var(--muted); font-size: .95rem; margin-bottom: 16px; }
.level {
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.lemma { font-size: 2rem; line-height: 1.3; }
.meta { margin: 0; color: var(--muted); }
.chip {
  display: inline-block;
  background: #efefef;
  color: var(--text);
  border-radius: 8px;
  padding: 2px 10px;
  margin-right: 8px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}
a.chip:hover { background: #e2e2e2; text-decoration: underline; }

/* "Попрактикуем?" | Другие формы [select] | "Попрактикуем все формы?" — one line, wraps on phones */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin: 24px 0 0; }
.other { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.other select {
  font: inherit;
  font-weight: 400;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.btn.secondary { background: var(--card); color: var(--text); border: 1px solid #111; }
.btn.secondary:disabled { color: #aaa; border-color: #ccc; background: var(--card); }
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 28px; }
.card-foot .next { margin-left: auto; }
@media (max-width: 600px) {
  .card { padding: 20px 18px; }
  .other { flex-wrap: wrap; white-space: normal; width: 100%; }
  .other select { flex: 1; min-width: 0; }
}
a.btn { display: inline-block; text-decoration: none; }

h2 .topic-link { text-decoration: underline dotted; text-underline-offset: 4px; }
h2 .topic-link:hover { text-decoration: underline; }
.back { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.back .next-link { margin-left: auto; }
.back [hidden] { display: none; }
.example { padding-left: 14px; border-left: 3px solid var(--line); }

.home-title { text-align: center; margin: 16px 0 24px; }
.topics { margin: 0; padding-left: 0; list-style: none; line-height: 1.5; }
.topics li { padding: 3px 0; }
.topics a { text-decoration: none; border-bottom: 1px solid #bbb; }
.topics a:hover { border-bottom-color: var(--text); }
.topics .soon { color: #aaa; }

.ro.missing::before { content: "[нет формы]"; color: #c00; }
.theory p { line-height: 1.55; }
table.classes { width: auto; margin-bottom: 8px; }

table.present { border-collapse: collapse; font-size: 1.35rem; }
table.present th, table.present td { padding: 6px 28px 6px 0; text-align: left; font-weight: 400; }
table.present td.ru { color: var(--muted); font-size: 1rem; white-space: nowrap; }
table.present .alt, table.present .nonrec { font-size: .8em; }
.theory thead a { text-decoration: none; }
.theory thead a:hover { text-decoration: underline dotted; }

.btn {
  font: inherit;
  font-weight: 600;
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { background: #bbb; cursor: default; }

.scroll { overflow-x: auto; margin-bottom: 16px; }
table.forms { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.forms th, table.forms td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
table.forms thead th { font-weight: 500; font-style: italic; background: #f6f6f6; }
table.forms tbody th { font-weight: 400; white-space: nowrap; }
table.forms td.ru { color: var(--muted); white-space: nowrap; }
table.forms td > span { white-space: nowrap; }
.alt { color: var(--muted); }
.nonrec { color: #3b55c9; font-style: italic; }
.note { color: var(--muted); font-size: .85rem; margin: 0; }

/* trainer (docs/screens/03–05) */
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge { display: inline-block; background: #efefef; border-radius: 8px; padding: 3px 10px;
  font-size: .8rem; font-weight: 600; }
.badge.draft { background: #fff3c4; color: #7a5b00; }
.sentence { text-align: center; font-size: 1.45rem; font-weight: 600; margin: 28px 0 6px; }
.gap { display: inline-block; min-width: 2.5em; margin: 0 .3em; }
.gap.filled { color: #16794a; border-bottom: 2px solid #16794a; }
.translation { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 1.05rem; }
.options { display: grid; gap: 12px; }
.option { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit;
  font-size: 1.1rem; padding: 16px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #f3f3f3; cursor: pointer; color: var(--text); }
.option:hover:not(:disabled) { border-color: #bbb; }
.option.selected { border-color: #111; background: #fff; box-shadow: 0 0 0 1px #111 inset; }
.option .form { flex: 1; }
.option .mark { font-weight: 700; }
.option:disabled { cursor: default; }
.option.correct { background: #fff; color: var(--text); font-weight: 600;
  border-color: #16a34a; box-shadow: 0 0 0 1px #16a34a inset; }
.option.correct .mark { color: #16a34a; }
.option.wrong { background: #fff; font-weight: 600; border-color: #dc2626; box-shadow: 0 0 0 1px #dc2626 inset; }
.option.wrong .mark { color: #dc2626; }
.option.dim { background: #fafafa; color: #999; }
.explanation { margin-top: 20px; line-height: 1.5; }
.explanation p { margin: 8px 0; }
.verdict { font-weight: 700; font-size: 1.1rem; }
.verdict.ok { color: #16794a; }
.verdict.no { color: #b42318; }
.btn.wide { display: block; width: 100%; margin-top: 20px; }
.score { font-size: 1.3rem; }
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* "Сообщить об ошибке" (common.js addReportButton) */
.report-row { display: flex; justify-content: flex-end; margin-top: 16px; }
.report-btn { font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 0;
  padding: 4px 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.report-btn:hover { color: var(--text); }
#report-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px;
  width: min(560px, calc(100vw - 32px)); box-sizing: border-box; }
#report-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.report-form h2 { margin-top: 0; }
.report-form label { display: block; margin-bottom: 8px; }
.report-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px;
  border: 1px solid #ccc; border-radius: 10px; resize: vertical; }
.report-context { font-size: .85rem; margin: 12px 0; padding: 10px 12px; background: #f6f6f6;
  border-radius: 10px; overflow-wrap: anywhere; }
.report-status { white-space: pre-wrap; color: #7a5b00; min-height: 1em; }

/* Side arrows and panels (panels.js): left — progress, right — verbs of the level / "Тема дня".
   The page is a five-column grid: panel | arrow | central page | arrow | panel. A panel is a card like
   the central one, in its own column; panels.js lines its top up with the central card. On wide windows
   the central card stays in the middle; on narrower ones it gets narrower to make room (no overlap). */
body.has-panels { display: grid; min-height: 100vh; align-items: start;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 952px) auto minmax(0, 1fr); }
body.has-panels.open-left { grid-template-columns: minmax(320px, 1fr) auto minmax(0, 952px) auto minmax(0, 1fr); }
body.has-panels.open-right { grid-template-columns: minmax(0, 1fr) auto minmax(0, 952px) auto minmax(320px, 1fr); }
body.has-panels.open-left.open-right {
  grid-template-columns: minmax(320px, 1fr) auto minmax(0, 952px) auto minmax(320px, 1fr); }
.has-panels > .page { grid-column: 3; grid-row: 1; margin: 0; max-width: none; min-width: 0; box-sizing: border-box; }
.side-arrow { grid-row: 1; position: sticky; top: calc(50vh - 44px); margin: calc(50vh - 44px) 8px 0;
  width: 44px; height: 88px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: 400 2.2rem/1 system-ui, sans-serif; cursor: pointer; border-radius: 22px; padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06); visibility: hidden; z-index: 20; }
.panels-ready .side-arrow { visibility: visible; }
.side-arrow:hover { border-color: #111; }
.side-arrow.left { grid-column: 2; }
.side-arrow.right { grid-column: 4; }
.side-panel { display: none; grid-row: 1; position: sticky; top: 16px; box-sizing: border-box; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px;
  overflow-y: auto; }
.side-panel.left { grid-column: 1; margin-left: 16px; }
.side-panel.right { grid-column: 5; margin-right: 16px; }
.side-panel.open { display: block; }
.side-panel.left.open { animation: panel-from-left .25s ease; }
.side-panel.right.open { animation: panel-from-right .25s ease; }
.side-panel.restored.open { animation: none; }  /* reopened on the next page: already there */
@keyframes panel-from-left { from { opacity: 0; transform: translateX(-40px); } }
@keyframes panel-from-right { from { opacity: 0; transform: translateX(40px); } }
/* The page itself does not scroll: the title and all three windows stay in place, long content scrolls
   inside its window. All three windows have one height, so their bottom edges are in line; panels.js copies
   the central card's top and height to the panels (user requests 04.11.2026). The height fits the progress
   panel and shrinks on a low screen. */
@media (min-width: 761px) {
  body.has-panels { height: 100vh; overflow: hidden; }
  .has-panels > .page { height: 100vh; display: flex; flex-direction: column; padding-bottom: 24px; }
  .has-panels > .page > * { flex: none; }
  .has-panels > .page > .card { flex: 0 1 720px; box-sizing: border-box; min-height: 0; overflow-y: auto;
    margin-bottom: 0; }
  .has-panels > .page > .card:focus { outline: none; }
}
/* No room for arrow columns: the arrows float at the window edges and take no width from the central card. */
@media (max-width: 1100px) {
  .side-arrow { position: fixed; top: 50%; transform: translateY(-50%); margin: 0; }
  .side-arrow.left { left: 4px; }
  .side-arrow.right { right: 4px; }
}
/* Phones: no room for columns at all, a panel takes the central card's place. */
@media (max-width: 760px) {
  body.has-panels, body.has-panels.open-left, body.has-panels.open-right { display: block; }
  .panel-open > .page { display: none; }
  .side-panel, .side-panel.left, .side-panel.right { position: relative; top: auto; margin: 16px; }
}
/* Home page art (home-art.js): in the panel columns, under the panels, the central card's height
   (panels.js). Hidden where the columns are too narrow for a drawing (below ~190 px). */
.side-art { display: none; }
.side-panel { z-index: 2; }
@media (min-width: 1500px) {
  .has-panels > .side-art { display: block; grid-row: 1; position: sticky; top: 16px; z-index: 1;
    box-sizing: border-box; min-width: 0; pointer-events: none; }
  .side-art.left { grid-column: 1; margin: 0 8px 0 16px; }
  .side-art.right { grid-column: 5; margin: 0 16px 0 8px; }
  .side-art svg { display: block; width: 100%; height: 100%; }
}
.art-iris { transition: transform .6s ease; }
.art-lid { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); animation: art-blink 10s infinite; }
@keyframes art-blink { 0%, 96.5% { transform: scaleY(0); } 97.8% { transform: scaleY(1); } 99.2%, 100% { transform: scaleY(0); } }
.art-peek { opacity: 0; transition: opacity .6s ease; }
.peek .art-peek { opacity: 1; }
.art-walker { opacity: 0; transform: translate(130px, 593px); }
.walk .art-walker { animation: art-walk 5s linear; }
.art-walker-dir { transform-box: fill-box; transform-origin: 50% 50%; }
.walk .art-walker-dir { animation: art-turn 5s step-end; }
.art-leg { transform-box: fill-box; transform-origin: 50% 0; }
.walk .art-leg.a { animation: art-step .35s ease-in-out infinite alternate; }
.walk .art-leg.b { animation: art-step .35s ease-in-out infinite alternate-reverse; }
@keyframes art-walk {
  0% { opacity: 0; transform: translate(130px, 593px); }
  6% { opacity: 1; }
  48% { transform: translate(270px, 593px); }
  52% { transform: translate(270px, 593px); }
  94% { opacity: 1; }
  100% { opacity: 0; transform: translate(130px, 593px); } }
@keyframes art-turn { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } 100% { transform: scaleX(-1); } }
@keyframes art-step { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
@media (prefers-reduced-motion: reduce) { .art-lid { animation: none; } }
.side-panel h2 { margin-top: 0; }
/* Links under the central window; inactive until their pages exist */
.site-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; margin-top: 14px;
  font-size: .9rem; }
.site-links .soon { color: #aaa; cursor: default; }
.side-panel h3 { font-size: 1rem; margin: 20px 0 8px; }
.greeting { font-size: 1.4rem; font-weight: 600; }
.nick-form label { display: block; margin-bottom: 6px; color: var(--muted); }
.nick-row { display: flex; gap: 8px; }
.nick-row input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid #ccc; border-radius: 10px; }
.nick-row .btn { padding: 8px 14px; }
.bar { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin: 4px 0; }
.bar > div { height: 100%; background: #16a34a; }
.progress-total, .progress-row { display: flex; justify-content: space-between; }
.progress-total { font-size: 1.1rem; }
.progress-list { list-style: none; padding: 0; margin: 12px 0; }
.progress-list li { margin-bottom: 12px; }
.progress-list .muted { font-size: .8rem; }
.verb-list { padding-left: 2em; margin: 0; }
.verb-list li { padding: 4px 0; }
.verb-list li.current { background: var(--hl); }
.verb-list .done { color: #16a34a; font-weight: 700; }
.verb-list .muted { font-size: .85rem; }
.topic-of-day { font-size: 1.15rem; }
.read-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }

/* Sign-in (login/, login.js) */
.page.narrow { max-width: 520px; }
.login h2 { margin-top: 0; }
.login p { line-height: 1.5; }
.login-form label { display: block; font-weight: 600; margin: 16px 0 6px; }
.login-form input { width: 100%; box-sizing: border-box; font: inherit; font-size: 1.1rem; padding: 12px 14px;
  border: 1px solid #ccc; border-radius: 12px; }
.login-form input#code { letter-spacing: .4em; font-size: 1.4rem; text-align: center; }
.login-form label.check, .check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 12px 0 0; }
.login-form .check input { width: auto; }
.form-status { color: #b42318; min-height: 1.2em; margin: 8px 0 0; }
.login-alt { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }
.link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }

.hl, .hl > * { background: var(--hl); }
tr.hl th, tr.hl td { background: var(--hl); }
