:root {
  color-scheme: dark;
  --bg: #111;
  --panel: #181818;
  --raised: #222;
  --edge: #393939;
  --text: #fff;
  --dim: #c0c0c0;
  --accent: #fdd600;
  --font: Inter, TildaSans, "Segoe UI", Roboto, Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--font); }
a { color: var(--accent); }
a:hover { text-decoration: none; }
.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
header { background: #0b0b0b; border-bottom: 1px solid var(--edge); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.bar a { color: var(--text); font-weight: 750; text-decoration: none; }
.brand strong { color: var(--accent); }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  margin: 1.6rem 0; padding: clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--edge); border-radius: 26px;
  background: radial-gradient(ellipse at 73% 110%, #3e3b27, transparent 66%), #080808;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(134deg, transparent 45%, #ffefac20 75%, #ffefac35);
  clip-path: polygon(73% 0, 76% 0, 100% 100%, 41% 100%);
}
.hero p { margin: .55rem 0; }
.hero.with-announcer { min-height: clamp(14rem, 28vw, 21rem); }
.hero.with-announcer > :is(p,h1) { position: relative; z-index: 1; }
.hero.with-announcer > p { max-width: 58%; }
.hero.with-announcer > h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
.stage-speaker {
  pointer-events: none; position: absolute; width: min(43%, 355px, 35vw); aspect-ratio: 1346/1168;
  right: clamp(.3rem, 1.8vw, 1.6rem); bottom: -.3rem;
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
.stage-speaker img { display: block; width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .stage-speaker { animation: speaker-breath 6.1s ease-in-out infinite; transform-origin: 68% 88%; }
  @keyframes speaker-breath { 48% { transform: translateY(-3px) rotate(-.4deg) scale(1.008); } }
}
.eyebrow { font-size: .85rem; letter-spacing: .13em; font-weight: 800; color: var(--accent); }
h1, h2, h3 { line-height: 1.14; }
h1 { font-size: clamp(2.6rem, 8vw, 6rem); letter-spacing: -.065em; font-weight: 900; margin: .6rem 0 1rem; }
h1 span { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  @supports (background-clip: text) {
    .hero h1 span {
      background: linear-gradient(112deg, #fdd600 44%, #ffe56f 51%, #fdd600 58%) 100% 50% / 265% 100%;
      background-clip: text; color: transparent; animation: title-reflection 14s ease-in-out infinite;
    }
    @keyframes title-reflection { 0%, 76% { background-position: 100% 50%; } 96%, 100% { background-position: 0% 50%; } }
  }
  :is(button.primary, a.primary, #tabs button[aria-current], #tabs button[data-live-call]) {
    position: relative; overflow: hidden;
  }
  :is(button.primary, a.primary, #tabs button[aria-current], #tabs button[data-live-call]):not(:disabled)::after {
    content: ""; position: absolute; inset: -2px; pointer-events: none;
    background: linear-gradient(110deg, transparent 35%, #fff5 49%, transparent 63%);
    transform: translateX(-120%); animation: button-reflection 16s ease-in-out infinite;
  }
  :is(button.primary, a.primary, #tabs button[aria-current]):nth-child(even)::after { animation-delay: 2s; }
  @keyframes button-reflection { 0%, 76% { transform: translateX(-120%); } 94%, 100% { transform: translateX(120%); } }
}
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); margin: .35rem 0 1rem; }
h3 { margin: .5rem 0; }
small, .muted { color: var(--dim); }
.status:empty { display: none; }
nav, .actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1rem; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--edge); border-radius: 999px; padding: .58rem .9rem;
  font: 750 .94rem/1.3 var(--font); color: var(--text); background: var(--raised);
  text-align: center; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { border-color: var(--accent); }
button[aria-current], .primary {
  color: #111; background: var(--accent); border-color: var(--accent);
  box-shadow: 0 10px 25px -17px #fdd600;
}
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }
[hidden] { display: none !important; }
#view, .entrance { margin-bottom: 2rem; }
.entrance { max-width: 650px; }
.grid { display: grid; grid-template-columns: minmax(160px, 240px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.days { display: grid; gap: .4rem; max-height: 38rem; overflow: auto; }
.days button { display: block; text-align: left; border-radius: 12px; }
.days small { display: block; }
button[aria-current] small { color: #302900; }
.card, .days { border: 1px solid var(--edge); background: var(--panel); border-radius: 20px; padding: clamp(.9rem, 2.7vw, 1.55rem); }
.card + .card { margin-top: 1rem; }
label { display: grid; gap: .3rem; margin: .75rem 0; }
input, textarea, select {
  width: 100%; padding: .55rem .7rem; border: 1px solid #5c5c5c; border-radius: 10px;
  font: inherit; color: var(--text); background: #111;
}
.check { display: flex; align-items: center; gap: .55rem; }
.check input { width: auto; accent-color: var(--accent); }
.payment-qr { display: block; width: min(230px, 100%); aspect-ratio: 1; margin: 0 0 1rem; background: white; border-radius: 12px; }
[data-regular], [data-student] { padding: 0; border: 0; max-height: none; }
textarea { min-height: 4.75rem; resize: vertical; }
form .actions { margin-top: 1rem; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.video { display: block; width: 100%; aspect-ratio: 16/9; background: #060606; border: 0; border-radius: 14px; }
.contacts { margin-top: 1rem; display: grid; gap: .3rem; }
.teacher, .positive { color: var(--accent); }
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.team-grid .team-person { display: flex; flex-direction: column; margin: 0; padding: 0; min-width: 0; overflow: hidden; }
.team-person img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 32%; background: #222; }
.team-copy { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.15rem; }
.team-copy button { align-self: flex-start; margin-top: auto; }
.team-copy h3 { margin: 0; }
.team-copy p { margin: .45rem 0 .7rem; }
@media (max-width: 720px) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .team-copy { padding: .7rem; }
  .team-copy h3 { font-size: 1rem; }
  .team-copy p { font-size: .87rem; }
}
.negative { color: #ff9e97; }
details { border-top: 1px solid var(--edge); padding: .6rem 0; }
summary { cursor: pointer; }
output { display: block; margin-top: .6rem; overflow-wrap: anywhere; }
output input { margin: .5rem 0; }
.school-chat-open .hero, .school-chat-open #status { display: none; }
.school-chat-open #platform { padding-top: .8rem; }
.school-chat-open #view { margin-bottom: .8rem; }
.messenger {
  display: grid; grid-template-columns: minmax(240px, 30%) minmax(0, 1fr);
  height: max(31rem, calc(100dvh - 9rem)); overflow: hidden; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 18px;
}
.chat-side, .chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-side { background: #161616; border-right: 1px solid var(--edge); }
.chat-side-head { display: flex; gap: .3rem; align-items: center; padding: .6rem .8rem .35rem; }
.chat-side-head h2 { flex: 1; margin: 0; }
.chat-list-search { display: flex; align-items: center; gap: .5rem; margin: .1rem .65rem .45rem; padding: 0 .6rem; border-radius: 18px; background: #222; }
.chat-list-search svg { flex: none; width: 17px; height: 17px; color: var(--dim); }
.chat-list-search input { min-width: 0; border: 0; background: transparent; }
.chat-filters { display: flex; gap: .15rem; margin: 0 .6rem .4rem; }
.chat-filters button { flex: 1; padding: .45rem .25rem; border: 0; background: transparent; color: var(--dim); font-size: .82rem; }
.chat-filters button[aria-pressed="true"] { background: #3c3517; color: var(--accent); }
.chat-side [data-rooms] { flex: 1; min-height: 0; padding: .25rem .45rem; overflow: auto; overscroll-behavior: contain; }
.room-row {
  display: grid; grid-template-columns: 2.35rem minmax(0, 1fr) auto; width: 100%;
  gap: .55rem; padding: .47rem; border-radius: 10px; border-color: transparent;
  text-align: left; background: transparent; box-shadow: none;
}
.room-row .avatar { width: 2.35rem; height: 2.35rem; }
.room-row .row-copy { min-width: 0; display: grid; gap: .2rem; }
.row-copy strong, .row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-copy small, .row-meta time { color: var(--dim); font-weight: 500; font-size: .74rem; }
.row-meta { display: grid; justify-items: end; gap: .15rem; }
.room-row[aria-current] .row-copy small, .room-row[aria-current] time { color: #3d3300; }
.room-row > svg { width: 17px; height: 17px; color: var(--dim); }
.chat-empty { margin: 1rem; font-size: .9rem; color: var(--dim); }
.topic-rows { display: grid; gap: .25rem; padding-left: .8rem; }
.topic-rows:empty { display: none; }
.topic-rows .room-row { background: #151515; }
.topic-rows .room-row[aria-current] { background: var(--accent); }
.unread { min-width: 1.2rem; padding-inline: .2rem; border-radius: 20px; background: #111; color: var(--accent); text-align: center; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; }
.letter { display: inline-grid; place-items: center; color: #111; background: #d6bf47; }
.chat-side .profile { align-self: flex-start; margin: .45rem .65rem; padding: .25rem .55rem; background: transparent; border-color: transparent; }
.room-head { display: flex; align-items: center; gap: .6rem; }
.room-head { flex-wrap: nowrap; min-height: 3.45rem; padding: .4rem .65rem; border-bottom: 1px solid var(--edge); background: #171717; }
.room-title { flex: 1; min-width: 0; }
.room-head h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.room-head small { display: block; line-height: 1.2; font-size: .74rem; }
.chat-icon {
  width: 2.5rem; height: 2.5rem; flex: none; display: inline-grid; place-items: center;
  padding: 0; background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer;
}
.chat-icon:hover, .chat-icon[aria-expanded="true"] { border-color: var(--edge); background: #303030; }
.chat-icon.primary { background: var(--accent); color: #111; }
.chat-icon svg { width: 1.25rem; height: 1.25rem; display: block; }
.chat-header-menu { position: relative; padding: 0; border: 0; }
.chat-header-menu summary { list-style: none; }
.chat-header-menu summary::-webkit-details-marker { display: none; }
.chat-header-menu > div { position: absolute; z-index: 3; top: 100%; right: 0; min-width: max-content; padding: .35rem; border: 1px solid var(--edge); background: var(--panel); border-radius: 10px; }
.chat-header-menu > div button { display: flex; width: 100%; border: 0; background: transparent; justify-content: start; padding: .45rem .6rem; }
[data-search] { display: flex; gap: .55rem; align-items: flex-end; margin: .35rem .65rem; }
[data-search] label { flex: 1; margin: 0; }
.posts {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex;
  flex-direction: column; gap: .55rem; padding: .7rem clamp(.65rem, 4%, 2rem);
  background: radial-gradient(ellipse at bottom right, #202020, transparent 63%), #101010;
}
.posts > * { flex-shrink: 0; }
.chat-main [data-older] { align-self: center; margin: .25rem 0; }
.chat-main [data-chat-status] { margin: .2rem .65rem; color: var(--dim); }
.chat-main [data-chat-status]:empty { display: none; }
.chat-main [data-recording] { padding: .3rem .65rem; }
.chat-main [data-chat-form] { flex: none; padding: .4rem .65rem; border-top: 1px solid var(--edge); }
.chat-compose-row { display: flex; align-items: flex-end; gap: .18rem; }
.chat-compose-row textarea {
  flex: 1; width: auto; min-width: 0; min-height: 2.5rem; max-height: 7rem; field-sizing: content;
  resize: none; padding: .48rem .4rem; border: 1px solid transparent; background: transparent;
}
.chat-main .pins { margin: 0 .65rem; }
.bubble { position: relative; align-self: flex-start; background: #252525; padding: .3rem .45rem .3rem .62rem; max-width: min(80%, 42rem); width: fit-content;
  border: 0; border-radius: 5px 15px 15px; overflow-wrap: anywhere; }
.bubble.own { align-self: flex-end; background: #323232; border-radius: 15px 5px 15px 15px; }
.bubble-author { display: flex; gap: .3rem; align-items: baseline; color: #e8ce69; font-size: .78rem; }
.bubble-author strong { max-width: 17ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble-content { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; column-gap: .4rem; }
.bubble-body { min-width: 0; max-width: 100%; flex: 1 1 auto; }
.bubble-meta { display: flex; align-items: center; gap: .13rem; flex: none; }
.bubble time { color: var(--dim); font-size: .7rem; white-space: nowrap; }
.bubble blockquote { margin: .2rem 0; padding: .2rem .45rem; border-left: 2px solid #888; background: #111; border-radius: 3px; }
.bubble-menu { position: relative; margin: 0; padding: 0; border: 0; }
.bubble-menu summary { display: grid; place-items: center; width: 1.7rem; height: 1.65rem; color: var(--dim); list-style: none; }
.bubble-menu summary::-webkit-details-marker { display: none; }
.bubble-menu summary svg { width: .95rem; height: .95rem; }
.bubble-menu > .actions { position: absolute; z-index: 3; inset: auto 0 100% auto; display: grid; min-width: max-content; padding: .25rem;
  background: #232323; border: 1px solid var(--edge); border-radius: .55rem; }
.bubble:not(.own) .bubble-menu > .actions { inset-inline: 0 auto; }
.bubble-menu > .actions button { text-align: left; }
.bubble .actions button { padding: .35rem .55rem; }
.reactions { display: flex; flex-wrap: wrap; justify-content: start; gap: .25rem; margin-top: .2rem; }
.bubble.own .reactions { justify-content: end; }
.reactions button { display: inline-flex; align-items: center; gap: .25rem; padding: .16rem .45rem; font-size: .74rem;
  border: 0; box-shadow: none; background: #404040; }
.reactions button[aria-pressed="true"] { background: #565656; }
.bubble[data-reaction-open] { margin-bottom: 2.8rem; }
.bubble-quick-reactions { position: absolute; top: calc(100% + .3rem); left: 0; z-index: 3; display: flex; align-items: center; gap: .12rem;
  width: max-content; padding: .24rem .3rem; background: #252525; border: 1px solid #494949; border-radius: 999px; box-shadow: 0 5px 16px #0008; }
.bubble.own .bubble-quick-reactions { left: auto; right: 0; }
.bubble-quick-reactions button { display: grid; place-items: center; width: clamp(1.65rem, 8.4vw, 2.12rem); height: 2rem; padding: 0;
  background: none; border: 0; font-size: 1.18rem; border-radius: 50%; }
.bubble-quick-reactions :is(button:hover, button[aria-pressed="true"]) { background: #474747; }
@media (prefers-reduced-motion: no-preference) {
  .bubble-quick-reactions { animation: reaction-appear .16s ease-out both; }
  @keyframes reaction-appear { from { opacity: 0; transform: translateY(-.32rem) scale(.94); } }
}
[data-media] img, [data-media] audio, [data-media] video { display: block; max-width: 100%; margin-bottom: .45rem; border-radius: 10px; }
.circle, [data-media] .circle { display: block; width: min(220px, 58vw); aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #000; }
.attach { margin: 0; position: relative; overflow: hidden; }
.attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attach:focus-within { outline: 2px solid white; }
.chat-dialog { max-width: min(560px, calc(100% - 24px)); width: 100%; max-height: 85vh; color: var(--text); background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; padding: 1.25rem; }
.chat-dialog::backdrop { background: #000b; }
fieldset { border: 1px solid var(--edge); border-radius: 10px; max-height: 32vh; overflow: auto; }
.support-controls { max-height: none; margin: 1rem 0; }
.support-controls form + form { border-top: 1px solid var(--edge); margin-top: .8rem; padding-top: .5rem; }
.chat-icon.back-to-chats { display: none; }
[data-record] { touch-action: none; user-select: none; -webkit-touch-callout: none; }
[data-recording]:empty { display: none; }
[data-recording] button { margin: .45rem .3rem 0 0; }
.compose-hint { font-size: .84rem; }
[data-emoji-picker] { padding: .6rem; border: 1px solid var(--edge); border-radius: 12px; }
[data-emoji-grid] { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.25rem, 1fr)); gap: .2rem; max-height: 14rem; overflow: auto; }
[data-emoji-grid] button { font-size: 1.25rem; padding: .3rem; border-radius: 8px; }
.contacts [data-write] { font-size: .85rem; margin: .2rem; padding: .4rem .7rem; }
.quiz-question { border: 1px solid var(--edge); border-radius: 12px; padding: .65rem .8rem; margin-bottom: .85rem; max-height: none; overflow: visible; }
.quiz-question legend { padding: 0 .25rem; overflow-wrap: anywhere; font-weight: 750; }
.animated-emoji-grid, [data-emoji-grid].animated-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.2rem, 1fr)); gap: .4rem; }
.reaction-palette { margin-bottom: .8rem; max-height: 40dvh; overflow: auto; padding: .3rem; }
.animated-emoji-grid .emoji-tile {
  width: 3rem; aspect-ratio: 1; display: inline-grid; place-items: center; padding: 0;
  border: 1px solid #635220; border-radius: 50%; font-size: 1.86rem; justify-self: center;
  background: radial-gradient(circle at 34% 22%, #4b3d20, #24211b 70%);
}
.reaction-dot { display: inline-grid; place-items: center; font-size: 1.35rem; }
.emoji-glyph { position: relative; display: inline-grid; place-items: center; width: 1.12em; height: 1.12em; vertical-align: -.17em; }
.emoji-art {
  display: block; width: 100%; height: 100%; color: transparent; line-height: 1;
  background-image: url("https://tmbaranova.ru/ucheba/emoji-fluent.webp");
  background-repeat: no-repeat; background-size: calc(var(--emoji-columns) * 100%) calc(var(--emoji-rows) * 100%);
  background-position: var(--emoji-x) var(--emoji-y);
}
.emoji-native { line-height: 1; }
.emoji-avatar { display: inline-grid; place-items: center; background: #312b1a; color: #fff; font-size: 1.65rem; }
.text.text-emoji-only { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; font-size: 2.15rem; line-height: 1; }
[data-avatar-emoji-preview] { display: inline-flex; align-items: center; gap: .35rem; }
.emoji-mic::after { content: "Zz"; position: absolute; font: 800 .4em/1 var(--font); right: -.06em; top: -.06em; color: #fff2a8; text-shadow: 0 1px #100; }
.emoji-tile[aria-pressed="true"] { border-color: var(--accent); }
#tabs [data-live-call], .live-join { background: var(--accent); border-color: var(--accent); color: #111; }
@media (prefers-reduced-motion: no-preference) {
  #tabs [data-live-call], .live-join { animation: live-call-glow 2s ease-in-out infinite; }
  @keyframes live-call-glow { 50% { box-shadow: 0 0 14px #fdd6708a; } }
  .emoji-tile > span { animation: emoji-pop .64s ease-in-out both; }
  .emoji-tile:nth-child(3n+2) > span { animation-delay: .08s; }
  .emoji-tile:nth-child(3n) > span { animation-delay: .16s; }
  .emoji-tile:hover > span, .emoji-tile:focus-visible > span { animation: emoji-dance .7s ease-in-out infinite alternate; }
  .reactions button:active .reaction-dot { transform: scale(1.15); }
  .emoji-book::after {
    content: ""; position: absolute; width: 36%; height: 57%; top: 18%; left: 47%;
    border-radius: 2px; background: linear-gradient(130deg, #d2905d, #915345); border: 1px solid #e5aa78;
    transform-origin: left; animation: emoji-book-open 4.3s ease-in-out infinite;
  }
  .emoji-mic::after { animation: emoji-mic-doze 3.1s ease-out infinite; }
  .text-emoji-only .emoji-glyph, .emoji-avatar .emoji-glyph { animation: emoji-idle 5.2s ease-in-out infinite; }
  @keyframes emoji-idle { 12% { transform: translateY(-.12em) rotate(-7deg) scale(1.07); } 22% { transform: rotate(5deg); } 34%, 100% { transform: none; } }
  @keyframes emoji-book-open {
    0%, 70%, 100% { opacity: 0; transform: perspective(60px) rotateY(-87deg); }
    16%, 29% { opacity: .82; transform: perspective(60px) rotateY(6deg); }
    54% { opacity: .3; transform: perspective(60px) rotateY(-56deg); }
  }
  @keyframes emoji-mic-doze {
    0%, 82% { opacity: 0; transform: translate(-.1em, .32em); }
    18%, 43% { opacity: 1; }
    68% { opacity: 0; transform: translate(.35em, -.8em); }
  }
  @keyframes emoji-pop { 20%, 72% { transform: scale(1.16) rotate(-10deg); } 47% { transform: scale(.92) rotate(9deg); } }
  @keyframes emoji-dance { to { transform: translateY(-3px) scale(1.14) rotate(10deg); } }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 28px); }
  .bar { gap: .6rem; min-height: 3.25rem; padding-block: .35rem; font-size: .85rem; }
  .bar a:last-child { flex: none; }
  .hero { padding: 1.2rem; margin: .85rem 0; border-radius: 18px; }
  .hero h1 { font-size: clamp(2.1rem, 10vw, 3.4rem); margin: .4rem 0; }
  .hero p:last-child { font-size: .88rem; }
  .hero.with-announcer { min-height: 14rem; padding-right: 1rem; }
  .hero.with-announcer > h1 { font-size: clamp(2.15rem, 10vw, 3.65rem); max-width: 61%; }
  .hero.with-announcer > h1 span { display: block; }
  .hero.with-announcer > p { max-width: 52%; font-size: clamp(.68rem, 2.75vw, .9rem); }
  .stage-speaker { width: 53%; right: -.55rem; bottom: .4rem; }
  #tabs { gap: .38rem; }
  #tabs button { flex: 1 1 auto; min-height: 40px; padding: .45rem .65rem; font-size: .84rem; white-space: nowrap; }
  .grid > *, .card, .contacts > *, .support-controls { min-width: 0; }
  .card { overflow-wrap: anywhere; }
  .card input, .card select, .card textarea, .chat-side input, .chat-main input, .chat-main textarea { font-size: 16px; }
  .card input[type="file"] { overflow: hidden; text-overflow: ellipsis; }
  .card button:not(.chat-icon), .card .button { min-height: 42px; }
  .grid, .messenger { grid-template-columns: 1fr; }
  .days { grid-auto-flow: column; grid-auto-columns: minmax(4.15rem, auto); max-height: none; overflow: auto hidden; padding: .4rem; }
  .days button { padding: .45rem; text-align: center; white-space: nowrap; }
  .days small { display: none; }
  .school-chat-open > header { display: none; }
  .school-chat-open main.wrap { width: 100%; }
  .school-chat-open #platform { padding: 0; min-height: var(--school-viewport, 100dvh); display: flex; flex-direction: column; }
  .school-chat-open #tabs { flex-wrap: nowrap; overflow: auto hidden; margin: 0; padding: .25rem; scrollbar-width: none; }
  .school-chat-open #tabs button { flex: none; min-height: 35px; }
  .school-chat-open #view { margin: 0; }
  .messenger { height: max(17rem, calc(var(--school-viewport, 100dvh) - 2.75rem)); border-width: 1px 0 0; border-radius: 0; }
  .chat-side { border: 0; }
  .messenger[data-room-open="false"] .chat-main,
  .messenger[data-room-open="true"] .chat-side { display: none; }
  .chat-icon.back-to-chats { display: inline-grid; }
  .room-head { gap: .25rem; padding-inline: .3rem; }
  .chat-main [data-chat-form] { padding: .3rem .35rem max(.35rem, env(safe-area-inset-bottom)); }
  .chat-compose-row .chat-icon { width: 2.45rem; height: 2.65rem; }
  .bubble { max-width: 88%; }
}
.conference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.conference-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: #080808;
  border: 1px solid var(--edge);
  border-radius: 14px;
}
.conference-tile video {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #080808;
}
.conference-tile figcaption {
  position: absolute;
  left: .55rem;
  bottom: .55rem;
  max-width: calc(100% - 1.1rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: .2rem .55rem;
  border-radius: 7px;
  background: #000c;
  font-size: .85rem;
}
[data-conf][aria-pressed="true"] { color: #111; background: var(--accent); border-color: var(--accent); }
@media (min-width: 950px) {
  .conference-grid:has(.conference-tile:nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.android-actions { margin: 0 0 14px; }
.android-actions output { flex: 1 0 100%; font-size: .9rem; }
body:not(.android-app) .android-only, .android-app [data-android-download], .android-app .android-only-web { display: none; }


.room-with-topics { display: grid; grid-template-columns: minmax(0, 1fr) 2.7rem; gap: .2rem; align-items: stretch; }
.room-with-topics .room-row { min-width: 0; }
.room-with-topics .topic-fold { padding: 0; min-height: 44px; border-radius: .6rem; font-size: 1.1rem; }
.topic-rows[hidden] { display: none; }

.sfu-grid { --camera-ratio: 4 / 3; display: grid; gap: .5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sfu-grid:has(.portrait-camera) { --camera-ratio: 4 / 5; }
@media (orientation: portrait) {
  .conference-tile { aspect-ratio: 4 / 5; }
}
.sfu-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.sfu-grid.sfu-large { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sfu-tile { position: relative; min-width: 0; aspect-ratio: var(--camera-ratio); overflow: hidden; display: grid;
  place-items: center; border: 1px solid #444; border-radius: .65rem; background: #202020; }
.sfu-tile video { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.sfu-tile.has-screen video { object-fit: contain; }
.sfu-tile.mirror-camera:not(.has-screen) video { transform: scaleX(-1); }
.personal-call-head [data-conf="mirror"] { margin-inline-start: auto; padding: .35rem .6rem; font-size: .8rem; }
.sfu-tile.has-video .sfu-avatar { visibility: hidden; }
.sfu-avatar { display: grid; place-items: center; border-radius: 50%; color: #151515; background: #ffd600;
  width: 2.5em; height: 2.5em; font-size: clamp(.8rem, 2vw, 1.2rem); font-weight: 700; }
.sfu-name { position: absolute; bottom: .3rem; left: .3rem; right: .3rem; width: fit-content; max-width: calc(100% - .6rem);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .15rem .35rem; color: #fff;
  background: #111d; border-radius: .25rem; font-size: clamp(.68rem, 1.25vw, .95rem); }
.sfu-name::before { content: '🔇 '; }
.sfu-tile.mic-on .sfu-name::before { content: ''; }
.sfu-tile.speaking { border-color: #ffd600; }
.sfu-tile.sfu-lead { grid-column: 1 / -1; order: -1; width: 100%; aspect-ratio: 16 / 9;
  max-height: 52vh; max-height: 52svh; }
.sfu-large .portrait-camera.sfu-lead:not(.school-full-view) { grid-column: span 3; grid-row: span 2; aspect-ratio: 4 / 5; max-height: none; }
@media (max-width: 820px) {
  .sfu-large .portrait-camera.sfu-lead:not(.school-full-view) { grid-column: span 2; }
}
.sfu-room [data-conf-controls] { position: sticky; top: 0; z-index: 2; padding: .35rem 0; background: var(--card, #181818); }
.sfu-room [data-conf-controls] button[aria-pressed="true"] { color: #151515; background: #ffd600; }
.sfu-room [data-conf-controls][hidden] { display: none; }
@media (max-width: 820px) { .sfu-grid.sfu-large { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .sfu-grid.sfu-large { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sfu-room [data-conf-controls] button { min-height: 44px; }
  .sfu-tile.sfu-lead { max-height: 42vh; max-height: 42svh; }
}


.webinar-chat-card { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .65rem .9rem;
  margin: .35rem .65rem; border: 1px solid #5f5520; border-radius: .7rem; background: #242216; }
.webinar-chat-card span { color: #e5d481; }
.webinar-chat-card[hidden], .webinar-panel[hidden], .webinar-panel [hidden] { display: none !important; }
.webinar-guest-label, .webinar-panel [data-wb-posts] small { color: #f9db58; font-size: .8rem; }
.webinar-panel { background: #151515; color: #f8f8f8; border: 1px solid #393939; border-radius: 1rem; padding: clamp(.7rem, 2vw, 1.35rem); }
.webinar-overlay { position: fixed; z-index: 11000; inset: max(.35rem, env(safe-area-inset-top)) max(.35rem, env(safe-area-inset-right))
  max(.35rem, env(safe-area-inset-bottom)) max(.35rem, env(safe-area-inset-left)); overflow: auto; overscroll-behavior: contain; }
.webinar-heading { display: flex; justify-content: space-between; align-items: start; gap: .65rem; flex-wrap: wrap; margin-bottom: .85rem; }
.webinar-heading h2 { margin: .25rem 0; }
.webinar-heading [data-wb-heading] { display: flex; flex-wrap: wrap; gap: .45rem; }
.webinar-heading [data-wb-state] { margin: 0; color: #f9db58; font-size: .90rem; }
.webinar-layout { display: flex; align-items: start; gap: .75rem; }
.webinar-main { flex: 1 1 0; min-width: 0; }
.webinar-waiting, .webinar-stage { background: #0d0d0d; border-radius: .8rem; padding: .65rem; text-align: center; overflow: hidden; }
.webinar-waiting img { display: block; max-width: 100%; max-height: 58vh; margin: 0 auto; object-fit: contain; }
.webinar-waiting audio { width: min(100%, 25rem); }
.webinar-tiles { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .5rem; }
.webinar-tiles figure { position: relative; min-width: 0; margin: 0; overflow: hidden; border-radius: .5rem; background: #080808; }
.webinar-tiles video { display: block; width: 100%; max-height: 68vh; aspect-ratio: 16 / 9; object-fit: contain; }
.webinar-tiles figcaption { position: absolute; left: .35rem; bottom: .35rem; background: #171717e8; padding: .15rem .4rem; border-radius: .3rem; }
.webinar-tiles.has-screen { display: block; }
.webinar-tiles.has-screen figure:not(.webinar-screen):not(.webinar-inset) { display: none; }
.webinar-tiles.has-screen .webinar-inset { position: absolute; right: .4rem; bottom: .4rem; width: clamp(4.4rem, 22%, 15rem); border: 1px solid #555; }
.webinar-tiles.has-screen .webinar-inset figcaption { font-size: .7rem; }
.webinar-panel [data-wb-status] { color: #f3d356; }
.webinar-panel [data-wb-tools] { flex-wrap: wrap; }
.webinar-panel [aria-pressed="true"] { background: #ffd600; color: #191919; }
.webinar-panel [data-wb-host], .webinar-panel [data-wb-chat] { background: #1d1d1d; border: 1px solid #424242;
  padding: .8rem; border-radius: .7rem; margin-top: .6rem; }
.webinar-panel [data-wb-chat] { flex: 0 0 min(29%, 24rem); min-width: 0; margin-top: 0; }
.webinar-panel [data-wb-posts] { max-height: 45vh; min-height: 5rem; overflow: auto; overflow-wrap: anywhere; }
.webinar-panel [data-wb-posts] p { margin: .45rem 0; }
.webinar-panel [data-wb-form="assets"] { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 12rem),1fr)); gap: .55rem; }
.webinar-panel [data-wb-form="assets"] input { max-width: 100%; }
.webinar-panel [data-wb-people] { max-height: 35vh; overflow: auto; }
.webinar-restore { position: fixed; z-index: 10500; bottom: calc(5rem + env(safe-area-inset-bottom)); right: .8rem; }
.webinar-setup { max-width: min(36rem, 95vw); background: #181818; color: white; border-radius: .8rem; border: 1px solid #555; padding: 1rem; }
.webinar-setup::backdrop { background: #000b; }
@media (max-width: 760px) { .webinar-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
  .webinar-panel [data-wb-chat] { margin-top: .1rem; } .webinar-tiles video { max-height: 48vh; }
  .room-head:has([data-chat="new-webinar"], [data-chat="join-webinar"]) { flex-wrap: wrap; }
  .room-head [data-chat="start-call"], .room-head [data-chat="new-webinar"], .room-head [data-chat="join-webinar"] {
    padding: .3rem .55rem; min-height: 2.45rem; font-size: .82rem; }
}

/* Mobile chat viewport */
@media (max-width: 760px) {
  body.school-chat-open { overflow: hidden; }
  .school-chat-open .android-actions { display: none; }
  .school-chat-open #platform:not([hidden]) { height: var(--school-viewport, 100dvh); min-height: 0; overflow: hidden; }
  .school-chat-open #tabs { flex: 0 0 auto; }
  .school-chat-open #view { display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .school-chat-open #view > .messenger { flex: 1 1 auto; width: 100%; height: 100%; min-height: 0; max-height: none; }
}

/* Mobile content and forms */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.contacts { gap: .7rem; }
.contacts > a { justify-self: start; }
.contacts ul { list-style: none; display: grid; gap: .65rem; padding: 0; margin: 0; }
.contacts li { display: grid; gap: .18rem; min-width: 0; padding: .7rem .82rem; border: 1px solid var(--edge); border-radius: .8rem; }
.contacts li strong { line-height: 1.35; }
.contacts .contact-role { color: var(--dim); font-size: .86rem; }
.contacts .contact-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .28rem .8rem; min-width: 0; margin-top: .2rem; }
.contacts .contact-actions a { white-space: nowrap; }
.contacts .contact-actions button { margin: 0; }
.registration-form fieldset, .entrance fieldset { min-inline-size: 0; }
@media (max-width: 760px) {
  .bar a:last-child { text-align: right; }
  .hero.with-announcer > p { max-width: 64%; font-size: .85rem; }
  .card, .webinar-setup { overflow-wrap: break-word; }
  .card :is(h2,h3), .team-copy h3, .webinar-heading h2 { text-wrap: balance; }
  .card p, .card label, .webinar-panel p { line-height: 1.5; }
  .card .text, .card output, .webinar-panel [data-wb-status] { overflow-wrap: anywhere; }
  .entrance, .registration-form { min-width: 0; }
  .entrance label, .registration-form label { margin-block: .65rem; }
  .entrance :is(input,select), .registration-form :is(input,select) { min-width: 0; max-width: 100%; min-height: 44px; }
  .registration-form input[type="checkbox"] { flex: 0 0 1.05rem; min-height: 1.05rem; margin: .2rem 0 0; }
  .registration-form .check { align-items: flex-start; }
  .registration-form button.primary, .entrance form button.primary, .entrance > .actions .button { width: 100%; }
  .registration-form + .android-only-web { margin-top: .85rem; }
}
@media (max-width: 380px) {
  body > header .bar { gap: .4rem; font-size: .79rem; }
  .wrap { width: calc(100% - 22px); }
  .hero { padding: .95rem; }
  .hero.with-announcer > h1 { font-size: clamp(1.9rem, 9.2vw, 2.15rem); max-width: 67%; }
  .hero.with-announcer > p { max-width: 67%; }
  .hero.with-announcer > .stage-speaker { width: 46%; }
  .contacts li { padding-inline: .6rem; }
  .team-grid { grid-template-columns: 1fr; }
}
.room-event-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .35rem .65rem; }
.room-event-actions button { min-height: 38px; padding: .35rem .7rem; font-size: .88rem; }
@media (max-width: 760px) { .room-event-actions { gap: .35rem; padding: .3rem .5rem; } }
.emoji-drag-handle { display: flex; width: 100%; min-height: 24px; padding: 0; margin: -.3rem 0 .15rem;
  border: 0; border-radius: 0; background: transparent; touch-action: none; }
.emoji-drag-handle::before { content: ""; width: 2.25rem; height: .25rem; border-radius: .3rem; background: var(--dim); }
[data-emoji-grid] { overscroll-behavior-y: contain; }
.video-transfer { padding: .65rem .8rem; border: 1px solid #665918; border-radius: .65rem;
  background: #282311; color: #ffea83; white-space: pre-line; overflow-wrap: anywhere; font-size: .9rem; }
.chat-main .video-transfer { margin: .2rem .65rem; flex: none; }
.incoming-call { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  padding: .55rem .75rem; margin-bottom: .55rem; border: 1px solid #665918; border-radius: .75rem; background: #282311; }
.incoming-call strong { margin-right: auto; }
.contact-shortcuts { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .2rem; }
.contact-shortcuts .room-row { min-width: 0; }
.contact-shortcuts .chat-icon { width: 2.4rem; height: 2.4rem; }
.lesson-title { color: var(--accent); font-weight: 900; overflow-wrap: anywhere; }
.lesson-copy { display: flow-root; container-type: inline-size; margin-block: .85rem 1.1rem; }
.lesson-paragraph { min-height: 1.5em; white-space: pre-wrap; overflow-wrap: anywhere; }
.lesson-copy .lesson-paragraph { max-width: 69ch; margin-inline: auto; line-height: 1.65; }
.lesson-editor { min-width: 0; max-height: none; overflow: visible; border: 1px solid var(--edge); border-radius: .8rem; padding: .7rem; margin: .75rem 0; }
.lesson-editor .lesson-tools { align-items: end; gap: .45rem; margin-bottom: .6rem; }
.lesson-editor .lesson-tools label { margin: 0; }
.lesson-editor input[type="color"] { width: 3.6rem; padding: .25rem; }
[data-lesson-editor] { padding: .65rem .75rem; min-height: 10rem; white-space: pre-wrap;
  overflow-wrap: anywhere; border: 1px solid #5c5c5c; border-radius: .6rem; background: #111; }
.quiz-question textarea { resize: vertical; min-height: 3.35rem; }
.video-actions { margin-top: .6rem; }
.video-actions:empty { display: none; }
.lesson-resize { display: block; margin: .35rem 0 0 auto; min-height: 42px; padding: .35rem .65rem;
  color: var(--accent); cursor: ns-resize; touch-action: none; font-size: .85rem; }
.lesson-resize span { margin-right: .2rem; }
.lesson-image { width: fit-content; margin: clamp(.85rem, 2vw, 1.6rem) auto; max-width: 100%; padding: .45rem; border: 1px solid var(--edge); border-radius: 1rem;
  background: #111; overflow: hidden; white-space: normal; text-align: center; }
.lesson-image img { display: block; width: auto; max-width: 100%; max-height: 75svh; height: auto;
  object-fit: contain; margin: 0 auto; border-radius: .65rem; }
.lesson-image button { margin-top: .35rem; font-size: .85rem; }
.lesson-image figcaption { padding: .6rem .5rem .2rem; color: var(--dim); font-size: .9em; overflow-wrap: anywhere; }
.lesson-image-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .45rem .15rem .1rem; }
.lesson-image-controls input { flex: 1 1 12rem; min-width: 0; }
.lesson-image-controls button { margin: 0; }
@container (min-width: 40rem) {
  .lesson-copy .portrait-photo:has(+ .lesson-paragraph) { float: inline-start; clear: both; max-width: 39%; margin: .2rem 1.5rem 1rem 0; }
  .lesson-copy .lesson-image { clear: both; }
}
.lesson-image-input input { max-width: min(13rem, 68vw); }
.homework-preview:not([hidden]) { display: block; width: min(100%, 28rem); max-height: 48svh; margin-block: .65rem; border-radius: .8rem; background: #141414; }
[data-homework-file] { overflow-wrap: anywhere; max-width: 100%; }
.chat-main { position: relative; }
.chat-call { position: absolute; z-index: 4; inset: 0; display: flex; min-height: 0; background: #131313; }
.chat-call[data-expanded="false"] { position: relative; order: -1; flex: none; }
.chat-call[data-expanded="true"] .chat-call-restore,
.chat-call[data-expanded="false"] .chat-call-panel { display: none; }
.chat-call-restore { width: 100%; border-radius: 0; background: #33301b; color: #ffe266; padding: .42rem .65rem; }
.chat-call-restore strong { margin-inline-start: .4rem; }
.chat-call-panel { flex: 1; min-height: 0; overflow: auto; }
.personal-call { display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 24%, #39301c, #121212 68%); }
.personal-call-head { display: flex; align-items: center; gap: .3rem; margin: .25rem .45rem; color: #ded8c2; font-size: .88rem; }
.personal-call-stage { display: grid; position: relative; flex: 1; min-height: 9rem; }
.personal-call-person { grid-area: 1 / 1; align-self: center; justify-self: center; text-align: center; padding: .25rem .75rem; min-width: 0; z-index: 1; pointer-events: none; }
.personal-call-person h2 { margin: .6rem 0 .25rem; font-size: clamp(1.05rem, 4vw, 1.55rem); overflow-wrap: anywhere; }
.personal-call-person p { margin: 0; color: #e4ddc7; font-size: .85rem; }
.personal-call-avatar { width: clamp(3.6rem, 16vw, 5.4rem); aspect-ratio: 1; margin: auto; display: grid; place-items: center;
  overflow: hidden; border-radius: 50%; background: #ffdc40; color: #1e1909; font-size: 2rem; font-weight: 800; }
.personal-call-avatar img { width: 100%; height: 100%; object-fit: cover; }
.personal-call .sfu-grid { grid-area: 1 / 1; display: block; position: relative; min-width: 0; min-height: 0; }
.personal-call .sfu-tile { position: absolute; inset: .3rem; aspect-ratio: auto; }
.personal-call .sfu-tile:not(.has-video), .audio-call .sfu-grid { display: none; }
.personal-call .sfu-self { inset: .55rem .55rem auto auto; z-index: 2; width: clamp(5.1rem, 23%, 9rem); aspect-ratio: var(--camera-ratio); }
.personal-call-stage[data-remote-video]:has(.sfu-self.has-video) .sfu-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: center; }
.personal-call-stage[data-remote-video]:has(.sfu-self.has-video) .sfu-tile:not(.school-full-view) { position: relative; inset: auto; width: 100%; aspect-ratio: var(--camera-ratio); }
.personal-call-stage[data-remote-video]:has(.sfu-self.has-video) .personal-call-person { display: none; }
.personal-call-stage[data-remote-video] .personal-call-person { align-self: start; justify-self: start; margin: .55rem; padding: .4rem .6rem;
  text-align: left; border-radius: .6rem; background: #161616d9; max-width: 66%; }
.personal-call-stage[data-remote-video] .personal-call-avatar { display: none; }
.personal-call-stage[data-remote-video] .personal-call-person h2 { font-size: .85rem; margin: 0; }
.personal-call [data-conf-welcome], .personal-audio-enable { align-self: center; }
.personal-call [data-conf-welcome] { margin-top: .35rem; }
.personal-call-controls { position: relative; min-height: 5.25rem; display: grid; place-items: center; flex: none; }
.personal-call-controls [data-conf-controls] { position: absolute; inset-inline: 0; display: flex; justify-content: center; gap: 5.25rem; }
.personal-call-controls [data-conf-controls][hidden] { display: none; }
.personal-call-controls button { display: grid; place-items: center; border-radius: 50%; width: 2.75rem; height: 2.75rem; padding: 0; }
.personal-call-controls :is([data-conf="audio"], [data-conf="video"])[aria-pressed="false"]::after { content: ''; position: absolute;
  width: 1.35rem; height: 2px; transform: rotate(-48deg); background: currentColor; box-shadow: 0 0 0 1px #292929; }
.personal-call-controls [data-conf="audio"] { margin-right: auto; }
.personal-call-controls [data-conf-controls] { inset-inline: auto; width: 13.6rem; }
.personal-call-controls .call-hangup { width: 3.55rem; height: 3.55rem; z-index: 1; background: #c82736; border-color: #ff6672; color: #fff; }
.personal-call-controls .call-hangup:hover { background: #a81928; }
.full-video-button { position: absolute; z-index: 3; bottom: .4rem; right: .4rem; display: grid; place-items: center; width: 2.65rem;
  height: 2.65rem; padding: 0; color: #fff; background: #171717df; border-color: #a0a0a0; }
.full-video-button[hidden] { display: none; }
.school-full-view, .sfu-tile.school-full-view, .personal-call .sfu-tile.school-full-view { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center;
  width: 100%; height: 100dvh; max-width: none; max-height: none; aspect-ratio: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: #080808; }
.school-full-view .full-video-button { top: max(.65rem, env(safe-area-inset-top)); right: max(.65rem, env(safe-area-inset-right)); bottom: auto; }
.school-full-view video, .personal-call .school-full-view video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.sfu-tile.school-full-view:not(.has-screen) video { object-fit: cover; }
.webinar-stage { position: relative; min-height: 4rem; }
.webinar-stage.school-full-view { position: fixed; }
.webinar-stage.school-full-view .webinar-tiles { width: 100%; height: 100%; grid-auto-rows: minmax(0, 1fr); }
.webinar-stage.school-full-view figure:not(.webinar-inset) { height: 100%; }
.webinar-stage.school-full-view .webinar-tiles video { aspect-ratio: auto; }
.webinar-stage.school-full-view [data-wb-novideo] { position: absolute; }
.webinar-presentation { margin-bottom: .6rem; }
.webinar-presentation:empty { display: none; }
.webinar-history { width: min(36rem, 95vw); max-height: 90dvh; }
.webinar-history article { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; padding: .55rem;
  border: 1px solid var(--edge); border-radius: .65rem; }
.webinar-history article > div { flex: 1 0 min(100%, 12rem); overflow-wrap: anywhere; }
.webinar-history article small { display: block; }
.voice-note { display: flex; align-items: center; gap: .35rem; width: min(9.25rem, 45vw); }
.voice-note .chat-icon { width: 2.2rem; height: 2.2rem; color: #171717; background: #ffda34; }
.voice-note-track { flex: 1; min-width: 0; }
.voice-progress { height: .32rem; overflow: hidden; border-radius: 999px; background: #9a917550; }
.voice-progress i { display: block; height: 100%; border-radius: inherit; transform: scaleX(0); transform-origin: left; background: #ffdb37; }
.voice-note-track span { display: flex; justify-content: space-between; gap: .25rem; font-size: .64rem; color: #ccc4b0; }
.circle-note { position: relative; width: min(52vw, 13rem); max-width: 100%; }
.circle-note[data-expanded] { width: min(78vw, 25rem, 65dvh); }
.circle-note .circle { width: 100%; margin: 0; }
.circle-note .chat-icon { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: none; }
.circle-note .chat-icon svg { position: absolute; right: .65rem; bottom: .65rem; width: 1.7rem; height: 1.7rem; padding: .24rem;
  border-radius: 50%; color: #fff; background: #151515c9; }
.pending-circle small { font-size: .72rem; }
.chat-main [data-recording]:not(:empty) { flex: none; padding: .3rem .55rem; font-size: .83rem; }
.recording-row { display: flex; align-items: center; justify-content: space-between; gap: .35rem; padding: .38rem .45rem;
  border-radius: .7rem; background: #211d1e; color: #faf0ee; }
.recording-label { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; }
.recording-meter { display: flex; align-items: center; gap: .13rem; height: 1.15rem; }
.recording-meter i { display: block; width: .18rem; height: 100%; transform: scaleY(.15); border-radius: 999px; background: #ff6d78;
  transition: transform 70ms ease-out; }
.chat-main [data-recording] .recording-cancel { flex: none; gap: .24rem; margin: 0; padding: .22rem .3rem; border: 0;
  background: none; color: #dccfcd; font-size: .74rem; }
.recording-cancel svg { width: 1.12rem; height: 1.12rem; }
.recording-discard-flight { position: fixed; z-index: 80; pointer-events: none; color: #ff6877; }
.recording-discard-flight svg { position: absolute; width: 1.55rem; height: 1.55rem; left: -.775rem; top: -.775rem; }
.recording-discard-flight svg:first-child { animation: discard-bin .58s ease-out both; }
.recording-discard-flight svg:last-child { animation: discard-mic .48s ease-in-out both; }
@keyframes discard-mic {
  from { transform: translate(var(--mic-x), var(--mic-y)) scale(1.1); }
  55% { transform: translate(var(--arc-x), -2.25rem) rotate(-36deg) scale(.92); }
  to { transform: translateY(0) rotate(-12deg) scale(.12); opacity: 0; }
}
@keyframes discard-bin {
  0%, 70% { transform: none; }
  85% { transform: translateY(.12rem) scale(1.15,.85); }
  to { transform: none; opacity: 0; }
}
.chat-main [data-recording][data-discard] .recording-cancel { color: #ff6979; }
.recording-circle-preview { position: absolute; z-index: 3; top: 47%; left: 50%; width: min(17rem, 72vw, 44dvh); aspect-ratio: 1;
  transform: translate(-50%, -50%) scaleX(-1); border-radius: 50%; border: 2px solid #ff717d; background: #0d0d0d;
  object-fit: cover; box-shadow: 0 9px 35px #000b; pointer-events: none; }
[data-chat-form][data-recording-kind="voice"] [data-record="voice"] { background: #cc2334; border-color: #fa5768; color: #fff;
  box-shadow: 0 0 0 .22rem #b6253648; }
@media (prefers-reduced-motion: no-preference) {
  [data-recording][data-discard] .recording-cancel svg { animation: recording-trash .25s ease-out both; }
  @keyframes recording-trash { 40% { transform: rotate(-15deg) scale(1.23); } }
}
.mobile-menu-head, .mobile-menu-toggle { display: none; }
@media (max-width: 760px) {
  #tabs:not([data-menu-expanded]) { display: none; }
  #tabs[hidden] + .mobile-menu-toggle { display: none; }
  .mobile-menu-toggle { display: inline-flex; align-items: center; gap: .45rem; align-self: flex-start; margin: .3rem .45rem; min-height: 42px; }
  body.school-menu-open { overflow: hidden; }
  #tabs[data-menu-expanded]:not([hidden]) { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; flex-wrap: nowrap;
    gap: .65rem; margin: 0; padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    overflow: auto; background: #151515; }
  #tabs[data-menu-expanded] > button { flex: none; width: min(100%, 33rem); align-self: center; min-height: 3.35rem;
    border-radius: .8rem; font-size: 1rem; white-space: normal; }
  .mobile-menu-head { display: flex; justify-content: space-between; align-items: center; width: min(100%, 33rem); align-self: center;
    margin-bottom: .5rem; gap: .7rem; font-size: 1.45rem; }
  .mobile-menu-head span { color: var(--accent); }
  .mobile-menu-head button { flex: none; width: 2.75rem; height: 2.75rem; padding: 0; font-size: 1.45rem; }
  .room-head .chat-icon { width: 2.38rem; }
  .room-head > .avatar { flex: none; }
}
.course-welcome {
  position: fixed; width: min(39rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: clamp(1.1rem, 5vw, 2.3rem);
  color: #fff; background: radial-gradient(ellipse at 100% 110%, #403517, transparent 65%), #111;
  border: 1px solid #63521d; border-radius: 1rem; overflow: auto; isolation: isolate;
}
.course-welcome::backdrop { background: #000c; }
.course-welcome-body { position: relative; z-index: 1; max-width: 70%; }
.course-welcome-logo { display: block; margin-bottom: 1.1rem; font-size: clamp(1.4rem, 5vw, 2.25rem); font-weight: 900; letter-spacing: -.045em; }
.course-welcome-logo strong { color: var(--accent); }
.course-welcome h2 { font-size: clamp(1.35rem, 4.5vw, 1.9rem); overflow-wrap: anywhere; margin-bottom: .45rem; }
.course-welcome p { margin: 0 0 1.1rem; line-height: 1.45; }
.course-welcome button { min-height: 44px; min-width: 8rem; }
.course-welcome img { position: absolute; z-index: -1; right: -.1rem; bottom: 0; width: min(36%, 14rem); }
.lesson-clip { padding-block: 1.2rem; border-top: 1px solid var(--edge); }
.homework-photo figure { margin: .75rem 0 0; overflow-wrap: anywhere; }
.homework-photo img { display: block; max-height: 65dvh; max-width: 100%; margin: auto; object-fit: contain; }
.lesson-clip h3 { margin: 0 0 .8rem; overflow-wrap: anywhere; }
.clip-cover { position: relative; width: 100%; aspect-ratio: 16/9; padding: 0; overflow: hidden; background: #181818; color: white; border-radius: 14px; }
.clip-cover video { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.clip-cover span { position: absolute; padding: .55rem 1rem; border-radius: 2rem; background: #171717d9; }
.theme-choice { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; }
.theme-choice select { width: auto; min-height: 2.5rem; }
.bar { flex-wrap: wrap; gap: .4rem 1rem; padding-block: .35rem; }
.bar .brand { margin-right: auto; }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf9f6; --panel: #fff; --raised: #f3f2ee; --edge: #d8d5cc; --text: #25231f; --dim: #57554e;
  --ink-gold: #735400;
}
[data-theme="light"] :is(body > header, .room-head, .chat-side, .webinar-panel, .webinar-setup, #tabs[data-menu-expanded],
  .lesson-editor, .lesson-image, .bubble-menu .actions, .bubble-quick-reactions) { background: var(--panel); color: var(--text); border-color: var(--edge); }
[data-theme="light"] :is(input, textarea, select, [contenteditable="true"]) { background-color: #fff; color: var(--text); border-color: #aaa79d; }
[data-theme="light"] :is(a:not(.button), .brand strong, .lesson-title, .teacher, .positive, .bubble-author, .mobile-menu-head span,
  .webinar-heading [data-wb-state], .webinar-panel [data-wb-status], .webinar-panel [data-wb-posts] small, .webinar-guest-label,
  .webinar-chat-card span, .voice-note-track span, .lesson-editor-resize) { color: var(--ink-gold); }
[data-theme="light"] :is(.hero, .course-welcome) { background: radial-gradient(ellipse at 90% 100%, #f8eab9, transparent 58%), #fffdf8; color: var(--text); border-color: var(--edge); }
[data-theme="light"] :is(.hero .eyebrow, .course-welcome-logo strong, .hero h1 span) { color: var(--ink-gold); }
[data-theme="light"] .hero h1 span { background: none; }
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  @supports (background-clip: text) {
    [data-theme="light"] .hero h1 span { background: linear-gradient(112deg, #735400 44%, #9a7416 51%, #735400 58%) 100% 50% / 265% 100%; background-clip: text; color: transparent; }
  }
}
[data-theme="light"] .negative { color: #a72129; }
[data-theme="light"] .chat-main [data-chat-form][data-recording-kind="voice"] [data-record="voice"] { background: #cc2334; color: #fff; }
[data-theme="light"] .posts { background: #f6f5f0; }
[data-theme="light"] .bubble { background: #fff; }
[data-theme="light"] .bubble.own { background: #fff0bc; }
[data-theme="light"] :is(.chat-list-search, .topic-rows .room-row:not([aria-current]), .bubble blockquote, .reactions button,
  .chat-icon:hover, .chat-icon[aria-expanded="true"], .webinar-panel [data-wb-host], .webinar-panel [data-wb-chat]) { background: var(--raised); color: var(--text); }
[data-theme="light"] :is(.chat-filters button[aria-pressed="true"], .reactions button[aria-pressed="true"], .webinar-chat-card,
  .incoming-call, .video-transfer, .chat-main [data-chat-video-transfers]) { background: #fff0bc; color: #493800; border-color: #e4ce82; }
[data-theme="light"] .webinar-waiting { background: var(--raised); }
[data-theme="light"] :is(.sfu-name, .webinar-stage, .personal-call, .full-video-button) { color: #fff; }
[data-theme="light"] :is(.personal-call, .chat-call) { background: var(--panel); color: var(--text); }
[data-theme="light"] :is(.personal-call-head, .personal-call-person p) { color: var(--dim); }
[data-theme="light"] .personal-call-stage[data-remote-video] .personal-call-person { background: var(--panel); }
@media (max-width: 380px) {
  .course-welcome-body { max-width: 77%; }
  .course-welcome img { width: 28%; }
}
