: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; }
.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); }
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); }
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); }
.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; }
.messenger { display: grid; grid-template-columns: minmax(205px, 280px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.messenger .card { margin: 0; min-width: 0; }
.chat-side [data-rooms] { display: grid; gap: .2rem; max-height: 35rem; overflow: auto; }
.room-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; width: 100%; gap: .6rem; border-radius: 12px; border-color: transparent; text-align: left; }
.room-row span { overflow-wrap: anywhere; }
.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; }
.profile { margin-top: 1rem; }
.room-head, .bubble-head { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.room-head h2 { flex: 1; margin: 0; }
[data-search] { display: flex; gap: .55rem; align-items: flex-end; margin: .75rem 0; }
[data-search] label { flex: 1; margin: 0; }
.posts { min-height: 16rem; height: min(50vh, 510px); overflow: auto; display: flex; flex-direction: column; gap: .55rem; padding: .55rem .3rem; }
.bubble { background: var(--raised); padding: .68rem .9rem; max-width: 88%; width: fit-content; border: 1px solid var(--edge); border-radius: 4px 15px 15px; overflow-wrap: anywhere; }
.bubble.own { align-self: flex-end; border-color: #685a16; background: #2b2819; border-radius: 15px 4px 15px 15px; }
.bubble p { margin: .4rem 0; }
.bubble time { color: var(--dim); font-size: .8rem; }
.bubble blockquote { margin: .5rem 0; padding: .4rem .65rem; border-left: 2px solid var(--accent); background: #111; border-radius: 3px; }
.bubble-menu { border: 0; padding: .2rem 0 0; }
.bubble-menu summary { color: var(--dim); font-size: .86rem; }
.bubble .actions button, .reactions button { padding: .35rem .55rem; }
.reactions { display: flex; flex-wrap: wrap; gap: .25rem; }
.reactions button[aria-pressed="true"] { border-color: var(--accent); }
[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; }
@media (max-width: 720px) {
  .wrap { width: calc(100% - 28px); }
  .grid, .messenger { grid-template-columns: 1fr; }
  .days { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 12rem; }
  .days button { padding: .45rem; text-align: center; }
  .days small { display: none; }
  .chat-side [data-rooms] { max-height: 12rem; }
  .bubble { max-width: 96%; }
}
