/* Kairos — тёмная тема по референсу: угольный фон, ambient-свечение, графитовые карточки, белые кнопки. */
:root {
  --bg: #09090b;
  --bg-2: #0b0b0d;
  --card: #16161a;
  --card-2: #1b1b20;
  --field: #18181c;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);
  --text: #fafafa;
  --muted: #a1a1aa;
  --dim: #71717a;
  --sel: #e6deff;
  --sel-glow: rgba(176, 150, 255, 0.38);
  --card-grad: linear-gradient(180deg, #1a1a1f 0%, #141418 100%);
  --edge: rgba(255, 255, 255, 0.055);
  --ok: #5fd38a;
  --warn: #f5a524;
  --bad: #ff5c5c;
  --sans: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Prata", Georgia, "Times New Roman", serif;
  --safe-top: 0px;
  --safe-bottom: 0px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  min-height: 100vh;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
input, textarea { font: inherit; }
img { display: block; }
.tabular, .hero-count, .tl-time, .lesson-time, .deadline-left, .hero-count b, .hero-time, .big-num b, .stat b, .item-score, .daypill b, .devcode, .limit-dots, .tl-time small, .att-row-state { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- ambient-свечение ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.5; }
.ambient .a1 { width: 70vw; height: 70vw; left: -25vw; bottom: -20vw; background: radial-gradient(circle, rgba(138, 88, 40, 0.55), transparent 70%); }
.ambient .a2 { width: 80vw; height: 80vw; right: -35vw; top: -30vw; background: radial-gradient(circle, rgba(74, 62, 150, 0.5), transparent 70%); }
.ambient .a3 { width: 60vw; height: 60vw; right: -10vw; bottom: 10vh; background: radial-gradient(circle, rgba(96, 60, 30, 0.28), transparent 70%); }

/* isolation: шторки (z 60) и нижняя панель (z 40) в одном контексте наложения — шторка всегда поверх панели */
.app { position: relative; min-height: 100vh; min-height: 100dvh; isolation: isolate; }
.ambient { z-index: -1; }
.app main { position: relative; padding-top: calc(var(--safe-top) + 10px); }
.app.with-tabs main { padding-bottom: calc(var(--safe-bottom) + 104px); }
.page { max-width: 640px; margin: 0 auto; padding: 0 16px 24px; }
.center-page { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.screen-in { animation: screen-in 0.3s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- типографика ---------- */
.title { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.4px; margin: 0; }
.small-title { font-size: 20px; }
.eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.eyebrow::first-letter { text-transform: uppercase; }
h1.serif { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.1; letter-spacing: -0.3px; margin: 0; text-align: center; }
.hello { font-size: 34px; font-weight: 700; letter-spacing: -0.6px; margin: 26px 0 10px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 18px; }
.footnote { margin: 22px 0 6px; text-align: center; color: var(--dim); font-size: 12px; }

/* ---------- кнопки ---------- */
.btn {
  height: 52px; padding: 0 22px; border-radius: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.1px; white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}
.btn.full { width: 100%; }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(0.985); }
.btn-primary { background: #fff; color: #09090b; box-shadow: 0 6px 24px rgba(255, 255, 255, 0.08); }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] { background: #252529; color: #67676f; box-shadow: none; }
.btn.nudge { animation: nudge 0.34s var(--ease); }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 55% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }
.btn-primary.is-loading { background: #fff; color: #09090b; }
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: #fff; }
.btn-secondary:disabled, .btn-secondary[aria-disabled="true"] { color: var(--dim); }
.btn-ghost { background: transparent; color: #fff; }
.btn-danger { background: rgba(255, 92, 92, 0.12); color: #ff8a8a; }
.btn.small { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
.textlink { color: #fff; font-weight: 500; font-size: 15px; padding: 12px; border-radius: 12px; }
.textlink { transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.textlink:active { background: rgba(255, 255, 255, 0.06); }
.textlink.danger { color: #ff8a8a; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.07); color: #fff; flex: none; }
.iconbtn:active { transform: scale(0.94); }
.iconbtn.active { color: #ffd166; }
.iconbtn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- заставка ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(165deg, #1a2547 0%, #0d0f1d 42%, #10091a 70%, #2b0e2c 100%);
  transition: opacity 0.4s ease;
}
.splash.leaving { opacity: 0; }
.splash-glow { position: absolute; inset: 0; background: radial-gradient(60% 40% at 15% 85%, rgba(150, 40, 120, 0.45), transparent 70%), radial-gradient(50% 35% at 85% 10%, rgba(60, 90, 200, 0.35), transparent 70%); }
.splash-mark { position: relative; animation: mark-in 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both; filter: drop-shadow(0 10px 40px rgba(255, 255, 255, 0.15)); }
.splash-name { position: relative; font-family: var(--serif); font-size: 32px; letter-spacing: 1px; animation: screen-in 0.6s 0.15s both; }
.splash-tag { position: relative; color: rgba(255, 255, 255, 0.6); font-size: 14px; animation: screen-in 0.6s 0.3s both; }
@keyframes mark-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

/* ---------- выбор предметов ---------- */
.onboarding { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 6px 16px 0; }
.progress-seg { display: flex; gap: 6px; padding: 6px 0 0; }
.progress-seg i { width: 30px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); }
.progress-seg i.on { background: #fff; }
.onboarding > p.muted { margin: 0; max-width: 420px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.subject-card {
  position: relative; height: 128px; border-radius: 20px; overflow: hidden; padding: 12px 14px; text-align: left; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start;
  background: radial-gradient(100% 120% at 92% 105%, var(--h1, #2a2a33) 0%, transparent 72%), linear-gradient(150deg, #19191e 0%, #131317 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.12s ease;
}
.subject-card:active { transform: scale(0.97); }
.subject-title { position: relative; z-index: 1; font-size: 15px; font-weight: 500; line-height: 1.25; max-width: 100%; }
.subject-meta { position: relative; z-index: 1; font-size: 12px; color: var(--muted); margin-top: 3px; max-width: calc(100% - 64px); }
.subject-art { position: absolute; right: 10px; bottom: 10px; width: 52px; height: 52px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4)); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.2, 1); pointer-events: none; }
.subject-card.selected { border-color: var(--sel); box-shadow: inset 0 0 0 1px var(--sel), 0 0 26px var(--sel-glow); }
.subject-card.selected .subject-art { transform: scale(1.07) rotate(-4deg); }
.subject-card.all { background: radial-gradient(100% 120% at 92% 105%, #3a2f55 0%, transparent 72%), linear-gradient(150deg, #19191e 0%, #131317 100%); }
.all-stack { position: absolute; right: 10px; bottom: 10px; display: flex; }
.all-stack img { width: 36px; height: 36px; border-radius: 9px; background: #232329; border: 1px solid rgba(255, 255, 255, 0.12); margin-left: -10px; padding: 3px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }
.all-stack img:nth-child(2) { transform: translateY(-6px); }
.sticky-actions { position: sticky; bottom: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 16px -16px 0; padding: 22px 16px calc(var(--safe-bottom) + 10px); background: linear-gradient(to top, rgba(9, 9, 11, 0.98) 55%, rgba(9, 9, 11, 0)); }

/* ---------- главная ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px; min-height: 0; border: 1px solid rgba(255, 255, 255, 0.07);
  background: radial-gradient(110% 110% at 100% 0%, var(--h1, #2a2a33) 0%, transparent 62%), linear-gradient(160deg, #1b1b21 0%, #111114 100%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.hero-time { font-size: 15px; font-weight: 600; color: #e4e4e7; }
.hero-title { position: relative; z-index: 1; font-size: 25px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.15; margin: 0 0 6px; max-width: none; }
.hero-kicker { color: var(--muted); font-size: 13px; }
.hero-sub { position: relative; z-index: 1; color: #c4c4cc; font-size: 13.5px; max-width: none; }
.hero-count { position: relative; z-index: 1; margin-top: 12px; color: #d4d4d8; font-size: 14px; }
.hero-count b { font-size: 22px; color: #fff; margin-left: 4px; }
.hero-progress { position: relative; z-index: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); margin: 12px 0 4px; overflow: hidden; }
.hero-progress.small { height: 3px; margin: 10px 0 0; }
.hero-progress i { display: block; height: 100%; border-radius: 2px; background: var(--ha, #fff); transition: width 1s linear; }
/* Иллюстрация стоит в потоке, рядом с названием, а не поверх текста */
.hero-main { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.hero-main .hero-link { flex: 1; min-width: 0; }
.hero-art { position: relative; flex: none; width: 68px; height: 68px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45)); pointer-events: none; }
.hero-empty { display: flex; align-items: center; justify-content: space-between; min-height: 150px; }
.hero-empty .hero-art { position: static; }
.hero-materials { position: relative; z-index: 1; display: flex; flex-wrap: nowrap; gap: 8px; margin: 14px -18px; padding: 2px 18px; overflow-x: auto; scrollbar-width: none; }
.hero-materials::-webkit-scrollbar { display: none; }
.mat-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 240px; flex: none; padding: 5px 10px 5px 5px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.08); }
.mat-chip .filebadge { width: 26px; height: 30px; border-radius: 7px; }
.mat-chip .filebadge span { font-size: 7px; }
.mat-chip > span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 12.5px; font-weight: 500; color: #e4e4e7; white-space: nowrap; }
.chip.small { padding: 3px 8px; font-size: 11.5px; }
.chip-live { background: rgba(95, 211, 138, 0.14); color: #86e7a9; }
.chip-next { background: rgba(255, 255, 255, 0.12); color: #fff; }
.chip-bad { background: rgba(255, 92, 92, 0.14); color: #ff8a8a; }
.chip.toggle { border: 1px solid rgba(255, 255, 255, 0.1); background: transparent; padding: 8px 13px; transition: background 0.2s, color 0.2s; }
.chip.toggle.on { background: #fff; color: #09090b; border-color: #fff; }
.chips-row { display: flex; gap: 8px; margin: 12px 0 14px; }
.chips-row.scroll { overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
.chips-row.scroll::-webkit-scrollbar { display: none; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(95, 211, 138, 0.14); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.16); }
.dot-error { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 92, 92, 0.16); }
.dot-off { background: #52525b; }
/* Пульс — только transform и opacity у псевдоэлемента: без перерисовки тени на каждом кадре */
.dot-live { position: relative; background: var(--ok); box-shadow: 0 0 0 3px rgba(95, 211, 138, 0.14); }
.dot-live::after, .tl-row.live .tl-line i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: rgba(95, 211, 138, 0.5); animation: ring 1.8s var(--ease) infinite; pointer-events: none; }
@keyframes ring { 0% { transform: scale(0.55); opacity: 0.8; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(95, 211, 138, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(95, 211, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 211, 138, 0); } }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); font-size: 12px; color: var(--muted); white-space: nowrap; }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 11px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.1px; color: #e4e4e7; }
.section-head .textlink { padding: 6px 4px; font-size: 14px; color: var(--muted); }

.card { background: var(--card-grad); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); border-radius: 20px; padding: 14px 16px; }
.card.soft { background: rgba(255, 255, 255, 0.035); }
.banner { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(245, 165, 36, 0.1); border: 1px solid rgba(245, 165, 36, 0.24); color: #ffd08a; text-align: left; font-size: 14px; }
.banner span { flex: 1; }
.banner.static { margin: 0 0 12px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 13px 14px; background: var(--card-grad); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); transition: transform 0.14s var(--ease), background 0.2s ease; }
button.row:active { transform: scale(0.985); background: var(--card-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main b { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .row-main b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.row-badge { min-width: 44px; height: 26px; padding: 0 8px; border-radius: 13px; background: rgba(255, 255, 255, 0.08); font-size: 12.5px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; flex: none; }
.row .icon { color: var(--muted); flex: none; }
.via { display: inline-block; margin-left: 7px; padding: 1px 7px 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); font-size: 11px; font-weight: 400; color: var(--muted); vertical-align: 1px; white-space: nowrap; }
.sync-row { align-items: center; }
.sync-row .row-main small { white-space: normal; line-height: 1.4; }
.sync-row .dot { align-self: flex-start; margin-top: 7px; }
.sync-row .iconbtn { width: 36px; height: 36px; background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.sync-row .iconbtn:disabled { opacity: 0.5; }
.star-on { color: #ffd166; flex: none; }
.star-on .icon { color: #ffd166; }

.timeline { display: flex; flex-direction: column; background: var(--card-grad); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); border-radius: 20px; padding: 4px 14px; }
.tl-row { display: grid; grid-template-columns: 50px 14px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-time { font-size: 15px; font-weight: 600; display: flex; flex-direction: column; line-height: 1.2; }
.tl-time small { font-size: 12px; color: var(--dim); font-weight: 400; }
.tl-line { display: flex; justify-content: center; }
.tl-line i { width: 8px; height: 8px; border-radius: 50%; background: #52525b; }
.tl-row.live .tl-line i { position: relative; background: var(--ok); }
.tl-body { min-width: 0; display: flex; flex-direction: column; }
.tl-body b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-body small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-row.past { opacity: 0.45; }
.tl-row.cancelled b { text-decoration: line-through; color: var(--muted); }

.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.file-tile { flex: 0 0 148px; height: 148px; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; text-align: left; padding: 12px; border-radius: 20px; background: var(--card-grad); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.file-tile:active { transform: scale(0.97); }
.file-tile-name { font-size: 14px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-tile-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.filebadge { width: 40px; height: 48px; border-radius: 10px; flex: none; display: grid; place-items: center; position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 20%, #1a1a1f), #141418); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.filebadge::after { content: ""; position: absolute; top: -1px; right: -1px; width: 11px; height: 11px; background: linear-gradient(225deg, var(--bg) 50%, color-mix(in srgb, var(--c) 45%, #222) 50%); border-top-right-radius: 10px; }
.filebadge span { font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; color: var(--c); }

/* ---------- файлы ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--card-grad); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font-size: 16px; }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar .clear { color: var(--muted); display: grid; place-items: center; width: 30px; height: 30px; }
.filegroups { margin-top: 4px; }
.filegroup-title { margin: 20px 2px 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.sortnote { display: flex; align-items: center; gap: 6px; margin: 12px 2px 0; font-size: 12.5px; color: var(--dim); }
.folder-head { position: relative; overflow: hidden; border-radius: 22px; padding: 18px; min-height: 124px; margin: 6px 0 14px; border: 1px solid rgba(255, 255, 255, 0.07);
  background: radial-gradient(100% 140% at 100% 100%, var(--h1) 0%, transparent 65%), linear-gradient(150deg, #19191e, #121216); }
.folder-head-text { position: relative; z-index: 1; max-width: calc(100% - 100px); }
.folder-art { position: absolute; right: 6px; bottom: -6px; width: 92px; height: 92px; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.55)); }

/* ---------- шторка ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0); transition: background 0.22s ease; }
.sheet-wrap.open { background: rgba(0, 0, 0, 0.55); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; max-width: 640px; margin: 0 auto;
  background: #121215; border: 1px solid rgba(255, 255, 255, 0.08); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 6px 16px calc(var(--safe-bottom) + 20px);
  transform: translateY(100%); transition: transform 0.3s var(--ease); }
.sheet-wrap.open .sheet { transform: translateY(0); }
.sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); margin: 6px auto 12px; }
.sheet-title { font-size: 19px; font-weight: 600; margin: 0 2px 12px; }
.filehead { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.filehead-name { font-size: 17px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; word-break: break-word; }
.actions-row { display: flex; gap: 10px; }
.actions-row.two > * { flex: 1; }
.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); font-size: 12px; color: #e4e4e7; }
.action:active { transform: scale(0.96); }
.action.on { color: #ffd166; }
.action.danger { color: #ff8a8a; }
.move-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.notes { margin-top: 18px; }
.notes-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); margin-bottom: 6px; white-space: pre-wrap; user-select: text; }
.note span { flex: 1; }
.note-del { color: var(--muted); }
.note-input { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
textarea { width: 100%; resize: none; border-radius: 14px; background: var(--field); border: 1px solid rgba(255, 255, 255, 0.08); color: #fff; padding: 11px 13px; font-size: 16px; outline: none; }
textarea:focus { border-color: rgba(255, 255, 255, 0.35); }
.dropzone { width: 100%; height: 112px; border-radius: 18px; border: 1.5px dashed rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #e4e4e7; padding: 0 12px; text-align: center; word-break: break-word; }
.pick-subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.pick { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid transparent; font-size: 13px; text-align: left; transition: border-color 0.2s, background 0.2s; }
.pick.on { border-color: var(--sel); background: rgba(230, 222, 255, 0.08); box-shadow: 0 0 14px rgba(176, 150, 255, 0.2); }
.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); flex: none; }
.kv b { font-weight: 500; text-align: right; }
.devcode { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0; padding: 18px; border-radius: 18px; background: var(--field); border: 1px dashed rgba(255, 255, 255, 0.22); font-size: 30px; font-weight: 700; letter-spacing: 4px; color: #fff; }

/* ---------- расписание ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); flex: none; }
.seg button { padding: 7px 13px; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 500; transition: background 0.2s, color 0.2s; }
.seg button { position: relative; z-index: 1; }
.seg button.on { background: #fff; color: #09090b; }
.seg.slide button.on { background: transparent; }
.seg-ind { position: absolute; top: 3px; bottom: 3px; left: 0; z-index: 0; border-radius: 9px; background: #fff; pointer-events: none; transition: transform 0.38s var(--ease), width 0.38s var(--ease), background-color 0.3s var(--ease); }
.seg-ind.tone-ok { background: #86e7a9; }
.seg-ind.tone-bad { background: #ff8a8a; }
.seg-ind.tone-warn { background: #f7c488; }
.seg.small button { padding: 5px 10px; }
.weekbar { display: flex; align-items: center; gap: 6px; }
.weekarrow { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); flex: none; color: var(--muted); }
.days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.daypill { display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; border-radius: 14px; border: 1px solid transparent; transition: background 0.2s; }
.daypill span { font-size: 11px; color: var(--muted); }
.daypill b { font-size: 17px; font-weight: 600; }
.daypill i { width: 4px; height: 4px; border-radius: 50%; margin-top: 4px; background: transparent; }
.daypill i.has { background: rgba(255, 255, 255, 0.55); }
.daypill.today { border-color: rgba(255, 255, 255, 0.2); }
.daypill.on { background: #fff; }
.daypill.on span, .daypill.on b { color: #09090b; }
.daypill.on i.has { background: #09090b; }
.today-link { display: block; margin: 10px auto 0; color: var(--muted); font-size: 13px; padding: 6px 10px; }
.lessons { margin-top: 14px; }
.lesson { position: relative; overflow: hidden; display: flex; gap: 14px; width: 100%; text-align: left; padding: 14px 14px 14px 16px; margin-bottom: 10px; border-radius: 20px; background: var(--card-grad); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); transition: transform 0.1s, opacity 0.2s; }
.lesson::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ha); }
.lesson:active { transform: scale(0.985); }
.lesson-time { display: flex; flex-direction: column; min-width: 46px; line-height: 1.25; }
.lesson-time b { font-size: 16px; font-weight: 600; }
.lesson-time span { font-size: 12.5px; color: var(--dim); }
.lesson-body { flex: 1; min-width: 0; padding-right: 58px; }
.lesson-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson-type { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.lesson-title { font-size: 17px; font-weight: 600; margin: 4px 0 4px; line-height: 1.25; }
.lesson-meta { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.lesson-meta .icon { color: var(--dim); }
.lesson-meta .sep { width: 4px; }
.lesson-reason { margin-top: 6px; font-size: 12.5px; color: #ffcf8a; }
.lesson-art { position: absolute; right: 10px; top: 12px; width: 46px; height: 46px; opacity: 0.95; }
.lesson.past { opacity: 0.5; }
.lesson.cancelled .lesson-title { text-decoration: line-through; color: var(--muted); }
.lesson.cancelled .lesson-reason { color: #ff8a8a; }
.lesson.live { border-color: rgba(95, 211, 138, 0.35); box-shadow: 0 0 0 1px rgba(95, 211, 138, 0.12), 0 10px 34px rgba(95, 211, 138, 0.08); }

/* ---------- задания ---------- */
.deadline { gap: 12px; }
.deadline-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--ha); flex: none; }
.deadline-left { font-size: 13px; font-weight: 600; color: var(--muted); flex: none; text-align: right; }
.u-overdue .deadline-left { color: var(--bad); }
.u-critical .deadline-left { color: #ff8a8a; }
.u-soon .deadline-left { color: var(--warn); }

/* ---------- профиль, почта ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 10px; border-radius: 22px; background: var(--card-grad); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #111; background: linear-gradient(135deg, #f3edff, #b8a6ff); flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.integ .art { flex: none; }
.switch-row { cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: #3f3f46; position: relative; flex: none; transition: background 0.25s var(--ease); cursor: pointer; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.32s var(--ease), width 0.2s var(--ease); }
.switch:active::after { width: 26px; }
.switch:checked:active::after { transform: translateX(18px); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.about { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 30px 10px 10px; }
.letter-head { margin: 10px 0 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.letter-head .title { font-size: 24px; }
.letter-body { white-space: pre-wrap; user-select: text; line-height: 1.55; word-break: break-word; }
.reply { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.draft .draft-body { margin: 8px 0 12px; white-space: pre-wrap; }

/* ---------- нижняя панель ---------- */
.tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-bottom) + 10px); z-index: 40; max-width: 616px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px; border-radius: 24px; background: rgba(20, 20, 25, 0.84); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--edge); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 6px; border-radius: 17px; color: #6b6b74; font-size: 10.5px; font-weight: 500; letter-spacing: 0.1px; transition: color 0.2s var(--ease), background 0.25s var(--ease); position: relative; }
.tab:active { transform: scale(0.94); }
.tab.on { color: #fff; background: rgba(255, 255, 255, 0.075); }
.tab.on .icon { filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.28)); }
.tabbar { transition: transform 0.28s var(--ease), opacity 0.2s var(--ease); }
.tabbar.is-hidden { transform: translateY(calc(100% + 28px)); opacity: 0; pointer-events: none; }

/* ---------- тосты, скелетоны, пустые ---------- */
.toasts { position: fixed; top: calc(var(--safe-top) + 10px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 14px; border-radius: 14px; background: rgba(28, 28, 34, 0.96); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: toast-in 0.28s var(--ease); backdrop-filter: blur(12px); }
.toast-ok { border-color: rgba(95, 211, 138, 0.45); }
.toast-error { border-color: rgba(255, 92, 92, 0.55); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
/* Мерцание — transform у псевдоэлемента, фон не перерисовывается */
.skeleton { position: relative; overflow: hidden; background: #141418; isolation: isolate; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent); transform: translateX(-100%); animation: shimmer 1.4s var(--ease) infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 16px; gap: 6px; }
.empty-title { font-size: 17px; font-weight: 600; margin-top: 8px; }
.empty-text { color: var(--muted); font-size: 14px; max-width: 320px; margin-bottom: 8px; }
.art { object-fit: contain; opacity: 0; transition: opacity 0.25s ease; }
.art.loaded { opacity: 1; }
.integ .row-main small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.integ .row-main b { white-space: normal; }
.logo { display: block; }

/* =====================================================================
   Учебные функции: режимы пары, окна и переходы, баллы и допуск, посещаемость,
   конспекты, радар сроков, офлайн. Кривая — cubic-bezier(0.22, 1, 0.36, 1), 180–320 мс;
   анимируются в основном transform и opacity.
   ===================================================================== */
:root { --ease: cubic-bezier(0.22, 1, 0.36, 1); --amber: #f0a85c; --violet: #b096ff; }

button:active:not(:disabled) { transition-duration: 0.12s; }
.phase-in { animation: phase-in 0.3s var(--ease) both; }
@keyframes phase-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rise { animation: phase-in 0.24s var(--ease) both; }
.hero-progress i { transform-origin: left center; width: 100%; transition: transform 1s linear; }

/* ---------- кнопки-иконки, поля ---------- */
.round-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); transition: transform 0.18s var(--ease), background 0.2s; }
.round-btn:active { transform: scale(0.92); }
.round-btn.add { background: #fff; color: #09090b; border-color: #fff; }
.iconbtn.tiny { width: 28px; height: 28px; }
.textlink.inline { padding: 8px 2px; font-size: 13.5px; color: var(--muted); text-align: left; }
.field-plain { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-plain > span { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.field-plain input, .field-plain textarea, .composer textarea, .time-input {
  width: 100%; min-width: 0; background: var(--field); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; color: #fff; padding: 12px 14px; font-size: 16px; outline: none; resize: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); color-scheme: dark;
}
.field-plain input:focus, .field-plain textarea:focus, .composer textarea:focus, .time-input:focus { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-glow); }
.field-row { display: flex; align-items: center; gap: 8px; }
.field-row em { font-style: normal; color: var(--muted); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.field-error { color: #ff8a8a; font-size: 13px; }
.time-input { width: auto; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.quiet-row { gap: 10px; }
.note-under { margin: 10px 2px 12px; }

/* ---------- шапка с «назад» ---------- */
.backbar { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.backbar-text { min-width: 0; }
.backbar-text .title { margin: 0; font-size: 22px; line-height: 1.2; }
.small-title { font-size: 20px; }

/* ---------- чипы режимов ---------- */
.chip-review { background: rgba(176, 150, 255, 0.16); color: #cdbdff; }
.chip-changed { background: rgba(240, 168, 92, 0.15); color: #f7c488; }
.hero-link { display: block; width: 100%; text-align: left; position: relative; z-index: 1; }
.hero-link .hero-sub { display: block; }
.hero-change { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 9px; border-radius: 10px; font-size: 12.5px; background: rgba(240, 168, 92, 0.14); color: #f7c488; }
.hero.phase-review { box-shadow: 0 0 0 1px rgba(176, 150, 255, 0.35), 0 0 34px rgba(176, 150, 255, 0.16); transition: box-shadow 0.3s var(--ease); }
.hero.phase-live { box-shadow: 0 0 0 1px rgba(95, 211, 138, 0.32), 0 0 34px rgba(95, 211, 138, 0.12); }
.hero-mode { position: relative; z-index: 1; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.mode-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #d8cfff; }
.mode-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mode-notes li { position: relative; padding: 8px 12px 8px 26px; border-radius: 12px; background: rgba(0, 0, 0, 0.32); border: 1px solid rgba(255, 255, 255, 0.07); font-size: 13.5px; line-height: 1.35; }
.mode-notes li::before { content: ""; position: absolute; left: 11px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }
.mode-notes li.more { color: var(--muted); }
.mode-notes li.more::before { display: none; }
.mode-empty, .mode-hint { font-size: 13px; color: var(--muted); line-height: 1.4; }
.mode-hint { text-align: center; }
.mode-done { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #86e7a9; }
.hero-mode .actions-row .btn:not(.full) { flex: none; }

/* ---------- таймлайн: пары — кнопки, окна — компактные вставки ---------- */
button.tl-row { width: 100%; text-align: left; transition: opacity 0.2s, transform 0.12s var(--ease); }
button.tl-row:active { transform: scale(0.99); }
.tl-end { display: inline-flex; align-items: center; gap: 6px; }
.tl-end .icon { color: var(--muted); }

.gap { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px 8px 12px; margin: 2px 0; border-radius: 12px; color: var(--muted); transition: background 0.2s, transform 0.12s var(--ease); }
.gap:active { transform: scale(0.99); background: rgba(255, 255, 255, 0.04); }
.gap-rail { position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.1); }
.gap-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.06); }
.gap-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }
.gap-head { display: flex; align-items: center; gap: 8px; color: #d4d4d8; }
.gap-head b { font-weight: 500; }
.gap-head em { font-style: normal; font-size: 11px; color: #f7c488; }
.gap-text { line-height: 1.35; }
.gap-note { display: flex; align-items: center; gap: 5px; color: #cdbdff; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap.long .gap-rail { background: linear-gradient(rgba(176, 150, 255, 0.5), rgba(176, 150, 255, 0.1)); }
.gap.long .gap-ico { background: rgba(176, 150, 255, 0.14); color: #cdbdff; }
.gap.warn .gap-rail { background: var(--amber); }
.gap.warn .gap-ico { background: rgba(240, 168, 92, 0.16); color: #f7c488; }
.gap.bad .gap-rail { background: var(--bad); }
.gap.bad .gap-ico { background: rgba(255, 92, 92, 0.15); color: #ff8a8a; }
.lessons > .gap, .gaps-stack .gap { background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(255, 255, 255, 0.1); margin: -2px 0 10px; }
.gaps-stack { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.timeline .gap { border-radius: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 7px 4px 7px 8px; }

/* ---------- расписание ---------- */
.att-mini { display: inline-grid; place-items: center; }
.att-mini.st-present { color: var(--ok); }
.att-mini.st-absent { color: var(--bad); }
.att-mini.st-excused { color: var(--warn); }

/* ---------- экран пары ---------- */
.phase-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(120% 140% at 100% 0%, var(--h1, #2a2a33) 0%, transparent 70%), var(--card); animation: phase-in 0.3s var(--ease) both; }
.phase-card b { display: block; font-size: 17px; font-weight: 600; }
.phase-card small { color: var(--muted); font-size: 13px; }
.phase-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.08); }
.phase-art { position: static; flex: none; margin-left: auto; pointer-events: none; opacity: 0.92; }
.phase-card > div:not(.phase-ico):not(.phase-art) { flex: 1; min-width: 0; }
.phase-review { box-shadow: 0 0 0 1px rgba(176, 150, 255, 0.35), 0 0 28px rgba(176, 150, 255, 0.14); }
.phase-review .phase-ico { background: rgba(176, 150, 255, 0.2); color: #d8cfff; }
.phase-live { box-shadow: 0 0 0 1px rgba(95, 211, 138, 0.32); }
.phase-live .phase-ico { background: rgba(95, 211, 138, 0.18); color: #86e7a9; }
.phase-cancelled .phase-ico { background: rgba(255, 92, 92, 0.16); color: #ff8a8a; }
.banner.bad { background: rgba(255, 92, 92, 0.1); border-color: rgba(255, 92, 92, 0.26); color: #ffb0b0; }
.lesson-page .banner.static { margin: 12px 0 0; }
.att-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.att-line { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 13px; color: var(--muted); }
.att-line span { flex: 1; }
.att-line.tone-last, .att-line.tone-limit { color: #f7c488; background: rgba(240, 168, 92, 0.1); }
.att-line.tone-exceeded { color: #ffb0b0; background: rgba(255, 92, 92, 0.1); }
.row.file-row.primary { border-color: var(--sel); box-shadow: inset 0 0 0 1px var(--sel), 0 0 22px var(--sel-glow); }

/* ---------- переключатель режимов ---------- */
.seg { position: relative; }
.seg button { display: inline-flex; align-items: center; gap: 6px; transition: background 0.22s var(--ease), color 0.22s var(--ease), transform 0.12s var(--ease); }
.seg button:disabled { opacity: 0.35; }
.seg button:active:not(:disabled) { transform: scale(0.96); }
.seg button.on.tone-ok { background: #86e7a9; color: #06210f; }
.seg.slide button.on.tone-ok { background: transparent; }
.seg button.on.tone-bad { background: #ff8a8a; color: #2a0707; }
.seg.slide button.on.tone-bad { background: transparent; }
.seg button.on.tone-warn { background: #f7c488; color: #2a1704; }
.seg.slide button.on.tone-warn { background: transparent; }
.att-card .seg { width: 100%; }
.att-card .seg button { flex: 1; justify-content: center; }

/* ---------- конспекты ---------- */
.composer { display: flex; flex-direction: column; gap: 10px; }
.composer-photo { position: relative; width: 120px; }
.composer-photo img { width: 120px; height: 120px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line-2); }
.composer-photo .iconbtn { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, 0.6); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.photo-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-2); font-size: 14px; transition: transform 0.12s var(--ease), background 0.2s; }
.photo-btn:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.12); }
.notes { display: flex; flex-direction: column; gap: 8px; }
.note { padding: 12px 14px; border-radius: 16px; background: var(--card-grad); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); animation: phase-in 0.24s var(--ease) backwards; transition: opacity 0.22s var(--ease), transform 0.22s var(--ease); }
.note.leaving { opacity: 0; transform: translateX(-16px) scale(0.98); }
.note.pending { border-style: dashed; border-color: rgba(240, 168, 92, 0.4); }
.note header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.note p { margin: 0; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.note-photo { display: block; margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); }
.note-photo img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.photo-viewer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0, 0, 0, 0.92); animation: phase-in 0.2s var(--ease) both; }
.photo-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-close { position: absolute; top: calc(var(--safe-top) + 14px); right: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); }

/* ---------- карточка предмета ---------- */
.subject-hero { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 4px; border-radius: 20px; border: 1px solid var(--line);
  background: radial-gradient(110% 140% at 100% 100%, var(--h1) 0%, transparent 68%), var(--card); }
.subject-hero b { display: block; font-size: 15px; font-weight: 600; }
.subject-hero small { font-size: 12.5px; }
.block { display: flex; flex-direction: column; gap: 12px; }
.block-top { display: flex; align-items: center; gap: 12px; }
.block-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(176, 150, 255, 0.14); color: #cdbdff; flex: none; }
.big-num { flex: 1; font-size: 15px; color: var(--muted); }
.big-num b { font-size: 28px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.meter { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.09); overflow: visible; }
.meter-fill { position: absolute; inset: 0; border-radius: 5px; background: linear-gradient(90deg, #8d74ff, #cdbdff); transform-origin: left center; transition: transform 0.6s var(--ease); }
.meter.tone-ok .meter-fill { background: linear-gradient(90deg, #3fbf70, #86e7a9); }
.meter.tone-warn .meter-fill { background: linear-gradient(90deg, #d99a3d, #f7c488); }
.meter.tone-bad .meter-fill { background: linear-gradient(90deg, #e04b4b, #ff8a8a); }
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: #fff; }
.meter-mark.target { background: var(--amber); }
.goal { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #d4d4d8; line-height: 1.4; }
.goal.ok { color: #86e7a9; }
.goal.bad { color: #ff8a8a; }
.goal b { color: #fff; }
.block .banner.static { margin: 0; }
.items { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); text-align: left; width: 100%; transition: background 0.2s; }
.item:active { background: rgba(255, 255, 255, 0.04); }
.item-main { display: flex; flex-direction: column; min-width: 0; }
.item-main b { font-weight: 500; font-size: 14.5px; }
.item-main small { color: var(--muted); font-size: 12px; }
.item-score { font-size: 17px; font-weight: 600; white-space: nowrap; }
.item-score small { font-size: 12px; color: var(--muted); font-weight: 400; }
.item-score.planned { color: var(--dim); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { padding: 10px 6px; border-radius: 14px; text-align: center; background: rgba(255, 255, 255, 0.05); }
.stat b { display: block; font-size: 22px; font-weight: 700; }
.stat small { font-size: 11.5px; color: var(--muted); }
.stat.tone-ok b { color: #86e7a9; }
.stat.tone-bad b { color: #ff8a8a; }
.stat.tone-warn b { color: #f7c488; }
.limit { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
.limit b { display: block; font-size: 14px; font-weight: 600; }
.limit small { color: var(--muted); font-size: 12.5px; }
.limit-dots { display: flex; flex-wrap: wrap; gap: 5px; max-width: 110px; align-items: center; }
.limit-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); transition: background 0.3s var(--ease), border-color 0.3s var(--ease); }
.limit-dots i.used { background: #ff8a8a; border-color: #ff8a8a; }
.limit.tone-last { background: rgba(240, 168, 92, 0.12); }
.limit.tone-limit { background: rgba(240, 168, 92, 0.16); }
.limit.tone-exceeded { background: rgba(255, 92, 92, 0.14); }
.att-list { display: flex; flex-direction: column; }
.att-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.att-row-main { flex: 1; display: flex; flex-direction: column; }
.att-row-main b { font-weight: 500; font-size: 14.5px; }
.att-row-main small { color: var(--muted); font-size: 12px; }
.att-row-state { font-size: 12.5px; color: var(--muted); }
.att-row.st-present .icon { color: var(--ok); }
.att-row.st-absent .icon { color: var(--bad); }
.att-row.st-excused .icon { color: var(--warn); }

/* ---------- радар сроков ---------- */
.row.deadline { padding: 0; overflow: hidden; align-items: stretch; }
.deadline-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 4px; text-align: left; }
.row.deadline > .deadline-bar { margin: 12px 0 12px 14px; }
.check { width: 44px; flex: none; display: grid; place-items: center; }
.check::before { content: ""; position: absolute; }
.check { position: relative; }
.check .icon { position: relative; width: 24px; height: 24px; padding: 4px; border-radius: 50%; border: 1.6px solid rgba(255, 255, 255, 0.3); color: transparent; transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s, transform 0.2s var(--ease); }
.check.on .icon { background: var(--ok); border-color: var(--ok); color: #06210f; }
.check:active .icon { transform: scale(0.88); }
.row.deadline.done .row-main b { text-decoration: line-through; color: var(--muted); }
.row.deadline.done { opacity: 0.6; }
.toggle-title { display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.context { margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid var(--violet); border-radius: 0 12px 12px 0; background: rgba(255, 255, 255, 0.04); font-size: 14px; line-height: 1.45; color: #d4d4d8; }
.context small { display: block; color: var(--muted); margin-bottom: 2px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- офлайн ---------- */
.offline-pill { position: fixed; z-index: 55; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 18px); max-width: calc(100% - 24px); display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(40, 30, 14, 0.92); border: 1px solid rgba(240, 168, 92, 0.4); color: #f7c488; animation: phase-in 0.24s var(--ease) both; }
.subject-link { margin-bottom: 4px; }

@media (min-width: 560px) {
  .grid2 { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* карточка пары: кнопки режима в столбик, название не под иллюстрацией */
.hero-link .hero-title { display: block; }
.hero-mode .actions-row { flex-direction: column; }
.hero-mode .actions-row .btn { width: 100%; }

.app.with-tabs .offline-pill { bottom: calc(var(--safe-bottom) + 96px); }

/* =====================================================================
   Движение: каждое действие. Одна кривая (--ease), 180–420 мс; только transform и opacity.
   prefers-reduced-motion отключает всё правилом выше.
   ===================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* Списки появляются по очереди (38 мс между элементами). backwards: после появления transform не мешает нажатию */
.list > *, .lessons > *, .grid2 > *, .items > *, .att-list > *, .timeline > *, .move-list > *, .sheet-body > *, .filegroups > *, .stats > *, .pick-subjects > * {
  animation: rise 0.42s var(--ease) backwards;
}
.list > :nth-child(2), .lessons > :nth-child(2), .grid2 > :nth-child(2), .items > :nth-child(2), .att-list > :nth-child(2), .timeline > :nth-child(2), .move-list > :nth-child(2), .sheet-body > :nth-child(2), .filegroups > :nth-child(2), .stats > :nth-child(2), .pick-subjects > :nth-child(2) { animation-delay: 38ms; }
.list > :nth-child(3), .lessons > :nth-child(3), .grid2 > :nth-child(3), .items > :nth-child(3), .att-list > :nth-child(3), .timeline > :nth-child(3), .move-list > :nth-child(3), .sheet-body > :nth-child(3), .filegroups > :nth-child(3), .stats > :nth-child(3), .pick-subjects > :nth-child(3) { animation-delay: 76ms; }
.list > :nth-child(4), .lessons > :nth-child(4), .grid2 > :nth-child(4), .items > :nth-child(4), .att-list > :nth-child(4), .timeline > :nth-child(4), .move-list > :nth-child(4), .sheet-body > :nth-child(4), .filegroups > :nth-child(4), .stats > :nth-child(4), .pick-subjects > :nth-child(4) { animation-delay: 114ms; }
.list > :nth-child(5), .lessons > :nth-child(5), .grid2 > :nth-child(5), .items > :nth-child(5), .att-list > :nth-child(5), .timeline > :nth-child(5), .move-list > :nth-child(5), .sheet-body > :nth-child(5), .filegroups > :nth-child(5), .stats > :nth-child(5), .pick-subjects > :nth-child(5) { animation-delay: 152ms; }
.list > :nth-child(n+6), .lessons > :nth-child(n+6), .grid2 > :nth-child(n+6), .items > :nth-child(n+6), .att-list > :nth-child(n+6), .timeline > :nth-child(n+6), .move-list > :nth-child(n+6), .sheet-body > :nth-child(n+6), .filegroups > :nth-child(n+6), .stats > :nth-child(n+6), .pick-subjects > :nth-child(n+6) { animation-delay: 190ms; }

/* Нажатие: все интерактивные карточки и строки отвечают одинаково */
.row, .chip, .action, .iconbtn, .round-btn, .pick, .att-line, .item, .gap, .photo-btn, .weekarrow, .daypill, .subject-card, .file-tile, .tl-row, .lesson, .seg button, .tab {
  transition-property: transform, background-color, border-color, color, box-shadow, opacity;
  transition-duration: 0.22s;
  transition-timing-function: var(--ease);
}
.row:active, .chip.toggle:active, .action:active, .iconbtn:active, .round-btn:active, .pick:active, .att-line:active, .item:active, .gap:active, .photo-btn:active, .weekarrow:active, .daypill:active, .subject-card:active, .file-tile:active, .lesson:active, .tl-row:active, .seg button:active:not(:disabled) { transform: scale(0.97); }
.check.on .icon { animation: pop 0.38s var(--ease); }
.row.deadline.done { transition: opacity 0.3s var(--ease); }

/* Подписи в кнопках сменяются плавно: «Сохранить» → точки → текст */
.btn > span, .dots { animation: phase-in 0.24s var(--ease) backwards; }

/* Плашка тоста уходит, а не пропадает */
.toast { transition: opacity 0.24s var(--ease), transform 0.24s var(--ease); }
.toast.out { opacity: 0; transform: translateY(-8px) scale(0.98); }

/* Клавиатурный фокус видно, мышь и касание — без рамки */
:focus-visible { outline: 2px solid var(--sel-glow); outline-offset: 2px; }
button:focus:not(:focus-visible), textarea:focus:not(:focus-visible) { outline: none; }

/* =====================================================================
   Успеваемость: GPA, графики, калькулятор, симулятор, список компонентов, веса курса.
   Графики анимируются transform (шкалы) и opacity; подсказки — без перерисовки всей страницы.
   ===================================================================== */
.grades-hero { display: flex; flex-direction: column; gap: 14px; padding: 18px; margin-top: 8px; border-radius: 22px; background: radial-gradient(120% 120% at 100% 0%, rgba(176, 150, 255, 0.22), transparent 62%), var(--card-grad); border: 1px solid var(--edge); }
.gh-num { font-size: 40px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.05; margin: 4px 0 2px; }
.gh-stats { grid-template-columns: repeat(3, 1fr); }
.gh-stats .stat { background: rgba(255, 255, 255, 0.04); }

.chart-card { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.chart-card .seg { align-self: flex-start; }
.bars { display: flex; flex-direction: column; gap: 6px; position: relative; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 1.1fr) auto; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; text-align: left; transition: background 0.22s var(--ease); }
.bar-row:hover, .bar-row.on { background: rgba(255, 255, 255, 0.04); }
.bar-label { display: flex; flex-direction: column; min-width: 0; }
.bar-label b { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-label small { font-size: 11.5px; }
.bar-track { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar-max, .bar-fill { position: absolute; inset: 0; border-radius: 5px; transform-origin: left center; }
.bar-max { background: rgba(255, 255, 255, 0.16); transition: transform 0.6s var(--ease); }
.bar-fill { transition: transform 0.6s var(--ease); }
.bar-val { font-size: 13px; font-weight: 600; min-width: 34px; text-align: right; }
.bar-legend { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding-left: 10px; }
.sw { display: inline-block; width: 12px; height: 6px; border-radius: 3px; }
.sw.fill { background: var(--sel); }
.sw.max { background: rgba(255, 255, 255, 0.16); margin-left: 6px; }
.chart-tip { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border-radius: 14px; background: rgba(28, 28, 34, 0.96); border: 1px solid var(--line-2); font-size: 13px; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.7); }
.chart-tip b { font-weight: 600; }
.chart-tip span { color: #d4d4d8; }
.chart-empty { padding: 26px 8px; text-align: center; }

.tl-wrap { position: relative; }
.tl-svg { display: block; width: 100%; height: auto; overflow: visible; }
.tl-svg .grid { stroke: rgba(255, 255, 255, 0.09); stroke-width: 1; }
.tl-svg .axis { fill: #71717a; font-size: 10px; font-family: var(--sans); }
.tl-svg .trend { fill: none; stroke-width: 1.6; opacity: 0.7; stroke-linejoin: round; stroke-linecap: round; }
.tl-svg .pt circle:first-of-type { transition: r 0.2s var(--ease); }
.tl-svg .pt { cursor: pointer; }
.tl-svg .pt:active circle:first-of-type { r: 6; }
.tl-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); max-width: 240px; pointer-events: none; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.tl-key { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.tl-key i { width: 8px; height: 8px; border-radius: 50%; }

.calc { display: flex; flex-direction: column; gap: 4px; padding: 6px 14px 14px; }
.calc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.calc-row:last-of-type { border-bottom: 0; }
.calc-main { display: flex; flex-direction: column; min-width: 0; }
.calc-main b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-main small { font-size: 12px; }
.calc-contrib { min-width: 40px; text-align: right; font-size: 14px; font-weight: 600; }
.grade-select, .scale-row select { appearance: none; -webkit-appearance: none; height: 38px; padding: 0 30px 0 12px; border-radius: 12px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; border: 1px solid rgba(255, 255, 255, 0.08); color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; color-scheme: dark; min-width: 96px; }
.calc-sum { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.calc-sum > div { display: flex; flex-direction: column; gap: 2px; }
.calc-sum b { font-size: 20px; font-weight: 700; }

.sim { display: flex; flex-direction: column; gap: 12px; }
.sim-input { display: flex; align-items: flex-end; gap: 10px; }
.sim-field { flex: 1; }
.sim-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(176, 150, 255, 0.1); font-size: 13.5px; line-height: 1.45; }
.sim-note .icon { margin-top: 1px; flex: none; color: #cdbdff; }
.sim-note.ok { background: rgba(95, 211, 138, 0.1); }
.sim-note.ok .icon { color: #86e7a9; }
.sim-note.bad { background: rgba(255, 92, 92, 0.1); }
.sim-note.bad .icon { color: #ff8a8a; }
.sim-need { display: flex; flex-direction: column; align-items: flex-end; font-size: 16px; font-weight: 700; }
.sim-need small { font-size: 11px; font-weight: 400; color: var(--muted); }
.sim-need.hard { color: #f7c488; }
.sim-need.impossible { color: #ff8a8a; }
.sim-need.ok { color: #86e7a9; }

.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex: none; }
.grade-list .item-score small { font-size: 11px; color: var(--ok); margin-left: 4px; }

.scale-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.scale-row input { height: 42px; border-radius: 12px; background: var(--field); border: 1px solid rgba(255, 255, 255, 0.08); color: #fff; padding: 0 12px; font-size: 16px; font-variant-numeric: tabular-nums; outline: none; min-width: 0; }
.scale-row input:focus { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-glow); }
.scale-row select { width: 100%; }

.weight-row { display: grid; grid-template-columns: minmax(0, 1fr) 74px 36px; align-items: center; gap: 8px; }
.weight-row input { height: 42px; border-radius: 12px; background: var(--field); border: 1px solid rgba(255, 255, 255, 0.08); color: #fff; padding: 0 12px; font-size: 16px; outline: none; min-width: 0; font-variant-numeric: tabular-nums; }
.weight-row input:focus { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-glow); }
.sum-line { font-size: 14px; color: #d4d4d8; padding: 2px 2px 0; }
.sum-line.bad { color: #ffb0b0; }
.two-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.daily-row { margin: 12px 0 4px; }
.works-list { margin-top: 10px; }
.czech { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 2px; border-top: 1px solid var(--line); margin-top: 12px; }
.czech-val { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.czech-val b { font-size: 22px; font-weight: 700; }
.czech .chips-wrap { gap: 6px; }
.czech .chip { padding: 6px 10px; }
.date-input { width: 100%; min-width: 0; background: var(--field); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; color: #fff; padding: 12px 14px; font-size: 16px; outline: none; color-scheme: dark; }
.date-input:focus { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-glow); }

/* Работы внутри компонентов: каждый вид работы — группа с весом, под ним — оценки по работам */
.groups { display: flex; flex-direction: column; margin-top: 10px; }
.comp-group { display: flex; flex-direction: column; padding: 4px 0 8px; border-top: 1px solid var(--line); }
.comp-group:first-child { border-top: 0; }
.comp-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 2px 6px; text-align: left; transition: background 0.2s var(--ease); }
.comp-head:active { background: rgba(255, 255, 255, 0.04); }
.comp-head.static { cursor: default; }
.comp-head .item-main b { font-size: 14.5px; font-weight: 600; }
.comp-head .item-main small { font-size: 12px; }
.work-row { padding: 8px 2px 8px 16px; border-top: 0; }
.work-row .item-main b { font-weight: 500; font-size: 14px; }
