:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #223;
    --muted: #667;
    --line: #dce3ef;
    --primary: #275efe;
    --danger: #c0392b;
    --success: #198754;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; margin-bottom: 24px;
}
.brand { font-size: 28px; font-weight: 700; }
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 18px; box-shadow: 0 4px 16px rgba(0,0,0,.04);
}
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); }
label { display:block; margin: 10px 0 6px; font-weight: 600; }
input[type=text], input[type=password], textarea, select {
    width: 100%; padding: 11px 12px; border: 1px solid #cfd8e6; border-radius: 10px; background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
button, .button {
    display:inline-block; border:none; background:var(--primary); color:#fff; padding:10px 14px;
    border-radius:10px; cursor:pointer; font-weight:700;
}
.button.secondary, button.secondary { background:#6c7a89; }
.button.danger, button.danger { background: var(--danger); }
.flash { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; }
.flash.success { background: #e7f7ee; color: #135e37; }
.flash.error { background: #fdecec; color: #8c1d18; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; text-align:left; }
.muted { color: var(--muted); }
.exercise-box { font-size: 22px; line-height: 1.6; padding: 18px; border-radius: 12px; background:#fff; border:1px solid var(--line); margin-bottom: 16px; }
.inline-input { display:inline-block; width:150px; margin: 0 6px; }
.badge { display:inline-block; padding:4px 9px; border-radius:999px; background:#eef2ff; color:#2942a0; font-size:12px; font-weight:700; }
.lesson-list { columns: 3 220px; }
.lesson-list label { font-weight: normal; break-inside: avoid; }
.actions { display:flex; gap:10px; flex-wrap:wrap; }
.right { text-align:right; }
.small { font-size: 13px; }


details.section {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 4px 16px rgba(0,0,0,.04);
}
details.section summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 18px;
    font-size: 22px;
    font-weight: 700;
}
details.section summary::-webkit-details-marker { display: none; }
details.section[open] summary { border-bottom: 1px solid var(--line); }
.section-body { padding: 18px; }
input[type=number] {
    width: 100%; padding: 11px 12px; border: 1px solid #cfd8e6; border-radius: 10px; background: #fff;
}


.section-intro h2 { margin: 0 0 6px; }
.card-main { border-left: 6px solid var(--primary); }

details.section {
    margin: 0 0 18px;
    border: 1px solid #c9d5ea;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: 0 6px 20px rgba(39,94,254,.08);
    overflow: hidden;
}
details.section summary,
details.subsection summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
details.section summary {
    cursor: pointer;
    padding: 18px 20px;
    font-size: 22px;
    font-weight: 800;
    background: #eef3ff;
}
details.section summary::-webkit-details-marker,
details.subsection summary::-webkit-details-marker { display: none; }
details.section summary::after {
    content: '▸';
    font-size: 24px;
    color: var(--primary);
    transition: transform .18s ease;
}
details.section[open] summary::after { transform: rotate(90deg); }
details.section[open] summary { border-bottom: 1px solid var(--line); }
.summary-hint {
    font-size: 13px;
    font-weight: 700;
    color: #4d62a8;
    background: #dfe8ff;
    border-radius: 999px;
    padding: 6px 10px;
    margin-right: 28px;
}
.section-body { padding: 18px; background: #f9fbff; }

details.subsection {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
details.subsection summary {
    cursor: pointer;
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 700;
    background: #f6f8fc;
}
details.subsection summary::after {
    content: '▸';
    font-size: 18px;
    color: #64748b;
    transition: transform .18s ease;
}
details.subsection[open] summary::after { transform: rotate(90deg); }
details.subsection[open] summary { border-bottom: 1px solid var(--line); }
.subsection-body { padding: 14px 16px 16px; }
.sub-hint {
    font-size: 12px;
    font-weight: 700;
    color: #5b6477;
    background: #e9edf5;
    border-radius: 999px;
    padding: 5px 9px;
    margin-right: 22px;
}
@media (max-width: 700px) {
    details.section summary { font-size: 19px; padding: 16px; }
    details.subsection summary { font-size: 16px; }
    .summary-hint, .sub-hint { display: none; }
}
