:root {
  --navy: #163a8a;
  --navy-2: #1b4ba8;
  --navy-3: #2458c2;
  --teal: #1e8a4c;
  --teal-2: #24a059;
  --gold: #e8b923;
  --gold-soft: #fff3c4;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --paper: #ffffff;
  --danger: #dc2626;
  --success: #1e8a4c;
  --info: #1b4ba8;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, .08);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar: 260px;
  --font: Inter, "Segoe UI", sans-serif;
  --dock: 64px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }

h1, h2, h3, h4 { letter-spacing: -.02em; font-weight: 600; }
a { color: var(--navy-2); }
p { color: var(--muted); }

.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: .55rem .9rem;
  font-size: 14px;
}
.btn-sm { border-radius: var(--radius-sm); }
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--navy-2);
  border-color: var(--navy-2);
}
.btn-teal {
  background: var(--teal);
  border: 0;
  color: #fff;
}
.btn-teal:hover { background: var(--teal-2); color: #fff; }
.btn-gold {
  background: var(--gold);
  border: 0;
  color: #163a8a;
}
.btn-outline-navy {
  color: var(--navy);
  border-color: #cbd5e1;
  background: #fff;
}
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: #cbd5e1;
  padding: .55rem .75rem;
  min-height: 42px;
  font-size: 15px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(22, 58, 138, .12);
}
.form-label { font-weight: 600; color: var(--ink); font-size: 13px; }

/* Auth */
.auth-body { background: var(--navy); }
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-visual {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 48px;
  background:
    radial-gradient(circle at 18% 18%, rgba(232, 185, 35, .22), transparent 30%),
    radial-gradient(circle at 92% 82%, rgba(30, 138, 76, .38), transparent 34%),
    linear-gradient(160deg, #122a66 0%, #163a8a 52%, #1e8a4c 100%);
}
.auth-visual-inner { position: relative; z-index: 1; max-width: 520px; }
.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--gold-soft);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-visual h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin: 18px 0 10px;
  color: #fff;
}
.auth-visual p.lead { color: rgba(255,255,255,.78); font-size: 17px; }
.auth-points { display: grid; gap: 10px; margin-top: 32px; }
.auth-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 14px;
}
.auth-point i {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #163a8a;
  flex: none;
}
.auth-point strong { display: block; color: #fff; }
.auth-point span { color: rgba(255,255,255,.7); font-size: 13px; }
.auth-panel {
  display: grid;
  place-items: center;
  background: #f8fafc;
  padding: 28px 20px;
}
.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.brand-row { margin-bottom: 20px; }
.brand-row strong { font-size: 22px; color: var(--navy); display: block; }

/* App chrome */
.app-shell { min-height: 100vh; display: flex; }
.app-sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, #122a66 0%, #163a8a 62%, #1e8a4c);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  overflow: hidden;
}
.brand-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px 14px;
}
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-school { color: rgba(255,255,255,.62); font-size: 12px; margin-top: 2px; }
.sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.12);
  color: #fff;
  flex: none;
}
.sidebar-user {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 12px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--gold);
  color: #163a8a;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}
.sidebar-user-meta strong, .sidebar-user-meta span { display: block; }
.sidebar-user-meta span { color: rgba(255,255,255,.6); font-size: 12px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.35) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.32);
  border-radius: 99px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.5); }

.sidebar-nav .nav-link {
  color: rgba(255,255,255,.82);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 14px;
  min-height: 40px;
}
.sidebar-nav .nav-link i { width: 18px; }
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav .nav-link.active {
  color: #163a8a;
  background: var(--gold-soft);
  font-weight: 600;
}
.nav-label {
  color: rgba(255,255,255,.4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 12px 8px 4px;
}
.sidebar-foot {
  flex: none;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.16);
}
.logout-link {
  color: #fff;
  text-decoration: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 10px;
  font-weight: 600;
  min-height: 44px;
  align-items: center;
  background: rgba(0, 0, 0, .18);
}
.logout-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar-logout {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  min-height: 40px;
  flex: none;
}
.topbar-logout:hover { color: var(--navy); background: #f8fafc; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 8px;
}
.topbar-copy { flex: 1; min-width: 0; }
.topbar-copy h1 { margin: 0; font-size: 22px; }
.topbar-copy p { margin: 2px 0 0; font-size: 13px; }
.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 20px;
}
.today-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.app-content { padding: 8px 20px 28px; flex: 1; }

.class-switcher-wrap { padding: 0 20px 8px; }
.class-switcher-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.class-switcher {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.class-switcher::-webkit-scrollbar { height: 6px; }
.class-switcher::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.class-chip {
  min-width: 132px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  text-decoration: none;
  color: inherit;
  flex: none;
}
.class-chip .chip-class { display: block; font-weight: 600; color: var(--navy); font-size: 13px; }
.class-chip .chip-subject { color: var(--muted); font-size: 12px; }
.class-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.class-chip.active .chip-class { color: #fff; }
.class-chip.active .chip-subject { color: rgba(255,255,255,.78); }
.switcher-empty {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card-blue {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.stat-card-sky {
  background: #e0f2fe;
  border-color: #bae6fd;
}
.stat-card-amber {
  background: #fff8e8;
  border-color: #fde68a;
}
.stat-card-navy {
  background: #e8eef9;
  border-color: #c5d4ee;
}
.stat-card-blue .label, .stat-card-blue .value { color: #1e3a8a; }
.stat-card-sky .label, .stat-card-sky .value { color: #075985; }
.stat-card-amber .label, .stat-card-amber .value { color: #92400e; }
.stat-card-navy .label, .stat-card-navy .value { color: #163a8a; }
.stat-card-blue .label,
.stat-card-sky .label,
.stat-card-amber .label,
.stat-card-navy .label { opacity: .78; }
.stat-card .icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: #fff;
}
.icon-navy { background: var(--navy); }
.icon-teal { background: var(--teal); }
.icon-gold { background: var(--gold); color: #163a8a; }
.icon-info { background: var(--info); }
.icon-success { background: var(--success); }
.stat-card .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-card .value { font-size: 24px; font-weight: 700; line-height: 1.15; }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 4px;
}

.table { --bs-table-bg: transparent; }
.table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  border-bottom-width: 1px;
}
.table td { vertical-align: middle; font-size: 14px; }
.table-wrap { overflow-x: auto; }

.badge-soft {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-soft-success { background: #dcfce7; color: #166534; }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }
.badge-soft-primary { background: #dbeafe; color: #1e40af; }
.badge-soft-info { background: #dcfce7; color: #166534; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; }

.feed-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.feed-item:last-child { border-bottom: 0; }
.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  margin-top: 6px;
  flex: none;
}
.feed-item strong { display: block; color: var(--ink); font-size: 14px; }
.feed-item span { font-size: 12px; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  position: relative;
  padding: 0 0 16px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child):before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: #dbe4f3;
}
.timeline-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8eefc;
  color: var(--navy);
  font-size: 12px;
  z-index: 1;
}
.timeline-item.timeline-diary .timeline-marker { background: #fff3c4; color: #92400e; }
.timeline-item.timeline-meet .timeline-marker { background: #dbeafe; color: #1e40af; }
.timeline-item.timeline-notification .timeline-marker { background: #e0e7ff; color: #163a8a; }
.timeline-body strong { display: block; font-size: 14px; color: var(--ink); }
.timeline-body span { display: block; font-size: 12px; color: var(--muted); }
.timeline-body em {
  display: inline-block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: #eef2ff;
  border-radius: 4px;
  padding: 1px 6px;
}

.btn-view-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eef2ff;
  color: var(--navy);
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn-view-all:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.notice-card, .meet-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.diary-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.diary-card p, .notice-card p { margin-bottom: 8px; font-size: 14px; }
.notice-card h3, .diary-card h3 { font-size: 15px; margin-bottom: 6px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.entry-list { display: grid; gap: 8px; }
.entry-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
}
.entry-item p { margin: 6px 0; font-size: 14px; color: var(--ink); }

.join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-decoration: none;
  min-width: 108px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.join-btn:hover { color: #fff; background: var(--teal-2); }
.join-btn.live { background: #dc2626; }
.hero-join .join-btn {
  background: #22c55e;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
}
.hero-join .join-btn:hover { background: #16a34a; }

.hero-join {
  background: linear-gradient(135deg, #0b1f4d 0%, #122a66 48%, #163a8a 100%);
  color: #fff;
  border-radius: 12px;
  padding: 18px;
}
.hero-join h2 { color: #fff; margin-bottom: 4px; font-size: 20px; }
.hero-join p { color: rgba(255,255,255,.78); }
.meet-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 10px;
}
.meet-row strong { color: #fff; display: block; }
.meet-row span { color: rgba(255,255,255,.75); font-size: 13px; }

.class-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.class-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
}
.class-card.is-live {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff7f7 0%, #fff 48%);
}
.class-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.class-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: linear-gradient(135deg, #122a66, #163a8a);
  font-size: 18px;
}
.class-card.is-live .class-card-icon {
  background: linear-gradient(135deg, #991b1b, #dc2626);
}
.class-card-copy { min-width: 0; flex: 1; }
.class-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.class-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.class-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.class-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}
.class-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: var(--navy);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}
.class-card.is-live .class-card-meta span {
  background: #fee2e2;
  color: #991b1b;
}
.class-card .join-btn {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
}

.empty-state { text-align: center; padding: 20px 12px; }
.empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #ecfdf3;
  color: var(--teal);
  font-size: 20px;
}
.empty-state h3 { margin-bottom: 4px; font-size: 15px; }
.empty-state p { margin: 0; font-size: 13px; }
.zhs-alert { border: 0; border-radius: var(--radius); }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-action {
  border: 0;
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  color: #fff;
  background: linear-gradient(135deg, #122a66, #163a8a);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
  transition: transform .15s ease, box-shadow .15s ease;
}
.quick-action:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}
.quick-action strong {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.quick-action span,
.quick-action .text-muted {
  color: rgba(255,255,255,.78) !important;
}
.quick-action i {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
  background: rgba(255,255,255,.16);
  color: #fff;
}
.quick-action-blue {
  background: linear-gradient(135deg, #122a66, #163a8a);
  color: #fff;
}
.quick-action-sky {
  background: linear-gradient(135deg, #0c4a6e, #0369a1);
  color: #fff;
}
.quick-action-amber {
  background: linear-gradient(135deg, #14532d, #1e8a4c);
  color: #fff;
}

.profile-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.profile-hero .avatar { width: 56px; height: 56px; font-size: 18px; }
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-field { min-width: min(260px, 100%); }

.mobile-dock { display: none; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 40;
}

.install-wrap { max-width: 760px; margin: 40px auto; padding: 0 16px 40px; }
.install-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 28px; }

@media (min-width: 768px) {
  .class-card-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1200px) {
  .class-card-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1199px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { padding: 24px 20px 16px; }
  .auth-points { display: none; }
  .auth-visual h1 { font-size: 26px; margin: 10px 0 6px; }
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    width: min(86vw, 300px);
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.open { transform: none; }
  .sidebar-close { display: grid; place-items: center; }
  .sidebar-toggle { display: inline-grid; place-items: center; }
  .sidebar-backdrop.show { display: block; }
  .topbar-logout { display: inline-flex; }
  .stat-grid, .quick-actions { grid-template-columns: 1fr 1fr; }
  .stat-card { text-align: center; }
  .stat-card .icon { margin-left: auto; margin-right: auto; }
  .quick-action {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 8px;
  }
  .quick-action i { margin: 0 auto; }
  .app-topbar, .app-content, .class-switcher-wrap { padding-left: 14px; padding-right: 14px; }
  body.role-teacher .app-content,
  body.role-student .app-content { padding-bottom: calc(var(--dock) + 20px + env(safe-area-inset-bottom)); }
  .mobile-dock {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    z-index: 30;
    height: calc(var(--dock) + env(safe-area-inset-bottom));
  }
  .mobile-dock a {
    text-align: center;
    text-decoration: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 6px 2px;
    min-height: 48px;
  }
  .mobile-dock a i { display: block; font-size: 18px; margin-bottom: 2px; }
  .mobile-dock a.active { color: var(--navy); background: #eff6ff; }
}
@media (max-width: 640px) {
  .stat-card { padding: 14px 10px; }
  .stat-card .label { font-size: 11px; }
  .stat-card .value { font-size: 22px; }
  .quick-action { min-height: 96px; padding: 14px 10px; }
  .topbar-copy h1 { font-size: 18px; }
  .meet-row, .profile-hero { flex-direction: column; align-items: stretch; }
  .meet-row .join-btn,
  .class-card .join-btn { width: 100%; }
  .auth-card { padding: 20px; }
  .class-chip { min-width: 120px; }
}
