:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #676b73;
  --line: #e3e1da;
  --accent: #2f5bd3;
  --accent-soft: #e8eefc;
  --good: #1f7a4a;
  --good-soft: #e5f3eb;
  --bad: #b3322b;
  --bad-soft: #fbe9e7;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --surface: #1e2126;
    --text: #e8e9ec;
    --muted: #9a9ea8;
    --line: #2e3238;
    --accent: #7ea2ff;
    --accent-soft: #232c44;
    --good: #5fcf94;
    --good-soft: #1d3127;
    --bad: #ff8a80;
    --bad-soft: #3a2220;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: .4em 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 2em 0 .6em; }
h3 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* шапка */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .95rem; }
.who { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.foot { color: var(--muted); font-size: .85rem; padding-top: 48px; padding-bottom: 32px; }

/* блоки */
.hero { padding: 24px 0 8px; }
.lead { font-size: 1.15rem; max-width: 760px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 12px 0; }
.card.accent { border-color: var(--accent); background: var(--accent-soft); }
.card.host { border-style: dashed; margin-top: 32px; }
.card h3:first-child, .card h2:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin: 0; }
.kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.big { font-size: 1.12rem; margin: 0; }
.note { background: var(--surface); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 4px; }
.note.ok { border-color: var(--good); background: var(--good-soft); }
.note.err { border-color: var(--bad); background: var(--bad-soft); }
.crumbs { color: var(--muted); font-size: .9rem; margin: 20px 0 0; }
.pill { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.done { background: var(--good-soft); color: var(--good); }
.pill.dim { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* список встреч */
.month { margin-top: 1.6em; }
.sessions { display: flex; flex-direction: column; gap: 8px; }
.srow { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.srow:hover { border-color: var(--accent); text-decoration: none; }
.srow.ready { border-left: 3px solid var(--accent); }
.sno { font-size: 1.4rem; font-weight: 700; color: var(--muted); line-height: 1.2; }
.smain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stitle { font-weight: 600; }
.scase { font-size: .88rem; color: var(--accent); }
.sout { font-size: .92rem; color: var(--muted); }
.sstat { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mat { padding-left: 1.3em; }

/* текст из Markdown */
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose table { border-collapse: collapse; margin: 1em 0; width: 100%; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose blockquote { margin: 1em 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 4px; }
.prose code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.prose pre { background: var(--surface); border: 1px solid var(--line); padding: 12px; border-radius: 6px; overflow-x: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
article.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 28px 24px; min-width: 0; }
article.prose h1 { margin-top: .8em; }
.with-side { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin-top: 24px; align-items: start; }
.side-h { font-weight: 600; margin: 0 0 8px; }
.side-list { padding-left: 1.2em; margin: 0; font-size: .95rem; }
.side-list li { margin-bottom: 6px; }
.side-list .cur a { color: var(--text); font-weight: 600; }

/* план встречи */
.plan { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.plan td { border-top: 1px solid var(--line); padding: 10px 14px; vertical-align: top; }
.plan tr:first-child td { border-top: 0; }
.plan .min { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; width: 80px; }
.ticks { list-style: none; padding: 0; }
.ticks li { padding-left: 28px; position: relative; margin: 8px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 4px; color: var(--good); font-weight: 700; }
.prompt blockquote { margin: 0 0 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* формы */
.narrow { max-width: 420px; margin: 40px auto; }
.narrow-l { max-width: 520px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .92rem; }
input[type=email], input[type=password], input[type=text], textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }
.btn { display: inline-block; font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; align-self: flex-start; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.danger { background: var(--bad); }
@media (prefers-color-scheme: dark) { .btn { color: #0d1117; } }

.checklist { display: flex; flex-direction: column; gap: 10px; }
.citem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.ccheck { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; flex-direction: row !important; }
.ccheck input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.ctext { display: flex; flex-direction: column; gap: 6px; }
.ctitle { display: block; font-weight: 500; }
.hint { display: block; color: var(--muted); font-size: .9rem; margin-top: 2px; }

/* тест */
.test { display: flex; flex-direction: column; gap: 18px; }
.sec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 20px 18px; margin: 0; }
.sec legend { font-weight: 700; padding: 0 6px; font-size: 1.05rem; }
section.sec { margin-top: 18px; }
section.sec h2 { margin-top: 0; }
.q { padding: 12px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q.miss { background: var(--bad-soft); margin: 0 -12px; padding: 12px; border-radius: 8px; }
.qt { font-weight: 600; margin: 0 0 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; cursor: pointer; }
.opt input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.scores { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 12px; }
.score { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; display: flex; flex-direction: column; }
.score .num { font-size: 1.8rem; font-weight: 700; }
.ans { margin: 0; }
.ans.good, b.good { color: var(--good); }
.ans.bad, b.bad { color: var(--bad); }
.mark { font-size: .78rem; margin-left: 8px; padding: 1px 7px; border-radius: 99px; border: 1px solid currentColor; }
.correct { margin: 4px 0 0; color: var(--good); }
.explain { margin-top: 8px; font-size: .93rem; color: var(--muted); }
.pre { white-space: pre-wrap; background: var(--bg); border-radius: 6px; padding: 8px 10px; margin-top: 4px; font-weight: 400; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin: 8px 0; }

/* сводка ведущего */
.scroll { overflow-x: auto; }
.grid { border-collapse: collapse; background: var(--surface); font-size: .88rem; min-width: 100%; }
.grid th, .grid td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap; }
.grid .uname { text-align: left; }
.grid .cell span { display: block; }
.grid .ok { color: var(--good); }
.grid .dim { color: var(--muted); }

@media (max-width: 720px) {
  h1 { font-size: 1.5rem; }
  .grid2 { grid-template-columns: 1fr; }
  .with-side { grid-template-columns: 1fr; }
  .srow { grid-template-columns: 32px 1fr; }
  .sstat { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; }
  article.prose { padding: 4px 16px 16px; }
  .plan .min { width: 60px; padding-right: 6px; }
  .nav { gap: 12px; }
}

/* опрос интересов и темы */
.topics { display: flex; flex-direction: column; margin-top: 8px; }
.trow { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.tname { display: flex; flex-direction: column; }
.tscale { display: flex; gap: 6px; flex-wrap: wrap; }
.topt { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.topt input { accent-color: var(--accent); margin: 0; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tcard { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); }
.tcard:hover { border-color: var(--accent); text-decoration: none; }
.tsess { font-size: .78rem; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.card.case { border-left: 3px solid var(--accent); }
.card.case h3 { margin-top: .6em; }
@media (max-width: 720px) { .trow { grid-template-columns: 1fr; } }

/* сворачиваемые блоки и снимки экрана */
details.fold { border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; background: var(--surface); }
details.fold > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; position: relative; padding-left: 38px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; position: absolute; left: 16px; color: var(--accent); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold-body { padding: 4px 18px 14px; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; display: block; }
.dl { margin-top: 10px; }
.with-side > div { min-width: 0; }
.prose pre code { background: none; padding: 0; white-space: pre; }
details.item-fold { margin: 10px 0 0 32px; background: var(--bg); }
details.item-fold > summary { font-weight: 500; font-size: .93rem; padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 720px) { details.item-fold { margin-left: 0; } }
