:root {
  color-scheme: light;
  --ink: #20202d;
  --muted: #77778a;
  --line: #e8e8f1;
  --surface: #ffffff;
  --canvas: #f6f7fb;
  --primary: #1767b4;
  --primary-dark: #0b3f78;
  --primary-soft: #e8f2fb;
  --mint: #6bd9e5;
  --mint-dark: #087885;
  --mint-soft: #e7fafd;
  --amber: #f4b95e;
  --amber-soft: #fff4df;
  --danger: #df5d6e;
  --danger-soft: #fff0f2;
  --shadow: 0 18px 50px rgba(52, 48, 101, .09);
  --shadow-small: 0 8px 24px rgba(52, 48, 101, .08);
  --radius: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body { min-height: 100vh; min-height: 100dvh; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--canvas); overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 5vw, 2.55rem); line-height: 1.08; letter-spacing: -.045em; }
h2 { margin-bottom: 5px; font-size: 1.25rem; letter-spacing: -.025em; }
h3 { margin-bottom: 4px; font-size: 1rem; }
.muted { color: var(--muted); }
.eyebrow { display: block; margin-bottom: 6px; color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.auth-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: max(24px, var(--safe-top)) 24px max(24px, var(--safe-bottom)); overflow: auto; background: linear-gradient(120deg, rgba(4,24,51,.82), rgba(12,75,137,.48)), url("brand/studio-mood.jpg") center/cover no-repeat; }
.auth-orb { position: absolute; border-radius: 999px; filter: blur(4px); opacity: .65; }
.auth-orb-one { width: 360px; height: 360px; top: -150px; right: -110px; background: #d8d0ff; }
.auth-orb-two { width: 290px; height: 290px; bottom: -130px; left: -90px; background: #baf0e2; }
.auth-card { position: relative; width: min(100%, 420px); padding: 42px; border: 1px solid rgba(255,255,255,.8); border-radius: 32px; background: rgba(255,255,255,.94); box-shadow: 0 30px 90px rgba(2,19,43,.35); backdrop-filter: blur(18px); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 14px; color: white; background: linear-gradient(145deg, #7b6aee, #5543cd); box-shadow: 0 9px 22px rgba(104,87,229,.27); font-size: .78rem; font-weight: 900; letter-spacing: -.03em; }
.brand-mark-large { width: 68px; height: 68px; margin-bottom: 30px; border-radius: 22px; font-size: 1.1rem; }
.brand-logo { display: block; width: 112px; height: 42px; flex: 0 0 auto; object-fit: contain; }
.brand-logo-large { width: 190px; height: 72px; margin: -10px auto 22px; object-position: center; }
.auth-card h1 { font-size: 2.3rem; }
.auth-mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: -10px 0 28px; padding: 5px; border-radius: 15px; background: #efeff5; }
.auth-mode-switch button { padding: 9px 10px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-size: .76rem; font-weight: 800; cursor: pointer; }
.auth-mode-switch button.active { color: var(--primary); background: white; box-shadow: 0 4px 12px rgba(52,48,101,.08); }
.pin-input { font-size: 1.35rem !important; letter-spacing: .25em; }
.form-error { min-height: 20px; margin: 14px 0 0; color: var(--danger); font-size: .86rem; font-weight: 650; text-align: center; }

.app-shell { min-height: 100vh; }
.student-shell { min-height: 100vh; background: linear-gradient(180deg, #f8f7ff 0, var(--canvas) 42%); }
.student-topbar { display: flex; align-items: center; justify-content: space-between; width: min(980px, calc(100% - 40px)); height: calc(82px + var(--safe-top)); margin: 0 auto; padding-top: var(--safe-top); }
.student-main { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 45px 0 calc(70px + var(--safe-bottom)); }
body.student-menu-open { overflow: hidden; }
.portal-page[hidden] { display: none !important; }
.student-menu-backdrop { position: fixed; inset: 0; z-index: 180; background: rgba(11, 24, 44, .38); backdrop-filter: blur(5px); }
.student-menu-backdrop:not([hidden]) { animation: menu-backdrop-in .2s ease both; }
.student-side-menu { position: fixed; z-index: 181; top: 0; right: 0; display: flex; width: min(380px, calc(100% - 30px)); height: 100dvh; flex-direction: column; gap: 17px; padding: calc(22px + var(--safe-top)) 18px calc(22px + var(--safe-bottom)); border-left: 1px solid rgba(255,255,255,.72); border-radius: 28px 0 0 28px; background: rgba(255,255,255,.98); box-shadow: -28px 0 70px rgba(14,23,42,.22); }
.student-side-menu:not([hidden]) { animation: student-menu-in .24s cubic-bezier(.2,.8,.2,1) both; }
.student-side-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 2px 8px; }
.student-side-head strong { display: block; margin-top: 2px; font-size: 1.55rem; letter-spacing: -.04em; }
.student-side-nav, .student-side-tools { display: grid; gap: 8px; }
.student-side-tools { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.student-side-nav button, .student-side-tools button, .student-side-tools a { position: relative; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; min-height: 58px; padding: 9px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: white; text-align: left; text-decoration: none; box-shadow: var(--shadow-small); cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.student-side-nav button:hover, .student-side-tools button:hover, .student-side-tools a:hover, .student-side-nav button:focus-visible, .student-side-tools button:focus-visible, .student-side-tools a:focus-visible { transform: translateX(-2px); border-color: #bad8ef; background: #fbfdff; box-shadow: 0 12px 28px rgba(23,103,180,.1); outline: 0; }
.student-side-nav button:active, .student-side-tools button:active, .student-side-tools a:active { transform: translateX(-1px) scale(.985); }
.student-side-nav button.active { color: var(--primary-dark); border-color: #b8d7ef; background: var(--primary-soft); }
.student-side-nav svg, .student-side-tools svg { display: grid; place-items: center; width: 42px; height: 42px; padding: 11px; box-sizing: border-box; border-radius: 14px; color: var(--primary); background: var(--primary-soft); transition: transform .18s ease, background .18s ease, color .18s ease; }
.student-side-nav button:hover svg, .student-side-tools button:hover svg, .student-side-tools a:hover svg, .student-side-nav button.active svg { transform: scale(1.05); color: white; background: var(--primary); }
.student-side-nav span, .student-side-tools span { min-width: 0; font-weight: 900; }
.student-side-nav .nav-badge { position: static; justify-self: end; border-color: white; }
.student-side-menu:not([hidden]) .student-side-nav button, .student-side-menu:not([hidden]) .student-side-tools button, .student-side-menu:not([hidden]) .student-side-tools a { animation: menu-item-in .22s cubic-bezier(.2,.8,.2,1) both; }
.student-side-menu:not([hidden]) .student-side-nav button:nth-child(1) { animation-delay: .02s; }
.student-side-menu:not([hidden]) .student-side-nav button:nth-child(2) { animation-delay: .04s; }
.student-side-menu:not([hidden]) .student-side-nav button:nth-child(3) { animation-delay: .06s; }
.student-side-menu:not([hidden]) .student-side-nav button:nth-child(4) { animation-delay: .08s; }
.student-side-menu:not([hidden]) .student-side-nav button:nth-child(5) { animation-delay: .1s; }
.student-side-menu:not([hidden]) .student-side-nav button:nth-child(6) { animation-delay: .12s; }
.student-side-menu:not([hidden]) .student-side-nav button:nth-child(7) { animation-delay: .14s; }
.student-side-menu:not([hidden]) .student-side-nav button:nth-child(8) { animation-delay: .16s; }
.student-side-menu:not([hidden]) .student-side-tools > *:nth-child(1) { animation-delay: .18s; }
.student-side-menu:not([hidden]) .student-side-tools > *:nth-child(2) { animation-delay: .2s; }
.student-side-menu:not([hidden]) .student-side-tools > *:nth-child(3) { animation-delay: .22s; }
.student-side-menu:not([hidden]) .student-side-tools > *:nth-child(4) { animation-delay: .24s; }
.student-side-menu:not([hidden]) .student-side-tools > *:nth-child(5) { animation-delay: .26s; }
.student-welcome { display: flex; align-items: center; gap: 18px; margin-bottom: 27px; }
.student-welcome p { margin-bottom: 0; }
.portal-voice-range-card { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 15px; margin: -8px 0 16px; padding: 17px 19px; border: 1px solid #cfe1f2; border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-small); }
.portal-voice-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; color: white; background: linear-gradient(145deg, var(--primary), var(--mint-dark)); }
.portal-voice-icon svg { width: 25px; height: 25px; }
.portal-voice-range-card strong { display: block; margin-top: 4px; color: var(--ink); font-size: 1.12rem; letter-spacing: -.03em; }
.portal-voice-range-card p { margin: 4px 0 0; font-size: .78rem; }
.portal-avatar { display: grid; place-items: center; width: 78px; height: 78px; flex: 0 0 auto; overflow: hidden; border: 4px solid white; border-radius: 50%; color: var(--primary); background: var(--primary-soft); box-shadow: var(--shadow-small); font-weight: 900; }
.portal-avatar-button { padding: 0; cursor: zoom-in; transition: transform .18s ease, box-shadow .18s ease; }
.portal-avatar-button:hover { transform: scale(1.04); box-shadow: 0 12px 28px rgba(23,103,180,.22); }
.portal-avatar-button:focus-visible, .avatar-button:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.portal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.availability-card { position: relative; display: grid; grid-template-columns: 190px 1fr; align-items: center; min-height: 250px; gap: 32px; padding: 34px 46px; overflow: hidden; border-radius: 34px; color: white; background: linear-gradient(130deg, #0b3f78, #1976c8); box-shadow: 0 24px 60px rgba(9,64,120,.22); }
.availability-card::after { content: ""; position: absolute; width: 280px; height: 280px; right: -100px; top: -130px; border-radius: 50%; background: rgba(140,230,208,.2); }
.availability-refresh-wrap { position: relative; z-index: 1; display: grid; justify-items: center; gap: 11px; }
.availability-refresh-wrap > span { color: rgba(255,255,255,.68); font-size: .62rem; font-weight: 900; line-height: 1.15; text-align: center; letter-spacing: .08em; }
.availability-ring { --progress: 0deg; position: relative; z-index: 1; display: grid; place-items: center; width: 164px; height: 164px; border: 0; border-radius: 50%; color: white; background: conic-gradient(var(--mint) var(--progress), rgba(255,255,255,.17) 0); }
.availability-ring::before { content: ""; position: absolute; inset: 13px; border-radius: inherit; background: #115a9f; }
.availability-ring > div { position: relative; text-align: center; }
.availability-ring strong { display: block; }
.availability-ring strong { font-size: 3.4rem; line-height: .95; letter-spacing: -.07em; }
.availability-refresh { cursor: pointer; transition: transform .18s ease, filter .18s ease, opacity .18s ease; }
.availability-refresh:hover { transform: translateY(-2px); filter: brightness(1.04); }
.availability-refresh:active { transform: scale(.98); }
.availability-refresh.is-refreshing { pointer-events: none; opacity: .75; }
.availability-copy { position: relative; z-index: 1; }
.availability-copy h2 { margin-bottom: 9px; font-size: clamp(1.6rem, 4vw, 2.5rem); }
.availability-copy p { color: rgba(255,255,255,.75); }
.portal-progress { display: grid; grid-template-columns: repeat(var(--package-lessons, 4), 1fr); gap: 8px; max-width: 380px; margin-top: 22px; }
.portal-progress span { height: 9px; border-radius: 999px; background: rgba(255,255,255,.22); }
.portal-progress span.used { background: var(--mint); }
.portal-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 22px; }
.portal-quick-actions.single-action { grid-template-columns: 1fr; }
.portal-feature-button { position: relative; display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 13px; min-height: 76px; padding: 15px 17px; border: 1px solid #cfe1f2; border-radius: 22px; color: var(--primary-dark); background: white; box-shadow: var(--shadow-small); text-align: left; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.portal-feature-button:hover { transform: translateY(-2px); border-color: #a9cee9; box-shadow: var(--shadow); }
.portal-stat-card { cursor: default; }
.portal-stat-card:hover { transform: none; border-color: #cfe1f2; box-shadow: var(--shadow-small); }
.portal-feature-button svg { display: grid; place-items: center; width: 48px; height: 48px; padding: 12px; box-sizing: border-box; border-radius: 16px; color: white; background: linear-gradient(145deg, var(--primary), var(--mint-dark)); }
.portal-feature-button strong, .portal-feature-button small { display: block; }
.portal-feature-button strong { font-size: .98rem; letter-spacing: -.02em; }
.portal-feature-button small { margin-top: 3px; color: var(--muted); font-size: .72rem; font-weight: 750; }
.portal-feature-button .nav-badge { top: 9px; right: 10px; border-color: white; }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 15px; }
.portal-pages-wrap { margin-top: 18px; }
.portal-month-list { display: grid; gap: 18px; }
.portal-year-group { display: grid; gap: 10px; }
.portal-year-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.portal-year-heading h3 { margin: 0; color: var(--ink); font-size: 1.05rem; font-weight: 950; letter-spacing: -.02em; }
.portal-year-heading span { padding: 6px 9px; border-radius: 999px; color: var(--muted); background: #eef3f8; font-size: .7rem; font-weight: 900; white-space: nowrap; }
.portal-year-months { display: grid; gap: 10px; }
.portal-month-group { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-small); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.portal-month-group:hover { transform: translateY(-1px); border-color: #cbdff0; box-shadow: 0 12px 30px rgba(23,103,180,.08); }
.portal-month-group[open] { border-color: #c7def1; box-shadow: 0 14px 34px rgba(23,103,180,.1); }
.portal-month-group summary { display: grid; grid-template-columns: 1fr auto 28px; align-items: center; gap: 10px; padding: 17px 19px; color: var(--primary-dark); cursor: pointer; list-style: none; user-select: none; transition: background .18s ease, color .18s ease; }
.portal-month-group summary::-webkit-details-marker { display: none; }
.portal-month-group summary:focus-visible { outline: 3px solid rgba(107,217,229,.48); outline-offset: -4px; }
.portal-month-group summary span { font-size: .94rem; font-weight: 950; text-transform: capitalize; }
.portal-month-group summary small { padding: 6px 9px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: .7rem; font-weight: 900; white-space: nowrap; transition: background .18s ease, color .18s ease; }
.portal-month-group summary::after { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; color: var(--ink); background: #f4f7fb; font-size: 1.05rem; font-weight: 850; transition: transform .18s ease, background .18s ease, color .18s ease; }
.portal-month-group[open] summary { border-bottom: 1px solid var(--line); }
.portal-month-group[open] summary::after { content: "-"; color: white; background: var(--primary); transform: scale(.96); }
.portal-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.portal-month-group .portal-list { border: 0; border-radius: 0; box-shadow: none; }
.portal-month-group[open] .portal-list { animation: collapsible-body-in .24s cubic-bezier(.2,.8,.2,1) both; }
.portal-month-group[open] .portal-row { animation: collapsible-row-in .22s cubic-bezier(.2,.8,.2,1) both; }
.portal-row { display: flex; align-items: center; justify-content: flex-start; gap: 15px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.portal-row:last-child { border-bottom: 0; }
.portal-row-copy strong, .portal-row-copy span { display: block; }
.portal-row-copy { min-width: 0; flex: 1; }
.portal-row-copy span { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.portal-row-amount { color: var(--mint-dark); font-size: 1rem; font-weight: 850; white-space: nowrap; }
.portal-date { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: .72rem; font-weight: 850; text-align: center; }
.portal-schedule { margin-top: 22px; padding: 18px 21px; border: 1px solid #dcd8fb; border-radius: 18px; color: var(--primary-dark); background: var(--primary-soft); font-size: .85rem; }
.portal-schedule > div + div { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(104,87,229,.16); }
.portal-schedule .portal-variation { color: #8b5d19; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: calc(76px + var(--safe-top)); padding: var(--safe-top) max(20px, calc((100vw - 1180px) / 2)) 0; border-bottom: 1px solid rgba(232,232,241,.8); background: rgba(246,247,251,.86); backdrop-filter: blur(18px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 1rem; letter-spacing: -.02em; }
.brand-lockup span { margin-top: 1px; color: var(--muted); font-size: .72rem; }
.brand-lockup .brand-referent:not([hidden]) { display: block; margin-top: 2px; color: var(--primary-dark); font-size: .76rem; font-weight: 900; line-height: 1.15; }
.brand-lockup.has-referent > div { display: flex; flex-direction: column; align-items: flex-start; }
.brand-lockup.has-referent .brand-date { display: block; margin-top: 1px; color: var(--muted); font-size: .7rem; line-height: 1.15; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-topbar-more { display: none; }
.storage-badge { display: inline-grid; place-items: center; width: 34px; height: 34px; min-width: 34px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 0; cursor: pointer; }
.storage-badge::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(119,119,138,.13); }
.storage-badge.is-db { color: #0aa86f; }
.storage-badge.is-db::before { box-shadow: 0 0 0 4px rgba(10,168,111,.15); }
.storage-badge.is-file { color: var(--danger); }
.storage-badge.is-file::before { box-shadow: 0 0 0 4px rgba(223,93,110,.14); }
.storage-badge.is-offline { color: #a43c4b; }
.storage-badge.is-offline::before { box-shadow: 0 0 0 4px rgba(164,60,75,.14); }
.storage-badge.is-unknown { color: #9b9baa; }
.icon-button { position: relative; display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface); text-decoration: none; cursor: pointer; transition: .2s ease; }
.icon-button:hover { transform: translateY(-1px); border-color: #d5d2ef; box-shadow: var(--shadow-small); }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid white; border-radius: 999px; background: var(--danger); }

.main-content { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 120px; }
.view { display: none; animation: view-in .28s ease both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
[data-role="coach"] .admin-only { display: none !important; }
[data-role="admin"] .coach-only { display: none !important; }

.payment-hero { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 210px; padding: 38px 42px; overflow: hidden; border-radius: 32px; color: white; background: linear-gradient(130deg, #0b3f78, #1976c8); box-shadow: 0 24px 60px rgba(9,64,120,.22); }
.payment-hero::before, .payment-hero::after { content: ""; position: absolute; border-radius: 999px; }
.payment-hero::before { width: 260px; height: 260px; right: -80px; top: -120px; background: rgba(140,230,208,.23); }
.payment-hero::after { width: 170px; height: 170px; right: 100px; bottom: -125px; border: 32px solid rgba(255,255,255,.07); }
.payment-hero.is-due { background: linear-gradient(130deg, #df675f, #ef9b67); }
.hero-kicker { display: block; margin-bottom: 14px; color: rgba(255,255,255,.75); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.payment-hero h1 { position: relative; max-width: 650px; margin-bottom: 10px; font-size: clamp(2rem, 5vw, 3.5rem); }
.payment-hero p { position: relative; margin: 0; color: rgba(255,255,255,.82); }
.hero-symbol { position: relative; display: grid; place-items: center; width: 104px; height: 104px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.3); border-radius: 32px; background: rgba(255,255,255,.16); font-size: 3rem; font-weight: 700; backdrop-filter: blur(8px); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 44px; }
.stat-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.stat-card span, .stat-card small, .stat-card strong { display: block; }
.stat-card span { color: var(--muted); font-size: .83rem; font-weight: 650; }
.stat-card strong { margin: 10px 0 3px; font-size: 2.1rem; line-height: 1; letter-spacing: -.05em; }
.stat-card small { color: #a0a0b0; }
.stat-card.stat-accent { border-color: #e1ddff; background: var(--primary-soft); }
.stat-card.stat-accent strong { color: var(--primary); }

.section-heading, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading { margin: 34px 0 16px; }
.section-heading h2, .page-heading h1 { margin-bottom: 0; }
.page-heading { margin-bottom: 28px; }
.page-heading p { margin-bottom: 0; }
.page-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; }
.page-actions .button { white-space: nowrap; }
.back-to-more { color: var(--primary); background: var(--primary-soft); font-size: 1.15rem; font-weight: 900; }
.back-to-more:hover { transform: translateY(-1px); box-shadow: var(--shadow-small); }
.section-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.section-primary-action { min-height: 40px; padding: 10px 13px; border-radius: 14px; white-space: nowrap; }
.text-button { padding: 8px; border: 0; color: var(--primary); background: transparent; font-weight: 750; cursor: pointer; }

.agenda-list { display: grid; gap: 10px; }
.agenda-item { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(112px, 170px) auto; align-items: center; gap: 18px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.agenda-item.lesson-skipped { border-color: #f28c9a; background: linear-gradient(135deg, #ffedf0, #ffd8df); box-shadow: 0 10px 24px rgba(217,54,78,.12); }
.agenda-item.lesson-skipped .agenda-time,
.agenda-item.lesson-skipped .agenda-person strong { color: #8f2434; }
.agenda-item.lesson-skipped .agenda-person span { color: #9d4c59; }
.agenda-time { color: var(--primary); font-size: 1.05rem; font-weight: 800; }
.agenda-person { min-width: 0; }
.agenda-person strong, .agenda-person span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-person span { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.agenda-progress { display: grid; grid-template-columns: repeat(var(--package-lessons, 4), 1fr); align-items: center; width: 100%; min-width: 104px; gap: 9px; }
.agenda-lesson-dot { display: block; width: 100%; height: 10px; min-width: 0; padding: 0; border: 0; border-radius: 999px; background: #e6edf7; box-shadow: inset 0 0 0 1px rgba(20,42,77,.03); }
button.agenda-lesson-dot { cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
button.agenda-lesson-dot:hover, button.agenda-lesson-dot:focus-visible { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(23,103,180,.13); outline: 0; }
.agenda-lesson-dot.done { background: var(--lesson-color, var(--accent)); box-shadow: 0 6px 14px rgba(23,103,180,.12); }
.agenda-item.lesson-skipped .agenda-lesson-dot.done { background: #d9364e; }
.agenda-action { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.search-box { display: flex; align-items: center; width: min(390px, 100%); gap: 9px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.search-box svg { width: 19px; color: #9b9bab; }
.search-box input { width: 100%; padding: 13px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.filter-pills { display: flex; gap: 7px; padding: 5px; border-radius: 16px; background: #ebeaf2; overflow-x: auto; }
.filter-pill { padding: 8px 13px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: .78rem; font-weight: 750; white-space: nowrap; cursor: pointer; }
.filter-pill.active { color: var(--ink); background: white; box-shadow: 0 3px 10px rgba(48,44,87,.08); }
.student-group-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--primary-dark); background: white; font-size: .76rem; font-weight: 850; white-space: nowrap; box-shadow: var(--shadow-small); cursor: pointer; }
.student-group-toggle input { width: 16px; height: 16px; accent-color: var(--primary); }

.student-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.students-grouped-list { display: grid; gap: 18px; }
.student-visual-group { padding: 16px; border: 1px solid #dce8f4; border-radius: 26px; background: linear-gradient(180deg, #ffffff, #f7fbff); box-shadow: var(--shadow-small); }
.student-visual-group-plain { background: transparent; box-shadow: none; }
.student-visual-group-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.student-visual-group-head h2 { margin: 3px 0 0; font-size: 1.05rem; letter-spacing: -.03em; }
.student-visual-group-head strong { padding: 7px 10px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: .72rem; white-space: nowrap; }
.group-student-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-grid { grid-template-columns: repeat(2, 1fr); }
.student-card { position: relative; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); transition: transform .2s ease, box-shadow .2s ease; }
.student-card.menu-open { z-index: 25; overflow: visible; }
.student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.student-card.inactive { opacity: .68; background: #f1f1f5; box-shadow: none; }
.student-card.due { border-color: #f4d7ae; }
.student-card-head { display: flex; align-items: center; gap: 12px; }
.avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; overflow: hidden; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-weight: 850; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-button { padding: 0; border: 0; cursor: zoom-in; transition: transform .18s ease, box-shadow .18s ease; }
.avatar-button:hover { transform: scale(1.08); box-shadow: 0 7px 18px rgba(23,103,180,.2); }
.student-card.due .avatar { color: #96631a; background: var(--amber-soft); }
.student-title { min-width: 0; flex: 1; }
.student-title h3 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.student-title span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.more-button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; color: var(--muted); background: #f6f6f9; cursor: pointer; }
.card-menu { position: absolute; z-index: 30; top: 58px; right: 18px; width: 175px; padding: 6px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.card-menu button { display: flex; align-items: center; width: 100%; gap: 8px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; font-size: .8rem; text-align: left; cursor: pointer; }
.card-menu button:hover { background: var(--canvas); }
.card-menu button.danger { color: var(--danger); }
.card-menu svg { width: 17px; }
.progress-label { display: flex; justify-content: space-between; margin: 23px 0 9px; color: var(--muted); font-size: .76rem; }
.progress-label strong { color: var(--ink); }
.lesson-progress { display: grid; grid-template-columns: repeat(var(--package-lessons, 4), 1fr); gap: 7px; }
.lesson-dot { height: 8px; border-radius: 999px; background: #e9e9f0; }
button.lesson-dot { width: 100%; padding: 0; border: 0; cursor: pointer; }
button.lesson-dot:hover, button.lesson-dot:focus-visible { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(244,185,94,.18); outline: 0; }
.lesson-dot.done { background: var(--mint); }
.student-card.due .lesson-dot.done { background: var(--amber); }
.due-badge { display: inline-flex; align-items: center; margin-top: 13px; padding: 6px 9px; border-radius: 9px; color: #946017; background: var(--amber-soft); font-size: .7rem; font-weight: 800; }
.skip-badge { display: inline-flex; align-items: center; margin-top: 13px; margin-left: 6px; padding: 6px 9px; border-radius: 9px; color: #a63b4c; background: #ffe3e8; font-size: .7rem; font-weight: 850; }
.agenda-skip-badge { margin-top: 7px; margin-left: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.card-actions .button { flex: 1 1 145px; min-width: min(145px, 100%); }
.card-actions .button-whatsapp-direct { flex: .9 1 130px; }
.button-skip { color: #a63b4c; background: var(--danger-soft); }
.button-skip.is-active { color: #8f2434; background: white; box-shadow: 0 10px 22px rgba(143,36,52,.13); }
.button-skip.is-active svg { color: #d9364e; }
.student-meta { display: flex; gap: 12px; margin-top: 13px; color: var(--muted); font-size: .74rem; }
.student-meta { flex-wrap: wrap; }
.status-pill.code-pill { align-items: baseline; gap: 6px; padding: 7px 11px; border-radius: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; }
.status-pill.code-pill span { color: #496b8d; font-size: .62rem; font-weight: 900; text-transform: uppercase; }
.status-pill.code-pill strong { color: var(--primary-dark); font-size: .84rem; line-height: 1; }
.status-pill.code-pill.is-missing strong { font-size: .72rem; }
.student-gender-toggle { display: inline-flex; gap: 7px; margin-top: 13px; padding: 5px; border: 1px solid #e1e5ef; border-radius: 999px; background: #f7f9fd; }
.gender-icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 999px; color: #1f87e6; background: transparent; cursor: pointer; transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease; opacity: .48; }
.gender-icon-button svg { width: 25px; height: 25px; fill: #d9eeff; stroke-width: 1.5; }
.gender-icon-button:hover { transform: translateY(-1px); background: white; box-shadow: 0 7px 16px rgba(31, 42, 68, .08); }
.gender-icon-button.is-active { opacity: 1; color: #1f87e6; background: #edf7ff; box-shadow: 0 8px 18px rgba(31, 135, 230, .16); }
.student-status-switch { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; color: var(--muted); background: #f7f7fb; font-size: .75rem; font-weight: 850; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.student-status-switch > span { position: relative; width: 43px; height: 25px; flex: 0 0 auto; border-radius: 999px; background: #d6d6df; transition: .2s; }
.student-status-switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: .2s; }
.student-status-switch.is-active { border-color: #cfe1f2; color: var(--primary-dark); background: var(--primary-soft); }
.student-status-switch.is-active > span { background: var(--primary); }
.student-status-switch.is-active > span::after { transform: translateX(18px); }
.student-status-switch strong { font-size: .75rem; }

.week-toolbar { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 18px; padding: 10px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.week-toolbar strong { text-align: center; }
.schedule-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 18px; }
.schedule-days { scrollbar-width: none; }
.schedule-days::-webkit-scrollbar { display: none; }
.schedule-day { padding: 13px 8px; border: 1px solid var(--line); border-radius: 16px; color: var(--muted); background: var(--surface); text-align: center; cursor: pointer; }
.schedule-day strong, .schedule-day span, .schedule-day small { display: block; }
.schedule-day strong { margin: 4px 0; color: var(--ink); font-size: 1.05rem; }
.schedule-day span, .schedule-day small { font-size: .68rem; }
.schedule-day small { min-height: 15px; color: var(--primary); font-weight: 800; }
.schedule-day.active { border-color: var(--primary); color: white; background: var(--primary); box-shadow: 0 9px 22px rgba(104,87,229,.22); }
.schedule-day.active strong, .schedule-day.active small { color: white; }
.schedule-timeline { display: grid; gap: 9px; }
.timeline-slot { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; min-height: 72px; gap: 17px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.timeline-slot.occupied { border-left: 5px solid var(--primary); box-shadow: var(--shadow-small); }
.timeline-slot.variation { border-left-color: var(--amber); background: var(--amber-soft); }
.timeline-slot.free { border-style: dashed; color: var(--muted); background: rgba(255,255,255,.45); }
.timeline-time { color: var(--primary); font-size: .93rem; font-weight: 850; }
.timeline-slot.variation .timeline-time { color: #9a651b; }
.timeline-copy strong, .timeline-copy span { display: block; }
.timeline-copy span { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.timeline-actions { display: flex; align-items: center; gap: 6px; }
.timeline-actions button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 11px; color: var(--muted); background: var(--canvas); cursor: pointer; }
.timeline-actions button:hover { color: var(--primary); }
.timeline-actions button.danger { color: var(--danger); background: var(--danger-soft); }
.free-slot-button { justify-self: end; }
.variations-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.variation-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 17px; border: 1px solid #f0d9b7; border-radius: 18px; background: var(--amber-soft); }
.variation-badge { padding: 8px; border-radius: 11px; color: #956019; background: white; font-size: .67rem; font-weight: 850; text-align: center; }
.variation-card strong, .variation-card span { display: block; }
.variation-card span { margin-top: 3px; color: #8a7560; font-size: .73rem; }
.form-note { margin: 16px 0 0; padding: 11px 13px; border-radius: 12px; color: var(--primary-dark); background: var(--primary-soft); font-size: .75rem; line-height: 1.45; }

.history-toolbar { justify-content: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.history-toolbar .field-label { margin: 0; white-space: nowrap; }
.history-toolbar .text-input { width: min(340px, 100%); }
.history-list { display: grid; gap: 10px; }
.history-accordion { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-small); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.history-accordion:hover { transform: translateY(-1px); border-color: #cbdff0; box-shadow: 0 12px 30px rgba(23,103,180,.08); }
.history-accordion[open] { border-color: #c7def1; box-shadow: 0 14px 34px rgba(23,103,180,.1); }
.history-accordion summary { display: grid; grid-template-columns: 44px 1fr auto 28px; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; list-style: none; user-select: none; transition: background .18s ease, color .18s ease; }
.history-accordion summary::-webkit-details-marker { display: none; }
.history-accordion summary:focus-visible { outline: 3px solid rgba(107,217,229,.48); outline-offset: -4px; }
.history-accordion summary > span { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-size: .75rem; font-weight: 900; }
.history-accordion summary img { width: 100%; height: 100%; object-fit: cover; }
.history-accordion summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-accordion summary small { padding: 6px 9px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: .7rem; font-weight: 850; white-space: nowrap; transition: background .18s ease, color .18s ease; }
.history-accordion summary::after { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; color: var(--ink); background: #f4f7fb; font-size: 1.05rem; font-weight: 850; transition: transform .18s ease, background .18s ease, color .18s ease; }
.history-accordion[open] summary { border-bottom: 1px solid var(--line); }
.history-accordion[open] summary small { color: var(--mint-dark); background: var(--mint-soft); }
.history-accordion[open] summary::after { content: "-"; color: white; background: var(--primary); transform: scale(.96); }
.history-accordion-body { border-top: 0; }
.history-accordion[open] .history-accordion-body { animation: collapsible-body-in .24s cubic-bezier(.2,.8,.2,1) both; }
.history-accordion[open] .history-item { animation: collapsible-row-in .22s cubic-bezier(.2,.8,.2,1) both; }
.history-item { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 15px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-date { text-align: center; }
.history-date strong, .history-date span { display: block; }
.history-date strong { color: var(--primary); font-size: 1.2rem; }
.history-date span { color: var(--muted); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.history-copy strong, .history-copy span { display: block; }
.history-copy span { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.lesson-info-grid { display: grid; gap: 10px; }
.lesson-info-grid > div { padding: 14px 15px; border: 1px solid var(--line); border-radius: 16px; background: #fbfbfd; }
.lesson-info-grid span, .lesson-info-grid strong { display: block; }
.lesson-info-grid span { margin-bottom: 4px; color: var(--muted); font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.lesson-info-grid strong { color: var(--ink); font-size: .92rem; line-height: 1.35; }
.delete-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; color: var(--danger); background: var(--danger-soft); cursor: pointer; }

.settings-card { display: grid; gap: 18px; }
.setting-block { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.setting-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; color: var(--mint-dark); background: var(--mint-soft); }
.setting-icon.purple { color: var(--primary); background: var(--primary-soft); }
.setting-content h2 { margin-bottom: 5px; }
.setting-content > p { margin-bottom: 22px; }
.setting-inline { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.compact-textarea { min-height: 47px; }
.brand-color-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 2px; }
.brand-color-grid .field-label { margin-top: 12px; }
.color-input { height: 46px; padding: 5px; cursor: pointer; }
.brand-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.brand-upload-card { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: #fbfbfd; }
.brand-upload-card strong { display: block; margin-bottom: 4px; }
.brand-upload-card p { margin-bottom: 10px; font-size: .78rem; line-height: 1.35; }
.brand-preview { display: grid; place-items: center; overflow: hidden; width: 92px; height: 72px; border: 1px dashed #cfd3df; border-radius: 18px; color: var(--muted); background: white; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.brand-preview img { width: 100%; height: 100%; object-fit: contain; }
.login-preview img { object-fit: cover; }
.feature-switch-wrap { display: inline-flex; align-items: center; justify-content: center; padding: 8px; border: 1px solid #cfe1f2; border-radius: 999px; background: #edf6ff; transition: background .18s ease, border-color .18s ease; }
.feature-switch-wrap.is-enabled { border-color: #9ee6cf; background: #e5fbf2; }
.ear-training-setting .switch span { background: #9fb5ca; }
.ear-training-setting .switch input:checked + span { background: linear-gradient(135deg, #0aa86f, #087885); }
.voice-type-preview { display: grid; gap: 3px; margin: 13px 0 0; padding: 14px 15px; border: 1px solid #bcebd7; border-radius: 16px; color: #08724d; background: #e9faf3; }
.voice-type-preview span { color: inherit; font-size: .68rem; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.voice-type-preview strong { color: inherit; font-size: 1.25rem; line-height: 1.1; letter-spacing: -.035em; }
.voice-type-preview small { color: #2f8065; font-size: .73rem; line-height: 1.35; }
.voice-type-preview.is-empty { border-color: #dcd8fb; color: var(--primary-dark); background: #f8f6ff; }
.voice-type-preview.is-warning { border-color: #f0d9b7; color: #956019; background: var(--amber-soft); }
.voice-type-preview.is-empty small, .voice-type-preview.is-warning small { color: var(--muted); }
.message-preview { margin-top: 12px; padding: 14px 16px; border-radius: 8px 18px 18px 18px; color: #315c52; background: var(--mint-soft); font-size: .82rem; line-height: 1.5; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 46px; }
.input-suffix span { position: absolute; right: 16px; top: 50%; color: var(--muted); transform: translateY(-50%); }
.about-card { display: flex; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 20px 24px; border-radius: 20px; color: var(--muted); background: #ececf3; font-size: .8rem; }
.about-card strong { color: var(--ink); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: 14px; font-size: .83rem; font-weight: 800; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; pointer-events: none; }
.button svg { width: 18px; height: 18px; }
.whatsapp-icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 auto; object-fit: contain; }
.button .whatsapp-icon, .preview-whatsapp-action .whatsapp-icon { width: 18px; height: 18px; }
.button-whatsapp .whatsapp-icon, .preview-whatsapp-action .whatsapp-icon { width: 25px; height: 25px; padding: 3px; border-radius: 999px; background: white; box-shadow: 0 2px 7px rgba(0,0,0,.08); }
.setting-icon .whatsapp-icon { width: 26px; height: 26px; }
.button.is-loading { opacity: 1; cursor: wait; }
.button-spinner { width: 17px; height: 17px; flex: 0 0 auto; border: 3px solid rgba(255,255,255,.42); border-top-color: currentColor; border-radius: 50%; animation: saving-spin .72s linear infinite; }
.button-ghost .button-spinner, .button-soft .button-spinner { border-color: rgba(23,103,180,.18); border-top-color: currentColor; }
.button-primary { color: white; background: var(--primary); box-shadow: 0 8px 20px rgba(104,87,229,.23); }
.button-primary:hover { background: var(--primary-dark); }
.button-soft { color: var(--primary); background: var(--primary-soft); }
.button-mint { color: #126653; background: var(--mint-soft); }
.button-whatsapp { color: white; background: #20a66a; }
.button-danger { color: #9b2436; background: var(--danger-soft); }
.button-ghost { border-color: var(--line); background: white; }
.button-large { width: 100%; min-height: 51px; margin-top: 20px; }

.field-label { display: block; margin: 16px 0 7px; color: #5f5f70; font-size: .77rem; font-weight: 750; }
.field-hint { display: block; margin-top: 7px; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.code-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.text-input { width: 100%; padding: 12px 14px; border: 1px solid #dedee8; border-radius: 14px; outline: none; color: var(--ink); background: #fbfbfd; transition: border .18s, box-shadow .18s; }
.text-input:focus { border-color: #61a6df; box-shadow: 0 0 0 4px rgba(23,103,180,.11); }
textarea.text-input { resize: vertical; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }

.switch { position: relative; display: inline-grid; place-items: center; width: 56px; height: 34px; min-width: 56px; flex: 0 0 auto; cursor: pointer; touch-action: manipulation; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.switch span { position: relative; display: block; width: 56px; height: 34px; border: 1px solid #c5ccd8; border-radius: 999px; background: linear-gradient(180deg, #eef1f6, #d7dde8); box-shadow: inset 0 1px 2px rgba(21,34,55,.1), 0 6px 14px rgba(45,55,85,.08); cursor: pointer; transition: background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.switch span::after { content: ""; position: absolute; width: 26px; height: 26px; top: 3px; left: 3px; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; background: white; box-shadow: 0 3px 8px rgba(21,34,55,.28); transition: transform .2s ease; }
.switch input:checked + span { border-color: rgba(23,103,180,.75); background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: inset 0 1px 2px rgba(255,255,255,.16), 0 7px 16px rgba(23,103,180,.18); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid rgba(107,217,229,.65); outline-offset: 3px; }
.switch input:disabled + span { opacity: .58; cursor: not-allowed; }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: max(14px, var(--safe-bottom)); display: flex; align-items: center; width: min(520px, calc(100% - 28px)); height: 70px; padding: 8px; border: 1px solid rgba(255,255,255,.9); border-radius: 24px; background: rgba(255,255,255,.93); box-shadow: 0 18px 48px rgba(44,40,80,.17); transform: translateX(-50%); backdrop-filter: blur(18px); }
.nav-item { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 4px; border: 0; border-radius: 17px; color: #9999a8; background: transparent; cursor: pointer; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item span { font-size: .64rem; font-weight: 750; }
.nav-item.active { color: var(--primary); background: var(--primary-soft); }
.app-dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 28px); padding: 0; overflow-y: auto; border: 0; border-radius: 28px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(36,31,76,.3); }
.app-dialog::backdrop { background: rgba(28,26,45,.48); backdrop-filter: blur(5px); }
.app-dialog form, .confirm-dialog { padding: 27px; }
.support-dialog { width: min(640px, calc(100% - 28px)); }
.support-dialog .field-label { margin-top: 13px; }
.support-dialog .field-label:first-of-type { margin-top: 0; }
.support-dialog textarea.text-input { min-height: 150px; resize: vertical; }
.support-dialog .form-note { margin-top: 14px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-header > div { min-width: 0; }
.dialog-header h2 { font-size: 1.45rem; }
.dialog-close { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 12px; color: var(--muted); background: var(--canvas); font-size: 1.5rem; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.lesson-info-dialog { padding: 27px; }
.payment-student-name { margin: -5px 0 8px; padding: 12px 14px; border-radius: 13px; color: var(--primary-dark); background: var(--primary-soft); font-weight: 800; }
.student-code-dialog .payment-student-name { margin-bottom: 12px; }
.code-input-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
.code-input-row .button { min-height: 47px; padding-inline: 16px; }
.photo-picker { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 18px; margin-bottom: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 20px; background: var(--canvas); }
.photo-picker strong { display: block; margin-bottom: 3px; }
.photo-picker p { margin-bottom: 10px; font-size: .72rem; }
.photo-preview { display: grid; place-items: center; width: 88px; height: 88px; overflow: hidden; border: 3px solid white; border-radius: 50%; color: var(--primary); background: var(--primary-soft); box-shadow: var(--shadow-small); font-size: 1.35rem; font-weight: 900; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.photo-actions .button { min-height: 36px; padding: 8px 11px; }
.confirm-dialog { text-align: center; }
.confirm-dialog .dialog-actions { justify-content: center; }
.confirm-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 22px; color: var(--primary); background: var(--primary-soft); font-size: 1.7rem; font-weight: 800; }

.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-button { width: 100%; color: var(--ink); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.stat-button:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-link { display: block; text-decoration: none; }
.group-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 18px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.group-toggle-row strong, .group-toggle-row span { display: block; }
.group-toggle-row > div > span { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.grouped-slot { align-items: flex-start; border-color: #dcd8fb !important; background: linear-gradient(135deg, #fff, #f5f2ff) !important; }
.group-count { display: inline-flex !important; margin-bottom: 10px; padding: 5px 9px; border-radius: 999px; color: var(--primary-dark) !important; background: var(--primary-soft); font-size: .68rem !important; font-weight: 850; }
.group-people { display: grid; gap: 8px; }
.group-person { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; min-width: 0; padding: 7px 8px; border-radius: 13px; background: rgba(255,255,255,.82); }
.group-person > strong { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.mini-avatar { display: grid; place-items: center; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: .66rem; font-weight: 900; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }

.count-badge, .nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; color: white; background: var(--danger); font-size: .65rem; font-weight: 900; vertical-align: middle; }
.nav-item { position: relative; }
.nav-badge { position: absolute; top: 5px; right: 11px; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid white; font-size: .55rem; }
.messages-layout { display: grid; grid-template-columns: minmax(240px, 330px) 1fr; min-height: 610px; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-small); }
.message-threads { padding: 10px; border-right: 1px solid var(--line); background: #fafafe; overflow-y: auto; }
.message-thread { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; width: 100%; gap: 10px; padding: 11px; border: 0; border-radius: 16px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.message-thread:hover, .message-thread.active { background: var(--primary-soft); }
.message-thread strong, .message-thread span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-thread span { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.message-thread > b { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px; color: white; background: var(--danger); font-size: .65rem; }
.coach-chat, .student-chat-card { display: flex; min-width: 0; flex-direction: column; background: var(--surface); }
.coach-chat-header { padding: 18px 20px; border-bottom: 1px solid var(--line); font-weight: 850; }
.chat-messages { display: flex; min-height: 350px; max-height: 520px; flex: 1; flex-direction: column; gap: 8px; padding: 20px; overflow-y: auto; background: linear-gradient(180deg, #fbfbff, #f6f7fb); }
.chat-bubble { align-self: flex-start; max-width: min(78%, 560px); padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px 18px 18px; background: white; box-shadow: 0 5px 16px rgba(52,48,101,.05); }
.chat-bubble.outgoing { align-self: flex-end; border-color: #dcd8fb; border-radius: 18px 6px 18px 18px; background: var(--primary-soft); }
.chat-bubble small, .chat-bubble time { color: var(--muted); font-size: .63rem; }
.chat-bubble p { margin: 4px 0; white-space: pre-wrap; word-break: break-word; }
.chat-bubble time { display: block; text-align: right; }
.chat-compose { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 9px; padding: 13px; border-top: 1px solid var(--line); background: white; }
.chat-compose textarea { resize: none; }
.student-chat-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-small); }
.student-chat-card .chat-messages { min-height: 230px; max-height: 390px; }
.student-peer-chat { display: grid; grid-template-columns: minmax(210px, 280px) 1fr; gap: 14px; }
.peer-threads { display: grid; align-content: start; gap: 8px; max-height: 470px; overflow-y: auto; }
.peer-thread { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: white; text-align: left; box-shadow: var(--shadow-small); cursor: pointer; }
.peer-thread.active, .peer-thread:hover { border-color: #cfc9ff; background: var(--primary-soft); }
.peer-thread strong, .peer-thread span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-thread span { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.peer-thread > b { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; color: white; background: var(--danger); font-size: .62rem; }
.ear-training-teaser { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px; border: 1px solid #cfe1f2; border-radius: 22px; background: linear-gradient(135deg, #fff, var(--primary-soft)); box-shadow: var(--shadow-small); }
.ear-training-teaser strong, .ear-training-teaser span { display: block; }
.ear-training-teaser span { margin-top: 5px; color: var(--muted); font-size: .78rem; }

.management-list { display: grid; gap: 11px; }
.management-card { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 17px; padding: 17px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow-small); }
.management-date { display: grid; place-items: center; min-height: 70px; padding: 8px; border-radius: 16px; color: var(--primary); background: var(--primary-soft); text-align: center; }
.management-date strong { font-size: 1.4rem; line-height: 1; }
.management-date span { font-size: .66rem; font-weight: 850; text-transform: uppercase; }
.management-date b { margin-top: 5px; color: var(--ink); font-size: .69rem; }
.management-copy { min-width: 0; }
.management-copy h3 { font-size: 1.05rem; }
.management-copy p { margin: 4px 0 9px; color: var(--muted); font-size: .78rem; }
.management-actions { display: flex; align-items: center; gap: 7px; }
.status-pill { display: inline-flex; margin: 2px 5px 0 0; padding: 5px 8px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: .65rem; font-weight: 850; }
.status-pill.code-pill { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; }
.status-pill.mint { color: var(--mint-dark); background: var(--mint-soft); }
.status-pill.danger { color: #9d2f42; background: var(--danger-soft); }
.admin-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-action-card { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 13px; min-height: 92px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: white; text-align: left; box-shadow: var(--shadow-small); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.admin-action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.admin-action-card svg { grid-row: 1 / 3; width: 28px; height: 28px; padding: 10px; box-sizing: content-box; border-radius: 16px; color: var(--primary); background: var(--primary-soft); }
.admin-action-card span { color: var(--muted); font-size: .72rem; }
.secretary-flow-card { margin: 0 0 20px; padding: 22px; overflow: hidden; border: 1px solid #cfe1f2; border-radius: 26px; background: linear-gradient(135deg, #ffffff, var(--primary-soft)); box-shadow: var(--shadow-small); }
.secretary-flow-card h2 { margin-bottom: 14px; font-size: 1.45rem; }
.secretary-flow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.secretary-flow-grid article { padding: 14px; border: 1px solid rgba(23,103,180,.13); border-radius: 18px; background: rgba(255,255,255,.72); }
.secretary-flow-grid strong, .secretary-flow-grid span { display: block; }
.secretary-flow-grid span { margin-top: 5px; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.admin-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.coach-management-card { align-items: start; }
.coach-student-details { grid-column: 1 / -1; margin-top: 2px; border-top: 1px solid var(--line); transition: border-color .18s ease; }
.coach-student-details summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px 0; color: var(--primary-dark); font-size: .82rem; font-weight: 950; list-style: none; cursor: pointer; user-select: none; transition: color .18s ease; }
.coach-student-details summary::-webkit-details-marker { display: none; }
.coach-student-details summary:focus-visible { outline: 3px solid rgba(107,217,229,.48); outline-offset: 5px; border-radius: 12px; }
.coach-student-details summary b { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; transition: transform .18s ease, background .18s ease, color .18s ease; }
.coach-student-details summary b::after { content: "+"; font-size: .86rem; line-height: 1; }
.coach-student-details[open] { border-color: #c7def1; }
.coach-student-details[open] summary b { color: var(--mint-dark); background: var(--mint-soft); transform: translateY(-1px); }
.coach-student-details[open] summary b::after { content: "-"; }
.coach-student-list { display: grid; gap: 8px; padding-top: 12px; }
.coach-student-details[open] .coach-student-list { animation: collapsible-body-in .24s cubic-bezier(.2,.8,.2,1) both; }
.coach-student-details[open] .coach-student-row { animation: collapsible-row-in .22s cubic-bezier(.2,.8,.2,1) both; }
.coach-student-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcff; }
.coach-student-dot { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font-size: .98rem; font-weight: 950; }
.coach-student-copy { min-width: 0; }
.coach-student-copy strong, .coach-student-copy span { display: block; }
.coach-student-copy strong { font-size: .88rem; }
.coach-student-copy span { margin: 2px 0 6px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.coach-student-empty { padding: 14px; border: 1px dashed #d9d9e5; border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.7); font-size: .8rem; font-weight: 750; text-align: center; }
.path-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.path-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 9px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: .65rem; font-weight: 850; }
.path-pill::before { content: ""; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 999px; background: var(--path-color, var(--primary)); }
.coach-scope-banner { margin-bottom: 18px; padding: 14px 16px; border: 1px solid #cfe1f2; border-radius: 18px; color: var(--primary-dark); background: var(--primary-soft); font-size: .82rem; font-weight: 750; }
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.more-grid button, .more-grid a { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 14px; padding: 21px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: white; text-align: left; text-decoration: none; box-shadow: var(--shadow-small); cursor: pointer; }
.more-grid svg { grid-row: 1 / 3; width: 30px; height: 30px; padding: 7px; box-sizing: content-box; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.more-grid span { color: var(--muted); font-size: .73rem; }
.mini-setting { margin: 16px 0 4px; padding: 14px 15px; border: 1px solid #dcd8fb; border-radius: 17px; background: #f8f6ff; }
.mini-setting .form-note { margin: 4px 0 0; font-size: .72rem; }
.wide-dialog { width: min(680px, calc(100% - 28px)); }
.student-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; max-height: 180px; margin-top: 10px; padding: 10px; overflow-y: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--canvas); }
.student-picker label { display: flex; align-items: center; gap: 8px; padding: 9px; border-radius: 11px; background: white; font-size: .79rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 190px; margin-top: 8px; padding: 10px; overflow-y: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--canvas); }
.checkbox-grid label { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px; border: 1px solid transparent; border-radius: 11px; background: white; color: var(--ink); font-size: .79rem; font-weight: 800; cursor: pointer; }
.checkbox-grid input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }
.checkbox-grid span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-left { max-height: 260px; overflow-y: auto; text-align: left; white-space: pre-wrap; }
.profile-access-block { margin-top: 20px; padding: 16px; border: 1px solid #cfe1f2; border-radius: 17px; background: var(--primary-soft); }
.profile-access-block > strong { display: block; color: var(--primary-dark); }
.profile-access-block .form-note { margin: 4px 0 12px; color: var(--muted); font-size: .72rem; }
.student-preview-dialog { padding: 27px; text-align: center; }
.student-preview-dialog .dialog-header { text-align: left; }
.student-preview-photo { display: grid; place-items: center; width: min(230px, 70vw); aspect-ratio: 1; margin: 8px auto 23px; overflow: hidden; border: 7px solid white; border-radius: 50%; color: var(--primary); background: var(--primary-soft); box-shadow: 0 22px 50px rgba(9,64,120,.2); font-size: 3.2rem; font-weight: 900; }
.student-preview-photo img { width: 100%; height: 100%; object-fit: cover; }
.student-preview-contacts { display: grid; gap: 9px; }
.student-preview-contacts > p { margin: 0; }
.student-preview-contact { padding: 13px; border: 1px solid #cfe1f2; border-radius: 18px; background: var(--primary-soft); text-align: left; }
.student-preview-contact-head { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 11px; }
.student-preview-contact-head > svg { padding: 9px; box-sizing: content-box; border-radius: 12px; color: white; background: var(--primary); }
.student-preview-contacts small, .student-preview-contacts strong { display: block; }
.student-preview-contacts small { margin-bottom: 2px; color: var(--muted); font-size: .65rem; }
.student-preview-contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.student-preview-contact-actions a { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 10px; border-radius: 12px; font-size: .75rem; font-weight: 850; text-decoration: none; }
.student-preview-contact-actions svg { width: 18px; height: 18px; }
.preview-call-action { color: var(--primary); background: white; }
.preview-whatsapp-action { color: white; background: #1f9d55; }
.install-help-dialog { padding: 27px; }
.install-help-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 23px; color: white; background: linear-gradient(145deg, var(--primary), var(--mint-dark)); box-shadow: 0 14px 34px rgba(23,103,180,.22); }
.install-help-icon svg { width: 34px; height: 34px; }
.install-help-dialog > p { text-align: center; }
.install-help-steps { display: grid; gap: 10px; margin: 20px 0 0; padding-left: 25px; color: var(--ink); font-size: .88rem; line-height: 1.45; }
.auth-install-button { width: 100%; margin-top: 10px; }
.auth-install-button svg, .install-button svg { width: 18px; height: 18px; }
.topbar-actions-dialog { width: min(360px, calc(100% - 24px)); max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px); margin: calc(var(--safe-top) + 12px) 12px auto auto; padding: 22px; border-radius: 24px; }
.topbar-actions-dialog::backdrop { background: rgba(28,26,45,.26); backdrop-filter: blur(3px); }
.topbar-actions-dialog[open] { animation: side-sheet-in .24s cubic-bezier(.2,.8,.2,1) both; }
.topbar-actions-dialog[open]::backdrop { animation: menu-backdrop-in .2s ease both; }
.topbar-action-list { display: grid; gap: 8px; }
.topbar-action-list a, .topbar-action-list button { position: relative; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: white; text-align: left; text-decoration: none; box-shadow: var(--shadow-small); cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.topbar-action-list a:hover, .topbar-action-list button:hover, .topbar-action-list a:focus-visible, .topbar-action-list button:focus-visible { transform: translateX(-2px); border-color: #bad8ef; background: #fbfdff; box-shadow: 0 12px 28px rgba(23,103,180,.1); outline: 0; }
.topbar-action-list a:active, .topbar-action-list button:active { transform: translateX(-1px) scale(.985); }
.topbar-action-list svg { width: 22px; height: 22px; padding: 10px; box-sizing: content-box; border-radius: 14px; color: var(--primary); background: var(--primary-soft); transition: transform .18s ease, background .18s ease, color .18s ease; }
.topbar-action-list a:hover svg, .topbar-action-list button:hover svg { transform: scale(1.05); color: white; background: var(--primary); }
.topbar-action-list strong, .topbar-action-list small { display: block; }
.topbar-action-list small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.topbar-actions-dialog[open] .topbar-action-list > * { animation: menu-item-in .22s cubic-bezier(.2,.8,.2,1) both; }
.topbar-actions-dialog[open] .topbar-action-list > *:nth-child(1) { animation-delay: .03s; }
.topbar-actions-dialog[open] .topbar-action-list > *:nth-child(2) { animation-delay: .06s; }
.topbar-actions-dialog[open] .topbar-action-list > *:nth-child(3) { animation-delay: .09s; }
.topbar-actions-dialog[open] .topbar-action-list > *:nth-child(4) { animation-delay: .12s; }
.topbar-actions-dialog[open] .topbar-action-list > *:nth-child(5) { animation-delay: .15s; }
.topbar-actions-dialog[open] .topbar-action-list > *:nth-child(6) { animation-delay: .18s; }
.portal-month-group[open] .portal-row:nth-child(1), .history-accordion[open] .history-item:nth-child(1), .coach-student-details[open] .coach-student-row:nth-child(1) { animation-delay: .02s; }
.portal-month-group[open] .portal-row:nth-child(2), .history-accordion[open] .history-item:nth-child(2), .coach-student-details[open] .coach-student-row:nth-child(2) { animation-delay: .04s; }
.portal-month-group[open] .portal-row:nth-child(3), .history-accordion[open] .history-item:nth-child(3), .coach-student-details[open] .coach-student-row:nth-child(3) { animation-delay: .06s; }
.portal-month-group[open] .portal-row:nth-child(4), .history-accordion[open] .history-item:nth-child(4), .coach-student-details[open] .coach-student-row:nth-child(4) { animation-delay: .08s; }
.portal-month-group[open] .portal-row:nth-child(5), .history-accordion[open] .history-item:nth-child(5), .coach-student-details[open] .coach-student-row:nth-child(5) { animation-delay: .1s; }
.portal-month-group[open] .portal-row:nth-child(6), .history-accordion[open] .history-item:nth-child(6), .coach-student-details[open] .coach-student-row:nth-child(6) { animation-delay: .12s; }
.portal-month-group[open] .portal-row:nth-child(7), .history-accordion[open] .history-item:nth-child(7), .coach-student-details[open] .coach-student-row:nth-child(7) { animation-delay: .14s; }
.portal-month-group[open] .portal-row:nth-child(8), .history-accordion[open] .history-item:nth-child(8), .coach-student-details[open] .coach-student-row:nth-child(8) { animation-delay: .16s; }
@keyframes menu-backdrop-in { from { opacity: 0; backdrop-filter: blur(0); } }
@keyframes student-menu-in { from { opacity: 0; transform: translateX(28px) scale(.985); } }
@keyframes side-sheet-in { from { opacity: 0; transform: translateX(18px) scale(.985); } }
@keyframes menu-item-in { from { opacity: 0; transform: translateX(10px); } }
@keyframes collapsible-body-in { from { opacity: 0; transform: translateY(-8px); clip-path: inset(0 0 14px 0); } }
@keyframes collapsible-row-in { from { opacity: 0; transform: translateY(-5px); } }
.portal-events { display: grid; gap: 10px; }
.portal-event-card { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow-small); cursor: pointer; }
.portal-event-card.unread { border-color: #cfc9ff; box-shadow: 0 10px 28px rgba(104,87,229,.12); }
.portal-event-card strong, .portal-event-card span, .portal-event-card b, .portal-event-card a { display: block; }
.portal-event-card span { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.portal-event-card p { margin: 8px 0; color: var(--muted); font-size: .8rem; }
.portal-event-card b { margin-top: 6px; color: var(--mint-dark); font-size: .78rem; }
.portal-event-card a { margin-top: 9px; color: var(--primary); font-size: .78rem; font-weight: 800; }
.event-rsvp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.event-rsvp-actions button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--canvas); font-size: .74rem; font-weight: 850; cursor: pointer; }
.event-rsvp-actions button > span { display: inline; margin: 0; color: inherit; font-size: 1rem; }
.event-rsvp-actions button.active.yes { border-color: #8ed7bd; color: #08724d; background: #e9faf3; box-shadow: 0 5px 15px rgba(8,114,77,.1); }
.event-rsvp-actions button.active.no { border-color: #efb5bd; color: #a43c4b; background: var(--danger-soft); box-shadow: 0 5px 15px rgba(164,60,75,.08); }
.status-pill.rsvp-yes { color: #08724d; background: #e9faf3; }
.status-pill.rsvp-no { color: #a43c4b; background: var(--danger-soft); }
.management-copy .event-rsvp-names { margin: 9px 0 0; color: var(--muted); font-size: .75rem; }
.management-copy .event-rsvp-names strong { color: var(--ink); }
.portal-feature-section { margin-top: 38px; }
.portal-coach-list { display: grid; gap: 12px; }
.portal-coach-card { display: grid; grid-template-columns: 76px 1fr; align-items: start; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow-small); }
.portal-coach-photo { display: grid; place-items: center; width: 76px; height: 76px; overflow: hidden; border-radius: 22px; color: var(--primary); background: var(--primary-soft); font-size: 1.15rem; font-weight: 950; }
.portal-coach-photo img { width: 100%; height: 100%; object-fit: cover; }
.portal-coach-copy h3 { margin: 2px 0 6px; font-size: 1.05rem; }
.portal-coach-copy p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; white-space: pre-wrap; }
.portal-coach-links, .portal-coach-phone { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.portal-coach-links a, .portal-coach-phone a { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 8px 11px; border: 1px solid #cfe1f2; border-radius: 12px; color: var(--primary-dark); background: var(--primary-soft); font-size: .75rem; font-weight: 850; text-decoration: none; }
.portal-coach-phone a:last-child { color: #08724d; border-color: #a9dfc9; background: #e9faf3; }
.portal-coach-phone svg { width: 16px; height: 16px; }
.proposal-form { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow-small); }
.proposal-form .dialog-actions { margin-top: 15px; }
.proposal-list, .diary-list { display: grid; gap: 11px; }
.proposal-card { display: grid; grid-template-columns: 44px 1fr auto; align-items: start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow-small); }
.proposal-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.proposal-card strong, .proposal-card span { display: block; }
.proposal-card span { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.proposal-card p { margin: 8px 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.proposal-card a { display: inline-flex; margin-top: 7px; color: var(--primary); font-size: .78rem; font-weight: 850; text-decoration: none; }
.diary-toolbar { justify-content: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.diary-toolbar .field-label { margin: 0; white-space: nowrap; }
.diary-toolbar .text-input { width: min(340px, 100%); }
.diary-coach-grid { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: 22px; margin-top: 24px; }
.diary-card { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow-small); }
.diary-card-head { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 13px; }
.diary-card-head .management-date { min-height: 60px; }
.diary-card-head .eyebrow { margin-bottom: 2px; }
.diary-card-head h3 { margin: 0; }
.diary-card-head small { color: var(--muted); font-size: .7rem; }
.diary-card > p { margin: 15px 0; color: var(--ink); font-size: .88rem; line-height: 1.55; white-space: pre-wrap; }
.diary-song-link { display: inline-flex; align-items: center; gap: 7px; color: var(--primary); font-size: .8rem; font-weight: 850; text-decoration: none; }
.diary-song-link svg { width: 18px; height: 18px; }
.diary-video { display: block; width: 100%; max-height: 430px; margin-top: 14px; border-radius: 16px; background: #111; }
.diary-video-actions { display: flex; margin-top: 8px; }
.diary-video-actions a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: .78rem; font-weight: 850; text-decoration: none; }
.diary-video-actions svg { width: 17px; height: 17px; }
.diary-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.file-input { padding: 9px; }
.video-compression-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 16px; margin-top: 13px; padding: 14px 15px; border: 1px solid #cfe1f2; border-radius: 17px; background: linear-gradient(135deg, #fff, var(--primary-soft)); }
.video-compression-box strong { display: block; color: var(--primary-dark); font-size: .88rem; }
.video-compression-box .form-note { margin: 4px 0 0; font-size: .72rem; }
.video-compression-option { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--primary-dark); font-size: .75rem; font-weight: 800; }
.video-compression-option input { width: 17px; height: 17px; accent-color: var(--primary); }
.video-trim-editor { display: grid; gap: 12px; margin-top: 13px; padding: 14px 15px; border: 1px solid #d7e6f4; border-radius: 17px; background: #f7fbff; }
.video-trim-editor[hidden] { display: none; }
.trim-preview { display: block; width: 100%; max-height: 260px; border-radius: 15px; background: #111; }
.trim-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trim-topline .video-compression-option { grid-column: auto; margin: 0; }
.trim-topline .button { flex: 0 0 auto; padding: 9px 12px; font-size: .74rem; }
.trim-time-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.trim-time-grid label { display: grid; gap: 5px; color: var(--muted); font-size: .67rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.trim-time-input { padding: 10px 11px; font-size: .82rem; font-weight: 850; text-align: center; }
.trim-range { position: relative; height: 42px; --start: 0%; --end: 100%; }
.trim-range-track { position: absolute; left: 0; right: 0; top: 17px; height: 9px; border-radius: 999px; background: linear-gradient(to right, #dce8f4 0 var(--start), var(--primary) var(--start) var(--end), #dce8f4 var(--end) 100%); box-shadow: inset 0 0 0 1px rgba(23,103,180,.08); }
.trim-range input[type="range"] { position: absolute; inset: 0; width: 100%; height: 42px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; pointer-events: none; }
.trim-range input[type="range"]::-webkit-slider-runnable-track { height: 42px; background: transparent; }
.trim-range input[type="range"]::-moz-range-track { height: 42px; background: transparent; }
.trim-range input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: 7px; border: 4px solid white; border-radius: 50%; background: var(--primary); box-shadow: 0 6px 16px rgba(23,103,180,.25); cursor: grab; pointer-events: auto; -webkit-appearance: none; }
.trim-range input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 4px solid white; border-radius: 50%; background: var(--primary); box-shadow: 0 6px 16px rgba(23,103,180,.25); cursor: grab; pointer-events: auto; }
.trim-range input[type="range"]:disabled::-webkit-slider-thumb { cursor: not-allowed; opacity: .45; }
.trim-range input[type="range"]:disabled::-moz-range-thumb { cursor: not-allowed; opacity: .45; }
.trim-playhead-box { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid #d7e6f4; border-radius: 14px; background: white; }
.trim-playhead-box .field-label { display: flex; justify-content: space-between; gap: 10px; margin: 0; }
.trim-playhead-box strong { color: var(--primary-dark); font-size: .82rem; }
.trim-playhead { width: 100%; accent-color: var(--accent); }
.trim-playhead:disabled { opacity: .45; }
.video-compression-status { margin: 10px 0 0; padding: 10px 12px; border-radius: 13px; color: var(--primary-dark); background: var(--mint-soft); font-size: .75rem; font-weight: 750; line-height: 1.45; }
.video-compression-status.warning { color: #8b5d19; background: var(--amber-soft); }
.upload-progress { --progress: 0%; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; color: var(--primary-dark); background: var(--primary-soft); font-size: .78rem; }
.upload-spinner { width: 18px; height: 18px; border: 3px solid #bfd8ed; border-top-color: var(--primary); border-radius: 50%; animation: upload-spin .7s linear infinite; }
.upload-progress-copy { display: grid; min-width: 0; gap: 7px; }
.upload-progress-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress-bar { display: none; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(23,103,180,.16); }
.upload-progress-bar i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--mint-dark)); transition: width .16s linear; }
.upload-progress b { display: none; min-width: 48px; font-size: .98rem; line-height: 1; text-align: right; }
.upload-progress.has-progress .upload-progress-bar,
.upload-progress.has-progress b { display: block; }
@keyframes upload-spin { to { transform: rotate(360deg); } }

.empty-state { padding: 42px 20px; border: 1px dashed #d9d9e5; border-radius: var(--radius); color: var(--muted); text-align: center; background: rgba(255,255,255,.5); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }
.toast { position: fixed; z-index: 240; left: 50%; top: 46%; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 13px; width: min(430px, calc(100% - 32px)); min-height: 86px; padding: 18px 20px; border: 1px solid rgba(255,255,255,.9); border-radius: 24px; color: var(--primary-dark); background: rgba(255,255,255,.97); box-shadow: 0 28px 90px rgba(2,19,43,.28); font-size: .98rem; font-weight: 850; line-height: 1.42; opacity: 0; pointer-events: none; transform: translate(-50%, calc(-50% + 20px)) scale(.96); transition: opacity .24s ease, transform .24s ease; }
.toast::before { content: "✓"; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 14px; color: var(--primary-dark); background: var(--mint); font-size: 1rem; font-weight: 950; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.error { color: #5c1318; background: rgba(255,248,248,.98); border-color: rgba(234,91,103,.28); }
.toast.error::before { content: "!"; color: white; background: var(--danger); }
.saving-overlay { width: min(340px, calc(100% - 34px)); padding: 0; border: 0; border-radius: 28px; color: var(--ink); background: transparent; box-shadow: none; }
.saving-overlay::backdrop { background: rgba(13, 22, 38, .34); backdrop-filter: blur(6px); }
.saving-card { display: grid; place-items: center; gap: 10px; padding: 28px 24px; border: 1px solid rgba(255,255,255,.84); border-radius: 28px; background: rgba(255,255,255,.96); box-shadow: 0 28px 80px rgba(2,19,43,.28); text-align: center; }
.saving-spinner { width: 48px; height: 48px; border: 5px solid #dcecf8; border-top-color: var(--primary); border-radius: 50%; animation: saving-spin .72s linear infinite; }
.saving-card strong { display: block; color: var(--primary-dark); font-size: 1.08rem; letter-spacing: -.02em; }
.saving-card p { max-width: 250px; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.saving-progress { --progress: 0%; display: grid; width: min(230px, 70vw); grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 4px; }
.saving-progress[hidden] { display: none; }
.saving-progress span { height: 9px; overflow: hidden; border-radius: 999px; background: rgba(23,103,180,.16); }
.saving-progress i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--mint-dark)); transition: width .16s linear; }
.saving-progress strong { min-width: 48px; font-size: 1rem; text-align: right; }
@keyframes saving-spin { to { transform: rotate(360deg); } }

@media (max-width: 920px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .messages-layout { grid-template-columns: 260px 1fr; }
  .diary-coach-grid { grid-template-columns: 1fr; }
  .admin-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-columns, .secretary-flow-grid { grid-template-columns: 1fr; }
  .student-grid { grid-template-columns: repeat(2, 1fr); }
  .group-student-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .student-group-toggle { justify-content: center; width: 100%; }
  .filter-pills { align-self: flex-start; max-width: 100%; }
}

@media (max-width: 650px) {
  .topbar { height: calc(68px + var(--safe-top)); gap: 8px; padding: var(--safe-top) 12px 0; overflow: hidden; }
  .brand-lockup { min-width: 0; flex: 1 1 auto; gap: 8px; }
  .brand-lockup > div { min-width: 0; }
  .brand-logo { width: 52px; height: 34px; }
  .brand-lockup strong { overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
  .brand-lockup span { display: none; }
  .brand-lockup .brand-referent:not([hidden]) { display: block !important; overflow: hidden; max-width: 100%; color: var(--primary-dark); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
  .brand-lockup.has-referent .brand-date { display: block !important; overflow: hidden; max-width: 100%; color: var(--muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { flex: 0 0 auto; gap: 4px; min-width: 0; }
  .topbar-actions #supportButton,
  .topbar-actions #notificationButton,
  .topbar-actions #logoutButton,
  .topbar-actions a[href="guida-coach.php"],
  .topbar-actions [data-install-app] { display: none !important; }
  .mobile-topbar-more { display: grid; }
  .icon-button { width: 36px; height: 36px; min-width: 36px; border-radius: 12px; }
  .icon-button svg { width: 19px; height: 19px; }
  .storage-badge { width: 24px; height: 24px; min-width: 24px; }
  .storage-badge::before { width: 9px; height: 9px; }
  .main-content { width: calc(100% - 28px); padding-top: 20px; }
  .install-button { min-width: 44px; padding: 10px 12px; font-size: .72rem; }
  .payment-hero { min-height: 190px; padding: 27px; border-radius: 27px; }
  .payment-hero h1 { max-width: 250px; font-size: 2.05rem; }
  .payment-hero p { max-width: calc(100% - 78px); }
  .hero-symbol { position: absolute; right: 20px; bottom: 22px; width: 64px; height: 64px; border-radius: 21px; font-size: 2rem; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-bottom: 34px; }
  .stat-card { padding: 15px 12px; border-radius: 18px; }
  .stat-card span { min-height: 30px; font-size: .68rem; }
  .stat-card strong { font-size: 1.65rem; }
  .stat-card small { display: none; }
  .agenda-heading { align-items: stretch; flex-direction: column; gap: 10px; }
  .section-actions { justify-content: stretch; }
  .section-actions .button { flex: 1 1 auto; }
  .section-actions .text-button { flex: 0 0 auto; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .button { flex: 1 1 auto; }
  .page-actions .back-to-more { flex: 0 0 44px; width: 44px; min-width: 44px; }
  .student-grid, .compact-grid, .group-student-grid { grid-template-columns: 1fr; }
  .student-visual-group { padding: 12px; border-radius: 20px; }
  .student-visual-group-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .admin-action-grid { grid-template-columns: 1fr; }
  .agenda-item { grid-template-columns: 54px 1fr; gap: 10px; padding: 14px; }
  .agenda-progress { grid-column: 2 / -1; max-width: 180px; min-width: 0; gap: 7px; }
  .agenda-lesson-dot { height: 9px; }
  .agenda-action { grid-column: 1 / -1; justify-self: stretch; }
  .agenda-action .button { flex: 1; padding: 10px; }
  .agenda-action .button span { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .page-heading .page-actions .button { width: auto; min-width: 0; }
  .setting-block { grid-template-columns: 1fr; padding: 21px; }
  .setting-inline { align-items: flex-start; }
  .setting-icon { width: 42px; height: 42px; }
  .brand-color-grid, .brand-upload-grid { grid-template-columns: 1fr; }
  .brand-upload-card { grid-template-columns: 76px 1fr; padding: 12px; }
  .brand-preview { width: 76px; height: 64px; border-radius: 16px; }
  .about-card { flex-direction: column; gap: 5px; }
  .auth-card { padding: 30px 24px; border-radius: 27px; }
  .student-topbar, .student-main { width: calc(100% - 28px); }
  .student-topbar { gap: 8px; overflow: hidden; }
  .student-topbar .topbar-actions { flex: 0 0 auto; gap: 6px; }
  .student-topbar .topbar-actions > a.icon-button,
  .student-topbar #studentSupportButton,
  .student-topbar [data-install-app] { display: none !important; }
  .student-side-menu { width: min(350px, calc(100% - 24px)); gap: 10px; overflow-y: auto; padding: calc(18px + var(--safe-top)) 14px calc(16px + var(--safe-bottom)); border-radius: 24px 0 0 24px; }
  .student-side-head { gap: 10px; padding-bottom: 4px; }
  .student-side-head strong { font-size: 1.28rem; }
  .student-side-nav, .student-side-tools { gap: 6px; }
  .student-side-tools { margin-top: 4px; padding-top: 10px; }
  .student-side-nav button, .student-side-tools button, .student-side-tools a { grid-template-columns: 34px 1fr auto; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 14px; }
  .student-side-nav svg, .student-side-tools svg { width: 34px; height: 34px; padding: 8px; border-radius: 11px; }
  .student-side-nav span, .student-side-tools span { font-size: .88rem; line-height: 1.12; }
  .topbar-actions-dialog { width: min(350px, calc(100% - 24px)); overflow-y: auto; padding: 18px 14px; border-radius: 24px; }
  .topbar-actions-dialog .dialog-header { gap: 10px; margin-bottom: 12px; }
  .topbar-actions-dialog .dialog-header h2 { font-size: 1.28rem; }
  .topbar-action-list { gap: 6px; }
  .topbar-action-list a, .topbar-action-list button { grid-template-columns: 34px 1fr; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 14px; }
  .topbar-action-list svg { width: 18px; height: 18px; padding: 8px; border-radius: 11px; }
  .topbar-action-list strong { font-size: .88rem; line-height: 1.12; }
  .topbar-action-list small { margin-top: 1px; font-size: .66rem; line-height: 1.15; }
  .student-main { padding-top: 25px; }
  .portal-voice-range-card { grid-template-columns: 46px 1fr; gap: 12px; padding: 14px; border-radius: 20px; }
  .portal-voice-icon { width: 44px; height: 44px; border-radius: 15px; }
  .portal-voice-range-card strong { font-size: 1rem; }
  .availability-card { grid-template-columns: 1fr; min-height: 0; padding: 28px; border-radius: 28px; }
  .availability-ring { width: 140px; height: 140px; margin: 0 auto; }
  .availability-copy { text-align: center; }
  .availability-copy p { margin-bottom: 0; }
  .portal-progress { margin-right: auto; margin-left: auto; }
  .portal-quick-actions { gap: 8px; margin-top: 12px; }
  .portal-coach-card { grid-template-columns: 58px 1fr; gap: 12px; padding: 14px; border-radius: 18px; }
  .portal-coach-photo { width: 58px; height: 58px; border-radius: 18px; font-size: .95rem; }
  .portal-coach-copy h3 { font-size: .95rem; }
  .portal-coach-copy p { font-size: .8rem; }
  .portal-feature-button { grid-template-columns: 40px 1fr; min-height: 70px; padding: 12px; border-radius: 18px; }
  .portal-feature-button svg { width: 40px; height: 40px; padding: 10px; border-radius: 14px; }
  .portal-feature-button strong { font-size: .84rem; }
  .portal-feature-button small { font-size: .64rem; }
  .portal-grid { grid-template-columns: 1fr; gap: 5px; }
  .portal-avatar { width: 64px; height: 64px; }
  .portal-month-group summary { grid-template-columns: minmax(0,1fr) auto 26px; gap: 8px; padding: 14px; }
  .portal-month-group summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portal-month-group summary small { padding: 5px 7px; font-size: .64rem; }
  .portal-month-group summary::after { width: 26px; height: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .week-toolbar { grid-template-columns: auto 1fr auto; }
  .week-toolbar #currentWeek { display: none; }
  .schedule-days { display: flex; max-width: 100%; margin-right: 0; padding: 0 0 6px; overflow-x: auto; }
  .schedule-day { min-width: 68px; flex: 0 0 68px; }
  .timeline-slot { grid-template-columns: 76px 1fr; gap: 10px; }
  .timeline-actions, .free-slot-button { grid-column: 1 / -1; justify-self: stretch; }
  .timeline-actions button { flex: 1; }
  .free-slot-button { width: 100%; }
  .variations-list { grid-template-columns: 1fr; }
  .messages-layout { display: block; min-height: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .message-threads { display: flex; max-width: 100%; gap: 7px; margin: 0 0 12px; padding: 0 0 6px; border: 0; overflow-x: auto; background: transparent; }
  .message-thread { min-width: 210px; border: 1px solid var(--line); background: white; }
  .student-peer-chat { grid-template-columns: 1fr; }
  .peer-threads { display: flex; max-width: 100%; gap: 7px; margin: 0 0 12px; padding: 0 0 6px; overflow-x: auto; }
  .peer-thread { min-width: 190px; }
  .ear-training-teaser { align-items: stretch; flex-direction: column; }
  .ear-training-teaser .button { width: 100%; }
  .coach-chat { min-height: 500px; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; }
  .chat-messages { min-height: 310px; padding: 14px; }
  .chat-bubble { max-width: 88%; }
  .chat-compose { grid-template-columns: 1fr; }
  .chat-compose .button { width: 100%; }
  .management-card { grid-template-columns: 62px 1fr; align-items: start; gap: 11px; padding: 13px; }
  .history-accordion summary { grid-template-columns: 38px minmax(0,1fr) auto 26px; gap: 8px; padding: 12px; }
  .history-accordion summary > span { width: 38px; height: 38px; }
  .history-accordion summary small { padding: 5px 7px; font-size: .64rem; }
  .history-accordion summary::after { width: 26px; height: 26px; }
  .history-item { grid-template-columns: 44px 1fr; gap: 12px; padding: 14px; }
  .history-item .delete-button { grid-column: 1 / -1; justify-self: end; }
  .coach-student-row { grid-template-columns: 38px 1fr; align-items: start; gap: 10px; }
  .coach-student-dot { width: 38px; height: 38px; border-radius: 12px; }
  .coach-student-row .management-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .proposal-card { grid-template-columns: 40px 1fr auto; padding: 13px; }
  .diary-toolbar, .history-toolbar { align-items: stretch; flex-direction: column; }
  .diary-toolbar .text-input, .history-toolbar .text-input { width: 100%; }
  .management-date { min-height: 62px; }
  .management-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .more-grid { grid-template-columns: 1fr; }
  .student-picker, .checkbox-grid { grid-template-columns: 1fr; }
  .group-person { grid-template-columns: 30px 1fr; }
  .group-person .timeline-actions { grid-column: 1 / -1; }
  .app-dialog form, .confirm-dialog { padding: 23px 20px; }
  .lesson-info-dialog { padding: 23px 20px 20px; }
  .lesson-info-dialog .dialog-header { gap: 12px; }
  .lesson-info-dialog .dialog-header h2 { font-size: 1.32rem; line-height: 1.12; }
  .lesson-info-grid > div { padding: 12px 13px; border-radius: 14px; }
  .photo-picker { grid-template-columns: 72px 1fr; gap: 13px; padding: 12px; }
  .photo-preview { width: 70px; height: 70px; }
  .trim-topline { align-items: stretch; flex-direction: column; }
  .trim-topline .button { width: 100%; }
  .trim-preview { max-height: 220px; }
}

@media (max-width: 380px) {
  .auth-screen { padding-right: 18px; padding-left: 18px; }
  .auth-card { padding: 26px 20px; border-radius: 24px; }
  .auth-mode-switch button { padding: 8px 6px; font-size: .7rem; }
  .brand-logo { width: 46px; }
  .topbar-actions { gap: 3px; }
  .icon-button { width: 34px; height: 34px; min-width: 34px; }
  .payment-hero { min-height: 176px; padding: 23px; }
  .payment-hero h1 { font-size: 1.85rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .portal-quick-actions { grid-template-columns: 1fr; }
  .availability-card { gap: 22px; padding: 22px; }
  .availability-ring { width: 118px; height: 118px; }
  .availability-ring::before { inset: 10px; }
  .availability-ring strong { font-size: 2.75rem; }
}

@media (max-width: 340px) {
  .brand-lockup { gap: 6px; }
  .brand-logo { width: 42px; }
  .brand-lockup strong { font-size: .84rem; }
}

@media (min-width: 921px) {
  .main-content { width: min(1080px, calc(100% - 180px)); margin-right: auto; margin-left: max(140px, calc((100vw - 1080px) / 2)); }
  .bottom-nav { left: 30px; top: 50%; bottom: auto; width: 82px; height: auto; flex-direction: column; padding: 10px; border-radius: 26px; transform: translateY(-50%); }
  .nav-item { width: 62px; min-height: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
