/* style.css — GalinT (05.11.2026, редизайн). Токены Tsink (день) / Grafiit (ночь) из work.bb.ee; тема: :root[data-theme=light|dark],
   без атрибута — по prefers-color-scheme (ранний скрипт в gl_page_head ставит атрибут из localStorage до отрисовки).
   Иконки — lucide_icons.js (<i class="fa-solid fa-имя">), ambient-фон как Stuudium в work. */
@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700;800&family=Geologica:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
    --font-ui: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-num: 'Geologica', 'Golos Text', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --bg-color: #f2f3f6; --card-bg: #ffffff; --surface-2: #f6f7f9; --glass: rgba(255,255,255,.78);
    --c-primary: #4f46e5; --c-primary-light: rgba(79,70,229,.09); --c-primary-ink: #fff;
    --c-accent: #0d9488; --c-accent-light: rgba(13,148,136,.10);
    --c-ok: #0f766e; --c-ok-light: rgba(15,118,110,.10);
    --c-warning: #9a4608; --c-warning-light: rgba(154,70,8,.10);
    --c-danger: #b91c1c; --c-danger-light: rgba(185,28,28,.08); --c-danger-ink: #fff;
    --text-main: #15171c; --text-muted: #5d6370; --text-light: #8b909c;
    --border-color: #e2e4e9; --border-strong: #cdd1d8;
    --card-shadow: 0 1px 2px rgba(20,22,30,.05), 0 8px 24px -18px rgba(20,22,30,.18);
    --hover-shadow: 0 2px 4px rgba(20,22,30,.05), 0 14px 32px -16px rgba(79,70,229,.22);
    --modal-shadow: 0 24px 60px -20px rgba(20,22,30,.35);
    --scrim: rgba(21,23,28,.55);
    --amb-1: rgba(79,70,229,.14); --amb-2: rgba(13,148,136,.12);
    --tip-bg: #1a1c23; --tip-fg: #f4f3ef; --tip-muted: rgba(255,255,255,.66); --tip-line: rgba(255,255,255,.14);
    --r-sm: 8px; --r-md: 16px; --r-lg: 22px; --tap: 40px;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --bg-color: #0f1114; --card-bg: #181c20; --surface-2: #1e2328; --glass: rgba(24,28,32,.78);
    --c-primary: #8b85ff; --c-primary-light: rgba(139,133,255,.14); --c-primary-ink: #0d1117;
    --c-accent: #2dd4bf; --c-accent-light: rgba(45,212,191,.12);
    --c-ok: #3ddc84; --c-ok-light: rgba(61,220,132,.12);
    --c-warning: #f6ad55; --c-warning-light: rgba(246,173,85,.12);
    --c-danger: #ff8a8a; --c-danger-light: rgba(255,138,138,.12); --c-danger-ink: #0d1117;
    --text-main: #e8e6e1; --text-muted: #8a9299; --text-light: #5a6268;
    --border-color: #272d32; --border-strong: #3a4147;
    --card-shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.6);
    --hover-shadow: 0 2px 6px rgba(0,0,0,.4), 0 16px 36px -16px rgba(139,133,255,.25);
    --scrim: rgba(0,0,0,.6);
    --amb-1: rgba(139,133,255,.16); --amb-2: rgba(45,212,191,.12);
    --tip-bg: #2b323a; --tip-fg: #f4f3ef; --tip-muted: #b3bac2; --tip-line: rgba(255,255,255,.12);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #0f1114; --card-bg: #181c20; --surface-2: #1e2328; --glass: rgba(24,28,32,.78);
        --c-primary: #8b85ff; --c-primary-light: rgba(139,133,255,.14); --c-primary-ink: #0d1117;
        --c-accent: #2dd4bf; --c-accent-light: rgba(45,212,191,.12);
        --c-ok: #3ddc84; --c-ok-light: rgba(61,220,132,.12);
        --c-warning: #f6ad55; --c-warning-light: rgba(246,173,85,.12);
        --c-danger: #ff8a8a; --c-danger-light: rgba(255,138,138,.12); --c-danger-ink: #0d1117;
        --text-main: #e8e6e1; --text-muted: #8a9299; --text-light: #5a6268;
        --border-color: #272d32; --border-strong: #3a4147;
        --card-shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.6);
        --hover-shadow: 0 2px 6px rgba(0,0,0,.4), 0 16px 36px -16px rgba(139,133,255,.25);
        --scrim: rgba(0,0,0,.6);
        --amb-1: rgba(139,133,255,.16); --amb-2: rgba(45,212,191,.12);
    --tip-bg: #2b323a; --tip-fg: #f4f3ef; --tip-muted: #b3bac2; --tip-line: rgba(255,255,255,.12);
        color-scheme: dark;
    }
}
/* Вечер/ночь (data-tod=night, ставит скрипт в head по часу) в автоматической теме = тёмные токены */
:root[data-tod="night"]:not([data-theme="light"]) {
    --bg-color: #0f1114; --card-bg: #181c20; --surface-2: #1e2328; --glass: rgba(24,28,32,.78);
    --c-primary: #8b85ff; --c-primary-light: rgba(139,133,255,.14); --c-primary-ink: #0d1117;
    --c-accent: #2dd4bf; --c-accent-light: rgba(45,212,191,.12);
    --c-ok: #3ddc84; --c-ok-light: rgba(61,220,132,.12);
    --c-warning: #f6ad55; --c-warning-light: rgba(246,173,85,.12);
    --c-danger: #ff8a8a; --c-danger-light: rgba(255,138,138,.12); --c-danger-ink: #0d1117;
    --text-main: #e8e6e1; --text-muted: #8a9299; --text-light: #5a6268;
    --border-color: #272d32; --border-strong: #3a4147;
    --card-shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.6);
    --hover-shadow: 0 2px 6px rgba(0,0,0,.4), 0 16px 36px -16px rgba(139,133,255,.25);
    --scrim: rgba(0,0,0,.6);
    --amb-1: rgba(139,133,255,.16); --amb-2: rgba(45,212,191,.12);
    --tip-bg: #2b323a; --tip-fg: #f4f3ef; --tip-muted: #b3bac2; --tip-line: rgba(255,255,255,.12);
    color-scheme: dark;
}
/* Сезон (data-season, Seaded → Hooajateema): меняет только ambient-пятна фона и цвет штриха; светлый/тёмный варианты */
:root[data-season="sygis"] { --amb-1: rgba(217,119,6,.17); --amb-2: rgba(185,28,28,.10); --art: #b45309; }
:root[data-season="talv"]  { --amb-1: rgba(56,189,248,.16); --amb-2: rgba(100,116,139,.13); --art: #0ea5e9; }
:root[data-season="kevad"] { --amb-1: rgba(34,197,94,.15); --amb-2: rgba(168,85,247,.12); --art: #16a34a; }
:root[data-season="suvi"]  { --amb-1: rgba(13,148,136,.17); --amb-2: rgba(250,204,21,.15); --art: #0d9488; }
:root[data-theme="dark"][data-season="sygis"], :root[data-tod="night"]:not([data-theme="light"])[data-season="sygis"] { --amb-1: rgba(245,158,11,.14); --amb-2: rgba(239,68,68,.10); --art: #f59e0b; }
:root[data-theme="dark"][data-season="talv"],  :root[data-tod="night"]:not([data-theme="light"])[data-season="talv"]  { --amb-1: rgba(125,211,252,.14); --amb-2: rgba(148,163,184,.10); --art: #7dd3fc; }
:root[data-theme="dark"][data-season="kevad"], :root[data-tod="night"]:not([data-theme="light"])[data-season="kevad"] { --amb-1: rgba(74,222,128,.13); --amb-2: rgba(192,132,252,.12); --art: #4ade80; }
:root[data-theme="dark"][data-season="suvi"],  :root[data-tod="night"]:not([data-theme="light"])[data-season="suvi"]  { --amb-1: rgba(45,212,191,.14); --amb-2: rgba(253,224,71,.12); --art: #fde047; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"])[data-season="sygis"] { --amb-1: rgba(245,158,11,.14); --amb-2: rgba(239,68,68,.10); --art: #f59e0b; }
    :root:not([data-theme="light"])[data-season="talv"]  { --amb-1: rgba(125,211,252,.14); --amb-2: rgba(148,163,184,.10); --art: #7dd3fc; }
    :root:not([data-theme="light"])[data-season="kevad"] { --amb-1: rgba(74,222,128,.13); --amb-2: rgba(192,132,252,.12); --art: #4ade80; }
    :root:not([data-theme="light"])[data-season="suvi"]  { --amb-1: rgba(45,212,191,.14); --amb-2: rgba(253,224,71,.12); --art: #fde047; }
}
/* сезон в интерфейсе: полоса под шапкой, кромка карточек и иконки заголовков в цвете сезона, подпись дня */
:root[data-season] .topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--art), var(--amb-2-solid, var(--c-accent)) 60%, transparent); opacity: .85; }
:root[data-season="sygis"] { --amb-2-solid: #b91c1c; } :root[data-season="talv"] { --amb-2-solid: #64748b; } :root[data-season="kevad"] { --amb-2-solid: #a855f7; } :root[data-season="suvi"] { --amb-2-solid: #facc15; }
:root[data-season] .card { border-top: 2px solid color-mix(in srgb, var(--art) 55%, var(--border-color)); }
:root[data-season] .card h2 .ic:not(.accent):not(.warn):not(.danger):not(.ok) { background: color-mix(in srgb, var(--art) 14%, transparent); color: var(--art); }
:root[data-season] .kpi .ic:not(.accent):not(.warn):not(.danger):not(.ok) { background: color-mix(in srgb, var(--art) 14%, transparent); color: var(--art); }
:root[data-season] .page-head .date { border-color: color-mix(in srgb, var(--art) 40%, var(--border-color)); }
.daycap { margin-top: 5px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.daycap i { color: var(--art, var(--c-primary)); font-size: 15px; }
/* частицы */
.season-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; color: var(--art, var(--c-primary)); }
.season-fx.paused .fx { animation-play-state: paused; }
.fx { position: absolute; top: -40px; animation-name: fxFall, fxSway; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite, infinite; animation-direction: normal, alternate; will-change: transform; }
.fx svg { width: 100%; height: 100%; display: block; animation: fxSpin 9s linear infinite; }
.fx-talv svg { animation: none; }
.fx-float { top: auto; bottom: -40px; animation-name: fxRise, fxSway; }
@keyframes fxFall { to { transform: translateY(calc(100vh + 80px)); } }
@keyframes fxRise { to { transform: translateY(calc(-100vh - 80px)); } }
@keyframes fxSway { from { margin-left: calc(var(--sway) * -1); } to { margin-left: var(--sway); } }
@keyframes fxSpin { to { transform: rotate(var(--spin, 360deg)); } }
@media (prefers-reduced-motion: reduce) { .season-fx { display: none; } }
@media (max-width: 900px) { .season-fx { display: none; } :root[data-season] .topbar::after { height: 2px; } }
.season-art { position: fixed; right: -10px; bottom: -6px; width: 320px; height: 220px; z-index: -1; pointer-events: none; color: var(--art, var(--c-primary)); opacity: .22; }
.season-art svg { width: 100%; height: 100%; display: block; }
:root[data-theme="dark"] .season-art, :root[data-tod="night"]:not([data-theme="light"]) .season-art { opacity: .28; }
@media (max-width: 900px) { .season-art { display: none; } }
@media (max-width: 768px) { :root { --tap: 44px; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--bg-color); color: var(--text-main); font-family: var(--font-ui); min-height: 100vh; line-height: 1.45; position: relative; }
/* ambient: два мягких пятна света, фиксированы */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; transition: background 1.2s;
    background: radial-gradient(60% 50% at 8% -10%, var(--amb-1), transparent 70%), radial-gradient(50% 45% at 100% 110%, var(--amb-2), transparent 70%); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.015em; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
i[class*="fa-"] { color: inherit; }

/* ── Шапка ── */
.topbar { position: sticky; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 20px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-main); font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 32px; height: 32px; display: block; }
.nav-links { display: flex; gap: 2px; list-style: none; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: var(--text-muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav-links a i { font-size: 16px; opacity: .85; }
.nav-links a:hover { background: var(--surface-2); text-decoration: none; color: var(--text-main); }
.nav-links a.active { background: var(--c-primary-light); color: var(--c-primary); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-name { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text-main); }
@media (max-width: 768px) {
    .topbar { padding: 0 10px; gap: 8px; }
    .brand span, .nav-name { display: none; }
    .nav-links a { padding: 8px 9px; font-size: 13px; gap: 5px; }
}
@media (max-width: 480px) { .nav-links a span { display: none; } .nav-links a i { font-size: 19px; opacity: 1; } .nav-links a { padding: 8px 10px; } }

/* ── Страница ── */
.page { max-width: 1120px; margin: 0 auto; padding: 24px 20px 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 800; line-height: 1.15; }
.page-head .date { color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--border-color); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--r-md); box-shadow: var(--card-shadow); padding: 18px 20px; min-width: 0; transition: box-shadow .2s, transform .2s; }
.card[data-href]:hover { box-shadow: var(--hover-shadow); transform: translateY(-1px); }
.card h2 { font-size: 15px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.card h2 .cnt { margin-left: auto; font-family: var(--font-num); font-size: 12px; color: var(--text-muted); font-weight: 600; }
.card h2 .ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; background: var(--c-primary-light); color: var(--c-primary); font-size: 15px; flex: 0 0 auto; }
.card h2 .ic.accent { background: var(--c-accent-light); color: var(--c-accent); }
.card h2 .ic.warn { background: var(--c-warning-light); color: var(--c-warning); }
.card h2 .ic.danger { background: var(--c-danger-light); color: var(--c-danger); }
.card h2 .ic.ok { background: var(--c-ok-light); color: var(--c-ok); }
.empty { color: var(--text-light); font-size: 13.5px; padding: 22px 12px; text-align: center; border: 1px dashed var(--border-strong); border-radius: 12px; }
.empty i { display: block; font-size: 28px; margin: 0 auto 8px; opacity: .5; }
.list { list-style: none; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--border-color); line-height: 1.4; }
.list li:first-child { border-top: 0; }
.list .when { flex: 0 0 auto; font-family: var(--font-num); font-size: 12.5px; color: var(--text-muted); min-width: 56px; line-height: 1.2; padding-top: 2px; }
.list .when small { color: var(--text-light); }
.list .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list .what .sub { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.chip.ok { background: var(--c-ok-light); color: var(--c-ok); }
.chip.warn { background: var(--c-warning-light); color: var(--c-warning); }
.chip.danger { background: var(--c-danger-light); color: var(--c-danger); }
.chip.primary { background: var(--c-primary-light); color: var(--c-primary); }
a.chip:hover { text-decoration: none; filter: brightness(.95); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 7px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-primary), var(--c-accent)); border-radius: 3px; }

/* ── Кнопки и формы ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 9px 16px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--card-bg); color: var(--text-main); font-weight: 700; font-size: 14px; cursor: pointer; transition: filter .15s, transform .1s; }
.btn:hover { filter: brightness(.97); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); color: var(--c-primary-ink); border-color: transparent; box-shadow: 0 6px 16px -8px var(--c-primary); }
.btn-danger { background: var(--c-danger); color: var(--c-danger-ink); border-color: transparent; }
.btn-ghost { background: transparent; border-color: var(--border-color); color: var(--text-muted); }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; margin-top: 16px; padding: 13px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: default; }
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-top: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
    display: block; width: 100%; margin-top: 5px; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--card-bg); color: var(--text-main); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light); }
textarea { min-height: 90px; resize: vertical; }
.msg { margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; text-align: left; display: flex; gap: 10px; align-items: flex-start; }
.msg i { flex: 0 0 auto; font-size: 16px; margin-top: 1px; }
.msg-err { background: var(--c-danger-light); border: 1px solid var(--c-danger); color: var(--c-danger); }
.msg-ok { background: var(--c-ok-light); border: 1px solid var(--c-ok); color: var(--c-ok); }
.msg-info { background: var(--c-primary-light); border: 1px solid var(--border-color); color: var(--text-main); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* ── Вход ── */
.auth-body { display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 26px; max-width: 410px; width: 100%; padding: 36px 30px 30px; text-align: center; box-shadow: var(--modal-shadow); }
.auth-card .brand-mark { margin: 0 auto 16px; }
.auth-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-card .hint { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.5; }
.auth-card .who { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.auth-card label { text-align: left; }
.auth-card input.code { width: 100%; padding: 16px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); font-family: var(--font-mono); font-size: 26px; letter-spacing: 10px; text-align: center; outline: none; }
.auth-card input.code:focus { border-color: var(--c-primary); }
.brand-mark { width: 64px; height: 64px; display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.link-btn { margin-top: 14px; background: none; border: none; color: var(--text-muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.link-btn[disabled] { opacity: .5; cursor: default; text-decoration: none; }
.back { display: block; margin-top: 14px; font-size: 12px; color: var(--text-light); }
.theme-fab { position: fixed; right: 16px; bottom: 16px; }

/* ── Окно подтверждения (nav.js) ── */
.ask-overlay { display: none; position: fixed; inset: 0; z-index: 100000; background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); align-items: center; justify-content: center; padding: 20px; }
.ask-box { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; max-width: 430px; width: 100%; padding: 22px 24px 18px; box-shadow: var(--modal-shadow); }
.ask-box .bb-ask-title { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.ask-box .bb-ask-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.ask-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Töölaud: показатели и карточки курсов ── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--r-md); box-shadow: var(--card-shadow); color: var(--text-main); min-width: 0; transition: box-shadow .2s, transform .2s; }
.kpi:hover { text-decoration: none; box-shadow: var(--hover-shadow); transform: translateY(-1px); }
.kpi .ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--c-primary-light); color: var(--c-primary); font-size: 18px; flex: 0 0 auto; }
.kpi .ic.accent { background: var(--c-accent-light); color: var(--c-accent); }
.kpi .ic.warn { background: var(--c-warning-light); color: var(--c-warning); }
.kpi .ic.danger { background: var(--c-danger-light); color: var(--c-danger); }
.kpi .ic.ok { background: var(--c-ok-light); color: var(--c-ok); }
.kpi .kv { display: flex; flex-direction: column; min-width: 0; }
.kpi .kv b { font-size: 22px; font-weight: 800; line-height: 1.1; }
.kpi .kv small { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.bad { border-color: var(--c-danger); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-2 .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ccard { display: block; padding: 12px 13px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--surface-2); color: var(--text-main); min-width: 0; transition: border-color .15s, transform .15s; }
.ccard:hover { text-decoration: none; border-color: var(--c-primary); transform: translateY(-1px); }
.cc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cc-top b { font-family: var(--font-num); font-size: 13px; letter-spacing: .02em; color: var(--c-primary); }
.cc-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-meta { display: flex; gap: 10px; margin-top: 7px; font-size: 11.5px; color: var(--text-muted); flex-wrap: wrap; }
.cc-meta .warnt { color: var(--c-warning); font-weight: 700; }
.card .tk { padding: 8px 0; font-size: 13.5px; }
.card .tk input { width: 17px; height: 17px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kpi { padding: 11px 12px; gap: 9px; } .kpi .ic { width: 34px; height: 34px; font-size: 15px; } .kpi .kv b { font-size: 18px; } }

/* ── Töölaud: карточка недельного плана ── */
.prep-card { margin-bottom: 16px; padding: 20px 24px 18px; }
.prep-card h2 { margin-bottom: 14px; }
.prep-head { font-size: 16px; font-weight: 700; line-height: 1.5; max-width: 78ch; margin-bottom: 10px; }
.prep-text { font-size: 14px; line-height: 1.65; color: var(--text-muted); max-width: 78ch; }

/* ── Страницы: общие блоки ── */
.kp { margin: 0; padding-left: 20px; } .kp li { margin: 5px 0; }
.terms dt { font-weight: 700; margin-top: 8px; } .terms dd { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.summary { font-size: 15px; line-height: 1.65; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chips a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-color); font-size: 13px; font-weight: 700; color: var(--text-muted); background: var(--card-bg); }
.chips a:hover { text-decoration: none; color: var(--text-main); }
.chips a.on { background: var(--c-primary); color: var(--c-primary-ink); border-color: transparent; }
.headline { font-size: 19px; font-weight: 800; margin-bottom: 8px; line-height: 1.3; }
.focus { font-size: 15px; line-height: 1.65; }
.plan li { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: start; padding: 11px 0; border-top: 1px solid var(--border-color); }
.plan li:first-child { border-top: 0; }
.plan .w { font-family: var(--font-num); font-weight: 700; font-size: 13px; color: var(--c-primary); }
.plan .why { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.plan .t { font-family: var(--font-num); font-size: 12px; color: var(--text-muted); white-space: nowrap; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); }
@media (max-width: 600px) { .plan li { grid-template-columns: 1fr; } }

/* ── Kalender: месяц ── */
.cal { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--r-md); box-shadow: var(--card-shadow); overflow: hidden; }
.cal-h { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border-color); background: var(--surface-2); }
.cal-h div { padding: 8px 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: var(--text-muted); text-transform: uppercase; }
.cal-h div.we { color: var(--c-danger); opacity: .8; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cd { min-height: 112px; min-width: 0; padding: 6px 7px 8px; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background .15s; }
.cd:nth-child(7n) { border-right: 0; }
.cd:hover { background: var(--surface-2); }
.cd.out { opacity: .42; }
.cd.we { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cd.today { background: var(--c-primary-light); }
.cd.today .cn .num { background: var(--c-primary); color: var(--c-primary-ink); }
.cn { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.cn .num { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.cu { font-size: 10.5px; font-weight: 800; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border-color); border-radius: 999px; padding: 1px 6px; }
.ct { font-size: 11.5px; line-height: 1.25; padding: 3px 6px; margin-top: 3px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid transparent; background: var(--surface-2); color: var(--text-main); }
.ct b { font-family: var(--font-num); font-weight: 700; }
.ct.moodle { border-left-color: var(--c-danger); background: var(--c-danger-light); }
.ct.plan { border-left-color: var(--c-primary); background: var(--c-primary-light); }
.ct.own { border-left-color: var(--c-accent); background: var(--c-accent-light); }
.ct.done { text-decoration: line-through; opacity: .5; }
.ct.more { background: transparent; color: var(--text-muted); font-weight: 700; }
@media (max-width: 760px) {
    .cd { min-height: 64px; padding: 4px 4px 5px; }
    .ct { font-size: 0; height: 6px; padding: 0; margin-top: 3px; border-left: 0; border-radius: 3px; }
    .ct.moodle { background: var(--c-danger); } .ct.plan { background: var(--c-primary); } .ct.own { background: var(--c-accent); } .ct.more { display: none; }
}
/* плашка при наведении на день */
.cal-tip { display: none; position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 24px); background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-line); border-radius: 14px; box-shadow: 0 18px 44px -12px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.25); padding: 10px 12px 8px; pointer-events: none; font-size: 13px; }
.cal-tip .ct-h { font-weight: 800; font-size: 13px; margin-bottom: 6px; color: var(--tip-fg); }
.cal-tip .ct-r { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-top: 1px solid var(--tip-line); line-height: 1.3; }
.cal-tip .ct-r:first-of-type { border-top: 0; }
.cal-tip .ct-r .dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--tip-muted); }
.cal-tip .ct-r.moodle .dot { background: #ff8a8a; } .cal-tip .ct-r.plan .dot { background: #a5a0ff; } .cal-tip .ct-r.own .dot { background: #2dd4bf; }
.cal-tip .ct-r span { min-width: 0; overflow-wrap: anywhere; }
.cal-tip .ct-r b { font-family: var(--font-num); }
.cal-tip .ct-r small { display: block; color: var(--tip-muted); font-size: 11.5px; }
.cal-tip .ct-r.done span { text-decoration: line-through; color: var(--tip-muted); opacity: .7; }
.cal-tip .ct-f { margin-top: 6px; font-size: 11px; color: var(--tip-muted); text-align: right; }
/* окно дня */
.day-box { max-width: 520px; padding: 18px 20px 16px; max-height: 88vh; overflow: auto; }
.db-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.db-t { font-size: 17px; font-weight: 800; }
.db-list .tk { padding: 9px 0; font-size: 13.5px; }
.db-list .tk input { width: 17px; height: 17px; }
.db-add { margin-top: 12px; border-top: 1px solid var(--border-color); padding-top: 10px; }
.db-add summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--c-primary); list-style: none; display: flex; align-items: center; gap: 6px; }
.db-add summary::-webkit-details-marker { display: none; }

/* ── Kalender: неделя (старые классы, используются в окне дня) ── */
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 10px 11px 8px; min-height: 170px; min-width: 0; box-shadow: var(--card-shadow); }
.day.today { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light), var(--card-shadow); }
.day.past { opacity: .7; }
.dh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.dh b { font-family: var(--font-num); font-size: 15px; } .day.today .dh b { color: var(--c-primary); }
.dh small { color: var(--text-muted); font-size: 11.5px; font-family: var(--font-num); }
.tk { display: flex; gap: 7px; align-items: flex-start; padding: 6px 0; border-top: 1px dashed var(--border-color); font-size: 12.5px; line-height: 1.35; }
.tk:first-of-type { border-top: 0; }
.tk input { margin-top: 2px; flex: 0 0 auto; width: 15px; height: 15px; accent-color: var(--c-primary); cursor: pointer; }
.tk .tt { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.tk .tm { display: block; font-size: 11px; color: var(--text-muted); font-family: var(--font-num); }
.tk.done .tt { text-decoration: line-through; color: var(--text-light); }
.tk.moodle .tt b { color: var(--c-danger); font-weight: 700; }
.tk.own .tt { color: var(--c-accent); }
.tk .x { background: none; border: 0; color: var(--text-light); cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); margin: 12px 0 0; flex-wrap: wrap; }
.legend i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.addf { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
.addf label { margin-top: 0; }
@media (max-width: 1000px) { .wk { grid-template-columns: repeat(2, minmax(0, 1fr)); } .addf { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .wk { grid-template-columns: 1fr; } .day { min-height: 0; } }
