/* ============================================================ STMe — Bento UI */

:root {
  --bg: #f3f3f6;
  --tile: #ffffff;
  --tile-2: #f6f6f9;
  --tile-3: #ececf1;
  --text: #111116;
  --muted: #6c6c78;
  --faint: #9a9aa5;
  --line: rgba(17, 17, 22, .07);
  --line-strong: rgba(17, 17, 22, .13);
  --accent: #5b5bf6;
  --accent-2: #b05cf6;
  --accent-soft: rgba(91, 91, 246, .10);
  --accent-text: #ffffff;
  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, .12);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, .10);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .14);
  --shadow: 0 1px 2px rgba(17, 17, 22, .04), 0 10px 30px -18px rgba(17, 17, 22, .18);
  --shadow-lg: 0 24px 60px -20px rgba(17, 17, 22, .35);
  --scrim: rgba(12, 12, 18, .32);
  --radius: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --gap: 14px;
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --topbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0f;
    --tile: #15151b;
    --tile-2: #1c1c24;
    --tile-3: #26262f;
    --text: #f2f2f6;
    --muted: #a0a0ad;
    --faint: #6d6d7a;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .14);
    --accent: #8484ff;
    --accent-2: #c58bff;
    --accent-soft: rgba(132, 132, 255, .14);
    --accent-text: #0b0b0f;
    --ok: #3ecf7a;
    --ok-soft: rgba(62, 207, 122, .14);
    --danger: #ff6b70;
    --danger-soft: rgba(255, 107, 112, .13);
    --warn-soft: rgba(245, 158, 11, .16);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .8);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .9);
    --scrim: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0b0f;
  --tile: #15151b;
  --tile-2: #1c1c24;
  --tile-3: #26262f;
  --text: #f2f2f6;
  --muted: #a0a0ad;
  --faint: #6d6d7a;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --accent: #8484ff;
  --accent-2: #c58bff;
  --accent-soft: rgba(132, 132, 255, .14);
  --accent-text: #0b0b0f;
  --ok: #3ecf7a;
  --ok-soft: rgba(62, 207, 122, .14);
  --danger: #ff6b70;
  --danger-soft: rgba(255, 107, 112, .13);
  --warn-soft: rgba(245, 158, 11, .16);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .9);
  --scrim: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }
::selection { background: var(--accent-soft); }

.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 26px; height: 26px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.pre { white-space: pre-wrap; word-break: break-word; }
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

/* ---------------------------------------------------------------- boot / splash */

.boot {
  position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100;
  transition: opacity .5s var(--ease), visibility .5s;
}
.boot.gone { opacity: 0; visibility: hidden; }
.boot .brand-mark { font-size: 34px; animation: pulse 1.4s var(--ease) infinite; }

.brand-mark {
  font-weight: 800; letter-spacing: -.04em; font-size: 22px;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.welcome-splash {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; text-align: center; padding: 24px;
  background: var(--bg);
  animation: splashOut .7s var(--ease) 1.9s forwards;
}
.welcome-splash h1 { font-size: clamp(30px, 6vw, 60px); font-weight: 800; }
.welcome-splash h1 span { display: inline-block; opacity: 0; transform: translateY(24px); animation: rise .8s var(--ease) forwards; }
.welcome-splash p { margin-top: 12px; opacity: 0; animation: rise .8s var(--ease) .5s forwards; }

/* ---------------------------------------------------------------- buttons, inputs */

.btn {
  --b: var(--tile-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--b); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s, box-shadow .25s var(--ease), opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--tile-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--text); box-shadow: 0 8px 22px -10px var(--text); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:hover { background: var(--accent); box-shadow: 0 10px 24px -10px var(--accent); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line-strong); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent;
  animation: spin .8s linear infinite;
}
.btn-primary.loading::after, .btn-accent.loading::after { border-color: var(--bg) transparent var(--bg) transparent; }

.icon-btn {
  width: 42px; height: 42px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; color: var(--text); cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease), color .2s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--tile-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.on { color: var(--warn); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 11px 16px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--tile-2); outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--tile); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 22px; height: 22px; flex: none; border-radius: 7px; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; transition: all .25s var(--spring); background: var(--tile);
}
.check .box svg { width: 14px; height: 14px; stroke: var(--accent-text); stroke-width: 3; fill: none; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .3s var(--ease) .05s; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.check input:checked + .box svg { stroke-dashoffset: 0; }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--accent-soft); }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--tile-2); border: 1px solid var(--line); position: relative; }
.seg button {
  border: 0; background: transparent; height: 34px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font-weight: 600; color: var(--muted); transition: color .25s, background-color .3s var(--ease), box-shadow .3s;
}
.seg button.active { background: var(--tile); color: var(--text); box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .25); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--tile-2); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: #b76e00; }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .chip.warn { color: var(--warn); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.warn { color: var(--warn); } }

/* ---------------------------------------------------------------- layout */

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 6px; padding: 0 max(14px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .brand { padding: 0 6px; }
.topbar-spacer { flex: 1; }
.top-avatar { margin-left: 4px; border-radius: 50%; transition: transform .25s var(--spring); }
.top-avatar:hover { transform: scale(1.08); }

.bell-wrap { position: relative; }
.badge {
  position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg); pointer-events: none; animation: pop .4s var(--spring);
}

.view { max-width: 1240px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left)) 120px; }
.page { animation: pageIn .45s var(--ease) both; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 4px 18px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.page-head p { margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin: 0 4px 10px; transition: color .2s, gap .2s var(--ease); }
.back:hover { color: var(--text); gap: 10px; }

/* ---------------------------------------------------------------- drawer */

.scrim {
  position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s; backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; z-index: 50; top: 10px; bottom: 10px; left: 10px; width: min(320px, calc(100vw - 20px));
  background: var(--tile); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  transform: translateX(calc(-100% - 20px)); transition: transform .5s var(--ease);
  display: flex; flex-direction: column; padding: 14px; overflow-y: auto;
}
body.drawer-open .scrim { opacity: 1; visibility: visible; }
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer .nav a { animation: slideIn .45s var(--ease) both; animation-delay: calc(var(--i) * 30ms + 80ms); }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.drawer-user { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-md); background: var(--tile-2); margin-bottom: 12px; transition: background-color .2s; }
.drawer-user:hover { background: var(--tile-3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 14px; border-radius: 14px;
  color: var(--muted); font-weight: 600; transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.nav a:hover { background: var(--tile-2); color: var(--text); transform: translateX(3px); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .ext { margin-left: auto; opacity: .6; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.drawer-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }

/* ---------------------------------------------------------------- bento */

.bento {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row dense;
}
.c-1 { grid-column: span 1; } .c-2 { grid-column: span 2; } .c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; }
.r-2 { grid-row: span 2; }

.tile {
  position: relative; min-width: 0;
  background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; display: flex; flex-direction: column; gap: 14px; overflow: hidden;
  animation: rise .65s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.tile.hover:hover, a.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.tile-title { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile-title .dot { width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tile-title .dot .ic { width: 16px; height: 16px; }
.tile-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); transition: color .2s, gap .25s var(--ease); white-space: nowrap; }
.tile-link:hover { color: var(--accent); gap: 8px; }
.tile.accent { background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.tile.accent .muted, .tile.accent .tile-title { color: rgba(255, 255, 255, .78); }
.tile.accent .tile-title .dot { background: rgba(255, 255, 255, .18); color: #fff; }

.empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: 22px 10px; color: var(--muted); font-size: 14px; }
.empty .ic { width: 30px; height: 30px; opacity: .45; }

.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--tile-2) 0%, var(--tile-3) 50%, var(--tile-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-line { height: 14px; margin: 6px 0; }

/* list rows */
.list { display: flex; flex-direction: column; gap: 6px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--tile-2);
  transition: background-color .2s, transform .25s var(--ease); animation: rise .45s var(--ease) both; animation-delay: calc(var(--j, 0) * 40ms);
}
.item:hover { background: var(--tile-3); }
.item .actions { display: flex; gap: 2px; opacity: .6; transition: opacity .2s; }
.item:hover .actions { opacity: 1; }
@media (hover: none) { .item .actions { opacity: 1; } }

/* ---------------------------------------------------------------- avatar */

.avatar {
  --s: 40px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; font-size: calc(var(--s) * .38); color: #fff;
  background: hsl(var(--h, 245) 70% 60%); object-fit: cover;
}
img.avatar { background: var(--tile-2); }

/* ---------------------------------------------------------------- home */

.t-welcome { justify-content: space-between; min-height: 190px; }
.t-welcome .eyebrow { font-size: 13px; font-weight: 700; color: var(--muted); }
.t-welcome .eyebrow::first-letter, .day h3::first-letter { text-transform: uppercase; }
.t-welcome h1 { font-size: clamp(28px, 4.2vw, 48px); font-weight: 800; margin-top: 8px; word-break: break-word; }
.t-welcome .next { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 999px; background: var(--tile-2); width: fit-content; max-width: 100%; }
.t-welcome .next .ic { color: var(--accent); }
.t-welcome .blob { position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; animation: float 9s ease-in-out infinite; }

.weather-now { display: flex; align-items: center; gap: 14px; }
.weather-temp { font-size: 54px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.weather-cond { font-size: 17px; font-weight: 700; }
.weather-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.weather-stats div { background: var(--tile-2); border-radius: 14px; padding: 10px 12px; }
.weather-stats b { display: block; font-size: 18px; }
.weather-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.wx { width: 76px; height: 76px; flex: none; overflow: visible; }
.wx .sun { transform-origin: 32px 32px; animation: spin 18s linear infinite; }
.wx .cloud { animation: drift 5s ease-in-out infinite; }
.wx .drop { animation: drop 1.1s linear infinite; }
.wx .flake { animation: snow 2.4s linear infinite; }
.wx .fogline { animation: fog 3s ease-in-out infinite; }
.wx .bolt { animation: flash 2.2s steps(1) infinite; }

/* lessons */
.lesson {
  display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: var(--tile-2); position: relative; overflow: hidden;
  border: 1px solid transparent; transition: background-color .3s, border-color .3s, transform .3s var(--ease);
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--j, 0) * 45ms);
}
.lesson .time { font-size: 13px; font-weight: 700; line-height: 1.25; }
.lesson .time small { display: block; color: var(--muted); font-weight: 600; }
.lesson .subj { font-weight: 700; line-height: 1.25; }
.lesson .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.lesson.past { opacity: .5; }
.lesson.now { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.lesson.now .time { color: var(--accent); }
.lesson.next { border-color: var(--line-strong); background: var(--tile); }
.lesson .progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); border-radius: 0 3px 3px 0; transition: width 1s linear; }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: ping 1.6s var(--ease) infinite; }

/* schedule page */
.week { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.day.today { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.day { scroll-margin-top: calc(var(--topbar-h) + 10px); }
.day h3 { font-size: 20px; font-weight: 800; }

/* ---------------------------------------------------------------- feed / posts */

.composer { display: flex; flex-direction: column; gap: 12px; }
.dropzone {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 1.5px dashed var(--line-strong); border-radius: 18px; padding: 18px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .2s, background-color .2s, transform .2s var(--ease); font-weight: 600;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone.drag { transform: scale(1.01); }
.picked { display: flex; flex-wrap: wrap; gap: 6px; }

.feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.post-author { display: flex; align-items: center; gap: 12px; }
.post-author b { display: block; line-height: 1.2; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.media-grid.one { grid-template-columns: 1fr; }
.media-thumb {
  position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: var(--tile-2); cursor: zoom-in; border: 0; padding: 0;
}
.media-grid.one .media-thumb { aspect-ratio: 16 / 10; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.media-thumb:hover img { transform: scale(1.05); }
.file-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--tile-2);
  transition: background-color .2s, transform .2s var(--ease); min-width: 0;
}
.file-chip:hover { background: var(--tile-3); transform: translateY(-1px); }
.file-chip .ext { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; flex: none; }

.chat { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; animation: rise .35s var(--ease); }
.chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding-right: 4px; scroll-behavior: smooth; }
.msg { display: flex; gap: 8px; align-items: flex-end; animation: rise .3s var(--ease) both; }
.msg .bubble { background: var(--tile-2); padding: 8px 12px; border-radius: 16px 16px 16px 6px; max-width: 80%; }
.msg .bubble b { font-size: 12px; color: var(--accent); display: block; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-text); border-radius: 16px 16px 6px 16px; }
.msg.mine .bubble b { color: inherit; opacity: .75; }
.msg time { font-size: 11px; color: var(--faint); flex: none; }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { border-radius: 999px; }

.search-tile { gap: 12px; }
.search-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; }
.search-box { position: relative; display: block; }
.search-box .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 40px; border-radius: 999px; }
.date-field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.date-field .input { min-height: 46px; padding: 8px 12px; width: 150px; }
mark { background: color-mix(in srgb, var(--warn) 35%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
@media (max-width: 720px) {
  .search-row { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .date-field .input { width: 100%; }
  .date-field { flex: 1; }
}

/* концентрация */
.focus-timer { align-items: center; justify-content: center; gap: 18px; transition: background-color .6s var(--ease); }
.focus-timer.rest { background: color-mix(in srgb, var(--ok) 7%, var(--tile)); }
.ring-wrap { position: relative; width: min(280px, 72vw); aspect-ratio: 1; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--tile-3); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .6s; }
.focus-timer.rest .ring-fg { stroke: var(--ok); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.clock { font-size: clamp(44px, 9vw, 64px); font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.focus-timer.running .clock { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.03); } }
.focus-main { min-width: 150px; height: 50px; font-size: 16px; }
.tomatoes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; }
.tomato { font-size: 18px; animation: pop .4s var(--spring); }
.seg-wrap { flex-wrap: wrap; border-radius: 18px; }
.focus-list { max-height: 320px; overflow-y: auto; }
.focus-chip { height: 32px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; font-weight: 800; font-size: 13px;
  font-variant-numeric: tabular-nums; background: var(--accent-soft); color: var(--accent); transition: transform .2s var(--spring); }
.focus-chip::before { content: "🍅"; margin-right: 6px; }
.focus-chip.rest { background: var(--ok-soft); color: var(--ok); }
.focus-chip.rest::before { content: "☕"; }
.focus-chip.paused { opacity: .6; }
.focus-chip:hover { transform: scale(1.05); }

/* ---------------------------------------------------------------- notes */

.todo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--tile-2); animation: rise .4s var(--ease) both; animation-delay: calc(var(--j, 0) * 35ms); transition: background-color .2s, opacity .3s; }
.todo .txt { position: relative; flex: 1; min-width: 0; word-break: break-word; transition: color .3s; }
.todo .txt::after { content: ""; position: absolute; left: 0; top: 52%; height: 2px; width: 0; background: var(--muted); border-radius: 2px; transition: width .35s var(--ease); }
.todo.done .txt { color: var(--muted); }
.todo.done .txt::after { width: 100%; }
.todo.done { opacity: .75; }
.add-row { display: flex; gap: 8px; }
.add-row .input { border-radius: 999px; }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.note-card {
  text-align: left; border: 1px solid var(--line); background: var(--tile-2); border-radius: 18px; padding: 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; min-height: 150px; transition: transform .3s var(--ease), box-shadow .3s, background-color .2s;
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--j, 0) * 40ms);
}
.note-card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-lg); background: var(--tile); }
.note-card h4 { font-size: 16px; }
.note-card p { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.note-card .faint { margin-top: auto; font-size: 12px; }
.note-card.new { border-style: dashed; border-width: 1.5px; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; background: transparent; }
.note-card.new:hover { color: var(--accent); border-color: var(--accent); }

.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.file-tile { position: relative; border-radius: 16px; overflow: hidden; background: var(--tile-2); aspect-ratio: 1; display: flex; flex-direction: column; animation: rise .4s var(--ease) both; animation-delay: calc(var(--j, 0) * 35ms); }
.file-tile img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.file-tile .file-body { flex: 1; display: grid; place-items: center; padding: 12px; text-align: center; gap: 6px; }
.file-tile .file-body span { font-size: 12px; font-weight: 600; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-tile .del { position: absolute; top: 6px; right: 6px; background: var(--tile); box-shadow: var(--shadow); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s var(--spring); }
.file-tile:hover .del { opacity: 1; transform: none; }
@media (hover: none) { .file-tile .del { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- playlists */

.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); }
.user-card { align-items: center; text-align: center; gap: 10px; cursor: pointer; }
.user-card .avatar { --s: 76px; transition: transform .4s var(--spring); }
.user-card:hover .avatar { transform: scale(1.07) rotate(-3deg); }
.user-card .fav { position: absolute; top: 10px; right: 10px; }
.track { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 14px; background: var(--tile-2); transition: background-color .2s; animation: rise .4s var(--ease) both; animation-delay: calc(var(--j, 0) * 35ms); }
.track:hover { background: var(--tile-3); }
.track .play {
  width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--tile); color: var(--text); cursor: pointer; display: grid; place-items: center;
  transition: background-color .2s, color .2s, transform .25s var(--spring);
}
.track .play:hover { transform: scale(1.08); }
.track.playing .play { background: var(--accent); color: var(--accent-text); }
.track.playing .title { color: var(--accent); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: currentColor; border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
.paused .eq i { animation-play-state: paused; }

/* player bar */
.player {
  position: fixed; z-index: 35; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px;
  background: color-mix(in srgb, var(--tile) 88%, transparent); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); animation: playerIn .5s var(--spring);
}
.player .cover { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--accent), var(--accent-2)); }
.player .cover { overflow: hidden; }
.player .cover img { width: 100%; height: 100%; object-fit: cover; }
.player .info { flex: 1; min-width: 0; }
.pl-cover { --s: 96px; width: var(--s); height: var(--s); flex: none; border-radius: calc(var(--s) * .22); object-fit: cover; box-shadow: var(--shadow); display: grid; place-items: center; }
.pl-cover-empty { background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; }
.pl-cover-empty .ic { width: 40%; height: 40%; }
.user-card .pl-cover { transition: transform .4s var(--spring); }
.user-card:hover .pl-cover { transform: scale(1.05) rotate(-2deg); }
.pl-cover-pick { position: relative; cursor: pointer; border-radius: 24px; overflow: hidden; flex: none; }
.pl-cover-pick .overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .4); color: #fff; opacity: 0; transition: opacity .2s; }
.pl-cover-pick:hover .overlay { opacity: 1; }
.player .info b { display: block; font-size: 14px; }
.player .bar { height: 4px; background: var(--tile-3); border-radius: 4px; margin-top: 6px; cursor: pointer; position: relative; }
.player .bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 4px; width: 0; }
.player .ctrls { display: flex; align-items: center; gap: 2px; }
.player .ctrls .main { background: var(--text); color: var(--bg); }

/* ---------------------------------------------------------------- profile */

.profile-photo { align-items: center; text-align: center; justify-content: center; }
.photo-wrap { position: relative; width: 168px; height: 168px; border-radius: 42px; overflow: hidden; cursor: pointer; background: var(--tile-2); }
.photo-wrap img, .photo-wrap .avatar { width: 100%; height: 100%; border-radius: 0; object-fit: cover; --s: 168px; }
.photo-wrap .overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; opacity: 0; transition: opacity .25s; font-weight: 700; font-size: 13px; }
.photo-wrap:hover .overlay { opacity: 1; }
.fio-line { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; animation: rise .6s var(--ease) both; animation-delay: calc(var(--j) * 90ms + 150ms); }
.fio-line:nth-child(n+2) { color: var(--muted); }
.kv { display: flex; flex-direction: column; gap: 10px; }
.kv > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--tile-2); border-radius: 14px; min-width: 0; }
.kv span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv b { word-break: break-word; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ec-frame { width: 100%; height: min(75vh, 780px); border: 1px solid var(--line); border-radius: 18px; background: #fff; animation: rise .5s var(--ease) both; }
.captcha { flex: none; width: 150px; height: 50px; padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; overflow: hidden; cursor: pointer; display: grid; place-items: center; }
.captcha img { width: 100%; height: 100%; object-fit: contain; }
.captcha .skeleton { width: 100%; height: 100%; margin: 0; border-radius: 0; }

.corpus { gap: 12px; }
button.corpus-num { border: 0; cursor: pointer; transition: transform .25s var(--spring), background-color .2s; }
button.corpus-num:hover { transform: scale(1.06); background: var(--accent); color: var(--accent-text); }
.place .corpus-num { width: 44px; height: 44px; border-radius: 14px; font-size: 18px; }
.route-row { border-radius: 16px; background: var(--tile-2); overflow: hidden; transition: background-color .2s; }
.route-row.open { background: var(--tile-3); }
.route-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.route-head .chev { transition: transform .3s var(--ease); color: var(--muted); }
.route-row.open .chev { transform: rotate(90deg); }
.route-badge { min-width: 40px; height: 32px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: #f08a24; flex: none; }
.route-badge.trolleybus { background: var(--accent); }
.route-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 14px; animation: rise .35s var(--ease) both; }
.stops-list { margin: 0; padding-left: 22px; columns: 2; column-gap: 24px; font-size: 13px; color: var(--muted); }
.stops-list li { break-inside: avoid; padding: 1px 0; }
.stops-list li.before { color: var(--text); }
.stops-list li.here { color: var(--accent); font-weight: 800; }
.times { display: flex; flex-wrap: wrap; gap: 6px; }
.time-chip { display: inline-flex; align-items: baseline; gap: 3px; padding: 5px 9px; border-radius: 10px; background: var(--tile); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.time-chip.past { opacity: .4; font-weight: 500; }
.time-chip.next { background: var(--accent); color: var(--accent-text); }
.time-chip small { color: var(--danger); font-weight: 700; }
@media (max-width: 720px) { .stops-list { columns: 1; } }
.corpus-num { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 24px; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.corpus.next-corpus { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }

/* events */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--gap); }
.event-card { padding: 0; cursor: pointer; }
.event-card .cover-wrap { position: relative; }
.event-card .cover { aspect-ratio: 16 / 9; background: linear-gradient(140deg, var(--accent), var(--accent-2)); overflow: hidden; position: relative; }
.event-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.event-card:hover .cover img { transform: scale(1.05); }
.event-card .cover .ic { position: absolute; inset: 0; margin: auto; width: 42px; height: 42px; color: rgba(255, 255, 255, .6); }
.event-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.event-card .desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.event-card.past { opacity: .6; }
.datebox { width: 54px; height: 58px; flex: none; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.datebox b { font-size: 21px; font-weight: 800; }
.datebox span { font-size: 11px; font-weight: 700; text-transform: uppercase; margin-top: 3px; }
.event-card .datebox { position: absolute; left: 18px; bottom: -24px; background: var(--tile); box-shadow: var(--shadow); }
.event-card .body { padding-top: 34px; }
.icon-btn.on svg { fill: currentColor; }

.announce { padding: 12px 14px; border-radius: 16px; background: var(--tile-2); border-left: 3px solid var(--warn); animation: rise .45s var(--ease) both; animation-delay: calc(var(--j, 0) * 45ms); }
.announce.direct { border-left-color: var(--accent); }
.announce b { display: block; }
.respond { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; background: var(--tile-2); }
.pick-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; padding: 2px; }
.pick {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--tile-2); font-size: 13px; font-weight: 600;
  transition: background-color .2s, color .2s, transform .25s var(--spring), border-color .2s;
}
.pick:hover { border-color: var(--accent); }
.pick:active { transform: scale(.95); }
.pick.on { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.pick.on .faint { color: inherit; opacity: .7; }
.announce p { color: var(--muted); font-size: 14px; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.announce .clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ecampus */
.ecampus-hero { min-height: 340px; justify-content: center; align-items: flex-start; gap: 18px; }
.ecampus-hero h2 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; }
.ecampus-hero .btn { height: 54px; padding: 0 26px; font-size: 16px; background: #fff; color: #111; }
.ecampus-hero .btn:hover { box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .6); transform: translateY(-2px); }

/* cabinet table */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--tile-2); position: sticky; top: 0; }
tbody tr { transition: background-color .15s; }
tbody tr:hover { background: var(--tile-2); }
tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- auth */

.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--gap); padding: var(--gap); }
.auth-art { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1.2fr 1fr 1fr; gap: var(--gap); }
.auth-art .tile { justify-content: flex-end; }
.auth-art .t-big { grid-column: span 2; }
.auth-art .t-big h1 { font-size: clamp(44px, 6vw, 84px); font-weight: 800; letter-spacing: -.05em; }
.auth-art .ic-tile { align-items: flex-start; }
.auth-art .ic-tile .ic { width: 30px; height: 30px; color: var(--accent); margin-bottom: auto; }
.auth-art .ic-tile b { font-size: 18px; }
.auth-panel { display: grid; place-items: center; padding: 24px 12px; }
.auth-card { width: min(460px, 100%); display: flex; flex-direction: column; gap: 16px; animation: rise .6s var(--ease) both; }
.auth-card h2 { font-size: 32px; font-weight: 800; }
.auth-card .form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .switch { text-align: center; color: var(--muted); font-size: 14px; }
.link { color: var(--accent); font-weight: 700; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }
.steps { display: flex; gap: 6px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--tile-3); transition: background-color .4s var(--ease); }
.steps i.on { background: var(--accent); }
.code-input { font-size: 26px; letter-spacing: .5em; text-align: center; font-weight: 800; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; color: var(--muted); }
.form-error { color: var(--danger); font-size: 14px; font-weight: 600; min-height: 0; animation: shake .4s var(--ease); }

/* ---------------------------------------------------------------- modal, toast, notifications */

.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--scrim); animation: fadeIn .25s var(--ease); backdrop-filter: blur(3px); }
.modal-wrap.closing { animation: fadeOut .22s var(--ease) forwards; }
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--tile); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 16px;
  animation: modalIn .45s var(--spring);
}
.modal.wide { width: min(820px, 100%); }
.modal-wrap.closing .modal { animation: modalOut .22s var(--ease) forwards; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head h3 { font-size: 22px; font-weight: 800; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .88); display: grid; place-items: center; padding: 20px; animation: fadeIn .25s; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 90dvh; border-radius: 16px; animation: modalIn .4s var(--spring); object-fit: contain; }
.lightbox .icon-btn { position: fixed; top: 14px; right: 14px; color: #fff; background: rgba(255, 255, 255, .12); }

.toasts { position: fixed; z-index: 80; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(420px, calc(100vw - 24px)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg);
  animation: toastIn .45s var(--spring);
}
.toast.error { background: var(--danger); color: #fff; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }

.notif-panel {
  position: absolute; right: -50px; top: calc(100% + 8px); width: min(380px, calc(100vw - 24px)); max-height: 70dvh; overflow-y: auto;
  background: var(--tile); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 14px;
  display: flex; flex-direction: column; gap: 8px; animation: dropIn .35s var(--spring); transform-origin: top right;
}
.notif { display: flex; gap: 12px; padding: 10px; border-radius: 14px; transition: background-color .2s; }
.notif:hover { background: var(--tile-2); }
.notif .ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--warn-soft); color: var(--warn); }
.notif.event .ico, .notif.direct .ico { background: var(--accent-soft); color: var(--accent); }
.notif.unread { background: var(--accent-soft); }
.notif b { display: block; font-size: 14px; line-height: 1.3; }
.notif p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- keyframes */

@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes playerIn { from { opacity: 0; transform: translate(-50%, 30px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-14px); } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; transform: scale(1.03); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.96); } }
@keyframes pop { from { transform: scale(0); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes float { 50% { transform: translate(-20px, 20px) scale(1.08); } }
@keyframes drift { 50% { transform: translateX(3px); } }
@keyframes drop { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
@keyframes snow { 0% { transform: translate(0, -4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(3px, 12px); opacity: 0; } }
@keyframes fog { 50% { transform: translateX(5px); } }
@keyframes flash { 0%, 100% { opacity: 1; } 45% { opacity: .2; } 50% { opacity: 1; } 55% { opacity: .3; } }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-3, .c-4 { grid-column: span 2; }
  .r-2 { grid-row: auto; }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}

@media (max-width: 720px) {
  :root { --radius: 22px; --gap: 12px; }
  .view { padding-top: 10px; }
  .bento, .week, .feed { grid-template-columns: minmax(0, 1fr); }
  .c-1, .c-2, .c-3, .c-4 { grid-column: span 1; }
  .r-2 { grid-row: auto; }
  .tile { padding: 18px; }
  .form-grid, .kv-grid { grid-template-columns: 1fr; }
  .weather-temp { font-size: 46px; }
  .lesson { grid-template-columns: 48px 1fr auto; gap: 10px; padding: 11px 12px; }
  .notif-panel { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) + 4px); width: auto; }
  .modal-wrap { align-items: end; padding: 0; }
  .modal { width: 100%; border-radius: 26px 26px 0 0; max-height: 92dvh; padding-bottom: max(22px, env(safe-area-inset-bottom)); animation: sheetIn .45s var(--ease); }
  .modal-wrap.closing .modal { animation: sheetOut .25s var(--ease) forwards; }
  .page-head { margin-bottom: 14px; }
  .player { bottom: max(10px, env(safe-area-inset-bottom)); }
  .player .hide-sm { display: none; }
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
