:root {
  color-scheme: light;
  --ink: #112343;
  --muted: #64738d;
  --canvas: #f5f8ff;
  --surface: #ffffff;
  --surface-soft: #eef5ff;
  --line: #dbe5f3;
  --brand: #1667e8;
  --brand-deep: #0d2d68;
  --brand-soft: #eaf3ff;
  --orange: #ef7d35;
  --orange-soft: #fff3e9;
  --red: #d84352;
  --shadow: 0 14px 40px rgba(35, 70, 126, .09);
  --radius: 20px;
  --sidebar: 268px;
  font-family: Inter, ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--ink); background: radial-gradient(circle at 86% 0, #e4f1ff 0, transparent 32rem), var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); padding: 0; background: rgba(255,255,255,.95); border-right: 1px solid var(--line); backdrop-filter: blur(18px); display: flex; flex-direction: column; }
.brand { min-height: 142px; display: flex; gap: 13px; align-items: center; padding: 26px 22px; border-bottom: 1px solid var(--line); text-decoration: none; }
.brand-logo { width: 68px; height: 68px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 10px 30px rgba(25,66,131,.14); }
.brand-logo img { display: block; width: 120%; height: 120%; max-width: none; object-fit: contain; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.primary-nav { padding: 15px 13px; display: grid; gap: 4px; overflow-y: auto; }
.nav-label { margin: 10px 12px 5px; color: #95a2b6; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: 9px; }
.nav-link { position: relative; min-height: 44px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 13px; padding: 7px 10px; color: #40516d; background: transparent; text-decoration: none; font-size: 13px; font-weight: 700; cursor: pointer; text-align: left; width: 100%; transition: color .16s ease, background .16s ease, transform .16s ease; }
.nav-link span:first-child { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: currentColor; background: rgba(22,103,232,.08); text-align: center; font-size: 15px; }
.nav-link:hover { color: var(--brand); background: #f0f6ff; transform: translateX(2px); }
.nav-link.active { color: var(--brand); background: var(--brand-soft); }
.nav-link.danger { color: var(--red); }
.sidebar-footer { margin-top: auto; padding: 13px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
/* Route changes focus the main landmark without drawing a page-wide border. */
#main:focus { outline: none; }
.main-content { min-width: 0; min-height: 100vh; margin-left: var(--sidebar); padding: 30px clamp(22px,3vw,44px) 56px; }
.page { width: min(1280px, 100%); min-width: 0; margin: 0 auto; animation: enter .22s ease-out; }
@keyframes enter { from { opacity: .2; transform: translateY(5px) } }
.page-loading { min-height: 80vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.page-header { padding: 18px 0 4px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; margin: 0 0 7px; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.035em; line-height: 1.05; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 16px; }
.subtitle { color: var(--muted); margin: 9px 0 0; max-width: 620px; line-height: 1.5; }
.button { min-height: 44px; border: 0; border-radius: 12px; padding: 10px 17px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; color: #fff; background: var(--brand); font-weight: 750; cursor: pointer; text-decoration: none; box-shadow: 0 8px 22px rgba(22,103,232,.18); }
.button:hover { background: var(--brand-deep); }
.button.secondary { color: var(--brand); background: var(--brand-soft); box-shadow: none; }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); box-shadow: none; }
.button.danger { background: var(--red); }
.button.bonus { color: #71500b; background: #fff2bd; border: 1px solid #ead58a; box-shadow: none; }
.button.bonus:hover { background: #f7e293; }
.button.bonus:disabled { opacity: .65; cursor: default; }
.button.small { min-height: 34px; padding: 6px 11px; border-radius: 10px; font-size: 13px; }
.icon-button { position: relative; border: 1px solid var(--line); border-radius: 12px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; border-radius: 10px; padding: 0 5px; display: grid; place-items: center; color: white; background: var(--orange); font-size: 10px; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 26px; }
.stat { padding: 16px 17px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.9); box-shadow: 0 8px 24px rgba(35,70,126,.05); }
.stat strong { display: block; margin-top: 5px; font-size: 27px; }
.stat span { color: var(--muted); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.8fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { padding: 19px 21px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 20px; }
.task-card { --subject: var(--brand); position: relative; padding: 18px 18px 17px 22px; border: 1px solid color-mix(in srgb,var(--subject) 26%,var(--line)); border-radius: 17px; background: color-mix(in srgb,var(--subject) 8%,white); overflow: hidden; }
.task-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--subject); }
.task-card.urgent { border: 2px solid #f2a35d; background: color-mix(in srgb,var(--subject) 9%,white); box-shadow: 0 8px 22px rgba(232,119,34,.08); }
.task-card.urgent::before { width: 7px; background: var(--orange); }
.task-card.completed { opacity: .62; }
.task-card.completed h3 { text-decoration: line-through; }
.task-top, .task-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subject-chip { border-radius: 999px; padding: 5px 9px; background: color-mix(in srgb,var(--subject) 14%,white); color: color-mix(in srgb,var(--subject) 80%,black); font-size: 11px; font-weight: 800; }
.subject-chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.group-chip { border-radius: 999px; padding: 5px 9px; color: #36516f; background: #eaf1fa; font-size: 11px; font-weight: 800; }
.subject-swatch { display: block; width: 30px; height: 30px; border: 2px solid rgba(32,48,43,.12); border-radius: 9px; background: var(--subject, var(--brand)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.45); }
.subject-ink { color: var(--subject, var(--brand)); }
.due { font-size: 12px; color: var(--muted); font-weight: 700; }
.task-card h3 { margin-top: 12px; font-size: 17px; }
.task-card p { color: #56657d; line-height: 1.5; margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.homework-progress { display: grid; grid-template-columns: auto minmax(120px,1fr) 48px; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.64); }
.homework-progress label, .homework-progress output { color: #53647e; font-size: 12px; font-weight: 800; }
.homework-progress output { text-align: right; font-variant-numeric: tabular-nums; }
.homework-progress input[type="range"] { min-width: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; box-shadow: none; accent-color: var(--subject); cursor: grab; }
.homework-progress input[type="range"]:active { cursor: grabbing; }
.homework-progress input[type="range"]:disabled { cursor: default; opacity: .65; }
.task-foot { margin-top: 14px; color: var(--muted); font-size: 11px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--brand); }
.list { display: grid; gap: 10px; }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border: 0; }
.list-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-soft); }
.list-main { min-width: 0; flex: 1; }
.list-main p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 11px; }
.filter-panel { margin-bottom: 18px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.74); box-shadow: 0 8px 24px rgba(30,61,51,.04); }
.filter-heading { display: flex; align-items: baseline; gap: 9px; margin-bottom: 11px; }
.filter-heading strong { color: var(--ink); font-size: 15px; }
.filter-heading span { color: var(--muted); font-size: 12px; }
.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.filter-field { display: grid; flex: 1 1 180px; gap: 6px; }
.filter-field > span { color: #53647e; font-size: 11px; font-weight: 800; }
.filter-submit { flex: 0 0 auto; min-width: 130px; min-height: 44px; }
.calendar-panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: var(--shadow); overflow: hidden; }
.calendar-toolbar { min-height: 70px; padding: 13px 18px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.calendar-toolbar h2 { text-align: left; text-transform: capitalize; }
.calendar-toolbar-actions { display: flex; align-items: center; gap: 9px; }
.calendar-scroll { overflow-x: auto; }
.calendar-weekdays, .calendar-grid { min-width: 760px; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.calendar-weekdays span { padding: 9px 8px; color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.calendar-day { min-height: 132px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.62); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-day.outside { background: #f7f9f7; }
.calendar-day.outside > * { opacity: .48; }
.calendar-day-head { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.calendar-day-head > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #53647e; font-size: 12px; font-weight: 800; }
.calendar-day.today .calendar-day-head > span { color: #fff; background: var(--brand); }
.calendar-day-head button { width: 26px; height: 26px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; opacity: 0; }
.calendar-day:hover .calendar-day-head button, .calendar-day-head button:focus-visible { opacity: 1; background: var(--surface-soft); }
.calendar-events { display: grid; gap: 5px; margin-top: 4px; }
.calendar-event { --subject: var(--brand); min-width: 0; padding: 6px 7px; display: grid; gap: 1px; border: 1px solid color-mix(in srgb,var(--subject) 28%,white); border-left: 4px solid var(--subject); border-radius: 8px; color: var(--ink); background: color-mix(in srgb,var(--subject) 12%,white); cursor: pointer; text-align: left; }
.calendar-event:hover { background: color-mix(in srgb,var(--subject) 20%,white); }
.calendar-event span, .calendar-event strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.calendar-event strong { font-size: 11px; }
.calendar-event.private { border-style: dashed; }
.calendar-detail { --subject: var(--brand); padding: 5px 2px 4px 16px; border-left: 6px solid var(--subject); }
.calendar-detail-labels { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.visibility-badge { padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.visibility-badge.public { color: var(--brand); background: var(--brand-soft); }
.visibility-badge.private { color: #654f25; background: #fff4d8; }
.calendar-visibility { min-width: 0; margin: 0; padding: 0; border: 0; }
.calendar-visibility legend { margin-bottom: 8px; color: #53647e; font-size: 12px; font-weight: 800; }
.visibility-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.visibility-option { min-width: 0; padding: 12px 13px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }
.visibility-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(22,103,232,.1); }
.visibility-option:has(input:disabled) { opacity: .48; cursor: not-allowed; }
.visibility-option input { width: 18px; height: 18px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--brand); }
.visibility-option span, .visibility-option strong, .visibility-option small { display: block; min-width: 0; }
.visibility-option strong { font-size: 13px; }
.visibility-option small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.permission-note { display: block; margin-top: 8px; color: var(--muted); line-height: 1.4; }
.calendar-detail h2 { margin-top: 14px; }
.calendar-detail p { line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.calendar-detail-date { color: var(--muted); font-weight: 750; }
.field { display: grid; gap: 7px; }
.field label, .field > span { font-size: 12px; color: #53647e; font-weight: 750; }
input, textarea, select { width: 100%; border: 1px solid #ccd8e8; border-radius: 12px; background: #fff; color: var(--ink); padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 104px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.field.full, .form-actions { grid-column: 1/-1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 7px; }
.file-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.file-link { padding: 7px 9px; border-radius: 9px; background: var(--surface-soft); font-size: 12px; text-decoration: none; }
.image-previews { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 10px; margin-top: 14px; }
.image-preview { min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.72); font-size: 10px; text-decoration: none; }
.image-preview img { width: 100%; height: 118px; display: block; border-radius: 8px; object-fit: cover; background: var(--surface-soft); }
.image-preview span { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject-checkboxes { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 8px; }
.subject-choice { --subject: var(--brand); min-height: 46px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 750; }
.subject-choice:has(input:checked) { border-color: var(--subject); background: color-mix(in srgb,var(--subject) 10%,white); box-shadow: 0 0 0 2px color-mix(in srgb,var(--subject) 16%,transparent); }
.subject-choice input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--subject); }
.subject-choice .subject-swatch { width: 20px; height: 20px; border-radius: 6px; }
.timetable-preview { display: grid; gap: 7px; }
.timetable-mini { --subject: var(--brand); min-width: 0; padding: 8px 9px; display: grid; grid-template-columns: 58px 5px minmax(0,1fr); align-items: center; gap: 9px; border-radius: 11px; background: color-mix(in srgb,var(--subject) 7%,white); }
.timetable-period { color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.timetable-color { width: 5px; align-self: stretch; border-radius: 5px; background: var(--subject); }
.timetable-mini strong, .timetable-mini small { display: block; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.timetable-mini strong { font-size: 13px; line-height: 1.3; }
.timetable-mini small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.timetable-double { padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.timetable-scroll { width: 100%; max-width: 100%; overflow: visible; padding: 2px 2px 14px; }
.weekly-timetable { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; align-items: stretch; }
.timetable-day { min-width: 0; min-height: clamp(520px,calc(100vh - 315px),680px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); overflow: hidden; }
.timetable-day-head { padding: 24px 22px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.timetable-day-head h2 { font-size: 24px; }
.timetable-day-head span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.timetable-day-lessons { min-height: 0; padding: 18px; display: grid; grid-auto-rows: minmax(104px,auto); align-content: start; gap: 14px; flex: 1; }
.timetable-day-lessons:has(.empty) { align-content: stretch; }
.timetable-day-lessons .empty { min-height: 100%; padding: 48px 14px; display: grid; place-content: center; font-size: 14px; }
.timetable-day-lessons .empty strong { font-size: 17px; }
.timetable-lesson-card { --subject: var(--brand); min-width: 0; min-height: 104px; padding: 15px 14px; display: grid; grid-template-columns: minmax(0,1fr); align-items: start; gap: 9px; border: 1px solid color-mix(in srgb,var(--subject) 24%,var(--line)); border-left: 7px solid var(--subject); border-radius: 16px; background: color-mix(in srgb,var(--subject) 7%,white); }
.timetable-lesson-period { width: fit-content; padding: 3px 7px; border-radius: 8px; color: color-mix(in srgb,var(--subject) 76%,black); background: rgba(255,255,255,.58); font-size: 17px; font-weight: 850; }
.timetable-lesson-card > div:last-child { min-width: 0; }
.timetable-lesson-card .subject-chip { width: 100%; max-width: 100%; padding: 8px 10px; display: block; border-radius: 11px; font-size: 13px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; word-break: normal; hyphens: none; }
.timetable-lesson-card p, .timetable-lesson-card small { display: block; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.timetable-lesson-card p { white-space: nowrap; }
.timetable-page .page-header { margin-bottom: 30px; }
.timetable-page .subtitle { font-size: 16px; }
.archive-section { display: grid; gap: 14px; margin-top: 26px; }
.archive-section > h2, .archive-section .section-heading h2 { color: var(--ink); }
.archive-section .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.chat-layout { display: grid; grid-template-rows: minmax(360px,calc(100vh - 300px)) auto; }
.messages { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.message { align-self: flex-start; max-width: min(76%,620px); }
.message.mine { align-self: flex-end; }
.bubble { border-radius: 8px 17px 17px 17px; background: var(--surface-soft); padding: 10px 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.mine .bubble { color: white; background: var(--brand); border-radius: 17px 8px 17px 17px; }
.message.system { align-self: center; max-width: 90%; text-align: center; color: var(--muted); font-size: 12px; }
.message-meta { margin: 0 5px 4px; color: var(--muted); font-size: 10px; }
.mine .message-meta { text-align: right; }
.chat-form { display: flex; gap: 9px; padding: 14px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }
.notification.unread { border-left: 4px solid var(--orange); padding-left: 12px; }
.notification a { text-decoration: none; }
.support-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.support-dialog, .support-list { display: grid; gap: 16px; }
.support-dialog > section { border-top: 1px solid var(--line); padding-top: 18px; }
.support-ticket { display: grid; gap: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.support-ticket.resolved { opacity: .7; }
.support-ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.support-ticket-head strong, .support-ticket-head .meta { display: block; }
.support-replies { display: grid; gap: 8px; margin-left: 22px; }
.support-reply { padding: 10px 12px; border-radius: 12px; background: var(--surface-soft); }
.support-reply.from-admin { border-left: 4px solid var(--brand); }
.support-reply strong { font-size: 12px; }
.support-reply p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-reply-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 9px; }
.support-reply-form textarea { min-height: 68px; }
.mail-tabs { display: flex; gap: 7px; margin-bottom: 14px; }
.mail-layout { display: grid; grid-template-columns: minmax(310px,.78fr) minmax(0,1.5fr); gap: 16px; align-items: stretch; }
.mail-list, .mail-reader { min-width: 0; min-height: 560px; }
.mail-list-body { max-height: 650px; overflow-y: auto; }
.mail-list-item { position: relative; min-width: 0; padding: 14px 16px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: start; gap: 11px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.mail-list-item:hover, .mail-list-item.active { background: #f2f7ff; }
.mail-list-item.unread::before { content:""; position: absolute; left: 6px; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.mail-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg,#1673e8,#694fe5); font-size: 12px; font-weight: 850; }
.mail-list-copy { min-width: 0; }
.mail-list-copy strong, .mail-list-copy small, .mail-list-copy b { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list-copy small { margin: 2px 0 5px; color: var(--muted); font-size: 10px; }
.mail-list-copy b { font-size: 12px; }
.mail-list-copy > span { margin-top: 4px; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mail-list-meta { color: var(--muted); font-size: 9px; text-align: right; white-space: nowrap; }
.mail-list-meta small { display: block; margin-top: 6px; }
.mail-list-side { display: flex; align-items: flex-start; gap: 8px; }
.mail-list-chevron { display: none; color: var(--brand); font-size: 27px; font-weight: 500; line-height: 1; }
.mail-reader { padding: 25px; }
.mail-reader > .empty { min-height: 500px; }
.mail-detail { min-width: 0; }
.mail-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.mail-detail-head h2 { margin-top: 4px; overflow-wrap: anywhere; }
.mail-addresses { margin: 0; padding: 15px 0; display: grid; gap: 7px; border-bottom: 1px solid var(--line); }
.mail-addresses > div { display: grid; grid-template-columns: 75px minmax(0,1fr); gap: 10px; }
.mail-addresses dt { color: var(--muted); font-size: 11px; font-weight: 750; }
.mail-addresses dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.mail-addresses dd > span { color: var(--muted); }
.mail-body { min-height: 180px; padding: 22px 2px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.mail-privacy-note, .mail-admin-notice { grid-column: 1/-1; padding: 12px 14px; border: 1px solid #c8daf6; border-radius: 13px; color: #27476f; background: #f2f7ff; }
.mail-privacy-note strong, .mail-privacy-note span { display: block; }
.mail-privacy-note span { margin-top: 3px; font-size: 12px; line-height: 1.45; }
.mail-admin-notice { margin: 20px 0 0; font-size: 11px; }
.mail-delete-deadline { margin-top: 6px !important; color: var(--red) !important; font-weight: 750; }
.mail-delete-notice { padding: 13px 15px; display: grid; gap: 4px; border: 1px solid #f0c3c8; border-radius: 14px; color: #7b2530; background: #fff4f5; }
.mail-delete-notice strong, .mail-delete-notice span { display: block; }
.mail-delete-notice span { font-size: 12px; line-height: 1.45; }
.mail-filters { margin-bottom: 14px; display: grid; grid-template-columns: minmax(220px,1fr) repeat(3,auto) auto; align-items: end; gap: 12px; }
.recipient-choice-list { max-height: 270px; display: grid; gap: 7px; padding: 7px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: #f8fbff; }
.recipient-choice { min-width: 0; display: grid; grid-template-columns: auto 38px minmax(0,1fr); align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.recipient-choice:hover { background: #fff; border-color: var(--line); }
.recipient-choice:has(input:checked) { color: var(--navy); background: var(--soft-blue); border-color: #8fb9ff; box-shadow: inset 3px 0 var(--blue); }
.recipient-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.recipient-choice .mail-avatar { width: 38px; height: 38px; }
.recipient-choice span:last-child { min-width: 0; display: grid; gap: 2px; }
.recipient-choice strong,.recipient-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipient-choice small { color: var(--muted); }
.mail-back { display: none; margin-bottom: 10px; color: var(--brand); font-size: 12px; font-weight: 800; text-decoration: none; }
.mail-thread { padding: 20px 0; display: grid; gap: 13px; }
.mail-message { max-width: min(82%,700px); padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px 18px 18px; background: var(--surface-soft); overflow: hidden; }
.mail-message.mine { justify-self: end; border-color: #bfd5fa; border-radius: 18px 8px 18px 18px; background: #eef5ff; }
.mail-message.reported { border: 2px solid var(--red); }
.mail-message p, .support-post p { margin: 9px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.mail-message-meta, .mail-message-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.mail-message-meta strong { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.mail-message-status { margin-top: 10px; }
.text-button { padding: 2px; border: 0; color: var(--brand); background: none; font: inherit; font-weight: 800; cursor: pointer; }
.danger-text { color: var(--red); }
.mail-reply-form { padding-top: 17px; display: grid; gap: 10px; border-top: 1px solid var(--line); }
.mail-reply-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.mail-reply-actions > small { margin-right: auto; color: var(--muted); }
.file-button { position: relative; padding: 9px 12px; display: inline-flex; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.content-reference { margin: 16px 0 0; padding: 12px 14px; display: grid; gap: 3px; border: 1px solid #bcd3f7; border-radius: 13px; color: var(--ink); background: #f2f7ff; text-decoration: none; }
.content-reference > span { color: var(--brand); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.content-reference small { color: var(--muted); }
.content-reference.unavailable { border-color: var(--line); color: var(--muted); background: var(--surface-soft); }
.split-actions { align-items: center; }
.split-actions > span { flex: 1; }
.support-dialog, .support-list { display: grid; gap: 10px; }
.support-layout, .support-detail { min-width: 0; }
.support-workspace { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(0,1.45fr); gap: 16px; align-items: start; }
.support-ticket-row { padding: 14px 16px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 5px 10px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.support-ticket-row:hover, .support-ticket-row.active { background: #f2f7ff; }
.support-ticket-row > strong { min-width: 0; overflow-wrap: anywhere; }
.support-ticket-row > span:not(.support-status), .support-ticket-row > small { grid-column: 2; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.support-status { padding: 4px 8px; align-self: start; border-radius: 999px; color: #31547f; background: #e7f0ff; font-size: 9px; font-weight: 850; white-space: nowrap; }
.support-status.resolved { color: #35634f; background: #dff1e9; }
.support-status.waiting_user, .support-status.waiting_internal { color: #7b5920; background: #fff1cf; }
.support-status.archived { color: #5f6675; background: #eef1f5; }
.support-detail { padding: 24px; }
.support-post { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.support-replies { margin: 13px 0; }
.support-reply.internal { border: 1px dashed #9c7a31; border-left: 5px solid #b88b2f; background: #fff8e9; }
.support-work-controls { margin: 18px 0; padding: 14px; display: flex; flex-wrap: wrap; gap: 14px; border-radius: 14px; background: var(--surface-soft); }
.support-work-controls label { display: grid; gap: 5px; font-size: 11px; font-weight: 800; }
.support-helpers { display: grid; gap: 3px; color: var(--muted); font-size: 11px; }
.support-reply-form { padding-top: 16px; display: grid; grid-template-columns: 1fr; gap: 10px; border-top: 1px solid var(--line); }
.internal-note-check { color: #775719; }
.matrix-scroll { overflow-x: auto; }
.communication-matrix th, .communication-matrix td { min-width: 130px; text-align: center; vertical-align: middle; }
.communication-matrix th:first-child { min-width: 190px; text-align: left; }
.matrix-switch { display: grid; justify-items: center; gap: 3px; color: var(--muted); font-size: 10px; }
.admin-contact-override { margin-bottom: 18px; }
.admin-contact-override small { display: block; margin-top: 3px; color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.account-settings-grid { display: grid; gap: 20px; align-items: start; }
.account-settings-columns { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,.8fr); gap: 20px; align-items: start; }
.account-settings-primary, .account-settings-secondary { min-width: 0; display: grid; gap: 20px; }
.account-password-panel .button { width: 100%; }
.navigation-order-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.navigation-order-item { width: 100%; min-width: 0; min-height: 54px; padding: 9px 16px; display: grid; grid-template-columns: 24px 34px minmax(0,1fr); align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); cursor: grab; transition: border-color .15s ease, background .15s ease, opacity .15s ease, transform .15s ease; }
.navigation-order-item:active { cursor: grabbing; }
.navigation-order-item.dragging { opacity: .42; }
.navigation-order-item.drag-over { border-color: var(--brand); background: var(--brand-soft); transform: translateY(2px); }
.navigation-order-grip { color: var(--muted); font-size: 19px; line-height: 1; letter-spacing: -5px; user-select: none; }
.navigation-order-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-deep); background: var(--brand-soft); font-weight: 900; }
.navigation-order-item strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.rights-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 18px; }
.right-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.right-item span { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-deep); background: var(--brand-soft); font-weight: 900; }
.right-item strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.settings-wide, .settings-save { grid-column: 1/-1; }
.settings-save { padding-top: 0; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border: 0; }
.toggle { width: 44px; height: 25px; flex: 0 0 auto; accent-color: var(--brand); }
.group-choice-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.group-choice { min-width: 0; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.group-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(22,103,232,.08); }
.group-choice span, .group-choice strong, .group-choice small { min-width: 0; display: block; }
.group-choice small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.group-choice:has(input:disabled) { cursor: default; opacity: .72; }
.support-helper-choice { min-height: 66px; }
.support-helper-check { width: 22px; height: 22px; min-width: 22px; flex: 0 0 22px; margin: 0; padding: 0; border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: none; accent-color: var(--brand); }
.support-helper-check:focus { box-shadow: 0 0 0 3px rgba(22,103,232,.16); }
.feature-toggle-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; }
.feature-toggle-card { min-width: 0; padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); cursor: pointer; transition: border-color .16s ease,background .16s ease,box-shadow .16s ease; }
.feature-toggle-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(22,103,232,.07); }
.feature-toggle-card span,.feature-toggle-card strong,.feature-toggle-card small { min-width: 0; display: block; }
.feature-toggle-card small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.status { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; background: var(--brand-soft); color: var(--brand-deep); }
.status.off { background: #f1dddd; color: var(--red); }
.user-block-reason { display: block; max-width: 220px; margin-top: 5px; }
.report-reason { padding: 9px 11px; border-radius: 10px; color: #394b68 !important; background: var(--surface-soft); }
.report-button { color: #7a4b16; border-color: #ead8bf; }
.leaderboard-panel { max-width: 900px; margin: 0 auto; }
.leaderboard-list { padding: 8px 20px 20px; display: grid; gap: 8px; }
.leaderboard-row { min-width: 0; min-height: 74px; padding: 11px 15px; display: grid; grid-template-columns: 42px 46px minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.leaderboard-row.current { border-color: #85b7ff; box-shadow: 0 8px 24px rgba(22,103,232,.11); }
.leaderboard-row.podium-1 { background: linear-gradient(135deg,#fff9de,#fffdf5); border-color: #e7ca66; }
.leaderboard-row.podium-2 { background: linear-gradient(135deg,#f3f6fa,#fff); border-color: #cbd4df; }
.leaderboard-row.podium-3 { background: linear-gradient(135deg,#fff0e6,#fffaf7); border-color: #dcac88; }
.leaderboard-position { color: var(--muted); font-size: 18px; font-weight: 850; text-align: center; font-variant-numeric: tabular-nums; }
.leaderboard-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg,var(--brand),#694fe5); font-weight: 850; }
.leaderboard-person { min-width: 0; }
.leaderboard-person strong, .leaderboard-person small { display: block; }
.leaderboard-person strong { overflow-wrap: anywhere; }
.leaderboard-person small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.rank-medal { display: inline-block; margin-left: 3px; font-size: 1.12em; line-height: 1; vertical-align: -.08em; filter: drop-shadow(0 2px 2px rgba(31,45,72,.12)); }
.leaderboard-points { color: var(--brand-deep); font-size: 17px; white-space: nowrap; }
.tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 18px; }
.tab { white-space: nowrap; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 9px 13px; cursor: pointer; font-weight: 700; color: var(--muted); }
.tab.active { color: white; background: var(--brand); border-color: var(--brand); }
.admin-section-stack { display: grid; gap: 22px; }
.readonly-selection { min-height: 43px; padding: 11px 13px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-soft); font-weight: 750; }
.modal { width: min(620px,calc(100% - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 90px rgba(25,53,99,.25); }
.modal::backdrop { background: rgba(28,45,74,.48); backdrop-filter: blur(4px); }
.modal-inner { padding: 22px; overflow-y: auto; max-height: calc(100vh - 40px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.update-admin-list { display: grid; gap: 10px; }
.update-admin-item { min-width: 0; padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.update-admin-copy { min-width: 0; }
.update-admin-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.update-admin-copy p { margin: 6px 0; color: var(--muted); overflow-wrap: anywhere; }
.update-builder { gap: 12px; }
.update-builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.update-builder-head > div:first-child { min-width: 0; }
.update-builder-head label, .update-builder-head small { display: block; }
.update-builder-head small, [data-update-total] { color: var(--muted); line-height: 1.45; }
.update-block-editor { display: grid; gap: 11px; }
.update-editor-block { min-width: 0; padding: 13px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.update-editor-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.update-editor-block-head strong { color: var(--brand-deep); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.update-editor-controls { display: flex; gap: 5px; }
.update-editor-controls .icon-button { width: 34px; height: 34px; min-width: 34px; background: #fff; }
.update-editor-block textarea { min-height: 96px; background: #fff; }
.update-editor-block input[type="file"] { background: #fff; }
.update-announcement-modal { width: min(680px,calc(100% - 24px)); }
.update-announcement-modal .modal-head { margin-bottom: 12px; }
.update-announcement-modal .modal-head h2 { color: var(--brand); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.update-announcement { display: grid; gap: 15px; }
.update-announcement-image { width: 100%; max-height: 290px; display: block; object-fit: cover; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); }
.update-version { width: fit-content; padding: 6px 10px; border-radius: 999px; color: var(--brand-deep); background: var(--brand-soft); font-size: 11px; font-weight: 850; }
.update-announcement h2 { margin: -3px 0 0; font-size: clamp(25px,4vw,36px); line-height: 1.08; overflow-wrap: anywhere; }
.update-content-blocks { display: grid; gap: 14px; }
.update-content-text { margin: 0; color: var(--text); font-size: 15px; line-height: 1.58; white-space: pre-line; overflow-wrap: anywhere; }
.update-summary { margin: -6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; white-space: pre-line; }
.update-announcement ul { margin: 0; padding: 0; display: grid; gap: 9px; list-style: none; }
.update-announcement li { min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: start; gap: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.update-announcement li > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-weight: 900; }
.update-announcement li > span:last-child { padding-top: 3px; }
.update-acknowledge { width: 100%; margin-top: 5px; }
.update-remaining { color: var(--muted); text-align: center; }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 84px; display: grid; gap: 8px; width: min(380px,calc(100% - 40px)); }
.toast { padding: 13px 15px; border-radius: 13px; color: white; background: var(--brand-deep); box-shadow: var(--shadow); animation: enter .2s; }
.toast.error { background: var(--red); }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(380px,.9fr); background: var(--canvas); }
.login-intro { position: relative; overflow: hidden; padding: clamp(40px,7vw,100px); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: linear-gradient(145deg,#0f67e8,#173f9d); }
.login-intro::after { content:""; position:absolute; width:420px; height:420px; border:80px solid rgba(255,255,255,.07); border-radius:50%; right:-180px; bottom:-140px; }
.login-brand { display: flex; gap: 14px; align-items: center; font-size: 20px; font-weight: 800; }
.login-brand .brand-logo { width: 62px; height: 62px; box-shadow: 0 10px 24px rgba(16,40,33,.2); }
.login-eyebrow { color: #d4e6ff; }
.login-copy { position: relative; z-index: 1; max-width: 620px; }
.login-copy h1 { font-size: clamp(42px,6vw,76px); }
.login-copy p { color: #dbe9ff; font-size: 18px; line-height: 1.6; }
.login-form-wrap { padding: clamp(24px,7vw,90px); display: grid; align-content: center; }
.login-card { max-width: 430px; width: 100%; margin: auto; }
.login-card h2 { font-size: 30px; margin-bottom: 8px; }
.login-card > p { color: var(--muted); margin: 0 0 27px; }
.login-card form { display: grid; gap: 15px; }
.login-card .button { margin-top: 4px; }
.public-link { text-align: center; margin-top: 20px; color: var(--brand); font-weight: 700; }
.home-appbar { min-height: 64px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.home-appbar > div:first-child { min-width: 0; }
.home-appbar h1 { font-size: clamp(23px,2.5vw,32px); overflow-wrap: anywhere; }
.home-user { display: flex; align-items: center; gap: 10px; }
.home-user > span:last-child strong, .home-user > span:last-child small { display: block; }
.home-user > span:last-child strong { font-size: 12px; }
.home-user > span:last-child small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.home-avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#0f73ec,#6948e9); font-size: 13px; font-weight: 850; }
.home-welcome { position: relative; min-height: 154px; padding: 22px 28px; display: flex; align-items: center; overflow: hidden; border: 1px solid #bed8fa; border-radius: 22px; background: linear-gradient(112deg,#f9fcff 0%,#e8f3ff 64%,#dfeeff 100%); box-shadow: var(--shadow); }
.home-welcome::before, .home-welcome::after { content:""; position:absolute; border: 1px solid rgba(22,103,232,.13); border-radius: 50%; }
.home-welcome::before { width: 280px; height: 280px; right: -52px; top: -120px; }
.home-welcome::after { width: 180px; height: 180px; right: 120px; bottom: -135px; }
.home-welcome-copy { position: relative; z-index: 1; max-width: calc(100% - 160px); }
.home-welcome-copy h2 { font-size: clamp(24px,2.5vw,32px); }
.home-welcome-copy > p:not(.eyebrow) { max-width: 680px; margin: 7px 0 0; color: #52647e; font-size: 14px; line-height: 1.45; }
.home-actions { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 9px; }
.home-actions .button { min-height: 39px; padding: 8px 14px; }
.home-welcome-logo { position: absolute; right: 52px; width: 112px; height: 112px; display: grid; place-items: center; border-radius: 29px; background: linear-gradient(145deg,#1977ef,#274fc3); box-shadow: 0 18px 38px rgba(23,89,195,.23); transform: rotate(6deg); }
.home-welcome-logo > span { width: 86px; height: 86px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.75); transform: rotate(-6deg); }
.home-welcome-logo img { display: block; width: 118%; height: 118%; max-width: none; object-fit: contain; }
.home-stats { margin: 18px 0; gap: 12px; }
.home-stats .stat { min-width: 0; display: flex; align-items: center; gap: 12px; }
.home-stats .stat > span:last-child { min-width: 0; color: var(--muted); font-size: 10px; }
.home-stats .stat strong { color: var(--ink); font-size: 23px; }
.stat-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: var(--brand); background: var(--brand-soft); font-weight: 900; }
.stat-icon.warning { color: #e54a58; background: #fff0f1; }
.stat-icon.material { color: #1b9b7e; background: #e8f8f4; }
.stat-icon.notice { color: #7748db; background: #f1edff; }
.home-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(310px,.82fr); grid-template-areas: "today missed" "today timetable" "chat materials" "archive archive"; gap: 16px; align-items: stretch; }
.home-dashboard-grid > :nth-child(1) { grid-area: today; }
.home-dashboard-grid > :nth-child(2) { grid-area: missed; }
.home-dashboard-grid > :nth-child(3) { grid-area: chat; }
.home-dashboard-grid > :nth-child(4) { grid-area: timetable; }
.home-dashboard-grid > :nth-child(5) { grid-area: materials; }
.home-dashboard-grid > :nth-child(6) { grid-area: archive; }
.home-dashboard-grid > :nth-child(2), .home-dashboard-grid > :nth-child(4) { min-height: 190px; }
.home-panel .panel-head { min-height: 64px; padding: 14px 18px; }
.home-panel .panel-head > a { color: var(--brand); font-size: 11px; font-weight: 800; text-decoration: none; }
.home-panel-title { display: flex; align-items: center; gap: 10px; }
.home-panel-title .stat-icon { width: 35px; height: 35px; border-radius: 10px; }
.home-panel-title h2 { font-size: 16px; }
.home-rows { display: grid; }
.home-row { --subject: var(--brand); min-width: 0; padding: 13px 18px; display: grid; align-items: center; gap: 13px; border-bottom: 1px solid #edf2f8; text-decoration: none; }
.home-row:last-child { border-bottom: 0; }
.home-row:hover { background: #f9fbff; }
.home-task-row { grid-template-columns: minmax(92px,.35fr) minmax(0,1.3fr) minmax(120px,.55fr); }
.home-task-row .subject-chip { width: fit-content; max-width: 100%; padding: 7px 11px; border-radius: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-row-copy { min-width: 0; }
.home-row-copy strong, .home-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-row-copy strong { font-size: 12px; }
.home-row-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.home-row-meta { justify-self: end; color: var(--muted); font-size: 10px; text-align: right; }
.home-row-meta strong { display: block; margin-top: 3px; color: var(--subject); font-size: 11px; }
.home-row-meta.overdue, .home-row-meta.overdue strong { color: var(--red); }
.home-row-meta strong.homework-due-date { color: var(--ink); }
.homework-due-date .due-calendar { display: inline; margin-right: 4px; color: var(--subject); }
.home-row-meta.overdue .due-calendar { color: var(--red); }
.home-dashboard-grid > :nth-child(1) .panel-head { min-height: 72px; padding: 16px 20px; }
.home-dashboard-grid > :nth-child(1) .home-panel-title h2 { font-size: 19px; }
.home-dashboard-grid > :nth-child(1) .home-row { min-height: 78px; padding: 17px 20px; }
.home-dashboard-grid > :nth-child(1) .subject-chip { padding: 8px 12px; font-size: 12px; }
.home-dashboard-grid > :nth-child(1) .home-row-copy strong { font-size: 15px; }
.home-dashboard-grid > :nth-child(1) .home-row-copy small { margin-top: 5px; font-size: 12px; }
.home-dashboard-grid > :nth-child(1) .home-row-meta { font-size: 11px; }
.home-dashboard-grid > :nth-child(1) .home-row-meta strong { font-size: 12px; }
.home-chat-row, .home-material-row { grid-template-columns: 42px minmax(0,1fr) auto; }
.home-row-avatar { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#18a7a1,#1676e9); font-size: 11px; font-weight: 850; }
.home-file-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; color: #8950e9; background: #f0eaff; }
.home-archive { min-height: 170px; padding: 24px; display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 20px; }
.home-archive-icon { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 23px; color: #fff; background: linear-gradient(145deg,#7652e6,#4731ad); box-shadow: 0 15px 30px rgba(93,64,194,.2); font-size: 32px; }
.home-archive h2 { font-size: 16px; }
.home-archive p { margin: 7px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.home-archive .button { color: #6040c4; background: #f1edff; }
.filter-panel, .calendar-panel { background: rgba(255,255,255,.94); }
.tabs { padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.78); }
.tab { border-color: transparent; background: transparent; }
.tab:hover { color: var(--brand); background: var(--brand-soft); }
.data-table tbody tr:hover { background: #f8fbff; }
.support-ticket, .timetable-day { box-shadow: 0 8px 24px rgba(35,70,126,.05); }
.parent-view-notice { margin-bottom: 18px; padding: 14px 18px; display: flex; align-items: center; gap: 13px; border: 1px solid #bfd7ff; border-radius: 15px; color: #12376f; background: linear-gradient(135deg,#f4f8ff,#eaf3ff); box-shadow: 0 8px 24px rgba(39,100,190,.07); }
.parent-view-notice > span { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: #dceaff; font-size: 18px; }
.parent-view-notice strong, .parent-view-notice small { display: block; }
.parent-view-notice small { margin-top: 3px; color: var(--muted); line-height: 1.4; }
.chat-readonly { padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); background: #f8faff; font-size: 13px; text-align: center; }
.mobile-header { display: none; }
@media (max-width: 1100px) and (min-width: 901px) {
  .weekly-timetable { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .timetable-day { min-height: 360px; }
}
@media (max-width: 900px) {
  .sidebar { z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(20,40,34,.15); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; z-index: 30; height: 70px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); box-shadow: 0 8px 22px rgba(35,70,126,.08); backdrop-filter: blur(18px); }
  .brand.compact { min-height: 0; padding: 0; gap: 9px; border-bottom: 0; }
  .brand.compact .brand-logo { width: 44px; height: 44px; }
  .header-actions { display: flex; gap: 8px; }
  .main-content { margin-left: 0; padding: 25px 16px 90px; }
  .dashboard-grid, .settings-grid, .account-settings-grid, .account-settings-columns { grid-template-columns: 1fr; }
  .rights-list { grid-template-columns: 1fr; }
  .navigation-order-item { grid-template-columns: 24px 32px minmax(0,1fr); }
  .mail-layout { grid-template-columns: 1fr; }
  .mail-page .page-header { align-items: stretch; flex-direction: column; gap: 14px; }
  .mail-page .page-header .button { width: 100%; justify-content: center; }
  .mail-filters { padding: 14px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .mail-filters .filter-field { grid-column: 1/-1; }
  .mail-filters .check { min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: #f8fbff; }
  .mail-filters .button { grid-column: 1/-1; width: 100%; }
  .support-workspace { grid-template-columns: 1fr; }
  .mail-list, .mail-reader { min-height: 0; }
  .mail-reader > .empty { min-height: 220px; }
  .mail-page.conversation-open .mail-list { display: none; }
  .mail-page:not(.conversation-open) .mail-reader { display: none; }
  .mail-back { width: fit-content; padding: 8px 11px; display: inline-flex; align-items: center; border-radius: 10px; background: var(--brand-soft); }
  .mail-list-item { grid-template-columns: 40px minmax(0,1fr) auto; padding: 15px 14px; align-items: center; }
  .mail-list-side { height: 100%; align-items: center; }
  .mail-list-chevron { display: inline-block; }
  .mail-detail-head { flex-direction: column; }
  .mail-detail-head .actions { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .home-dashboard-grid { grid-template-columns: 1fr; grid-template-areas: "today" "missed" "timetable" "chat" "materials" "archive"; }
  .home-appbar { min-height: 52px; }
  .home-welcome { min-height: 180px; padding: 24px; }
  .home-welcome-copy { max-width: 100%; }
  .home-welcome-logo { right: -12px; opacity: .14; }
  .login-page { grid-template-columns: 1fr; }
  .login-intro { min-height: 300px; padding: 34px 24px; }
  .login-copy h1 { font-size: 42px; }
  .login-copy p { font-size: 15px; }
  .login-form-wrap { padding: 42px 22px; }
  .timetable-scroll { overflow-x: visible; padding: 0; }
  .weekly-timetable { min-width: 0; grid-template-columns: 1fr; gap: 16px; }
  .timetable-day { min-height: 0; }
  .timetable-day-head { padding: 18px 20px; }
  .timetable-day-lessons { padding: 15px; grid-auto-rows: minmax(96px,auto); }
  .timetable-day-lessons:has(.empty) { min-height: 145px; }
  .timetable-day-lessons .empty { min-height: 145px; padding: 30px 14px; }
  .timetable-lesson-card { min-height: 96px; }
}
@media (max-width: 560px) {
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-header .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .mail-filters { grid-template-columns: 1fr; }
  .mail-reader { padding: 17px; }
  .support-page.conversation-open .support-list, .support-page:has(.support-detail) .support-list { display: none; }
  .support-page:not(:has(.support-detail)) .support-detail { display: none; }
  .mail-message { max-width: 94%; }
  .mail-detail-head, .support-ticket-head { flex-direction: column; }
  .mail-detail-head .actions, .support-ticket-head .actions { width: 100%; }
  .split-actions { display: grid; grid-template-columns: 1fr; }
  .split-actions > span { display: none; }
  .visibility-options { grid-template-columns: 1fr; }
  .filter-panel { padding: 13px; }
  .filter-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .filters { display: grid; grid-template-columns: 1fr; }
  .filter-field, .filter-submit { min-width: 0; width: 100%; }
  .calendar-toolbar { padding: 11px 12px; grid-template-columns: minmax(0,1fr) auto; }
  .calendar-toolbar h2 { font-size: 17px; text-align: left; }
  .calendar-toolbar-actions .button { display: none; }
  .calendar-weekdays, .calendar-grid { min-width: 700px; }
  .calendar-day { min-height: 118px; }
  .calendar-day-head button { opacity: 1; }
  .task-top { align-items: flex-start; }
  .task-foot { align-items: flex-end; }
  .homework-progress { grid-template-columns: 1fr auto; }
  .homework-progress input { grid-column: 1/-1; grid-row: 2; }
  .data-table { display: block; overflow-x: auto; }
  .message { max-width: 88%; }
  .mail-list-item { grid-template-columns: 38px minmax(0,1fr) auto; }
  .mail-avatar { width: 36px; height: 36px; }
  .mail-list-meta { white-space: normal; text-align: right; }
  .mail-list-side { max-width: 92px; }
  .mail-reader { padding: 18px 15px; }
  .mail-detail-head { flex-direction: column; }
  .panel-head, .panel-body { padding-left: 15px; padding-right: 15px; }
  .home-appbar { align-items: flex-start; }
  .home-appbar h1 { font-size: 22px; line-height: 1.15; }
  .home-user > span:last-child { display: none; }
  .home-stats .stat { padding: 13px; gap: 9px; }
  .home-stats .stat-icon { width: 34px; height: 34px; }
  .home-stats .stat strong { font-size: 19px; }
  .home-welcome { padding: 22px; }
  .home-actions .button { flex: 1 1 140px; }
  .home-task-row { grid-template-columns: 1fr auto; }
  .home-task-row .subject-chip { grid-column: 1/-1; }
  .home-dashboard-grid > :nth-child(4) .home-row-copy strong,
  .home-dashboard-grid > :nth-child(4) .home-row-copy small { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
  .home-chat-row, .home-material-row { grid-template-columns: 40px minmax(0,1fr); }
  .home-chat-row .home-row-meta, .home-material-row .home-row-meta { grid-column: 2; justify-self: start; text-align: left; }
  .home-archive { grid-template-columns: 1fr; }
  .home-archive-icon { width: 66px; height: 66px; }
  .leaderboard-list { padding: 8px 12px 14px; }
  .leaderboard-row { grid-template-columns: 30px 40px minmax(0,1fr); gap: 9px; padding: 10px; }
  .leaderboard-avatar { width: 40px; height: 40px; }
  .leaderboard-points { grid-column: 3; font-size: 14px; }
  .update-admin-item { align-items: stretch; flex-direction: column; }
  .update-admin-item .actions .button { flex: 1 1 120px; }
  .update-builder-head { align-items: stretch; flex-direction: column; }
  .update-builder-head .actions .button { flex: 1 1 120px; }
  .update-announcement-modal .modal-inner { padding: 18px; }
  .update-announcement-image { max-height: 220px; }
  .toast-region { right: 14px; bottom: 76px; width: calc(100% - 28px); }
}
/* Administration responds to its available width, including beside the sidebar. */
.admin-page { container: administration / inline-size; }
.admin-page :is(#admin-content, .admin-section-stack, .stack, .settings-grid, .panel, .panel-body, .panel-head > div, .field) { min-width: 0; }
.admin-page :is(h2, h3, strong, .subtitle, .meta, .status, .subject-chip, .group-chip) { overflow-wrap: anywhere; }
.admin-page :is(input, select, textarea), .admin-modal :is(input, select, textarea) { min-width: 0; max-width: 100%; }
.admin-page .button, .admin-modal .button { min-height: 44px; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.admin-page .panel-head { flex-wrap: wrap; }
.admin-page .panel-head > div { flex: 1 1 280px; }
.admin-page .panel-head > .button { flex-shrink: 0; }
.admin-page .form-actions, .admin-modal .form-actions { flex-wrap: wrap; }
.admin-page .feature-toggle-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); }
.admin-page .feature-toggle-card > span, .admin-page .toggle-row > span { min-width: 0; overflow-wrap: anywhere; }
.admin-page .feature-toggle-card strong { hyphens: auto; }
.admin-page .admin-tabs { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; padding: 6px; overflow: visible; }
.admin-tabs .tab { min-width: 0; min-height: 46px; padding: 10px 8px; display: grid; place-items: center; text-align: center; text-decoration: none; white-space: normal; font-size: 14px; line-height: 1.35; }
.admin-tabs .tab:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.admin-tabs .tab.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.admin-page .stats-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.admin-page .stat { min-width: 0; }
.admin-page .data-table { table-layout: fixed; }
.admin-page .data-table :is(td, th) { overflow-wrap: anywhere; }
.admin-page .subject-chip { display: inline-block; max-width: 100%; white-space: normal; }

/* Accounts contain too many permissions for a readable eight-column table. */
.admin-page .admin-users-table { display: block; overflow: visible; }
.admin-users-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin-users-table tbody { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,400px),1fr)); gap: 16px; align-items: start; }
.admin-users-table tr { min-width: 0; padding: 18px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.admin-users-table td { min-width: 0; padding: 0; display: grid; align-content: start; gap: 7px; border: 0; }
.admin-users-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 750; line-height: 1.4; }
.admin-users-table td[data-label="Name"] { grid-column: 1/-1; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 750; }
.admin-users-table td[data-label="Aktionen"] { grid-column: 1/-1; padding-top: 12px; border-top: 1px solid var(--line); }
.admin-users-table .actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.admin-users-table td > .button { width: 100%; }
.admin-users-table .status { justify-self: start; }
.admin-page .matrix-scroll { max-width: 100%; }
.admin-page .communication-matrix { min-width: 710px; table-layout: auto; }
.admin-page .matrix-switch { min-height: 48px; cursor: pointer; }
.admin-modal { max-height: calc(100dvh - 32px); }
.admin-modal .modal-inner { max-height: calc(100dvh - 34px); overscroll-behavior: contain; }
.admin-modal .modal-head { gap: 16px; }
.admin-modal .modal-head .icon-button { flex: 0 0 44px; width: 44px; height: 44px; }

@container administration (max-width: 820px) {
  .admin-page .admin-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-page .settings-grid { grid-template-columns: minmax(0,1fr); }
  .admin-page .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@container administration (max-width: 760px) {
  .admin-page :is(.admin-subjects-table, .admin-groups-table, .admin-timetable-table) { display: block; overflow: visible; }
  :is(.admin-subjects-table, .admin-groups-table, .admin-timetable-table) thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  :is(.admin-subjects-table, .admin-groups-table, .admin-timetable-table) tbody { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 14px; align-items: start; }
  :is(.admin-subjects-table, .admin-groups-table, .admin-timetable-table) tr { min-width: 0; padding: 16px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  :is(.admin-subjects-table, .admin-groups-table, .admin-timetable-table) td { min-width: 0; padding: 0; display: grid; align-content: start; gap: 6px; border: 0; }
  :is(.admin-subjects-table, .admin-groups-table, .admin-timetable-table) td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 750; }
  :is(.admin-subjects-table, .admin-groups-table, .admin-timetable-table) td[data-label="Aktionen"],
  .admin-groups-table td:not([data-label="Mitglieder"]), .admin-timetable-table td[data-label="Hinweis"] { grid-column: 1/-1; }
  .admin-subjects-table tr { grid-template-columns: 52px minmax(0,1fr); }
  .admin-page .actions .button { flex: 1 1 110px; }
  .admin-page .list-item, .admin-page .update-admin-item { flex-wrap: wrap; }
}
@container administration (max-width: 760px) {
  /* Each sender gets a card, so all recipients remain visible without swiping. */
  .admin-page .communication-matrix { display: block; min-width: 0; }
  .communication-matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .communication-matrix tbody { display: grid; gap: 14px; }
  .communication-matrix tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 14px; gap: 12px; border: 1px solid var(--line); border-radius: 14px; }
  .admin-page .communication-matrix tbody th { grid-column: 1/-1; min-width: 0; padding: 0 0 10px; font-size: 13px; text-transform: none; letter-spacing: normal; }
  .communication-matrix tbody th::before { content: "Absender: "; color: var(--muted); font-weight: 400; }
  .admin-page .communication-matrix td { min-width: 0; padding: 0; border: 0; }
  .communication-matrix td::before { content: "An " attr(data-label); display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
  .admin-page .matrix-switch { padding: 8px; border-radius: 10px; background: var(--surface-soft); }
  .admin-page .form-actions .button { width: 100%; }
}
@container administration (max-width: 440px) {
  .admin-page .admin-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 16px; }
  .admin-page .page-header { margin-bottom: 18px; }
  .admin-page .page-header h1 { font-size: 30px; }
  .admin-page .subtitle { font-size: 14px; }
  .admin-section-stack { gap: 16px; }
  .admin-page .panel { border-radius: 16px; }
  .admin-page .panel-head { padding: 16px 14px; align-items: stretch; flex-direction: column; gap: 12px; }
  .admin-page .panel-head > div { flex-basis: auto; }
  .admin-page .panel-head h2 { font-size: 19px; }
  .admin-page .panel-head > .button { width: 100%; }
  .admin-page .panel-body { padding: 14px; }
  .admin-page .stats-grid { gap: 10px; margin-bottom: 16px; }
  .admin-page .stat { padding: 14px; }
  .admin-page .stat span { font-size: 12px; }
  .admin-page .stat strong { font-size: 26px; }
  .admin-page .list-item { align-items: stretch; flex-direction: column; }
  .admin-page .list-item > .actions { width: 100%; }
  .admin-users-table tr { padding: 14px; gap: 14px 10px; }
  .admin-page .feature-toggle-card { padding: 14px 12px; gap: 10px; }
  .admin-page .task-top, .admin-page .task-foot { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .main-content:has(.admin-page) { padding-left: max(16px,env(safe-area-inset-left)); padding-right: max(16px,env(safe-area-inset-right)); padding-bottom: max(32px,env(safe-area-inset-bottom)); }
  .admin-page :is(input, select, textarea), .admin-modal :is(input, select, textarea) { font-size: 16px; }
}
@media (max-width: 560px) {
  .admin-modal .modal-inner { padding: 18px 14px max(18px,env(safe-area-inset-bottom)); }
  .admin-modal .form-actions .button { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; } }

/* Invitation batches: selectable codes on screen, cut-out cards on A4. */
.invitation-codes { font-family: ui-monospace, monospace; letter-spacing: .04em; line-height: 1.8; }
.invitation-print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { height: auto !important; overflow: visible !important; background: white !important; }
  body:has(> .invitation-print-sheet) > :not(.invitation-print-sheet) { display: none !important; }
  body:has(> .invitation-print-sheet) dialog::backdrop { display: none !important; }
  .invitation-print-sheet { display: block !important; color: black; font: 10pt/1.4 Arial, sans-serif; }
  .invitation-print-card { display: inline-block; vertical-align: top; box-sizing: border-box; width: 48%; margin: 0 1% 5mm 0; padding: 5mm; border: 1px dashed #555; break-inside: avoid; page-break-inside: avoid; overflow-wrap: anywhere; }
  .invitation-print-card h2 { margin: 0 0 3mm; font: bold 13pt Arial, sans-serif; color: black; }
  .invitation-print-card p { margin: 3mm 0 0; color: black; }
  .invitation-print-code { display: block; margin: 4mm 0; font: bold 13pt ui-monospace, monospace; letter-spacing: .04em; white-space: nowrap; }
}

.admin-page .panel-head > .admin-user-actions { justify-content: flex-end; }
@media (min-width: 900px) {
  .admin-page .panel-head > .admin-user-actions { flex: 1 1 520px; }
}

/* SchulPlan access: one audience choice and a scrollable account list. */
.schulplan-access-choices, .schulplan-user-selection { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 12px; }
.schulplan-access-choices legend, .schulplan-user-selection legend { padding: 0 6px; font-weight: 750; }
.schulplan-user-selection { max-height: 320px; overflow-y: auto; background: var(--surface-soft); }
.schulplan-user-selection .check { align-items: flex-start; overflow-wrap: anywhere; }
.schulplan-user-selection small { color: var(--muted); }

.live-page .live-lesson-card h3{margin:0;font-size:1.2rem}.live-page .permission-note{margin-bottom:24px}.live-lesson-card .actions{flex-wrap:wrap}.live-conference{position:fixed;inset:0;z-index:1100;background:#101c30;color:white;display:flex;flex-direction:column;padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom))}.live-conference[hidden]{display:none}.live-conference-head{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:8px}.live-conference-head strong{flex:1;font-size:1.2rem}.live-conference-head .button{color:white;border-color:#8ca4c5}#live-video-stage{flex:1;min-height:240px}#live-video-stage iframe{border:0;width:100%;height:100%}.live-connection-status{margin:8px}.live-browser-fallback{align-self:flex-start}@media(max-width:600px){.live-conference-head span{font-size:.8rem}.live-conference-head strong{flex-basis:100%}.live-lesson-card .actions .button{flex:1}.live-page fieldset{min-width:0}}

.live-conference.compact{inset:auto 16px 16px auto;width:min(560px,calc(100vw - 32px));height:440px;border:1px solid #8ca4c5;border-radius:18px;box-shadow:0 12px 50px #0005}.live-conference.compact .live-conference-head{gap:8px}.live-conference.compact .live-conference-head strong{font-size:1rem}.live-conference.compact .live-conference-head span{display:none}.live-conference.compact #live-video-stage{min-height:100px}.live-conference.compact .button{padding:6px 10px;font-size:.8rem}@media(max-width:600px){.live-conference.compact{height:40dvh;min-height:260px;inset:auto 8px 8px;width:calc(100vw - 16px)}}
@media(max-width:600px){.live-conference-head{gap:8px}.live-conference-head span{flex-basis:100%}.live-conference-head .button{font-size:.8rem;padding:8px 10px;min-height:38px;flex:1 1 calc(50% - 8px)}.live-conference.compact{height:45dvh;min-height:320px}.live-conference.compact .live-connection-status{display:none}.live-conference.compact .live-browser-fallback{font-size:.75rem}}
.live-whiteboard{position:fixed;inset:12px 12px 12px auto;z-index:1250;width:min(620px,calc(100vw - 24px));overflow:auto;padding:20px;border:1px solid var(--line);border-radius:18px;background:white;color:#10213a;box-shadow:0 12px 60px #0005}.live-whiteboard[hidden]{display:none}.live-whiteboard header,.live-board-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.live-whiteboard h2{font-size:1.25rem;flex:1}.live-whiteboard svg{display:block;width:100%;aspect-ratio:10/7;background:#fff;border:1px solid #a7b8ce;touch-action:none;cursor:crosshair}.live-board-tools{margin:16px 0}.live-board-tools label{display:flex;align-items:center;gap:8px}.live-whiteboard [role=status]{font-size:.85rem;color:#465b75}.live-video-check{align-self:flex-start;margin-top:8px}@media(max-width:600px){.live-whiteboard{inset:0;width:100%;border-radius:0}.live-whiteboard header .button{flex-basis:100%}}
.live-whiteboard svg{user-select:none}
/* A presented worksheet is the main stage; the video connection stays mounted. */
.live-whiteboard{inset:12px;width:auto;max-width:none;padding:18px 22px 220px}.live-whiteboard header>div{flex:1}.live-whiteboard header p{margin:3px 0;color:#465b75}.live-board-layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:20px;align-items:start}.live-board-layout>div{min-width:0}.live-board-layout aside{padding:16px;border-radius:12px;background:#f0f4fa}.live-board-layout aside[hidden]{display:none}.live-board-layout:has(aside[hidden]){grid-template-columns:1fr}.live-board-layout aside p{font-size:.85rem;line-height:1.5}.live-board-layout input[type=file]{max-width:100%}.live-board-layout [data-board-people]>div{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:10px 0;border-bottom:1px solid #c7d3e0}.live-board-layout [data-board-people] span{flex:1}.live-board-layout .button{font-size:.85rem}.live-board-paper{max-width:1100px;margin:auto}.live-board-paper svg{max-height:none}.live-board-paper image[hidden]{display:none}.live-whiteboard textarea{width:100%;color:#10213a;background:white}.live-whiteboard select{color:#10213a;background:white}.live-whiteboard [data-board-text-form]{padding:12px;border:1px solid #a7b8ce;border-radius:12px;margin-top:12px}.live-whiteboard [data-board-text-form][hidden]{display:none}.live-board-present #live-conference{inset:auto 24px 20px auto;width:300px;height:180px;min-height:0;z-index:1260;overflow:hidden;border-radius:12px;box-shadow:0 5px 25px #0006;padding:0}.live-board-present #live-video-stage{height:100%;min-height:0}.live-board-present .live-conference-head,.live-board-present .live-connection-status,.live-board-present .live-browser-fallback,.live-board-present .live-video-check{display:none!important}@media(max-width:760px){.live-whiteboard{inset:0;padding:14px 14px 190px}.live-board-layout{grid-template-columns:1fr}.live-board-layout aside{order:2}.live-board-present #live-conference{right:12px;bottom:12px;width:240px;height:150px}.live-board-tools label{font-size:.85rem}.live-whiteboard header .button{flex-basis:auto}}
.live-extra-options{font-size:.85rem;padding:4px 0}.live-extra-options summary{cursor:pointer;color:#c5d8ef;padding:6px 0}.live-extra-options[open] .live-browser-fallback{margin-top:8px}.live-board-present .live-extra-options{display:none}
.live-board-tools input[type=color]{width:46px;min-width:46px;height:38px;padding:3px;border:1px solid #a7b8ce;border-radius:8px}.live-board-tools input[type=range]{width:150px;padding:0}

/* Full-bleed video: Jitsi owns microphone, camera, chat and leaving the meeting. */
.live-conference{padding:0;background:#040c14;overflow:hidden}.live-conference-head{flex:none;min-height:50px;padding:6px max(12px,env(safe-area-inset-right)) 6px max(16px,env(safe-area-inset-left));padding-top:max(6px,env(safe-area-inset-top));gap:10px;flex-wrap:nowrap;background:#101a27}.live-conference-head strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.95rem;flex:1 1 auto}.live-conference-head .button,.live-conference-head summary{min-height:36px;padding:7px 12px;font-size:.85rem;border-radius:8px;flex:none}#live-video-stage{min-height:0;position:relative;width:100%;overflow:hidden}#live-video-stage iframe{display:block}.live-extra-options{position:relative;flex:none;padding:0}.live-extra-options summary{list-style:none;color:#e3eaf2;cursor:pointer;border:1px solid #4b5b71;user-select:none}.live-extra-options summary::-webkit-details-marker{display:none}.live-extra-options[open] summary{background:#293b52}.live-options-menu{position:absolute;z-index:10;right:0;top:calc(100% + 8px);width:min(280px,calc(100vw - 24px));padding:8px;border:1px solid #4b5b71;border-radius:12px;background:#162436;box-shadow:0 12px 35px #0007}.live-options-menu .button{display:block;width:100%;text-align:left;margin:3px 0;white-space:normal}.live-options-menu [hidden]{display:none}.live-options-menu .live-browser-fallback{margin-top:3px}.live-connection-status{position:absolute;left:16px;bottom:90px;max-width:min(600px,calc(100vw - 32px));z-index:3;padding:10px 14px;border-radius:10px;background:#101c30ed;font-size:.9rem;margin:0}.live-conference[data-connected] .live-connection-status{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.live-conference.compact{padding:0;overflow:visible}.live-conference.compact #live-video-stage{min-height:0;overflow:hidden;border-radius:0 0 18px 18px}.live-conference.compact .live-conference-head{border-radius:18px 18px 0 0}.live-board-present #live-conference{overflow:hidden}.live-board-present .live-extra-options{display:none}@media(max-width:600px){.live-conference-head{gap:6px;min-height:48px}.live-conference-head strong{flex-basis:auto;font-size:.85rem}.live-conference-head .button,.live-conference-head summary{flex:none;padding:6px 9px;font-size:.8rem;min-height:36px}}
/* Keep secondary links readable inside the dark meeting menu. */
.live-options-menu .button.secondary{background:#243b53;color:#f3f7fc;border-color:#7890ac}.live-options-menu .button.danger{background:#b9233b;color:#fff;border-color:#ef7687}
.live-board-tool-buttons{display:flex;gap:6px}.live-board-tools .board-tool{display:inline-flex;align-items:center;gap:7px;background:#edf3fa;color:#233b56;border:1px solid #b5c6da}.live-board-tools .board-tool[aria-pressed=true]{background:#165ed0;border-color:#165ed0;color:#fff}.live-board-tools .board-tool-icon{display:block;width:20px;height:20px;aspect-ratio:auto;background:none;border:0;stroke:currentColor;stroke-width:1.7;fill:none;touch-action:auto}.live-board-hint{font-size:.85rem;color:#465b75;margin:0 0 12px}.live-board-inline-input,.live-board-text-view{box-sizing:border-box;width:100%;height:100%;margin:0;padding:6px;border:2px solid transparent;line-height:1.3;font-family:Arial,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;overflow:hidden;background:transparent}.live-whiteboard .live-board-inline-input{resize:none;min-height:0;outline:none;border:2px dashed #2563eb;border-radius:5px;background:#fffffff2;touch-action:auto;box-shadow:0 2px 8px #2563eb20}.live-board-text-view{pointer-events:none}.live-board-paper .own-text{cursor:text}.live-board-paper .own-text .live-board-text-view{pointer-events:auto}.live-board-inline-input:disabled{opacity:.75}
