[hidden] { display: none !important; }
:root {
  --bg: #0f1117;
  --bg2: #151821;
  --bg3: #1c2030;
  --line: #262b3b;
  --text: #e6e8ee;
  --muted: #8d93a8;
  --accent: #00add8;
  --accent2: #5dc9e2;
  --ok: #3ecf8e;
  --bad: #ff6b6b;
  --warn: #f5b041;
  --code-bg: #0b0d12;
  --radius: 10px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --top: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.65 var(--sans); }
a { color: var(--accent2); text-decoration: none; }
* { scrollbar-width: thin; scrollbar-color: #343a50 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #343a50; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #4a5170; }
a:hover { text-decoration: underline; }
button { font: inherit; }

/* ---------- topbar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: rgba(15,17,23,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.gopher { font-size: 20px; }
.progress-wrap { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; flex: 0 1 280px; }
.progress { flex: 1; height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--ok)); transition: width .4s; }
.top-nav { margin-left: auto; display: flex; gap: 8px; }
.icon-btn { display: none; background: none; border: 0; color: var(--text); font-size: 20px; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg3); color: var(--text); cursor: pointer;
  font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: #252a3d; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04151b; font-weight: 600; }
.btn.primary:hover { background: var(--accent2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg3); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: wait; }
kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }

/* ---------- layout ---------- */
.layout { display: flex; padding-top: var(--top); min-height: 100%; }
.sidebar {
  position: fixed; top: var(--top); bottom: 0; left: 0; width: 300px; overflow-y: auto;
  background: var(--bg2); border-right: 1px solid var(--line); padding: 12px 8px 40px;
}
.main { margin-left: 300px; flex: 1; min-width: 0; }
.loading { padding: 40px; color: var(--muted); }

.part { margin: 14px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ch-link {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text); font-size: 14px;
}
.ch-link:hover { background: var(--bg3); text-decoration: none; }
.ch-link.active { background: rgba(0,173,216,.14); color: #fff; }
.ch-num { width: 22px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ch-title { flex: 1; line-height: 1.3; }
.ch-count { font-size: 11px; color: var(--muted); flex: none; }
.ch-count.done { color: var(--ok); }
.read-mark { color: var(--ok); font-size: 11px; }
.ex-list { margin: 2px 0 8px 30px; border-left: 1px solid var(--line); }
.ex-link { display: flex; gap: 8px; padding: 3px 10px; font-size: 13px; color: var(--muted); border-radius: 0 6px 6px 0; }
.ex-link:hover { color: var(--text); background: var(--bg3); text-decoration: none; }
.ex-link.active { color: #fff; background: rgba(0,173,216,.14); }
.st { flex: none; width: 14px; text-align: center; }
.st.pass { color: var(--ok); }
.st.fail { color: var(--bad); }
.st.none { color: #4b5168; }

/* ---------- home ---------- */
.home { max-width: 1100px; margin: 0 auto; padding: 40px 32px 80px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; }
.hero p { color: var(--muted); max-width: 720px; margin: 0 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: flex; gap: 14px; margin: 28px 0; flex-wrap: wrap; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-width: 150px; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--muted); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
  display: block; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; color: var(--text); transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.card .n { color: var(--accent2); font-size: 12px; font-weight: 600; }
.card h3 { margin: 4px 0 12px; font-size: 15px; line-height: 1.35; }
.card .progress { height: 6px; }
.card .meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.howto { margin-top: 36px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; }
.howto ol { margin: 8px 0 0; padding-left: 20px; }

/* ---------- chapter ---------- */
.chapter-wrap { display: flex; gap: 32px; max-width: 1180px; margin: 0 auto; padding: 32px 32px 80px; }
.article { flex: 1; min-width: 0; max-width: 860px; }
.page-toc { width: 220px; flex: none; position: sticky; top: calc(var(--top) + 24px); align-self: flex-start; max-height: calc(100vh - var(--top) - 48px); overflow-y: auto; font-size: 13px; }
.page-toc b { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.page-toc a { display: block; color: var(--muted); padding: 3px 0 3px 10px; border-left: 2px solid var(--line); line-height: 1.35; }
.page-toc a:hover, .page-toc a.on { color: var(--text); border-color: var(--accent); text-decoration: none; }
.read-bar { position: fixed; top: var(--top); left: 300px; right: 0; height: 2px; z-index: 19; }
.read-bar div { height: 100%; width: 0; background: var(--accent); }

.md h1 { font-size: 32px; line-height: 1.25; margin: 0 0 20px; }
.md h2 { font-size: 24px; margin: 44px 0 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.md h3 { font-size: 19px; margin: 30px 0 10px; }
.md h4 { font-size: 16px; margin: 22px 0 8px; }
.md h2, .md h3, .md h4 { scroll-margin-top: calc(var(--top) + 16px); }
.md p, .md li { color: #d5d8e2; }
.md strong { color: #fff; }
.md code { font: 13.5px var(--mono); background: var(--bg3); padding: 2px 6px; border-radius: 5px; }
.md pre { margin: 0; }
.md pre code { display: block; padding: 16px 18px; background: var(--code-bg); border-radius: 0 0 var(--radius) var(--radius); overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
.md pre code.hljs { background: var(--code-bg); }
.md .code-block { margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.md .code-block > pre code { border-radius: 0; }
.md .code-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.md .code-head .lang { margin-right: auto; font-family: var(--mono); }
.md .code-block.plain .code-head { display: none; }
.md .code-block .CodeMirror { height: auto; font-size: 13.5px; }
.md .run-out { border-top: 1px solid var(--line); }
.md blockquote { margin: 18px 0; padding: 12px 18px; border-left: 4px solid var(--accent); background: rgba(0,173,216,.07); border-radius: 0 8px 8px 0; }
.md blockquote p { margin: 6px 0; }
.md blockquote.warn { border-color: var(--warn); background: rgba(245,176,65,.08); }
.md blockquote.good { border-color: var(--ok); background: rgba(62,207,142,.08); }
.md table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 12px; text-align: left; vertical-align: top; }
.md th { background: var(--bg2); }
.md details { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; margin: 8px 0; }
.md details summary { cursor: pointer; color: var(--accent2); font-weight: 500; }
.md details[open] summary { margin-bottom: 8px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.md img { max-width: 100%; }
.ex-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 13px;
  background: rgba(0,173,216,.14); border: 1px solid rgba(0,173,216,.4); color: var(--accent2); font-weight: 500;
}
.ex-chip:hover { background: rgba(0,173,216,.25); text-decoration: none; }
.chapter-exs { margin-top: 48px; }
.chapter-exs h2 { border: 0; }
.ex-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ex-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--line); color: var(--text); }
.ex-card:hover { border-color: var(--accent); text-decoration: none; }
.ex-card small { display: block; color: var(--warn); font-size: 12px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }
.pager a { flex: 1; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a small { display: block; color: var(--muted); font-size: 12px; }
.pager a.next { text-align: right; }

/* ---------- run output ---------- */
.run-out { background: #07080c; font: 13px/1.5 var(--mono); padding: 12px 16px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.run-out .err { color: var(--bad); }
.run-out .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------- exercise / playground ---------- */
.ide { display: flex; flex-direction: column; height: calc(100vh - var(--top)); }
.ide-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); flex-wrap: wrap; }
.crumbs { color: var(--muted); font-size: 13px; }
.ide-head h2 { margin: 0; font-size: 17px; }
.stars { color: var(--warn); font-size: 13px; }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.badge.pass { color: var(--ok); border-color: rgba(62,207,142,.5); background: rgba(62,207,142,.1); }
.badge.fail { color: var(--bad); border-color: rgba(255,107,107,.5); background: rgba(255,107,107,.08); }
.ide-head .spacer { flex: 1; }
.ide-body { flex: 1; display: flex; min-height: 0; }
.left { width: 40%; min-width: 320px; max-width: 620px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); background: var(--bg2); overflow-x: auto; flex: none; }
.tab { padding: 7px 14px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px 8px 0 0; font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); background: var(--bg); border-bottom-color: var(--accent); }
.tab.ro { font-style: italic; }
.tab.sol { color: var(--warn); }
.pane { flex: 1; overflow: auto; padding: 18px 20px; min-height: 0; }
.task { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; color: #d5d8e2; }
.task .code { font: 13px var(--mono); color: var(--accent2); }
.hint { margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.right { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); flex-wrap: wrap; }
.toolbar .save-state { color: var(--muted); font-size: 12px; margin-left: auto; }
.editor { flex: 1; min-height: 0; position: relative; }
.editor .CodeMirror { position: absolute; inset: 0; height: 100%; font: 14px/1.55 var(--mono); }
.CodeMirror { background: var(--code-bg) !important; }
.cm-s-material-darker .CodeMirror-gutters { background: var(--code-bg); border-right: 1px solid var(--line); }
.cm-s-material-darker .CodeMirror-activeline-background { background: rgba(255,255,255,.04); }
.CodeMirror-readonly .CodeMirror-cursor { display: none; }
.cm-errline { background: rgba(255,107,107,.15) !important; }

.result-banner { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-banner.pass { background: rgba(62,207,142,.12); border: 1px solid rgba(62,207,142,.45); color: var(--ok); }
.result-banner.fail { background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.4); color: var(--bad); }
.result-banner .grow { flex: 1; }
.result-banner small { font-weight: 400; color: var(--muted); }
.build-err { background: #07080c; border: 1px solid rgba(255,107,107,.35); border-radius: 8px; padding: 12px 14px; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; color: #ffb3b3; margin-bottom: 14px; }
.loc { color: var(--accent2); cursor: pointer; text-decoration: underline dotted; }
.test { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
.test summary { list-style: none; cursor: pointer; padding: 7px 12px; display: flex; gap: 8px; align-items: center; font: 13px var(--mono); background: var(--bg2); }
.test summary::-webkit-details-marker { display: none; }
.test summary .t { color: var(--muted); margin-left: auto; font-size: 11px; }
.test pre { margin: 0; padding: 10px 14px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; background: #07080c; color: #d5d8e2; }
.test.sub summary { padding-left: 28px; }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.play-bottom { height: 34%; min-height: 140px; display: flex; border-top: 1px solid var(--line); }
.play-bottom .stdin { width: 30%; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.play-bottom label { font-size: 12px; color: var(--muted); padding: 6px 12px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.play-bottom textarea { flex: 1; background: #07080c; color: var(--text); border: 0; resize: none; padding: 10px 12px; font: 13px var(--mono); outline: none; }
.play-bottom .out { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.play-bottom .run-out { flex: 1; max-height: none; }

/* ---------- misc ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: var(--bg3); border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px; transition: .25s; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 60; }
.modal-back[hidden] { display: none; }
.modal { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; width: min(440px, 92vw); }
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--muted); margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1200px) { .page-toc { display: none; } }
@media (max-width: 900px) {
  .icon-btn { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; z-index: 30; }
  body.menu-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .read-bar { left: 0; }
  .progress-wrap { display: none; }
  .chapter-wrap, .home { padding: 20px 16px 60px; }
  .ide { height: auto; }
  .ide-body { flex-direction: column; }
  .left { width: auto; max-width: none; min-width: 0; border-right: 0; border-bottom: 1px solid var(--line); max-height: 45vh; }
  .editor { height: 60vh; flex: none; }
  .top-nav .btn { padding: 6px 10px; font-size: 13px; }
  #scanBtn { display: none; }
}

/* ================= прогресс, аккаунты, друзья ================= */
.progress-wrap { color: var(--muted); }
.progress-wrap:hover { text-decoration: none; color: var(--text); }
.progress.thin { height: 3px; margin-top: 4px; background: rgba(255,255,255,.06); }
.ring { flex: none; }
.ring .ring-bg { fill: none; stroke: var(--bg3); }
.ring .ring-fg { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ring text { fill: var(--text); font: 600 12px var(--sans); }
svg.ring[width="120"] text { font-size: 30px; }
svg.ring[width="36"] text { font-size: 10px; }
.user-box { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
.user-name { font-size: 13px; color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* сайдбар */
.ch-main { flex: 1; min-width: 0; }
.ch-link .ch-title { display: block; }
.ch-link.complete .ch-num { color: var(--ok); }
.ch-link .ch-count { min-width: 30px; text-align: right; }

/* главная */
.dash { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: center; margin-bottom: 28px; }
.dash-main { display: flex; gap: 24px; align-items: center; }
.dash-main h1 { margin: 0 0 4px; font-size: 28px; }
.dash .stats { margin: 0; display: grid; gap: 10px; }
.dash .stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 14px; min-width: 0; }
.dash .stat b { font-size: 16px; }
.dash .stat .progress { grid-column: 1 / -1; height: 5px; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px; }
.again { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.chip { padding: 3px 10px; border-radius: 99px; border: 1px solid rgba(245,176,65,.45); color: var(--warn); font-size: 13px; }
.chip:hover { text-decoration: none; background: rgba(245,176,65,.1); }
.cards-title { font-size: 18px; margin: 8px 0 12px; }
.card-top { display: flex; justify-content: space-between; gap: 10px; }
.card.complete { border-color: rgba(62,207,142,.45); }
.mini { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* глава */
.article-col { flex: 1; min-width: 0; max-width: 860px; }
.ch-progress { display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin-bottom: 22px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: calc(var(--top) + 6px); z-index: 5; }
.cp-body b { font-size: 13px; }
.cp-row { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.cp-row a { color: var(--muted); }
.cp-row a:hover { color: var(--text); }
.toc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.toc-head b { margin: 0 !important; }
.page-toc a { display: flex; gap: 6px; }
.page-toc a .ti { flex: none; width: 14px; color: #4b5168; }
.page-toc a.done .ti { color: var(--ok); }
.sec-mark { display: inline-block; width: 0; overflow: hidden; color: var(--ok); vertical-align: middle; font-size: .8em; transition: width .2s; }
.sec-mark.on { width: 1.3em; }
.sec-done { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 8px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); }
.sec-done.done { border-style: solid; border-color: rgba(62,207,142,.4); background: rgba(62,207,142,.06); }
.sec-done .ok { color: var(--ok); font-weight: 600; }
.q-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.q-rate .btn.on.q-know { background: rgba(62,207,142,.18); border-color: var(--ok); color: var(--ok); }
.q-rate .btn.on.q-again { background: rgba(245,176,65,.15); border-color: var(--warn); color: var(--warn); }
.md details.know { border-color: rgba(62,207,142,.45); }
.md details.know summary::after { content: "  ✓ знаю"; color: var(--ok); font-size: 12px; }
.md details.again { border-color: rgba(245,176,65,.45); }
.md details.again summary::after { content: "  ↻ повторить"; color: var(--warn); font-size: 12px; }
.md h2.plain-h { border: 0; }

/* вход */
body.auth-mode .sidebar, body.auth-mode .top-nav, body.auth-mode .progress-wrap, body.auth-mode #menuBtn { display: none !important; }
body.auth-mode .main { margin-left: 0; }
.auth { min-height: calc(100vh - var(--top)); display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; text-align: center; }
.auth-logo { font-size: 44px; }
.auth-card h1 { margin: 4px 0; }
.auth-card form { text-align: left; display: grid; gap: 12px; margin-top: 16px; }
.auth-card label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-card input { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 9px 12px; font: 15px var(--sans); outline: none; }
.auth-card input:focus { border-color: var(--accent); }
.auth-err { color: var(--bad); font-size: 13px; min-height: 1em; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-top: 14px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 16px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--bg3); color: var(--text); }

/* друзья */
.table-wrap { overflow-x: auto; margin-top: 16px; }
table.lb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lb th, table.lb td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.lb th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.lb tr.me td { background: rgba(0,173,216,.07); }
table.lb td .progress { width: 110px; }

@media (max-width: 1200px) { .ch-progress { top: calc(var(--top) + 4px); } }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash-main { flex-direction: column; text-align: center; }
  .user-name { display: none; }
}

/* источники */
.sources-link { display: block; margin-top: 36px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.sources-link:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.md.sources table { font-size: 13px; }
.md.sources td:first-child { white-space: nowrap; color: var(--muted); }
