/* WellTrained Academy — application styles */
:root {
  --ink: #101828;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-soft: #f0f2f7;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef0ff;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .1);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { margin: 0 0 4px; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.stack-4 > * + * { margin-top: 4px; }

/* ------------------------------------------------------------- app shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #7c6cf6);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14.5px; }
.brand-text small { color: var(--muted); font-size: 11.5px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--ink-soft); font-weight: 500; font-size: 13.5px;
}
.nav-link:hover { background: var(--line-soft); color: var(--ink); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.nav-link .ico { display: inline-flex; width: 18px; height: 18px; }
.nav-link svg { width: 18px; height: 18px; }

/* --- grouped navigation: one summary per section, current one auto-open --- */
.nav-group { margin-top: 2px; }
.nav-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; list-style: none; user-select: none;
}
.nav-group-head::-webkit-details-marker { display: none; }
.nav-group-head:hover { background: var(--line-soft); color: var(--ink); }
.nav-group-head.active { color: var(--primary-dark); }
.nav-group-head .ico { display: inline-flex; width: 16px; height: 16px; }
.nav-group-head svg { width: 16px; height: 16px; }
.nav-group-head .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .15s ease; opacity: .7; }
.nav-group[open] > .nav-group-head .chev { transform: rotate(90deg); }
.nav-group > .nav-link { margin-left: 10px; }
.nav-group[open] { padding-bottom: 4px; }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 2px 4px; color: inherit; text-decoration: none; border-radius: 10px; }
a.user-chip:hover { background: rgba(255, 255, 255, .07); }
/* v29 — the account / password-reset notices */
.auth-main code { background: #EEF2FF; padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.badge button, button.badge { font: inherit; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: var(--muted); font-size: 11.5px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
  background: var(--primary-soft); color: var(--primary-dark);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
}
.logout { padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 13px; }
.logout:hover { background: var(--bad-soft); color: var(--bad); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; }
.topbar-title p { font-size: 13px; margin: 2px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-btn {
  display: none; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  width: 38px; height: 38px; font-size: 16px; cursor: pointer; color: var(--ink-soft);
}

.content { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 22px; max-width: 1240px; }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.card-head > div { min-width: 0; }
.card-head h2 { font-size: 15.5px; }
.card-head p { font-size: 12.5px; margin: 2px 0 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .01em; }
.stat-value { font-size: 24px; font-weight: 680; letter-spacing: -.02em; }
.stat-hint { font-size: 11.5px; color: var(--muted); }
.stat-warn .stat-value { color: var(--warn); }
.stat-ok .stat-value { color: var(--ok); }
.stat-bad .stat-value { color: var(--bad); }
.stat-primary .stat-value { color: var(--primary-dark); }
.stat.accent { background: linear-gradient(135deg, #4338ca, #6d5ef0); border-color: transparent; }
.stat.accent .stat-label, .stat.accent .stat-hint { color: rgba(255, 255, 255, .78); }
.stat.accent .stat-value { color: #fff; }

/* ---------------------------------------------------------------- controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
  background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 550;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-danger { background: #fff; border-color: #fecdca; color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--ink-soft); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=tel], input[type=search], select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; width: 100%; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #a5a1f0; box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 15px; height: 15px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.seg { display: inline-flex; background: var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 550; color: var(--muted); }
.seg a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ----------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; padding: 11px 16px; background: #fafbfd;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 550; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: 12px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 34px; height: 34px; flex-basis: 34px; }
.avatar.sq { border-radius: 9px; background: #eef4ff; color: #175cd3; }

/* ----------------------------------------------------------------- badges */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--line-soft); color: var(--ink-soft); white-space: nowrap;
  /* long class/school names must wrap instead of pushing a phone screen sideways */
  max-width: 100%; overflow-wrap: anywhere; white-space: normal;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: #f2f4f7; color: var(--muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }

/* ------------------------------------------------------------------ lists */

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .when { font-size: 12px; color: var(--muted); white-space: nowrap; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; }
.tl-time { width: 58px; flex: 0 0 58px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding-top: 2px; }
.tl-body { border-left: 2px solid var(--line); padding: 0 0 18px 16px; flex: 1; min-width: 0; }
.tl-item:last-child .tl-body { padding-bottom: 0; border-left-color: transparent; }
.tl-body .tl-dot { margin-left: -23px; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--ink-soft); margin-bottom: 4px; font-size: 13.5px; }

.flash { margin: 16px 28px -6px; padding: 11px 14px; border-radius: 10px; font-size: 13px; border: 1px solid transparent; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: #abefc6; }
.flash-error { background: var(--bad-soft); color: var(--bad); border-color: #fecdca; }
.flash-info { background: var(--info-soft); color: var(--info); border-color: #b2ddff; }

/* ------------------------------------------------------------------- auth */

body.auth {
  background: #f6f7fb;
  background-image: radial-gradient(900px 500px at 12% 0%, #e8e6ff 0%, transparent 60%),
                    radial-gradient(700px 500px at 92% 10%, #e6f4ff 0%, transparent 55%);
  min-height: 100vh;
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; }
.auth-card { width: 100%; max-width: 940px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; }
.auth-side { padding: 40px 36px; background: linear-gradient(160deg, #f0efff, #f7f9ff 60%); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.auth-side h2 { font-size: 24px; letter-spacing: -.02em; }
.auth-side ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 13px; line-height: 1.9; }
.auth-main { padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; }
/* The sign-in / reset forms are used on phones: 44px controls are easier to tap. */
.auth-main input[type=text], .auth-main input[type=email], .auth-main input[type=password] { min-height: 44px; font-size: 15px; }
.auth-main .btn { min-height: 44px; }
.auth-main form { display: flex; flex-direction: column; gap: 14px; }
.demo-box { background: #fafbff; border: 1px dashed #c9c6f2; border-radius: 12px; padding: 12px 14px; font-size: 12px; color: var(--ink-soft); }
.demo-box b { color: var(--ink); }
.demo-box .demo-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.demo-box button { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }

/* ------------------------------------------------------------------ exams */

.exam-shell { min-height: 100vh; background: #f7f8fc; }
.exam-top { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; padding: 6px 12px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); }
.exam-timer.low { background: var(--bad-soft); color: var(--bad); }
.exam-body { max-width: 860px; margin: 0 auto; padding: 24px 18px 120px; display: flex; flex-direction: column; gap: 18px; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.q-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; align-items: center; }
.q-text { font-size: 15px; font-weight: 550; margin-bottom: 16px; line-height: 1.55; }
.opt {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 11px; cursor: pointer; font-size: 13.5px; margin-bottom: 9px; transition: all .12s ease;
}
.opt:last-child { margin-bottom: 0; }
.opt:hover { border-color: #c4c0f5; background: #fbfaff; }
.opt.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(79,70,229,.1); }
.opt input { margin-top: 2px; }
.opt .opt-key { font-weight: 700; color: var(--ink-soft); width: 16px; flex: 0 0 16px; }
.opt.correct { border-color: #abefc6; background: var(--ok-soft); }
.opt.wrong { border-color: #fecdca; background: var(--bad-soft); }
.exam-bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.qnav { display: flex; gap: 6px; flex-wrap: wrap; }
.qnav a { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: #fff; }
.qnav a.answered { background: var(--ok-soft); border-color: #abefc6; color: var(--ok); }
.qnav a.current { outline: 2px solid var(--primary); outline-offset: 1px; }

.progress { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #7c6cf6); border-radius: 999px; }

.score-ring { display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), #eef0f6 0); position: relative; }
.score-ring::after { content: ''; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.score-ring > div { position: relative; z-index: 1; text-align: center; }
.score-ring strong { display: block; font-size: 27px; }

.cat-bar { display: flex; flex-direction: column; gap: 6px; }
.cat-bar .bar { height: 7px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.cat-bar .bar > i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.cat-bar .bar > i.fail { background: var(--bad); }

/* ------------------------------------------------------------ whatsapp CTA */

.icon-btn {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn-lg { width: auto; height: 36px; padding: 0 12px; gap: 7px; font-size: 12.5px; font-weight: 600; }
.icon-wa { color: #128c4a; border-color: #b7e4c9; background: #f1fbf5; }
.icon-wa:hover { background: #25d366; border-color: #25d366; color: #fff; box-shadow: 0 4px 12px rgba(37, 211, 102, .3); }
.icon-btn-disabled { color: #b6bcc9; border-color: var(--line); background: var(--line-soft); cursor: not-allowed; }
.icon-btn-disabled:hover { transform: none; }

/* ------------------------------------------------ invoice list (mobile) */

.inv-cards { display: none; }
.inv-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.inv-rows { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.inv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); }
.inv-row strong { font-size: 13.5px; color: var(--ink); text-align: right; font-weight: 600; display: flex; flex-direction: column; }
.inv-row strong small { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.inv-actions { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.inv-actions .btn { flex: 1; }
.text-bad { color: var(--bad) !important; }
.text-warn { color: var(--warn) !important; }
.text-ok { color: var(--ok) !important; }

/* ------------------------------------------------------- children picker */

.picker { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcff; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: #fff; border: 1px solid var(--line-soft); cursor: pointer; font-weight: 400; }
.picker-row:hover { border-color: #c4c0f5; background: #fbfaff; }
.picker-main { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.picker-main strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.picker-main small { font-size: 11.5px; color: var(--muted); }

/* ----------------------------------------------------- daily reminders */

.daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.daystrip-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink-soft); }
.daystrip-item:hover { border-color: #c4c0f5; background: #fbfaff; color: var(--ink); }
.daystrip-item.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.daystrip-item .dow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.daystrip-item strong { font-size: 15px; }
.daystrip-item.active .dow { color: var(--primary-dark); }

.rem-list { display: flex; flex-direction: column; gap: 12px; }
.rem-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: #fcfcff; flex-wrap: wrap; }
.rem-main { flex: 1; min-width: 220px; }
.rem-items { margin: 10px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-soft); }
.rem-items li { padding-left: 11px; position: relative; }
.rem-items li::before { content: ''; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: #c4c0f5; }
.rem-items strong { font-variant-numeric: tabular-nums; }
.rem-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 168px; }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn-wa:hover { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }
.btn-wa svg { width: 16px; height: 16px; }

/* ------------------------------------------------------- reset demo data */

.reset-group { margin-bottom: 20px; }
.reset-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.reset-group-head h3 { font-size: 13.5px; }
.reset-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; margin-bottom: 5px;
  border: 1px solid var(--line-soft); border-radius: 9px; background: #fbfcff; cursor: pointer; font-weight: 400;
}
.reset-item:hover { border-color: #c4c0f5; }
.reset-item.demo { background: #fffdf7; border-color: #fde9c8; }
.reset-item input { accent-color: var(--primary); }
.reset-name { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.reset-name { font-size: 13px; font-weight: 550; color: var(--ink); }
.reset-name small { font-weight: 400; font-size: 11.5px; color: var(--muted); }


.reset-list { display: flex; flex-direction: column; gap: 4px; }
.reset-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 7px 10px; border-radius: 8px; background: #fbfcff; border: 1px solid var(--line-soft); font-size: 12.5px;
}
.reset-row span { color: var(--ink-soft); }
.reset-row strong { font-variant-numeric: tabular-nums; }

/* --------------------------------------------- per-meeting economics card */

.econ {
  border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px;
  background: linear-gradient(180deg, #fbfcff, #ffffff); margin-bottom: 18px;
}
.econ-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.econ-head h3 { font-size: 14px; }
.econ-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.econ-grid > div { display: flex; flex-direction: column; gap: 2px; }
.econ-grid strong { font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 1080px) { .econ-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .econ-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------ tutor payouts */

.payout-lines { display: flex; flex-direction: column; gap: 3px; }
.payout-line { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.payout-line > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payout-line strong { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .payout-line { flex-wrap: wrap; }
}

/* ------------------------------------------------------- class logbook */

.log-day {
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
}
.log-day:first-of-type { margin-top: 4px; }
.log-list { display: flex; flex-direction: column; gap: 10px; }
.log-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fcfcff; }
.log-head { display: flex; align-items: flex-start; gap: 10px; }
.log-note { margin: 9px 0 0; font-size: 13px; color: var(--ink-soft); }
.last-note {
  margin-top: 6px; max-width: 340px; font-size: 11.5px; line-height: 1.45; color: var(--muted);
  border-left: 2px solid #c4c0f5; padding-left: 8px;
}
.last-note strong { color: var(--ink-soft); font-weight: 600; }
.last-focus { color: var(--primary-dark); margin-top: 2px; }
.log-focus {
  margin-top: 9px; padding: 8px 11px; border-radius: 9px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 12.5px;
}

/* ------------------------------------------------------- achievements */

.ach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ach-card {
  border: 1px solid var(--line); border-radius: 13px; padding: 15px 16px;
  background: linear-gradient(180deg, #fdfcff, #ffffff); display: flex; flex-direction: column; gap: 8px;
}
.ach-top { display: flex; align-items: flex-start; gap: 10px; }
.ach-trophy {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #fff3d6, #ffe7b3); color: #b4690e;
}
.ach-trophy svg { width: 19px; height: 19px; }
.ach-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; color: var(--ink); }
.ach-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.ach-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--line-soft); padding-top: 9px; margin-top: auto; flex-wrap: wrap;
}
@media (max-width: 860px) { .ach-grid { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------- tutor hours grid */

.hours-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.hours-day { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fcfcff; min-height: 92px; }
.hours-day-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.hours-day-head strong { font-size: 12.5px; }
.hours-chip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--ok-soft); border: 1px solid #abefc6; color: var(--ok);
  border-radius: 8px; padding: 5px 7px; margin-bottom: 5px; font-size: 11.5px; font-weight: 600;
}
.hours-chip .hours-time { font-variant-numeric: tabular-nums; }
.hours-chip form { margin: 0 0 0 auto; }
.hours-x {
  border: 0; background: transparent; color: var(--ok); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 2px; opacity: .6;
}
.hours-x:hover { opacity: 1; color: var(--bad); }
.hours-meet {
  background: var(--info-soft); border: 1px solid #b2ddff; color: var(--info);
  border-radius: 8px; padding: 4px 7px; margin-bottom: 5px; font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hours-meet:last-child { margin-bottom: 0; }

@media (max-width: 1080px) {
  .hours-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hours-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------- deposits & credit */

.credit-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-radius: 13px;
  background: linear-gradient(135deg, #f4f2ff, #f8fbff);
  border: 1px solid #e2dffb;
}
.credit-hero strong { display: block; font-size: 24px; letter-spacing: -.02em; }
.credit-note {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 12px; background: #f8faff; border: 1px dashed #c9c6f2;
}
@media (max-width: 720px) {
  .credit-hero { flex-direction: column; align-items: flex-start; }
}

/* --------------------------------------------------- session packages */

.quota-form { display: flex; gap: 4px; margin-top: 6px; align-items: center; }
.quota-form input[type=number] { width: 58px; padding: 4px 6px; font-size: 11.5px; border-radius: 7px; }
.quota-form .btn { padding: 4px 8px; font-size: 11.5px; border-radius: 7px; }

/* ------------------------------------------------------- find a slot */

.daypick { display: flex; gap: 8px; flex-wrap: wrap; }
.daypick-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 12.5px; font-weight: 550; color: var(--ink-soft); cursor: pointer;
}
.daypick-item input { accent-color: var(--primary); width: 14px; height: 14px; }
.daypick-item.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

table.tt td.tt-cell { vertical-align: top; min-width: 108px; padding: 8px 10px; }
table.tt th.hl, table.tt td.hl { background: #f7f6ff; }
table.tt th.hl { color: var(--primary-dark); }
.tt-chip {
  display: block; font-size: 11px; line-height: 1.35; padding: 3px 6px; border-radius: 6px;
  background: var(--line-soft); color: var(--ink-soft); margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.tt-chip:last-child { margin-bottom: 0; }
.tt-chip.clash { background: var(--bad-soft); color: var(--bad); }

/* ---------------------------------------------------------------- utility */

.divider { height: 1px; background: var(--line-soft); margin: 16px 0; border: 0; }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.chart .col > i { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #7c6cf6, #4f46e5); display: block; min-height: 3px; }
.chart .col > span { font-size: 10.5px; color: var(--muted); }
.copybox { display: flex; gap: 8px; align-items: center; background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.copybox input { border: 0; background: transparent; padding: 0; font-size: 12px; box-shadow: none !important; }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .inv-table { display: none; }
  .inv-cards { display: flex; flex-direction: column; gap: 14px; padding: 0 16px 18px; }
  .card.pad-0 .card-head { padding-left: 16px !important; padding-right: 16px !important; }
  .daystrip { grid-template-columns: repeat(7, minmax(62px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .rem-actions { min-width: 0; flex-direction: row; width: 100%; }
  .rem-actions .btn { flex: 1; }
}

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 30; }
  .menu-btn { display: inline-grid; place-items: center; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .flash { margin: 12px 16px -6px; }
}
@media print {
  .sidebar, .topbar, .flash { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}

/* ---------------------------------------------------------------- portal v19
   Dashboard building blocks: the "today" agenda, quick actions, task cards and
   the student hero. Kept small and dependency-free so they read the same on
   phone and desktop.
--------------------------------------------------------------------------- */

.who {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(79,70,229,.10), rgba(139,92,246,.07));
  border: 1px solid rgba(79,70,229,.14);
}
.who .avatar-lg {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #7c6cf6); color: #fff;
  font-weight: 700; letter-spacing: .02em;
}
.who-greet { font-size: 18px; font-weight: 700; line-height: 1.25; }
.who-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.who .spacer { flex: 1; }

.qa-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qa {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-weight: 600; font-size: 13.5px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(16,24,40,.04));
  transition: border-color .15s ease, transform .12s ease;
}
.qa:hover { border-color: rgba(79,70,229,.45); transform: translateY(-1px); }
.qa .ico { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); flex: 0 0 32px; }
.qa .ico svg { width: 17px; height: 17px; }
.qa-sub { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.qa.qa-warn .ico { background: var(--warn-soft, #fffaeb); color: #b54708; }

.today-list { display: flex; flex-direction: column; }
.today-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.today-row:last-child { border-bottom: 0; }
.today-time {
  flex: 0 0 62px; text-align: center;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px;
  color: var(--primary-dark);
}
.today-time small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.today-main { flex: 1; min-width: 0; }
.today-main .strong { font-size: 14px; }
.today-nav { display: flex; gap: 6px; flex: 0 0 auto; }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.task.task-done { background: var(--ok-soft, #ecfdf3); border-color: #abefc6; }
.task.task-overdue { border-color: #fecdca; background: #fffbfa; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 650; font-size: 14px; }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.task-text { color: var(--ink-soft); font-size: 13px; margin-top: 6px; white-space: pre-wrap; }
.task-actions { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; }

.tick-form button {
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid var(--line-strong, #d0d5dd); background: #fff;
  display: grid; place-items: center; color: transparent;
}
.tick-form button:hover { border-color: var(--primary); }
.tick-form.done button { background: var(--ok, #12b76a); border-color: var(--ok, #12b76a); color: #fff; }
.tick-form button svg { width: 16px; height: 16px; }

.score-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.score-row:last-child { border-bottom: 0; }
.score-pill {
  flex: 0 0 auto; min-width: 58px; text-align: center;
  padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 14px;
  background: var(--primary-soft); color: var(--primary-dark);
}
.score-pill.good { background: var(--ok-soft, #ecfdf3); color: #027a48; }
.score-pill.mid { background: #fffaeb; color: #b54708; }
.score-pill.bad { background: var(--bad-soft, #fef3f2); color: #b42318; }

@media (max-width: 1080px) {
  .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .qa-grid { grid-template-columns: minmax(0, 1fr); }
  .today-row { flex-wrap: wrap; }
  .today-time { flex: 0 0 54px; }
  .today-nav { width: 100%; }
  .who { padding: 14px 16px; }
}

/* --- business snapshot: four money figures side by side ---------------- */
.money-strip { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.money-cell { display: flex; flex-direction: column; gap: 2px; }
.money-cell strong { font-size: 17px; letter-spacing: -.01em; }
@media (max-width: 720px) {
  .money-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- money & margin (v21) ---------------------------------------------- */
.split-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.split-row:first-of-type { padding-top: 0; }
.split-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.split-bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.split-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #7c6cf6); }

.trend { display: flex; flex-direction: column; gap: 10px; }
.trend.legend { flex-direction: row; gap: 16px; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.trend.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
.dot-delivered { background: linear-gradient(135deg, var(--primary), #7c6cf6); }
.dot-cost { background: #f79009; }
.trend-row {
  display: grid; gap: 12px; align-items: center;
  grid-template-columns: 74px minmax(0, 1fr) 170px;
  padding: 8px 10px; border-radius: 10px;
}
.trend-row.is-current { background: #f8f7ff; }
.trend-bars { display: flex; flex-direction: column; gap: 3px; }
.trend-bar { height: 7px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.trend-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #7c6cf6); }
.trend-bar.cost > span { background: linear-gradient(90deg, #f79009, #fdb022); }
@media (max-width: 720px) {
  .trend-row { grid-template-columns: 60px minmax(0, 1fr); }
  .trend-row > .right { grid-column: 1 / -1; text-align: left; }
}

/* --- routine membership & weekly slots (v21) ---------------------------- */
.callout { border-left: 3px solid var(--warn); }
.enrol-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  background: #fcfcff;
  margin: 6px 0 20px;
}
.enrol-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.enrol-head h2 { font-size: 15.5px; }
.enrol-head p { font-size: 12.5px; margin: 2px 0 0; }
.enrol-card .form-grid { gap: 14px 16px; }

/* Small inline action menu used in roster rows (Manage / Skip / move). */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  width: 300px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(24, 20, 60, .16);
  padding: 14px;
}
.row-menu-body .divider { margin: 10px 0; }
.row-menu-body .field { width: 100%; }
@media (max-width: 720px) {
  .row-menu-body { position: fixed; inset: auto 12px 12px 12px; width: auto; }
}
.past-list { margin-top: 14px; }
.past-list > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 10px 0; border-top: 1px solid var(--line-soft);
}

/* --- schedule requests (v21) -------------------------------------------- */
.rule-strip > div {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcff;
}
.rule-strip strong { font-size: 13.5px; }
.rules-explain { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rules-explain > div {
  padding: 14px 16px; border-radius: 12px; background: #f8f7ff;
  border: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; color: var(--ink-soft);
}
.rules-explain strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 13px; }
.rules-form { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: start; }
.rules-form label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
.rules-form label.check input { margin-top: 3px; }
.rules-form label.check span { display: flex; flex-direction: column; gap: 2px; }
table.data tr.row-active { background: #f5f3ff; }
@media (max-width: 1080px) {
  .rules-explain { grid-template-columns: minmax(0, 1fr); }
  .rules-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .rules-form { grid-template-columns: minmax(0, 1fr); }
}

/* --- public intake & onboarding (v22) ----------------------------------- */
body.join-page { background: linear-gradient(160deg, #f7f5ff 0%, #eef2ff 45%, #fdf2f8 100%); }
.join-wrap { max-width: 860px; margin: 0 auto; padding: 32px 18px 48px; }
.join-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.join-head strong { display: block; font-size: 15px; }
.join-head small { color: var(--muted); font-size: 12px; }
.join-hero { margin: 6px 0 22px; }
.join-hero h1 { font-size: 26px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -.02em; }
.join-hero p { color: var(--ink-soft); font-size: 14px; max-width: 62ch; margin: 0 0 12px; }
.join-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.join-points li { position: relative; padding-left: 22px; font-size: 13px; color: var(--ink-soft); }
.join-points li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--primary); font-weight: 700; }
.join-form .join-section { border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 16px; }
.join-form .join-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.join-form h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.join-label { font-size: 12.5px; font-weight: 550; color: var(--ink-soft); display: block; margin-bottom: 8px; }
.join-days { display: flex; gap: 8px; flex-wrap: wrap; }
.join-day { position: relative; }
.join-day input { position: absolute; opacity: 0; pointer-events: none; }
.join-day span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 54px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 550; color: var(--ink-soft);
}
.join-day input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.join-day input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.join-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.join-submit { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.join-done { text-align: center; margin-bottom: 8px; }
.join-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 999px; margin-bottom: 10px;
  background: var(--ok-soft, #ecfdf3); color: #027a48; font-size: 22px; font-weight: 700;
}
.join-done h1 { font-size: 22px; margin: 0 0 8px; }
.join-steps { display: grid; gap: 12px; margin: 18px 0; }
.join-step { display: flex; gap: 12px; align-items: flex-start; }
.join-step-num {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 700;
}
.join-step p { margin: 2px 0 0; }
.auth-new {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line);
  background: #fbfaff; font-size: 12.5px; color: var(--ink-soft);
}
@media (max-width: 720px) {
  .join-points { grid-template-columns: minmax(0, 1fr); }
  .join-hero h1 { font-size: 22px; }
}

/* onboarding checklist */
.onboard-list { display: flex; flex-direction: column; }
.onboard-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.onboard-item:last-child { border-bottom: 0; padding-bottom: 0; }
.onboard-mark {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 999px; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); color: #fff; font-size: 11px; font-weight: 700;
}
.onboard-item.is-done .onboard-mark { background: var(--ok, #12b76a); border-color: var(--ok, #12b76a); }
.onboard-item.is-done .strong { color: var(--muted); text-decoration: line-through; }

/* intake queue */
.intake-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 4px 0 16px; }
.intake-block { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcff; }
.intake-actions { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding-top: 4px; }
.intake-decline { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.intake-decline input { flex: 1; min-width: 160px; }
.intake-flow { display: grid; gap: 12px; }
.intake-flow > div { display: flex; gap: 12px; align-items: flex-start; }
.intake-flow p { margin: 2px 0 0; }
@media (max-width: 900px) {
  .intake-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- intake reference code, attribution & next-step offers (v23) -------- */
.join-code {
  margin: 16px 0 4px; padding: 14px 16px; border-radius: 12px;
  border: 1px dashed var(--primary); background: #fbfaff;
  display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center;
}
.join-code strong { font-size: 22px; letter-spacing: .08em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.join-lookup { margin-bottom: 16px; }
.join-lookup > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--primary-dark);
  padding: 8px 0; list-style: none;
}
.join-lookup > summary::-webkit-details-marker { display: none; }
.join-status { border-left: 3px solid var(--primary); }
.intake-links { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.offer-card { border-left: 3px solid var(--primary); }
.welcome-preview {
  margin: 0; padding: 14px 16px; border-radius: 12px; background: #f8f7ff;
  border: 1px solid var(--line); font-family: inherit; font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; color: var(--ink-soft);
}

/* --- student-named classes (v24) --------------------------------------- */
.check-row { flex-direction: row; align-items: flex-start; gap: 10px; }
.check-row span { display: flex; flex-direction: column; gap: 2px; font-weight: 500; }
.own-class-card { border-left: 3px solid var(--primary); }
.own-class-form { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.own-class-form .span-all { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .own-class-form { grid-template-columns: minmax(0, 1fr); }
  .own-class-form .span-all { grid-column: auto; }
}

/* --- intake: "start his own class" disclosure (v24) -------------------- */
.intake-own { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.intake-own > summary {
  cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--primary-dark);
  padding: 4px 0;
  display: flex; align-items: center; gap: 6px;
}
.intake-own > summary::-webkit-details-marker { display: none; }
.intake-own > summary::before { content: '+'; font-size: 16px; }
.intake-own[open] > summary::before { content: '−'; }

/* --- registration: who-is-it-for switch, flexible days (v26) ------------ */
.join-switch {
  display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 18px;
}
.join-switch-opt {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border-radius: 12px; text-decoration: none;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-size: 12.5px; transition: border-color .15s ease, background .15s ease;
}
.join-switch-opt strong { font-size: 14px; color: var(--ink); }
.join-switch-opt:hover { border-color: #c7d2f7; background: #fbfaff; }
.join-switch-opt.is-active {
  border-color: var(--primary); background: #f5f3ff;
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.join-switch-opt.is-active strong { color: var(--primary-dark); }
@media (max-width: 560px) {
  /* Two compact tabs instead of two stacked cards: on a phone every 90px of
     chrome is 90px of the form the parent has to scroll past. */
  .join-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .join-switch-opt { padding: 10px 12px; min-height: 44px; justify-content: center; text-align: center; }
  .join-switch-opt span { display: none; }
  .join-switch-opt strong { font-size: 13.5px; }
}
.join-day-flex {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 12.5px; color: var(--ink-soft);
}
.join-day-flex input { width: 16px; height: 16px; }
#day-picker.is-off { opacity: .45; }

/* --- demo preview banner (v26) ----------------------------------------- */
.demo-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 0; padding: 12px 16px; border-radius: 12px;
  border: 1px solid #f5c26b; background: #fffaeb; color: #7a4b00;
  font-size: 13px; line-height: 1.5;
}
.demo-banner .grow { flex: 1; min-width: 220px; }
.demo-banner strong { color: #663c00; }
.demo-banner-dot {
  width: 10px; height: 10px; border-radius: 999px; flex: 0 0 10px;
  background: #f79009; box-shadow: 0 0 0 4px rgba(247, 144, 9, .18);
}
.demo-banner form { margin: 0; }
.demo-banner .btn { background: #fff; border-color: #f5c26b; color: #7a4b00; }
.demo-banner .btn:hover { background: #fff7e6; }

/* --- logbook note audience (v27) --------------------------------------- */
/* One component for both save-button notices (session page + logbook page). */
.note-audience {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline;
  margin-top: 14px; padding: 11px 14px; border-radius: 10px;
  border: 1px solid #d6e0fb; background: #f6f8ff; color: var(--ink-soft);
  font-size: 12.5px; line-height: 1.5;
}
.note-audience strong { color: var(--ink); font-weight: 600; }
.note-audience-internal {
  border-color: #f5c26b; background: #fffaeb; color: #7a4b00;
}
.note-audience-internal strong { color: #663c00; }
.internal-note-card { border-left: 3px solid #f79009; }
.internal-note-card textarea { min-height: 92px; }

/* --- username suggestions (v29) ---------------------------------------- */
.username-suggest { display: none; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.username-option {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 5px 10px; border-radius: 999px; border: 1px dashed #c7d2f7;
  background: #f7f8ff; color: var(--primary-dark);
}
.username-option:hover { background: #eef2ff; border-style: solid; }
.username-option.is-picked { background: var(--primary); border-color: var(--primary); color: #fff; }

/* --- tutor abilities & Instagram choices (v30) --------------------------- */
.ability-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ability-option {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 550; color: var(--ink-soft);
  cursor: pointer; min-height: 40px;
}
.ability-option:has(input:checked) {
  border-color: var(--primary); background: #f5f3ff; color: var(--primary-dark);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.ability-option input { accent-color: var(--primary); width: 15px; height: 15px; }
.join-choice { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.join-choice label {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; font-size: 13.5px; color: var(--ink-soft); cursor: pointer;
}
.join-choice label:has(input:checked) { border-color: var(--primary); background: #f5f3ff; }
.join-choice input { margin-top: 2px; accent-color: var(--primary); width: 16px; height: 16px; }
.ig-caption {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  background: #f7f8ff; border: 1px dashed #c7d2f7; border-radius: 10px; padding: 10px 12px;
}

/* --- public request form: three steps, built for a phone (v31) -----------
   Most families arrive from an Instagram or WhatsApp link on a phone, so:
   bigger type in the inputs (16px stops iOS zooming into the field), 44px+ tap
   targets, one column, and an error message that sits under its own field
   instead of a wall of text at the top.
------------------------------------------------------------------------ */
.join-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 10px; padding: 5px 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--primary-dark);
}
.join-form .join-section-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.join-form .join-section-head strong {
  display: block; font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--ink);
}
.join-form .join-section-head .tiny { display: block; margin-top: 2px; }
.join-form .join-section-head .join-step-num {
  flex: 0 0 auto; width: 28px; height: 28px; font-size: 13px;
}

/* one message, right under the field it belongs to */
.field-error {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12px; font-weight: 600; line-height: 1.45; color: var(--bad);
}
.field-error::before {
  content: '!'; flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
}
.has-error input, .has-error select, .has-error textarea {
  border-color: #f97066; background: #fffbfa;
}
.has-error input:focus, .has-error select:focus, .has-error textarea:focus {
  border-color: #f97066; box-shadow: 0 0 0 3px rgba(217, 45, 32, .12);
}

/* the optional Instagram tick, and the handle it reveals */
.join-consent {
  margin-top: 18px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fcfcff;
}
.join-consent-opt {
  display: flex; align-items: flex-start; gap: 10px; min-height: 44px;
  font-size: 13px; color: var(--ink-soft); cursor: pointer;
}
.join-consent-opt > span { display: flex; flex-direction: column; gap: 2px; }
.join-consent-opt strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.join-consent-opt input {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary);
}
.join-consent-more { margin-top: 12px; }
.join-consent-more[hidden] { display: none; }

/* the "request received" page: what we have, and what is still open */
.join-statebar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.join-confirm {
  margin: 18px 0 0; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fcfcff; text-align: left;
}
.join-confirm h2 { font-size: 14.5px; margin: 0 0 6px; }
.join-confirm-list { margin: 10px 0 8px; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.join-confirm-list strong { color: var(--ink); }
.join-states { display: grid; gap: 10px; margin: 16px 0 0; text-align: left; }
.join-state {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
}
.join-state.is-now { border-color: #abefc6; background: #f6fef9; }
.join-state.is-next { border-style: dashed; }
.join-state-dot {
  flex: 0 0 10px; width: 10px; height: 10px; margin-top: 5px; border-radius: 999px; background: var(--line);
}
.join-state.is-now .join-state-dot { background: #12b76a; box-shadow: 0 0 0 4px rgba(18, 183, 106, .14); }
.join-state-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.join-state.is-now .join-state-label { color: #027a48; }
.join-state p { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }

@media (max-width: 640px) {
  .join-wrap { padding: 16px 14px 36px; }
  .join-head { margin-bottom: 12px; gap: 10px; }
  .join-head small { display: none; }
  .join-hero { margin: 2px 0 14px; }
  .join-hero h1 { font-size: 21px; }
  .join-hero p { font-size: 13.5px; margin-bottom: 0; }
  .join-points { display: none; }          /* the form is the point on a phone */
  .join-form .join-section { margin-top: 14px; padding-top: 14px; }
  .join-form .join-section-head { margin-bottom: 12px; }
  .join-form .join-section-head strong { font-size: 14.5px; }
  body.join-page input:not([type=checkbox]):not([type=radio]),
  body.join-page select,
  body.join-page textarea { font-size: 16px; padding: 11px 12px; min-height: 46px; }
  body.join-page textarea { min-height: 96px; }
  .join-form .form-grid { gap: 12px; }
  .join-day span { min-width: 46px; min-height: 44px; padding: 10px 8px; font-size: 13px; }
  .join-day-flex { min-height: 44px; align-items: center; font-size: 13px; }
  .join-consent-opt { min-height: 48px; }
  .join-consent-opt input { width: 20px; height: 20px; }
  .join-form .btn-lg { width: 100%; min-height: 52px; font-size: 15.5px; }
  .join-submit { margin-top: 18px; }
  .join-confirm, .join-state { padding: 13px 14px; }
  .join-code strong { font-size: 20px; }
  .card { border-radius: 14px; }
}

/* --- review a PDF before its questions are imported (v32) ----------------
   One block per question, so a 40-question paper still reads as a list instead
   of a wall of inputs: number + badges + answer/points in the header, then the
   text, the five options and an optional explanation.
------------------------------------------------------------------------ */
.pdf-note {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid #f5c26b; background: #fffaeb; color: #7a4b00;
  font-size: 12.5px; line-height: 1.55;
}
.pdf-note strong { color: #663c00; }
.pdf-paste { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.pdf-paste > summary {
  cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--primary-dark);
  padding: 4px 0; min-height: 32px; display: flex; align-items: center;
}
.pdf-paste > summary::-webkit-details-marker { display: none; }
.pdf-paste > summary::before { content: '+'; margin-right: 6px; font-size: 15px; }
.pdf-paste[open] > summary::before { content: '−'; }

.pdf-q-list { display: grid; gap: 14px; }
.pdf-q {
  display: grid; gap: 10px;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff;
}
.pdf-q.needs-look { border-color: #f5c26b; background: #fffdf7; }
.pdf-q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pdf-q-pick {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; color: var(--ink); cursor: pointer; min-height: 32px;
}
.pdf-q-pick input { width: 18px; height: 18px; accent-color: var(--primary); }
.pdf-q-pick .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.pdf-mini {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.pdf-mini select, .pdf-mini input {
  width: auto; min-width: 84px; padding: 6px 8px; font-size: 12.5px; border-radius: 8px;
}
.pdf-mini input[type=number] { min-width: 62px; width: 62px; }
.pdf-opts { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pdf-opts .field { position: relative; }
.pdf-opt-label {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 700; color: var(--muted); pointer-events: none;
}
.pdf-opts input { padding-left: 26px; }
.pdf-expl { font-size: 12.5px; }
.pdf-expl > summary {
  cursor: pointer; list-style: none; color: var(--primary-dark); font-weight: 600;
  padding: 4px 0; min-height: 30px; display: flex; align-items: center;
}
.pdf-expl > summary::-webkit-details-marker { display: none; }
.pdf-expl > summary::before { content: '+'; margin-right: 6px; font-size: 14px; }
.pdf-expl[open] > summary::before { content: '−'; }
@media (max-width: 860px) {
  .pdf-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdf-q { padding: 12px 12px; }
  .pdf-mini select, .pdf-mini input { min-width: 74px; min-height: 42px; }
  /* On a phone these are the fields that get corrected by hand: 16px text stops
     iOS zooming into the box, 44px keeps the tap comfortable. */
  .pdf-opts input { min-height: 44px; font-size: 16px; padding: 10px 10px 10px 26px; }
  .pdf-q textarea { font-size: 16px; }
}
@media (max-width: 560px) {
  .pdf-opts { grid-template-columns: minmax(0, 1fr); }
  .pdf-mini { flex: 1 1 40%; }
  .pdf-mini select, .pdf-mini input { flex: 1; }
}

/* A hint that has turned into a warning (e.g. a file that is too big). */
.hint-error { color: var(--bad); font-weight: 600; }

/* --- pictures and written answers in exercises (v33) --------------------
   A question can carry a diagram and can be an essay a coach marks by hand.
   The picture always sits between the question text and the answer area, at a
   size that reads on a phone without pushing the answer off the screen.
------------------------------------------------------------------------ */
.q-figure {
  margin: 12px 0 4px; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fff; max-width: 520px;
}
.q-figure img { display: block; width: 100%; height: auto; }
.q-thumb {
  display: block; margin-top: 8px; max-width: 120px; max-height: 80px; width: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; object-fit: contain;
}
.q-essay textarea { min-height: 150px; line-height: 1.6; }
.essay-answer {
  margin-top: 10px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fbfcff;
  font-size: 13.5px; line-height: 1.6; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.grade-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.grade-form .field { margin: 0; }

/* PDF import: the pictures found inside the paper, offered as candidates. */
.pdf-pics {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.pdf-pic {
  margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.pdf-pic img {
  width: 100%; height: 110px; object-fit: contain; background: #fbfcff; border-radius: 8px;
}
.pdf-pic figcaption { font-size: 11.5px; color: var(--muted); text-align: center; }
.pdf-pic-preview { margin: 0; padding: 8px; border: 1px dashed var(--line); border-radius: 12px; background: #fbfcff; max-width: 260px; }
.pdf-pic-preview[hidden] { display: none; }
.pdf-pic-preview img { display: block; width: 100%; height: auto; border-radius: 8px; }
@media (max-width: 640px) {
  .q-figure { max-width: 100%; }
  .grade-form { flex-direction: column; align-items: stretch; }
  .grade-form .field { max-width: none !important; }
  .grade-form .btn { width: 100%; }
  .pdf-pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdf-pic img { height: 88px; }
}
