/* Портал студентов СКТиС. Тема «Табло»: зернистые панели, маркер на главных словах, акцент #FF3D30. */

:root {
  color-scheme: dark;
  --page: #000;
  --panel: #0B0B0D;
  --panel-2: #111113;
  --chip: #0E0E10;
  --hero: #0B0A0C;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .1);
  --line-3: rgba(255, 255, 255, .18);
  --soft: rgba(255, 255, 255, .03);
  --soft-2: rgba(255, 255, 255, .06);
  --soft-3: rgba(255, 255, 255, .08);
  --text: #FFFFFF;
  --text-2: #D9D6D6;
  --muted: #A7A5A8;
  --faint: #6C6A6E;
  --red: #FF3D30;
  --red-soft: rgba(255, 61, 48, .16);
  --red-chip: rgba(255, 61, 48, .2);
  --red-line: rgba(255, 61, 48, .45);
  --pick: #FFB3AC;
  --pick-ink: #1A0806;
  --grad-a: #FF6A5E;
  --grad-b: #FFC2BC;
  --amber: #F0B860;
  --amber-soft: rgba(232, 163, 61, .14);
  --green: #7FD6A4;
  --green-soft: rgba(111, 211, 154, .12);
  --cta: #FFFFFF;
  --cta-ink: #000000;
  --bubble-me: #FF3D30;
  --bubble-me-ink: #FFFFFF;
  --bubble: #141416;
  --grain-opacity: .2;
  --nav-bg: rgba(8, 8, 9, .94);
  --shadow: 0 12px 30px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: 'Montserrat', 'Golos Text', system-ui, sans-serif;
  --body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #F3F1EF;
  --panel: #FFFFFF;
  --panel-2: #F6F4F2;
  --chip: #FFFFFF;
  --hero: #FFFFFF;
  --line: rgba(20, 10, 10, .08);
  --line-2: rgba(20, 10, 10, .12);
  --line-3: rgba(20, 10, 10, .2);
  --soft: rgba(20, 10, 10, .035);
  --soft-2: rgba(20, 10, 10, .06);
  --soft-3: rgba(20, 10, 10, .08);
  --text: #141012;
  --text-2: #2E2A2C;
  --muted: #625D60;
  --faint: #8E888B;
  --red: #E5321F;
  --red-soft: rgba(229, 50, 31, .1);
  --red-chip: rgba(229, 50, 31, .12);
  --red-line: rgba(229, 50, 31, .45);
  --pick: #E5321F;
  --pick-ink: #FFFFFF;
  --grad-a: #D42A18;
  --grad-b: #F0624F;
  --amber: #A9670E;
  --amber-soft: rgba(201, 129, 20, .14);
  --green: #1E8A52;
  --green-soft: rgba(30, 138, 82, .12);
  --cta: #141012;
  --cta-ink: #FFFFFF;
  --bubble: #FFFFFF;
  --grain-opacity: .08;
  --nav-bg: rgba(255, 255, 255, .94);
  --shadow: 0 12px 30px rgba(40, 20, 20, .12);
}

* { box-sizing: border-box; }
html { background: var(--page); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s ease, color .3s ease;
}
* { scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 6px; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
a { color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--grad-a); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--red-line); }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grain-defs { position: absolute; width: 0; height: 0; }
.grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: var(--grain-opacity); mix-blend-mode: soft-light; pointer-events: none; }
:root[data-theme="light"] .grain { mix-blend-mode: multiply; }

@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0 round 12px); } to { clip-path: inset(0 0 0 0 round 12px); } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 61, 48, .55); } 80% { box-shadow: 0 0 0 10px rgba(255, 61, 48, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 61, 48, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes dots { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.up { animation: up .55s var(--ease) both; }

/* ---------- Каркас ---------- */

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: grid; grid-template-columns: minmax(0, 1.7fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
.topnav { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
@media (max-width: 1180px) { .topnav .pill { padding: 0 11px; } .topnav { gap: 4px; } }
.logo { display: block; width: 40px; height: 40px; border-radius: 999px; }
.top-right { display: flex; justify-content: flex-end; gap: 6px; align-items: center; }
.pill {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--chip);
  color: var(--text);
  border: 1px solid var(--line);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.pill:hover { border-color: var(--line-3); }
.pill[aria-current="page"] { background: var(--red-soft); color: var(--pick); }
.pill .me { width: 28px; height: 28px; border-radius: 8px; background: var(--red-chip); color: var(--pick); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; overflow: hidden; }
.pill .me img { width: 100%; height: 100%; object-fit: cover; }
.pill.me-pill { padding: 0 12px 0 6px; }
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 40px 4px 8px; }
.footer .brand { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.footer .brand img { width: 32px; height: 32px; border-radius: 999px; }
.footer .links { display: flex; gap: 16px; font-size: 13px; color: var(--faint); flex-wrap: wrap; }
.footer a { color: var(--faint); text-decoration: none; }
.footer a:hover { color: var(--pick); }

.m-head { display: none; }
.m-nav { display: none; }

@media (max-width: 860px) {
  .wrap { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); gap: 12px; }
  .topbar { display: none; }
  .m-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .m-head .logo { width: 34px; height: 34px; }
  .m-head .acts { display: flex; gap: 6px; align-items: center; }
  .m-head .pill { height: 36px; padding: 0 12px; border-radius: 11px; }
  .m-head .me-btn { width: 36px; height: 36px; border-radius: 11px; border: none; background: var(--red-chip); color: var(--pick); font-size: 12px; font-weight: 700; overflow: hidden; padding: 0; }
  .m-head .me-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .m-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .m-nav a { position: relative; text-decoration: none; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; }
  .m-nav .ico { width: 48px; height: 28px; border-radius: 10px; display: flex; align-items: center; justify-content: center; transition: background-color .2s ease; }
  .m-nav a[aria-current="page"] { color: var(--pick); }
  .m-nav a[aria-current="page"] .ico { background: var(--red-soft); }
  .m-nav .count { position: absolute; top: 0; left: 50%; margin-left: 10px; min-width: 16px; height: 16px; font-size: 10px; }
  .footer { display: none; }
  .hide-m { display: none !important; }
}
@media (min-width: 861px) { .hide-d { display: none !important; } }

/* ---------- Типографика ---------- */

.h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.15; text-transform: uppercase; letter-spacing: -.01em; }
.h1.xl { font-size: 54px; line-height: 1.12; }
.h1.md { font-size: 34px; }
.hl { display: inline-block; padding: 0 14px; border-radius: 12px; background: var(--red-chip); }
.hl > span { background: linear-gradient(90deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hl.wipe { animation: wipe .7s .15s var(--ease) both; }
.h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.2; text-transform: uppercase; }
.h2.sm { font-size: 15px; }
.lead { margin: 0; font-size: 18px; line-height: 1.75; color: var(--muted); max-width: 720px; }
.sub { margin: 0; font-size: 15px; color: var(--muted); }
.hint { margin: 0; font-size: 13px; color: var(--faint); }
.word { padding: 2px 8px; border-radius: 7px; background: var(--soft-3); color: var(--text); font-weight: 500; white-space: nowrap; }
.eyebrow { align-self: flex-start; padding: 6px 12px; border-radius: 10px; background: var(--soft-2); font-size: 13px; color: var(--text-2); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 24px 4px 4px; }
.page-head .sub { margin-top: 10px; }
.center-head { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 0 4px; text-align: center; }
@media (max-width: 860px) {
  .h1, .h1.md { font-size: 26px; line-height: 1.2; }
  .h1.xl { font-size: 23px; line-height: 1.2; }
  .hl { padding: 0 10px; border-radius: 10px; }
  .lead { font-size: 14px; line-height: 1.8; }
  .page-head { padding: 4px 2px 0; }
  .page-head .sub { margin-top: 6px; font-size: 14px; }
  .center-head { padding: 4px 0 0; }
  .center-head .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .word { padding: 1px 7px; border-radius: 6px; }
  .eyebrow { padding: 4px 10px; border-radius: 8px; font-size: 12px; }
}

/* ---------- Панели ---------- */

.panel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  transition: border-color .25s ease, transform .25s var(--ease);
}
.panel > :not(.grain) { position: relative; }
.panel.hov:hover { border-color: var(--line-3); }
.panel.glow { background: radial-gradient(100% 100% at 100% 0%, rgba(255, 61, 48, .18), rgba(255, 61, 48, 0) 60%), var(--panel); }
.panel.tight { padding: 14px; gap: 8px; }
.panel.flat { padding: 0; gap: 0; }
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 40px;
  border: 1px solid var(--line);
  background: radial-gradient(110% 90% at 88% 0%, rgba(255, 61, 48, .26) 0%, rgba(255, 61, 48, 0) 55%), radial-gradient(70% 80% at 0% 100%, rgba(140, 28, 20, .30) 0%, rgba(140, 28, 20, 0) 60%), var(--hero);
  padding: 52px 56px 40px;
}
:root[data-theme="light"] .hero { background: radial-gradient(110% 90% at 88% 0%, rgba(255, 61, 48, .16) 0%, rgba(255, 61, 48, 0) 55%), radial-gradient(70% 80% at 0% 100%, rgba(255, 140, 120, .16) 0%, rgba(255, 140, 120, 0) 60%), var(--hero); }
.hero > .in { position: relative; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 860px) {
  .panel { border-radius: 22px; padding: 16px; }
  .hero { border-radius: 28px; padding: 22px 20px 18px; }
  .hero > .in { gap: 14px; }
}
.cols { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.cols > .main-col { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cols > .side-col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
@media (max-width: 860px) { .cols { gap: 12px; } .cols > .side-col { gap: 12px; } }

/* ---------- Кнопки ---------- */

.btn {
  height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  border: none;
  background: var(--cta);
  color: var(--cta-ink);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, transform .15s ease, opacity .2s ease;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-3); }
.btn.ghost:hover:not(:disabled) { background: var(--soft-2); }
.btn.quiet { background: var(--soft-2); color: var(--text); }
.btn.quiet:hover:not(:disabled) { background: var(--soft-3); }
.btn.text { background: transparent; color: var(--muted); padding: 0 10px; }
.btn.text:hover:not(:disabled) { color: var(--text); }
.btn.danger { background: transparent; color: #FF8A80; border: 1px solid rgba(255, 61, 48, .35); }
:root[data-theme="light"] .btn.danger { color: var(--red); }
.btn.red { background: var(--red); color: #fff; }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13px; }
.btn.md { height: 42px; padding: 0 16px; border-radius: 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 36px; }
.spin { width: 14px; height: 14px; border-radius: 999px; border: 2px solid rgba(127, 127, 127, .3); border-top-color: currentColor; animation: spin .7s linear infinite; flex-shrink: 0; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 860px) { .btn { height: 44px; padding: 0 18px; font-size: 14px; } }

.seg { display: inline-flex; gap: 6px; padding: 5px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.seg button {
  height: 42px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  transition: background-color .2s ease, color .2s ease;
}
.seg button:hover:not([aria-pressed="true"]):not([aria-selected="true"]) { background: var(--soft-2); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--pick); color: var(--pick-ink); }
.seg .n { opacity: .6; margin-left: 4px; }
.seg.full { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
@media (max-width: 860px) {
  .seg { gap: 4px; padding: 4px; border-radius: 15px; }
  .seg button { height: 40px; padding: 0 12px; border-radius: 11px; }
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll > * { flex-shrink: 0; }
.chip {
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover:not([aria-pressed="true"]) { border-color: var(--line-3); }
.chip[aria-pressed="true"] { background: var(--pick); color: var(--pick-ink); border-color: transparent; }
.chip .n { opacity: .6; margin-left: 4px; }

.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; padding: 0; border-radius: 999px; border: none; background: var(--soft-3); transition: background-color .2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.switch[aria-checked="true"] { background: var(--red); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ---------- Поля ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > .lbl { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.input, .select, .textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23A7A5A8' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.select option, .select optgroup { background: var(--panel); color: var(--text); }
.input[type="date"], .input[type="time"] { color-scheme: inherit; }
.search { height: 46px; padding: 0 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; color: var(--faint); min-width: 0; }
.search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); font-size: 14px; }
.pw { position: relative; display: flex; }
.pw .input { padding-right: 48px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: none; background: transparent; color: var(--faint); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.err-box { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--red-soft); color: var(--pick); font-size: 13px; animation: open .2s ease-out both; }
.ok-box { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 13px; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--soft); }
.toggle-row .t { display: flex; flex-direction: column; min-width: 0; }
.toggle-row .t b { font-size: 14px; font-weight: 500; }
.toggle-row .t small { font-size: 12px; color: var(--muted); }

/* ---------- Пары ---------- */

.dayline { position: relative; height: 74px; margin-top: 18px; }
.dayline .track { position: absolute; left: 0; right: 0; top: 30px; height: 2px; border-radius: 2px; background: var(--soft-3); }
.dayline .tick { position: absolute; top: 50px; transform: translateX(-50%); font-size: 11px; color: var(--faint); }
.dayline .seg-l { position: absolute; top: 25px; height: 12px; border-radius: 6px; transform-origin: left; animation: draw .8s var(--ease) both; }
.dayline .seg-n { position: absolute; top: 0; font-size: 12px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.dayline .now { position: absolute; top: 22px; width: 18px; height: 18px; margin-left: -9px; border-radius: 999px; background: #fff; border: 4px solid var(--red); animation: ring 2.2s ease-out infinite; }
@media (max-width: 860px) {
  .dayline { height: 46px; margin-top: 4px; }
  .dayline .track { top: 14px; }
  .dayline .seg-l { top: 10px; height: 10px; border-radius: 5px; }
  .dayline .seg-n { display: none; }
  .dayline .tick { top: 30px; font-size: 10px; }
  .dayline .now { top: 7px; width: 16px; height: 16px; margin-left: -8px; }
}
.facts { display: flex; gap: 10px; flex-wrap: wrap; }
.fact { flex: 1 1 250px; display: flex; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; border-radius: 18px; background: var(--soft); border: 1px solid var(--line); min-width: 0; }
.fact .v { padding: 4px 12px; border-radius: 12px; background: var(--red-soft); font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.2; white-space: nowrap; }
.fact .v > span { background: linear-gradient(90deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fact .t { font-size: 14px; color: var(--muted); }
@media (max-width: 860px) {
  .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fact { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border-radius: 16px; background: var(--panel); }
  .fact .v { padding: 1px 8px; border-radius: 9px; font-size: 18px; line-height: 1.3; }
  .fact .t { font-size: 12px; line-height: 1.3; }
}

.lesson {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  column-gap: 20px;
  align-items: center;
  text-align: left;
  color: var(--text);
  width: 100%;
  transition: border-color .25s ease, transform .25s var(--ease), opacity .3s ease;
}
button.lesson:hover { transform: translateY(-2px); border-color: var(--line-3); }
.lesson > :not(.grain) { position: relative; }
.lesson.now { border-color: var(--red-line); background: radial-gradient(90% 140% at 100% 0%, rgba(255, 61, 48, .22), rgba(255, 61, 48, 0) 60%), var(--panel); }
.lesson.done { opacity: .42; }
.lesson .time { display: flex; flex-direction: column; }
.lesson .time b { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.05; letter-spacing: -.02em; }
.lesson .time small { font-size: 13px; color: var(--faint); }
.lesson .mid { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lesson .meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson .num { font-size: 12px; font-weight: 600; color: var(--faint); }
.lesson .subj { font-size: 19px; font-weight: 600; line-height: 1.3; }
.lesson.cancel .subj { text-decoration: line-through; }
.lesson .teacher { font-size: 14px; color: var(--muted); }
.lesson .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.room { padding: 6px 14px; border-radius: 12px; background: var(--soft-2); font-family: var(--display); font-weight: 800; font-size: 22px; white-space: nowrap; }
.lesson.now .room { background: var(--red-chip); }
.lesson.moved .room { background: var(--amber-soft); color: var(--amber); }
.lesson.cancel .room { color: var(--faint); }
.lesson .was { font-size: 12px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--soft-2); color: var(--muted); }
.tag.red { background: var(--red-soft); color: var(--pick); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag .live { width: 6px; height: 6px; border-radius: 999px; background: var(--red); animation: ring 2s ease-out infinite; }
.break { display: flex; justify-content: center; }
.break span { padding: 4px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--faint); }
@media (max-width: 860px) {
  .lesson { border-radius: 22px; padding: 16px; grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: 12px; }
  .lesson .time b { font-size: 21px; line-height: 1.1; }
  .lesson .time small { font-size: 12px; }
  .lesson .mid { gap: 3px; }
  .lesson .num { display: none; }
  .lesson .subj { font-size: 15px; }
  .lesson .teacher { font-size: 12px; }
  .room { padding: 4px 9px; border-radius: 10px; font-size: 15px; }
  .lesson .was { display: none; }
  .tag { padding: 1px 7px; border-radius: 6px; font-size: 11px; }
  .break span { border: none; background: none; padding: 0; }
}
.bells { display: flex; flex-direction: column; gap: 4px; }
.bells div { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; }
.bells .cur { background: var(--red-soft); color: var(--pick); font-weight: 600; }
.bells .past { color: var(--faint); }

.week-nav { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.week-nav .wn-label { min-width: 150px; display: flex; flex-direction: column; align-items: center; }
.week-nav .wn-label b { font-size: 15px; font-weight: 600; }
.week-nav .wn-label small { font-size: 12px; color: var(--muted); }
@media (max-width: 860px) { .week-nav { width: 100%; justify-content: space-between; } .week-nav .wn-label { flex: 1; min-width: 0; } }
.week { overflow-x: auto; }
.week-grid { display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr)); gap: 10px; min-width: 1060px; }
.wday { border-radius: 26px; border: 1px solid var(--line); background: var(--panel); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.wday.today { border-color: var(--red-line); background: radial-gradient(120% 80% at 100% 0%, rgba(255, 61, 48, .2), rgba(255, 61, 48, 0) 60%), var(--panel); }
.wday .hd { display: flex; align-items: center; justify-content: space-between; }
.wday .dt { padding: 2px 10px; border-radius: 10px; background: var(--soft-2); font-family: var(--display); font-weight: 800; font-size: 26px; }
.wday.today .dt { background: var(--red-chip); color: var(--pick); }
.wday .dw { font-family: var(--display); font-weight: 800; font-size: 13px; text-transform: uppercase; color: var(--muted); }
.wl { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--soft); text-align: left; border: none; color: var(--text); width: 100%; }
.wl small { font-size: 12px; color: var(--faint); }
.wl b { font-size: 13px; font-weight: 500; line-height: 1.35; }
.wl.rep small { color: var(--amber); }
.wl.cancel b { text-decoration: line-through; color: var(--faint); }
.wday .none { font-size: 13px; color: var(--faint); padding: 8px 2px; }
.wrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); width: 100%; text-align: left; color: var(--text); }
.wrow.today { border-color: var(--red-line); background: radial-gradient(120% 120% at 100% 0%, rgba(255, 61, 48, .18), rgba(255, 61, 48, 0) 60%), var(--panel); }
.wrow .dt { width: 44px; padding: 2px 0; border-radius: 10px; background: var(--soft-2); text-align: center; font-family: var(--display); font-weight: 800; font-size: 19px; }
.wrow.today .dt { background: var(--red-chip); color: var(--pick); }
.wrow .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wrow .tx b { font-size: 14px; font-weight: 600; }
.wrow .tx small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrow .c { font-size: 12px; color: var(--faint); }

/* ---------- Задания ---------- */

.check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  padding: 0;
  border-radius: 7px;
  border: 1.5px solid var(--line-3);
  background: transparent;
  color: var(--pick-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.check:active { transform: scale(.9); }
.check[aria-pressed="true"] { background: var(--pick); border-color: var(--pick); }
.check svg { opacity: 0; transform: scale(.6); transition: opacity .15s ease, transform .2s var(--ease); }
.check[aria-pressed="true"] svg { opacity: 1; transform: none; }
.check.lg { width: 28px; height: 28px; border-radius: 9px; }
.hw-mini { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; background: var(--soft); }
.hw-mini .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hw-mini .tx b { font-size: 15px; font-weight: 500; }
.hw-mini .tx small { font-size: 13px; color: var(--muted); }
.hw-mini.done .tx b { text-decoration: line-through; color: var(--faint); }
.hw-mini .soon { color: var(--amber) !important; }
.task {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color .2s ease, background-color .2s ease;
}
.task[aria-current="true"] { border-color: var(--red-line); background: radial-gradient(100% 100% at 100% 0%, rgba(255, 61, 48, .12), rgba(255, 61, 48, 0) 60%), var(--panel); }
.task .open { flex: 1; min-width: 0; border: none; background: transparent; color: var(--text); text-align: left; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.task .subj { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .02em; }
.task .ttl { font-size: 16px; font-weight: 600; line-height: 1.35; }
.task .txt { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.task.done .ttl { text-decoration: line-through; color: var(--faint); }
.group-title { margin: 14px 4px 2px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.file-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--soft); text-decoration: none; color: var(--text); }
.file-link:hover { background: var(--soft-2); }
.file-link .ext { width: 40px; height: 40px; border-radius: 11px; background: var(--red-soft); color: var(--pick); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; text-transform: uppercase; flex-shrink: 0; }
.file-link .nm { display: flex; flex-direction: column; min-width: 0; }
.file-link .nm b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-link .nm small { font-size: 12px; color: var(--faint); }

/* ---------- Люди ---------- */

.ava { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
.ava.md { width: 40px; height: 40px; border-radius: 12px; font-size: 13px; }
.ava.lg { width: 72px; height: 72px; border-radius: 22px; font-family: var(--display); font-weight: 800; font-size: 24px; }
.ava.xl { width: 96px; height: 96px; border-radius: 28px; font-family: var(--display); font-weight: 800; font-size: 32px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); min-width: 0; text-align: left; color: var(--text); width: 100%; transition: border-color .2s ease; }
button.person:hover { border-color: var(--line-3); }
.person .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person .tx b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .tx small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-card { border-radius: 28px; border: 1px solid var(--line); background: radial-gradient(100% 80% at 100% 0%, rgba(255, 61, 48, .14), rgba(255, 61, 48, 0) 60%), var(--panel); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.staff-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.staff-card .role { font-size: 12px; font-weight: 600; color: var(--pick); text-transform: uppercase; letter-spacing: .04em; }
.staff-card .nm { font-size: 18px; font-weight: 600; line-height: 1.3; }
.staff-card .ab { font-size: 13px; color: var(--muted); }
.staff-grid { grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
@media (max-width: 860px) {
  .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .staff-card { border-radius: 20px; padding: 14px; gap: 10px; }
  .staff-card .ava.lg { width: 44px; height: 44px; border-radius: 14px; font-size: 15px; }
  .staff-card .nm { font-size: 14px; }
  .staff-card .ab { display: none; }
  .staff-card .role { font-size: 11px; }
  .staff-card .ic { width: 32px; height: 32px; border-radius: 10px; }
}
.ic { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: background-color .2s ease; }
.ic:hover { background: var(--soft-2); }

/* ---------- Объявления ---------- */

.post { border-radius: 28px; border: 1px solid var(--line); background: var(--panel); padding: 22px; display: flex; gap: 14px; }
.post .bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post .who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.post .who b { font-size: 14px; font-weight: 600; }
.post .who small { font-size: 13px; color: var(--faint); }
.post h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; }
.post p { margin: 0; font-size: 15px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.post.pinned { position: relative; overflow: hidden; display: flex; flex-direction: column; border-color: var(--red-line); background: radial-gradient(100% 100% at 100% 0%, rgba(255, 61, 48, .2), rgba(255, 61, 48, 0) 60%), var(--panel); padding: 28px; }
.post.pinned > :not(.grain) { position: relative; }
.post.pinned h2 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.3; }
.attach { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.attach img { max-width: 100%; max-height: 360px; border-radius: 16px; display: block; cursor: zoom-in; }
.soon-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--soft); }
.soon-item .d { width: 52px; padding: 4px 0; border-radius: 12px; background: var(--red-soft); display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.soon-item .d b { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1.1; color: var(--pick); }
.soon-item .d small { font-size: 11px; color: var(--pick); text-transform: uppercase; }
.soon-item .t { display: flex; flex-direction: column; min-width: 0; }
.soon-item .t b { font-size: 14px; font-weight: 500; }
.soon-item .t small { font-size: 12px; color: var(--muted); }
@media (max-width: 860px) {
  .post { border-radius: 22px; padding: 16px; flex-direction: column; gap: 10px; }
  .post.pinned { padding: 18px; }
  .post.pinned h2 { font-size: 18px; }
  .post h3 { font-size: 16px; }
  .post p { font-size: 14px; }
}

/* ---------- Чат ---------- */

.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; height: calc(100vh - 128px); min-height: 520px; }
.rooms { border-radius: 28px; border: 1px solid var(--line); background: var(--panel); padding: 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.rooms h1 { margin: 6px 8px 10px; font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; }
.room-btn { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; border: none; background: transparent; color: var(--text); text-align: left; width: 100%; transition: background-color .15s ease; }
.room-btn:hover { background: var(--soft); }
.room-btn[aria-current="true"] { background: var(--red-soft); }
.room-btn .rs { width: 46px; height: 46px; flex-shrink: 0; border-radius: 15px; background: var(--soft-2); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 13px; }
.room-btn[aria-current="true"] .rs { background: var(--red-chip); color: var(--pick); }
.room-btn .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-btn .tx b { font-size: 15px; font-weight: 600; }
.room-btn .tx small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-btn .lock { font-size: 11px; color: var(--faint); }
.thread-wrap { border-radius: 28px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.thread-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.thread-head small { font-size: 13px; color: var(--muted); }
.thread-head small b { color: var(--green); font-weight: 500; }
.pinned-bar { display: flex; gap: 10px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--soft); text-decoration: none; color: var(--text); border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; }
.pinned-bar i { width: 3px; align-self: stretch; border-radius: 3px; background: var(--red); }
.pinned-bar span { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.pinned-bar span b { color: var(--pick); font-size: 12px; font-weight: 600; }
.pinned-bar span em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.day-sep { align-self: center; padding: 4px 12px; border-radius: 999px; background: var(--soft-2); font-size: 12px; color: var(--muted); margin: 6px 0; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; animation: pop .25s ease-out both; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .ava { width: 32px; height: 32px; border-radius: 10px; font-size: 11px; cursor: pointer; }
.bubble { position: relative; padding: 9px 13px; border-radius: 18px 18px 18px 6px; background: var(--bubble); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg.mine .bubble { background: var(--bubble-me); color: var(--bubble-me-ink); border-color: transparent; border-radius: 18px 18px 6px 18px; }
.bubble .nm { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--pick); }
.bubble .badge { padding: 1px 6px; border-radius: 6px; background: var(--soft-3); color: var(--muted); font-size: 10px; font-weight: 600; }
.bubble .tx { font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bubble .tx a { color: inherit; }
.bubble .rep { padding: 4px 8px; border-left: 2px solid currentColor; border-radius: 4px; background: var(--soft-2); font-size: 12px; opacity: .85; display: flex; flex-direction: column; }
.msg.mine .bubble .rep { background: rgba(0, 0, 0, .15); }
.bubble .media { max-width: 320px; max-height: 320px; border-radius: 12px; display: block; cursor: zoom-in; }
.bubble video.media { cursor: default; }
.bubble audio { max-width: 260px; }
.bubble .file { display: flex; gap: 8px; align-items: center; color: inherit; text-decoration: none; font-size: 13px; }
.bubble .file b { padding: 6px 8px; border-radius: 8px; background: var(--soft-3); font-size: 10px; text-transform: uppercase; }
.msg .foot { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--faint); padding: 0 4px; flex-wrap: wrap; }
.msg.mine .foot { justify-content: flex-end; }
.reacts { display: flex; gap: 4px; flex-wrap: wrap; }
.react { height: 24px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.react[aria-pressed="true"] { border-color: var(--red-line); background: var(--red-soft); }
.msg-menu { position: fixed; z-index: 50; min-width: 200px; padding: 6px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: pop .15s ease-out both; }
.msg-menu .emo { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.msg-menu .emo button { width: 34px; height: 34px; border: none; border-radius: 10px; background: transparent; font-size: 18px; }
.msg-menu .emo button:hover { background: var(--soft-2); }
.msg-menu > button { height: 38px; padding: 0 12px; border: none; border-radius: 10px; background: transparent; color: var(--text); font-size: 14px; text-align: left; }
.msg-menu > button:hover { background: var(--soft-2); }
.msg-menu > button.bad { color: #FF8A80; }
.composer { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.composer .ctx { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--soft); font-size: 13px; }
.composer .ctx span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; resize: none; min-height: 46px; max-height: 160px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-size: 15px; line-height: 1.4; outline: none; }
.composer .send { width: 46px; height: 46px; border-radius: 15px; border: none; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s ease, opacity .2s ease; }
.composer .send:active { transform: scale(.94); }
.composer .att { width: 46px; height: 46px; border-radius: 15px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-lock { max-width: 520px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
@media (max-width: 860px) {
  .chat { display: block; height: auto; min-height: 0; }
  .chat.in-room .rooms { display: none; }
  .chat:not(.in-room) .thread-wrap { display: none; }
  .rooms { border: none; background: transparent; padding: 0; }
  .rooms h1 { margin: 4px 2px 10px; font-size: 26px; }
  .room-btn { background: var(--panel); border: 1px solid var(--line); margin-bottom: 6px; }
  .thread-wrap { position: fixed; inset: 0; z-index: 35; border-radius: 0; border: none; background: var(--page); }
  .thread-head { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
  .thread { padding: 12px; }
  .msg { max-width: 88%; }
  .bubble .media { max-width: 240px; }
  .composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
}

/* ---------- Профиль и вход ---------- */

.profile-hero { position: relative; overflow: hidden; border-radius: 40px; border: 1px solid var(--line); background: radial-gradient(100% 100% at 100% 0%, rgba(255, 61, 48, .24), rgba(255, 61, 48, 0) 58%), var(--hero); padding: 36px 40px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.profile-hero > :not(.grain) { position: relative; }
.profile-hero .who { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 12px; }
.profile-hero .who .chips span { padding: 4px 10px; border-radius: 9px; background: var(--soft-2); font-size: 13px; }
.kv-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.kv-row:first-of-type { border-top: none; }
.kv-row .k { width: 150px; flex-shrink: 0; font-size: 14px; color: var(--muted); }
.kv-row .v { flex: 1; min-width: 0; font-size: 15px; word-break: break-word; }
.kv-row .a { border: none; background: transparent; color: var(--pick); font-size: 14px; font-weight: 600; padding: 4px; }
.code-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code { padding: 8px 16px; border-radius: 14px; background: var(--red-soft); font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .08em; color: var(--pick); }
@media (max-width: 860px) {
  .profile-hero { border-radius: 28px; padding: 22px 20px; gap: 16px; }
  .kv-row { flex-wrap: wrap; gap: 2px 12px; }
  .kv-row .k { width: 100%; font-size: 12px; }
}

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; padding: 20px; max-width: 1240px; margin: 0 auto; align-items: stretch; }
.auth .pitch { position: relative; overflow: hidden; border-radius: 40px; border: 1px solid var(--line); background: radial-gradient(110% 90% at 88% 0%, rgba(255, 61, 48, .26) 0%, rgba(255, 61, 48, 0) 55%), radial-gradient(70% 80% at 0% 100%, rgba(140, 28, 20, .30) 0%, rgba(140, 28, 20, 0) 60%), var(--hero); padding: 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.auth .pitch > :not(.grain) { position: relative; }
.auth .brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.auth .brand img { width: 44px; height: 44px; border-radius: 999px; }
.auth .perks { display: flex; flex-direction: column; gap: 10px; }
.auth .form-side { border-radius: 40px; border: 1px solid var(--line); background: var(--panel); padding: 44px; display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; padding: 14px; min-height: 0; }
  .auth .pitch { border-radius: 28px; padding: 22px 20px; gap: 14px; }
  .auth .pitch .perks { display: none; }
  .auth .form-side { border: none; background: transparent; padding: 4px 2px 40px; }
}

/* ---------- Модальные окна и всплывающее ---------- */

.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .62); animation: fade .2s ease-out both; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 32px; border: 1px solid var(--line-2); background: var(--panel); padding: 26px; display: flex; flex-direction: column; gap: 16px; animation: pop .25s var(--ease) both; box-shadow: var(--shadow); }
.modal .mh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal .x { width: 36px; height: 36px; border-radius: 11px; border: none; background: var(--soft-2); color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
@media (max-width: 860px) {
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 28px 28px 0 0; padding: 12px 18px calc(24px + env(safe-area-inset-bottom)); max-height: 88vh; animation: sheet .3s var(--ease) both; }
  .modal::before { content: ""; align-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--line-3); margin-bottom: 4px; }
}
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease-out both; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

.toasts { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: toastIn .3s var(--ease) both; transition: opacity .25s ease, transform .25s ease; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; background: var(--green); }
.toast.bad::before { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }
@media (max-width: 860px) { .toasts { left: 14px; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); align-items: stretch; } .toast { max-width: none; } }

.banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.banner.amber { border-color: rgba(232, 163, 61, .35); background: linear-gradient(90deg, var(--amber-soft), transparent 70%), var(--panel); }
.banner.red { border-color: var(--red-line); background: linear-gradient(90deg, var(--red-soft), transparent 70%), var(--panel); }
.banner .t { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.banner .t b { font-size: 15px; font-weight: 600; }
.banner .t small { font-size: 13px; color: var(--muted); }

.empty { margin: 0; padding: 22px; border-radius: 20px; border: 1px dashed var(--line-2); text-align: center; color: var(--muted); font-size: 14px; }
.lock { max-width: 560px; margin: 30px auto; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.lock .ico { width: 64px; height: 64px; border-radius: 20px; background: var(--red-soft); color: var(--pick); display: flex; align-items: center; justify-content: center; }
.skel { border-radius: 22px; background: linear-gradient(90deg, var(--soft), var(--soft-3), var(--soft)); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 5px; height: 5px; border-radius: 999px; background: currentColor; animation: dots 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.offline { position: fixed; z-index: 90; top: 0; left: 0; right: 0; padding: 6px 12px calc(6px); text-align: center; font-size: 13px; background: var(--amber); color: #1A1206; animation: open .2s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
