:root {
  --bg: #f9fafb;
  --card: #fff;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --purple: #9333ea;
  --purple-dark: #7e22ce;
  --purple-soft: #f3e8ff;
  --purple-wash: #faf5ff;
  --green: #16a34a;
  --blue: #2563eb;
  --sidebar: 256px;
  color: var(--ink);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--purple); text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #c084fc;
  outline-offset: 2px;
}

.shell { display: flex; height: 100%; min-height: 100%; background: var(--bg); }
.side {
  width: var(--sidebar);
  flex: none;
  background: #f9fafb;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 0;
}
.brand-kicker {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}
.brand-title {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 700;
}
.side-head { border-bottom: 1px solid var(--line); padding: 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; overflow: auto; }
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #374151;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}
.nav button { transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.nav button:hover { background: #fff; color: #111827; }
.nav button:active { transform: scale(0.98); }
.nav button svg, .btn svg, .banner svg, .icon-btn svg, .send svg { width: 18px; height: 18px; flex: none; }
.nav button.active { background: var(--purple); color: #fff; }
.side-spacer { flex: 1; }
.side-foot { border-top: 1px solid var(--line); padding: 16px; }
.me-card {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  outline: 1px solid var(--line);
}
.avatar, .chat-avatar, .rank {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: #fff;
  font-weight: 650;
  font-size: 12px;
  flex: none;
}
.chat-avatar { background: #f3e8ff; color: var(--purple); }
.me-name { font-weight: 650; font-size: 14px; line-height: 1.2; }
.me-role { color: var(--muted); font-size: 12px; margin-top: 2px; }
.logout, .ghost, .btn {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 550;
}
.logout { width: 100%; }
.logout:hover, .ghost:hover { background: #f9fafb; }
.danger {
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
}
.danger:hover { background: #fee2e2; }
.btn {
  background: var(--purple);
  border-color: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 1px rgba(17, 24, 39, 0.04);
}
.btn, .ghost, .logout, .danger, .dialog, .slot, .course, .stat { transition: background-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.btn:hover { background: var(--purple-dark); }
.btn:active, .ghost:active, .logout:active, .dialog:active { transform: scale(0.98); }

.main { flex: 1; min-width: 0; overflow: auto; padding: 24px 28px 40px; }
.main.flush { padding: 16px 16px 16px 20px; overflow: hidden; display: flex; }
h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; color: #111827; }
h2 { margin: 0; font-size: 16px; font-weight: 650; }
h3 { margin: 0; font-size: 14px; font-weight: 650; }
.page-kicker, .sub { color: var(--muted); }
.page-kicker { margin: 6px 0 18px; font-size: 14px; }
.sub { font-size: 13px; margin-top: 4px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat, .card, .table-card, .course, .chat-shell, .schedule {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.stat { padding: 12px 16px; border-radius: 12px; }
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.stat strong { font-size: 24px; line-height: 1.3; letter-spacing: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.card { padding: 18px 18px 16px; }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  text-align: left;
  background: #fff;
  border: 1px solid #e9d5ff;
  border-radius: 14px;
  color: #4b5563;
  font-size: 14px;
}
.banner i {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1.5px solid #9ca3af;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  color: #6b7280;
  flex: none;
}
.banner span { flex: 1; line-height: 1.4; }
.banner svg { color: #9ca3af; }

.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: stretch; }
.upcoming, .split > .card { height: 448px; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.upcoming .section-body { display: flex; flex-direction: column; }
.upcoming .empty { margin: auto; }
.section-body { flex: 1; min-height: 0; overflow: auto; }
.card > h2, .upcoming > h2, .split .card > h2 { }
.section-head { border-bottom: 1px solid var(--line); padding: 12px 20px; }
.empty {
  margin: 28px auto;
  width: min(440px, 92%);
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty strong { display: block; color: #4b5563; font-weight: 650; margin-bottom: 4px; font-size: 14px; }
.rating-list { margin-top: 8px; }
.rating-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
}
.rating-row.me { background: #faf5ff; }
.rank { width: 28px; height: 28px; font-size: 12px; background: #f3f4f6; color: #4b5563; }
.rank.top { background: #111827; color: #fff; }
.rank.self { background: var(--purple); color: #fff; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.who.self { color: #581c87; font-weight: 500; }
.you { margin-left: 4px; color: var(--purple); font-size: 12px; font-weight: 650; background: none; padding: 0; }
.score { font-variant-numeric: tabular-nums; color: #111827; }
.rating-row.me .score { font-weight: 700; }

.confirm { margin-top: 24px; padding: 0; overflow: hidden; }
.confirm > h2 { border-bottom: 1px solid var(--line); padding: 12px 20px; }
.confirm-list { margin: 0; }
.confirm-item { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid #f3f4f6; width: 100%; border-right: 0; border-left: 0; border-bottom: 0; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background-color .15s ease; }
.confirm-item:hover { background: #f9fafb; }
.confirm-item:first-child { border-top: 0; }
.confirm-time { width: 56px; flex: none; text-align: center; }
.confirm-time b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.confirm-time span { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.confirm-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.confirm-meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.confirm-more { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.confirm-more a { font-weight: 500; }
.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.28);
}

.page-head, .salary-top, .profile-top, .row-between, .rating-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.row-between > div:first-child { min-width: 0; flex: 1; }
.page-head { margin-bottom: 14px; }
.tools, .range { display: flex; gap: 8px; align-items: center; }
.week-label { color: var(--muted); margin-top: 8px; font-size: 14px; }

.schedule { overflow: auto; max-height: calc(100vh - 168px); }
.grid { min-width: 880px; display: grid; grid-template-columns: 68px repeat(7, 1fr); }
.gh, .gd, .gt, .gc { border-bottom: 1px solid #f3f4f6; border-right: 1px solid #f3f4f6; min-height: 44px; }
.gh { position: sticky; top: 0; background: #fff; z-index: 1; min-height: 68px; padding: 10px 4px 8px; text-align: center; }
.gh.today, .gc { position: relative; min-height: 52px; }
.gc.today { background: #faf5ff; }
.slot {
  display: block;
  width: calc(100% - 8px);
  margin: 4px;
  border-radius: 6px;
  border: 1px solid #e9d5ff;
  background: #faf5ff;
  text-align: left;
  padding: 4px 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.slot.planned { background: #fff; border-color: #d8b4fe; }
.slot b, .slot small { display: block; font-size: 10px; font-weight: 650; }
.slot span { display: block; font-size: 11px; font-weight: 500; line-height: 1.2; }
.gh small { display: block; color: var(--faint); font-size: 11px; letter-spacing: 0.06em; font-weight: 600; }
.gh b { font-size: 18px; font-weight: 650; }
.gt { color: #c4c4ce; font-size: 12px; padding: 6px 10px 0 0; text-align: right; }

.table-card { overflow: hidden; }
.filters { padding: 16px 16px 6px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; min-width: 140px; }
.field.grow { flex: 1; min-width: 200px; }
.field input, .field select, .composer input, .login-card input, .modal input, .modal select, .link-row input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
}
.check { display: flex; align-items: center; gap: 8px; padding: 10px 2px 8px; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
tr.day td { color: #6b7280; font-weight: 650; background: #f9fafb; border-bottom: 0; padding-bottom: 4px; }
td.money { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { background: #f9fafb; font-weight: 650; border-bottom: 0; color: #111827; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafafa; }
.id-line { color: var(--faint); font-size: 12px; margin-top: 2px; }
.time { font-weight: 650; }
.dow { color: var(--muted); font-size: 12px; }
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  background: #f3e8ff;
  color: #7e22ce;
}
.badge.trial { background: #fef3c7; color: #b45309; }
.badge.done, .badge.planned { background: transparent; padding-left: 0; }
.badge.done { color: var(--green); }
.badge.planned { color: #6b7280; }
.student-link { color: var(--purple); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; color: var(--muted); font-size: 14px; }
.pager b { color: var(--ink); font-weight: 600; }
.pager .off { opacity: 0.45; }

.courses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.course { padding: 16px; min-height: 132px; display: flex; flex-direction: column; }
.course-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; font-weight: 650; }
.pill { background: #f3f4f6; color: #4b5563; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.course a { margin-top: auto; padding-top: 18px; font-weight: 600; }

.chat-shell { flex: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 0; overflow: hidden; }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fafafa; }
.chat-side-head, .thread-head { padding: 14px 16px; background: #fff; border-bottom: 1px solid #f3f4f6; }
.dialogs { overflow: auto; background: #fff; }
.dialog {
  width: 100%;
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.dialog:hover { background: #f9fafb; }
.dialog.active { background: #faf5ff; box-shadow: inset 3px 0 0 #9333ea; }
.dialog-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.dialog-top span, .preview { color: var(--muted); font-weight: 400; font-size: 13px; }
.preview { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.thread-head { display: flex; gap: 10px; align-items: center; }
.thread-empty, .pick { margin: auto; text-align: center; color: var(--muted); }
.thread-empty strong, .pick strong { display: block; color: var(--ink); font-size: 16px; margin: 8px 0 4px; }
.bubble-ico {
  width: 48px; height: 48px; margin: 0 auto; border-radius: 16px;
  background: #f5f3ff; color: #c4b5fd; display: grid; place-items: center;
}
.bubble-ico svg { width: 22px; height: 22px; }
.msgs { flex: 1; overflow: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: min(520px, 76%); display: flex; flex-direction: column; }
.msg.tutor { align-self: flex-end; align-items: flex-end; }
.msg.student { align-self: flex-start; align-items: flex-start; }
.bubble { border-radius: 16px; padding: 10px 12px; line-height: 1.4; white-space: pre-wrap; }
.msg.tutor .bubble { background: var(--purple); color: #fff; border-bottom-right-radius: 6px; }
.msg.student .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.meta { color: var(--faint); font-size: 12px; margin-top: 4px; }
.meta.read { color: var(--green); }
.card-bubble { width: 260px; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.note-card { background: #ffd6ea; padding: 26px 14px; text-align: center; font-weight: 700; }
.note-card small { display: block; margin-top: 8px; font-weight: 500; }
.sheet { padding: 12px; font-size: 11px; }
.sheet b { display: block; margin-bottom: 6px; letter-spacing: 0.04em; }
.composer { display: flex; gap: 8px; align-items: center; padding: 10px 12px 0; }
.composer input { flex: 1; border-radius: 999px; padding-left: 14px; }
.icon-btn, .send {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: #9ca3af;
  display: grid; place-items: center;
}
.send { background: var(--purple); color: #fff; border-radius: 12px; }
.hint { color: var(--faint); font-size: 12px; padding: 6px 16px 10px; }

.rules { color: #374151; line-height: 1.55; max-width: 820px; padding: 4px 2px 8px; }
.rules h3 { margin: 16px 0 6px; }
.rules p { margin: 0 0 6px; }
.profile-top { align-items: center; margin-bottom: 4px; }
.profile-top .page-kicker { margin-bottom: 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 32px; margin-top: 16px; }
.kv span { display: block; color: var(--faint); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.tg-card { margin-top: 12px; }
.status-pill { border-radius: 999px; background: #f3f4f6; color: #4b5563; padding: 4px 10px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.status-pill.on { background: #f0fdf4; color: #15803d; box-shadow: inset 0 0 0 1px #bbf7d0; }
.tg-id { margin-top: 16px; background: #f9fafb; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tg-id span { display: block; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.tg-id b { display: block; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 500; }
.tg-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid #f3f4f6; }
.student-name { font-weight: 500; color: #111827; }
.rate { display: inline-grid; grid-template-columns: auto auto; column-gap: 6px; align-items: baseline; justify-content: center; }
.rate span { font-size: 12px; font-weight: 500; color: #6b7280; }
.rate b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tg { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px; margin-top: 14px; align-items: start; }
.qr {
  width: 140px; height: 140px; border-radius: 8px; border: 1px solid var(--line);
  background:
    linear-gradient(#111 0 0) 8px 8px / 28px 28px no-repeat,
    linear-gradient(#111 0 0) calc(100% - 8px) 8px / 28px 28px no-repeat,
    linear-gradient(#111 0 0) 8px calc(100% - 8px) / 28px 28px no-repeat,
    repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 8px 8px;
}
.link-row { display: flex; gap: 8px; margin: 8px 0; }
.link-row input { flex: 1; color: var(--purple); }
.step { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.num {
  width: 18px; height: 18px; border-radius: 999px; background: var(--purple); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; margin-top: 1px;
}
.tg .ghost { margin-top: 12px; }
.callout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 280px;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  color: #0369a1;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
}
.callout b { font-weight: 650; }

.modal-back {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45);
  display: grid; place-items: center; padding: 24px; z-index: 20;
  animation: fade .18s ease;
}
.modal {
  width: min(880px, 100%);
  max-height: min(92vh, 840px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  animation: pop .18s ease;
}
.modal.narrow { width: min(520px, 100%); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.x {
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: #6b7280; font-size: 18px; line-height: 1; flex: none;
}
.x:hover { background: #f9fafb; }
.lead { color: var(--muted); margin: 8px 0 14px; line-height: 1.45; }
.modal-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; }
.hours-modal { width: min(920px, 100%); padding: 22px 24px 18px; border-radius: 20px; }
.cal, .period-box, .applied { border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.period-box { display: flex; flex-direction: column; }
.cal-head { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; text-align: center; margin-bottom: 8px; }
.month-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.icon-round { width: 36px; height: 36px; padding: 0; border-radius: 12px; }
.dow-row, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.dow-row { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 6px; }
.day {
  border: 0; background: transparent; border-radius: 12px; height: 40px;
  color: #111827; font-weight: 500;
}
.day:hover:not(:disabled):not(.on) { background: #f3f4f6; }
.day.out { color: #d1d5db; }
.day.today:not(.on) { box-shadow: inset 0 0 0 1.5px var(--purple); color: var(--purple); font-weight: 650; }
.day.on { background: var(--purple); color: #fff; font-weight: 650; }
.day.taken, .day:disabled { color: #d1d5db; cursor: default; }
.pick-count { margin: 12px 0 4px; font-size: 14px; color: #111827; }
.hint-quiet { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.reset-days { border: 0; background: none; color: var(--purple); font-weight: 600; padding: 8px 0 0; }
.reset-days:hover { color: var(--purple-dark); }
.hours-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; }
.period-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 10px; background: #fff; }
.period-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.period-card-head b { font-weight: 600; }
.link-danger { border: 0; background: none; color: #dc2626; font-weight: 600; padding: 0; }
.link-danger:hover { color: #b91c1c; }
.period-box > .ghost { margin-top: 12px; align-self: flex-start; }
.period { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: auto; padding-top: 14px; }
.hours-modal .btn { border-radius: 999px; padding: 10px 18px; }
.hours-modal .btn:disabled { opacity: 0.45; cursor: default; }
.week-block { margin-top: 18px; }
.week-block .row-between { align-items: center; }
.week-range { color: var(--muted); font-size: 13px; margin: 8px 0; }
.applied { margin-top: 4px; }
.applied-line { padding: 8px 0; border-top: 1px solid #f3f4f6; }
.applied-line:first-child { border-top: 0; }
.lesson-rows { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lesson-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid #f3f4f6; }
.lesson-rows div:first-child { border-top: 0; }
.lesson-rows span { color: var(--muted); }
.record { margin-top: 12px; }
.record a { word-break: break-all; }

.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
.login-card h1 { font-size: 24px; margin-top: 8px; }
.login-card p { color: var(--muted); }
.login-card label { display: block; margin: 12px 0; color: var(--muted); font-size: 13px; }
.login-card input, .login-card .btn { width: 100%; }
.login-card .btn { justify-content: center; margin-top: 8px; }
.login-hint { margin-top: 14px; background: var(--bg); border-radius: 12px; padding: 12px; }
.login-hint .ghost { width: 100%; margin-top: 8px; }
.err { color: #b91c1c; font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: #111827; color: #fff; border-radius: 999px; padding: 8px 14px; z-index: 30; font-size: 13px;
  animation: toast-in .2s ease;
}
.view { animation: rise .22s ease; }
.menu-btn {
  width: 40px; height: 40px; border: 0; background: transparent; border-radius: 12px;
  color: #374151; font-size: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.menu-btn:hover { background: #f3f4f6; }
.topbar, .side-close, .back-chat, .scrim { display: none; }
.top-name { font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 1023px) {
  html, body, #app { height: auto; min-height: 100%; }
  .shell { display: block; height: auto; min-height: 100dvh; }
  .shell.menu-open { overflow: hidden; }
  .topbar {
    display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px 0 8px;
    position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line);
  }
  .topbar .brand-kicker { font-size: 10px; }
  .top-brand { min-width: 0; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 40; border: 0; padding: 0;
    background: rgba(0, 0, 0, .4); cursor: pointer; animation: fade .2s ease;
  }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: min(256px, calc(100vw - 48px)); height: 100%;
    transform: translateX(-105%);
    transition: transform .2s ease-out;
    box-shadow: none;
  }
  .side.open { transform: none; box-shadow: 8px 0 24px rgba(17, 24, 39, .08); }
  .side-close { display: inline-flex; }
  .main { overflow: visible; padding: 16px 16px 96px; }
  .main.flush { display: block; overflow: hidden; padding: 0; height: calc(100dvh - 56px); }
  .stats, .split, .courses, .modal-grid, .kv, .tg { grid-template-columns: 1fr; }
  .upcoming, .split > .card { height: auto; min-height: 280px; max-height: 448px; }
  .page-head, .salary-top, .profile-top { flex-direction: column; }
  .tools, .range { flex-wrap: wrap; }
  .table-card { overflow-x: auto; }
  table { min-width: 680px; }
  .chat-shell { display: block; min-height: 0; height: 100%; }
  .chat-shell .chat-side, .chat-shell .thread { height: 100%; }
  .chat-shell.picked .chat-side { display: none; }
  .chat-shell:not(.picked) .thread { display: none; }
  .back-chat { display: inline-flex; }
  .preview { max-width: 58vw; }
  .profile-top { display: block; }
  .callout { margin-bottom: 12px; max-width: none; }
  .fab { right: 16px; bottom: 16px; font-size: 12px; padding: 8px 12px; }
  .modal-back { padding: 12px; align-items: end; }
  .modal { width: 100%; max-height: min(92dvh, 840px); }
  .field { min-width: 0; width: 100%; }
  .filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .field.grow { grid-column: 1 / -1; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .view, .modal, .modal-back, .toast, .scrim, .side { animation: none; transition: none; }
}
