:root {
    --primary: #0066cc;
    --primary-hover: #0052a3;
    --dark: #2c3e50;
    --light: #f4f6f9;
    --text-main: #34495e;
    --muted: #7f8c8d;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--light); color: var(--dark); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
header { background: #fff; border-bottom: 1px solid #e2e8f0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.logo { font-weight: 800; color: var(--primary); text-decoration: none; font-size: 18px; display: inline-flex; align-items: center; gap: 8px; }
.logo img { width: 28px; height: 28px; }
nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
nav a { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--text-main); }
nav a:hover { background: #eef5fc; color: var(--primary); text-decoration: none; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none; border: none; cursor: pointer; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: #e2e8f0; color: var(--text-main); }
section, .page-card { background: #fff; border-radius: 16px; padding: 24px; margin: 18px 0; box-shadow: 0 4px 14px rgba(0,0,0,0.04); }
h1 { font-size: 28px; line-height: 1.25; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.55; }
.kod { font-size: 12px; font-weight: 700; color: var(--primary); }
.answer { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; }
.answer-btn { width: 100%; text-align: left; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.answer-btn:hover { border-color: #93c5fd; background: #eff6ff; }
.answer-btn.correct { border-color: #86efac; background: #f0fdf4; }
.answer-btn.wrong { border-color: #fca5a5; background: #fef2f2; }
.q-nav { margin: 0 0 16px; }
.q-num { color: var(--muted); font-weight: 700; margin-right: 6px; }
.q-pic-wrap { text-align: center; margin: 12px 0 16px; }
.q-pic-btn { border: 0; background: none; padding: 0; cursor: zoom-in; }
.q-pic { max-width: min(280px, 70%); height: auto; border-radius: 10px; display: inline-block; }
.answers-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pic-modal { position: fixed; inset: 0; z-index: 80; background: rgba(15,23,42,.7); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.pic-modal img { max-width: 96vw; max-height: 92vh; border-radius: 12px; background: #fff; }
.hidden { display: none !important; }
@media (min-width: 720px) {
    .answers-grid { grid-template-columns: 1fr 1fr; }
}
footer { padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 16px; }
.result { display: block; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-top: 8px; background: #f8fafc; color: inherit; }
.result:hover { border-color: var(--primary); background: #eef5fc; text-decoration: none; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; margin-top: 8px; background: #f1f5f9; border-radius: 12px; color: inherit; font-weight: 650; }
.row-link:hover { background: #e2e8f0; text-decoration: none; }
.row-link span.chev { color: #94a3b8; font-size: 20px; font-weight: 400; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.cat-card { display: block; padding: 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; color: inherit; }
.cat-card:hover { border-color: #93c5fd; background: #eff6ff; text-decoration: none; }
.cat-card strong { display: block; margin-bottom: 4px; }
.cat-card span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.crumbs { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.crumbs a { color: var(--muted); }
.chapter { margin-top: 18px; }
.chapter h2 { font-size: 16px; margin-bottom: 8px; }
.lib-block { margin-top: 28px; }
.lib-block:first-of-type { margin-top: 18px; }
.lib-block h2 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 6px;
}
.lib-list { border-top: 1px solid #e2e8f0; }
.lib-list a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    color: inherit;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
}
.lib-list a:hover { color: var(--primary); text-decoration: none; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 8px 0 16px; }
.check-grid label { display: flex; gap: 8px; align-items: flex-start; padding: 10px; background: #f8fafc; border-radius: 10px; font-size: 14px; cursor: pointer; }
.license-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: #f0f7ff; border: 1px solid #bcd7ff; border-radius: 10px; font-size: 14px; font-weight: 650; cursor: pointer; }
