:root {
  color-scheme: dark;
  --bg: #171222;
  --bg-2: #1c1628;
  --panel: #241c31;
  --panel-2: #2b223b;
  --panel-3: rgba(255,255,255,.075);
  --line: rgba(255,255,255,.105);
  --line-strong: rgba(173,139,255,.28);
  --text: #fbf9ff;
  --muted: #bbb3ca;
  --accent: #b69aff;
  --accent-strong: #8d67ed;
  --accent-deep: #5b38b3;
  --accent-soft: rgba(171,132,255,.18);
  --accent-softer: rgba(171,132,255,.10);
  --danger: #ff91a2;
  --danger-soft: rgba(255,107,132,.11);
  --success: #7ae4b3;
  --success-soft: rgba(122,228,179,.11);
  --warning: #ffd18a;
  --warning-soft: rgba(255,209,138,.11);
  --radius-xl: 28px;
  --radius-lg: 21px;
  --radius-md: 16px;
  --shadow: 0 22px 64px rgba(0,0,0,.34);
  --safe-top: max(12px, env(safe-area-inset-top));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); font-size: 16px; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 82% 2%, rgba(126,86,232,.16), transparent 28%), linear-gradient(180deg, #1a1425 0%, #17121f 56%, #130f1b 100%); }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.is-hidden { display: none !important; }
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; width: 340px; height: 340px; border-radius: 50%; filter: blur(110px); background: #875cf0; opacity: .16; }
.ambient i:nth-child(1) { top: -150px; right: -110px; opacity: .21; }
.ambient i:nth-child(2) { top: 40%; left: -250px; }
.ambient i:nth-child(3) { bottom: -210px; right: -160px; opacity: .09; }
.app-shell { position: relative; width: min(100%, 760px); margin: 0 auto; padding: calc(var(--safe-top) + 68px) 14px calc(92px + var(--safe-bottom)); }
.app-header { position: fixed; z-index: 40; top: 0; left: 50%; transform: translateX(-50%); width: min(100%,760px); height: calc(62px + var(--safe-top)); padding: var(--safe-top) 14px 8px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(to bottom, rgba(23,18,34,.97) 62%, rgba(23,18,34,0)); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 0; text-align: left; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #ad8cff, #6a45cf); box-shadow: 0 10px 26px rgba(107,66,213,.35), inset 0 1px rgba(255,255,255,.22); font-size: 12px; font-weight: 950; }
.brand-copy small, .brand-copy b { display: block; }
.brand-copy small { color: #8e86a1; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.brand-copy b { margin-top: 2px; font-size: 15px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.045); font-size: 19px; }
.page { display: none; animation: pageIn .23s ease; }
.page.is-active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kicker { display: block; color: var(--accent); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .15em; }
.kicker.light { color: rgba(255,255,255,.66); }
.surface-card { margin-top: 12px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(43,34,58,.97), rgba(30,24,42,.97)); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.surface-card.no-margin { margin-top: 0; }
.avatar { position: relative; flex: 0 0 auto; overflow: hidden; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.15); background: linear-gradient(145deg, #8d6dde, #4f397d); box-shadow: inset 0 1px rgba(255,255,255,.14); font-weight: 900; }
.avatar-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.avatar.has-photo img { opacity: 1; }
.avatar.has-photo span { opacity: 0; }
.avatar-header { width: 39px; height: 39px; padding: 0; border-radius: 13px; }
.avatar-md { width: 57px; height: 57px; border-radius: 19px; font-size: 20px; }
.avatar-lg { width: 78px; height: 78px; border-radius: 25px; font-size: 28px; }
.welcome-card { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: linear-gradient(145deg, rgba(48,38,64,.94), rgba(31,25,43,.94)); box-shadow: var(--shadow); }
.welcome-copy { min-width: 0; }
.welcome-copy h1 { margin: 3px 0 4px; font-size: 24px; letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.welcome-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.round-link { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-3); font-size: 24px; }
.deadline-card { position: relative; overflow: hidden; margin-top: 12px; padding: 23px; border-radius: var(--radius-xl); background: linear-gradient(132deg, #8a68eb 0%, #6a47c7 48%, #3a285f 100%); box-shadow: 0 24px 60px rgba(86,48,169,.34); }
.deadline-card::before { content: ""; position: absolute; width: 210px; height: 210px; top: -125px; right: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0) 68%); }
.deadline-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: 18px; bottom: -78px; border: 22px solid rgba(255,255,255,.045); border-radius: 50%; }
.deadline-top, .deadline-meta { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-pill { flex: 0 0 auto; padding: 6px 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: rgba(10,8,18,.22); font-size: 11px; font-weight: 850; }
.deadline-card h2 { position: relative; z-index: 1; margin: 18px 0 5px; max-width: 82%; font-size: 28px; line-height: 1.12; letter-spacing: -.04em; }
.deadline-card > p { position: relative; z-index: 1; margin: 0 0 18px; color: rgba(255,255,255,.72); font-size: 14px; }
.deadline-meta { padding-top: 13px; border-top: 1px solid rgba(255,255,255,.16); font-size: 12px; }
.deadline-action { position: relative; z-index: 1; width: 100%; margin-top: 14px; padding: 11px 13px; display: flex; justify-content: space-between; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.11); font-weight: 850; }
.signal-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.signal-card { min-width: 0; min-height: 104px; padding: 16px 14px; text-align: left; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(44,35,58,.96), rgba(29,23,40,.96)); }
.signal-card small, .signal-card span { display: block; color: var(--muted); }
.signal-card small { font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.signal-card strong { display: block; margin: 9px 0 4px; font-size: 27px; letter-spacing: -.04em; }
.signal-card span { font-size: 11px; }
.signal-card.danger strong { color: var(--danger); }
.signal-card.accent { grid-column: 1 / -1; min-height: 86px; }
.signal-card.accent strong { color: #d9cdff; font-size: 25px; }
.content-section { margin-top: 24px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.section-title h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.025em; }
.section-title > button, .text-action { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 850; padding: 6px 0; }
.section-note { color: var(--muted); font-size: 11px; text-align: right; }
.stack-list, .card-list, .timeline, .progress-list, .analytics-subjects { display: grid; gap: 9px; }
.subject-row, .compact-row { width: 100%; padding: 13px 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(40,32,53,.94); }
.subject-row b, .compact-row b { display: block; font-size: 14px; }
.subject-row small, .compact-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.row-value { min-width: 45px; min-height: 36px; display: grid; place-items: center; padding: 0 9px; border-radius: 11px; background: var(--accent-soft); color: #e0d7ff; font-size: 13px; font-weight: 900; }
.page-head { padding: 7px 2px 17px; }
.page-head h1 { margin: 3px 0 5px; font-size: 32px; letter-spacing: -.045em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.segmented-scroll { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 5px; margin: 11px 0; }
.segmented-scroll::-webkit-scrollbar { display: none; }
.segmented-scroll button, .segmented button { flex: 0 0 auto; min-height: 37px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); color: var(--muted); font-size: 12px; font-weight: 850; }
.segmented-scroll button b { margin-left: 4px; }
.segmented-scroll button.is-active, .segmented button.is-active { color: var(--text); border-color: var(--line-strong); background: var(--accent-soft); }
.segmented { display: flex; gap: 7px; margin-bottom: 10px; }
.segmented button { flex: 1; }
.subject-progress-strip { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.subject-progress-strip::-webkit-scrollbar { display: none; }
.progress-chip { flex: 0 0 auto; padding: 9px 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--accent-softer); }
.progress-chip b, .progress-chip small { display: block; }
.progress-chip b { font-size: 12px; }
.progress-chip small { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.task-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(145deg, rgba(45,36,60,.96), rgba(30,24,42,.96)); }
.task-card.is-overdue { border-color: rgba(255,145,162,.26); box-shadow: inset 3px 0 var(--danger); }
.task-card.is-focused { border-color: rgba(154,116,255,.82); box-shadow: 0 0 0 2px rgba(139,92,246,.16), 0 18px 42px rgba(68,37,126,.22); }
.task-top { display: flex; justify-content: space-between; gap: 10px; }
.task-card h3 { margin: 5px 0 0; font-size: 18px; line-height: 1.28; }
.subject-label { color: var(--accent); font-size: 11px; font-weight: 850; }
.task-card > p { margin: 11px 0 0; color: #e0d9e8; font-size: 13px; line-height: 1.5; }
.task-details { display: grid; gap: 7px; margin: 12px 0; padding: 11px; border-radius: 13px; background: rgba(255,255,255,.035); }
.task-details div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.task-details span { color: var(--muted); }
.status-controls { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.status-controls button { min-height: 38px; padding: 7px 3px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 850; }
.status-controls button.is-active { color: var(--text); border-color: var(--line-strong); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(157,112,255,.04); }
.source-link, .contact-link, .secondary-button, .primary-button { width: 100%; min-height: 44px; border-radius: 13px; font-weight: 850; }
.source-link { margin-top: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--accent); }
.primary-button { margin-top: 12px; border: 0; background: linear-gradient(135deg, #8e68ee, #6842cd); box-shadow: 0 12px 28px rgba(95,55,199,.26); }
.secondary-button { margin-top: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.calendar-toolbar { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; padding: 9px; }
.calendar-toolbar button { height: 40px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.045); font-size: 22px; }
.calendar-toolbar div { text-align: center; }
.calendar-toolbar strong, .calendar-toolbar small { display: block; }
.calendar-toolbar small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.calendar-days { margin: 10px 0 20px; }
.calendar-days.week-mode { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.calendar-days.month-mode { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.calendar-day { position: relative; min-height: 58px; padding: 8px 2px; border: 1px solid transparent; border-radius: 13px; background: rgba(255,255,255,.023); text-align: center; }
.calendar-day em, .calendar-day span, .calendar-day small { display: block; font-style: normal; }
.calendar-day em { color: #837c91; font-size: 9px; text-transform: uppercase; }
.calendar-day span { margin-top: 4px; font-size: 16px; font-weight: 900; }
.calendar-day small { min-height: 11px; margin-top: 4px; color: var(--accent); font-size: 9px; }
.calendar-day.has-events { border-color: var(--line); background: rgba(157,112,255,.045); }
.calendar-day.is-today span { color: var(--accent); }
.calendar-day.is-selected { border-color: rgba(167,133,255,.46); background: var(--accent-soft); box-shadow: 0 8px 22px rgba(68,38,132,.16); }
.calendar-spacer { min-height: 48px; }
.selected-day-head { margin: 0 2px 10px; }
.selected-day-head h2 { margin: 3px 0 0; font-size: 18px; }
.timeline-item { display: grid; grid-template-columns: 47px 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(40,32,53,.94); }
.timeline-item.kind-exam { border-color: rgba(255,209,138,.23); }
.timeline-item.kind-assignment { border-color: rgba(167,133,255,.24); }
.timeline-time { color: var(--accent); font-size: 13px; font-weight: 900; }
.timeline-copy h3 { margin: 0; font-size: 15px; }
.timeline-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.timeline-copy .timeline-meta { margin-top: 8px; color: #d7d1df; line-height: 1.4; }
.study-summary-card { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; overflow: hidden; margin-bottom: 11px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--line); }
.study-summary-card > div { padding: 15px 10px; background: linear-gradient(145deg, #38284f, #251b34); text-align: center; }
.study-summary-card small, .study-summary-card strong { display: block; }
.study-summary-card small { color: var(--muted); font-size: 10px; }
.study-summary-card strong { margin-top: 5px; font-size: 26px; }
.filter-banner { margin: 9px 0; padding: 11px 13px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid rgba(255,145,162,.22); border-radius: 13px; background: var(--danger-soft); font-size: 10px; }
.filter-banner button { border: 0; background: transparent; color: var(--danger); font-weight: 850; }
.subject-card { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(145deg, rgba(45,36,60,.96), rgba(29,23,40,.96)); }
.subject-card-top { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.subject-card h3 { margin: 0; font-size: 18px; }
.subject-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.average-badge { min-width: 48px; min-height: 42px; display: grid; place-items: center; padding: 0 8px; border-radius: 13px; background: var(--accent-soft); color: #e0d6ff; font-size: 17px; font-weight: 950; }
.subject-mini-progress { margin-top: 12px; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10.5px; }
.progress-label b { color: #d9d2e5; }
.progress-track { height: 6px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d43d0, #ad8cff); }
.recent-grades { display: flex; gap: 5px; margin-top: 11px; }
.grade-dot { min-width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.045); color: #dcd5e7; font-size: 11px; font-weight: 900; }
.subject-open { width: 100%; margin-top: 11px; min-height: 38px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.03); color: var(--accent); font-size: 11px; font-weight: 850; }
.analytics-hero { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; padding: 20px; border-radius: var(--radius-xl); background: linear-gradient(135deg, #8660e6, #5b3ab7 58%, #352552); box-shadow: 0 22px 55px rgba(65,35,139,.34); }
.analytics-hero strong { display: block; margin: 7px 0 2px; font-size: 38px; letter-spacing: -.05em; }
.analytics-hero p { margin: 0; color: rgba(255,255,255,.65); font-size: 11px; }
.analytics-hero-side { display: grid; gap: 7px; text-align: right; color: rgba(255,255,255,.72); font-size: 11px; }
.analytics-hero-side b { color: white; font-size: 17px; }
.attention-card { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: rgba(42,34,56,.95); }
.attention-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-weight: 950; }
.attention-card.is-danger .attention-icon { background: var(--danger-soft); color: var(--danger); }
.attention-card b, .attention-card small { display: block; }
.attention-card b { font-size: 13px; }
.attention-card small { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.attention-card > span:last-child { color: var(--muted); }
.analytics-section { margin-top: 14px; }
.workload-chart { display: grid; grid-template-columns: repeat(14,minmax(0,1fr)); gap: 4px; align-items: end; min-height: 154px; overflow: hidden; padding-top: 8px; }
.workload-day { min-width: 0; display: grid; grid-template-rows: 108px auto auto; gap: 4px; text-align: center; }
.workload-bar-wrap { display: flex; align-items: flex-end; justify-content: center; height: 108px; }
.workload-bar { width: min(20px,80%); min-height: 4px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #b18fff, #6940d0); box-shadow: 0 8px 20px rgba(102,61,208,.2); }
.workload-day.is-peak .workload-bar { box-shadow: 0 0 0 1px rgba(255,209,138,.45), 0 8px 22px rgba(102,61,208,.3); }
.workload-day b { font-size: 9px; }
.workload-day small { color: var(--muted); font-size: 8px; }
.chart-note { margin: 10px 0 0; color: #8d879a; font-size: 10.5px; line-height: 1.5; }
.analytics-progress-row { padding: 11px 0; border-bottom: 1px solid var(--line); }
.analytics-progress-row:last-child { border-bottom: 0; }
.analytics-progress-row .progress-label { font-size: 11px; }
.analytics-subject-row { width: 100%; padding: 12px 0; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; }
.analytics-subject-row:last-child { border-bottom: 0; }
.analytics-subject-head { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.analytics-subject-head h3 { margin: 0; font-size: 14px; }
.analytics-subject-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.trend-badge { align-self: start; padding: 5px 7px; border-radius: 8px; background: rgba(255,255,255,.045); color: var(--muted); font-size: 9px; font-weight: 850; }
.trend-badge.up { color: var(--success); background: var(--success-soft); }
.trend-badge.down { color: var(--danger); background: var(--danger-soft); }
.identity-card { display: flex; align-items: center; gap: 14px; }
.identity-card h2 { margin: 0; }
.identity-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.telegram-badge { margin-left: auto; align-self: flex-start; padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: #d9ccff; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.detail-list { margin: 0; }
.detail-list div { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; max-width: 62%; text-align: right; font-weight: 750; overflow-wrap: anywhere; }
.settings-list { display: grid; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b, .setting-row small { display: block; }
.setting-row b { font-size: 11px; }
.setting-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.toggle { width: 44px; height: 26px; padding: 3px; border: 0; border-radius: 99px; background: rgba(255,255,255,.11); }
.toggle::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform .18s; }
.toggle.is-on { background: var(--accent-strong); }
.toggle.is-on::after { transform: translateX(18px); }
.quiet-time-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:10px 0 13px; }
.quiet-time-row label { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.035); }
.quiet-time-row label span { color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.quiet-time-row input { width:100%; min-width:0; border:0; background:transparent; color:var(--text); font:inherit; font-size:12px; font-weight:700; outline:none; color-scheme:dark; }
.headman-card { margin-top: 12px; padding: 18px; border-radius: var(--radius-xl); background: linear-gradient(135deg, #6742bd, #2c214b 68%, #171321); box-shadow: 0 18px 42px rgba(71,36,147,.24); }
.headman-card h2 { margin: 4px 0; }
.headman-card p { margin: 0; color: rgba(255,255,255,.67); font-size: 10px; line-height: 1.45; }
.headman-card button { width: 100%; min-height: 42px; margin-top: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.11); font-weight: 850; }
.privacy-note { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.02); }
.privacy-note b { font-size: 11px; }
.privacy-note p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.sheet { position: fixed; z-index: 80; inset: 0; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4,3,8,.76); backdrop-filter: blur(6px); }
.sheet-panel { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%,760px); max-height: 94vh; overflow-y: auto; padding: 16px 14px calc(22px + var(--safe-bottom)); border: 1px solid var(--line); border-radius: 27px 27px 0 0; background: #21192d; box-shadow: 0 -20px 70px rgba(0,0,0,.48); animation: sheetIn .23s ease; }
@keyframes sheetIn { from { transform: translate(-50%,100%); } }
.sheet-panel > header { position: sticky; top: -16px; z-index: 3; display: flex; align-items: center; gap: 11px; margin: -16px -14px 13px; padding: 16px 14px 11px; border-bottom: 1px solid var(--line); background: rgba(33,25,45,.96); backdrop-filter: blur(14px); }
.sheet-panel > header button { width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); font-size: 23px; }
.sheet-panel > header h2 { margin: 2px 0 0; font-size: 17px; }
.subject-hero { position: relative; overflow: hidden; padding: 18px; border-radius: var(--radius-lg); background: linear-gradient(135deg, #7d58d8, #5536a9 58%, #32234c); }
.subject-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.subject-average strong { display: block; margin-top: 5px; font-size: 38px; letter-spacing: -.055em; }
.subject-hero p { margin: 4px 0 0; color: rgba(255,255,255,.68); font-size: 10px; }
.subject-progress-big { text-align: right; }
.subject-progress-big strong { display: block; font-size: 18px; }
.subject-progress-big small { color: rgba(255,255,255,.6); font-size: 9px; }
.contact-card { margin-top: 10px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(42,34,56,.96); }
.contact-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.contact-card-head h2 { margin: 3px 0 0; font-size: 16px; }
.contact-card-head button { border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 850; }
.contact-list { display: grid; gap: 7px; margin-top: 11px; }
.contact-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.contact-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 900; }
.contact-row b, .contact-row small { display: block; }
.contact-row b { font-size: 10px; }
.contact-row small { margin-top: 2px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.contact-row button { border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 850; }
.contact-empty { padding: 13px; color: var(--muted); font-size: 10px; text-align: center; }
.contact-editor { display: grid; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.field-with-clear { display: grid; grid-template-columns: 1fr 38px; gap: 7px; }
.contact-editor label { display: grid; gap: 5px; color: #cfc7d9; font-size: 10px; font-weight: 800; }
.contact-editor input { width: 100%; min-height: 42px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(6,5,10,.35); color: var(--text); }
.field-with-clear button { align-self: end; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.035); color: var(--muted); }
.goal-row { display: flex; gap: 6px; margin-bottom: 10px; }
.goal-row button { flex: 1; min-height: 35px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); color: var(--muted); font-size: 9px; font-weight: 850; }
.goal-row button.is-active { color: var(--text); background: var(--accent-soft); border-color: var(--line-strong); }
.goal-result { margin-bottom: 10px; padding: 11px; border-radius: 12px; background: var(--accent-softer); color: #d8d0e5; font-size: 10px; line-height: 1.45; }
.simulator-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.simulator-cell { padding: 10px 4px; text-align: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.simulator-cell b, .simulator-cell small { display: block; }
.simulator-cell b { font-size: 13px; }
.simulator-cell small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.result-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.result-row:last-child { border-bottom: 0; }
.result-value { width: 38px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); font-size: 11px; font-weight: 900; }
.result-value.absence { color: var(--danger); background: var(--danger-soft); }
.result-row p { margin: 0; font-size: 10px; }
.result-row small { color: var(--muted); font-size: 8px; }
.empty-state { padding: 24px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.015); font-size: 11.5px; line-height: 1.5; }
.bottom-navigation { position: fixed; z-index: 50; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%,760px); display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; padding: 7px 8px var(--safe-bottom); border-top: 1px solid var(--line); background: rgba(27,21,38,.94); backdrop-filter: blur(22px); }
.nav-item { min-width: 0; padding: 7px 1px 5px; border: 0; border-radius: 12px; background: transparent; color: #827b91; }
.nav-item span, .nav-item small { display: block; }
.nav-item span { font-size: 20px; line-height: 1; }
.nav-item small { margin-top: 4px; font-size: 9px; font-weight: 850; }
.nav-item.is-active { color: var(--text); background: var(--accent-soft); }
.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(77px + var(--safe-bottom)); transform: translate(-50%,18px); width: min(calc(100% - 28px),520px); padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(29,24,40,.97); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; font-size: 11px; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }
.toast.is-error { border-color: rgba(255,145,162,.26); color: #ffd1d8; }
.fatal-error { position: fixed; z-index: 110; inset: 0; display: grid; align-content: center; width: min(100%,760px); margin: auto; padding: 30px; background: var(--bg); text-align: center; }
.fatal-error h2 { margin: 0; }
.fatal-error p { color: var(--muted); }
@media (max-width: 390px) {
  .app-shell { padding-left: 11px; padding-right: 11px; }
  .app-header { padding-left: 11px; padding-right: 11px; }
  .signal-card { padding: 12px 8px; }
  .signal-card strong { font-size: 21px; }
  .signal-card.accent strong { font-size: 18px; }
  .deadline-card h2 { max-width: 92%; font-size: 23px; }
  .analytics-hero { grid-template-columns: 1fr; }
  .analytics-hero-side { grid-template-columns: 1fr 1fr; text-align: left; }
}
@media (min-width: 640px) {
  .app-shell { padding-left: 20px; padding-right: 20px; }
  .card-list { gap: 11px; }
  .workload-chart { gap: 8px; }
}


/* v0.30 Student Core: clearer type and lighter purple surfaces */
.deadline-card.is-overdue { box-shadow: 0 24px 60px rgba(114,48,123,.26); }
.deadline-top { align-items: flex-start; }
.deadline-top .status-pill { max-width: 46%; text-align: center; white-space: normal; line-height: 1.25; }
.today-row, .result-preview-row { width:100%; display:grid; align-items:center; gap:10px; padding:13px 14px; border:1px solid var(--line); border-radius:var(--radius-md); background:rgba(42,34,56,.94); text-align:left; }
.today-row { grid-template-columns:44px 30px 1fr auto; }
.today-time { color:var(--accent); font-size:12px; font-weight:900; }
.today-icon { width:30px; height:30px; display:grid; place-items:center; border-radius:10px; background:var(--accent-soft); color:#eadfff; font-weight:950; }
.today-row b, .result-preview-row b { display:block; font-size:14px; }
.today-row small, .result-preview-row small { display:block; margin-top:4px; color:var(--muted); font-size:11px; line-height:1.35; }
.today-arrow, .result-preview-row > span:last-child { color:var(--muted); font-size:20px; }
.result-preview-row { grid-template-columns:42px 1fr auto; }
.empty-state.calm { display:grid; gap:5px; }
.empty-state.calm b { color:#e6deef; font-size:13px; }
.empty-state.calm span { color:var(--muted); }
.calendar-day.load-mid { border-color:rgba(182,154,255,.25); }
.calendar-day.load-high { border-color:rgba(255,209,138,.34); background:rgba(255,209,138,.07); }
.analytics-range { margin:-2px 0 12px; }
.analytics-range button { min-height:34px; }

@media (min-width: 600px) {
  .app-shell { padding-left:24px; padding-right:24px; }
  .app-header { padding-left:24px; padding-right:24px; }
  .welcome-card { padding:19px; }
  .welcome-copy h1 { font-size:27px; }
  .deadline-card { padding:27px; }
  .deadline-card h2 { font-size:31px; max-width:88%; }
  .deadline-card > p { font-size:15px; }
  .signal-card { min-height:112px; }
  .task-card, .subject-card, .surface-card { padding:19px; }
  .page-head h1 { font-size:35px; }
  .page-head p { font-size:15px; }
  .subject-row b, .compact-row b, .today-row b, .result-preview-row b { font-size:15px; }
  .subject-row small, .compact-row small, .today-row small, .result-preview-row small { font-size:12px; }
}
@media (max-width: 390px) {
  .signal-card { padding: 14px 11px; }
  .signal-card strong { font-size: 24px; }
  .signal-card.accent strong { font-size: 23px; }
  .deadline-card h2 { max-width: 100%; font-size: 26px; }
  .today-row { grid-template-columns: 40px 28px 1fr auto; padding: 12px; }
}
.nav-item small { font-size: 10px; }
.toast { font-size: 12px; }


/* v0.32.1 — visual correction: calmer graphite + violet palette, larger mobile type */
:root {
  --bg: #0e0e17;
  --bg-2: #14131e;
  --panel: rgba(29, 28, 43, .96);
  --panel-2: rgba(41, 39, 58, .90);
  --panel-3: rgba(255,255,255,.055);
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(159,134,255,.36);
  --text: #f7f5ff;
  --muted: #aaa6b8;
  --accent: #9f86ff;
  --accent-strong: #8069dc;
  --accent-deep: #56469e;
  --accent-soft: rgba(159,134,255,.15);
  --accent-softer: rgba(159,134,255,.09);
  --shadow: 0 20px 58px rgba(0,0,0,.30);
}
html { background: #0e0e17; }
body {
  background:
    radial-gradient(circle at 84% -8%, rgba(111,91,211,.10), transparent 31%),
    linear-gradient(180deg, #11111a 0%, #0e0e17 58%, #0c0c14 100%);
}
.ambient i { background: #6f5bd3; opacity: .075; filter: blur(128px); }
.ambient i:nth-child(1) { opacity: .10; }
.ambient i:nth-child(2) { opacity: .055; }
.ambient i:nth-child(3) { opacity: .035; }
.app-header {
  background: linear-gradient(to bottom, rgba(14,14,23,.98) 66%, rgba(14,14,23,0));
}
.brand-mark {
  background: linear-gradient(145deg, #8f76ed, #6553ba);
  box-shadow: 0 9px 24px rgba(73,59,148,.28), inset 0 1px rgba(255,255,255,.18);
}
.icon-button, .round-link, .calendar-toolbar button {
  background: rgba(255,255,255,.04);
}
.surface-card,
.welcome-card,
.signal-card,
.task-card,
.subject-card {
  background: rgba(35,33,48,.90);
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
}
.subject-row, .compact-row, .timeline-item, .attention-card, .contact-card {
  background: rgba(35,33,48,.82);
}
.deadline-card {
  background: linear-gradient(135deg, #735dd2 0%, #4c3c92 50%, #292440 100%);
  box-shadow: 0 22px 55px rgba(70,54,145,.27);
}
.deadline-card::before { opacity: .62; }
.deadline-card::after { opacity: .65; }
.deadline-card h2 { max-width: 100%; }
.analytics-hero {
  background: linear-gradient(135deg, #735dd2 0%, #4b3a90 58%, #292440 100%);
  box-shadow: 0 20px 48px rgba(57,45,116,.26);
}
.subject-hero {
  background: linear-gradient(135deg, #735dd2 0%, #4b3a90 58%, #292440 100%);
}
.headman-card {
  background: linear-gradient(135deg, #554596, #29243f 70%, #171721);
  box-shadow: 0 16px 38px rgba(43,34,93,.22);
}
.primary-button {
  background: linear-gradient(135deg, #8069dc, #6250b5);
  box-shadow: 0 10px 24px rgba(66,52,137,.24);
}
.progress-track i, .workload-bar {
  background: linear-gradient(90deg, #6f5bd3, #9f86ff);
}
.bottom-navigation {
  background: rgba(20,19,30,.96);
  border-top-color: rgba(255,255,255,.08);
}
.nav-item.is-active { background: rgba(159,134,255,.12); }

/* Typography: secondary text must remain readable in Telegram WebView. */
.brand-copy small { font-size: 11px; }
.brand-copy b { font-size: 16px; }
.kicker { font-size: 11.5px; }
.page-head h1 { font-size: 33px; }
.page-head p { font-size: 14px; }
.section-title h2 { font-size: 21px; }
.section-note { font-size: 12px; }
.subject-row b, .compact-row b { font-size: 15px; }
.subject-row small, .compact-row small { font-size: 12px; line-height: 1.4; }
.signal-card small { font-size: 11px; }
.signal-card span { font-size: 12px; }
.progress-chip b { font-size: 13px; }
.progress-chip small { font-size: 11.5px; }
.nav-item small { font-size: 10.5px; }

/* Assignment cards: full-width title; status never steals title width. */
.task-card { padding: 17px; }
.task-card.is-overdue {
  border-color: rgba(255,143,159,.28);
  box-shadow: inset 3px 0 #ff8f9f, 0 12px 30px rgba(0,0,0,.12);
}
.task-card.is-submitted {
  border-color: rgba(122,228,179,.22);
  box-shadow: inset 3px 0 rgba(122,228,179,.64), 0 12px 30px rgba(0,0,0,.12);
}
.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.task-card h3 {
  margin: 8px 0 0;
  width: 100%;
  max-width: none;
  font-size: 20px;
  line-height: 1.27;
  letter-spacing: -.018em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.subject-label {
  min-width: 0;
  color: #a994ff;
  font-size: 12px;
  line-height: 1.25;
}
.task-top .status-pill {
  flex: 0 0 auto;
  max-width: 46%;
  padding: 6px 9px;
  white-space: nowrap;
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.08);
  font-size: 10.5px;
  line-height: 1.15;
}
.task-card.is-overdue .task-top .status-pill {
  color: #ffb2bd;
  background: rgba(255,143,159,.08);
  border-color: rgba(255,143,159,.18);
}
.task-top .status-pill.is-submitted {
  color: #b7ecd3;
  background: rgba(122,228,179,.09);
  border-color: rgba(122,228,179,.20);
  box-shadow: 0 0 14px rgba(122,228,179,.06);
}
.task-card > p { color: #d4d0dc; font-size: 13.5px; line-height: 1.55; }
.task-details {
  margin: 14px 0;
  padding: 12px;
  background: rgba(255,255,255,.03);
}
.task-details div { font-size: 12.5px; line-height: 1.35; }
.task-details b { text-align: right; }
.task-details .overdue-detail b { color: #ffadb9; }
.status-controls { gap: 7px; }
.status-controls button {
  min-height: 42px;
  padding: 9px 5px;
  font-size: 10.5px;
  background: rgba(255,255,255,.012);
}
.status-controls button.is-active {
  border-color: rgba(159,134,255,.38);
  background: rgba(159,134,255,.15);
}
.status-controls button.is-active[data-status-update="submitted"] {
  color: #b7ecd3;
  border-color: rgba(122,228,179,.28);
  background: rgba(122,228,179,.10);
  box-shadow: inset 0 0 0 1px rgba(122,228,179,.04), 0 0 14px rgba(122,228,179,.05);
}

@media (max-width: 390px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .task-card { padding: 15px; }
  .task-card h3 { font-size: 19px; }
  .task-top .status-pill { max-width: 48%; font-size: 10px; }
  .status-controls button { font-size: 10px; }
}

@media (min-width: 600px) {
  html { font-size: 17px; }
  .app-shell { padding-left: 18px; padding-right: 18px; }
  .task-card h3 { font-size: 22px; }
  .task-details div { font-size: 13px; }
  .status-controls button { font-size: 11px; }
}

/* Длинные описания из админки */
.task-description,
.subject-description {
  white-space: normal;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.subject-description-card .subject-description {
  margin: 0;
}
