/* AMMA design system. Palette from the brand sheet; the seal is the one recurring idea. */
@view-transition { navigation: auto; }

:root {
  --bg: #060E15;
  --card: #181E27;
  --card-2: #0F161E;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, .7);
  --gold: #FFCF23;
  --amber: #FFBB38;
  --orange: #FF8D3A;
  --grad: linear-gradient(100deg, #FFCF23 0%, #FFBB38 45%, #FF8D3A 100%);
  --display: 'Manrope', 'Inter', Arial, sans-serif;
  --serif: 'Inter', Arial, sans-serif;
  --body: 'Inter', Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --on-gold: #060E15;   /* text on gold buttons, chips and badges, the same in every theme */
  --accent: #FFCF23;    /* gold used as text: darker on light themes so it stays readable */
  --bubble: #1A212B;
  --grad-text: var(--grad);
  color-scheme: dark;
}
/* Themes. Tungi (dark) is the default above. */
:root[data-theme="dusk"] {   /* Shom: dark, but a clear step lighter than Tungi */
  --bg: #2B333E; --card: #37414E; --card-2: #313A46; --line: rgba(255, 255, 255, .11); --line-2: rgba(255, 255, 255, .2);
  --text: #F3F5F8; --muted: rgba(243, 245, 248, .74); --bubble: #3E4957;
}
:root[data-theme="mid"] {    /* O'rta: the real middle, mid grey with white text and darker cards */
  --bg: #6B737E; --card: #59616C; --card-2: #626A75; --line: rgba(255, 255, 255, .14); --line-2: rgba(255, 255, 255, .26);
  --text: #FFFFFF; --muted: rgba(255, 255, 255, .9); --accent: #FFE07A; --bubble: #565E69;
}
:root[data-theme="light"] {
  --bg: #F2F4F7; --card: #FFFFFF; --card-2: #E8ECF1; --line: rgba(13, 22, 33, .08); --line-2: rgba(13, 22, 33, .16);
  --text: #0D1621; --muted: rgba(13, 22, 33, .66); --accent: #8A6200; --bubble: #FFFFFF;
  --grad-text: linear-gradient(100deg, #9A6A00, #C2540F); color-scheme: light;
}
:root[data-theme="dawn"] {   /* Tong: soft light, grey rather than white */
  --bg: #C8CED6; --card: #DCE1E7; --card-2: #D1D6DD; --line: rgba(13, 22, 33, .1); --line-2: rgba(13, 22, 33, .2);
  --text: #111A24; --muted: rgba(17, 26, 36, .72); --accent: #6E4E00; --bubble: #E4E8ED;
  --grad-text: linear-gradient(100deg, #8A5E00, #A8470D); color-scheme: light;
}
/* Ko'z himoyasi: warm, yellowish versions of Kunduzgi and Tong, less blue light for long reading */
:root[data-theme="warm-light"] {
  --bg: #F6EDD5; --card: #FBF4E2; --card-2: #EFE3C6; --line: rgba(60, 45, 15, .1); --line-2: rgba(60, 45, 15, .2);
  --text: #2B2214; --muted: rgba(43, 34, 20, .72); --accent: #7A5300; --bubble: #FDF7E8;
  --grad-text: linear-gradient(100deg, #8A5A00, #A9470F); color-scheme: light;
}
:root[data-theme="warm-dawn"] {
  --bg: #E2D3AE; --card: #ECDFBE; --card-2: #DCCBA3; --line: rgba(60, 45, 15, .12); --line-2: rgba(60, 45, 15, .22);
  --text: #2A2110; --muted: rgba(42, 33, 16, .74); --accent: #6A4700; --bubble: #F1E6C9;
  --grad-text: linear-gradient(100deg, #7E5200, #9C410C); color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--amber); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--gold); color: var(--on-gold); }

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 860px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.gold { color: var(--accent); }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-split] .grad-text { background: none; color: inherit; }
[data-split] .grad-text .word > span { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ic { flex: none; display: block; }

.eyebrow { font: 700 12px/1.45 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.h-lg, .h-md, .h-sm { font-family: var(--display); font-weight: 800; letter-spacing: -.047em; text-wrap: balance; }
.h-lg { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.08; }
.h-md { font-size: clamp(26px, 2.8vw, 36px); line-height: 1.16; }
.h-sm { font-size: 23px; line-height: 1.3; font-weight: 700; letter-spacing: -.03em; }
.lead { font-size: clamp(18px, 1.5vw, 21px); color: var(--muted); max-width: 58ch; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
  min-height: 56px; padding: 0 28px; border: 0; border-radius: 10px; font-weight: 700; font-size: 17px; text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn .ic { transition: transform .3s var(--ease); }
.btn:hover .ic { transform: translateX(4px); }
.btn.primary { background: var(--grad); background-size: 170% 100%; color: var(--on-gold); transition: transform .2s var(--ease), background-position .5s var(--ease); }
.btn.primary:hover { background-position: 100% 0; color: var(--on-gold); transform: translateY(-2px); }
.btn.primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
}
.btn.primary:hover::after { animation: sheen .8s var(--ease); }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.btn.dark { background: var(--bg); color: var(--text); }
.btn.dark:hover { color: var(--accent); }
.btn.small { min-height: 46px; padding: 0 20px; font-size: 16px; }
.btn.block { width: 100%; }
@keyframes sheen { to { left: 120%; } }

/* pills with a sliding highlight */
.pills { position: relative; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: var(--card); border-radius: 12px; max-width: 100%; }
.pill-bar { position: absolute; left: 0; top: 0; background: var(--gold); border-radius: 8px; transition: transform .4s var(--ease), width .4s var(--ease), height .4s var(--ease); }
.pills button {
  position: relative; z-index: 1; min-height: 44px; padding: 8px 16px; background: none; border: 0; border-radius: 8px;
  color: var(--text); font-weight: 600; transition: color .25s;
}
.pills button[aria-pressed="true"] { color: var(--on-gold); }

/* ---------- reveal choreography (only once fx.js is alive) ---------- */
.fx-on [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 80ms); }
.fx-on [data-reveal].fx-in { opacity: 1; transform: none; }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.word > span { display: inline-block; animation: word-up .9s var(--ease) both; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes word-up { from { transform: translateY(105%); } to { transform: none; } }
.fx-enter { animation: enter .45s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }

/* ---------- the live logo ---------- */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --rise { syntax: '<percentage>'; inherits: false; initial-value: -10%; }
@property --grow { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.seal { display: block; width: 100%; height: auto; }
.logo-live {
  position: relative; aspect-ratio: 1; --rx: 0deg; --ry: 0deg;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .4s var(--ease);
}
.logo-stack { position: absolute; inset: 4.5%; border-radius: 50%; }
.ll { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ll-disc { animation: disc .8s var(--spring) both; }
.ll-band { -webkit-mask: conic-gradient(#000 var(--sweep), transparent 0); mask: conic-gradient(#000 var(--sweep), transparent 0); animation: sweep 1.3s cubic-bezier(.6, 0, .2, 1) .15s forwards; }
.ll-rings { -webkit-mask: conic-gradient(from 180deg, #000 var(--sweep), transparent 0); mask: conic-gradient(from 180deg, #000 var(--sweep), transparent 0); animation: sweep 1s cubic-bezier(.6, 0, .2, 1) .55s forwards; }
.ll-laurel { -webkit-mask: linear-gradient(to top, #000 var(--rise), transparent calc(var(--rise) + 9%)); mask: linear-gradient(to top, #000 var(--rise), transparent calc(var(--rise) + 9%)); animation: rise 1.1s var(--ease) .9s forwards; }
.ll-circuit { -webkit-mask: radial-gradient(circle at 50% 80%, #000 var(--grow), transparent calc(var(--grow) + 5%)); mask: radial-gradient(circle at 50% 80%, #000 var(--grow), transparent calc(var(--grow) + 5%)); animation: grow 1s var(--ease) 1.5s forwards; }
.ll-amma { animation: amma .75s var(--spring) .7s both; transform-origin: 50% 50%; }
.ll-pulses { fill: var(--orange); opacity: 0; animation: show .5s linear 2.5s forwards; }
.ll-sheen { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none; }
.ll-sheen::after {
  content: ""; position: absolute; top: -30%; bottom: -30%; left: -60%; width: 34%; transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent); animation: gloss 8s ease-in-out 2.8s infinite;
}
.orbit { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 70s linear infinite; }
.orbit circle { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: .5 4.5; opacity: .55; }
@keyframes sweep { to { --sweep: 360deg; } }
@keyframes rise { to { --rise: 110%; } }
@keyframes grow { to { --grow: 75%; } }
@keyframes disc { from { opacity: 0; transform: scale(.72); } }
@keyframes amma { from { opacity: 0; transform: scale(.8); } }
@keyframes show { to { opacity: 1; } }
@keyframes gloss { 0% { left: -60%; } 28%, 100% { left: 130%; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; scale: 0; } }

.medal { position: relative; width: 84px; height: 84px; display: grid; place-items: center; flex: none; }
.medal svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.medal circle { fill: none; stroke-width: 5; }
.medal .m-track { stroke: var(--line-2); }
.medal .m-fill { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.2s var(--ease) .1s; }
.medal.fx-in .m-fill { stroke-dashoffset: calc(100 - var(--p, 100)); }
.medal b { font: 800 19px var(--display); letter-spacing: -.03em; color: var(--muted); }
.medal.is-earned b { color: var(--accent); }
.medal.is-earned::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 1px solid var(--gold); opacity: .55; }
.fx-on .medal.is-earned { transform: scale(.6); opacity: 0; }
.fx-on .medal.is-earned.fx-in { transform: none; opacity: 1; transition: transform .6s var(--spring), opacity .3s; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: 14px; }
.lift {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%; position: relative;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .35s var(--ease);
}
.lift::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--gold), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.lift:hover::before { opacity: 1; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 5px; font-size: 13px; font-weight: 700; background: var(--amber); color: var(--on-gold); }
.tag.line { background: none; color: var(--text); border: 1px solid var(--line-2); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--card-2); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; text-decoration: none; }
.card .avatar { background: var(--bg); }

.input, .textarea, .select {
  width: 100%; min-height: 52px; padding: 12px 14px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px; transition: border-color .2s, background-color .2s;
}
.textarea { resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: 0; border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--text) 50%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 600; font-size: 15px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.progress { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--grad); transition: width .9s var(--ease); }

/* ---------- inner pages ---------- */
.page-top { padding-block: 40px 28px; display: flex; flex-direction: column; gap: 12px; }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 18px; padding-bottom: 80px; }
.course { display: flex; flex-direction: column; overflow: hidden; color: var(--text); text-decoration: none; }
.course:hover { color: var(--text); }
.cover { position: relative; aspect-ratio: 16 / 9; padding: 18px; background: var(--card-2); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.cover-art { position: absolute; right: -14px; bottom: -22px; width: 190px; height: 190px; color: rgba(255, 207, 35, .13); transition: transform .6s var(--ease), color .3s; }
.cover-art svg { width: 100% !important; height: 100% !important; stroke-width: 1.1; }
.course:hover .cover-art { transform: rotate(-7deg) scale(1.1); color: rgba(255, 207, 35, .3); }
.cover h3 { position: relative; font: 800 25px/1.2 var(--display); letter-spacing: -.03em; max-width: 86%; }
.course-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.course-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: auto; font-weight: 700; }

.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 80px; }
.sticky-side { position: sticky; top: 20px; }
.course-hero { position: relative; aspect-ratio: 16 / 7; border-radius: 14px; background: var(--card); overflow: hidden; display: flex; align-items: flex-end; padding: 22px; gap: 14px; }
.course-hero .seal { position: absolute; right: -50px; top: -50px; width: 360px; opacity: .9; }
.play { position: relative; width: 66px; height: 66px; border: 0; border-radius: 50%; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; flex: none; transition: transform .25s var(--spring); }
.play:hover { transform: scale(1.1); }
.play::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold); animation: ring 2.4s ease-out infinite; }
@keyframes ring { to { transform: scale(1.7); opacity: 0; } }
.lesson-list { list-style: none; margin: 0; padding: 6px; }
.lesson-row { display: flex; gap: 14px; align-items: center; padding: 11px 12px; border-radius: 8px; transition: background-color .2s, transform .2s var(--ease); }
.lesson-row:hover { background: var(--card-2); transform: translateX(4px); }
.lesson-n { width: 28px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.state { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--muted); flex: none; }
.state.open { color: var(--accent); }
.buy { padding: 26px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; position: relative; }
.price { font: 800 46px/1.1 var(--display); letter-spacing: -.047em; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ticks li { display: flex; gap: 9px; color: var(--muted); }
.ticks .ic { color: var(--accent); margin-top: 4px; }
.method { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; text-align: left; transition: border-color .2s; }
.method[aria-pressed="true"] { border-color: var(--accent); }
.method .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); transition: .25s var(--spring); }
.method[aria-pressed="true"] .dot { border: 6px solid var(--gold); }
.stamp { width: 170px; margin: 0 auto; animation: stamp .55s var(--spring) both; }
@keyframes stamp { from { opacity: 0; transform: scale(2.2) rotate(-16deg); } }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(6, 14, 21, .25); border-top-color: var(--on-gold); animation: spin .7s linear infinite; }

.player { position: relative; aspect-ratio: 16 / 9; background: var(--card-2); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.player-stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; }
.player-stage .seal { position: absolute; width: 46%; left: 27%; top: 50%; translate: 0 -50%; opacity: .12; }
.bars { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; align-items: flex-end; gap: 4px; height: 44px; opacity: 0; transition: opacity .3s; }
.is-playing .bars { opacity: .9; }
.bars i { width: 4px; height: 100%; background: var(--grad); border-radius: 2px; transform-origin: bottom; animation: eq 1s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -130ms); animation-play-state: paused; }
.is-playing .bars i { animation-play-state: running; }
@keyframes eq { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
.player-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scrub { flex: 1; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.scrub > i { display: block; height: 100%; background: var(--grad); transition: width .25s linear; }

/* ---------- lesson video player (static/player.js) ---------- */
/* The picture is always on black, in every theme; the controls are white on a dark scrim, gold for what is played. */
.player.has-video { background: #000; }
.vp-host { position: absolute; inset: 0; }
.vp { position: absolute; inset: 0; background: #000; color: #fff; overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.vp video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vp .wm { z-index: 2; color: rgba(255, 255, 255, .28); text-shadow: 0 0 2px rgba(0, 0, 0, .4); }
.vp.is-full .wm { font-size: 18px; }
.vp.is-quiet { cursor: none; }
.vp-ctrl { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 28px 12px 6px; background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .35) 60%, transparent); transition: opacity .2s, transform .2s; }
.vp.is-quiet .vp-ctrl, .vp.is-idle .vp-ctrl { opacity: 0; transform: translateY(6px); pointer-events: none; }
.vp-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.vp-gap { flex: 1; }
.vp-btn { position: relative; display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: #fff; cursor: pointer; font: 600 14px/1 inherit; font-family: inherit; }
.vp-btn:hover, .vp-btn:focus-visible { background: rgba(255, 255, 255, .14); }
.vp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.vp-btn .ic { width: 22px; height: 22px; }
.vp-skip span { position: absolute; left: 0; right: 0; top: 50%; translate: 0 -46%; font-size: 8.5px; font-weight: 800; letter-spacing: -.02em; pointer-events: none; }
.vp-text { min-width: 46px; font-variant-numeric: tabular-nums; }
.vp-qual { display: inline-flex; gap: 6px; }
.vp-qual .ic { width: 18px; height: 18px; }
.vp.no-quality .vp-qual { display: none; }
.vp-time { margin: 0 8px; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: rgba(255, 255, 255, .92); }
.vp-volwrap { display: flex; align-items: center; }
.vp-vol { width: 0; opacity: 0; margin: 0; transition: width .2s, opacity .2s, margin .2s; height: 4px; appearance: none; -webkit-appearance: none; border-radius: 2px; cursor: pointer;
  background: linear-gradient(to right, #fff var(--v, 100%), rgba(255, 255, 255, .3) var(--v, 100%)); }
.vp-volwrap:hover .vp-vol, .vp-vol:focus-visible { width: 76px; opacity: 1; margin: 0 8px 0 2px; }
.vp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.vp-vol::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.vp.is-touch .vp-vol { display: none; }

.vp-seek { position: relative; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.vp-rail { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .26); transition: height .12s; }
.vp-seek:hover .vp-rail, .vp-seek.drag .vp-rail, .vp-seek:focus-visible .vp-rail { height: 6px; }
.vp-buf, .vp-done { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.vp-buf { background: rgba(255, 255, 255, .42); }
.vp-done { background: var(--grad); }
.vp-knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #FFCF23; transform: scale(0); transition: transform .12s; }
.vp-seek:hover .vp-knob, .vp-seek.drag .vp-knob, .vp-seek:focus-visible .vp-knob, .vp.is-touch .vp-knob { transform: scale(1); }
.vp-tip { position: absolute; bottom: 22px; translate: -50% 0; display: none; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.vp-seek.tip .vp-tip { display: flex; }
.vp-thumb { border-radius: 6px; border: 2px solid #fff; background-color: #111; background-repeat: no-repeat; }
.vp-thumb:not([style*="background-image"]) { display: none; }
.vp-tip span { padding: 2px 7px; border-radius: 5px; background: rgba(0, 0, 0, .8); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.vp-big { position: absolute; z-index: 3; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: rgba(0, 0, 0, .55); transition: opacity .2s, transform .2s; }
.vp-big .ic { width: 30px; height: 30px; margin-left: 4px; color: #FFCF23; }
.vp-big:hover { background: rgba(0, 0, 0, .72); transform: scale(1.05); }
.vp.is-playing .vp-big, .vp.is-ended .vp-big, .vp.is-wait .vp-big { opacity: 0; pointer-events: none; }
.vp-spin { position: absolute; z-index: 3; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; opacity: 0; pointer-events: none; transition: opacity .2s .25s; }
.vp.is-wait .vp-spin { opacity: 1; }
.vp-flash { position: absolute; z-index: 3; left: 50%; top: 50%; translate: -50% -50%; padding: 10px 16px; border-radius: 10px; background: rgba(0, 0, 0, .62); font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.vp-flash.left { left: 22%; }
.vp-flash.right { left: 78%; }
.vp-flash.on { opacity: 1; transition: none; }
.vp-toast { position: absolute; z-index: 4; left: 12px; top: 12px; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 8px 8px 8px 12px; border-radius: 9px; background: rgba(0, 0, 0, .72); font-size: 13.5px; opacity: 0; translate: 0 -6px; pointer-events: none; transition: opacity .25s, translate .25s; }
.vp-toast.on { opacity: 1; translate: 0 0; pointer-events: auto; }
.vp-toast button { border: 0; border-radius: 6px; padding: 6px 10px; background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.vp-toast button:hover { background: rgba(255, 255, 255, .26); }
.vp-end, .vp-fail { position: absolute; z-index: 3; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; background: rgba(0, 0, 0, .66); text-align: center; }
.vp.is-ended .vp-end, .vp-fail.on { display: flex; }
.vp-end-title { font-size: 19px; font-weight: 700; }
.vp-end-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vp-end .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.vp-menu { position: absolute; z-index: 5; right: 12px; bottom: 74px; min-width: 168px; max-height: calc(100% - 90px); overflow: auto; padding: 6px; border-radius: 10px; background: rgba(22, 26, 32, .97); border: 1px solid rgba(255, 255, 255, .1); }
.vp-menu-head { padding: 8px 10px 6px; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .62); text-transform: uppercase; letter-spacing: .04em; }
.vp-item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: #fff; font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.vp-item:hover, .vp-item:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }
.vp-item.on { color: #FFCF23; font-weight: 700; }
.vp-item .ic { width: 18px; height: 18px; }
.vp:fullscreen { border-radius: 0; }
.vp:-webkit-full-screen { border-radius: 0; }
@media (max-width: 560px) {
  .vp-ctrl { padding: 22px 6px 2px; }
  .vp-btn { min-width: 38px; padding: 0 6px; }
  .vp-skip { display: none; }
  .vp-time { margin: 0 4px; font-size: 12.5px; }
  .vp-qual span { display: none; }
  .vp-menu { right: 6px; bottom: 64px; }
  .vp-big { width: 58px; height: 58px; margin: -29px 0 0 -29px; }
}
@media (prefers-reduced-motion: reduce) { .vp-ctrl, .vp-big, .vp-toast, .vp-flash { transition: none; } }
.side-lessons { padding: 18px; }
.lesson-btn { width: 100%; display: flex; gap: 10px; align-items: center; min-height: 46px; padding: 6px 10px; background: none; border: 0; border-radius: 8px; color: var(--text); text-align: left; font-size: 15px; transition: background-color .2s; }
.lesson-btn:hover { background: var(--card-2); }
.lesson-btn[aria-current="true"] { background: var(--bg); }
.lesson-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--muted); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; transition: .3s var(--spring); }
.lesson-dot.done { background: var(--gold); color: var(--on-gold); }

.feed-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 80px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.post { padding: 18px 20px; }
.post-head { display: flex; gap: 12px; align-items: center; }
.post-meta { color: var(--muted); font-size: 14px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.like { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border: 0; border-radius: 8px; background: var(--bg); color: var(--text); font-weight: 600; transition: color .2s; }
.like .ic { transition: transform .35s var(--spring); }
.like[aria-pressed="true"] { color: var(--accent); }
.like[aria-pressed="true"] .ic { transform: scale(1.25); fill: var(--gold); }
.board { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.board li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-variant-numeric: tabular-nums; }
.board b { color: var(--accent); }
.board .progress { grid-column: 2 / -1; height: 5px; }

.chat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px; padding-block: 24px 40px; }
.chat-list { padding: 12px; }
.chat-btn { width: 100%; display: flex; gap: 12px; align-items: center; min-height: 68px; padding: 8px; background: none; border: 0; border-radius: 10px; text-align: left; transition: background-color .2s; }
.chat-btn:hover { background: var(--card-2); }
.chat-btn[aria-current="true"] { background: var(--bg); }
.chat-last { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { min-width: 22px; height: 22px; border-radius: 11px; background: var(--gold); color: var(--on-gold); font-size: 13px; font-weight: 700; display: grid; place-items: center; flex: none; animation: pop .4s var(--spring); }
.chat { display: flex; flex-direction: column; min-height: min(70vh, 660px); }
.chat-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.msg { max-width: 76%; padding: 9px 14px; border-radius: 14px; background: var(--bg); align-self: flex-start; }
.msg.me { align-self: flex-end; background: var(--gold); color: var(--on-gold); }
.typing { display: inline-flex; gap: 5px; align-items: center; height: 42px; padding: 0 14px; background: var(--bg); border-radius: 14px; align-self: flex-start; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: bounce 1s ease-in-out infinite; animation-delay: calc(var(--i) * 140ms); }
@keyframes bounce { 40% { transform: translateY(-6px); } }
.chat-form { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.icon-btn { width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--gold); color: var(--on-gold); flex: none; transition: transform .2s var(--spring); }
.icon-btn:hover { transform: scale(1.06); }

.cover-banner { position: relative; width: 100%; aspect-ratio: 4 / 1; min-height: 150px; max-height: 270px; border-radius: 14px 14px 0 0; overflow: hidden; transition: background .5s; }
/* A picture banner is complete as drawn: the faint logo seal only belongs on the plain colours */
.cover-banner.has-art > span[data-static] { display: none; }
.cover-banner .seal { position: absolute; right: 26px; top: -60px; width: 320px; opacity: .3; }
.profile-head { padding: 0 26px 24px; }
.profile-row { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; }
.big-avatar { position: relative; width: 128px; height: 128px; margin-top: -64px; flex: none; }
.big-avatar > svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.big-avatar > svg circle { fill: none; stroke-width: 4; }
.big-avatar .m-track { stroke: var(--card); }
.big-avatar .m-fill { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p)); transition: stroke-dashoffset 1.2s var(--ease); }
.big-avatar b { position: absolute; inset: 9px; border-radius: 50%; background: var(--bg); color: var(--accent); display: grid; place-items: center; font: 800 42px var(--display); }
.level { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); }
.panel-open { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.panel-open.open { grid-template-rows: 1fr; }
.panel-open > div { overflow: hidden; min-height: 0; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 16px 20px; padding: 24px; margin-top: 14px; }
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.swatch { width: 100%; height: 44px; border-radius: 10px; border: 2px solid transparent; transition: transform .2s var(--spring), border-color .2s; }
.swatch[aria-pressed="true"] { border-color: var(--text); transform: scale(1.08); }

.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.ach { display: flex; gap: 16px; align-items: center; padding: 16px; }
.ach strong { display: block; }
.ach small { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; }
.ach em { display: block; font-style: normal; font-weight: 700; font-size: 13px; margin-top: 3px; color: var(--muted); }
.ach.is-got em { color: var(--accent); }

.join { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.join-form { padding: 36px clamp(20px, 6vw, 84px) 56px; display: flex; flex-direction: column; }
.join-side { position: relative; background: var(--card-2); border-left: 1px solid var(--line); display: grid; place-items: center; padding: 40px; overflow: hidden; }
.join-side .bg-seal { position: absolute; width: 720px; right: -220px; bottom: -220px; opacity: .08; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 46px; padding: 8px 14px; background: var(--card); border: 1px solid transparent; border-radius: 10px; font-weight: 600; transition: background-color .2s, color .2s, transform .2s var(--spring); }
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.dir-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dir-opt { display: flex; flex-direction: column; gap: 6px; padding: 16px; text-align: left; background: var(--card); border: 2px solid transparent; border-radius: 12px; transition: border-color .2s, transform .2s var(--ease); }
.dir-opt:hover { transform: translateY(-2px); }
.dir-opt[aria-pressed="true"] { border-color: var(--accent); }
.dir-opt .ic { color: var(--accent); }
.dir-opt small { color: var(--muted); font-size: 14px; }
.step-view { animation: enter .5s var(--ease) both; }

.id-card { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%; position: relative; width: min(100%, 440px); aspect-ratio: 1.58; border-radius: 18px; padding: 22px; background: linear-gradient(135deg, #1D2530, #0F161E 70%); border: 1px solid var(--line-2); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .35s var(--ease); }
.id-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(240px circle at var(--mx) var(--my), rgba(255, 207, 35, .16), transparent 70%); pointer-events: none; }
.id-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.id-card .seal { position: absolute; right: -30px; bottom: -30px; width: 190px; }
.id-name { font: 800 28px/1.15 var(--display); letter-spacing: -.03em; overflow-wrap: anywhere; max-width: 66%; }
.id-line { font-size: 15px; color: var(--muted); max-width: 62%; }
.id-card.done { animation: card-win .8s var(--spring); }
@keyframes card-win { 40% { transform: perspective(900px) rotateY(8deg) scale(1.05); } }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; padding-bottom: 60px; }
.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 14px; font-weight: 600; padding: 14px 16px; }
td { padding: 12px 16px; border-top: 1px solid var(--line); }
tbody tr { transition: background-color .2s; }
tbody tr:hover { background: var(--card-2); }
.status { min-height: 38px; padding: 4px 12px; border: 0; border-radius: 6px; font-size: 14px; font-weight: 700; background: var(--bg); transition: background-color .25s, color .25s; }
.status[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--muted); text-align: center; cursor: pointer; transition: border-color .2s, color .2s; }
.drop:hover { border-color: var(--accent); color: var(--text); }

.toast { position: fixed; z-index: 60; right: 22px; bottom: 22px; display: flex; gap: 14px; align-items: center; padding: 12px 20px 12px 12px; background: var(--card); border: 1px solid var(--gold); border-radius: 14px; animation: toast .6s var(--spring) both; max-width: calc(100vw - 32px); }
.toast strong { display: block; }
.toast small { color: var(--muted); }
.toast.fx-out { opacity: 0; transform: translateY(16px); transition: .5s var(--ease); }
@keyframes toast { from { opacity: 0; transform: translateY(40px) scale(.9); } }
.fx-coins { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 70; pointer-events: none; }

::view-transition-old(root) { animation: .22s ease both vt-out; }
::view-transition-new(root) { animation: .34s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .orbit, .ll-sheen::after { animation: none; }
  .ll-pulses { display: none; }
}

/* ---------- podium of honor ---------- */
.honor-top { padding-block: 40px 30px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.honor-top .lead { max-width: 60ch; }
.sample-note { font-size: 14px; color: var(--amber); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; max-width: 980px; margin-inline: auto; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.pod-avatar { width: 68px; height: 68px; font-size: 26px; border: 2px solid var(--gold); }
.first .pod-avatar { width: 92px; height: 92px; font-size: 36px; border-width: 3px; }
.pod-metric { font: 800 clamp(28px, 3.4vw, 42px)/1.1 var(--display); letter-spacing: -.047em; white-space: nowrap; }
.first .pod-metric { font-size: clamp(32px, 4.2vw, 54px); }
.pod-what { font-size: 15px; line-height: 1.35; min-height: 2.7em; }
.pod-step { width: 100%; margin-top: 10px; display: grid; place-items: start center; padding-top: 12px; border-radius: 12px 12px 0 0; background: var(--card); font: 800 clamp(40px, 5vw, 68px)/1 var(--display); color: rgba(255, 255, 255, .16); height: 130px; transform-origin: bottom; }
.first .pod-step { height: 200px; background: var(--grad); color: rgba(6, 14, 21, .55); }
.second .pod-step { height: 160px; }
.fx-on .pod .pod-step { transform: scaleY(0); }
.fx-on .pod.fx-in .pod-step { transform: none; transition: transform .9s var(--ease); transition-delay: calc(var(--d, 0) * 80ms); }
.wall-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 14px; }
.win { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.win-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--accent); }
.win-metric { font: 800 40px/1.1 var(--display); letter-spacing: -.047em; }
.win .post-head { margin-top: auto; padding-top: 8px; }

/* ---------- pinned badges ---------- */
.badge-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; background: none; border: 1px solid transparent; border-radius: 12px; text-align: center; transition: background-color .2s, border-color .2s; }
.badge-pick:hover { background: var(--card-2); }
.badge-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--card-2); }
.badge-pick small { color: var(--muted); font-size: 13px; }
.badge-pick[aria-pressed="true"] small { color: var(--accent); }
.badge-pick .medal { width: 92px; height: 92px; }
.mini-badge { width: 34px; height: 34px; display: grid; place-items: center; animation: pop .4s var(--spring); }
.mini-badge img { width: 34px; height: 34px; display: block; }
/* Badge pictures: earned in full colour, not yet earned faded and grey */
.badge-art { flex: none; display: grid; place-items: center; width: 72px; height: 72px; }
.badge-art img { width: 100%; height: 100%; display: block; transition: filter .3s, opacity .3s; }
.ach:not(.is-got) .badge-art img { filter: grayscale(1); opacity: .42; }
.badge-pick .badge-art { width: 64px; height: 64px; }
/* Room pictures fill the whole round face */
.room-pic { overflow: hidden; background: none; }
.room-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 760px) {
  .podium { gap: 6px; }
  .pod-avatar { width: 48px; height: 48px; font-size: 19px; }
  .first .pod-avatar { width: 60px; height: 60px; font-size: 24px; }
  .pod-metric, .first .pod-metric { font-size: clamp(17px, 5vw, 26px); }
  .pod-what { font-size: 13px; min-height: 3.9em; }
  .pod-step { height: 70px; font-size: 32px; }
  .first .pod-step { height: 110px; }
  .second .pod-step { height: 88px; }
}

/* ---------- resources ---------- */
.res-lesson { display: block; font-weight: 700; color: var(--text); text-decoration: none; margin-bottom: 4px; }
.res-lesson:hover { color: var(--accent); }
.res-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; transition: background-color .2s, transform .2s var(--ease); }
.res-item:hover { background: var(--card-2); color: var(--text); transform: translateX(4px); }
.res-ic { width: 36px; height: 36px; border-radius: 8px; background: var(--bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.res-name { flex: 1; min-width: 0; }
.res-type { color: var(--muted); font-size: 13px; font-weight: 600; flex: none; }
.res-count { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 600; flex: none; }
.lesson-row { color: var(--text); text-decoration: none; }
.lesson-row:hover { color: var(--text); }

/* ---------- news ---------- */
.news-top { background: var(--grad); color: var(--on-gold); border-radius: 16px; overflow: hidden; }
.news-copy { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; max-width: 780px; }
.news-copy p { font-size: 18px; }
.news-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; font-weight: 600; }
.pin { display: inline-flex; align-items: center; gap: 5px; }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.news-item { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.news-item .news-meta { color: var(--muted); }
.news-item h3 { font: 700 21px/1.3 var(--display); letter-spacing: -.03em; }

@media (max-width: 760px) {
  .app-nav a { font-size: 11px; }
}

/* ---------- app shell ---------- */
.has-rail { padding-left: 88px; }
.rail { position: fixed; inset: 0 auto 0 0; width: 88px; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; background: var(--card-2); border-right: 1px solid var(--line); view-transition-name: rail; }
.rail-logo { display: block; margin-bottom: 8px; transition: transform .7s var(--spring); }
.rail-logo:hover { transform: rotate(360deg); }
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; flex: 1; }
.rail-nav a, .rail-admin { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 9px 2px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; transition: background-color .2s, color .2s; }
.rail-nav a:hover, .rail-admin:hover { background: var(--card); color: var(--text); }
.rail-nav a[aria-current], .rail-admin[aria-current] { background: var(--card); color: var(--accent); font-weight: 600; }
.rail-streak { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: var(--card); color: var(--orange); text-decoration: none; transition: transform .25s var(--spring); }
.rail-streak:hover { transform: scale(1.08); color: var(--orange); }
.rail-streak b { color: var(--text); font: 800 15px var(--display); }
.rail-streak .ic, .streak-flame .ic { animation: flick 1.6s ease-in-out infinite alternate; transform-origin: 50% 90%; }
@keyframes flick { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.1) rotate(3deg); } }
.page { max-width: 1200px; margin-inline: auto; padding-inline: 28px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.streak-chip { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; color: var(--orange); font-size: 14px; font-weight: 600; text-decoration: none; }
.streak-chip:hover { color: var(--amber); }
.brand { display: inline-flex; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; border-radius: 50%; display: block; transition: transform .7s var(--spring); }
.brand:hover .brand-mark { transform: rotate(360deg); }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px; max-width: 1180px; margin-inline: auto; padding: 32px; }
.signin-art { width: min(100%, 520px); justify-self: center; }
.signin-box { width: 100%; max-width: 420px; justify-self: center; }
.pass-row { position: relative; }
.pass-row .input { padding-right: 52px; }
.pass-eye { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--muted); }
.pass-eye:hover, .pass-eye[aria-pressed="true"] { color: var(--accent); }
.form-error { color: var(--orange); font-weight: 600; font-size: 15px; }
.fx-shake { animation: shake .4s var(--ease); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.draft-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ---------- messenger ---------- */
.chat-app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.chat-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--card-2); }
.chat-side-top { padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 44px; border-radius: 10px; background: var(--card); color: var(--muted); transition: box-shadow .2s; }
.search:focus-within { box-shadow: 0 0 0 1px var(--gold); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; }
.rooms-title { padding: 12px 10px 4px; font: 700 11px var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.chat-btn { width: 100%; display: flex; gap: 12px; align-items: center; min-height: 64px; padding: 8px; background: none; border: 0; border-radius: 10px; color: var(--text); text-align: left; transition: background-color .2s; }
.chat-btn:hover { background: var(--card); }
.chat-btn[aria-current="true"] { background: var(--card); box-shadow: inset 2px 0 0 var(--gold); }
.room-av { background: var(--card); }
.chat-btn[aria-current="true"] .room-av { background: var(--bg); }
.chat-last { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.chat-back { display: none; width: 44px; height: 44px; place-items: center; background: none; border: 0; color: var(--text); }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 3px; }
.day-sep { align-self: stretch; text-align: center; margin-bottom: 8px; }  /* stays centred above my own messages too */
.day-sep span { padding: 3px 12px; border-radius: 999px; background: var(--card); color: var(--muted); font-size: 13px; }
.msg-row { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; padding-left: 50px; }
.msg-row.fresh { margin-top: 12px; }
.msg-row.me { align-self: flex-end; padding-left: 0; }
.msg-av { width: 40px; height: 40px; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: none; min-width: 0; padding: 8px 12px; border-radius: 14px; background: var(--card); color: var(--text); align-self: auto; }
.msg-row.me .msg { background: var(--gold); color: var(--on-gold); }
.msg-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; font-weight: 700; }
.msg-quote { padding: 3px 8px; border-left: 2px solid currentColor; font-size: 14px; opacity: .75; }
.msg-file { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.msg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 12px; opacity: .72; }
.msg-act { display: inline-flex; align-items: center; gap: 3px; min-width: 28px; min-height: 28px; justify-content: center; padding: 2px 4px; background: none; border: 0; border-radius: 6px; color: inherit; font-size: 12px; opacity: 0; transition: opacity .15s; }
.msg-row:hover .msg-act, .msg-act:focus-visible, .msg-act.on { opacity: 1; }
.msg-act.on .ic { fill: currentColor; }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); animation: enter .25s var(--ease); }
.reply-bar .msg-act { opacity: 1; font-size: 20px; }
.chat-form { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.chat-form .input { background: var(--card); }
.attach { width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: none; }
.attach:hover { color: var(--accent); }
.emoji-btn { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; flex: none; }
.emoji-btn:hover, .emoji-btn[aria-expanded="true"] { color: var(--accent); }
/* Phones: a page cannot switch the keyboard to its emoji tab, and the keyboard already has its own emoji key
   (Gboard: next to the comma). So the button and our panel are for computers only. */
@media (pointer: coarse) { .emoji-btn, .emoji-pop { display: none; } }
.emoji-pop { position: absolute; right: 14px; bottom: 100%; z-index: 7; display: grid; grid-template-columns: repeat(8, 40px); gap: 2px; margin-bottom: 6px; padding: 8px; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 12px 28px rgba(0, 0, 0, .22); animation: enter .15s var(--ease); }
.emoji-pop button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 23px; line-height: 1; cursor: pointer; }
.emoji-pop button:hover { background: var(--card-2); }
@media (max-width: 760px) { .emoji-pop { left: 8px; right: 8px; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); } }

/* ---------- streak + credentials ---------- */
.streak-card { display: flex; flex-wrap: wrap; gap: 18px 24px; align-items: center; padding: 22px 24px; }
.streak-flame { color: var(--orange); }
.streak-num { font: 800 44px/1.1 var(--display); letter-spacing: -.047em; }
.week { display: flex; gap: 8px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.week-day b { font-weight: 600; }
.week-day i { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); }
.week-day.on i { background: var(--grad); }
.week-day.today i { background: var(--grad); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.cred { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--gold); border-radius: 12px; animation: enter .35s var(--ease); }
.cred dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cred dt { color: var(--muted); font-size: 13px; }
.cred dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }

/* ---------- tablets and phones ---------- */
@media (max-width: 1040px) {
  .split, .admin-grid, .signin { grid-template-columns: minmax(0, 1fr); }
  .signin { align-content: center; padding: 24px 20px; gap: 22px; }
  .signin-art { width: min(58%, 260px); }
  .sticky-side { position: static; }
  .join { grid-template-columns: minmax(0, 1fr); }
  .join-side { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .has-rail { padding-left: 0; padding-bottom: 66px; }
  .rail { inset: auto 0 0 0; width: auto; height: auto; flex-direction: row; padding: 4px 4px max(4px, env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); }
  .rail-logo, .rail-streak, .rail-admin { display: none; }
  .rail-nav { flex-direction: row; gap: 0; }
  .rail-nav a { flex: 1; min-width: 0; font-size: 11px; padding: 6px 1px; }
  .page { padding-inline: 16px; }
  .courses, .dir-pick { grid-template-columns: minmax(0, 1fr); }
  .toast { bottom: 80px; right: 16px; }
  .cover-banner { aspect-ratio: auto; height: 170px; min-height: 0; }
  .profile-head { padding-inline: 18px; }
  .chat-app { height: calc(100dvh - 66px); grid-template-columns: minmax(0, 1fr); }
  .chat-main { display: none; }
  .chat-app.show-chat .chat-side { display: none; }
  .chat-app.show-chat .chat-main { display: flex; }
  .chat-back { display: grid; }
  .chat-head { padding: 6px 10px; }
  .chat-head .btn { min-height: 40px; padding: 0 10px; font-size: 14px; }
  .chat-body { padding: 12px; }
  .chat-form { padding: 8px 10px; gap: 6px; }
  .msg-row { max-width: 92%; padding-left: 0; }
  .msg-act { opacity: 1; }
  .week-day i { width: 24px; height: 24px; }
}

/* ---------- devices ---------- */
.device { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 0; }
.device strong { display: block; }
.device small { display: block; color: var(--muted); font-size: 14px; }
.device-cell { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.limit-box { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; padding: 18px; border: 1px solid var(--orange); border-radius: 12px; animation: enter .35s var(--ease); }

/* ---------- watermark + account security ---------- */
.wm { position: absolute; z-index: 2; left: 8%; top: 12%; color: rgba(255, 255, 255, .3); font: 500 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; pointer-events: none; user-select: none; animation: wm 48s steps(1) infinite; }
@keyframes wm { 0% { left: 8%; top: 12%; } 25% { left: 66%; top: 22%; } 50% { left: 18%; top: 68%; } 75% { left: 72%; top: 72%; } }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.risk { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; background: var(--card-2); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.risk.high { background: rgba(255, 141, 58, .16); color: var(--orange); }
.risk.off { background: var(--bg); color: var(--text); }
.row-risk td:first-child { box-shadow: inset 2px 0 0 var(--orange); }
.detail { padding: 20px; animation: enter .35s var(--ease); }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.risk-why { color: var(--orange); font-weight: 600; margin-bottom: 10px; }

/* ---------- live data ---------- */
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-file { color: inherit; text-decoration: underline; }
.new-chat { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--card); color: var(--text); font-weight: 600; }
.new-chat:hover { color: var(--accent); }
.side-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }
.video-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); text-align: center; padding: 16px; }
.video-empty .ic { color: var(--accent); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- telegram-grade chat ---------- */
.is-on { position: relative; }
.is-on::after { content: ""; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #3DDC84; border: 2px solid var(--card-2); }
.on-text { color: #3DDC84; }
.unread.at { background: var(--orange); }
.unread.muted-badge { background: var(--line-2); color: var(--text); }
.head-icon { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 10px; color: var(--muted); font-size: 22px; flex: none; }
.head-icon:hover, .head-icon[aria-pressed="true"] { background: var(--card); color: var(--accent); }
.find-bar { position: relative; padding: 8px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.find-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.find-hit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 8px; background: none; border: 0; border-radius: 8px; color: var(--text); text-align: left; }
.find-hit:hover { background: var(--card); }
.find-hit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.find-hit time { font-size: 12px; color: var(--muted); }
.pin-bar { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 18px; background: var(--card-2); border: 0; border-bottom: 1px solid var(--line); color: var(--text); text-align: left; }
.pin-bar .ic { color: var(--accent); }
.pin-bar:hover { background: var(--card); }
.msg-wrap { display: flex; flex-direction: column; }
.msg-wrap:has(.msg-row.me) { align-items: flex-end; }
.new-line { align-self: stretch; display: flex; align-items: center; gap: 10px; margin: 10px 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.new-line::before, .new-line::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.msg-row { cursor: default; border-radius: 12px; transition: background-color .3s; -webkit-touch-callout: none; }
.msg-row.fx-flash .msg { box-shadow: 0 0 0 2px var(--gold); }
.msg-row.fx-flash { background: rgba(255, 207, 35, .14); }
.msg-row.selecting { cursor: pointer; }
.msg-row.sel { background: none; }
.msg { transition: box-shadow .3s; }
.msg-fwd { color: var(--accent); font-size: 13px; font-weight: 600; }
.msg-row.me .msg-fwd { color: inherit; opacity: .8; }
.msg-quote { display: block; width: 100%; padding: 4px 8px; background: color-mix(in srgb, var(--text) 6%, transparent); border: 0; border-left: 3px solid var(--gold); border-radius: 4px; color: inherit; text-align: left; cursor: pointer; font-size: 14px; opacity: 1; }
.msg-quote b { display: block; color: var(--accent); font-size: 13px; }
.msg-row.me .msg-quote { background: rgba(6, 14, 21, .12); border-left-color: var(--on-gold); }
.msg-row.me .msg-quote b { color: inherit; }
.msg-quote span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; opacity: .85; }
.msg-img { display: block; padding: 0; background: none; border: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.msg-img img { display: block; max-width: min(100%, 340px); max-height: 340px; }
.msg-file small { opacity: .7; }
.msg-text a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
.at-name { color: var(--amber); font-weight: 600; }
.msg-row.me .at-name { color: inherit; text-decoration: underline; }
.at-name.me { background: rgba(255, 141, 58, .2); border-radius: 4px; padding: 0 3px; }
.msg-foot { flex-wrap: wrap; }
.msg-foot time, .msg-foot small { font-size: 12px; }
.react-chip { min-height: 26px; padding: 1px 8px; background: color-mix(in srgb, var(--text) 8%, transparent); border: 1px solid transparent; border-radius: 999px; color: inherit; font-size: 13px; }
.react-chip.on { border-color: var(--accent); background: rgba(255, 207, 35, .16); }
.msg-row.me .react-chip { background: rgba(6, 14, 21, .12); }
.msg-row.me .react-chip.on { border-color: var(--on-gold); }
.ticks-read { letter-spacing: -2px; font-size: 13px; }
.ticks-read.seen { font-weight: 700; }
.msg-more { width: 26px; height: 26px; padding: 0; background: none; border: 0; border-radius: 6px; color: inherit; font-size: 16px; opacity: 0; transition: opacity .15s; }
.msg-row:hover .msg-more, .msg-more:focus-visible { opacity: 1; }
.typing-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.chat-main { position: relative; }
.to-bottom { position: absolute; right: 20px; bottom: 96px; z-index: 5; width: 46px; height: 46px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line-2); border-radius: 50%; color: var(--text); }
.to-bottom .ic { transform: rotate(-90deg); }
.to-bottom .unread { position: absolute; top: -6px; right: -4px; }
.sel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line); }
.composer-wrap { position: relative; }
.composer { resize: none; line-height: 1.45; min-height: 48px; max-height: 170px; }
.chat-form { align-items: flex-end; }
.suggest { position: absolute; left: 62px; right: 74px; bottom: 100%; z-index: 6; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; animation: enter .15s var(--ease); }
.suggest-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 6px 8px; background: none; border: 0; border-radius: 8px; color: var(--text); text-align: left; }
.suggest-item.on, .suggest-item:hover { background: var(--bg); }
.suggest-item small { display: block; color: var(--muted); }
.suggest-item .avatar { width: 36px; height: 36px; }
.ctx-back { position: fixed; inset: 0; z-index: 60; }
.ctx { position: fixed; z-index: 61; width: 260px; display: flex; flex-direction: column; gap: 8px; animation: ctx .16s var(--ease) both; transform-origin: top left; }
@keyframes ctx { from { opacity: 0; transform: scale(.92); } }
.ctx-react { display: flex; justify-content: space-between; padding: 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.ctx-react button { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; font-size: 19px; transition: transform .15s var(--spring); }
.ctx-react button:hover { transform: scale(1.3); }
.ctx-react button.on { background: rgba(255, 207, 35, .2); }
.ctx-list { padding: 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.ctx-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 6px 10px; background: none; border: 0; border-radius: 8px; color: var(--text); text-align: left; font-size: 15px; }
.ctx-list button:hover { background: var(--bg); }
.ctx-list button.danger { color: var(--orange); }
.modal-back { position: fixed; inset: 0; z-index: 62; background: rgba(0, 0, 0, .6); }
.modal { position: fixed; z-index: 63; left: 50%; top: 50%; translate: -50% -50%; width: min(92vw, 400px); max-height: 80vh; display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--card); border-radius: 14px; animation: enter .2s var(--ease); }
.modal-list { overflow-y: auto; }
.lightbox { position: fixed; inset: 0; z-index: 64; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .86); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
@media (max-width: 760px) {
  .chat-head .btn { display: none; }
  .msg-more { opacity: 1; }
  .to-bottom { bottom: 84px; }
  .suggest { left: 8px; right: 8px; }
  .ctx { left: 50% !important; translate: -50% 0; }
}

/* ---------- connected pages ---------- */
.msg-row { -webkit-user-select: text; user-select: text; }
@media (hover: none) { .msg-row { -webkit-user-select: none; user-select: none; } }
.pod-btns { display: flex; gap: 4px; }
.pod-btns .status { min-width: 40px; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.search-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search-row .search { flex: 1 1 240px; }
.chat-body::before { content: ""; flex: 1 0 0; }

/* ---------- second design pass: real app feel ---------- */
.face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; color: #fff; font: 700 calc(1em + 2px) var(--display); }
.avatar { background: none; overflow: visible; position: relative; }
.room-ic { background: var(--card); color: var(--accent); }
.chat-btn[aria-current="true"] .room-ic:not(.toned) { background: var(--bg); }
.room-ic.toned { color: #F3E9D4; }
.rail-nav a { position: relative; }
.rail-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: var(--on-gold); font: 700 11px/18px var(--body); text-align: center; }
.rail-badge[hidden] { display: none; }
.rail-face { width: 24px; height: 24px; display: block; font-size: 11px; }
/* Daily line: one quiet sentence under the title; × hides it until tomorrow */
.day-line { position: relative; display: flex; align-items: center; gap: 4px; margin: 0 0 12px; padding: 4px 0 4px 14px; animation: enter .3s var(--ease); }
.day-line::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #FFE38A 0%, #FFCF23 45%, #D9971A 100%); }
.day-line p { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 1.45; color: color-mix(in srgb, var(--text) 82%, transparent); overflow-wrap: anywhere; }
.day-line .head-icon { width: 30px; height: 30px; font-size: 18px; margin-top: -2px; }
.notify-card { display: flex; gap: 10px; align-items: center; padding: 10px 6px 10px 12px; border-radius: 12px; background: var(--card); animation: enter .3s var(--ease); }
.notify-card strong { display: block; font-size: 15px; }
.notify-card small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.notify-ic { color: var(--accent); flex: none; }
.notify-card .head-icon { width: 34px; height: 34px; }
.notify-card .btn { flex: none; }

/* room list */
.chat-btn { min-height: 70px; gap: 12px; }
.room-av { width: 52px; height: 52px; font-size: 19px; }
.room-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.room-top, .room-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.room-top strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-top time { flex: none; color: var(--muted); font-size: 12px; }
.room-bottom .chat-last { flex: 1; min-width: 0; }

/* chat head */
.chat-head { position: relative; flex-wrap: nowrap; padding: 8px 12px; background: var(--card-2); z-index: 8; }
.head-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.head-who strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-av { width: 44px; height: 44px; font-size: 17px; }
.head-menu { position: absolute; right: 10px; top: calc(100% + 6px); z-index: 20; min-width: 220px; padding: 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); animation: ctx .16s var(--ease) both; transform-origin: top right; }
.head-menu a, .head-menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 10px; background: none; border: 0; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; text-align: left; }
.head-menu a:hover, .head-menu button:hover { background: var(--bg); }
.head-menu .danger { color: var(--orange); }

/* conversation: quiet doodle wallpaper, telegram-shaped bubbles */
.chat-body { gap: 2px; padding: 14px 16px; background-color: var(--bg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='%23FFCF23' stroke-opacity='.045' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 34l-10 8 10 8M56 34l10 8-10 8M48 28l-10 28'/%3E%3Ccircle cx='150' cy='44' r='14'/%3E%3Cpath d='M150 34v10l7 5M98 96h34v22h-22l-12 10zM32 130h22v30H36a4 4 0 0 1-4-4zM32 156a4 4 0 0 1 4-4h18M170 120c2 9 12 12 12 25a12 12 0 0 1-24 0c0-5 3-7 5-9 1 3 2 5 5 6-1-7 0-14 2-22zM92 180l8 8 16-16M18 196h26M18 204h16M186 188l14 0M193 181v14'/%3E%3C/svg%3E"); }
.msg-row { max-width: min(82%, 620px); padding-left: 0; gap: 8px; border-radius: 0; }
.msg-row.group { padding-left: 44px; }
.msg-row.group:has(.msg-av) { padding-left: 0; }
.msg-row.fresh { margin-top: 10px; }
.msg-av { width: 36px; height: 36px; font-size: 14px; }
.msg { display: block; position: relative; padding: 6px 10px 6px; border-radius: 14px; background: var(--bubble); box-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.msg-row.tail .msg { border-bottom-left-radius: 4px; }
.msg-row.me.tail .msg { border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.msg-row.me .msg { background: linear-gradient(180deg, #FFD23A, #FFC42B); }
.msg-who { display: flex; margin-bottom: 2px; }
.msg-who .tag { font-size: 11px; padding: 0 6px; }
.msg-fwd { display: block; }
.msg-quote { margin-bottom: 4px; }
.msg-img { margin: 0 -6px 4px; }
.msg-img img { border-radius: 10px; }
.msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg-foot { float: right; position: relative; top: 5px; display: inline-flex; flex-wrap: nowrap; gap: 4px; margin-left: 12px; font-size: 11px; opacity: .62; }
.msg-foot time, .msg-foot small { font-size: 11px; }
.msg::after { content: ""; display: block; clear: both; }
.msg-more { width: 18px; height: 16px; margin-left: 2px; font-size: 14px; line-height: 1; }
@media (hover: none) { .msg-more { display: none; } }
.day-sep { margin: 8px 0; }
.day-sep span { background: color-mix(in srgb, var(--card) 90%, transparent); font-weight: 600; font-size: 12px; }
.new-line { font-size: 12px; }
.at-name { text-decoration: none; }
.msg-text a.at-name { text-decoration: none; }

/* composer */
.composer-wrap { background: var(--card-2); }
.chat-form { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); gap: 6px; }
.composer { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 22px; background: var(--card) !important; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; }

/* lesson, profile and news photos */
.cover.has-photo { padding: 0; }
.cover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-photo .cover-scrim { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; background: linear-gradient(180deg, rgba(6, 14, 21, .15), rgba(6, 14, 21, .82)); }
.course-hero { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 14px; display: block; }
.news-photo { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; margin-block: 8px; }
.news-top .news-photo { border-radius: 0; margin: 0; }
.proof-photo { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; margin-top: 6px; }
.cover-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-edit { border: 0; position: absolute; right: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px; background: rgba(6, 14, 21, .72); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.big-avatar .face { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); font-size: 42px; object-fit: cover; }
.big-avatar.can-edit { cursor: pointer; }
.big-avatar .cam { position: absolute; right: 2px; bottom: 6px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--on-gold); border: 3px solid var(--card); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.big-avatar .cam .ic { display: block; }
.handle { color: var(--accent); font-weight: 600; }
.name-check { font-size: 14px; color: var(--muted); }
.name-check.ok { color: #3DDC84; }
.name-check.bad { color: var(--orange); }
.at-field { position: relative; }
.at-field::before { content: "@"; position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }
.at-field .input { padding-left: 32px; }
.photo-row { display: flex; align-items: center; gap: 10px; }
.photo-thumb { width: 72px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--card-2); }
.pick-face { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.pick-face .avatar { width: 72px; height: 72px; font-size: 26px; }

/* phones: a real full-screen app, nothing bounces, nothing hides */
@media (max-width: 760px) {
  html:has(body.page-chat) { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body.page-chat { position: fixed; top: 0; left: 0; right: 0; height: 100dvh; overflow: hidden; padding: 0; overscroll-behavior: none; }
  .page-chat .chat-app { height: 100%; padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .page-chat .chat-app.show-chat { padding-bottom: 0; }
  .page-chat:has(.chat-app.show-chat) .rail { display: none; }
  .chat-side-top { padding: 12px 14px 8px; }
  .chat-head { padding: 6px 6px 6px 2px; }
  @media (display-mode: standalone) {  /* status bar room only in the installed app: some browsers report it inside a normal tab too */
    .chat-side-top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
    .chat-head { padding-top: calc(6px + env(safe-area-inset-top, 0px)); }
  }
  .chat-back { width: 40px; }
  .chat-body { padding: 10px 8px; }
  .msg-row { max-width: 88%; }
  .msg-row.group { padding-left: 42px; }
  .to-bottom { bottom: 76px; right: 12px; }
}
@media (max-width: 760px) {
  .page-chat #dc-root { height: 100%; }
}
html { color-scheme: dark; }
.chat-scroll, .chat-body, .modal-list, .find-list { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- 30-day plan and monthly review ---------- */
.rail-dot { position: absolute; top: 5px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.link-btn { padding: 6px; background: none; border: 0; color: var(--muted); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.plan-note { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 22px; color: var(--text); text-decoration: none; }
.plan-note:hover { color: var(--text); }
.plan-note-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.plan-setup { max-width: 760px; display: flex; flex-direction: column; gap: 26px; padding-bottom: 70px; }
.plan-setup .h-sm { margin-bottom: 6px; }
.plan-setup .input { background: var(--card); }
.plan-dirs { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.dir-opt .tag { align-self: flex-start; margin-top: 2px; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; padding-bottom: 80px; }
.plan-side { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.plan-count { display: flex; align-items: baseline; gap: 8px; }
.plan-count b { font: 800 46px/1 var(--display); letter-spacing: -.04em; color: var(--accent); }
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.plan-list { list-style: none; margin: 0; padding: 6px; }
.plan-today { outline: 1px solid rgba(255, 207, 35, .45); outline-offset: -1px; }
.plan-row { width: 100%; display: flex; align-items: center; gap: 13px; padding: 11px 12px; min-height: 58px; background: none; border: 0; border-radius: 9px; color: var(--text); text-align: left; text-decoration: none; transition: background-color .2s; }
.plan-row:hover { background: var(--card-2); color: var(--text); }
.plan-tick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; transition: background-color .2s, border-color .2s, transform .25s var(--spring); }
.plan-tick.lesson { border-radius: 50%; color: var(--accent); }
.plan-row.done .plan-tick { background: var(--gold); border-color: var(--gold); color: var(--on-gold); transform: scale(1.04); }
.plan-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-text strong { font-weight: 600; line-height: 1.35; }
.plan-text small { color: var(--muted); font-size: 14px; }
.plan-text small:empty { display: none; }
.plan-row.done .plan-text strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.plan-day { flex: none; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.plan-row.late .plan-day { color: var(--amber); }
.plan-end { padding: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.review-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.review-tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.review-tile b { font: 800 34px/1.1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; padding-bottom: 70px; }
.review-box { padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.review-next { grid-column: 1 / -1; }
.review-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.review-cols .label { display: block; margin-bottom: 10px; }
.review-bar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-weight: 600; }
.review-unlock + .review-unlock { margin-top: 14px; }
.review-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.review-table th { text-align: right; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 0 8px 12px; }
.review-table th:first-child, .review-table td:first-child { text-align: left; padding-left: 0; }
.review-table td { padding: 8px 0 8px 12px; border-top: 1px solid var(--line); text-align: right; }
.review-table td.num { font-variant-numeric: tabular-nums; }
.review-table tr.up td:last-child b { color: var(--accent); }
@media (max-width: 1040px) { .plan-layout { grid-template-columns: minmax(0, 1fr); } .plan-side { position: static; order: -1; } }
@media (max-width: 760px) {
  .plan-dirs { grid-template-columns: minmax(0, 1fr); }
  .review-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid, .review-cols { grid-template-columns: minmax(0, 1fr); }
  .plan-row { padding-inline: 8px; gap: 11px; }
}
@media (max-width: 340px) { .rail-nav a { font-size: 10px; letter-spacing: -.01em; } }


/* ---------- chat: selecting like Telegram, room info panel ---------- */
.msg-wrap { position: relative; }
.chat-body .msg-row.selecting:not(.me) { margin-left: 34px; }
.msg-row.selecting::before { content: ""; position: absolute; left: 6px; bottom: 9px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font: 800 13px/1 var(--body); color: var(--on-gold); transition: background-color .15s, border-color .15s; }
.msg-row.sel::before { content: "✓"; background: var(--gold); border-color: var(--gold); }
.msg-wrap:has(.msg-row.selecting) { cursor: pointer; }
.msg-row.selecting .msg * { pointer-events: none; }  /* while selecting, a tap on a link or picture picks the message */
body.drag-select, body.drag-select * { -webkit-user-select: none; user-select: none; }
.msg-row.sel { border-radius: 0; border-image: linear-gradient(rgba(255, 207, 35, .12), rgba(255, 207, 35, .12)) fill 0 / / 0 100vw; }
.chat-head .head-who { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; border-radius: 10px; }
.chat-head button.head-who:hover strong { color: var(--accent); }
.chat-main { position: relative; }
.info-back { position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, .45); animation: fade .2s both; }
.info-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(400px, 100%); display: flex; flex-direction: column; background: var(--card-2); border-left: 1px solid var(--line); animation: slide-in .25s var(--ease) both; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.info-close { position: absolute; top: 8px; right: 8px; }
.info-top { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 20px 14px; text-align: center; }
.info-top strong { font: 800 20px/1.25 var(--display); }
.info-av { width: 84px; height: 84px; font-size: 32px; margin-bottom: 8px; }
.info-av .face, .info-av .room-ic { width: 100%; height: 100%; }
.info-about { font-size: 14px; }
.info-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; padding: 0 16px 14px; }
.info-actions > * { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 10px; background: var(--card); color: var(--text); font-size: 13px; text-decoration: none; }
.info-actions > *:hover { color: var(--accent); }
.info-tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.info-tabs button { flex: none; padding: 10px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.info-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.info-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 24px; }
.info-find { margin: 2px 4px 8px; }
.info-member { display: flex; align-items: center; gap: 12px; padding: 8px 8px; border-radius: 10px; color: var(--text); text-decoration: none; }
.info-member:hover { background: var(--card); color: var(--text); }
.info-m-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.info-m-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.info-m-text small { color: var(--muted); font-size: 13px; }
.info-m-text small.on-text { color: #6fd28a; }
.info-tag { flex: none; padding: 2px 8px; border-radius: 6px; background: rgba(255, 207, 35, .14); color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.info-photo { aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--card); }
.info-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.info-link { display: flex; gap: 6px; align-items: center; max-width: 100%; overflow-wrap: anywhere; font-size: 14px; }

/* ---------- help menu ---------- */
.rail-help { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 9px 2px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 12px; font-weight: 500; }
.rail-help:hover, .rail-help[aria-expanded="true"] { background: var(--card); color: var(--text); }
.help-pop { position: fixed; left: 96px; bottom: 16px; z-index: 60; width: 320px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 8px; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: ctx .18s var(--ease) both; transform-origin: bottom left; }
.help-head { padding: 8px 10px 6px; font: 800 15px var(--display); }
.help-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--text); text-align: left; text-decoration: none; }
.help-item:hover { background: var(--bg); color: var(--text); }
.help-item .ic { color: var(--accent); flex: none; margin-top: 2px; }
.help-item > span:not([data-html]) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.help-item strong { font-weight: 600; font-size: 15px; }
.help-item small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.help-item.info { cursor: default; }
.help-item.info:hover { background: none; }
.help-card { display: none; }
@media (max-width: 760px) {
  .rail-help { display: none; }
  .help-card { display: block; }
  .info-panel { width: 100%; border-left: 0; }
  .chat-body .msg-row.selecting:not(.me) { margin-left: 30px; }
}

@media (max-width: 760px) {
  .rail-nav a span:not(.rail-face) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) { .rail-nav a { font-size: 10px; } }
.card.fx-flash { box-shadow: 0 0 0 2px var(--gold); transition: box-shadow .4s; }
section.card { scroll-margin-top: 16px; }

/* ---------- theme picker ---------- */
/* Language: each choice written in its own language */
.lang-mini { display: flex; justify-content: center; gap: 4px; margin-top: 14px; }
.lang-mini button { padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.lang-mini button[aria-pressed="true"] { color: var(--accent); font-weight: 700; }
.lang-pick { display: grid; gap: 10px; }
.lang-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lang-opt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 2px solid var(--line-2); border-radius: 14px; background: var(--card); color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s; }
.lang-row .lang-opt { justify-content: center; padding: 12px; background: var(--bg); }
.lang-opt strong { font: 700 18px var(--display); }
.lang-row .lang-opt strong { font-size: 16px; }
.lang-opt small { color: var(--muted); font-size: 14px; }
.lang-opt[aria-checked="true"] { border-color: var(--gold); }
.lang-opt[aria-checked="true"] strong::after { content: " ✓"; color: var(--accent); }
@media (max-width: 420px) { .lang-row { grid-template-columns: 1fr; } }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 2px solid var(--line-2); border-radius: 12px; background: var(--card); color: var(--text); text-align: left; transition: border-color .2s, transform .2s var(--spring); }
.theme-opt:hover { transform: translateY(-2px); }
.theme-opt[aria-checked="true"] { border-color: var(--gold); }
.theme-opt strong { font-weight: 700; font-size: 15px; }
.theme-opt small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.theme-prev { position: relative; display: block; height: 64px; border-radius: 8px; overflow: hidden; background: var(--tb); border: 1px solid rgba(127, 127, 127, .25); }
.theme-prev i { position: absolute; left: 10px; right: 36px; height: 14px; border-radius: 4px; background: var(--tc); }
.theme-prev i:first-child { top: 10px; }
.theme-prev i:nth-child(2) { top: 30px; right: 56px; }
.theme-prev b { position: absolute; right: 10px; bottom: 10px; width: 18px; height: 18px; border-radius: 50%; background: #FFCF23; }
.theme-prev.auto { background: linear-gradient(100deg, #060E15 50%, #F2F4F7 50%); }
.theme-prev.auto i { background: linear-gradient(100deg, #181E27 50%, #FFFFFF 50%); }
.theme-opt[aria-checked="true"] .theme-prev::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--on-gold); font: 800 12px/1 var(--body); }

/* ---------- roles: admin mode switch ---------- */
.rail-mode { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 8px 2px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 11px; }
.rail-mode b { color: var(--accent); font-size: 11px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-mode:hover { background: var(--card); color: var(--text); }
.rail-eye { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 8px 2px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 11px; white-space: nowrap; }
.rail-eye:hover { background: var(--card); color: var(--text); }
.rail-eye[aria-checked="true"] { color: var(--accent); font-weight: 700; }
/* On/off switch: used by God's Eye in the rail and on the profile page */
.switch { padding: 0; border: 0; background: none; cursor: pointer; flex: none; }
.switch-track { position: relative; display: block; width: 34px; height: 19px; border-radius: 999px; background: var(--line-2); transition: background-color .2s; }
.switch-track b { position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background-color .2s; }
[aria-checked="true"] > .switch-track, [aria-checked="true"].switch .switch-track { background: var(--gold); }
[aria-checked="true"] .switch-track b { transform: translateX(15px); background: var(--on-gold); }
.switch:focus-visible, .rail-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eye-switch .switch-track { width: 46px; height: 26px; }
.eye-switch .switch-track b { width: 20px; height: 20px; top: 3px; left: 3px; }
.eye-switch[aria-checked="true"] .switch-track b { transform: translateX(20px); }
.eye-name { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.eye-name > .ic { flex: none; margin-top: 2px; color: var(--accent); }
/* God's Eye: a deleted message stays, dimmed, under a label; older versions of an edited one follow, oldest at the bottom */
.msg-row.ghost .msg { opacity: .72; outline: 1px dashed var(--line-2); outline-offset: -1px; }
.eye-sep { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.eye-sep::before, .eye-sep::after { content: ""; flex: 1; border-top: 1px dashed currentColor; opacity: .6; }
.eye-sep.gone { color: var(--orange); opacity: 1; }
.msg-row.me .eye-sep.gone { color: inherit; }
.eye-old { opacity: .7; }
.eye-why { display: block; margin-top: 2px; font-size: 12px; opacity: .8; }
/* Reason form: reports, removing someone's message, blocking */
.reason-modal { width: min(94vw, 460px); overflow-y: auto; }
.cover-modal { width: min(94vw, 520px); }
.cover-upload { align-self: flex-start; cursor: pointer; }
.reason-modal .label { margin: 4px 0 0; }
.reason-lead { font-size: 14px; margin: 0; }
.reason-modal .chips { gap: 6px; }
.reason-modal .chip { min-height: 36px; padding: 6px 12px; font-size: 14px; border: 1px solid var(--line-2); }
.btn.danger { background: #B5432C; color: #fff; border-color: transparent; }
.btn.danger:hover { background: #9E3A25; }
.report-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }
.report-head { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-from { margin: 0; font-size: 14px; }
.report-why { gap: 6px; }
.report-note { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line-2); background: var(--card-2); border-radius: 0 8px 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-msg { display: block; padding: 8px 12px; border-radius: 8px; background: var(--bg); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.report-msg small { color: var(--muted); }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
/* Watcher (Admin) */
.watch-head .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.watch-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 20px; padding: 20px; }
.watch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.watch-note { display: flex; flex-direction: column; gap: 4px; }
.watch-note p, .watch-fact p { margin: 0; }
.watch-fact { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.idea-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.idea-card p { margin: 0; overflow-wrap: anywhere; }
.idea-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.idea-title { margin: 0; font-size: 19px; line-height: 1.3; }
.idea-hook { padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--card-2); border-radius: 0 8px 8px 0; }
.idea-hook small, .idea-links small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.idea-plan { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.idea-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.idea-links small { flex-basis: 100%; }
.idea-links a { color: var(--text); text-underline-offset: 3px; }
.idea-script { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.idea-part { display: flex; flex-direction: column; gap: 4px; }
.idea-part-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.block-why { margin: 6px 0 0; font-size: 14px; color: color-mix(in srgb, var(--orange) 70%, var(--text)); }
.eye-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.eye-row small { display: block; font-size: 14px; }
.mode-pop .help-item[aria-checked="true"] { background: var(--bg); }
.mode-bar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-size: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.mode-bar button { padding: 6px 12px; border: 0; border-radius: 999px; background: var(--on-gold); color: var(--gold); font-weight: 700; font-size: 13px; }
.mode-card { display: none; }
@media (max-width: 760px) {
  .rail-mode, .rail-eye { display: none; }  /* phones: both live on the Profil page */
  .mode-card { display: block; }
  .mode-bar { top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 24px); font-size: 13px; }
}
.theme-prev.cycle { background: linear-gradient(90deg, #C8CED6 0 20%, #F2F4F7 20% 40%, #6B737E 40% 60%, #2B333E 60% 80%, #060E15 80%); }
.theme-prev.cycle i { background: rgba(255, 255, 255, .55); }
.cycle-times { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cycle-row { display: flex; align-items: center; gap: 12px; }
.cycle-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 1px solid rgba(127, 127, 127, .4); }
.cycle-name { width: 90px; font-weight: 600; }
.cycle-row .input { width: auto; min-height: 42px; padding: 6px 10px; }
.theme-group { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 8px; }
.theme-group small { font-weight: 400; font-size: 13px; }

/* every bubble of one person's run lines up, the avatar sits beside the last one */
.msg-row.group:not(:has(.msg-av)) { padding-left: 44px; }
@media (max-width: 760px) { .msg-row.group:not(:has(.msg-av)) { padding-left: 42px; } }
.ctx-seen { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; margin-bottom: 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; background: none; color: var(--text); font-size: 15px; text-align: left; }
.ctx-seen:hover { background: var(--bg); }
.ctx-seen-ticks { color: var(--accent); font-weight: 700; letter-spacing: -2px; }
.ctx-seen-faces { display: flex; }
.ctx-seen-faces .avatar { width: 24px; height: 24px; font-size: 11px; margin-left: -6px; border: 2px solid var(--card); }
.locked-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.work-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.work-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.work-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.work-tile b { font: 800 26px/1.1 var(--display); }
.work-tile span { color: var(--muted); font-size: 13px; }
/* private Tanishuv card: only the new student sees it */
.intro-card { align-self: stretch; max-width: 620px; margin: 14px 0 6px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; border-radius: 14px; background: var(--card); border: 1px dashed var(--gold); }
.intro-head { display: flex; align-items: center; gap: 10px; }
.intro-av { width: 28px; height: 28px; border-radius: 50%; }
.intro-card p { margin: 0; }
.intro-card .textarea { background: var(--bg); }
.intro-label { font-size: 14px; font-weight: 600; }
.intro-text { font-size: 15px; line-height: 1.5; border-left: 3px solid var(--accent); resize: vertical; }
.intro-warn { color: #E5484D; font-size: 14px; font-weight: 500; }
.intro-card .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.intro-note { color: var(--muted); font-size: 13px; }
.intro-later { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.intro-later > span { flex: 1; }
.intro-later > .ic { flex: none; color: var(--accent); }
.privacy-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 10px 12px; border-radius: 10px; background: var(--card); color: var(--muted); font-size: 14px; line-height: 1.5; }
.privacy-note .ic { flex: none; margin-top: 2px; color: var(--accent); }
.privacy-note b { color: var(--text); }


/* profile picture: choose, place in the circle, save */
.photo-modal { width: min(92vw, 360px); max-height: 92vh; overflow-y: auto; align-items: center; text-align: center; gap: 12px; }
.photo-now { width: 160px; height: 160px; }
.photo-now .face { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font: 800 56px var(--display); color: #fff; }
.photo-tip { font-size: 14px; margin: 0; }
.photo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.photo-actions .btn { flex: 1 1 auto; }
.crop-stage { position: relative; width: 280px; height: 280px; border-radius: 12px; overflow: hidden; background: var(--bg); touch-action: none; }
.crop-stage canvas { display: block; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle closest-side, transparent calc(100% - 1px), rgba(255, 255, 255, .85) calc(100% - 1px), rgba(255, 255, 255, .85) 100%, rgba(0, 0, 0, .55) 100%); }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 280px; color: var(--muted); font-size: 20px; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }

/* first login: photo, official name, required vs optional */
.face-pick-row { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 14px; background: var(--card); }
.photo-pick { position: relative; flex: none; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.photo-pick .avatar { width: 84px; height: 84px; font-size: 32px; }
.photo-pick .avatar .face { width: 100%; height: 100%; }
.photo-badge { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--on-gold); border: 3px solid var(--card); }
.photo-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; font-size: 15px; }
.photo-copy .btn { margin-top: 6px; }
.official-name { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.official-name > .ic { flex: none; margin-top: 2px; color: var(--accent); }
.opt { font-weight: 500; font-size: 12px; color: var(--muted); padding: 1px 7px; border: 1px solid var(--line); border-radius: 99px; vertical-align: 1px; }
.field-help { font-size: 13px; color: var(--muted); }
.field-err { display: block; font-size: 14px; color: color-mix(in srgb, var(--orange) 70%, var(--text)); font-weight: 500; }
/* City picker: suggestions under the field, Latin name saved */
.city-box { position: relative; }
.city-box .input { scroll-margin-top: 56px; }
/* The setup step slides in with a transform, which would keep the list under the buttons that follow it */
.step-view:has(.city-list), .card:has(.city-list) { position: relative; z-index: 5; }
.city-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; max-height: min(340px, 50dvh); overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 28px rgba(0, 0, 0, .22); animation: enter .15s var(--ease); }
.city-opt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.city-opt b { font-weight: 600; }
.city-opt span { font-size: 13px; color: var(--muted); text-align: right; }
.city-opt[aria-selected="true"], .city-opt:hover { background: var(--card-2); }
.city-none { padding: 10px; font-size: 14px; color: var(--muted); }
button.big-avatar { border: 0; padding: 0; background: none; color: inherit; font: inherit; }
button.big-avatar:hover .cam { transform: scale(1.08); }
.big-avatar .cam { transition: transform .2s var(--ease); }
.real-name { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.real-name .ic { flex: none; }
.name-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.rename-form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; padding: 14px; border-radius: 12px; background: var(--bg); }

/* empty states: a small drawing in the current look's colours */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 34px 16px; text-align: center; color: var(--muted); }
.empty-state .spot { width: 190px; height: auto; }
.empty-state.small .spot { width: 130px; }
.empty-state p { margin: 0; max-width: 34ch; }
/* Locked after the term and the 24-hour wait: one card over everything */

/* course page: stages (bosqich) open one at a time, each with its modules and numbered lessons */
.course-parts { display: flex; flex-direction: column; padding: 4px 8px 10px; }
.course-part { border-top: 1px solid var(--line); }
.course-part:first-child { border-top: 0; }
.part-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px 10px; background: none; border: 0; border-radius: 10px; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.part-head:hover { background: var(--card-2); }
.part-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.part-text strong { font: 800 17px/1.3 var(--display); }
.part-text small { color: var(--muted); font-size: 14px; }
.part-count { flex: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.part-chev { flex: none; display: grid; transition: transform .2s var(--ease); color: var(--muted); }
.course-part.open .part-chev { transform: rotate(180deg); }
.part-body { padding: 0 0 10px; }
.course-module { margin-top: 6px; }
.module-title { margin: 10px 12px 2px; font-size: 14px; color: var(--muted); }
.module-title b { color: var(--accent); margin-right: 4px; }
.module-soon { margin: 4px 12px 8px; font-size: 14px; }
.lesson-row.practice .lesson-dot { outline: 1px dashed var(--accent); outline-offset: 1px; }

/* lesson page: note under the title, materials (text with links, prompts to copy, pictures, files), the side list by module */
.lesson-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--card-2); color: var(--text); font-size: 15px; }
.lesson-note svg { flex: none; margin-top: 3px; color: var(--accent); }
.lesson-body { margin-top: 12px; white-space: pre-wrap; color: var(--text); font-size: 16px; line-height: 1.6; }
.mat-text { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mat-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; background: var(--card-2); }
.mat-head strong { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.mat-body { padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; max-height: 320px; overflow: auto; }
.mat-body.prompt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.mat-body a { color: var(--accent); }
.mat-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.mat-image { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; text-decoration: none; overflow-wrap: anywhere; }
.mat-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.mat-image:hover { color: var(--text); }
.side-part { margin: 4px 4px 8px; font-weight: 700; font-size: 15px; }
.side-module { margin: 12px 8px 4px; font-size: 13px; color: var(--muted); }
.side-module b { color: var(--accent); }
.side-all { display: block; margin: 12px 8px 4px; font-weight: 600; font-size: 14px; text-decoration: none; }

/* the tier's time is over: one screen, nothing else */
.locked-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.locked-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 26px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.locked-card p { margin: 0; }
.tier-name { margin: 6px 0 0; font: 800 20px/1.25 var(--display); color: var(--accent); }
.tier-calls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.tier-pick { display: grid; gap: 8px; }
.tier-opt { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-align: left; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: inherit; }
.tier-opt small { color: var(--muted); font-size: 13px; }
.tier-opt[aria-checked="true"] { border-color: var(--gold); background: var(--card-2); }
.tier-box { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.tier-box p { margin: 0; }
