:root {
  color-scheme: light;
  --ink: #202a25;
  --ink-soft: #526057;
  --muted: #7b867d;
  --line: #e3e8df;
  --paper: #fffefa;
  --canvas: #f5f6f0;
  --primary: #416957;
  --primary-dark: #315443;
  --primary-soft: #edf3eb;
  --accent: #c77857;
  --accent-soft: #fbf0e9;
  --success: #39765b;
  --success-soft: #edf5ee;
  --danger: #b9504b;
  --danger-soft: #fbefec;
  --gold: #b98a49;
  --shadow: 0 26px 70px rgba(39, 56, 44, .11);
  --shadow-soft: 0 8px 26px rgba(39, 56, 44, .055);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(40, 92, 246, .34);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 14px; border-radius: 8px; color: white; background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.boot-screen, .auth-screen { display: grid; min-height: 100vh; place-content: center; justify-items: center; padding: 24px; }
.boot-screen p { color: var(--muted); font-size: 13px; }
.auth-screen { position: relative; overflow: hidden; background: radial-gradient(ellipse at 90% 0%, #e8efff 0, transparent 34%), var(--canvas); }
.auth-layout { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 980px); min-height: 560px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.auth-aside { display: flex; min-height: 100%; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 44px; color: white; background: #111722; }
.auth-aside::after { align-self: flex-end; width: 230px; height: 230px; margin: auto -90px -125px 0; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.025),0 0 0 62px rgba(255,255,255,.02); content: ""; }
.auth-aside .brand { color: white; }
.auth-aside h1 { max-width: 400px; margin: auto 0 14px; font-size: clamp(34px,4vw,52px); font-weight: 560; line-height: 1.02; letter-spacing: -2.3px; }
.auth-aside p { max-width: 370px; color: #aeb6c5; font-size: 14px; line-height: 1.7; }
.auth-aside .note { font-size: 12px; }
.auth-form-wrap { display: flex; align-items: center; padding: clamp(32px,5vw,68px); }
.auth-form { width: 100%; }
.auth-form h2 { margin: 0 0 9px; font-size: 29px; font-weight: 620; letter-spacing: -1px; }
.auth-form > p { margin: 0 0 30px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.auth-form .field { margin-bottom: 18px; }
.auth-form .button { width: 100%; margin-top: 8px; }
.auth-footer { margin-top: 20px !important; color: var(--muted) !important; font-size: 12px !important; line-height: 1.6 !important; }

.brand { display: inline-flex; min-width: 0; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: white; background: var(--primary); font-size: 19px; font-weight: 760; letter-spacing: -1px; }
.brand-name { display: flex; min-width: 0; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 780; letter-spacing: 1.05px; line-height: 1; }
.brand-tagline { color: var(--muted); font-size: 8px; font-weight: 650; letter-spacing: 1px; }
.auth-aside .brand-mark { color: var(--ink); background: white; }
.auth-aside .brand-tagline { color: #aeb6c5; }

.app-shell { min-height: 100vh; }
.app-header { position: sticky; z-index: 20; top: 0; display: grid; grid-template-columns: minmax(170px,1fr) auto minmax(170px,1fr); height: 76px; align-items: center; gap: 24px; padding: 0 clamp(24px,5vw,76px); border-bottom: 1px solid rgba(222,226,234,.85); background: rgba(255,255,255,.94); backdrop-filter: blur(18px); }
.app-header .brand-mark { width: 35px; height: 35px; }
.desktop-nav { display: flex; align-items: center; justify-content: center; gap: 3px; }
.nav-button { display: flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 11px; border: 0; border-radius: 8px; color: #687082; background: transparent; font-size: 11px; font-weight: 550; white-space: nowrap; transition: color .15s,background .15s; }
.nav-button:hover { color: var(--ink); background: #f4f6f9; }
.nav-button.active { color: var(--primary); background: var(--primary-soft); font-weight: 650; }
.nav-icon { display: block; width: 17px; height: 17px; flex: 0 0 auto; color: currentColor; }
.nav-label-short { display: none; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.today-label { color: var(--muted); font-size: 11px; text-transform: capitalize; white-space: nowrap; }
.topbar-profile { display: flex; align-items: center; gap: 8px; padding: 3px 9px 3px 3px; border: 1px solid transparent; border-radius: 24px; color: var(--ink); background: transparent; }
.topbar-profile:hover { border-color: var(--line); background: #f7f8fa; }
.avatar { display: grid; width: 33px; height: 33px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #1744d4; background: #eaf0ff; font-size: 10px; font-weight: 750; }
.topbar-name { font-size: 11px; font-weight: 650; }
.logout-button { display: inline-flex; min-height: 36px; align-items: center; gap: 8px; padding: 0 10px; border: 0; border-radius: 8px; color: #697184; background: transparent; font-size: 11px; font-weight: 600; }
.logout-button:hover { color: var(--danger); background: var(--danger-soft); }
.mobile-nav, .mobile-more-button, .mobile-more-menu, .mobile-logout { display: none; }
.app-main { width: 100%; }
.content { width: min(100%, 1360px); margin: 0 auto; padding: 42px clamp(22px,5vw,76px) 70px; }

.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 29px; }
.welcome-row .eyebrow { margin-bottom: 11px; color: var(--muted); font-size: 10px; font-weight: 680; letter-spacing: .55px; text-transform: capitalize; }
.welcome-row .eyebrow span { padding: 0 4px; color: var(--primary); }
.welcome-row h1 { margin: 0; font-size: clamp(32px,4vw,46px); font-weight: 630; line-height: 1.08; letter-spacing: -2.1px; }
.welcome-row > div > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.welcome-mark { color: #dce2ec; font-size: clamp(60px,10vw,100px); font-weight: 780; line-height: .75; letter-spacing: -10px; }
.welcome-mark span { color: var(--primary); }
.dashboard-feature { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(230px,.6fr); min-height: 270px; overflow: hidden; border-radius: 18px; color: white; background: #151a25; }
.dashboard-feature-admin { background: #131925; }
.dashboard-feature-teacher { background: #162436; }
.dashboard-feature-student { background: #1b273f; }
.feature-copy { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(28px,5vw,56px); }
.feature-copy::after { position: absolute; right: 0; bottom: -210px; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.025),0 0 0 75px rgba(255,255,255,.02); content: ""; pointer-events: none; }
.feature-overline { display: flex; align-items: center; gap: 9px; margin: 0 0 20px; color: #aeb9ca; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.feature-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #5f91ff; box-shadow: 0 0 0 4px rgba(95,145,255,.15); }
.feature-copy h2 { max-width: 600px; margin: 0; font-size: clamp(29px,4vw,45px); font-weight: 580; line-height: 1.06; letter-spacing: -1.9px; }
.feature-copy > p:not(.feature-overline) { max-width: 480px; margin: 13px 0 22px; color: #b8c0ce; font-size: 13px; line-height: 1.6; }
.feature-cta { position: relative; z-index: 1; min-height: 43px; color: white; background: var(--primary); }
.feature-cta:hover { color: white; background: #3d70ff; }
.feature-next { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 28px; border-left: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.035); }
.feature-next-label { margin-bottom: 16px; color: #aab5c7; font-size: 9px; font-weight: 680; letter-spacing: 1px; }
.feature-next strong { font-size: 18px; font-weight: 620; line-height: 1.25; }
.feature-next > span:not(.feature-next-label) { margin-top: 7px; color: #b8c0ce; font-size: 11px; }
.feature-link { margin-top: 21px; padding: 0; border: 0; color: #94b3ff; background: transparent; font-size: 11px; font-weight: 620; }
.feature-link:hover { color: white; }
.quick-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 14px 0 22px; }
.quick-stat { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 10px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; text-align: left; transition: border-color .15s,transform .15s; }
.quick-stat:hover { transform: translateY(-2px); border-color: #bdcafa; }
.quick-stat > span:first-child { color: #778092; font-size: 11px; }
.quick-stat > strong { grid-row: span 2; color: var(--ink); font-size: 29px; font-weight: 650; letter-spacing: -1.3px; }
.quick-stat-link { color: var(--primary); font-size: 10px; font-weight: 620; }
.home-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.75fr); gap: 16px; align-items: start; }
.home-primary,.home-secondary { display: grid; min-width: 0; gap: 15px; }
.home-schedule-panel { overflow: hidden; }
.home-activity-panel,.home-library-panel { min-width: 0; }
.panel,.dashboard-panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow-soft); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-heading h2,.panel-heading h3 { margin: 0; font-size: 16px; font-weight: 630; letter-spacing: -.35px; }
.panel-heading .section-kicker { margin: 0 0 5px; }
.section-kicker { margin: 0 0 12px; color: var(--primary); font-size: 9px; font-weight: 720; letter-spacing: 1.05px; text-transform: uppercase; }
.text-button { padding: 5px 0; border: 0; color: var(--primary); background: transparent; font-size: 11px; font-weight: 650; white-space: nowrap; }
.text-button:hover { color: var(--primary-dark); text-decoration: underline; }
.empty-state { display: grid; justify-items: center; padding: 27px 13px; color: var(--muted); text-align: center; }
.empty-state strong { margin: 9px 0 5px; color: var(--ink); font-size: 13px; font-weight: 620; }
.empty-state p { max-width: 330px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-symbol { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #dfe7ff; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 17px; }
.lesson-list,.activity-list,.resource-list { display: grid; }
.lesson-item { display: grid; grid-template-columns: 72px 3px minmax(0,1fr); gap: 13px; align-items: center; padding: 14px 0; border-top: 1px solid #edf0f4; }
.lesson-item:first-child { border-top: 0; }
.lesson-time { color: var(--primary); font-size: 11px; font-weight: 680; line-height: 1.55; }
.lesson-bar { align-self: stretch; border-radius: 4px; background: var(--primary); }
.lesson-details strong,.lesson-details span { display: block; }
.lesson-details strong { font-size: 13px; font-weight: 650; }
.lesson-details span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.mini-list-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #edf0f4; }
.mini-list-item:first-child { border-top: 0; }
.mini-list-item strong { display: block; font-size: 12px; line-height: 1.45; }
.mini-list-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.mini-meta { flex: 0 0 auto; color: var(--primary) !important; font-size: 10px !important; font-weight: 650; }
.dashboard-clock,.practice-nudge,.admin-shortcut { display: flex; width: 100%; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; text-align: left; transition: border-color .15s,transform .15s; }
.dashboard-clock:hover,.practice-nudge:hover,.admin-shortcut:hover { transform: translateY(-1px); border-color: #b8c8fa; }
.dashboard-clock.is-active { border-color: #b8ddc9; background: #f3faf6; }
.dashboard-clock-icon,.dashboard-admin-icon,.admin-shortcut-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.dashboard-clock-copy { display: grid; min-width: 0; flex: 1; gap: 4px; }
.dashboard-clock-copy small,.practice-nudge small { color: var(--primary); font-size: 9px; font-weight: 720; letter-spacing: .8px; }
.dashboard-clock-copy strong,.practice-nudge strong,.admin-shortcut strong { font-size: 12px; font-weight: 650; }
.dashboard-clock-copy > span,.admin-shortcut small,.practice-nudge > span:nth-child(2) > span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.practice-nudge-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: white; background: var(--primary); font-size: 20px; }
.practice-nudge > span:nth-child(2),.admin-shortcut > span:nth-child(2) { display: grid; flex: 1; gap: 5px; }
.admin-shortcut small { display: block; margin-top: 4px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 9px; font-weight: 720; letter-spacing: 1.05px; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-size: clamp(28px,3.5vw,38px); font-weight: 640; line-height: 1.12; letter-spacing: -1.5px; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.date-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: white; font-size: 10px; white-space: nowrap; }
.date-pill > span { color: var(--primary); }
.content-grid,.dashboard-columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.8fr); gap: 15px; align-items: start; }
.dashboard-main-column,.dashboard-side-column { display: grid; min-width: 0; gap: 14px; }
.content-grid > .panel + .panel { margin-top: 0; }
.panel + .panel { margin-top: 14px; }

.schedule-scroll-hint { display: none; margin: -3px 0 10px; color: var(--muted); font-size: 11px; }
.schedule-grid { display: grid; grid-template-columns: repeat(7,minmax(112px,1fr)); gap: 8px; overflow-x: auto; padding-bottom: 7px; scrollbar-color: #c9d3e5 transparent; scrollbar-width: thin; }
.schedule-day { min-height: 145px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.schedule-day.today { border-color: #aabdf9; background: #f4f7ff; box-shadow: inset 0 2px var(--primary); }
.schedule-day-header { display: flex; align-items: baseline; justify-content: space-between; padding: 11px 9px 9px; border-bottom: 1px solid #edf0f4; }
.schedule-day-header strong { font-size: 10px; font-weight: 660; }
.schedule-day-header span { color: var(--muted); font-size: 9px; }
.schedule-lessons { display: grid; gap: 7px; padding: 8px; }
.schedule-card { padding: 9px; border-radius: 7px; background: #edf2ff; }
.schedule-card strong,.schedule-card span { display: block; }
.schedule-card strong { color: #1c3eab; font-size: 9px; line-height: 1.4; }
.schedule-card span { margin-top: 4px; color: var(--ink-soft); font-size: 9px; line-height: 1.35; }
.schedule-card.inactive { opacity: .5; background: #f1f2f4; }
.schedule-day .field-hint { font-size: 9px; }

.button { display: inline-flex; min-height: 41px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; color: white; background: var(--primary); font-size: 12px; font-weight: 640; transition: background .14s,border-color .14s,transform .14s; }
.button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button.secondary { border-color: var(--line); color: var(--ink-soft); background: white; }
.button.secondary:hover { border-color: #c3d0fa; color: var(--primary); background: #f8faff; }
.button.danger { color: var(--danger); background: var(--danger-soft); }
.button.small { min-height: 34px; padding: 0 10px; font-size: 10px; }
.button.ghost { padding: 0 8px; color: var(--primary); background: transparent; }
.button.ghost:hover { background: var(--primary-soft); }
.icon-button { display: inline-grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: white; text-decoration: none; }
.icon-button:hover { border-color: #c3d0fa; color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field.full { grid-column: 1/-1; }
.field label,.field-label { color: #434b5a; font-size: 11px; font-weight: 650; }
.field input,.field select,.field textarea { width: 100%; min-width: 0; min-height: 43px; padding: 10px 12px; border: 1px solid #dfe3eb; border-radius: 8px; outline: none; color: var(--ink); background: white; font-size: 12px; }
.field textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.field input:focus,.field select:focus,.field textarea:focus { border-color: #8da8ff; box-shadow: 0 0 0 3px rgba(40,92,246,.1); }
.field input::placeholder,.field textarea::placeholder { color: #9aa2b1; }
.field-hint { margin: -2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 16px; }
.checkbox-list { display: grid; max-height: 160px; gap: 9px; overflow-y: auto; padding: 11px; border: 1px solid var(--line); border-radius: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 11px; }
.checkbox-row input { width: 15px; min-height: 15px; margin: 0; accent-color: var(--primary); }
.notice { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; margin-bottom: 15px; padding: 13px 14px; border: 1px solid #cce7d8; border-radius: 9px; color: #20633f; background: #f0faf4; font-size: 12px; line-height: 1.5; }
.notice.error { border-color: #f0cbcb; color: var(--danger); background: #fff5f5; }
.notice strong { display: block; margin-bottom: 3px; }
.notice code { display: inline-block; margin: 5px 4px 0 0; padding: 4px 7px; border-radius: 5px; background: white; font-size: 12px; font-weight: 700; }
.stack { display: grid; gap: 16px; }
.split-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.split-heading h2 { margin: 0; font-size: 16px; font-weight: 630; }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border: 1px solid #dfe5f4; border-radius: 6px; color: #3052bb; background: #f0f4ff; font-size: 9px; font-weight: 670; white-space: nowrap; }
.badge.teacher { border-color: #f0dfbf; color: #80612c; background: #fbf5e9; }
.badge.admin { border-color: #f0d3d3; color: var(--danger); background: #fff2f2; }
.badge.inactive { border-color: #e5e7eb; color: #797f8b; background: #f5f6f7; }

.activity-card { padding: 14px 0; border-top: 1px solid #edf0f4; }
.activity-card:first-child { padding-top: 2px; border-top: 0; }
.activity-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.activity-card h3 { margin: 0; font-size: 13px; line-height: 1.45; }
.activity-card p { margin: 8px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.activity-meta { display: flex; flex-wrap: wrap; gap: 5px 11px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.resource-library { grid-column: 1/-1; }
.resource-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.resource-search { display: flex; min-height: 40px; flex: 1; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; }
.resource-search input { width: 100%; min-width: 0; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 12px; }
.resource-filters select { min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: white; font-size: 11px; }
.resource-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.resource-card { display: grid; min-width: 0; grid-template-rows: auto 1fr auto; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s,transform .15s; }
.resource-card:hover { transform: translateY(-2px); border-color: #b9c9fa; }
.resource-card[hidden] { display: none; }
.resource-card-top { display: flex; align-items: center; justify-content: space-between; }
.resource-type-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-size: 19px; }
.resource-type-icon.audio { color: #097b75; background: var(--accent-soft); }
.resource-type-icon.image { color: #8256a3; background: #f4edfa; }
.file-type { padding: 5px 7px; border-radius: 5px; color: #697386; background: #f1f3f6; font-size: 8px; font-weight: 760; letter-spacing: .4px; }
.resource-card-copy { min-width: 0; }
.resource-card-copy h3 { overflow: hidden; margin: 0; font-size: 12px; font-weight: 660; text-overflow: ellipsis; white-space: nowrap; }
.resource-card-copy p { margin: 6px 0 0; color: var(--ink-soft); font-size: 10px; }
.resource-card-copy > span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.resource-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.resource-empty-filter { margin: 20px 0; color: var(--muted); font-size: 12px; text-align: center; }
.resource-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #edf0f4; }
.resource-row:first-child { border-top: 0; }
.resource-link { display: flex; min-width: 0; align-items: center; gap: 10px; }
.resource-copy { min-width: 0; }
.resource-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.resource-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.resource-row > div:last-child { display: flex; gap: 6px; }
.upload-dropzone { display: grid; min-height: 118px; justify-items: center; align-content: center; gap: 7px; padding: 15px; border: 1px dashed #b7c4de; border-radius: 10px; color: var(--ink-soft); background: #f8faff; text-align: center; cursor: pointer; }
.upload-dropzone:hover { border-color: var(--primary); background: #f2f6ff; }
.upload-dropzone strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.upload-dropzone > span:last-of-type { color: var(--muted); font-size: 10px; line-height: 1.5; }
.upload-glyph { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--primary); background: #e8efff; font-size: 17px; font-weight: 700; }
.upload-dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.upload-progress { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; align-items: center; margin-top: 10px; color: var(--ink-soft); font-size: 10px; }
.upload-progress progress { width: 100%; height: 7px; grid-column: 1/-1; accent-color: var(--primary); }
.upload-progress strong { color: var(--primary); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; min-width: 620px; border-collapse: collapse; background: white; text-align: left; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #778092; background: #f7f8fa; font-size: 9px; font-weight: 700; letter-spacing: .65px; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid #edf0f4; font-size: 11px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td strong { display: block; font-size: 11px; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.admin-grid .wide { grid-column: 1/-1; }
.admin-grid > .panel { padding: 21px; }
.admin-grid > .panel .panel-heading { align-items: flex-start; }

.tool-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #eceff4; }
.tool-tab { min-height: 37px; padding: 0 14px; border: 0; border-radius: 6px; color: #667083; background: transparent; font-size: 11px; font-weight: 630; }
.tool-tab.active { color: var(--ink); background: white; box-shadow: 0 1px 3px rgba(20,28,40,.11); }
.practice-panel { padding: clamp(20px,3vw,32px); }
.tool-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(230px,.75fr); gap: 20px; align-items: center; }
.metronome-face { display: grid; justify-items: center; padding: 29px 18px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fb; }
.tempo-number { display: flex; align-items: baseline; gap: 7px; margin: 13px 0 18px; }
.tempo-number strong { font-size: 64px; font-weight: 650; letter-spacing: -4px; }
.tempo-number span { color: var(--muted); font-size: 12px; font-weight: 650; }
.tempo-controls { display: flex; align-items: center; gap: 12px; }
.tempo-input { width: 95px; min-height: 42px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 17px; font-weight: 650; text-align: center; }
.beat-row { display: flex; gap: 10px; margin: 0 0 15px; }
.beat-dot { width: 10px; height: 10px; border-radius: 50%; background: #d4d9e2; transition: background .08s; }
.beat-dot.active { background: #4b7aff; box-shadow: 0 0 0 5px rgba(40,92,246,.1); }
.beat-dot.accent.active { background: var(--primary); box-shadow: 0 0 0 5px rgba(40,92,246,.15); }
.tempo-range { width: min(100%,300px); accent-color: var(--primary); }
.tool-settings { display: grid; gap: 12px; }
.tool-copy h3 { margin: 0 0 8px; font-size: 19px; font-weight: 640; letter-spacing: -.55px; }
.tool-copy p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.tool-copy .field { margin-top: 16px; }
.feedback { min-height: 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.feedback.error { color: var(--danger); }
.tap-tempo { display: grid; width: min(100%,290px); gap: 7px; margin-top: 11px; }
.tap-tempo > span { min-height: 15px; color: var(--muted); font-size: 10px; text-align: center; }
.tuner-display { display: grid; min-height: 240px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fb; text-align: center; }
.tuner-note { color: var(--primary); font-size: 72px; font-weight: 570; line-height: .95; letter-spacing: -4px; }
.tuner-frequency { margin: 9px 0 12px; color: var(--muted); font-size: 12px; }
.tuner-meter { position: relative; width: min(78%,270px); height: 5px; margin: 12px auto; border-radius: 5px; background: linear-gradient(90deg,#efb2b2,#e4e7eb 45%,#42a87d 50%,#e4e7eb 55%,#efb2b2); }
.tuner-needle { position: absolute; top: -5px; left: 50%; width: 3px; height: 15px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); transition: left .12s; }
.tuner-cents { color: var(--ink-soft); font-size: 11px; }
.practice-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,.78fr); gap: 22px; }
.practice-focus { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fc; }
.practice-focus h3,.practice-history h3 { margin: 0; font-size: 21px; font-weight: 630; letter-spacing: -.7px; }
.practice-focus > p:not(.section-kicker) { margin: 7px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.practice-timer { margin: 13px 0 11px; color: var(--ink); font-size: clamp(40px,6vw,66px); font-variant-numeric: tabular-nums; font-weight: 570; letter-spacing: -3px; }
.practice-progress { height: 6px; overflow: hidden; border-radius: 10px; background: #e1e6f0; }
.practice-progress span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .25s; }
.practice-goal-copy { margin: 9px 0 13px !important; font-size: 10px !important; }
.practice-goals { display: flex; gap: 7px; }
.goal-chip { min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: white; font-size: 10px; font-weight: 620; }
.goal-chip.active { border-color: #b3c5ff; color: var(--primary); background: #edf2ff; }
.practice-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.practice-storage-note { margin: 13px 0 0 !important; font-size: 10px !important; }
.practice-history { padding: 4px 1px; }
.practice-today-total { color: var(--primary); font-size: 20px; font-weight: 690; white-space: nowrap; }
.practice-today-total small { color: var(--muted); font-size: 10px; font-weight: 500; }
.practice-session-list { display: grid; max-height: 300px; overflow: auto; }
.practice-session { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #edf0f4; }
.practice-session-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--success); background: var(--success-soft); font-size: 11px; }
.practice-session > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.practice-session strong { font-size: 11px; font-weight: 640; }
.practice-session small { color: var(--muted); font-size: 9px; }
.practice-session b { color: var(--ink-soft); font-size: 10px; }
.practice-tool-shortcuts { display: flex; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.practice-tool-shortcuts button { display: flex; flex: 1; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: white; font-size: 10px; }
.practice-tool-shortcuts button span { color: var(--primary); }
.practice-tip { margin: 12px 0; color: var(--muted); font-size: 11px; }

.community-toolbar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.community-toolbar .field { width: min(100%,420px); margin: 0; }
.community-grid { align-items: start; }
.community-thread,.progress-list { display: grid; max-height: 430px; gap: 9px; overflow-y: auto; padding-right: 3px; }
.community-message,.progress-note { padding: 13px; border: 1px solid #e7eaf0; border-radius: 9px; background: #fafbfc; }
.community-message.own { border-color: #cbd8ff; background: #f3f6ff; }
.community-message-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.community-message-meta strong { font-size: 11px; font-weight: 660; }
.community-message-meta span { color: var(--muted); font-size: 10px; text-align: right; }
.community-message p,.progress-note p { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.community-compose,.progress-list { margin-top: 15px; }
.community-progress form { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }

.clock-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(290px,.88fr); gap: 16px; align-items: stretch; }
.clock-hero { position: relative; display: flex; min-height: 335px; flex-direction: column; align-items: flex-start; overflow: hidden; padding: 27px; border-radius: 14px; color: white; background: #172039; }
.clock-hero::after,.clock-hero::before { position: absolute; right: -100px; bottom: -170px; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; content: ""; pointer-events: none; }
.clock-hero::before { right: -60px; bottom: -140px; width: 240px; height: 240px; }
.clock-hero-active { background: #174e3a; }
.clock-kicker,.clock-hero h2,.clock-hero > p,.clock-running,.clock-ready,.clock-action,.clock-assurance { position: relative; z-index: 1; }
.clock-kicker { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.7); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.clock-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #60d39b; box-shadow: 0 0 0 4px rgba(96,211,155,.13); }
.clock-hero h2 { margin: 25px 0 8px; font-size: 27px; font-weight: 590; letter-spacing: -.7px; }
.clock-hero > p { max-width: 420px; margin: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.6; }
.clock-running { display: grid; gap: 4px; margin: 17px 0; }
.clock-running span,.clock-running small { color: rgba(255,255,255,.68); font-size: 10px; }
.clock-running strong { font-size: 32px; font-weight: 550; font-variant-numeric: tabular-nums; }
.clock-ready { display: flex; align-items: center; gap: 10px; margin: 22px 0; color: rgba(255,255,255,.76); font-size: 11px; }
.clock-ready-icon { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; color: #b8cbff; }
.clock-action { display: flex; width: min(100%,390px); min-height: 62px; align-items: center; gap: 11px; margin-top: auto; padding: 9px 13px; border: 0; border-radius: 9px; color: var(--ink); background: white; text-align: left; }
.clock-action-stop { color: var(--danger); background: #fff6f5; }
.clock-action-symbol { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: white; background: var(--primary); }
.clock-action-stop .clock-action-symbol { background: var(--danger); }
.clock-action strong,.clock-action small { display: block; }
.clock-action strong { font-size: 11px; }
.clock-action small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.clock-action-arrow { margin-left: auto; font-size: 16px; }
.clock-assurance { margin-top: 11px; color: rgba(255,255,255,.63); font-size: 9px; }
.clock-assurance span { margin-right: 4px; color: #8be1b6; }
.clock-register-panel { padding: 21px; }
.clock-register { display: grid; }
.clock-record { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 12px 0; border-top: 1px solid #edf0f4; }
.clock-record-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: var(--success); background: var(--success-soft); font-size: 11px; }
.clock-record-info { flex: 1; min-width: 0; }
.clock-record-info strong,.clock-record-info span { display: block; }
.clock-record-info strong { font-size: 11px; }
.clock-record-info span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.clock-record-duration { flex: 0 0 auto; color: var(--primary); font-size: 10px; font-weight: 650; }
.clock-footnote { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.clock-admin-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; margin-bottom: 14px; }
.clock-admin-stat { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow-soft); }
.clock-admin-stat-icon { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.active-stat-icon { color: var(--success); background: var(--success-soft); }
.duration-stat-icon { color: #87602c; background: #faf2e5; }
.clock-admin-stat small,.clock-admin-stat strong { display: block; }
.clock-admin-stat small { color: var(--muted); font-size: 9px; }
.clock-admin-stat strong { overflow: hidden; margin-top: 5px; font-size: 18px; font-weight: 630; text-overflow: ellipsis; white-space: nowrap; }
.clock-active-panel { margin-bottom: 14px; }
.clock-active-list { display: grid; }
.clock-active-record { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid #edf0f4; }
.clock-active-record > div { flex: 1; }
.clock-active-record strong,.clock-active-record > div > span { display: block; }
.clock-active-record strong { font-size: 11px; }
.clock-active-record > div > span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.clock-badge-active { color: var(--success); background: var(--success-soft); }
.clock-report-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.clock-report-heading .section-kicker,.clock-admin-register .section-kicker { margin-bottom: 4px; }
.clock-report-heading h2 { margin: 0; font-size: 18px; font-weight: 640; }
.clock-report-heading > div:first-child > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.clock-report-actions { display: flex; align-items: flex-end; gap: 9px; }
.clock-report-actions .field { width: 155px; }
.clock-report-actions .field input { min-height: 38px; }
.clock-admin-register { margin-top: 14px; }

.profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.profile-card { padding: 19px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.profile-row { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 12px; padding: 12px 0; border-top: 1px solid #edf0f4; }
.profile-row:first-child { border-top: 0; }
.profile-row > span { color: var(--muted); font-size: 10px; }
.profile-row strong { font-size: 11px; font-weight: 630; }

.overlay-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(13,18,28,.56); backdrop-filter: blur(5px); }
.dialog { width: min(100%,480px); padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 25px 70px rgba(0,0,0,.22); }
.dialog h2 { margin: 0 0 9px; font-size: 21px; font-weight: 650; letter-spacing: -.5px; }
.dialog p { color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.invitation-dialog { width: min(100%,520px); }
.invitation-qr { display: block; width: min(100%,280px); height: auto; margin: 17px auto; border: 1px solid var(--line); border-radius: 10px; background: white; }
.invitation-dialog .field { display: block; }
.invitation-dialog .field input { margin-top: 7px; font-size: 11px; }
.invitation-dialog .form-actions { flex-wrap: wrap; }
.preview-backdrop { z-index: 55; }
.preview-dialog { display: grid; width: min(100%,980px); max-height: min(90vh,900px); grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; border-radius: 14px; background: white; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.preview-header,.preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 19px; }
.preview-header { border-bottom: 1px solid var(--line); }
.preview-header .eyebrow { margin: 0 0 4px; font-size: 8px; }
.preview-header h2 { margin: 0; font-size: 16px; font-weight: 640; }
.preview-header p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.preview-stage { display: grid; min-height: 260px; place-items: center; overflow: auto; background: #e9edf3; }
.preview-image { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; }
.preview-audio { width: min(80%,500px); }
.preview-document { width: 100%; height: 100%; min-height: 65vh; border: 0; background: white; }
.preview-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.toast { position: fixed; z-index: 80; right: 22px; bottom: 22px; max-width: min(400px,calc(100% - 44px)); padding: 13px 16px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; color: white; background: #161c28; box-shadow: var(--shadow); font-size: 12px; }

@media (max-width: 1360px) {
  .app-header { grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; padding: 0 24px; }
  .desktop-nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .desktop-nav::-webkit-scrollbar { display: none; }
  .desktop-nav .nav-button { gap: 5px; padding: 0 6px; font-size: 10px; }
  .desktop-nav .nav-label-wide { display: none; }
  .desktop-nav .nav-label-short { display: inline; }
  .today-label { display: none; }
  .content { padding-right: 28px; padding-left: 28px; }
  .home-grid { grid-template-columns: minmax(0,1.2fr) minmax(260px,.8fr); }
}

@media (max-width: 780px) {
  .app-header { display: flex; height: 64px; justify-content: space-between; padding: 0 18px; }
  .app-header .brand-name { font-size: 12px; }
  .app-header .brand-tagline { font-size: 7px; }
  .desktop-nav,.logout-button { display: none; }
  .header-actions { gap: 6px; }
  .topbar-profile { padding: 2px; }
  .topbar-name { display: none; }
  .mobile-logout { display: inline-flex; min-height: 36px; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: white; font-size: 11px; font-weight: 620; }
  .app-main { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .content { padding: 28px 22px 32px; }
  .mobile-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: flex; min-height: 66px; align-items: stretch; justify-content: space-around; gap: 3px; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid #e2e6ed; background: rgba(255,255,255,.97); box-shadow: 0 -8px 24px rgba(25,34,52,.08); backdrop-filter: blur(18px); }
  .mobile-nav .nav-button { min-width: 0; min-height: 54px; flex: 1 1 0; flex-direction: column; gap: 4px; padding: 4px 2px; border-radius: 8px; font-size: 9px; line-height: 1.1; white-space: normal; }
  .mobile-nav .nav-label-wide { display: none; }
  .mobile-nav .nav-label-short { display: inline; }
  .mobile-nav .nav-icon { width: 19px; height: 19px; }
  .mobile-more-button { display: flex !important; }
  .mobile-more-menu { position: fixed; z-index: 31; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; display: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 15px 40px rgba(23,31,46,.18); }
  .mobile-more-menu:not([hidden]) { display: grid; }
  .mobile-more-menu .nav-button { min-height: 47px; justify-content: flex-start; gap: 10px; padding: 0 12px; font-size: 11px; }
  .mobile-more-menu .nav-label-wide { display: inline; }
  .mobile-more-menu .nav-label-short { display: none; }
  .welcome-row { margin-bottom: 22px; }
  .welcome-row h1 { font-size: 35px; }
  .welcome-mark { font-size: 64px; }
  .dashboard-feature { grid-template-columns: minmax(0,1fr) minmax(180px,.65fr); min-height: 245px; }
  .feature-copy { padding: 28px; }
  .feature-copy h2 { font-size: 32px; }
  .feature-next { padding: 20px; }
  .home-grid,.content-grid,.dashboard-columns,.admin-grid,.profile-grid { grid-template-columns: 1fr; }
  .admin-grid .wide { grid-column: auto; }
  .resource-library { grid-column: auto; }
  .resource-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .clock-layout { grid-template-columns: 1fr; }
  .clock-admin-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .practice-layout { grid-template-columns: 1fr; }
  .schedule-scroll-hint { display: block; }
  .schedule-grid { grid-template-columns: repeat(7,minmax(122px,1fr)); scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .schedule-day { scroll-snap-align: start; }
}

@media (max-width: 560px) {
  .auth-screen { padding: 14px; }
  .auth-layout { grid-template-columns: 1fr; width: min(100%,440px); min-height: 0; border-radius: 14px; }
  .auth-aside { min-height: 180px; padding: 22px; }
  .auth-aside h1 { max-width: 320px; margin-top: 25px; font-size: 32px; letter-spacing: -1.3px; }
  .auth-aside p { margin-bottom: 0; font-size: 12px; }
  .auth-aside .note { display: none; }
  .auth-form-wrap { padding: 24px 21px; }
  .auth-form h2 { font-size: 25px; }
  .content { padding: 22px 15px 28px; }
  .welcome-row { align-items: flex-start; gap: 8px; }
  .welcome-row .eyebrow { font-size: 9px; }
  .welcome-row h1 { max-width: 290px; font-size: 31px; letter-spacing: -1.4px; }
  .welcome-row > div > p:last-child { font-size: 12px; }
  .welcome-mark { padding-top: 8px; font-size: 48px; letter-spacing: -6px; }
  .dashboard-feature { grid-template-columns: 1fr; }
  .feature-copy { min-height: 236px; padding: 25px 21px; }
  .feature-copy h2 { max-width: 340px; font-size: 30px; }
  .feature-copy > p:not(.feature-overline) { max-width: 320px; margin: 10px 0 17px; font-size: 12px; }
  .feature-next { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.12); border-left: 0; }
  .feature-next-label { grid-column: 1/-1; margin: 0 0 4px; }
  .feature-next strong { font-size: 14px; }
  .feature-next > span:not(.feature-next-label) { grid-column: 1/-1; margin-top: 0; }
  .feature-link { grid-column: 1/-1; margin-top: 7px; text-align: left; }
  .quick-stats { gap: 7px; margin: 10px 0 15px; }
  .quick-stat { min-height: 91px; grid-template-columns: 1fr; gap: 4px; padding: 11px 10px; }
  .quick-stat > span:first-child { min-height: 26px; font-size: 9px; line-height: 1.3; }
  .quick-stat > strong { grid-row: auto; font-size: 23px; }
  .quick-stat-link { display: none; }
  .home-grid,.home-primary,.home-secondary { gap: 11px; }
  .panel,.dashboard-panel,.admin-grid > .panel { padding: 16px; border-radius: 10px; }
  .panel-heading { align-items: center; }
  .panel-heading h2,.panel-heading h3 { font-size: 14px; }
  .section-kicker { font-size: 8px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 18px; }
  .page-heading h1 { font-size: 29px; letter-spacing: -1px; }
  .page-heading p { font-size: 12px; }
  .date-pill { display: none; }
  .button:not(.small) { min-height: 44px; font-size: 12px; }
  .button.small { min-height: 38px; font-size: 10px; }
  .field label,.field-label { font-size: 12px; }
  .field input,.field select,.field textarea { min-height: 46px; font-size: 16px; }
  .field textarea { min-height: 100px; }
  .field-hint { font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .form-actions { gap: 7px; }
  .lesson-item { grid-template-columns: 63px 3px minmax(0,1fr); gap: 10px; padding: 12px 0; }
  .lesson-time { font-size: 10px; }
  .lesson-details strong { font-size: 12px; }
  .lesson-details span { font-size: 10px; }
  .schedule-grid { grid-template-columns: repeat(7,minmax(136px,1fr)); }
  .schedule-day-header { padding: 12px 10px 10px; }
  .schedule-day-header strong,.schedule-card strong,.schedule-card span { font-size: 10px; }
  .resource-filters { align-items: stretch; flex-direction: column; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-card { grid-template-columns: 40px minmax(0,1fr); gap: 10px; padding: 12px; }
  .resource-card-top { grid-row: span 2; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 7px; }
  .resource-card-copy h3 { white-space: normal; }
  .resource-card-actions { grid-column: 2; }
  .resource-card-actions .button.small { flex: 1; }
  .resource-filters select { min-height: 44px; font-size: 14px; }
  .clock-hero { min-height: 300px; padding: 21px; }
  .clock-admin-stats { grid-template-columns: 1fr; gap: 7px; }
  .clock-admin-stat { min-height: 62px; }
  .clock-report-heading { align-items: flex-start; flex-direction: column; }
  .clock-report-actions { width: 100%; flex-wrap: wrap; }
  .clock-report-actions .field,.clock-report-actions .button { flex: 1 1 140px; }
  .community-toolbar { align-items: stretch; flex-direction: column; }
  .community-toolbar .field { width: 100%; }
  .community-message-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .community-message-meta span { text-align: left; }
  .tool-layout { grid-template-columns: 1fr; gap: 15px; }
  .tool-tabs { overflow-x: auto; }
  .tool-tab { flex: 1 0 auto; padding: 0 11px; white-space: nowrap; }
  .practice-panel { padding: 13px; }
  .practice-focus { padding: 18px; }
  .practice-controls .button { flex: 1; }
  .practice-timer { font-size: 48px; }
  .table-wrap { margin-right: -2px; }
  .clock-report-actions .field input { font-size: 14px; }
  .overlay-backdrop { align-items: end; padding: 10px; }
  .dialog { padding: 20px; border-radius: 13px 13px 9px 9px; }
  .preview-dialog { max-height: 88vh; border-radius: 13px 13px 9px 9px; }
  .preview-header,.preview-footer { padding: 12px; }
  .preview-header h2 { font-size: 14px; }
  .preview-stage { min-height: 220px; }
  .preview-document { min-height: 60vh; }
  .toast { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100% - 24px); }
  .profile-row { grid-template-columns: 82px minmax(0,1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

:root {
  --canvas: #f5f6f0;
  --paper: #fffefa;
}

body { background: var(--canvas); }
.auth-screen { background: radial-gradient(ellipse at 90% 8%, #e5ecdf 0, transparent 38%), var(--canvas); }
.auth-layout { border-color: #e6e9e1; border-radius: 30px; box-shadow: 0 32px 90px rgba(39,56,44,.12); }
.auth-aside { background: linear-gradient(150deg,#273c32,#456b55 74%,#597b60); }
.auth-aside::after { border-color: rgba(255,255,255,.18); box-shadow: 0 0 0 28px rgba(255,255,255,.04),0 0 0 62px rgba(255,255,255,.025); }
.auth-aside h1,.welcome-row h1,.page-heading h1 { font-family: Georgia,"Times New Roman",serif; font-weight: 500; letter-spacing: -1.8px; }
.brand-mark { border-radius: 13px; color: #fffefa; background: var(--primary); }
.app-header { border-color: rgba(222,228,218,.82); background: rgba(255,254,250,.92); }
.nav-button { border-radius: 999px; }
.nav-button.active { color: var(--primary-dark); background: #eaf1e8; }
.avatar { color: var(--primary-dark); background: #e8f0e6; }
.content { padding-top: 46px; }
.welcome-row h1 { font-size: clamp(36px,4vw,52px); }
.welcome-mark { color: #d9e2d5; }
.welcome-mark span { color: var(--accent); }
.dashboard-feature,.dashboard-feature-admin,.dashboard-feature-teacher,.dashboard-feature-student {
  border-radius: 28px;
  background: radial-gradient(ellipse at 85% 20%,rgba(199,120,87,.25),transparent 35%),linear-gradient(130deg,#263c32,#3d614c);
}
.dashboard-panel,.panel { border-color: #e6e9e1; border-radius: 22px; background: var(--paper); box-shadow: 0 8px 24px rgba(39,56,44,.045); }
.panel-heading h2,.panel-heading h3 { font-weight: 640; }
.panel + .panel { margin-top: 18px; }
.date-pill,.badge { border-color: var(--line); border-radius: 999px; }
.schedule-day { border-color: #e6e9e1; border-radius: 16px; background: #fffefa; }
.schedule-day.today { border-color: #aac1aa; background: #f2f6ee; box-shadow: inset 0 3px #769579; }
.schedule-card { border-radius: 11px; background: #edf3eb; }
.schedule-card strong { color: #355b48; }
.button { border-radius: 999px; background: var(--primary); }
.button:hover { background: var(--primary-dark); }
.button.secondary { border-color: var(--line); background: #fffefa; }
.button.secondary:hover { border-color: #b9cbb8; color: var(--primary-dark); background: #f5f8f2; }
.button.danger { color: var(--danger); background: var(--danger-soft); }
.button.ghost:hover { background: var(--primary-soft); }
.icon-button { border-radius: 12px; background: #fffefa; }
.field label,.field-label { color: #435349; }
.field input,.field select,.field textarea,.resource-filters select {
  border-color: #dfe5dc;
  border-radius: 13px;
  background: #fffefa;
}
.field input:focus,.field select:focus,.field textarea:focus {
  border-color: #8ba991;
  box-shadow: 0 0 0 4px rgba(65,105,87,.12);
}
.checkbox-list { border-color: var(--line); border-radius: 16px; background: #fbfcf8; }
.student-picker { display: grid; gap: 11px; }
.student-picker-search,.resource-search { border-color: var(--line); border-radius: 999px; background: #fbfcf8; }
.student-picker-search { display: flex; min-height: 44px; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); color: var(--muted); }
.student-picker-search input { width: 100%; min-width: 0; min-height: 40px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.student-picker-search input:focus-visible { outline: 0; }
.student-picker-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.student-picker-summary strong { color: var(--primary-dark); }
.student-option { min-height: 52px; padding: 9px 12px; border: 1px solid transparent; border-radius: 13px; transition: background .16s,border-color .16s; }
.student-option:hover { border-color: #e1e9dc; background: #f3f7f0; }
.student-option[hidden] { display: none; }
.student-option { display: grid; grid-template-columns: 16px minmax(0,1fr) auto; align-items: center; column-gap: 10px; row-gap: 9px; }
.student-option > input { width: 15px; min-height: 15px; margin: 0; accent-color: var(--primary); }
.student-option-copy { display: grid; gap: 3px; }
.student-option-copy { min-width: 0; text-decoration: none; }
.student-option-copy strong { color: var(--ink); font-size: 12px; font-weight: 620; }
.student-option-copy small { color: var(--muted); font-size: 10px; }
.student-instrument-field { display: grid; grid-column: 2/4; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.student-instrument-field select,.student-instrument-field input { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; border: 1px solid #dfe5dc; border-radius: 11px; color: var(--ink); background: #fffefa; font-size: 11px; }
.student-instrument-field input:focus,.student-instrument-field select:focus { border-color: #8ba991; outline: 3px solid rgba(65,105,87,.12); }
.student-check { margin-left: auto; color: var(--primary); opacity: 0; }
.student-option.selected { border-color: #dae6d7; background: #f0f5ed; }
.student-option.selected .student-check { opacity: 1; }
.class-title-preview { display: block; min-height: 42px; padding: 11px 13px; border: 1px solid #e4eadf; border-radius: 13px; color: var(--primary-dark); background: #f3f7f0; font-size: 13px; font-weight: 650; }
.resource-card { border-color: var(--line); border-radius: 17px; background: #fffefa; }
.resource-card:hover { border-color: #bdcebb; }
.resource-type-icon { border-radius: 13px; color: var(--primary); background: var(--primary-soft); }
.resource-type-icon.audio { color: #865b3c; background: #f7eee4; }
.activity-card,.lesson-item,.mini-list-item,.resource-row { border-color: #edf0e9; }
.notice { border-radius: 15px; }
.dialog,.preview-dialog { border-radius: 24px; }
.toast { border-radius: 16px; background: #293a30; }
::selection { color: #24372c; background: #dce9d8; }

@media (max-width: 780px) {
  .content { padding-top: 30px; }
  .app-header { background: rgba(255,254,250,.96); }
  .nav-button.active { background: #eaf1e8; }
}

@media (max-width: 560px) {
  .auth-layout { border-radius: 23px; }
  .auth-aside { background: linear-gradient(150deg,#273c32,#456b55); }
  .panel,.dashboard-panel,.admin-grid > .panel { border-radius: 18px; }
  .dashboard-feature,.dashboard-feature-admin,.dashboard-feature-teacher,.dashboard-feature-student { border-radius: 22px; }
  .student-option { min-height: 54px; }
}

.week-calendar-wrap { display: grid; gap: 12px; min-width: 0; }
.week-calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.week-calendar-toolbar > div:first-child { display: grid; gap: 3px; }
.week-calendar-toolbar .section-kicker { margin: 0; }
.week-calendar-toolbar > div:first-child > strong { color: var(--ink); font-size: 13px; font-weight: 650; }
.week-calendar-controls { display: flex; align-items: center; gap: 7px; }
.week-calendar-controls .icon-button { width: 37px; min-height: 37px; border-radius: 50%; font-size: 17px; }
.week-calendar-controls .button.small { min-height: 36px; }
.week-calendar { display: grid; grid-template-columns: minmax(48px,.55fr) repeat(5,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid #e5e9e1; border-radius: 17px; background: #e5e9e1; }
.week-calendar-corner,.week-calendar-day { display: flex; min-width: 0; min-height: 66px; flex-direction: column; justify-content: center; gap: 5px; padding: 9px 7px; background: #f7f8f4; }
.week-calendar-corner { align-items: center; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.week-calendar-day { align-items: center; text-align: center; }
.week-calendar-day strong { color: #536257; font-size: 11px; font-weight: 700; }
.week-calendar-day > span { color: var(--muted); font-size: 10px; }
.week-calendar-day.today { background: #edf4e9; }
.week-calendar-day.today strong { color: var(--primary-dark); }
.week-calendar-day.is-closed { background: #f8eee8; }
.week-calendar-day small { max-width: 100%; overflow: hidden; color: #965c43; font-size: 8px; line-height: 1.25; text-overflow: ellipsis; }
.week-calendar-time { display: flex; min-height: 66px; align-items: flex-start; justify-content: center; padding: 10px 3px 0; color: #657166; background: #f7f8f4; font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 650; }
.week-calendar-cell { display: grid; min-width: 0; min-height: 66px; place-items: stretch; padding: 4px; background: #fffefa; }
.week-calendar-cell.today { background: #fbfdf8; }
.week-calendar-cell.is-closed { background: #fbf4ef; }
.week-slot { display: flex; width: 100%; min-width: 0; min-height: 56px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; border: 1px solid transparent; border-radius: 11px; color: var(--primary-dark); background: #edf3eb; cursor: pointer; transition: background .15s,border-color .15s,transform .15s; }
.week-slot:hover { border-color: #c9d9c5; background: #e3eddf; transform: translateY(-1px); }
.week-slot:focus-visible { outline: 3px solid rgba(65,105,87,.32); outline-offset: 1px; }
.week-slot.is-empty { color: #9aa49b; background: transparent; }
.week-slot.is-empty:hover { border-color: #e4e9e0; background: #f6f8f3; }
.week-slot.has-inactive { opacity: .68; }
.week-slot.is-closed,.week-slot.is-closed:hover { color: #aa795f; background: #f7e9df; }
.week-slot-count { font-size: 16px; font-weight: 700; line-height: 1; }
.week-slot-caption { color: #536c58; font-size: 8px; }
.week-slot-empty,.week-slot-closed { font-size: 17px; line-height: 1; }
.week-slot-lessons { display: grid; width: 100%; gap: 4px; }
.week-lesson { display: grid; min-width: 0; gap: 3px; padding: 7px; border: 1px solid #e3eadf; border-radius: 9px; background: #f3f7f0; }
.week-lesson strong,.week-lesson span { display: block; overflow: hidden; text-overflow: ellipsis; }
.week-lesson strong { color: #355b48; font-size: 9px; line-height: 1.25; }
.week-lesson span { color: #738076; font-size: 8px; line-height: 1.2; }
.week-lesson.inactive { opacity: .55; }
.week-lesson.recovery-lesson { border: 1px solid #b9cbb5; background: #f5f8f1; }
.week-lesson.recovery-lesson strong { color: #476a4b; }
.week-break { display: flex; grid-column: 1/-1; min-height: 31px; align-items: center; justify-content: center; gap: 7px; color: #866f4f; background: #f4f0e8; font-size: 9px; }
.week-break span:first-child { font-weight: 650; }
.week-calendar-hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.schedule-class-list { margin-top: 20px; }
.schedule-class-list table { min-width: 560px; }
.non-class-day-form { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.4fr) auto; align-items: end; gap: 12px; margin: 14px 0; }
.non-class-day-form .field { margin: 0; }
.non-class-day-form .button { white-space: nowrap; }
.non-class-day-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.non-class-day-list li { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #e7ebe3; border-radius: 12px; background: #fbfcf9; }
.non-class-day-list li > span { display: grid; min-width: 0; gap: 3px; }
.non-class-day-list strong { color: var(--ink); font-size: 10px; }
.non-class-day-list small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.non-class-day-list .button.small { min-height: 31px; flex: 0 0 auto; }
.school-calendar-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin: 12px 0; padding: 11px 13px; border: 1px solid #e6ebe2; border-radius: 12px; background: #f8faf6; color: var(--muted); font-size: 9px; }
.school-calendar-sources strong { color: var(--ink); }
.school-calendar-sources a { color: var(--primary-dark); font-weight: 650; text-decoration: none; }
.school-calendar-sources a:hover { text-decoration: underline; }
.school-day-source { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #476a4b; background: #edf3eb; font-size: 9px; font-weight: 650; }
.recovery-panel + .recovery-panel { margin-top: 14px; }
.recovery-form-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.recovery-form-fields .field { margin: 0; }
.recovery-empty { margin: 16px 0 0; padding: 16px; border: 1px dashed #dfe5da; border-radius: 12px; color: var(--muted); font-size: 11px; text-align: center; }
.recovery-agenda { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.recovery-agenda-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.recovery-agenda-heading h3 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 650; }
.recovery-agenda-heading .section-kicker { margin: 0 0 4px; }
.recovery-closed { padding: 11px 13px; border: 1px solid #f0d6c5; border-radius: 11px; color: #89583f; background: #fbf1e9; font-size: 10px; }
.recovery-conflict-list { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; }
.recovery-conflict-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 9px; color: var(--ink-soft); background: #f6f7f4; font-size: 10px; }
.recovery-conflict-list strong { flex: 0 0 auto; color: var(--ink); }
.recovery-slots { margin: 17px 0 0; padding: 0; border: 0; }
.recovery-slots legend { margin-bottom: 9px; color: var(--ink); font-size: 11px; font-weight: 650; }
.recovery-slot-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.recovery-slot { display: flex; min-width: 0; min-height: 58px; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid #d8e3d4; border-radius: 11px; background: #f7faf5; cursor: pointer; }
.recovery-slot:has(input:checked) { border-color: var(--primary); background: #edf4ea; box-shadow: 0 0 0 2px #7695791c; }
.recovery-slot:has(input:disabled) { border-color: #eceee9; background: #f7f7f5; cursor: not-allowed; opacity: .7; }
.recovery-slot input { flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--primary); }
.recovery-slot span { display: grid; min-width: 0; gap: 4px; }
.recovery-slot strong { color: var(--ink); font-size: 10px; }
.recovery-slot small { overflow-wrap: anywhere; color: var(--muted); font-size: 8px; line-height: 1.3; }
.recovery-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.recovery-submit-row .field-hint { margin: 0; }
.recovery-submit-row .button { flex: 0 0 auto; }
.recovery-upcoming-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.recovery-upcoming-card { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 12px; border: 1px solid #e6ebe2; border-radius: 12px; background: #fbfcf9; }
.recovery-date { flex: 0 0 auto; color: var(--primary-dark); font-size: 10px; font-weight: 700; text-transform: capitalize; }
.recovery-upcoming-card > div { display: grid; min-width: 0; gap: 4px; }
.recovery-upcoming-card strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.recovery-upcoming-card small { color: var(--muted); font-size: 9px; }
.recovery-slot-detail { border-color: #d9e4d5; background: #f7faf5; }
.schedule-slot-dialog { width: min(100%,600px); max-height: min(90vh,780px); overflow: auto; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-header .eyebrow { margin: 0 0 5px; }
.dialog-header h2 { overflow-wrap: anywhere; }
.schedule-slot-details { display: grid; gap: 10px; }
.slot-detail-card { padding: 15px; border: 1px solid #e4e9df; border-radius: 15px; background: #fbfcf9; }
.slot-detail-card.inactive { opacity: .68; }
.slot-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.slot-detail-heading .section-kicker { margin: 0 0 4px; }
.slot-detail-heading h3 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 650; }
.slot-detail-instrument { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; color: var(--primary-dark); background: #edf3eb; font-size: 9px; font-weight: 650; }
.slot-detail-teacher { margin: 7px 0 0; font-size: 11px; }
.slot-student-list { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.slot-student-list li { display: flex; justify-content: space-between; gap: 10px; padding-top: 7px; border-top: 1px solid #ecefe8; color: var(--ink); font-size: 10px; }
.slot-student-list small { color: var(--muted); }
.slot-day-off { display: grid; gap: 4px; padding: 11px 13px; border: 1px solid #f0d6c5; border-radius: 12px; color: #89583f; background: #fbf1e9; }
.slot-day-off strong { font-size: 11px; }
.slot-day-off span { font-size: 10px; }
.slot-empty-state { display: grid; justify-items: center; gap: 4px; padding: 22px; border: 1px dashed #dfe5da; border-radius: 14px; color: var(--muted); text-align: center; }
.slot-empty-state > span { color: var(--primary); font-size: 22px; }
.slot-empty-state strong { color: var(--ink); font-size: 12px; }
.slot-empty-state p { margin: 0; font-size: 10px; }
.schedule-slot-dialog .dialog-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

@media (max-width: 700px) {
  .week-calendar { grid-template-columns: minmax(38px,.5fr) repeat(5,minmax(0,1fr)); }
  .week-calendar-day,.week-calendar-time { min-height: 56px; padding-right: 3px; padding-left: 3px; }
  .week-calendar-cell { min-height: 56px; padding: 2px; }
  .week-slot { min-height: 50px; border-radius: 8px; }
  .week-slot-lessons { gap: 2px; }
  .week-lesson { padding: 5px 3px; border-radius: 6px; }
  .week-lesson strong { font-size: 8px; }
  .week-lesson span { font-size: 7px; }
  .non-class-day-form { grid-template-columns: 1fr 1fr; }
  .non-class-day-form .button { grid-column: 1/-1; justify-self: start; }
  .recovery-form-fields { grid-template-columns: 1fr 1fr; }
  .recovery-slot-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .recovery-upcoming-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .schedule-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; overflow: visible; }
  .schedule-day { min-width: 0; min-height: 120px; }
  .schedule-day-header { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 5px; }
  .schedule-day-header strong,.schedule-card strong,.schedule-card span { font-size: 8px; }
  .schedule-lessons { gap: 5px; padding: 5px; }
  .schedule-card { padding: 6px 5px; }
  .week-calendar { grid-template-columns: minmax(34px,.45fr) repeat(5,minmax(0,1fr)); border-radius: 12px; }
  .week-calendar-corner,.week-calendar-day { min-height: 57px; padding: 6px 2px; }
  .week-calendar-day strong { font-size: 9px; }
  .week-calendar-day > span { font-size: 9px; }
  .week-calendar-day small { max-width: 100%; font-size: 7px; }
  .week-calendar-time { min-height: 49px; padding: 8px 1px 0; font-size: 8px; }
  .week-calendar-cell { min-height: 49px; padding: 2px; }
  .week-slot { min-height: 45px; }
  .week-slot-count { font-size: 14px; }
  .week-slot-caption { font-size: 7px; }
  .week-break { min-height: 26px; font-size: 8px; }
  .week-calendar-toolbar > div:first-child > strong { font-size: 11px; }
  .week-calendar-controls { gap: 4px; }
  .week-calendar-controls .icon-button { width: 33px; min-height: 33px; }
  .week-calendar-controls .button.small { min-height: 32px; padding: 0 9px; font-size: 10px; }
  .non-class-day-form { grid-template-columns: 1fr; }
  .non-class-day-form .button { grid-column: auto; }
  .non-class-day-list { grid-template-columns: 1fr; }
  .school-calendar-sources { align-items: flex-start; flex-direction: column; }
  .recovery-form-fields { grid-template-columns: 1fr; }
  .recovery-agenda-heading { align-items: flex-start; flex-direction: column; }
  .recovery-submit-row { align-items: stretch; flex-direction: column; }
  .recovery-submit-row .button { width: 100%; }
  .recovery-conflict-list li { align-items: flex-start; flex-direction: column; gap: 4px; }
  .schedule-slot-dialog { max-height: 85vh; }
  .schedule-slot-dialog .dialog-header h2 { font-size: 17px; }
}
