/* Учёба-Даздранагон. Theme tokens follow the shared Dazdranagon palette (silver and platinum), as in Cheki and Aptechka.
   Two layouts from one template: phone (below 768px: bottom tabs) and computer (from 768px: left menu). */
:root {
  --bg: #eef1f5; --card: #ffffff; --text: #1a202b; --muted: #566175; --line: #cdd5df;
  --accent: #3b4861; --accent-text: #ffffff; --danger: #b3261e; --ok: #2f6f5e; --warn: #a3842a;
  --note: #eef0d8; --card-2: #e6eaf0; --link: #2c4c90; --chip: #e8eef8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218; --card: #171c24; --text: #e8ecf2; --muted: #9aa5b6; --line: #2b3441;
    --accent: #c9d1de; --accent-text: #10151d; --danger: #f2827a; --ok: #5fb39b; --warn: #d0b25a;
    --note: #2c2f1f; --card-2: #1f2630; --link: #9fb9e8; --chip: #232d3c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text);
       font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
h1 { font-size: 1.35rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--danger); }

header.top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px;
             padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 700; text-decoration: none; color: var(--text); margin-right: auto; }
.who { display: flex; gap: 4px; flex-wrap: wrap; }
.who a { font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
         text-decoration: none; color: var(--text); }
.who a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
form.inline { display: inline; }
button.link { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; }

.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 50px); }
nav.side { background: var(--card); border-right: 1px solid var(--line); padding: 14px 10px; }
nav.side a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
nav.side a.on { background: var(--card-2); font-weight: 600; }
nav.side .grp { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; margin: 16px 10px 4px; }
main { padding: 16px 20px 24px; min-width: 0; max-width: 1180px; }
main.solo { max-width: 420px; margin: 60px auto; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.cards .card { margin-bottom: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0;
       border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.chip { display: inline-block; font-size: .75rem; padding: 1px 9px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
.chip.ok { background: transparent; color: var(--ok); border: 1px solid var(--ok); }
.chip.late { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
       background: var(--card); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
label.field { display: block; margin: 10px 0; color: var(--muted); font-size: .9rem; }
label.field input { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--line);
                    border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }

footer.ver { display: flex; align-items: center; gap: 10px; margin-top: 28px; font-size: .8rem; color: var(--muted); }
footer.ver a { color: var(--muted); }

nav.tabbar { display: none; }

/* phone: no left menu, tabs at the thumb */
@media (max-width: 767px) {
  .layout { display: block; }
  nav.side { display: none; }
  main { padding: 12px 16px 84px; }
  header.top { padding: 8px 16px; }
  header.top .brand .long { display: none; }
  .cards { grid-template-columns: 1fr; }
  nav.tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: var(--card);
               border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  nav.tabbar a { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); text-decoration: none; padding: 8px 0; }
  nav.tabbar a.on { color: var(--text); font-weight: 600; }
}
