@font-face { font-family: 'e-Ukraine'; font-weight: 400; font-display: swap; src: url(/fonts/e-ukraine-400.woff2) format('woff2'); }
@font-face { font-family: 'e-Ukraine'; font-weight: 600; font-display: swap; src: url(/fonts/e-ukraine-600.woff2) format('woff2'); }
@font-face { font-family: 'e-Ukraine'; font-weight: 700; font-display: swap; src: url(/fonts/e-ukraine-700.woff2) format('woff2'); }


:root {
  --bg: #020617; --card: rgba(30, 41, 59, .62); --ink: #f1f5f9; --muted: #94a3b8; --line: rgba(255, 255, 255, .08);
  --primary: #6366f1; --primary-d: #4f46e5; --primary-ink: #a5b4fc; --primary-soft: rgba(99, 102, 241, .15);
  --grad: linear-gradient(to top right, #4f46e5, #8b5cf6);
  --amber: #fcd34d; --amber-ln: rgba(245, 158, 11, .4); --amber-bg: rgba(69, 26, 3, .18);
  --rose: #fda4af; --rose-ln: rgba(244, 63, 94, .4); --rose-bg: rgba(76, 5, 25, .18);
  --violet: #c4b5fd; --violet-ln: rgba(139, 92, 246, .4); --violet-bg: rgba(46, 16, 101, .22);
  --green: #4ade80;
  --r: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; overflow-x: hidden; }
body {
  color: var(--ink); font: 400 15px/1.4 'e-Ukraine', system-ui, sans-serif;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative;
}
/* м'які сяйва на тлі */
body::before, body::after {
  content: ''; position: fixed; inset: -14%; z-index: -1; pointer-events: none; will-change: transform;
  animation: drift 50s ease-in-out infinite alternate;
}
body::after {
  background: radial-gradient(520px 380px at 80% 70%, rgba(124, 58, 237, .13), transparent 70%), radial-gradient(480px 360px at 8% 55%, rgba(79, 70, 229, .12), transparent 70%);
  animation-duration: 60s; animation-direction: alternate-reverse;
}
body::before {
  background:
    radial-gradient(620px 420px at 12% -6%, rgba(79, 70, 229, .34), transparent 70%),
    radial-gradient(560px 400px at 92% 2%, rgba(139, 92, 246, .26), transparent 70%),
    radial-gradient(700px 500px at 50% 108%, rgba(67, 56, 202, .16), transparent 70%);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; transition: transform .12s ease, background-color .15s, border-color .15s, color .15s; }
button:active:not(:disabled) { transform: scale(.96); }
.hidden { display: none !important; }
.screen { width: 100%; max-width: 720px; margin: 0 auto; padding: 16px 16px 8px; flex: 1; }
.glass, .course, .strip, .now, .lesson, .empty, .search, .hero {
  background: var(--card); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

.banner { max-width: 720px; margin: 12px auto 0; padding: 10px 14px; border-radius: var(--r); font-size: 13px; background: var(--rose-bg); border: 1px solid var(--rose-ln); color: var(--rose); width: calc(100% - 32px); }
.banner.notice { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .4); color: #fcd34d; }

/* липка скляна шапка */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(2, 6, 23, .6); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.topbar-in { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.gsq { width: 44px; height: 44px; flex: none; border-radius: 13px; background: var(--grad); color: #fff; font-weight: 700; font-size: 17px; box-shadow: 0 8px 20px -6px rgba(99, 102, 241, .6), inset 0 1px 0 rgba(255, 255, 255, .25); }
.share { margin-left: auto; width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: transparent; }
.share:active { background: rgba(148, 163, 184, .15); }
.ttl { display: flex; flex-direction: column; min-width: 0; }
.ttl b { font-size: 17px; font-weight: 700; line-height: 1.2; }
.ttl span { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* головний екран */
.hero { position: relative; border-radius: 24px; padding: 22px 20px 18px; margin-top: 6px; border-color: rgba(139, 92, 246, .28); box-shadow: 0 20px 50px -20px rgba(99, 102, 241, .55), inset 0 1px 0 rgba(255, 255, 255, .06); overflow: hidden; }
.hero::after { content: ''; position: absolute; width: 220px; height: 220px; right: -70px; top: -90px; background: radial-gradient(circle, rgba(139, 92, 246, .35), transparent 70%); pointer-events: none; }
.hero h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; filter: brightness(1.35); }
.hero .sub { margin: 4px 0 0; color: var(--muted); }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.h-date { font-weight: 600; font-size: 14px; }
.h-week { color: var(--muted); font-size: 13px; margin-top: 2px; }
.h-time { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.pick-title { margin: 24px 4px 10px; font-size: 20px; font-weight: 700; }
.search { width: 100%; min-height: 50px; padding: 0 16px; border-radius: var(--r); outline: none; transition: border-color .15s, box-shadow .15s; }
.search::placeholder { color: var(--muted); }
.search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cap { margin: 18px 4px 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--primary-soft); border: 1px solid rgba(99, 102, 241, .35); color: var(--primary-ink); font-weight: 700; }
.chip:hover { background: rgba(99, 102, 241, .28); }
.course { border-radius: var(--r); padding: 16px; margin-top: 14px; }
.course h3 { margin: 0 0 12px 2px; font-size: 16px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.course h3 small { font-size: 13px; font-weight: 400; color: var(--muted); }
.glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.gitem { min-height: 46px; border-radius: 12px; background: rgba(30, 41, 59, .8); font-weight: 600; font-size: 15px; border: 1px solid rgba(71, 85, 105, .5); }
.gitem:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
.gitem.on { background: var(--grad); color: #fff; border-color: rgba(139, 92, 246, .6); }
.nores { padding: 24px; text-align: center; color: var(--muted); }

.legend { display: flex; align-items: center; gap: 8px; margin: 16px 4px 0; font-size: 13px; color: var(--muted); }
.legend i { width: 14px; height: 14px; border-radius: 5px; border: 1.5px solid rgba(245, 158, 11, .7); background: var(--amber-bg); flex: none; }
.gitem.has-subs, .chip.has-subs { position: relative; border-color: rgba(245, 158, 11, .7); background: rgba(69, 26, 3, .35); color: var(--amber); }
.gitem.has-subs::after, .chip.has-subs::after { content: ''; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, .8); }
.gitem.has-subs:hover { border-color: #fbbf24; }

/* смуга днів */
.strip { display: flex; align-items: stretch; gap: 4px; border-radius: var(--r); padding: 6px; }
.arrow { width: 32px; min-height: 56px; border-radius: 10px; font-size: 26px; color: var(--muted); }
.arrow:hover:not(:disabled) { color: var(--primary-ink); }
.arrow:disabled { opacity: .25; cursor: default; }
.days { position: relative; flex: 1; display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 4px; }
.day { position: relative; z-index: 1; min-height: 58px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid transparent; }
.day:hover:not(.on) { background: var(--primary-soft); }
.day small { font-size: 12px; color: var(--muted); font-weight: 600; }
.day b { font-size: 17px; font-weight: 700; }
.day.today { border-color: var(--primary); }
.day.on { border-color: transparent; }
.day.on small, .day.on b { color: #fff; }
.day .dot { position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, .8); }
.day-head { margin: 16px 4px 10px; font-weight: 600; font-size: 15px; color: var(--muted); min-height: 21px; }

/* статус "Зараз" */
.now { position: relative; border-radius: var(--r); padding: 14px 16px 16px; margin-bottom: 12px; border-color: rgba(139, 92, 246, .3); box-shadow: 0 14px 34px -18px rgba(99, 102, 241, .6); animation: rise .2s ease both; }
.n-row { display: flex; align-items: center; gap: 12px; }
.n-main { flex: 1; min-width: 0; }
.n-t { font-weight: 700; line-height: 1.3; }
.n-s { margin-top: 2px; color: var(--muted); font-size: 13.5px; }
.n-left { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-ink); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pulse { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin: 0 4px; }
.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: pulse 1.8s ease-out infinite; }
.pulse.idle { background: var(--primary); }
.pulse.idle::after { display: none; }
.pulse.off { background: #64748b; }
.pulse.off::after { display: none; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }
.bar { height: 5px; border-radius: 3px; background: rgba(51, 65, 85, .7); margin-top: 12px; overflow: hidden; }
.bar div { height: 100%; background: var(--grad); border-radius: 3px; transition: width .5s; }

/* урок */
.lesson { position: relative; display: grid; grid-template-columns: 42px 1fr; gap: 14px; border-radius: var(--r); padding: 14px; margin-bottom: 10px; overflow: hidden; animation: slide .26s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(min(var(--i, 0), 8) * 35ms); }
.lesson.static { animation: none; }
.lesson.past > * { opacity: .55; }
.lesson.now-l { box-shadow: 0 0 0 2px var(--primary), 0 12px 30px -12px rgba(99, 102, 241, .65); border-color: transparent; }
.l-num { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; background: var(--primary-soft); color: var(--primary-ink); border: 1px solid rgba(99, 102, 241, .3); }
.now-l .l-num { background: var(--grad); color: #fff; border-color: transparent; }
.l-body { min-width: 0; }
.l-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; }
.l-time { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.l-subj { font-weight: 700; font-size: 16px; line-height: 1.3; margin-top: 3px; }
.l-old { font-size: 12px; color: var(--muted); text-decoration: line-through; margin-top: 3px; line-height: 1.3; }
.l-old + .l-subj { margin-top: 1px; }
.l-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.bd { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 9px; font-size: 12.5px; background: rgba(30, 41, 59, .9); color: #cbd5e1; border: 1px solid rgba(71, 85, 105, .6); }
.bd svg { width: 14px; height: 14px; flex: none; opacity: .85; }
.bd.cab { background: rgba(99, 102, 241, .12); color: #a5b4fc; border-color: rgba(99, 102, 241, .25); font-weight: 600; }
.bd s { color: var(--muted); font-weight: 400; }
.l-note { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.l-tag { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid; }
.lesson.changed, .lesson.room { border-color: var(--amber-ln); background: var(--amber-bg); }
.lesson.changed .l-tag, .lesson.room .l-tag { color: var(--amber); background: rgba(245, 158, 11, .2); border-color: rgba(245, 158, 11, .3); }
.lesson.extra { border-color: var(--violet-ln); background: var(--violet-bg); }
.lesson.extra .l-tag { color: var(--violet); background: rgba(139, 92, 246, .2); border-color: rgba(139, 92, 246, .3); }
.lesson.cancelled { border-color: var(--rose-ln); background: var(--rose-bg); }
.lesson.cancelled .l-tag { color: var(--rose); background: rgba(244, 63, 94, .2); border-color: rgba(244, 63, 94, .3); }
.lesson.cancelled .l-subj { text-decoration: line-through; color: var(--muted); }
.lesson.cancelled .l-num { color: var(--muted); background: rgba(244, 63, 94, .08); border-color: rgba(244, 63, 94, .25); }
.l-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(51, 65, 85, .6); }
.l-prog i { display: block; height: 100%; background: var(--grad); transition: width .5s; }

.gap { display: flex; align-items: center; gap: 10px; margin: 2px 6px 10px; color: var(--muted); font-size: 12px; font-weight: 600; animation: slide .26s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(min(var(--i, 0), 8) * 35ms); }
.gap.static { animation: none; }
.gap.short { margin: -4px 6px 6px; font-size: 11px; font-weight: 500; opacity: .6; }
.gap::before, .gap::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.empty { border-radius: var(--r); padding: 32px 20px; text-align: center; color: var(--muted); font-weight: 600; animation: rise .2s ease both; }
.empty svg { width: 44px; height: 44px; color: var(--primary-ink); opacity: .8; margin-bottom: 8px; }
.skel { position: relative; overflow: hidden; height: 82px; border-radius: var(--r); margin-bottom: 10px; background: #0f172a; }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(139, 92, 246, .16) 50%, transparent 80%); transform: translateX(-100%); animation: sh 1.5s ease-in-out infinite; }
@keyframes sh { to { transform: translateX(100%); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* фон: дрейф */
@keyframes drift { from { transform: translate3d(-2.5%, -1.5%, 0) scale(1); } to { transform: translate3d(2.5%, 2%, 0) scale(1.06); } }
@keyframes slide { from { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 8px)); } to { opacity: 1; transform: none; } }
#lessons.dir-f { --dx: -26px; --dy: 0px; }
#lessons.dir-b { --dx: 26px; --dy: 0px; }

/* перехід екранів */
.in-f { animation: inF .24s cubic-bezier(.2, .8, .2, 1) both; }
.in-b { animation: inB .24s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes inF { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes inB { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

/* повзунок вибраного дня */
.slider { position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 13px; background: var(--grad); border: 1px solid rgba(139, 92, 246, .5); box-shadow: 0 8px 18px -8px rgba(99, 102, 241, .8); z-index: 0; pointer-events: none; opacity: 0; }
.slider.ready { transition: transform .32s cubic-bezier(.3, .9, .3, 1), opacity .2s; }

/* glow при натисканні */
.gitem, .chip, .day { position: relative; }
.gitem::before, .chip::before, .day::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 50% 50%, rgba(167, 139, 250, .6), transparent 72%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.gitem:active::before, .chip:active::before, .day:active::before { opacity: 1; transition-duration: .05s; }

/* поточний урок: дихання і блиск */
.lesson.now-l::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 26px rgba(139, 92, 246, .5); pointer-events: none; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.l-prog i, .bar div { position: relative; overflow: hidden; }
.l-prog i::after, .bar div::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-100%); animation: shine 2.6s ease-in-out infinite; }
@keyframes shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

/* кільце прогресу в картці "Зараз" */
.ring { position: relative; flex: none; width: 54px; height: 54px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.6; }
.ring .rt { stroke: rgba(51, 65, 85, .7); }
.ring .rp { stroke: #a78bfa; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(139, 92, 246, .8)); }
.rv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.rv b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rv small { font-size: 9px; color: var(--muted); margin-top: 1px; }

/* час у hero: перегортання хвилин */
.h-time .mm { display: inline-block; }
.h-time .mm.flip { animation: flip .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes flip { from { opacity: 0; transform: translateY(-45%) scaleY(.6); } to { opacity: 1; transform: none; } }

/* розгорнута картка */
.lesson.tap { cursor: pointer; }
.l-det { display: none; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.lesson.open .l-det { display: block; animation: rise .2s ease both; }
.l-det > div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.l-det span { color: var(--muted); }
.l-det b { font-weight: 600; text-align: right; }

/* тост */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50; padding: 10px 18px; border-radius: 999px; background: rgba(46, 16, 101, .92); border: 1px solid rgba(139, 92, 246, .5); color: var(--ink); font-size: 13.5px; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(99, 102, 241, .7); opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

footer { display: flex; justify-content: space-between; align-items: center; max-width: 720px; width: 100%; margin: 0 auto; padding: 16px 20px 24px; font-size: 13px; color: var(--muted); }
footer .api { margin-left: auto; }
footer a { color: var(--primary-ink); text-decoration: none; font-weight: 600; }

@media (min-width: 640px) {
  .hero h1 { font-size: 36px; }
  .screen { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.ttl #group-spec { font-weight: 500; }
