/*!
IRAN Sans-serif fonts are considered a proprietary software. To gain information about the laws
regarding the use of these fonts, please visit www.fontiran.com
---------------------------------------------------------------------
This set of fonts are used in this project under the license: (GHT5R07Y)
---------------------------------------------------------------------
*/
/* Main typeface: Peyda (licensed from fontiran, web licence GHT5R07Y). One variable WOFF2 file holds every weight from
   100 to 950, so all font-weights in the app are real (no faux bold). If it cannot load, Vazirmatn (bundled) and then
   system fonts take over automatically, so the layout never breaks. */
@font-face { font-family: 'Peyda'; src: url('/fonts/PeydaWebVF.woff2') format('woff2-variations'), url('/fonts/PeydaWebVF.woff2') format('woff2'); font-weight: 100 950; font-style: normal; font-display: swap; }
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #F3F5F7;
  --card: #FFFFFF;
  --ink: #16202A;
  --ink-2: #3F4A55;
  --muted: #55616C;
  --line: #DDE2E7;
  --line-2: #EEF0F2;
  --field: #C5CDD5;
  --brand: #1D4ED8;
  --brand-soft: #EEF3FF;
  --ok: #166534; --ok-bg: #E7F4EC; --ok-line: #B7DEC4;
  --warn: #9A3412; --warn-bg: #FFEDD5; --warn-line: #F5B98A;
  --amber: #92400E; --amber-bg: #FEF3C7; --amber-line: #F3D27A;
  --bad: #991B1B; --bad-bg: #FEE2E2; --bad-line: #F3B4B4;
  --info: #3730A3; --info-bg: #E0E7FF;
  --radius: 14px;
  --font: 'Peyda', 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.7; }
body { direction: rtl; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.4; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.wrap.narrow { max-width: 1180px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row.center { align-items: center; }
.row.tight { gap: 8px; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grow { flex: 999 1 520px; min-width: 0; }
.side { flex: 1 1 320px; min-width: 0; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }

/* Header */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1400px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; flex: none; }
.logo-fallback { width: 40px; height: 40px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex: none; }
.partner-logo { height: 40px; max-width: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; padding: 2px 6px; background: #fff; }
.brand-name { font-weight: 800; font-size: 16px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.soft { background: var(--brand-soft); border-color: #C9D6F8; }
.card.warn { background: #FFF7ED; border-color: var(--warn-line); }
.card.bad { border-color: var(--bad-line); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 800; }

/* Buttons & chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--field); background: var(--card); font-weight: 700; font-size: 14px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ok { background: var(--ok-bg); border-color: var(--ok-line); color: #14532D; }
.btn.danger { background: var(--bad-bg); border-color: var(--bad-line); color: #7F1D1D; }
.btn.amber { background: var(--amber-bg); border-color: var(--amber-line); color: #78350F; }
.btn.orange { background: var(--warn-bg); border-color: var(--warn-line); color: #7C2D12; }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--brand); }
.btn.block { width: 100%; }
.chip { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--field); background: var(--card); font-size: 13px; font-weight: 700; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.gray { background: var(--line-2); color: var(--ink-2); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; }
.input, select.input, textarea.input { border: 1px solid var(--field); border-radius: 10px; padding: 9px 10px; background: var(--card); min-height: 42px; width: 100%; }
textarea.input { resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.8; }
.check input { margin-top: 6px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-row > .field { flex: 1 1 160px; }
.error { background: var(--bad-bg); border: 1px solid var(--bad-line); color: #7F1D1D; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.notice { background: var(--ok-bg); border: 1px solid var(--ok-line); color: #14532D; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr.sel td { background: var(--brand-soft); }
table.t tr.flag td { background: #FFF8F1; }

/* Tabs / nav */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }

/* Toasts */
.toasts { position: fixed; bottom: 16px; left: 16px; right: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; max-width: 560px; width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.toast.ok { background: #14532D; }
.toast.bad { background: #7F1D1D; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.modal { background: var(--card); border-radius: 16px; padding: 20px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }

/* Bars */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; border-bottom: 1px solid var(--field); }
.bars > button, .bars > div { flex: 1 1 0; min-width: 0; border: 0; padding: 0; border-radius: 4px 4px 0 0; background: #9DB4E8; }
.bars > .on { background: var(--brand); }
.meter { height: 10px; background: #E6EAEE; border-radius: 5px; overflow: hidden; }
.meter > div { height: 10px; background: var(--brand); border-radius: 5px; }

/* Video tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; padding: 0; text-align: right; background: var(--card); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.tile.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .3); }
.tile .vid { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #2B3540; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.tile .seat { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 6px; }
.tile .dur { position: absolute; top: 6px; left: 6px; color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.tile .nocam { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #A9B4BE; font-size: 12px; }
.tile .meta { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.tile .nm { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-video { width: 100%; aspect-ratio: 4 / 3; background: #2B3540; border-radius: 12px; overflow: hidden; }
.focus-video video { width: 100%; height: 100%; object-fit: contain; transform: scaleX(-1); }

/* Timer ring */
.ring { position: relative; width: 210px; height: 210px; }
.ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .t { font-size: 42px; font-weight: 800; letter-spacing: 1px; }

/* Day cards in shift calendar */
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }

/* Admin layout */
.admin { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.admin-nav { flex: 1 1 220px; max-width: 260px; display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.admin-nav button { text-align: right; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.admin-nav button.on { background: var(--ink); color: #fff; }
.admin-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) {
  .admin-nav { max-width: none; flex-direction: row; overflow-x: auto; }
  .admin-nav button { white-space: nowrap; }
  .ring { width: 180px; height: 180px; }
  .ring .t { font-size: 36px; }
}

.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.big-logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto; object-fit: contain; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px; inset-inline-start: 0; }

/* Segmented control (login method, etc.) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--line-2); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { min-height: 38px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
/* Contacts / SMS tables */
.subs { display: flex; flex-wrap: wrap; gap: 6px; }
.subs label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 4px 8px; border: 1px solid var(--field); border-radius: 999px; cursor: pointer; }
.subs label.on { background: #EEF4FF; border-color: #BFD3FE; color: #1E3A8A; }
.subs input { margin: 0; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #EEF0F2; color: #374151; }
.pill.ok { background: #DCFCE7; color: #166534; } .pill.bad { background: #FEE2E2; color: #991B1B; } .pill.warn { background: #FEF3C7; color: #92400E; } .pill.info { background: #DBEAFE; color: #1E40AF; }
.vars { display: flex; flex-wrap: wrap; gap: 4px; }
.vars button { font: inherit; font-size: 12px; border: 1px dashed #93A3B8; background: #F8FAFC; border-radius: 6px; padding: 2px 6px; cursor: pointer; }
.smsprev { background: #F1F5F9; border-radius: 12px 12px 12px 2px; padding: 10px 12px; font-size: 13px; line-height: 1.9; white-space: pre-wrap; max-width: 420px; }
/* Supervisor's own webcam preview */
.selfcam { position: fixed; inset-inline-start: 16px; bottom: 16px; width: 200px; z-index: 40; background: #0F172A; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.selfcam video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transform: scaleX(-1); }
.selfcam-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; color: #E2E8F0; font-size: 11px; }
.selfcam-bar button { border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 6px; width: 24px; height: 22px; cursor: pointer; font: inherit; }
@media (max-width: 640px) { .selfcam { width: 130px; } }

/* ---------- Login page backgrounds ---------- */
.login-page { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; overflow: hidden; isolation: isolate; }
.login-page::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.login-page .login { position: relative; z-index: 1; }
.login-blob { display: none; }
.login-foot { position: relative; z-index: 1; margin: 0; font-size: 12px; text-align: center; max-width: 380px; }

/* Aurora: deep navy with brand-coloured light and a soft Persian star pattern */
.login-page.aurora { background: linear-gradient(160deg, #0B1220 0%, #111C33 55%, #0E1A2E 100%); }
.login-page.aurora::before {
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.2'%3E%3Cpath d='M48 18l9 21 21 9-21 9-9 21-9-21-21-9 21-9z'/%3E%3Crect x='31' y='31' width='34' height='34' transform='rotate(45 48 48)'/%3E%3Cpath d='M0 0l18 18M96 0L78 18M0 96l18-18M96 96L78 78'/%3E%3C/g%3E%3C/svg%3E");
}
.login-page.aurora .login-blob, .login-page.light .login-blob { display: block; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.login-page.aurora .login-blob.a { width: 520px; height: 520px; top: -160px; inset-inline-end: -120px; background: color-mix(in srgb, var(--brand) 70%, #22D3EE); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.login-page.aurora .login-blob.b { width: 460px; height: 460px; bottom: -180px; inset-inline-start: -140px; background: color-mix(in srgb, var(--brand) 45%, #A855F7); opacity: .45; animation: drift 22s ease-in-out infinite alternate-reverse; }
.login-page.aurora .login { background: #fff; border-color: rgba(255,255,255,.6); box-shadow: 0 24px 60px rgba(2,6,23,.45); backdrop-filter: blur(10px); }
.login-page.aurora .login-foot { color: rgba(226,232,240,.75); }

/* Light: airy, brand-tinted */
.login-page.light { background: linear-gradient(180deg, #F8FAFC, #EEF2F7); }
.login-page.light::before {
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%230F172A' stroke-width='1.2'%3E%3Cpath d='M48 18l9 21 21 9-21 9-9 21-9-21-21-9 21-9z'/%3E%3Crect x='31' y='31' width='34' height='34' transform='rotate(45 48 48)'/%3E%3C/g%3E%3C/svg%3E");
}
.login-page.light .login-blob.a { width: 480px; height: 480px; top: -200px; inset-inline-end: -120px; background: color-mix(in srgb, var(--brand) 40%, white); opacity: .6; }
.login-page.light .login-blob.b { width: 420px; height: 420px; bottom: -200px; inset-inline-start: -120px; background: color-mix(in srgb, var(--brand) 25%, #C4B5FD); opacity: .45; }
.login-page.light .login { box-shadow: 0 18px 50px rgba(15,23,42,.12); }
.login-page.light .login-foot { color: var(--muted); }

/* Photo uploaded by the admin, darkened for legibility */
.login-page.photo { background: #0F172A var(--bg) center / cover no-repeat; }
.login-page.photo::before { background: linear-gradient(180deg, rgba(2,6,23,.35), rgba(2,6,23,.6)); }
.login-page.photo .login { background: #fff; box-shadow: 0 24px 60px rgba(2,6,23,.5); backdrop-filter: blur(8px); }
.login-page.photo .login-foot { color: rgba(255,255,255,.85); text-shadow: 0 1px 2px rgba(0,0,0,.4); }

.login-page.plain { background: var(--bg); }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .login-blob { animation: none !important; } }

.login-page.mini { min-height: 110px; border-radius: 10px; padding: 10px; gap: 0; }
.login-page.mini .login-blob { filter: blur(24px); }
.login-page.mini .login-blob.a { width: 120px; height: 120px; top: -50px; }
.login-page.mini .login-blob.b { width: 110px; height: 110px; bottom: -50px; }
.look { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 2px solid transparent; border-radius: 14px; background: none; cursor: pointer; font: inherit; color: inherit; }
.look.on { border-color: var(--brand); }
/* Messages */
.chat-box { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: #F8FAFC; border: 1px solid var(--line); border-radius: 12px; }
.chat-msg { align-self: flex-start; max-width: 80%; background: #fff; border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 6px 10px; font-size: 13px; line-height: 1.8; }
.chat-msg.mine { align-self: flex-end; background: var(--brand-soft); border-color: #C7D7FE; border-radius: 12px 12px 4px 12px; }
.chat-from { font-size: 11px; font-weight: 700; color: var(--muted); }
.chat-time { font-size: 10px; color: var(--muted); text-align: left; }
.chat-day { align-self: center; font-size: 11px; color: var(--muted); background: #EEF0F2; border-radius: 999px; padding: 1px 10px; margin: 4px 0; }
.chat-inbox { display: grid; grid-template-columns: 240px 1fr; gap: 12px; min-width: min(760px, 86vw); }
.chat-list { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; }
.chat-thread { display: flex; flex-direction: column; gap: 2px; text-align: start; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.chat-thread.on { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 720px) { .chat-inbox { grid-template-columns: 1fr; min-width: 0; } .chat-list { max-height: 180px; } }
.modal:has(.chat-inbox) { max-width: 860px; }
.privacy-note { display: flex; flex-direction: column; gap: 2px; background: #F0FDF4; border: 1px solid #BBF7D0; color: #14532D; border-radius: 10px; padding: 8px 10px; line-height: 1.7; }
/* Partner panel backgrounds */
.panel-bg { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; }
.theme-plain { background-color: var(--bg, #F5F7F9); }
.theme-sky { background: linear-gradient(160deg, #E0F2FE 0%, #F0F9FF 50%, #EEF2FF 100%); }
.theme-mint { background: linear-gradient(160deg, #DCFCE7 0%, #F0FDF4 55%, #ECFEFF 100%); }
.theme-sunset { background: linear-gradient(160deg, #FFE4E6 0%, #FFF7ED 55%, #FEF3C7 100%); }
.theme-lavender { background: linear-gradient(160deg, #EDE9FE 0%, #F5F3FF 55%, #FDF2F8 100%); }
.theme-sand { background: linear-gradient(160deg, #FEF3C7 0%, #FFFBEB 55%, #F5F5F4 100%); }
.theme-night { background: linear-gradient(160deg, #1E293B 0%, #334155 60%, #1E3A8A 100%); }
.panel-bg[style] { background-color: var(--bg); }
.look-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.look-swatch { height: 64px; border-radius: 12px; border: 2px solid var(--line, #D6DCE2); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 6px; font: inherit; font-size: 12px; }
.look-swatch.theme-night { color: #fff; }
.look-swatch.on { border-color: var(--brand, #0F766E); box-shadow: 0 0 0 3px rgba(15,118,110,.2); }
html.has-panel-bg, html.has-panel-bg body { background: transparent; }
html.panel-dark main > p, html.panel-dark main > h2 { color: #E2E8F0; }
.article-preview h2 { font-size: 18px; margin: 12px 0 4px; } .article-preview h3 { font-size: 16px; } .article-preview p { margin: 6px 0; }
.cat-list { display: flex; flex-direction: column; }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.cat-main { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; }
.cat-main .input { flex: 1; min-width: 0; }
.cat-color { width: 36px; height: 36px; border: 0; background: none; padding: 0; flex: none; }
.cat-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.chip-x { border: 0; background: none; color: var(--bad); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 6px 14px; }
.seo-box { background: #F8FAFC; border-radius: 10px; padding: 8px 10px; }
.seo-box summary { cursor: pointer; }
.serp { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.serp-t { color: #1a0dab; font-size: 17px; line-height: 1.5; }
.serp-d { color: #4d5156; font-size: 13px; }
.chat-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.chat-badge { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #DC2626; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.chat-back { display: none; }
.chat-list { max-height: 420px; }
@media (max-width: 720px) {
  .chat-btn-label { display: none; }
  .chat-inbox.has-sel .chat-side { display: none; }
  .chat-inbox:not(.has-sel) .chat-main { display: none; }
  .chat-back { display: inline-flex; }
  .chat-list { max-height: 60vh; }
}

/* ---------- Avatars & account menu ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; color: #fff; font-weight: 800; line-height: 1; background: var(--line); user-select: none; }
.avatar-cam { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: #000; flex: none; }
.avatar-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.topbar { position: relative; z-index: 5; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 10px 3px 4px; min-height: 42px; font-weight: 700; color: var(--ink); }
.user-btn:hover { border-color: var(--field); }
.user-pop { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 32, .18); padding: 6px; z-index: 30; display: flex; flex-direction: column; }
.user-pop-head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.user-pop button { display: flex; gap: 10px; align-items: center; text-align: start; border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; color: var(--ink); }
.user-pop button:hover { background: var(--line-2); }
.user-pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; width: 100%; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }
@media (max-width: 640px) {
  .user-btn-name { display: none; }
  .user-btn { padding: 3px; }
  .topbar-in { gap: 8px; }
  .topbar-title .tiny { display: none; }
}

/* ---------- More backgrounds ---------- */
.theme-paper { background: #FBF8F1 radial-gradient(circle at 1px 1px, rgba(120, 100, 60, .08) 1px, transparent 0) 0 0 / 18px 18px; }
.theme-aurora { background: radial-gradient(900px 500px at 85% -10%, rgba(56, 189, 248, .35), transparent), radial-gradient(800px 500px at 0% 110%, rgba(168, 85, 247, .35), transparent), #0B1220; }
.look-swatch.theme-aurora { color: #fff; }
:root { --bg-veil: linear-gradient(rgba(255, 255, 255, .6), rgba(255, 255, 255, .78)); --soft: #F3F5F7; --soft-2: #F8FAFC; }

/* ---------- Text size & density ---------- */
html[data-font="sm"] body { zoom: .92; }
html[data-font="lg"] body { zoom: 1.1; }
html[data-font="xl"] body { zoom: 1.22; }
html.compact .wrap { gap: 10px; padding-top: 10px; }
html.compact .card { padding: 12px; }
html.compact .card.pad-0 { padding: 0; }
html.compact table.t td { padding: 6px 10px; }
html.compact .btn { min-height: 36px; }

/* ---------- Dark mode (for studying at night) ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E151D; --card: #16202A; --ink: #E7EDF3; --ink-2: #C5CFD8; --muted: #93A1AE; --line: #263544; --line-2: #1D2935; --field: #3A4D60;
  --brand-soft: #18284A; --soft: #1B2732; --soft-2: #1A2530;
  --ok: #86EFAC; --ok-bg: #12301F; --ok-line: #1F5135;
  --warn: #FDBA8C; --warn-bg: #3A2213; --warn-line: #6B3B1B;
  --amber: #FCD34D; --amber-bg: #372B0D; --amber-line: #6B5416;
  --bad: #FCA5A5; --bad-bg: #3A1717; --bad-line: #6E2626;
  --info: #A5B4FC; --info-bg: #1E2452;
  --bg-veil: linear-gradient(rgba(14, 21, 29, .78), rgba(14, 21, 29, .88));
}
html[data-theme="dark"] .notice, html[data-theme="dark"] .btn.ok { color: #BBF7D0; }
html[data-theme="dark"] .error, html[data-theme="dark"] .btn.danger { color: #FECACA; }
html[data-theme="dark"] .btn.amber { color: #FDE68A; }
html[data-theme="dark"] .btn.orange { color: #FED7AA; }
html[data-theme="dark"] .card.warn { background: #2A1C10; }
html[data-theme="dark"] .card.soft { border-color: #2A3D6A; }
html[data-theme="dark"] table.t tr.flag td { background: #2A1C10; }
html[data-theme="dark"] .meter { background: #263544; }
html[data-theme="dark"] .bars > button, html[data-theme="dark"] .bars > div { background: #34518F; }
html[data-theme="dark"] .bars > .on { background: var(--brand); }
html[data-theme="dark"] .chat-box { background: var(--soft); }
html[data-theme="dark"] .chat-msg { background: var(--card); }
html[data-theme="dark"] .chat-msg.mine { border-color: #2A3D6A; }
html[data-theme="dark"] .privacy-note { background: #12301F; border-color: #1F5135; color: #BBF7D0; }
html[data-theme="dark"] .modal-bg { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .panel-bg:not([style])::after { content: ''; position: absolute; inset: 0; background: rgba(14, 21, 29, .82); }
html[data-theme="dark"] .theme-night, html[data-theme="dark"] .theme-aurora { filter: none; }
html[data-theme="dark"] .serp { background: var(--card); }
html[data-theme="dark"] .seo-box, html[data-theme="dark"] .look-swatch.theme-plain { background: var(--soft); }
html[data-theme="dark"] img.logo { background: #fff; }
html[data-theme="dark"] .tile .vid, html[data-theme="dark"] .focus-video { background: #0A0F14; }
html.panel-dark:not([data-theme="dark"]) .topbar { background: rgba(255, 255, 255, .92); }
.chat-row { display: flex; gap: 6px; align-items: flex-end; align-self: flex-start; max-width: 88%; }
.chat-row.mine { align-self: flex-end; }
.chat-row .chat-msg { max-width: 100%; }
/* Admin menu: grouped with icons; a dropdown on phones */
.admin-nav { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.admin-nav button { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-2); }
.admin-nav button:hover { background: var(--line-2); }
.admin-nav button.on { color: #fff; }
.nav-ico { width: 22px; text-align: center; font-size: 15px; flex: none; }
.admin-nav-group { font-size: 11px; font-weight: 800; color: var(--muted); padding: 12px 12px 2px; letter-spacing: .2px; }
.admin-nav-select { display: none; }
html[data-theme="dark"] .admin-nav button.on { background: var(--brand); }
@media (max-width: 900px) {
  .admin-nav { position: static; max-height: none; flex-direction: column; overflow: visible; padding: 8px; max-width: none; flex-basis: 100%; }
  .admin-nav > button, .admin-nav-group { display: none; }
  .admin-nav-select { display: block; font-weight: 700; }
}
/* Loading spinner */
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
/* Student focus mode: big calm timer, full screen */
.focus-mode { position: fixed; inset: 0; z-index: 60; background: radial-gradient(1000px 600px at 50% 0%, #1E293B, #0B1118); color: #E7EDF3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.focus-label { font-size: 22px; font-weight: 700; opacity: .85; }
.focus-time { font-size: clamp(72px, 18vw, 180px); font-weight: 800; letter-spacing: 2px; line-height: 1; font-variant-numeric: tabular-nums; }
.focus-sub { font-size: 16px; opacity: .75; }
.focus-bar { width: min(420px, 80vw); height: 10px; border-radius: 5px; background: rgba(255,255,255,.12); overflow: hidden; }
.focus-bar > div { height: 100%; background: var(--brand); border-radius: 5px; }
.focus-mode .btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); margin-top: 10px; }
.user-btn { position: relative; }
html[data-theme="dark"] .card.warn span, html[data-theme="dark"] .card.warn b { color: #FED7AA !important; }
.toasts { z-index: 70; }
.focus-alerts { position: absolute; top: 16px; inset-inline: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.focus-alert { width: min(640px, 100%); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; text-align: start; font-size: 16px; line-height: 1.8; }
.focus-alert.warn { background: #7F1D1D; color: #fff; box-shadow: 0 0 0 3px rgba(248, 113, 113, .5); animation: pulse 1.2s ease-in-out 3; }
.focus-alert.msg { background: #1E3A8A; color: #fff; }
.focus-alert.talk { background: #14532D; color: #fff; justify-content: center; font-weight: 700; }
.focus-alert .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); margin: 0; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(248, 113, 113, 0); } }
@media (prefers-reduced-motion: reduce) { .focus-alert.warn { animation: none; } }
/* ---------- Drag & drop / layout editing ---------- */
body.is-dragging, body.is-dragging * { user-select: none; cursor: grabbing !important; }
.lz-item { border: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); border-radius: calc(var(--radius) + 4px); padding: 6px; background: color-mix(in srgb, var(--brand) 5%, transparent); }
.lz-item.lz-off { opacity: .6; }
.lz-item.lz-drag { box-shadow: 0 12px 30px rgba(15, 23, 32, .25); transform: scale(1.01); }
.lz-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 6px 6px; font-size: 13px; font-weight: 700; }
.lz-handle { cursor: grab; padding: 4px 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); }
.lz-btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 2px 8px; font-size: 12px; color: var(--ink); }
.lz-body { pointer-events: none; }
.lz-barfloat { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 55; width: min(720px, calc(100vw - 24px)); background: var(--ink); color: var(--card); border-radius: 14px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; box-shadow: 0 12px 32px rgba(0,0,0,.25); font-size: 13px; }
.lz-barfloat .btn:not(.primary) { background: transparent; color: var(--card); border-color: color-mix(in srgb, var(--card) 40%, transparent); }
.drag-handle { position: absolute; z-index: 2; top: 6px; left: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; opacity: 0; transition: opacity .15s; }
.tile:hover .drag-handle, .tile:focus-within .drag-handle { opacity: 1; }
@media (hover: none) { .drag-handle { opacity: .85; } }
.tile.dragging { opacity: .55; outline: 2px dashed var(--brand); }
.pin-badge { position: absolute; z-index: 2; bottom: 6px; left: 6px; font-size: 13px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 0 4px; }
.sortable-row { display: flex; align-items: center; gap: 8px; }
.sort-handle { cursor: grab; color: var(--muted); padding: 2px 6px; border-radius: 6px; font-size: 16px; touch-action: none; user-select: none; }
.sort-handle:hover { background: var(--line-2); color: var(--ink); }
[data-sort-group].dragging-row { opacity: .5; }
.tile .drag-handle { top: auto; bottom: 6px; left: auto; right: 6px; }
.pin-btn { position: absolute; z-index: 2; bottom: 6px; left: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: rgba(0,0,0,.55); font-size: 13px; opacity: 0; transition: opacity .15s; cursor: pointer; }
.tile:hover .pin-btn, .tile:focus-within .pin-btn, .pin-btn[aria-pressed="true"] { opacity: 1; }
.pin-btn[aria-pressed="true"] { background: #FDE68A; }
@media (hover: none) { .pin-btn { opacity: .85; } }
/* Medals */
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 8px; }
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); filter: grayscale(.85); opacity: .75; }
.medal.won { filter: none; opacity: 1; border-color: #F3D27A; background: linear-gradient(180deg, color-mix(in srgb, #FDE68A 35%, var(--card)), var(--card)); box-shadow: 0 4px 14px rgba(202, 138, 4, .15); }
.medal .meter { width: 100%; }
.medal-emoji { font-size: 30px; line-height: 1.1; }
.medal-emoji.big { font-size: 44px; }
.medal-fun { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--amber-bg); margin-bottom: 8px; }
.medal-row { border-bottom: 1px solid var(--line-2); padding: 6px 0; }
.medal-row .medal-emoji { font-size: 24px; }
.medal-preview { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--soft); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-pick button { width: 38px; height: 38px; font-size: 20px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.emoji-pick button.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.medal-pop { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: rgba(15, 23, 32, .45); }
.medal-pop-in { background: var(--card); border-radius: 20px; padding: 24px 28px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; animation: medalIn .5s cubic-bezier(.2, 1.4, .4, 1); max-width: 320px; }
.medal-pop-in .medal-emoji { font-size: 64px; }
@keyframes medalIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .medal-pop-in { animation: none; } }
/* Row action menu */
.row-actions { display: inline-flex; gap: 6px; align-items: center; }
.row-menu-btn { min-width: 34px; font-size: 18px; line-height: 1; padding: 0 8px; }
.row-menu-bg { position: fixed; inset: 0; z-index: 44; }
.row-menu { position: fixed; z-index: 45; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 32, .2); padding: 6px; display: flex; flex-direction: column; }
.row-menu button { display: flex; gap: 10px; align-items: center; text-align: start; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-weight: 600; color: var(--ink); font-size: 14px; }
.row-menu button:hover { background: var(--line-2); }
.row-menu button.danger { color: var(--bad); }
/* Dark mode: selected chips / dark buttons used --ink as background (light in dark mode) */
html[data-theme="dark"] .chip.on, html[data-theme="dark"] .btn.dark { background: var(--brand); border-color: var(--brand); color: #fff; }
html[data-theme="dark"] .admin-nav button.on { background: var(--brand); color: #fff; }
html[data-theme="dark"] .swatch.on { box-shadow: 0 0 0 3px var(--brand); }
/* Site builder */
.save-bar { position: sticky; bottom: 12px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--ink); color: var(--card); border-radius: 14px; padding: 10px 14px; box-shadow: 0 10px 28px rgba(0,0,0,.2); }
.save-bar .btn:not(.primary) { background: transparent; color: var(--card); border-color: color-mix(in srgb, var(--card) 40%, transparent); }
.pair-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.section-row.off, .menu-row.off { opacity: .55; }
.menu-row { display: grid; grid-template-columns: 30px minmax(150px, 1.3fr) minmax(140px, 1fr) 80px 80px 40px; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.menu-row.head { border: 0; background: none; padding-block: 0; }
@media (max-width: 720px) { .menu-row { grid-template-columns: 30px 1fr 56px 56px 34px; } .menu-row > :nth-child(3) { display: none; } }
table.te th, table.te td { padding: 6px; text-align: center; }
.te-input { width: 100%; min-width: 90px; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; background: transparent; text-align: center; }
.te-input:hover, .te-input:focus { border-color: var(--field); background: var(--card); }
.te-input.head { font-weight: 800; }
.te-toggle { width: 100%; min-height: 34px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; font-size: 18px; font-weight: 800; }
.te-cell.yes .te-toggle { color: #16A34A; }
.te-cell.no .te-toggle { color: var(--muted); }
.te-cell { position: relative; }
.te-mini { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 2px 4px; cursor: pointer; }
.md-editor { display: flex; flex-direction: column; gap: 6px; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.md-toolbar button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--ink); }
.md-toolbar button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.md-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .md-split { grid-template-columns: 1fr; } }
.md-preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; overflow: auto; max-height: 460px; background: var(--card); }
.md-preview h2 { font-size: 18px; margin: 12px 0 4px; } .md-preview p { margin: 6px 0; }
/* Personal side menu */
.admin-nav .nav-more { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.admin-nav .nav-custom { margin-top: 6px; border-top: 1px dashed var(--line) !important; border-radius: 0 0 10px 10px; }
.nav-edit { max-width: 340px; flex-basis: 320px; gap: 6px; }
.nav-edit-head { display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 6px; }
.nav-edit-row { display: grid; grid-template-columns: 22px 20px 1fr 28px 30px 30px; gap: 4px; align-items: center; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.nav-edit-row .input { padding: 5px 8px; font-size: 13px; min-width: 0; }
.nav-edit-row.off { opacity: .55; }
.nav-edit-row.drag { box-shadow: 0 8px 22px rgba(0,0,0,.2); }
.lz-btn.on { border-color: #F59E0B; }
@media (max-width: 900px) { .nav-edit { max-width: none; } .nav-edit > button { display: inline-flex !important; } }
/* Grid zones: two columns that fill gaps; wide cards take a whole row. */
.zone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; grid-auto-rows: 4px; column-gap: 16px; row-gap: 0; align-items: start; }
.zone-grid > * { min-width: 0; }
.zone-grid > .zg-wide { grid-column: 1 / -1; }
.zg-in { display: flex; flex-direction: column; gap: 16px; }
.zg-in > .card, .zg-in > * { margin: 0; }
@media (max-width: 980px) { .zone-grid { grid-template-columns: minmax(0, 1fr); } }
/* Messages column and staff chat */
.chat-panel .chat-thread { background: var(--card); }
.chat-thread.unread { border-color: var(--bad-line); background: var(--bad-bg); }
.staff-strip { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; gap: 6px; }
.staff-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 2px; min-width: 52px; color: var(--ink); }
html[data-theme="dark"] .chat-thread { background: var(--card); }
.admin-nav.nav-edit .nav-edit-row button { padding: 2px 4px; justify-content: center; font-size: 13px; min-height: 30px; }
.admin-nav.nav-edit .nav-edit-row .drag-handle { opacity: 1; background: none; width: auto; height: auto; position: static; display: inline-flex; justify-content: center; cursor: grab; color: var(--muted); }
/* ---- Focus breakdown ---- */
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.focus-stat { cursor: pointer; text-align: start; font: inherit; color: inherit; }
.focus-stat:hover { border-color: var(--brand); }
.focus-parts { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.focus-part { display: grid; grid-template-columns: 1fr auto 52px; gap: 2px 10px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.focus-part:last-child { border-bottom: 0; }
.focus-part b { text-align: left; font-variant-numeric: tabular-nums; }
.focus-part.head, .focus-part.total { grid-template-columns: 1fr 52px; }
.focus-part.total { font-weight: 800; font-size: 15px; border-top: 2px solid var(--line); border-bottom: 0; }
.focus-bar { grid-column: 1 / -1; height: 4px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.focus-bar > div { height: 100%; background: #F87171; border-radius: 3px; }
.focus-how { background: var(--soft-2); border-radius: 10px; padding: 8px 14px; line-height: 1.9; }
.focus-how ul { margin: 4px 0; padding-inline-start: 18px; }
.smart-switch { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--card); }
.smart-switch.compact { padding: 6px 10px; }
.sel-more > summary { cursor: pointer; font-weight: 700; font-size: 13px; padding: 6px 0; color: var(--ink-2); }
.checkin-entry { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line-2); padding-bottom: 6px; }
.checkin-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--soft-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.weight-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 40px; gap: 10px; align-items: center; }
.weight-row input[type=range] { width: 100%; accent-color: var(--brand); }
@media (max-width: 560px) { .weight-row { grid-template-columns: 1fr 40px; } .weight-row input[type=range] { grid-column: 1 / -1; grid-row: 2; } }
.mini-meter { display: inline-flex; align-items: center; gap: 6px; }
.mini-meter i { display: inline-block; height: 6px; min-width: 3px; border-radius: 4px; }
.q-row.off { opacity: .55; }
.seg.wrap { flex-wrap: wrap; }
/* Partner tri-state switches */
.tri-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 6px 12px; }
.tri { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.tri.set { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.tri-btns { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.tri-btns button { border: 0; background: var(--card); padding: 3px 8px; font-size: 12px; color: var(--muted); font-family: inherit; }
.tri-btns button + button { border-inline-start: 1px solid var(--line); }
.tri-btns button.on { background: var(--soft-2); color: var(--ink); font-weight: 700; }
.tri-btns button.on.yes { background: #DCFCE7; color: #166534; }
.tri-btns button.on.no { background: #FEE2E2; color: #991B1B; }
html[data-theme="dark"] .tri-btns button.on.yes { background: #14532D; color: #BBF7D0; }
html[data-theme="dark"] .tri-btns button.on.no { background: #7F1D1D; color: #FECACA; }

/* ---- Check-in sheet (students) ---- */
.ci-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 30, .45); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 12px; animation: ci-fade .2s ease; }
@media (min-width: 700px) { .ci-backdrop { align-items: center; } }
.ci-sheet { width: min(460px, 100%); background: var(--card); color: var(--ink); border-radius: 24px; padding: 18px 18px 14px; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: ci-up .28s cubic-bezier(.2,.9,.3,1.2); overflow: hidden; position: relative; }
.ci-head { display: flex; flex-direction: column; gap: 4px; margin: -18px -18px 12px; padding: 16px 18px 12px; background: linear-gradient(120deg, #7C3AED, #EC4899 55%, #F59E0B); color: #fff; }
.ci-kicker { font-size: 12px; font-weight: 700; opacity: .9; }
.ci-title { font-size: 19px; font-weight: 900; }
.ci-dots { display: flex; gap: 5px; margin-top: 4px; }
.ci-dots i { height: 5px; flex: 1; border-radius: 4px; background: rgba(255,255,255,.35); transition: background .2s; }
.ci-dots i.on { background: #fff; } .ci-dots i.done { background: rgba(255,255,255,.75); }
.ci-q { min-height: 150px; display: flex; flex-direction: column; gap: 14px; animation: ci-slide .25s ease; }
.ci-question { font-size: 17px; font-weight: 800; }
.ci-opt { font-size: 12px; font-weight: 500; color: var(--muted); }
.ci-emojis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ci-emoji { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid var(--line); background: var(--soft-2); border-radius: 16px; padding: 10px 2px 6px; font-family: inherit; color: var(--ink); cursor: pointer; transition: transform .12s, border-color .12s; }
.ci-emoji span { font-size: 30px; line-height: 1.1; }
.ci-emoji small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ci-emoji:hover { transform: translateY(-3px) scale(1.05); }
.ci-emoji.on { border-color: #A855F7; background: #F3E8FF; transform: scale(1.1); }
html[data-theme="dark"] .ci-emoji.on { background: #3B0764; }
.ci-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ci-chip { border: 2px solid var(--line); background: var(--soft-2); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .1s; }
.ci-chip:active { transform: scale(.95); }
.ci-chip.on { border-color: #EC4899; background: #FCE7F3; color: #9D174D; }
html[data-theme="dark"] .ci-chip.on { background: #500724; color: #FBCFE8; }
.ci-slider { display: flex; flex-direction: column; gap: 10px; }
.ci-slider-val { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 28px; }
.ci-slider-val b { font-size: 26px; }
.ci-slider input { width: 100%; accent-color: #A855F7; height: 28px; }
.ci-text { font-size: 15px; }
.ci-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.ci-skip { border: 0; background: none; color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer; padding: 6px; }
.ci-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 10px 24px; text-align: center; position: relative; }
.ci-streak { font-weight: 800; color: #EA580C; }
.ci-burst { position: absolute; inset: 0; pointer-events: none; }
.ci-burst span { position: absolute; left: 50%; top: 55%; font-size: 26px; animation: ci-pop 1.2s ease-out forwards; animation-delay: calc(var(--i) * 60ms); }
.ci-burst span:nth-child(1) { --x: -120px; --y: -90px; } .ci-burst span:nth-child(2) { --x: 110px; --y: -80px; } .ci-burst span:nth-child(3) { --x: -40px; --y: -120px; } .ci-burst span:nth-child(4) { --x: 60px; --y: -130px; } .ci-burst span:nth-child(5) { --x: 0px; --y: -70px; }
@keyframes ci-pop { 0% { transform: translate(-50%, 0) scale(.3); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--x)), var(--y)) scale(1.2); opacity: 0; } }
@keyframes ci-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ci-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ci-slide { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ci-sheet, .ci-q, .ci-backdrop, .ci-burst span { animation: none; } }
/* In-panel guide */
.help-btn { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-weight: 900; font-size: 17px; justify-content: center; }
.help-btn.pulse { animation: help-pulse 1.6s ease-in-out 4; border-color: var(--brand); color: var(--brand); }
@keyframes help-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.help-bg { position: fixed; inset: 0; z-index: 70; background: rgba(10, 14, 30, .35); }
.help-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(420px, 100vw); background: var(--card); color: var(--ink); box-shadow: 12px 0 40px rgba(0,0,0,.2); padding: 14px 16px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; animation: help-in .2s ease; }
@keyframes help-in { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.help-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.help-intro { background: var(--brand-soft); border-radius: 10px; padding: 8px 12px; margin: 0; line-height: 1.9; }
html[data-theme="dark"] .help-intro { background: var(--soft-2); }
.help-label { font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 4px; }
.help-topic { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.help-topic > summary { cursor: pointer; font-weight: 800; padding: 2px 0; }
.help-topic[open] > summary { margin-bottom: 4px; }
.help-topic p { margin: 0 0 6px; }
.help-topic dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.help-topic dt { font-weight: 700; font-size: 13.5px; }
.help-topic dd { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.85; }
.help-tips { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .help-panel, .help-btn.pulse { animation: none; } }
.import-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.9; }
.import-steps input[type=file] { display: block; margin-top: 6px; }
.ok-notice { background: #DCFCE7; border-color: #86EFAC; color: #14532D; font-weight: 700; }
html[data-theme="dark"] .ok-notice { background: #14532D; color: #DCFCE7; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.import-rules { background: var(--soft-2); border-radius: 10px; padding: 8px 12px; line-height: 1.9; }
.imp-off { opacity: .5; }
.imp-fill { color: #15803D; }
.imp-conflict { color: #B45309; }
.imp-similar { color: #7C3AED; }
html[data-theme="dark"] .imp-fill { color: #4ADE80; }
html[data-theme="dark"] .imp-conflict { color: #FBBF24; }
html[data-theme="dark"] .imp-similar { color: #C4B5FD; }
/* Enlarged camera view */
.zoom-btn { position: absolute; z-index: 2; bottom: 6px; right: 6px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; cursor: zoom-in; opacity: .85; transition: opacity .15s, transform .15s; }
.zoom-btn:hover, .zoom-btn:focus-visible { opacity: 1; transform: scale(1.08); }
.vid, .focus-video { position: relative; }
.vz-bg { position: fixed; inset: 0; z-index: 90; background: rgba(5, 8, 15, .88); display: flex; align-items: center; justify-content: center; padding: 12px; }
.vz { width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; color: #E2E8F0; }
.vz:fullscreen { width: 100%; height: 100%; padding: 12px; background: #000; }
.vz-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vz-head .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.vz-video { flex: 1; min-height: 0; background: #000; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; max-height: calc(100vh - 150px); }
.vz:fullscreen .vz-video { aspect-ratio: auto; max-height: none; border-radius: 0; }
.vz-video video { width: 100%; height: 100%; object-fit: contain; }
.vz-video .nocam { color: #94A3B8; }
.vz-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
/* Link preview mock (Telegram style) */
.link-preview { display: flex; flex-direction: column; gap: 2px; max-width: 420px; border-inline-start: 3px solid #3390EC; background: color-mix(in srgb, #3390EC 8%, var(--card)); border-radius: 6px 10px 10px 6px; padding: 8px 12px 10px; }
.link-preview .lp-site { color: #3390EC; font-size: 13px; }
.link-preview .lp-title { font-size: 14px; }
.link-preview .lp-desc { font-size: 13px; color: var(--ink-2); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link-preview img { margin-top: 8px; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 8px; }
/* Trial periods */
.pill.trial { background: #FCE7F3; color: #9D174D; }
.trial-card { border-color: color-mix(in srgb, #EC4899 40%, var(--line-2)); background: color-mix(in srgb, #EC4899 5%, var(--card)); }
.trial-card .seg button { white-space: nowrap; }
.seg.sm { display: inline-grid; padding: 3px; }
.seg.sm button { min-height: 28px; padding: 0 12px; font-size: 13px; }
.trial-pick { background: color-mix(in srgb, #EC4899 5%, var(--card)); border: 1px dashed color-mix(in srgb, #EC4899 45%, var(--line-2)); border-radius: 12px; padding: 8px 10px; }
.trial-banner { border-color: color-mix(in srgb, #EC4899 40%, var(--line-2)); background: color-mix(in srgb, #EC4899 7%, var(--card)); gap: 8px; flex-wrap: wrap; }
.trial-lock { border-color: color-mix(in srgb, #EC4899 40%, var(--line-2)); }
/* Shift plan */
.shift-src { display: inline-block; margin-top: 3px; font-size: 11px; padding: 1px 8px; white-space: nowrap; }
.plan-rot { border-color: color-mix(in srgb, #3B82F6 45%, var(--line-2)); background: color-mix(in srgb, #3B82F6 4%, var(--card)); }
.plan-help { margin: 0; padding-inline-start: 18px; line-height: 2; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--card); }
.chip-check.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--card)); }
.chip-check input { margin: 0; }
.my-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.my-week .d { border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; min-height: 64px; font-size: 12px; }
.my-week .d.today { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent); }
.my-week .d .h { font-weight: 800; font-size: 12px; margin-bottom: 4px; }
.my-week .s { display: block; border-radius: 6px; padding: 2px 6px; margin-top: 3px; background: color-mix(in srgb, var(--brand) 12%, var(--card)); font-weight: 700; }
.my-week .s.swap { background: #DBEAFE; color: #1E40AF; } .my-week .s.cover { background: #FEF3C7; color: #92400E; }
@media (max-width: 700px) { .my-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cover-card { border-color: #F3D27A; background: color-mix(in srgb, #F59E0B 6%, var(--card)); }
/* Subscription management */
.log-row { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.sub-row { padding: 10px; }
.sub-row.off { opacity: .55; }
.access-box { background: var(--soft, #F6F8FA); }
.cam-err { position: fixed; top: 64px; left: 16px; z-index: 40; max-width: 360px; background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.8; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.cam-sum { background: var(--soft, #F6F8FA); line-height: 2; }
.link-btn { display: block; border: 0; background: none; padding: 2px 0 0; margin: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-align: start; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.cam-now.bad { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; } .cam-now.ok { background: #F0FDF4; } html[data-theme="dark"] .cam-now.bad { background: #3A1515; border-color: #7F1D1D; color: #FECACA; }
/* Theme-aware status colours (used in inline styles): readable in light and dark mode */
:root { --ok-ink: #166534; --bad-ink: #991B1B; --warn-ink: #9A3412; --info-ink: #1E3A8A; --warn-soft: #FFF8F1; --brand-ink: var(--brand); }
html[data-theme="dark"] { --ok-ink: #4ADE80; --bad-ink: #FCA5A5; --warn-ink: #FDBA74; --info-ink: #93C5FD; --warn-soft: #2A1C10; --brand-ink: color-mix(in srgb, var(--brand) 45%, #fff); }
/* Brand-coloured text on the dark background: lighter, so it stays readable */
html[data-theme="dark"] .btn.ghost, html[data-theme="dark"] .link-btn, html[data-theme="dark"] .help-btn.pulse, html[data-theme="dark"] main a:not(.btn) { color: var(--brand-ink); }
html[data-theme="dark"] .chip { color: var(--ink); }
html[data-theme="dark"] table.t tr.flag td { background: var(--warn-soft); }
/* Text in a category's own colour (set by the admin): lighter in dark mode */
.cat-ink { color: var(--c); }
html[data-theme="dark"] .cat-ink { color: color-mix(in srgb, var(--c) 50%, #fff); }
/* Student pictures: always the whole picture (portrait phones are not cut off); manual rotation */
.tile .vid video, .focus-video video, .vz video { object-fit: contain; background: #0A0F14; }
.rot-box { position: relative; width: 100%; height: 100%; overflow: hidden; background: #0A0F14; }
.rot-box .rot-video { position: absolute; top: 50%; left: 50%; object-fit: contain; }

/* ===== Supervisor page: camera grid stays in view; tools beside and under it ===== */
.sup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.sup-head h1 { margin: 0; font-size: 22px; }
.timer-box { display: flex; align-items: center; gap: 14px; border-radius: 14px; padding: 8px 18px; color: #fff; box-shadow: 0 6px 18px rgba(15, 23, 42, .18); }
.timer-box .tiny { color: rgba(255, 255, 255, .82); }
.timer-box .tb-time { font-size: 28px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.timer-box.study { background: linear-gradient(135deg, #1E3A8A, #2563EB); }
.timer-box.rest { background: linear-gradient(135deg, #047857, #10B981); }
.timer-box.idle { background: linear-gradient(135deg, #334155, #475569); }
html[data-theme="dark"] .timer-box.study { background: linear-gradient(135deg, #1E3A8A, #3B82F6); box-shadow: 0 0 0 1px #3B82F6 inset, 0 6px 18px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .timer-box.rest { background: linear-gradient(135deg, #065F46, #10B981); box-shadow: 0 0 0 1px #34D399 inset, 0 6px 18px rgba(0, 0, 0, .4); }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.stat-chip b { font-size: 15px; }
.stat-chip.ok b { color: var(--ok-ink); } .stat-chip.warn b { color: var(--warn-ink); } .stat-chip.bad b { color: var(--bad-ink); } .stat-chip.info b { color: var(--info-ink); }
.stat-chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.stat-chip.on b { color: inherit; }
.sup-main { display: flex; gap: 16px; align-items: flex-start; }
.sup-side { flex: 0 0 clamp(330px, 28vw, 420px); position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 2px; scrollbar-width: thin; }
.sup-side > .col { gap: 12px; }
.sup-grid-col { gap: 12px; }
.sel-hint { padding: 14px; font-size: 14px; color: var(--muted); text-align: center; border-style: dashed; }
@media (max-width: 1100px) { .sup-main { flex-direction: column; } .sup-side { position: static; max-height: none; flex-basis: auto; width: 100%; } }
/* selected student */
.sel-panel .focus-video { position: relative; }
.rot-tools { position: absolute; bottom: 8px; left: 52px; display: flex; gap: 6px; }
.rot-btn { position: relative; width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(15, 23, 42, .7); color: #fff; font-size: 18px; cursor: pointer; }
.sel-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sel-stats > div { background: var(--soft); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; font-size: 13px; }
.sel-stats span { color: var(--muted); font-size: 12px; }
.sel-sec { display: flex; flex-direction: column; gap: 8px; }
.sel-h { font-weight: 800; font-size: 14px; }
.warn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.warn-grid .btn { white-space: normal; line-height: 1.5; min-height: 38px; }
/* interval report */
.ir { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--soft-2); }
.ir-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ir-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ir-btn { --c: #64748B; display: flex; align-items: center; gap: 8px; text-align: start; padding: 8px 10px; min-height: 42px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); background: color-mix(in srgb, var(--c) 9%, var(--card)); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; line-height: 1.5; cursor: pointer; transition: border-color .15s, background .15s; }
.ir-btn:hover:not(:disabled) { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--card)); }
.ir-btn .ir-dot, .ir-cur .ir-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.ir-btn .ir-lbl { flex: 1; min-width: 0; }
.ir-btn .ir-need { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; border: 1px dashed var(--line); border-radius: 999px; padding: 0 6px; }
.ir-btn.on { background: var(--c); border-color: var(--c); color: #fff; }
.ir-btn.on .ir-dot { background: #fff; } .ir-btn.on .ir-need { color: #fff; border-color: rgba(255, 255, 255, .6); }
.ir-cur { font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: flex; align-items: center; gap: 6px; }
.ir-reasons { display: flex; flex-direction: column; gap: 8px; border-inline-start: 3px solid var(--c); padding-inline-start: 8px; }
.ir-off { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; background: color-mix(in srgb, #6366F1 10%, var(--card)); border: 1px solid color-mix(in srgb, #6366F1 35%, var(--line)); border-radius: 10px; padding: 8px 10px; }
.ir-dayoff { width: 100%; border-style: dashed; justify-content: center; }
.dayoff-form { border: 1px solid color-mix(in srgb, #6366F1 35%, var(--line)); background: color-mix(in srgb, #6366F1 6%, var(--card)); border-radius: 12px; padding: 10px; }
.dayoff-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 480px) { .dayoff-opts, .ir-grid, .warn-grid { grid-template-columns: 1fr; } }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
/* student camera tools */
.cam-tools .btn { flex: 1; justify-content: center; }
/* Student timer: blue while studying, green in a break */
.timer-card.study { background: linear-gradient(180deg, color-mix(in srgb, #2563EB 13%, var(--card)), var(--card) 70%); border-color: color-mix(in srgb, #2563EB 45%, var(--line)); }
.timer-card.rest { background: linear-gradient(180deg, color-mix(in srgb, #10B981 15%, var(--card)), var(--card) 70%); border-color: color-mix(in srgb, #10B981 50%, var(--line)); }
/* focus score rows: the bar fits its row (the full-screen focus mode has its own wider bar) */
.focus-part .focus-bar { width: auto; height: 4px; background: var(--line-2); }
.focus-part { grid-template-columns: minmax(0, 1fr) auto 64px; }
.focus-part b { white-space: nowrap; }
.focus-part > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.pause-box.on { border-color: color-mix(in srgb, #F59E0B 55%, var(--line)); background: color-mix(in srgb, #F59E0B 8%, var(--card)); }
/* Others' video is never mirrored (a back camera would show writing flipped); only your own selfie preview is.
   The box keeps its shape whatever the picture's shape (portrait phones no longer stretch the tile). */
.tile video, .focus-video video, .vz video { transform: none; }
.tile .vid, .focus-video { min-height: 0; overflow: hidden; }
.tile .vid > video, .focus-video > video { position: absolute; inset: 0; }
.focus-video > video.mirror, .rot-box > video.mirror { transform: scaleX(-1); }
.dayoff-opts { grid-template-columns: 1fr; } .dayoff-opts .ir-btn .tiny { display: inline !important; margin-inline-start: 6px; }

/* Supervisor's question on the student's screen (sleepy?) */
.ask-card { border: 2px solid var(--info-ink); background: var(--info-bg); }
/* Newly registered students (first week): green edge and a small badge */
.tile.is-new { box-shadow: 0 0 0 2px var(--ok-ink) inset; }
.new-badge { position: absolute; top: 8px; right: 40px; background: var(--ok-ink); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
tr.is-new td:first-child { box-shadow: 4px 0 0 var(--ok-ink) inset; }
.new-pill { background: var(--ok-bg, #DCFCE7); color: var(--ok-ink); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800; margin-inline-start: 6px; }
.new-row { width: 100%; border: 1px solid var(--line); background: var(--card); color: inherit; border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; box-shadow: 4px 0 0 var(--ok-ink) inset; }
.sup-search { width: 220px; min-height: 36px; }
@media (max-width: 700px) { .sup-search { width: 100%; } }

/* ---------- Student file (summary strip, period cards, timeline) ---------- */
.sum-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--brand-soft), var(--card)); color: inherit; font: inherit; text-align: start; cursor: pointer; position: relative; }
.sum-strip:hover { border-color: var(--brand); }
.sum-strip > div { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.sum-strip span { font-size: 11px; color: var(--muted); }
.sum-strip b { font-size: 14px; }
.sum-strip small { font-weight: 500; color: var(--muted); font-size: 11px; }
.sum-strip i, .period-grid i { font-style: normal; font-size: 11px; font-weight: 700; }
.sum-strip i.up, .period-grid i.up { color: var(--ok-ink); }
.sum-strip i.down, .period-grid i.down { color: var(--bad-ink); }
.sum-strip .sum-over { grid-column: 1 / -1; font-size: 12px; color: var(--bad-ink); font-weight: 700; }
.sum-strip .sum-more { position: absolute; top: 8px; inset-inline-end: 10px; font-size: 11px; color: var(--brand-ink); font-weight: 700; }
.sum-strip.skeleton { height: 92px; cursor: default; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.modal:has(.file-modal), .modal:has(.perf-wide) { max-width: 880px; }
.file-modal { min-width: 0; }
.period-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 10px; }
.period-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.period-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.period-grid > div { background: var(--line-2); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; }
.period-grid span { font-size: 11px; color: var(--muted); }
.cat-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line-2); }
.cat-bar i { display: block; height: 100%; }
.cat-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--muted); }
.cat-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 4px; }
.chips-scroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chips-scroll .chip { flex: none; }
.timeline { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; padding-inline-end: 4px; }
.tl-day { position: sticky; top: 0; z-index: 1; background: var(--card); font-weight: 800; font-size: 12px; color: var(--muted); padding: 4px 0; }
.tl-item { display: flex; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line-2); margin-bottom: 6px; background: var(--card); }
.tl-item.warn { border-color: var(--warn-line); background: color-mix(in srgb, var(--warn-bg) 50%, var(--card)); }
.tl-item.info { border-color: color-mix(in srgb, var(--info-ink, #3730A3) 30%, transparent); }
.tl-item.muted { opacity: .6; }
.tl-ico { font-size: 18px; line-height: 1.4; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.tl-time { font-weight: 500; color: var(--muted); font-size: 11px; white-space: nowrap; }
.tl-text { font-size: 13px; color: var(--ink-2); }
.tl-by { font-size: 11px; color: var(--muted); }
.preset { text-align: start; border: 1px solid var(--line); background: var(--card); color: inherit; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.preset.on, .preset:hover { border-color: var(--brand); background: var(--brand-soft); }
.warn-row { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.warn-row.off { opacity: .6; text-decoration: line-through; text-decoration-color: var(--muted); }
.limit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); padding-bottom: 6px; }
.bad-ink { color: var(--bad-ink); font-weight: 700; }

/* ---------- Supervisor spreadsheet ---------- */
.sheet-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sheet-wrap { max-height: 70vh; }
.sheet { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.sheet th, .sheet td { border-bottom: 1px solid var(--line-2); border-inline-start: 1px solid var(--line-2); padding: 4px; text-align: center; vertical-align: top; }
.sheet thead th { position: sticky; top: 0; background: var(--card); z-index: 2; font-weight: 800; white-space: nowrap; }
.sheet .sticky-col { position: sticky; inset-inline-start: 0; background: var(--card); z-index: 1; text-align: start; white-space: nowrap; }
.sheet thead .sticky-col { z-index: 3; }
.sheet-cell { position: relative; min-width: 104px; }
.cell-btn { width: 100%; min-height: 50px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, var(--card)); box-shadow: inset 3px 0 0 var(--c); color: inherit; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 4px; }
.cell-btn:hover:not(:disabled) { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); }
.cell-btn:disabled { cursor: default; opacity: .7; }
.cell-cat { font-weight: 800; color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.cell-sub { font-size: 11px; }
.cell-empty { color: var(--muted); }
.cell-meta { font-size: 10px; color: var(--muted); }
.cell-pop { position: absolute; top: 100%; inset-inline-start: 0; z-index: 20; width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: 10px; }
.cell-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* ---------- Supervisor performance ---------- */
.perf-live { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.perf-card { display: flex; flex-direction: column; gap: 8px; text-align: start; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: var(--card); color: inherit; font: inherit; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.perf-card:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.perf-card.has-open { border-color: var(--warn-line); box-shadow: inset 0 3px 0 var(--warn-ink); }
.perf-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.perf-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.perf-nums.wide { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.perf-nums > div { background: var(--line-2); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; }
.perf-nums span { font-size: 11px; color: var(--muted); }
.perf-nums i { font-style: normal; font-size: 11px; }
.perf-open { font-size: 12px; color: var(--warn-ink); font-weight: 700; }
.alert-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; font-size: 13px; background: var(--line-2); }
.alert-row.ok { box-shadow: inset 3px 0 0 var(--ok-ink); }
.alert-row.miss { box-shadow: inset 3px 0 0 var(--bad-ink); background: color-mix(in srgb, var(--bad-bg) 40%, var(--card)); }
.seg.sm button { padding: 2px 10px; font-size: 12px; min-height: 28px; }
/* Phones: the account menu opens as a sheet across the screen (it used to run off the right edge). */
@media (max-width: 640px) {
  .user-pop { position: fixed; top: 64px; left: 8px; right: 8px; inset-inline-end: auto; min-width: 0; max-height: calc(100dvh - 80px); overflow: auto; }
}

.fixed-note { background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--ink); border-radius: 12px; padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.paused-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 12px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.plan-badge { position: absolute; z-index: 2; bottom: 8px; right: 44px; background: rgba(15,23,42,.7); border-radius: 8px; padding: 0 5px; font-size: 13px; }
.expect-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; width: 100%; border: 1px solid var(--line); background: var(--card); color: inherit; border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; }
.expect-row.done { opacity: .65; box-shadow: inset 3px 0 0 var(--ok-ink); }
.expect-row.late { box-shadow: inset 3px 0 0 var(--bad-ink); }
.plan-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; }

.away-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; background: radial-gradient(circle at 50% 35%, #3B4A9C, #1E2552); text-align: center; padding: 8px; }
.away-ico { font-size: 34px; line-height: 1.2; animation: floaty 3s ease-in-out infinite; }
.away-time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.15); border-radius: 99px; padding: 1px 10px; }
@keyframes floaty { 50% { transform: translateY(-3px); } }
.cheer-btn { background: linear-gradient(135deg, #FEF3C7, #FCE7F3); border-color: #F9C6DD; color: #7C2D12; }
html[data-theme="dark"] .cheer-btn { background: linear-gradient(135deg, #3B2A10, #3B1530); border-color: #6B3654; color: #FDE68A; }

/* =========================================================
   Student room — "study desk" look. Calm indigo for focus, mint for wins and breaks, desk-lamp amber for
   cheers, soft coral for reminders (never alarm red). The camera sits on a desk; the day is a track of beads.
   ========================================================= */
:root {
  --stu-ink: #23265A; --stu-indigo: #3B44C4; --stu-mint: #12B886; --stu-mint-ink: #0B7A5A; --stu-lamp: #F7B538; --stu-coral: #EE7B5C;
  --stu-paper: #F6F5FC; --stu-wood: #B9825A; --stu-wood-2: #8E5B3A; --stu-soft: #EEEDFB;
}
html[data-theme="dark"] { --stu-ink: #E4E6FF; --stu-indigo: #8F97FF; --stu-mint-ink: #5EE0B2; --stu-paper: #12142B; --stu-soft: #1C1F3D; --stu-wood: #6E4A33; --stu-wood-2: #4D3222; }
body:has(.stu) { background: var(--stu-paper); }
.stu { gap: 14px; }
.stu h2 { font-size: 17px; margin: 0; }

/* greeting + target */
.stu-hero { display: grid; grid-template-columns: 1fr minmax(260px, 380px); gap: 14px; align-items: center; padding: 6px 2px; }
.stu-hello h1 { margin: 0; font-size: clamp(22px, 4.4vw, 30px); font-weight: 900; color: var(--stu-ink); letter-spacing: -.3px; }
.stu-streak { display: inline-block; margin-top: 4px; font-weight: 800; font-size: 14px; color: #B4530A; background: #FFF1DC; border-radius: 99px; padding: 2px 12px; }
.stu-streak.soft { color: var(--stu-indigo); background: var(--stu-soft); font-weight: 700; }
html[data-theme="dark"] .stu-streak { background: #3A2610; color: #FDBA74; }
.stu-target { text-align: start; border: 0; cursor: pointer; font: inherit; color: inherit; background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(35, 38, 90, .45); display: flex; flex-direction: column; gap: 8px; }
.stu-target:hover { box-shadow: 0 0 0 2px var(--stu-indigo), 0 10px 30px -18px rgba(35, 38, 90, .45); }
.stu-target-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stu-target-num { font-size: 15px; color: var(--muted); }
.stu-target-num b { font-size: 28px; font-weight: 900; color: var(--stu-ink); font-variant-numeric: tabular-nums; }
.stu-target-edit { font-size: 12px; font-weight: 800; color: var(--stu-indigo); }
.stu-target-bar { height: 12px; border-radius: 99px; background: var(--stu-soft); overflow: hidden; }
.stu-target-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--stu-mint), #4ADE80); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.stu-target-note { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) { .stu-hero { grid-template-columns: 1fr; } }

/* target question sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(18, 20, 43, .45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
@media (min-width: 720px) { .sheet-bg { align-items: center; } }
.stu-sheet { width: 100%; max-width: 460px; background: var(--card); border-radius: 26px; padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
.stu-sheet h2 { font-size: 20px; font-weight: 900; color: var(--stu-ink); }
.stu-sheet p { margin: 0; }
.stu-sheet-emoji { font-size: 40px; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
.target-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.target-chip { border: 1.5px solid var(--line); background: var(--card); color: var(--stu-ink); border-radius: 16px; padding: 10px 0; font: inherit; font-size: 20px; font-weight: 900; cursor: pointer; display: flex; flex-direction: column; line-height: 1.2; }
.target-chip small { font-size: 11px; font-weight: 600; color: var(--muted); }
.target-chip.on { border-color: var(--stu-indigo); background: var(--stu-soft); box-shadow: 0 0 0 2px var(--stu-indigo) inset; }
.stu-note { background: #FFF6E5; color: #7C4A03; border-radius: 14px; padding: 8px 12px; font-size: 13px; text-align: start; }
html[data-theme="dark"] .stu-note { background: #2E2310; color: #FCD48A; }

/* gentle reminder from the supervisor */
.stu-remind { display: flex; align-items: center; gap: 12px; background: #FFF3EE; border: 1.5px solid #F6C3B2; color: #6B2B17; }
.stu-remind-ico { font-size: 26px; animation: ring-bell 1.2s ease-in-out 2; }
@keyframes ring-bell { 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } 50% { transform: none; } }
html[data-theme="dark"] .stu-remind { background: #2E1A14; border-color: #6B3A2A; color: #FFD9CC; }

/* cheer celebration */
.cheer-pop { position: fixed; z-index: 70; left: 50%; top: 18%; transform: translateX(-50%); width: min(380px, calc(100vw - 32px)); background: var(--card); border-radius: 26px; padding: 22px 18px 18px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; box-shadow: 0 30px 80px -20px rgba(35, 38, 90, .5), 0 0 0 3px var(--stu-lamp); animation: pop-in .45s cubic-bezier(.2, 1.4, .3, 1); cursor: pointer; }
.cheer-pop b { font-size: 18px; color: var(--stu-ink); }
.cheer-emoji { font-size: 54px; line-height: 1.1; }
.cheer-burst { position: absolute; inset: 0; pointer-events: none; }
.cheer-burst i { position: absolute; left: 50%; top: 30%; font-style: normal; font-size: 18px; animation: burst 1.1s ease-out var(--d) forwards; opacity: 0; }
@keyframes burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.6); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-130px) scale(1.1); } }
@keyframes pop-in { from { transform: translate(-50%, 20px) scale(.85); opacity: 0; } }

/* class topic question */
.stu-ask { display: flex; gap: 12px; align-items: center; background: var(--stu-soft); border-color: transparent; }
.stu-ask-ico { font-size: 32px; }

/* camera on a desk */
.desk { position: relative; padding: 10px 10px 0; border-radius: 22px 22px 8px 8px; background: radial-gradient(120% 90% at 85% -10%, rgba(247, 181, 56, .35), transparent 55%), linear-gradient(180deg, #2A2E5C, #1E2148); }
.desk-lamp { position: absolute; top: 10px; right: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--stu-lamp); box-shadow: 0 0 18px 6px rgba(247, 181, 56, .55); z-index: 1; }
.desk-screen { border-radius: 14px 14px 4px 4px; box-shadow: 0 0 0 3px #111432; }
.desk-edge { height: 16px; margin: 0 -10px; border-radius: 0 0 10px 10px; background: linear-gradient(180deg, var(--stu-wood), var(--stu-wood-2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18), 0 6px 14px -8px rgba(0, 0, 0, .5); }

/* the day as beads */
.day-track { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.bead { --c: var(--line); display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; position: relative; padding: 6px 0; }
.bead:not(:last-child)::after { content: ''; position: absolute; right: 16px; top: 38px; bottom: -6px; width: 2px; background: var(--line); }
.bead-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; background: var(--card); border: 2.5px solid var(--c); color: var(--stu-ink); z-index: 1; }
.bead.done .bead-dot { background: color-mix(in srgb, var(--c) 18%, var(--card)); }
.bead.cur .bead-dot { background: var(--stu-indigo); border-color: var(--stu-indigo); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--stu-indigo) 22%, transparent); }
.bead.future { opacity: .55; }
.bead-body { display: flex; flex-direction: column; line-height: 1.5; }
.bead-body b { font-size: 14px; }
.bead-body small { color: var(--muted); font-size: 12px; }

/* my week */
.week-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.week-list li { display: grid; grid-template-columns: 30px 1fr; gap: 0 10px; padding: 8px 10px; border-radius: 14px; background: var(--stu-soft); }
.week-list li.warn { background: #FFF3EE; }
html[data-theme="dark"] .week-list li.warn { background: #2E1A14; }
.wk-emoji { grid-row: span 2; font-size: 22px; align-self: center; }
.wk-text { font-size: 14px; font-weight: 600; }
.wk-when { font-size: 11px; color: var(--muted); }

/* report form with icons */
.stu-report { display: flex; flex-direction: column; gap: 10px; }
.rep-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.rep-cat { display: inline-flex; gap: 6px; align-items: center; border: 1.5px solid var(--line); background: var(--card); color: inherit; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.rep-cat.on { border-color: var(--stu-indigo); background: var(--stu-soft); color: var(--stu-indigo); }
.rep-reasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.rep-reason { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1.5px solid var(--line); background: var(--card); color: inherit; border-radius: 16px; padding: 10px 4px 8px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.rr-ico { font-size: 26px; line-height: 1.2; }
.rep-reason.on { border-color: var(--stu-mint); background: color-mix(in srgb, var(--stu-mint) 12%, var(--card)); box-shadow: 0 0 0 2px var(--stu-mint) inset; }
.rep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rep-list li { display: flex; gap: 8px; align-items: center; font-size: 13px; background: var(--stu-soft); border-radius: 12px; padding: 6px 10px; }

/* next medal */
.medal-next { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, #FFF7E0, #FDEBF4); border-radius: 18px; padding: 10px 14px; margin-bottom: 10px; color: #4A2A06; }
html[data-theme="dark"] .medal-next { background: linear-gradient(135deg, #2E2410, #2E1527); color: #FDE2B2; }
.medal-next-emoji { font-size: 36px; }
.medal-next-bar { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.medal-next-bar i { display: block; height: 100%; background: var(--stu-lamp); border-radius: 99px; }

/* timer colours inside the student room */
.stu .timer-card.study { box-shadow: inset 0 4px 0 var(--stu-indigo); }
.stu .timer-card.rest { box-shadow: inset 0 4px 0 var(--stu-mint); }
@media (prefers-reduced-motion: reduce) { .cheer-pop, .cheer-burst i, .stu-remind-ico, .stu-sheet, .away-ico { animation: none !important; } .cheer-burst { display: none; } }
@media (max-width: 640px) {
  .stu > .row { flex-direction: column; align-items: stretch; }
  .stu > .row > .side { width: 100%; max-width: none; }
  .target-chips { grid-template-columns: repeat(4, 1fr); }
}
.intro-banner { background: linear-gradient(135deg, #EEF0FF, #FDF2F8); border-color: transparent; font-weight: 700; color: var(--stu-ink); }
html[data-theme="dark"] .intro-banner { background: linear-gradient(135deg, #1C1F3D, #2A1530); }
.fam-card { display: flex; gap: 12px; align-items: flex-start; border-color: var(--amber-line); background: var(--amber-bg); }
.fam-ico { font-size: 32px; }

/* ---------- Messenger (redesign): soft bubbles, photos, voice notes, @mentions ---------- */
.chat-box { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 5%, var(--card)), var(--card)); border: 1px solid var(--line); border-radius: 18px; padding: 12px; gap: 4px; scroll-behavior: smooth; }
.chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; text-align: center; max-width: 300px; }
.chat-empty span { font-size: 32px; }
.chat-row.cont { margin-top: -2px; }
.chat-msg { border: 0; background: var(--card); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px var(--line); border-radius: 18px 18px 18px 6px; padding: 7px 12px 5px; font-size: 14px; }
.chat-msg.mine { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #7C3AED)); color: #fff; box-shadow: 0 4px 14px -8px color-mix(in srgb, var(--brand) 70%, transparent); border-radius: 18px 18px 6px 18px; }
.chat-msg.mine .chat-time { color: rgba(255, 255, 255, .75); }
.chat-msg.mine .mention { color: #FDE68A; }
.chat-msg.at-me { box-shadow: 0 0 0 2px #F7B538; }
.chat-msg.media { padding: 4px; }
.chat-msg.media .chat-text, .chat-msg.media .chat-from { padding: 0 8px; }
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-img { display: block; max-width: min(260px, 60vw); max-height: 280px; border-radius: 14px; object-fit: cover; }
.chat-day { background: none; padding: 0; margin: 8px 0 4px; }
.chat-day span { background: var(--line-2); border-radius: 99px; padding: 2px 12px; }
.mention { color: var(--brand-ink); font-weight: 800; }
.chat-compose { position: relative; display: flex; align-items: flex-end; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 5px; }
.chat-input { border: 0 !important; box-shadow: none !important; resize: none; min-height: 38px; max-height: 120px; padding: 7px 8px; background: transparent; flex: 1; field-sizing: content; }
.chat-tool { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--line-2); cursor: pointer; font-size: 16px; flex: none; }
.chat-send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 16px; cursor: pointer; flex: none; transform: scaleX(-1); }
.chat-send.mic { transform: none; background: var(--line-2); color: inherit; }
.chat-send:disabled, .chat-tool:disabled { opacity: .5; cursor: default; }
.rec-live { display: flex; align-items: center; gap: 8px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--bad-ink); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #EF4444; animation: pulse 1s infinite; }
.mention-pop { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px -10px rgba(15, 23, 42, .3); padding: 4px; display: flex; flex-direction: column; min-width: 200px; z-index: 5; }
.mention-pop button { display: flex; gap: 8px; align-items: center; border: 0; background: none; padding: 6px 8px; border-radius: 10px; font: inherit; font-size: 13px; cursor: pointer; text-align: start; color: inherit; }
.mention-pop button:hover, .mention-pop button:first-child { background: var(--line-2); }
.voice-note { display: flex; align-items: center; gap: 8px; min-width: 200px; padding: 4px 6px; }
.voice-note button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; cursor: pointer; flex: none; }
.voice-note.mine button { background: #fff; color: var(--brand); }
.vn-bar { flex: 1; height: 6px; border-radius: 99px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; }
.vn-bar i { display: block; height: 100%; background: currentColor; border-radius: 99px; }
.vn-len { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .chat-box { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 10%, var(--card)), var(--card)); }
/* Segmented switches never push the page sideways on phones: they scroll inside themselves. */
@media (max-width: 640px) { .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg button { flex: none; white-space: nowrap; } }

/* =====================================================================
   DESIGN SYSTEM v2 — "night ink & lamp"
   Calm deep-ink text on a cool lilac paper, the brand colour (from Branding) for action, mint for wins and breaks,
   lamp amber for encouragement, soft coral for reminders. Generous radii, crisp hairline borders with layered soft
   shadows, Lucide line icons. This layer comes last on purpose: it restyles every existing component without
   changing any markup, route or behaviour.
   ===================================================================== */
:root {
  --bg: #F5F5FA; --card: #FFFFFF; --ink: #1B1E3C; --ink-2: #3A3E63; --muted: #62668A;
  --line: #E4E4EF; --line-2: #EFEFF6; --field: #D2D3E3; --soft: #F3F3F9; --soft-2: #F7F7FB;
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 26%, #fff);
  --ok: #0B7A5C; --ok-bg: #E7F7F1; --ok-line: #B6E5D3;
  --warn: #B4430F; --warn-bg: #FFF1E8; --warn-line: #F6CBAE;
  --amber: #8F5B00; --amber-bg: #FFF6DF; --amber-line: #F1D693;
  --bad: #B8323C; --bad-bg: #FDEDEF; --bad-line: #F3C3C8;
  --info: #3B42B8; --info-bg: #EEEFFF;
  --ok-ink: #0B7A5C; --bad-ink: #B8323C; --warn-ink: #B4430F; --info-ink: #3B42B8; --brand-ink: color-mix(in srgb, var(--brand) 88%, #000);
  --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-xl: 24px; --radius: 18px;
  --sh-1: 0 1px 2px rgba(27, 30, 60, .05), 0 0 0 1px rgba(27, 30, 60, .02);
  --sh-2: 0 1px 2px rgba(27, 30, 60, .04), 0 12px 30px -16px rgba(27, 30, 60, .22);
  --sh-3: 0 2px 6px rgba(27, 30, 60, .06), 0 28px 60px -18px rgba(27, 30, 60, .32);
  --ring: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1124; --card: #171A33; --ink: #E8E9F7; --ink-2: #C3C6E3; --muted: #9195BC;
  --line: #262A4A; --line-2: #1D2040; --field: #363B63; --soft: #1B1E3A; --soft-2: #191C36;
  --brand-soft: color-mix(in srgb, var(--brand) 20%, #171A33);
  --brand-line: color-mix(in srgb, var(--brand) 45%, #171A33);
  --ok: #5EE0B2; --ok-bg: #10302A; --ok-line: #1E5446;
  --warn: #FDB28B; --warn-bg: #36200F; --warn-line: #66391C;
  --amber: #FCD37A; --amber-bg: #33280F; --amber-line: #62501C;
  --bad: #FF9AA2; --bad-bg: #3A1820; --bad-line: #6A2A35;
  --info: #AAB1FF; --info-bg: #1F2350;
  --ok-ink: #5EE0B2; --bad-ink: #FF9AA2; --warn-ink: #FDB28B; --info-ink: #AAB1FF; --brand-ink: color-mix(in srgb, var(--brand) 40%, #fff);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255, 255, 255, .02);
  --sh-2: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -16px rgba(0, 0, 0, .6);
  --sh-3: 0 2px 8px rgba(0, 0, 0, .4), 0 30px 70px -20px rgba(0, 0, 0, .75);
}

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
html, body { font-family: var(--font); font-weight: 400; background: var(--bg); color: var(--ink); line-height: 1.8; }
body { background:
  radial-gradient(1200px 520px at 100% -10%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 60%),
  radial-gradient(900px 480px at -10% 0%, color-mix(in srgb, #F5B23E 5%, transparent), transparent 55%),
  var(--bg); background-attachment: fixed; min-height: 100vh; }
* { -webkit-tap-highlight-color: transparent; }
button, a, input, select, textarea, label { touch-action: manipulation; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
b, strong, .bold { font-weight: 800; }
h1 { font-size: 24px; font-weight: 900; letter-spacing: -.2px; line-height: 1.45; text-wrap: balance; }
h2 { font-size: 17px; font-weight: 800; line-height: 1.5; }
h3 { font-size: 15px; font-weight: 800; }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.muted { color: var(--muted); }
a { color: var(--brand-ink); text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--ring), 0 0 0 1.5px var(--brand); border-radius: 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: none; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent; }
.i { flex: none; vertical-align: -0.18em; }
.i.fill { fill: currentColor; }
.lbl { display: inline-flex; align-items: center; gap: .4em; min-width: 0; }
.lbl .i { color: inherit; opacity: .9; }
.stars-row .i { color: var(--amber); }
[dir="rtl"] .chat-send .i, .flip-rtl .i { transform: scaleX(-1); }

/* ---------- layout ---------- */
.wrap { padding: 20px 20px 56px; gap: 18px; }
@media (max-width: 640px) { .wrap { padding: 12px 12px 40px; gap: 12px; } }
.grid { gap: 12px; }

/* ---------- top bar: quiet glass ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--card) 80%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.topbar-in { min-height: 64px; padding: 8px 20px; gap: 12px; }
.logo, .logo-fallback { border-radius: 12px; box-shadow: var(--sh-1); }
.brand-name { font-weight: 900; font-size: 16px; letter-spacing: -.1px; }
.user-btn { border-color: var(--line); background: var(--card); box-shadow: var(--sh-1); transition: border-color .15s, box-shadow .15s; }
.user-btn:hover { border-color: var(--brand-line); }
.user-pop { border-radius: var(--r-lg); border-color: var(--line); box-shadow: var(--sh-3); padding: 6px; }
.user-pop button { border-radius: 12px; font-weight: 600; gap: 12px; }
.user-pop button .i { color: var(--muted); }
.user-pop button:hover .i { color: var(--brand-ink); }
@media (max-width: 640px) { .topbar-in { padding: 6px 12px; min-height: 56px; } .topbar-title .tiny { display: none; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 18px; }
.card.pad-0 { padding: 0; }
.card-head { align-items: center; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 .i { color: var(--brand-ink); }
.card.pad-0 > .card-head { padding: 14px 18px 0; }
.card.soft { background: var(--brand-soft); border-color: var(--brand-line); box-shadow: none; }
.card.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.card.bad { border-color: var(--bad-line); }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 900; letter-spacing: -.3px; font-variant-numeric: tabular-nums; line-height: 1.35; }
@media (max-width: 640px) { .card { padding: 14px; border-radius: var(--r); } .stat .v { font-size: 22px; } }

/* ---------- buttons ---------- */
.btn { min-height: 42px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; gap: 8px; box-shadow: var(--sh-1);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease); }
.btn:hover:not(:disabled) { border-color: var(--field); background: var(--soft-2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; }
.btn .i { opacity: .85; }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 16px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: transparent; }
.btn.primary .i { opacity: 1; }
.btn.dark { background: var(--ink); border-color: transparent; color: var(--card); }
.btn.dark:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 85%, var(--brand)); }
.btn.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); box-shadow: none; }
.btn.danger { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); box-shadow: none; }
.btn.amber { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); box-shadow: none; }
.btn.orange { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); box-shadow: none; }
.btn.ok:hover:not(:disabled), .btn.danger:hover:not(:disabled), .btn.amber:hover:not(:disabled), .btn.orange:hover:not(:disabled) { filter: saturate(1.15) brightness(.98); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--brand-ink); }
.btn.ghost:hover:not(:disabled) { background: var(--brand-soft); }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: 12.5px; border-radius: 10px; gap: 6px; }
.btn.link { box-shadow: none; color: var(--brand-ink); }
.btn.link:hover:not(:disabled) { background: none; text-decoration: underline; }
html[data-theme="dark"] .btn.ok, html[data-theme="dark"] .btn.danger, html[data-theme="dark"] .btn.amber, html[data-theme="dark"] .btn.orange { color: inherit; }
html[data-theme="dark"] .btn.ok { color: var(--ok-ink); } html[data-theme="dark"] .btn.danger { color: var(--bad-ink); }
html[data-theme="dark"] .btn.amber { color: var(--amber); } html[data-theme="dark"] .btn.orange { color: var(--warn-ink); }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn.sm { min-height: 38px; } }

/* ---------- chips, pills, segmented ---------- */
.chip { min-height: 36px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 13px; color: var(--ink-2); gap: 6px;
  transition: background-color .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--field); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); line-height: 1.7; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); } .pill.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); } .pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.info { background: var(--info-bg); color: var(--info-ink); } .pill.gray { background: var(--line-2); color: var(--ink-2); }
.seg { background: var(--line-2); border-radius: 14px; padding: 4px; gap: 4px; border: 1px solid var(--line); }
.seg button { border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); min-height: 36px; transition: background-color .15s, color .15s, box-shadow .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--sh-1), 0 1px 3px rgba(27, 30, 60, .08); }
.tabs { gap: 6px; }

/* ---------- forms ---------- */
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { min-height: 44px; border: 1px solid var(--field); border-radius: 12px; padding: 9px 12px; background: var(--card); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:hover { border-color: color-mix(in srgb, var(--field) 60%, var(--ink)); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
select.input { background-color: var(--card); color: var(--ink); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 17px; height: 17px; }
.check { line-height: 1.9; }
.error { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-ink); border-radius: 12px; }
.notice { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-ink); border-radius: 12px; font-weight: 600; }
@media (max-width: 640px) { .input, select.input, textarea.input { font-size: 16px; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
table.t { font-size: 13.5px; }
table.t th { background: var(--soft-2); color: var(--muted); font-weight: 600; font-size: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
table.t tbody tr { transition: background-color .12s; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--brand) 3%, transparent); }
table.t tr.sel td { background: var(--brand-soft); }
table.t tr.flag td { background: color-mix(in srgb, var(--warn-bg) 70%, transparent); }
table.t tbody tr:last-child td { border-bottom: 0; }

/* ---------- toasts ---------- */
.toasts { bottom: max(16px, env(safe-area-inset-bottom)); gap: 8px; z-index: 80; }
.toast { background: color-mix(in srgb, var(--ink) 94%, transparent); color: #fff; border-radius: 16px; padding: 10px 10px 10px 14px; gap: 10px; box-shadow: var(--sh-3); max-width: 520px; align-items: center; justify-content: flex-start;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: toast-in .35s var(--ease); }
html[data-theme="dark"] .toast { background: #2A2E52; }
.toast.ok, .toast.bad { background: color-mix(in srgb, var(--ink) 94%, transparent); }
.toast-i { font-size: 20px; flex: none; color: #A5ACFF; }
.toast.ok .toast-i { color: #5EE0B2; } .toast.bad .toast-i { color: #FF9AA2; }
.toast-t { flex: 1; font-weight: 600; font-size: 14px; line-height: 1.7; }
.toast-x { border: 0; background: rgba(255, 255, 255, .1); color: #fff; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.toast-x:hover { background: rgba(255, 255, 255, .2); }
@keyframes toast-in { from { transform: translateY(14px) scale(.98); opacity: 0; } }

/* ---------- modals: centred card on desktop, bottom sheet on phones ---------- */
.modal-bg { background: rgba(15, 17, 36, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 60; animation: fade-in .2s ease; overscroll-behavior: contain; }
.modal { border-radius: var(--r-xl); padding: 0 22px 22px; box-shadow: var(--sh-3); border: 1px solid var(--line); gap: 14px; animation: modal-in .28s var(--ease); overscroll-behavior: contain; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 18px 0 12px; margin-bottom: -2px; background: var(--card); border-bottom: 1px solid var(--line-2); }
.modal-head h2 { flex: 1; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.modal-x { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: grid; place-items: center; flex: none; transition: background-color .15s, color .15s; }
.modal-x:hover { background: var(--soft); color: var(--ink); }
.modal-grab { display: none; }
@keyframes modal-in { from { transform: translateY(12px) scale(.985); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@media (max-width: 640px) {
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { max-width: none !important; width: 100%; border-radius: 24px 24px 0 0; max-height: 92dvh; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); animation: sheet-in .32s var(--ease); }
  .modal-grab { display: block; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 99px; background: var(--field); }
  .modal-head { padding-top: 20px; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: .4; } }

/* ---------- loading skeleton & empty state ---------- */
.skel { display: flex; flex-direction: column; gap: 12px; }
.skel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.skel i { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--line-2) 0%, color-mix(in srgb, var(--line) 80%, var(--card)) 50%, var(--line-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel i.block { height: 92px; border-radius: var(--r-lg); }
.skel i.wide { height: 220px; border-radius: var(--r-lg); }
.skel i.short { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--soft-2); }
.empty .i { font-size: 22px; color: color-mix(in srgb, var(--muted) 70%, transparent); }

/* ---------- admin navigation ---------- */
.admin-nav { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; border-radius: var(--r-lg); border-color: var(--line); box-shadow: var(--sh-1); padding: 8px; gap: 2px; }
.admin-nav button { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 9px 10px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); transition: background-color .15s, color .15s; }
.admin-nav button:hover { background: var(--soft); color: var(--ink); }
.admin-nav button.on { background: var(--brand-soft); color: var(--brand-ink); }
.admin-nav button.on .nav-ico { background: var(--brand); color: #fff; }
.nav-ico { width: 30px; height: 30px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--soft); color: var(--muted); font-size: 15px; transition: background-color .15s, color .15s; }
.admin-nav button:hover .nav-ico { color: var(--ink); }
.admin-nav-group { font-size: 11px; font-weight: 800; color: var(--muted); padding: 14px 10px 4px; letter-spacing: 0; }
html[data-theme="dark"] .admin-nav button.on { background: var(--brand-soft); color: var(--brand-ink); }
@media (max-width: 900px) {
  .admin-nav { position: static; max-height: none; overflow: visible; }
  .admin-nav > button, .admin-nav-group { display: none; }
  .admin-nav-select { min-height: 46px; border-radius: 12px; }
}

/* ---------- row menus ---------- */
.row-menu { border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--sh-3); padding: 6px; background: var(--card); }
.row-menu button { border-radius: 10px; gap: 10px; font-weight: 600; display: flex; align-items: center; }
.row-menu button .i { color: var(--muted); }
.row-menu button.danger, .row-menu button.danger .i { color: var(--bad-ink); }
.row-menu-btn { width: 34px; padding: 0; }

/* ---------- video tiles ---------- */
.tile { border: 1.5px solid var(--line); border-radius: 16px; box-shadow: var(--sh-1); transition: box-shadow .15s, border-color .15s, transform .12s; }
.tile:hover { box-shadow: var(--sh-2); }
.tile.sel { border-color: var(--brand); box-shadow: var(--ring); }
.tile .meta { padding: 8px 10px 10px; }
.tile .nm { font-weight: 800; }
.tile .seat { border-radius: 8px; font-weight: 700; background: rgba(15, 17, 36, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.focus-video, .tile .vid { background: #121530; }

/* ---------- misc elements ---------- */
.meter { background: var(--line-2); border-radius: 99px; height: 10px; }
.meter > div { border-radius: 99px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #10B48A)); }
.bars { border-bottom-color: var(--line); gap: 3px; }
.bars > button, .bars > div { background: color-mix(in srgb, var(--brand) 28%, var(--card)); border-radius: 6px 6px 2px 2px; transition: background-color .15s; }
.bars > button:hover { background: color-mix(in srgb, var(--brand) 55%, var(--card)); }
.bars > .on { background: var(--brand); }
.spinner { border-color: var(--line); border-top-color: var(--brand); }
.chat-badge { box-shadow: 0 0 0 2px var(--card); }
.notice.small, .notice.tiny { font-weight: 500; }
details > summary { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line-2); }
.timer-card .ring .t, .focus-time, .stu-target-num b, .away-time { font-variant-numeric: tabular-nums; }
.ring .t { font-weight: 900; letter-spacing: 0; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* narrow phones (≤360px): let flexible columns shrink instead of pushing the page sideways */
.grow, .sup-grid-col, .col { min-width: 0; }
@media (max-width: 400px) { .sup-search { min-width: 0 !important; width: 100%; flex: 1 1 100%; } }
@media (max-width: 1100px) { .sup-main { align-items: stretch; } .sup-main > * { max-width: 100%; min-width: 0; } }
.sup-grid-col label.row { max-width: 100%; min-width: 0; }
.sup-grid-col label.row select.input { min-width: 0; max-width: 100%; flex: 1 1 auto; }
.btn.help-btn { border-radius: 50%; width: 36px; height: 36px; min-height: 36px; padding: 0; }
@media (pointer: coarse) { .btn.help-btn { width: 40px; height: 40px; } }

/* ---------- shift calendar day cards: rooms stacked, two slots side by side (fits any width) ---------- */
.shift-day { display: flex; flex-direction: column; gap: 10px; }
.shift-day-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; background: var(--soft-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; }
.shift-day-head span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.shift-room { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.shift-room:first-of-type { border-top: 0; padding-top: 0; }
.shift-room-name { font-weight: 800; font-size: 13px; overflow-wrap: anywhere; }
.shift-room-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shift-slot { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shift-slot select.input { min-height: 40px; font-size: 13px; font-weight: 700; width: 100%; min-width: 0; padding-inline: 10px; }
.shift-slot select.input.is-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.shift-slot select.input.is-empty { color: var(--bad-ink); }
.shift-slot .shift-src { align-self: flex-start; }
.days { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }

/* ---------- students table: compact columns, the action column always visible ---------- */
.stu-table td { vertical-align: middle; }
.stu-table .sticky-act { position: sticky; left: 0; z-index: 2; background: var(--card); box-shadow: 8px 0 12px -10px rgba(27, 30, 60, .25) inset; white-space: nowrap; }
.stu-table th.sticky-act { background: var(--soft-2); z-index: 3; }
.stu-table tbody tr:hover td.sticky-act { background: color-mix(in srgb, var(--brand) 3%, var(--card)); }
.stu-table tr.is-new td:first-child { box-shadow: inset -3px 0 0 var(--ok); }
@media (max-width: 640px) { .stu-table .row-actions .btn.primary { padding-inline: 10px; } }

/* ---------- tabs inside a dialog ---------- */
.modal-tabs { position: sticky; top: 64px; z-index: 2; display: flex; overflow-x: auto; scrollbar-width: none; }
.modal-tabs button { flex: 1 0 auto; white-space: nowrap; }

/* ---------- dashboard: grouped new sign-ups ---------- */
.signups { border: 1px solid var(--ok-line); background: var(--ok-bg); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.signups-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: none; border: 0; text-align: start; color: var(--ink); cursor: pointer; }
.signups-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--ok); color: #fff; font-size: 18px; flex: none; }
html[data-theme="dark"] .signups-ico { color: #0F1124; }
.signups-list { display: flex; flex-direction: column; gap: 2px; padding: 0 14px 12px; max-height: 360px; overflow: auto; }
.signups-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--ok-line); }
.signups-list .btn { align-self: flex-start; margin-top: 8px; }
@media (max-width: 560px) { .signups-row { grid-template-columns: 1fr auto; } .signups-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; } }

/* =====================================================================
   MESSENGER v2 — calm list, airy bubbles, replies and "sent as" choice
   ===================================================================== */
.modal:has(.chat-inbox) { max-width: 980px; width: min(980px, 96vw); }
.chat-inbox { grid-template-columns: 300px minmax(0, 1fr); gap: 0; min-width: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--card); min-height: min(560px, 72vh); }
.chat-side { padding: 12px; border-inline-end: 1px solid var(--line); background: var(--soft-2); }
.chat-main { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-list { max-height: min(520px, 62vh); gap: 2px; }
.chat-thread { flex-direction: row; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); cursor: pointer; transition: background-color .15s; width: 100%; }
.chat-thread:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.chat-thread.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.chat-thread.unread { background: transparent; border: 0; }
.chat-thread.unread .thread-top b { font-weight: 900; }
html[data-theme="dark"] .chat-thread { background: transparent; }
.chat-panel .chat-thread { background: transparent; }
.thread-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: start; }
.thread-top, .thread-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.thread-top b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.thread-kind { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 6px; padding: 0 6px; margin-inline-end: 6px; }
.thread-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; flex: none; }
.thread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--field); flex: none; }
.thread-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 18px; }
.thread-av.group { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #10B48A)); color: #fff; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.chat-pick { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 30px; }
.chat-pick .thread-av { width: 56px; height: 56px; font-size: 24px; }
.chat-box { border-radius: 16px; padding: 14px 12px; gap: 4px; background:
  radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--brand) 6%, transparent) 0, transparent 40%),
  radial-gradient(circle at 90% 80%, color-mix(in srgb, #10B48A 6%, transparent) 0, transparent 40%), var(--soft-2); border: 1px solid var(--line-2); }
.chat-row { position: relative; max-width: 86%; gap: 8px; }
.chat-av-gap { width: 30px; flex: none; }
.chat-msg { border-radius: 18px 18px 18px 6px; padding: 8px 12px 6px; font-size: 14px; line-height: 1.75; }
.chat-msg.mine { border-radius: 18px 18px 6px 18px; }
.chat-from { font-size: 12px; font-weight: 800; color: var(--brand-ink); margin-bottom: 1px; }
.chat-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.chat-time { font-size: 10.5px; opacity: .75; }
.chat-as { font-size: 10.5px; display: inline-flex; align-items: center; gap: 3px; opacity: .85; }
.chat-msg.mine .chat-as { color: rgba(255, 255, 255, .85); }
.chat-quote { display: flex; flex-direction: column; gap: 0; width: 100%; text-align: start; border: 0; cursor: pointer; margin: 2px 0 6px; padding: 5px 10px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, transparent); box-shadow: inset 3px 0 0 var(--brand); color: inherit; font: inherit; }
.chat-quote b { font-size: 11.5px; color: var(--brand-ink); }
.chat-quote span { font-size: 12.5px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.chat-msg.mine .chat-quote { background: rgba(255, 255, 255, .16); box-shadow: inset 3px 0 0 rgba(255, 255, 255, .8); }
.chat-msg.mine .chat-quote b { color: #fff; }
.chat-reply-btn { align-self: center; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--card); color: var(--muted); box-shadow: var(--sh-1); display: grid; place-items: center; opacity: 0; transition: opacity .15s; cursor: pointer; flex: none; }
.chat-row:hover .chat-reply-btn, .chat-reply-btn:focus-visible { opacity: 1; }
@media (hover: none) { .chat-reply-btn { opacity: .7; width: 28px; height: 28px; } }
.chat-row.flash .chat-msg { animation: flash-msg 1.2s ease; }
@keyframes flash-msg { 30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 45%, transparent); } }
.chat-compose-wrap { display: flex; flex-direction: column; gap: 6px; }
.chat-compose-top { display: flex; flex-direction: column; gap: 6px; }
.chat-replying { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--brand-line); }
.chat-replying .grow { display: flex; flex-direction: column; min-width: 0; }
.chat-replying b { font-size: 12px; color: var(--brand-ink); }
.chat-replying span span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-replying button { border: 0; background: none; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.chat-as-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-as-pick button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.chat-as-pick button.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.chat-compose { border-radius: 22px; padding: 5px; box-shadow: var(--sh-1); }
.chat-tool, .chat-send { display: grid; place-items: center; }
@media (max-width: 720px) {
  .chat-inbox { grid-template-columns: 1fr; border: 0; border-radius: 0; background: transparent; min-height: 0; }
  .chat-side { border: 0; padding: 0; background: transparent; }
  .chat-main { padding: 0; }
  .chat-list { max-height: none; }
  .chat-box { height: calc(100dvh - 300px) !important; min-height: 280px; }
  .chat-row { max-width: 94%; }
}

/* ---------- partner panel: tabs, list with detail beside it on wide screens ---------- */
.partner-page { max-width: 1320px; margin-inline: auto; }
.partner-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.partner-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.partner-tabs button { white-space: nowrap; }
.partner-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1180px) { .partner-split.has-detail { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } .partner-detail { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; border-radius: var(--r-lg); } }
.partner-detail > .card { margin: 0; }
.partner-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; align-items: start; }

/* =====================================================================
   STUDENT: game badges, cheers, questions, pauses, pop-ups, report card, self-study
   ===================================================================== */
.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 95; }
.badge { position: relative; display: inline-grid; place-items: center; flex: none; }
.badge svg { position: absolute; inset: 0; filter: drop-shadow(0 4px 8px rgba(27, 30, 60, .18)); }
.badge-ico { position: relative; color: #fff; font-size: 34%; display: grid; place-items: center; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.badge-ico .i { width: 1em; height: 1em; stroke-width: 2.4; }
.badge.locked svg path { filter: saturate(.15) brightness(1.08); opacity: .55; }
.badge.locked .badge-ico { color: color-mix(in srgb, var(--ink) 55%, transparent); filter: none; font-size: 28%; }
.badge.won svg { animation: badge-shine 3.5s ease-in-out infinite; }
@keyframes badge-shine { 0%, 100% { filter: drop-shadow(0 4px 8px rgba(27, 30, 60, .18)); } 50% { filter: drop-shadow(0 4px 14px rgba(245, 178, 62, .55)); } }
.badge-x { position: absolute; bottom: -4px; inset-inline-start: -4px; background: var(--ink); color: var(--card); font-size: 11px; font-weight: 800; border-radius: 99px; padding: 0 6px; line-height: 18px; }
.medal-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.medal { border-radius: 16px; padding: 14px 8px 10px; gap: 6px; filter: none; opacity: 1; background: var(--soft-2); border: 1px solid var(--line-2); }
.medal.won { background: linear-gradient(180deg, color-mix(in srgb, #F5B23E 12%, var(--card)), var(--card)); border-color: color-mix(in srgb, #F5B23E 40%, var(--line)); }
.medal-way { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.medal-way-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 8px; }
.medal-way-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, #F5B23E 10%, var(--card)), color-mix(in srgb, var(--brand) 6%, var(--card))); border: 1px solid var(--line-2); }
.medal-pct { font-weight: 900; font-size: 15px; color: var(--amber); font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .medal-pct { color: #FCD37A; }
.fun-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px; background: var(--amber-bg); color: var(--amber); font-size: 12.5px; font-weight: 700; }
.medal-pop-in { border-radius: 28px; padding: 30px 32px 24px; gap: 10px; box-shadow: var(--sh-3); animation: pop-in .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop-in { from { transform: scale(.6) rotate(-6deg); opacity: 0; } }

.cheer-pop { box-shadow: var(--sh-3); border-radius: 26px; animation: pop-in .5s cubic-bezier(.2, 1.4, .4, 1); }

.ask-card2 { display: flex; flex-direction: column; gap: 10px; border: 1.5px solid var(--brand-line); background: linear-gradient(135deg, var(--brand-soft), var(--card)); animation: pop-in .4s var(--ease); }
.ask-top { display: flex; align-items: center; gap: 8px; }
.ask-ico { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 18px; }
.ask-q { font-size: 18px; line-height: 1.6; }
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-opts .btn { flex: 1 1 180px; justify-content: center; min-height: 48px; }

.pause-bar { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--amber-line); background: var(--amber-bg); flex-wrap: wrap; }
.pause-ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #F5B23E; color: #3B2A00; font-size: 20px; }
.pause-pick { display: flex; justify-content: flex-start; }

.popup-banners { position: sticky; top: 64px; z-index: 25; display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 0; max-width: 1100px; margin: 0 auto; }
.popup-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; box-shadow: var(--sh-2); color: #fff; animation: pop-in .35s var(--ease); }
.popup-banner button { border: 0; background: rgba(255, 255, 255, .18); color: #fff; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.tone-info { --t1: #3B47D6; --t2: #6A72F0; } .tone-celebrate { --t1: #0B8A64; --t2: #10B48A; }
.tone-important { --t1: #C2550F; --t2: #F08A24; } .tone-urgent { --t1: #B8323C; --t2: #E5484D; }
.popup-banner { background: linear-gradient(135deg, var(--t1), var(--t2)); }
.popup-bg { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(15, 17, 36, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in .2s ease; }
.popup-card { width: min(460px, 100%); background: var(--card); border-radius: 26px; padding: 26px 24px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: var(--sh-3); border-top: 6px solid var(--t1); animation: pop-in .45s cubic-bezier(.2, 1.3, .4, 1); }
.popup-card h2 { margin: 4px 0 0; font-size: 21px; }
.popup-card p { margin: 0; white-space: pre-wrap; line-height: 1.9; }
.popup-card .btn { margin-top: 10px; min-width: 200px; }
.popup-ico { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; font-size: 30px; color: #fff; background: linear-gradient(135deg, var(--t1), var(--t2)); box-shadow: 0 10px 24px -10px var(--t1); }
.popup-from { color: var(--muted); }
.popup-bg.full { background: linear-gradient(160deg, var(--t1, #3B47D6), #0F1124); }
.popup-bg.full .popup-card { width: min(640px, 100%); padding: 40px 28px; }
.popup-bg.full .popup-card h2 { font-size: 28px; }

.rank-stat { display: flex; flex-direction: column; gap: 6px; }
.rank-line { display: flex; flex-direction: column; gap: 3px; }
.rank-bar { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #10B48A, var(--brand)); }

.perf-nav .btn { min-height: 32px; width: 32px; padding: 0; justify-content: center; }
.perf-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.perf-big { display: flex; flex-direction: column; gap: 0; padding: 10px 12px; border-radius: 14px; background: var(--soft-2); border: 1px solid var(--line-2); }
.perf-big b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.5; }
.perf-hl { display: flex; flex-wrap: wrap; gap: 6px; }
.perf-hl span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: var(--ok-bg); color: var(--ok-ink); font-size: 12.5px; font-weight: 700; }
.perf-ivs { display: flex; flex-direction: column; gap: 6px; }
.perf-iv { border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); overflow: hidden; }
.perf-iv.now { border-color: var(--brand-line); box-shadow: inset 3px 0 0 var(--brand); }
.perf-iv.future { opacity: .55; }
.perf-iv-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; text-align: start; color: var(--ink); font: inherit; cursor: pointer; }
.perf-iv-head:disabled { cursor: default; }
.perf-idx { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; background: var(--soft); flex: none; }
.perf-cat { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.perf-warn { font-size: 11px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border-radius: 99px; padding: 0 7px; white-space: nowrap; }
.perf-cheer { color: #10B48A; }
.perf-bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.perf-bar i { display: block; height: 100%; background: linear-gradient(90deg, #10B48A, var(--brand)); border-radius: 99px; }
.perf-iv-body { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.perf-dis { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.perf-dis span { display: inline-flex; align-items: center; gap: 4px; }
.perf-note { font-size: 13px; padding: 6px 10px; border-radius: 10px; background: var(--soft-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.perf-note.ok { background: var(--ok-bg); color: var(--ok-ink); } .perf-note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.perf-iv-body .btn { align-self: flex-start; }
.perf-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 92px; padding-top: 6px; }
.perf-day { display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 10px; padding: 2px; }
.perf-day.on { color: var(--brand-ink); background: var(--brand-soft); }
.perf-col { flex: 1; width: 60%; display: flex; align-items: flex-end; }
.perf-col i { display: block; width: 100%; min-height: 3px; border-radius: 6px 6px 3px 3px; background: color-mix(in srgb, var(--brand) 40%, var(--card)); }
.perf-day.on .perf-col i { background: var(--brand); }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.sound-list { display: flex; flex-direction: column; gap: 4px; }
.sound-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--soft-2); }
.sound-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--card); color: var(--muted); }
.sound-row.on .sound-ico { color: var(--brand-ink); }
.switch { width: 46px; height: 28px; border-radius: 99px; border: 0; background: var(--field); position: relative; cursor: pointer; flex: none; transition: background-color .2s; }
.switch i { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch.on { background: #10B48A; }
.switch.on i { transform: translateX(-18px); }

.fx-hero { display: flex; align-items: center; gap: 16px; }
.fx-steps { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; background: var(--soft-2); }
.fx-step { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.fx-n { width: 24px; height: 24px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.fx-loss { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.fx-loss b { color: var(--bad-ink); font-variant-numeric: tabular-nums; }
.fx-loss-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.fx-loss-bar i { display: block; height: 100%; background: linear-gradient(90deg, #F5B23E, #EC7457); border-radius: 99px; }
.fx-tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--amber-bg); color: var(--ink); font-size: 13.5px; }
.fx-tip .i { color: var(--amber); font-size: 20px; }

.self-cam { position: relative; border-radius: 16px; overflow: hidden; background: #121530; aspect-ratio: 4 / 3; max-width: 320px; }
.self-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.self-badge { position: absolute; bottom: 8px; inset-inline-start: 8px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(15, 17, 36, .7); color: #fff; }
.self-badge.ok { background: #10B48A; }
.self-check { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 14px; background: var(--brand-soft); border: 1.5px solid var(--brand-line); animation: pop-in .35s var(--ease); }
@media (prefers-reduced-motion: reduce) { .badge.won svg, .medal-pop-in, .cheer-pop, .popup-card, .ask-card2 { animation: none !important; } }

/* ---------- guided tour ---------- */
.tour { position: fixed; inset: 0; z-index: 120; }
.tour-shade { position: absolute; inset: 0; background: rgba(15, 17, 36, .62); transition: clip-path .3s var(--ease); }
.tour-ring { position: absolute; border-radius: 14px; box-shadow: 0 0 0 3px #F5B23E, 0 0 0 9px rgba(245, 178, 62, .28); pointer-events: none; transition: top .3s var(--ease), left .3s var(--ease), width .3s var(--ease), height .3s var(--ease); animation: tour-pulse 1.8s ease-in-out infinite; }
@keyframes tour-pulse { 50% { box-shadow: 0 0 0 3px #F5B23E, 0 0 0 14px rgba(245, 178, 62, .12); } }
.tour-bubble { position: absolute; background: var(--card); color: var(--ink); border-radius: 20px; padding: 16px 16px 14px; box-shadow: var(--sh-3); display: flex; flex-direction: column; gap: 6px; animation: pop-in .3s var(--ease); }
.tour-top { display: flex; align-items: center; justify-content: space-between; }
.tour-n { font-size: 12px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 99px; padding: 1px 10px; }
.tour-x { border: 0; background: none; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.tour-title { font-size: 16px; }
.tour-text { margin: 0; font-size: 14px; line-height: 1.9; }
.tour-tip { margin: 0; font-size: 13px; padding: 8px 10px; border-radius: 12px; background: var(--amber-bg); display: flex; gap: 6px; align-items: flex-start; }
.tour-dots { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--line); transition: width .2s; }
.tour-dots i.on { width: 18px; background: var(--brand); }
.tour-nav { display: flex; justify-content: space-between; gap: 8px; }
.tour-nav .btn.primary { margin-inline-start: auto; }
.help-tour-btn { width: 100%; justify-content: center; margin: 4px 0 8px; }

/* ---------- supervisor tools ---------- */
.cheer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cheer-tile { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: start; cursor: pointer; font: inherit; transition: border-color .15s, background-color .15s, transform .1s; }
.cheer-tile:hover { border-color: color-mix(in srgb, #10B48A 50%, var(--line)); background: var(--ok-bg); }
.cheer-tile:active { transform: scale(.98); }
.cheer-tile-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #F5B23E, #EC7457); color: #fff; flex: none; }
.cheer-tile-t { font-size: 12.5px; line-height: 1.6; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cheer-del { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: none; place-items: center; color: var(--muted); font-size: 12px; }
.cheer-tile:hover .cheer-del { display: grid; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; font-size: 18px; }
.icon-pick button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ask-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.dispute { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--soft-2); }
.dispute-text { font-size: 13.5px; padding: 6px 10px; border-radius: 10px; background: var(--card); }
.popup-item { padding: 8px 0; border-bottom: 1px solid var(--line-2); gap: 8px; }
.muted-sounds { display: flex; align-items: center; gap: 4px; }
.range-pick { flex-wrap: wrap; }
.plan-week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.plan-day { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; background: var(--soft-2); border: 1px solid var(--line-2); min-width: 0; }
.plan-day.today { border-color: var(--brand-line); background: var(--brand-soft); }
.plan-day-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.plan-chip { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 10px; background: var(--card); box-shadow: inset 3px 0 0 var(--c); font-size: 12.5px; }
.modal:has(.plan-week) { max-width: 1180px; width: min(1180px, 96vw); }
@media (max-width: 900px) { .plan-week { grid-template-columns: 1fr; } }
.time-in { width: 92px !important; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- student stopwatch ---------- */
.stopwatch { gap: 6px; }
.sw-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sw-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.stopwatch.live .sw-label { color: var(--ok-ink); }
.sw-dot { width: 8px; height: 8px; border-radius: 50%; background: #10B48A; box-shadow: 0 0 0 0 rgba(16, 180, 138, .6); animation: sw-pulse 1.6s ease-out infinite; }
@keyframes sw-pulse { 70% { box-shadow: 0 0 0 8px rgba(16, 180, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 180, 138, 0); } }
.sw-time { font-size: clamp(34px, 7vw, 44px); font-weight: 900; line-height: 1.15; letter-spacing: 1px; font-variant-numeric: tabular-nums; color: var(--stu-ink, var(--ink)); direction: ltr; text-align: center; }
.stopwatch.live .sw-time { color: var(--ok-ink); }
.sw-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-left { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.sw-left b { font-variant-numeric: tabular-nums; direction: ltr; font-weight: 800; }
.sw-left.done { color: var(--ok-ink); font-weight: 700; }
.stopwatch .stu-target-bar i { transition: width 1s linear; }
@media (prefers-reduced-motion: reduce) { .sw-dot { animation: none; } }

/* =====================================================================
   PERFORMANCE: no blur behind sticky/overlay layers, no fixed background (both force the browser to repaint the
   whole page on every scroll), no endless filter animations. Same look, a fraction of the work.
   ===================================================================== */
body { background: var(--bg); background-attachment: scroll; }
.topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--card) 96%, var(--bg)); }
.modal-bg, .ci-backdrop, .popup-bg { -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal-bg { background: rgba(15, 17, 36, .5); }
.toast, .tile .seat, .login-page.aurora .login, .login-page.photo .login { -webkit-backdrop-filter: none; backdrop-filter: none; }
.badge.won svg { animation: none; }
.badge svg { filter: none; }
.badge.won { filter: drop-shadow(0 3px 6px rgba(27, 30, 60, .16)); }
.away-ico { animation: none; }
.tour-ring { animation: none; }
.tile { contain: layout paint; }
/* A dialog's own parts never shrink (the tab bar used to collapse to a thin line in tall dialogs). */
.modal > * { flex-shrink: 0; }
.modal-tabs { top: 0; position: relative; }
.row-menu { z-index: 95; max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
.row-menu-bg { z-index: 94; }
.row-menu button { min-height: 42px; white-space: normal; text-align: start; line-height: 1.6; }

/* =====================================================================
   PHONES: tables keep each value on one line and scroll sideways (instead of squeezing words into towers);
   the students list becomes one card per student.
   ===================================================================== */
@media (max-width: 700px) {
  .table-wrap { position: relative; }
  .table-wrap > table.t th, .table-wrap > table.t td { white-space: nowrap; }
  .table-wrap > table.t td.wrap, .table-wrap > table.t td .wrap-ok { white-space: normal; }
  table.t th, table.t td { padding: 9px 10px; }

  .card.pad-0:has(> .table-wrap > .stu-table) { background: transparent; border: 0; box-shadow: none; }
  .table-wrap:has(> .stu-table) { overflow: visible; }
  .stu-table, .stu-table tbody { display: block; width: 100%; }
  .stu-table thead { display: none; }
  .stu-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--sh-1); }
  .stu-table tr.is-new { border-color: var(--ok-line); box-shadow: inset 4px 0 0 var(--ok), var(--sh-1); }
  .stu-table tr.sel { border-color: var(--brand-line); }
  .stu-table td { display: block; padding: 0 !important; border: 0 !important; background: none !important; white-space: normal !important; min-width: 0; }
  .stu-table tr.is-new td:first-child { box-shadow: none; }
  .stu-table td:first-child { grid-column: 1 / -1; }
  .stu-table td.sticky-act { position: static; box-shadow: none; grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 6px !important; border-top: 1px solid var(--line-2) !important; }
  .stu-table td.sticky-act .row-actions { width: 100%; justify-content: space-between; display: flex; }
  .stu-table td.sticky-act .btn.primary { flex: 1; justify-content: center; }
  .stu-table td:empty { display: none; }
  .stu-table tr > td[colspan] { grid-column: 1 / -1; }
}

/* ---------- one page for a student's subscription and money ---------- */
.hub-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.hub-sum-item { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--soft-2); border: 1px solid var(--line-2); }
.hub-part { border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.hub-part > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 800; cursor: pointer; border-radius: 16px; }
.hub-part > summary::-webkit-details-marker { display: none; }
.hub-part > summary::after { content: ''; margin-inline-start: auto; width: 8px; height: 8px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.hub-part[open] > summary::after { transform: rotate(-135deg); }
.hub-part[open] > summary { border-bottom: 1px solid var(--line-2); border-radius: 16px 16px 0 0; }
.hub-part > .embedded { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.modal:has(.hub-part) { max-width: 720px; }

/* birth date: three compact selects that never overflow */
.birth-in { flex-wrap: nowrap; }
.birth-in .input { min-width: 0; flex: 1 1 0; padding-inline: 6px; }
.birth-in .input:nth-child(2) { flex: 1.5 1 0; }

/* =====================================================================
   ONLINE CLASS (class.<domain>) — its own dark, calm stage so faces and
   shared screens carry the colour; controls float in one pill.
   ===================================================================== */
.cls-shell, .cls-room {
  --c-bg: #0A0F1E; --c-surface: #121933; --c-tile: #19213D; --c-raise: #222B4A; --c-line: rgba(255, 255, 255, .09);
  --c-text: #EDF0F8; --c-muted: #98A3C0; --c-accent: #4C7DFF; --c-accent-ink: #fff; --c-red: #E5484D; --c-amber: #F2B53D; --c-green: #34C77B;
  color-scheme: dark; background: var(--c-bg); color: var(--c-text); font-family: inherit;
}
.cls-shell { min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 85% -10%, #1A2550 0%, transparent 60%), var(--c-bg); }
.cls-shell .spinner, .cls-room .spinner { border-color: rgba(255,255,255,.15); border-top-color: var(--c-accent); }
.cls-entry-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; font-weight: 800; letter-spacing: -.01em; }
.cls-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--c-accent); color: #fff; font-size: 18px; }
.cls-entry { flex: 1; display: grid; place-items: center; padding: 12px 16px 32px; }
.cls-loading { display: flex; gap: 10px; align-items: center; color: var(--c-muted); }
.cls-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 22px; padding: 26px; box-shadow: 0 30px 80px -40px rgba(0,0,0,.7); }
.cls-card h1 { font-size: 26px; line-height: 1.35; margin: 6px 0 4px; letter-spacing: -.02em; }
.cls-sub { color: var(--c-muted); margin: 4px 0; font-size: 14px; line-height: 1.8; }
.cls-sub.small { font-size: 12.5px; }
.cls-err { color: #FF8C8F; font-size: 13.5px; margin: 8px 0 0; line-height: 1.7; }
.cls-notice { max-width: 440px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cls-notice-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--c-raise); font-size: 26px; color: var(--c-accent); }
.cls-lobby { width: min(1060px, 100%); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 22px; align-items: center; }
.cls-join { display: flex; flex-direction: column; gap: 10px; }
.cls-kind { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--c-accent); background: rgba(76,125,255,.12); padding: 4px 10px; border-radius: 99px; }
.cls-live { display: flex; align-items: center; gap: 8px; color: var(--c-green); font-weight: 700; font-size: 14px; margin: 2px 0; }
.cls-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 0 0 rgba(52,199,123,.6); animation: cls-ping 1.8s infinite; }
@keyframes cls-ping { 70% { box-shadow: 0 0 0 9px rgba(52,199,123,0); } 100% { box-shadow: 0 0 0 0 rgba(52,199,123,0); } }
.cls-as { display: flex; align-items: center; gap: 8px; background: var(--c-raise); padding: 10px 12px; border-radius: 12px; margin: 4px 0; font-size: 14px; }
.cls-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--c-muted); }
.cls-field input, .cls-field select, .cls-chat-box select, .cls-chat-box textarea, .cls-devs select {
  background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 15px; outline: none; min-width: 0;
}
.cls-field input:focus, .cls-field select:focus, .cls-chat-box textarea:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(76,125,255,.25); }
.cls-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--c-muted); }
.cls-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--c-line); background: var(--c-raise); color: var(--c-text); border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: background .15s, transform .1s; }
.cls-btn:hover:not(:disabled) { background: #2B3559; }
.cls-btn:active:not(:disabled) { transform: translateY(1px); }
.cls-btn:disabled { opacity: .5; cursor: not-allowed; }
.cls-btn.primary { background: var(--c-accent); border-color: transparent; color: var(--c-accent-ink); }
.cls-btn.primary:hover:not(:disabled) { background: #3D6CF0; }
.cls-btn.danger { background: var(--c-red); border-color: transparent; color: #fff; }
.cls-btn.ghost { background: transparent; }
.cls-btn.big { padding: 14px 18px; font-size: 16px; border-radius: 14px; margin-top: 4px; }
.cls-btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.cls-shell :focus-visible, .cls-room :focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.cls-seg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cls-seg button { flex: 1 1 auto; border: 1px solid var(--c-line); background: var(--c-bg); color: var(--c-muted); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cls-seg button.on { background: var(--c-accent); color: #fff; border-color: transparent; }
.cls-seg.three button { flex: 1 1 0; }
.cls-min { width: 64px; text-align: center; background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-line); border-radius: 10px; padding: 9px; font: inherit; }
.cls-unit { color: var(--c-muted); font-size: 13px; }
.cls-login { display: flex; flex-direction: column; gap: 10px; }

/* preview */
.cls-preview { display: flex; flex-direction: column; gap: 10px; }
.cls-preview-video { position: relative; aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; background: #050812; border: 1px solid var(--c-line); }
.cls-preview.compact .cls-preview-video { aspect-ratio: 4 / 3; }
.cls-preview-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cls-shell video.mirror, .cls-room video.mirror { transform: scaleX(-1); }
.cls-preview-off { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: var(--c-muted); text-align: center; padding: 24px; font-size: 14px; line-height: 1.8; }
.cls-preview-off > :first-child { font-size: 34px; }
.cls-preview-bar { position: absolute; inset-inline: 0; bottom: 14px; display: flex; justify-content: center; gap: 12px; }
.cls-devs { display: flex; gap: 8px; flex-wrap: wrap; }
.cls-devs label { flex: 1 1 200px; display: flex; align-items: center; gap: 8px; color: var(--c-muted); }
.cls-devs select { flex: 1; padding: 9px 10px; font-size: 13px; }
.cls-waiting { align-items: center; text-align: center; }
.cls-pulse { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: rgba(76,125,255,.14); color: var(--c-accent); animation: cls-breathe 2.4s ease-in-out infinite; }
@keyframes cls-breathe { 50% { transform: scale(1.08); background: rgba(76,125,255,.24); } }

/* round control buttons */
.cls-round { position: relative; width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 21px; background: var(--c-raise); color: var(--c-text); cursor: pointer; transition: background .15s, transform .1s; flex: none; }
.cls-round:hover:not(:disabled) { background: #2E3960; }
.cls-round:active:not(:disabled) { transform: scale(.95); }
.cls-round.off { background: var(--c-red); color: #fff; }
.cls-round.off.locked { background: #3A2430; color: #FF9EA1; }
.cls-round.on { background: #D7E2FF; color: #10204D; }
.cls-round em, .cls-side-btn em, .cls-tabs em, .cls-pop em { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--c-amber); color: #241500; font-size: 11px; font-weight: 800; font-style: normal; display: grid; place-items: center; }
.cls-pop em, .cls-tabs em { position: static; display: inline-grid; margin-inline-start: 6px; }
.cls-level { position: absolute; inset-inline-end: 9px; bottom: 11px; width: 4px; height: 16px; border-radius: 2px; background: var(--c-green); transform-origin: bottom; transition: transform .08s; }
.cls-mini { width: 32px; height: 32px; border-radius: 10px; border: 0; background: rgba(10,15,30,.55); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 15px; }
.cls-mini:hover { background: rgba(10,15,30,.8); }

/* room layout */
.cls-room { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; overflow: hidden; }
.cls-room.with-panel { grid-template-columns: minmax(0, 1fr) 360px; }
.cls-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px 8px; min-height: 58px; }
.cls-top-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cls-top-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cls-topic { color: var(--c-muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cls-top-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.cls-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: var(--c-raise); color: var(--c-muted); font-size: 12.5px; font-weight: 700; }
.cls-chip.warn { color: var(--c-amber); } .cls-chip.bad { color: #FF8C8F; }
.cls-timer { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-text); border-radius: 99px; padding: 6px 14px 6px 12px; font: inherit; cursor: pointer; }
.cls-timer:disabled { cursor: default; }
.cls-time { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cls-timer small { color: var(--c-muted); font-size: 12px; }
.cls-timer.over { border-color: rgba(242,181,61,.5); } .cls-timer.over small { color: var(--c-amber); }
.cls-rec { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); }
.cls-timer.over .cls-rec { background: var(--c-amber); }
.cls-banner { grid-column: 1 / -1; margin: 0 18px 8px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #2A2F52; color: var(--c-text); border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: start; }
.cls-banner.bad { background: #3A1E26; cursor: default; }
.cls-banner .cls-btn { margin-inline-start: auto; }
.cls-stage { grid-row: 4; grid-column: 1; position: relative; min-height: 0; padding: 4px 18px 0; display: flex; }
.cls-panel { grid-row: 2 / 5; grid-column: 2; margin: 0 18px 0 0; margin-inline: 0 18px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 20px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cls-room.with-panel .cls-panel { margin-inline-start: 0; }

/* tiles */
.cls-tile { position: relative; background: var(--c-tile); border-radius: 18px; overflow: hidden; min-width: 0; min-height: 0; isolation: isolate; outline: 2px solid transparent; transition: outline-color .15s; }
.cls-tile.speaking { outline-color: var(--c-accent); box-shadow: 0 0 0 4px rgba(76,125,255,.25); }
.cls-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cls-screen video { object-fit: contain; background: #050812; }
.cls-tile-off { position: absolute; inset: 0; display: grid; place-items: center; }
.cls-avatar { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; flex: none; text-transform: uppercase; }
.cls-avatar.sm { width: 34px; height: 34px; font-size: 13px; background: var(--c-raise); }
.cls-tile-name { position: absolute; bottom: 10px; inset-inline-start: 10px; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px; background: rgba(7,11,24,.62); font-size: 13px; font-weight: 700; z-index: 2; }
.cls-tile-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cls-tile-name em { font-style: normal; font-size: 11px; font-weight: 800; color: #C7D6FF; background: rgba(76,125,255,.3); padding: 1px 7px; border-radius: 6px; }
.cls-tile-name > svg, .cls-tile-name > .icon { flex: none; }
.cls-tile.small .cls-tile-name { bottom: 6px; inset-inline-start: 6px; font-size: 11.5px; padding: 3px 7px; }
.cls-tile-hand { position: absolute; top: 10px; inset-inline-start: 10px; width: 34px; height: 34px; border-radius: 11px; background: var(--c-amber); color: #241500; display: grid; place-items: center; font-size: 18px; z-index: 2; animation: cls-wave 1.2s ease-in-out 2; }
@keyframes cls-wave { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.cls-tile-net { position: absolute; top: 10px; inset-inline-end: 10px; color: var(--c-amber); z-index: 2; }
.cls-tile-tools { position: absolute; top: 8px; inset-inline-end: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; z-index: 3; }
.cls-tile:hover .cls-tile-tools, .cls-tile:focus-within .cls-tile-tools, .cls-tile-tools.on { opacity: 1; }
@media (hover: none) { .cls-tile-tools { opacity: 1; } }
.cls-eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 13px; }
.cls-eq i { width: 3px; background: var(--c-accent); border-radius: 2px; animation: cls-eq .8s ease-in-out infinite; }
.cls-eq i:nth-child(2) { animation-delay: .15s; } .cls-eq i:nth-child(3) { animation-delay: .3s; }
@keyframes cls-eq { 0%, 100% { height: 4px; } 50% { height: 13px; } }
.cls-mine { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; text-align: center; padding: 20px; background: repeating-linear-gradient(135deg, #141B33 0 14px, #17203C 14px 28px); }
.cls-mine > :first-child { font-size: 34px; color: var(--c-accent); }
.cls-more { border: 0; color: var(--c-text); font: inherit; font-weight: 800; font-size: 18px; cursor: pointer; display: grid; place-items: center; }

.cls-grid { flex: 1; display: grid; gap: 12px; grid-auto-rows: minmax(0, 1fr); min-height: 0; }
.cls-grid.n1 { grid-template-columns: 1fr; }
.cls-grid.n2, .cls-grid.n3, .cls-grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cls-grid.n5, .cls-grid.n6, .cls-grid.n7, .cls-grid.n8, .cls-grid.n9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cls-grid.n10, .cls-grid.n11, .cls-grid.n12, .cls-grid.n13 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cls-grid.n1 .cls-tile { max-width: 1100px; width: 100%; justify-self: center; }
.cls-alone { position: absolute; inset-inline: 0; bottom: 26px; margin: auto; width: fit-content; max-width: calc(100% - 40px); display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 14px; background: rgba(18,25,51,.9); border: 1px solid var(--c-line); font-size: 14px; flex-wrap: wrap; justify-content: center; }
.cls-duo { flex: 1; position: relative; display: flex; min-height: 0; }
.cls-duo > .cls-tile { flex: 1; }
.cls-pip { position: absolute; bottom: 14px; inset-inline-end: 14px; width: clamp(150px, 22vw, 280px); aspect-ratio: 16 / 10; z-index: 4; border-radius: 16px; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.cls-pip .cls-tile { width: 100%; height: 100%; }
.cls-stage-main { flex: 1; display: flex; gap: 12px; min-height: 0; min-width: 0; }
.cls-screens { flex: 1; display: grid; gap: 12px; min-width: 0; min-height: 0; }
.cls-screens.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cls-strip { width: 220px; flex: none; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-width: thin; }
.cls-strip .cls-tile { aspect-ratio: 16 / 10; flex: none; }

/* floating reactions and toasts */
.cls-floats { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.cls-float { position: absolute; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 34px; color: var(--c-amber); animation: cls-rise 2.6s ease-out forwards; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
.cls-float small { font-size: 11px; color: var(--c-text); background: rgba(7,11,24,.7); padding: 1px 7px; border-radius: 6px; }
@keyframes cls-rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translateY(-20px) scale(1.1); } 100% { transform: translateY(-62vh) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cls-float { animation-duration: 1.2s; } .cls-live i, .cls-pulse, .cls-eq i, .cls-tile-hand { animation: none; } }
.cls-toasts { position: absolute; top: 10px; inset-inline: 0; margin: auto; width: min(440px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; z-index: 8; pointer-events: none; }
.cls-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; background: #1F2849; border: 1px solid var(--c-line); box-shadow: 0 12px 30px rgba(0,0,0,.4); font-size: 13.5px; line-height: 1.7; animation: cls-in .2s ease-out; }
.cls-toast span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cls-toast button { border: 0; background: transparent; color: #9DB7FF; font: inherit; font-weight: 800; cursor: pointer; padding: 4px 6px; }
@keyframes cls-in { from { transform: translateY(-6px); opacity: 0; } }

/* bottom bar */
.cls-bar { grid-row: 5; grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 12px 18px 14px; }
.cls-bar-main { display: flex; align-items: center; gap: 10px; }
.cls-bar-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cls-bar-side.end { justify-content: flex-end; }
.cls-bar-info { color: var(--c-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cls-leave { width: 64px; height: 50px; border-radius: 25px; border: 0; background: var(--c-red); color: #fff; font-size: 21px; display: grid; place-items: center; cursor: pointer; }
.cls-leave:hover { background: #D63A40; }
.cls-side-btn { position: relative; height: 44px; min-width: 44px; padding: 0 12px; border-radius: 22px; border: 0; background: transparent; color: var(--c-text); display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; cursor: pointer; font-size: 18px; }
.cls-side-btn span { font-size: 13px; }
.cls-side-btn:hover, .cls-side-btn.on { background: var(--c-raise); }
.cls-pop-wrap { position: relative; }
.cls-pop { position: absolute; bottom: calc(100% + 10px); inset-inline-start: 50%; transform: translateX(50%); z-index: 30; background: #1C2442; border: 1px solid var(--c-line); border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.5); padding: 6px; }
.cls-pop.react { display: flex; gap: 4px; padding: 6px; }
.cls-pop.react button, .cls-pop-react button { width: 46px; height: 46px; border-radius: 12px; border: 0; background: transparent; color: var(--c-amber); font-size: 24px; display: grid; place-items: center; cursor: pointer; }
.cls-pop.react button:hover, .cls-pop-react button:hover { background: var(--c-raise); transform: translateY(-2px); }
.cls-pop.list { display: flex; flex-direction: column; min-width: 250px; }
.cls-pop.list.end { inset-inline-start: auto; inset-inline-end: 0; transform: none; }
.cls-pop.list > button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--c-text); font: inherit; font-size: 14px; padding: 11px 12px; border-radius: 10px; cursor: pointer; text-align: start; }
.cls-pop.list > button:hover { background: var(--c-raise); }
.cls-pop.list > button.danger { color: #FF8C8F; }
.cls-pop.person { position: fixed; bottom: auto; transform: none; inset-inline-start: auto; width: 260px; }
.cls-pop-title { padding: 8px 12px 6px; font-weight: 800; font-size: 13px; color: var(--c-muted); }
.cls-pop-react { display: flex; justify-content: space-between; padding: 4px 2px; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); margin: 4px 0; }
.cls-pop-react button { width: 38px; height: 38px; font-size: 20px; }
.cls-scrim { position: fixed; inset: 0; z-index: 20; }
.narrow-only { display: none !important; }

/* side panel */
.cls-panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--c-line); }
.cls-tabs { flex: 1; display: flex; gap: 4px; }
.cls-tabs button { flex: 1; border: 0; background: transparent; color: var(--c-muted); font: inherit; font-weight: 800; font-size: 13.5px; padding: 9px 6px; border-radius: 10px; cursor: pointer; }
.cls-tabs button.on { background: var(--c-raise); color: var(--c-text); }
.cls-panel .cls-mini { background: transparent; color: var(--c-muted); }
.cls-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cls-chat-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cls-empty { color: var(--c-muted); font-size: 13.5px; line-height: 1.8; text-align: center; margin: 30px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cls-empty.small { margin: 12px; font-size: 12.5px; }
.cls-msg { max-width: 92%; align-self: flex-start; background: var(--c-raise); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.cls-msg.mine { align-self: flex-end; background: #233C86; border-radius: 14px 14px 4px 14px; }
.cls-msg.private { box-shadow: inset 0 0 0 1px rgba(242,181,61,.45); }
.cls-msg-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-muted); flex-wrap: wrap; }
.cls-msg-head b { color: var(--c-text); font-size: 12.5px; }
.cls-msg-head em { font-style: normal; font-size: 10.5px; color: #C7D6FF; background: rgba(76,125,255,.25); padding: 0 6px; border-radius: 5px; }
.cls-msg-head time { margin-inline-start: auto; font-size: 11px; }
.cls-msg-to { color: var(--c-amber); display: inline-flex; align-items: center; gap: 3px; }
.cls-msg p { margin: 4px 0 0; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.cls-chat-box { border-top: 1px solid var(--c-line); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.cls-chat-box select { padding: 8px 10px; font-size: 13px; }
.cls-chat-row { display: flex; gap: 8px; align-items: flex-end; }
.cls-chat-row textarea { flex: 1; resize: none; max-height: 120px; font-size: 14px; padding: 10px 12px; }
.cls-send { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--c-accent); color: #fff; display: grid; place-items: center; font-size: 18px; cursor: pointer; flex: none; }
.cls-send:disabled { opacity: .4; cursor: default; }
.cls-send svg, .cls-send .icon { transform: scaleX(-1); }
.cls-people, .cls-settings { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.cls-group-head { display: flex; align-items: center; gap: 8px; padding: 12px 4px 6px; font-size: 13px; color: var(--c-muted); }
.cls-group-head b { color: var(--c-text); }
.cls-group-head .cls-btn { margin-inline-start: auto; }
.cls-wait-box { background: rgba(242,181,61,.08); border: 1px solid rgba(242,181,61,.25); border-radius: 14px; padding: 0 8px 8px; margin: 4px 0 6px; }
.cls-person { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 10px; }
.cls-person:hover { background: rgba(255,255,255,.03); }
.cls-person-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cls-person-name em { font-style: normal; font-size: 10.5px; font-weight: 800; color: #C7D6FF; background: rgba(76,125,255,.25); padding: 1px 6px; border-radius: 5px; }
.cls-person-icons { display: flex; gap: 6px; color: var(--c-muted); font-size: 14px; }
.cls-settings section { padding: 6px 4px 12px; border-bottom: 1px solid var(--c-line); }
.cls-settings section:last-child { border-bottom: 0; }
.cls-settings h3 { font-size: 13px; color: var(--c-muted); margin: 10px 0 8px; font-weight: 800; }
.cls-toggle { display: flex; align-items: center; gap: 12px; padding: 9px 2px; cursor: pointer; position: relative; }
.cls-toggle > span { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.cls-toggle small { color: var(--c-muted); font-size: 12px; line-height: 1.6; }
.cls-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cls-toggle i { width: 42px; height: 24px; border-radius: 12px; background: #2B3355; position: relative; flex: none; transition: background .15s; }
.cls-toggle i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.cls-toggle input:checked + i { background: var(--c-accent); }
.cls-toggle input:checked + i::after { inset-inline-start: 21px; }
.cls-toggle input:focus-visible + i { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.cls-link { width: 100%; display: flex; align-items: center; gap: 8px; border: 1px solid var(--c-line); background: var(--c-bg); color: var(--c-text); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 13px; cursor: pointer; margin-bottom: 8px; }
.cls-link span { flex: 1; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-link.muted { color: var(--c-muted); }

/* modal */
.cls-modal-bg { position: fixed; inset: 0; background: rgba(4,7,16,.6); display: grid; place-items: center; z-index: 50; padding: 16px; }
.cls-modal { width: min(460px, 100%); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.cls-modal h2 { margin: 0; font-size: 20px; }
.cls-modal-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.cls-modal-act .big { flex: 1; }

/* tablets */
@media (max-width: 1100px) {
  .cls-room.with-panel { grid-template-columns: minmax(0, 1fr) 320px; }
  .cls-strip { width: 170px; }
}
/* phones: one-hand bar, panels as bottom sheets, stacked screens */
@media (max-width: 760px) {
  .cls-lobby { grid-template-columns: 1fr; gap: 14px; }
  .cls-card { padding: 20px; border-radius: 20px; }
  .cls-card h1 { font-size: 22px; }
  .cls-entry { place-items: start center; padding-top: 4px; }
  .cls-room, .cls-room.with-panel { grid-template-columns: minmax(0, 1fr); }
  .cls-top { padding: 10px 12px 6px; min-height: 50px; }
  .cls-top-title { flex-direction: column; gap: 0; align-items: flex-start; }
  .cls-top-title b { font-size: 14.5px; max-width: 46vw; }
  .cls-topic { font-size: 12px; max-width: 46vw; }
  .cls-timer { padding: 5px 10px; gap: 6px; }
  .cls-timer small { display: none; }
  .cls-time { font-size: 15px; }
  .cls-top-tools .cls-btn { padding: 8px 12px; font-size: 13px; }
  .cls-banner { margin: 0 12px 6px; font-size: 13px; }
  .cls-stage { padding: 2px 8px 0; }
  .cls-grid { gap: 8px; }
  .cls-grid.n2 { grid-template-columns: 1fr; }
  .cls-grid.n3, .cls-grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cls-grid.n5, .cls-grid.n6, .cls-grid.n7, .cls-grid.n8, .cls-grid.n9, .cls-grid.n10, .cls-grid.n11, .cls-grid.n12, .cls-grid.n13 { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-y: auto; grid-auto-rows: minmax(120px, 1fr); }
  .cls-tile { border-radius: 14px; }
  .cls-pip { width: 104px; aspect-ratio: 3 / 4; bottom: 10px; inset-inline-end: 10px; border-radius: 14px; }
  .cls-pip .cls-tile-name span { display: none; }
  .cls-stage-main { flex-direction: column; gap: 8px; }
  .cls-screens.n2 { grid-template-columns: 1fr; grid-auto-rows: minmax(0, 1fr); }
  .cls-strip { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 8px; height: 92px; }
  .cls-strip .cls-tile { width: 132px; height: 100%; aspect-ratio: auto; }
  .cls-bar { grid-template-columns: 1fr; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); }
  .cls-bar-side { display: none; }
  .cls-bar-main { justify-content: space-evenly; gap: 6px; }
  .cls-round { width: 48px; height: 48px; font-size: 20px; }
  .cls-leave { width: 58px; height: 48px; }
  .wide-only { display: none !important; }
  .narrow-only { display: flex !important; }
  .cls-pop.list { position: fixed; inset: auto 8px calc(78px + env(safe-area-inset-bottom)) 8px; transform: none; min-width: 0; }
  .cls-pop.person { inset: auto 8px calc(78px + env(safe-area-inset-bottom)) 8px !important; top: auto !important; left: auto !important; width: auto; }
  .cls-panel { position: fixed; inset: auto 0 0 0; height: min(78dvh, 640px); margin: 0; border-radius: 22px 22px 0 0; z-index: 40; box-shadow: 0 -20px 60px rgba(0,0,0,.6); animation: cls-sheet .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  @keyframes cls-sheet { from { transform: translateY(40px); opacity: .4; } }
  .cls-toasts { top: 4px; }
  .cls-alone { bottom: 14px; font-size: 13px; }
}
@media (max-width: 760px) and (orientation: landscape) and (max-height: 500px) {
  .cls-top { display: none; }
  .cls-pip { width: 150px; aspect-ratio: 16 / 10; }
}

/* admin: online classes */
.cls-note { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft, #FFF8F1); color: var(--warn-ink, #9A3412); line-height: 1.9; border: 1px solid color-mix(in srgb, var(--warn-ink, #9A3412) 20%, transparent); }
.cls-ok { color: var(--ok-ink); } .cls-warn { color: var(--warn-ink); } .cls-bad { color: var(--bad-ink); }
.cls-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.cls-room-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.cls-room-card.live { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ok-ink) 45%, transparent); }
.cls-room-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft, #EEF2FF); color: var(--brand); font-size: 19px; flex: none; }
.cls-live-line { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ok-ink); }
.cls-live-line i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: cls-ping 1.8s infinite; }
.cls-links { display: flex; flex-direction: column; gap: 6px; }
.cls-copy { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft-2, #F8FAFC); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cls-copy span { flex: 1; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-copy.muted { color: var(--muted); }
.cls-copy:hover { border-color: var(--brand); }
.cls-kind-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cls-kind-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.cls-kind-pick button > :first-child { font-size: 20px; color: var(--brand); }
.cls-kind-pick button small { color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.cls-kind-pick button.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft, #EEF2FF); }
.cls-slug { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.cls-slug span { padding: 0 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; max-width: 52%; overflow: hidden; text-overflow: ellipsis; }
.cls-slug .input { border: 0; border-radius: 0; flex: 1; min-width: 0; }
.cls-fs { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; margin: 0; min-width: 0; }
.cls-fs legend { font-weight: 800; font-size: 13.5px; padding: 0 6px; }
.cls-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; }
.cls-members { display: flex; flex-wrap: wrap; gap: 6px; max-height: 210px; overflow-y: auto; padding: 2px; }
.cls-members label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.cls-members label.on { border-color: var(--brand); background: var(--brand-soft, #EEF2FF); }
.cls-members input { margin: 0; }
.cls-sess { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cls-sess-head { width: 100%; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 0; background: var(--card); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.cls-sess table { margin: 0; }
@media (max-width: 700px) { .cls-kind-pick { grid-template-columns: 1fr; } .cls-kind-pick button { flex-direction: row; align-items: center; flex-wrap: wrap; } .cls-kind-pick button small { flex-basis: 100%; } }

/* student panel: my classes */
.my-classes { display: flex; flex-direction: column; gap: 10px; }
.my-class { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); }
.my-class.live { border-color: color-mix(in srgb, var(--ok-ink) 45%, transparent); background: color-mix(in srgb, var(--ok-ink) 6%, var(--card)); }
.my-class > div { flex: 1; min-width: 0; }
.my-class b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-class-hist { width: 100%; }
.my-class-hist td { white-space: nowrap; }
@media (hover: none) { .cls-tile .pin-btn { display: none; } }
.class-only-lock { gap: 14px; padding: 26px; }
.class-only-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.class-only-grid > div { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--soft-2, #F8FAFC); border: 1px dashed var(--line); color: var(--muted); }
.class-only-grid > div span { flex: 1; color: var(--text); font-weight: 600; }

/* class.<domain> panels (teachers, counsellors, head of counsellors, class admins, students): the pension's light
   look, under the class site's own header */
.clsp-shell { min-height: 100dvh; background: var(--bg); }
.clsp-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.clsp-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.clsp-brand .cls-mark { background: var(--brand); }
.clsp-who { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; }
.clsp-who > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clsp-main { width: min(1180px, 100%); margin: 0 auto; padding: 20px 16px 48px; }
.clsp-main > .wrap { padding: 0; }
.clsp-signin { max-width: 420px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 12px; padding: 26px; }
.clsp-signin h1 { margin: 0; font-size: 22px; }
.clsp-signin .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.clsp-h2 { font-size: 16px; margin: 6px 0 -4px; }
.clsp-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.clsp-kpis > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.clsp-kpis b { font-size: 24px; font-variant-numeric: tabular-nums; }
.clsp-kpis span { color: var(--muted); font-size: 12.5px; }
.clsp-member { padding: 6px 4px; border-bottom: 1px solid var(--line-2, var(--line)); }
.class-stats td { white-space: nowrap; }
@media (max-width: 600px) { .clsp-head { padding: 10px 12px; } .clsp-who > span { max-width: 40vw; } .clsp-main { padding: 14px 10px 40px; } }
.clsp-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; text-align: start; }
.clsp-hello h1 { margin: 0; text-align: start; }
.clsp-hello .tabs { width: auto; flex: none; margin: 0; }
.clsp-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.clsp-main h1, .clsp-main h2, .clsp-main h3 { text-align: start; }
