/* Стили сайта economy-study: главная, страница задания, приём ответов. Без внешних шрифтов и CDN —
   сайт открывают из России с телефонов, всё своё и лёгкое. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1b2233;
  --muted: #5d6578;
  --line: #e4e0d6;
  --accent: #1e40af;
  --accent-2: #3b82f6;
  --accent-soft: #e8eefc;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --bad: #b91c1c;
  --bad-soft: #fcebeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 6px 24px rgba(20, 30, 60, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420; --surface: #171e2d; --ink: #e8ecf5; --muted: #9aa3b8; --line: #263049;
    --accent: #7aa2ff; --accent-2: #93b4ff; --accent-soft: #1c2742;
    --ok: #4ade80; --ok-soft: #13291d; --warn: #fbbf24; --warn-soft: #2c2310; --bad: #f87171; --bad-soft: #2d1515;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: none; padding: 24px 16px; }

/* шапка */
.hero {
  background: radial-gradient(1200px 400px at 80% -10%, rgba(59, 130, 246, .35), transparent 60%),
              linear-gradient(135deg, #0b1f5c 0%, #1e40af 55%, #2f5fd0 100%);
  color: #fff; padding: 56px 0 64px;
}
.hero .brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: .02em; opacity: .95; }
.hero .brand svg { width: 34px; height: 34px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 6vw, 46px); line-height: 1.12; margin: 28px 0 14px; }
.hero p.lead { font-size: clamp(16px, 2.4vw, 19px); max-width: 620px; opacity: .9; margin: 0; }
.hero.small { padding: 28px 0 36px; }
.hero.small h1 { font-size: clamp(24px, 4.6vw, 34px); margin: 18px 0 8px; }
.hero .course { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin-top: 18px; }

main.page { margin-top: -28px; padding-bottom: 64px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
h2.section { font-family: var(--serif); font-size: 24px; margin: 34px 0 14px; }

/* главная */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pillar { padding: 18px; }
.pillar .ico { font-size: 22px; }
.pillar h3 { margin: 6px 0 6px; font-size: 17px; }
.pillar p { margin: 0; color: var(--muted); font-size: 15px; }
.quiz-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease; }
.quiz-link:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.quiz-link .t { font-weight: 600; font-size: 18px; }
.quiz-link .s { color: var(--muted); font-size: 14px; margin-top: 4px; }
.quiz-link .go { flex: none; background: var(--accent); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; }
.empty { color: var(--muted); }
footer.foot { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 0 40px; }

/* задание */
.student { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .student { grid-template-columns: 1fr; } }
label.f { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], textarea {
  width: 100%; margin-top: 5px; padding: 11px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; outline: none;
}
input[type=text]:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 120px; resize: vertical; }
.intro { color: var(--muted); }
.q { position: relative; }
.q .num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; margin-right: 8px; }
.q h3 { display: flex; align-items: center; margin: 0 0 4px; font-size: 18px; padding-right: 96px; }
.q .kind { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.q .text { margin: 6px 0 14px; }
.q .casebox { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--bg); }
.opt:hover { border-color: var(--accent-2); }
.opt input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.match-row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; align-items: center; margin: 8px 0; }
@media (max-width: 560px) { .match-row { grid-template-columns: 1fr; gap: 4px; } }
select { width: 100%; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.order { list-style: none; padding: 0; margin: 0; }
.order li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: grab; user-select: none; touch-action: none; }
.order li.drag { opacity: .5; border-style: dashed; }
.order li .pos { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.order li .lbl { flex: 1; }
.order li button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; width: 34px; height: 34px; font-size: 16px; cursor: pointer; }
.order li button:disabled { opacity: .35; cursor: default; }
.scale { display: flex; flex-wrap: wrap; gap: 6px; }
.scale button { min-width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.scale button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 6px; }
.case-field { margin: 10px 0; }
.case-field textarea { min-height: 80px; }
.saved { position: absolute; top: 22px; right: 18px; max-width: 90px; text-align: right; font-size: 12px; line-height: 1.3; color: var(--muted); }
.saved.ok { color: var(--ok); }
.saved.wait { color: var(--warn); }
.saved.err { color: var(--bad); }

/* полоса состояния */
.statusbar { position: sticky; bottom: 0; z-index: 5; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.statusbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.progress { flex: 1; }
.progress .bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.progress small { color: var(--muted); }
.btn { border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; padding: 12px 22px; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.notice { border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.hidden { display: none !important; }

/* приём ответов */
body.admin h1 { font-family: var(--serif); }
.admin-list li { margin: 8px 0; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table.answers { border-collapse: collapse; font-size: 14px; min-width: 100%; }
table.answers th, table.answers td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; white-space: pre-wrap; max-width: 380px; }
table.answers th { background: var(--accent-soft); position: sticky; top: 0; }
table.answers td.ok { background: var(--ok-soft); }
table.answers td.part { background: var(--warn-soft); }
table.answers td.bad { background: var(--bad-soft); }
ol.legend { color: var(--muted); font-size: 14px; }

/* блок info и варианты с пояснением (раздел «Кейсы») */
.q.info { border-left: 4px solid var(--accent); }
.q.info h3 { padding-right: 0; }
.text.pre { white-space: pre-line; }
.opt-body { display: flex; flex-direction: column; gap: 4px; }
.opt-desc { color: var(--muted); font-size: 14px; white-space: pre-line; }
.card.team { border-left: 4px solid var(--ok); }
.card.team h3 { margin-top: 0; }
.team-list { margin: 0 0 8px; padding-left: 20px; }
.team-list li { margin: 4px 0; }

/* материалы (статья) */
.article .block h2 { font-family: var(--serif); font-size: 26px; margin: 4px 0 12px; }
.article .block h3 { font-size: 18px; margin: 22px 0 8px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.toc ol { margin: 8px 0; padding-left: 20px; columns: 2; }
@media (max-width: 560px) { .toc ol { columns: 1; } }
.muted { color: var(--muted); font-size: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 12px 0; }
.twocol { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 12px 0; }
.mini { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.mini span { color: var(--muted); font-size: 14px; }
.timeline { list-style: none; padding: 0; margin: 8px 0; border-left: 2px solid var(--line); }
.timeline li { padding: 6px 0 6px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.hl::before { background: var(--accent); }
.timeline b { display: inline-block; min-width: 140px; }
.fact { display: flex; gap: 16px; align-items: center; background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.fact .big { font-family: var(--serif); font-size: clamp(30px, 6vw, 44px); font-weight: 700; color: var(--accent); white-space: nowrap; }
@media (max-width: 560px) { .fact { flex-direction: column; align-items: flex-start; gap: 6px; } }
.bars { margin: 10px 0; }
.bar { display: grid; grid-template-columns: 170px 1fr 100px; gap: 10px; align-items: center; margin: 6px 0; font-size: 14px; }
@media (max-width: 560px) { .bar { grid-template-columns: 1fr 80px; } .bar .track { grid-column: 1 / -1; grid-row: 2; } }
.bar .track { height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.bar .track.neg i { background: linear-gradient(90deg, var(--bad), #f59e0b); }
.bar .val { font-weight: 700; text-align: right; }
table.cmp { border-collapse: collapse; width: 100%; font-size: 14px; }
table.cmp th, table.cmp td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.cmp th { background: var(--accent-soft); }
table.cmp tr.hl td { background: var(--ok-soft); }
.funnel div { margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; min-width: 220px; }
.funnel div.hl { background: var(--warn-soft); }
.funnel b { font-size: 18px; margin-right: 6px; }
.discuss { margin-top: 16px; border-left: 4px solid var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 10px 14px; }
blockquote { margin: 10px 0; padding: 12px 16px; border-left: 4px solid var(--accent); font-family: var(--serif); font-size: 19px; background: var(--bg); border-radius: 8px; }
blockquote cite { display: block; font-family: var(--font); font-size: 13px; color: var(--muted); font-style: normal; margin-top: 8px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding-left: 20px; }
.cheat dt { font-weight: 700; margin-top: 12px; }
.cheat dd { margin: 4px 0 0; color: var(--ink); }
.sources li { margin: 6px 0; font-size: 14px; }
a.btn { display: inline-block; text-decoration: none; }
.q.info .text a { color: var(--accent); }

/* кнопка «Скачать презентацию» и ссылка на архив прошлых занятий (t-549) */
.download { position: relative; margin: 8px 0 20px; }
.btn-dl { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 22px;
  background: var(--accent); color: #fff; border-radius: var(--radius); text-decoration: none; font-weight: 600;
  font-size: 1.05rem; box-shadow: var(--shadow); }
.btn-dl span { font-weight: 400; font-size: .9rem; opacity: .85; }
.btn-dl:hover { background: var(--accent-2); }
.archive-link { margin: 36px 0 8px; text-align: center; }
.archive-link a { color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--line); }
.archive-link a:hover { color: var(--accent); }
@media (prefers-color-scheme: dark) { .btn-dl { color: #0f1420; } }
