/* RVL OS — coach dashboard + student portal.
   Matches rvl-site tokens: purple brand, mint accents, light surfaces. */

:root {
  --brand: #8F3985;
  --brand-bright: #A64A9B;
  --brand-dark: #75276C;
  --mint: #00F0B5;
  --mint-ink: #04332A;
  --mint-soft: rgba(0, 240, 181, .16);
  --ink: #2A2030;
  --ink-soft: #6B5E70;
  --stage: #1D1421;
  --white: #fff;
  --surface: #F8F5F9;
  --surface-2: #F0EAF2;
  --line: #E4DBE6;
  --good: #0a7a43;
  --bad: #b3261e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 8px 22px rgba(40, 20, 40, .09);
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

body.os {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; }

/* ── App nav ── */

.os-nav {
  background: var(--stage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem clamp(.9rem, 3vw, 1.6rem);
  position: sticky;
  top: 0;
  z-index: 20;
}

.os-brand { display: flex; align-items: center; gap: .6rem; color: #fff; }
.os-brand .brand-mark { color: var(--mint); }
.os-brand span { font-weight: 700; line-height: 1.15; font-size: .98rem; }
.os-brand small { display: block; font-weight: 400; font-size: .68rem; opacity: .65; }

.os-nav-links { display: flex; gap: 1rem; align-items: center; }
.os-nav-links a { color: rgba(255, 255, 255, .85); font-size: .88rem; }
.os-nav-links a:hover { color: var(--mint); }
.os-logout { opacity: .7; }

.os-banner {
  background: var(--mint-soft);
  color: var(--mint-ink);
  text-align: center;
  padding: .55rem 1rem;
  font-size: .85rem;
}

/* ── Layout ── */

.os-main {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.8rem) clamp(.9rem, 3vw, 1.6rem) 3rem;
  flex: 1;
}

.os-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

h1 { font-family: var(--font-serif); font-size: clamp(1.5rem, 4.5vw, 2rem); }
.os-sub { color: var(--ink-soft); font-size: .9rem; margin-top: .2rem; }
.os-back { display: inline-block; font-size: .82rem; margin-bottom: .35rem; }

.os-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 2.5vw, 1.4rem);
  margin-bottom: 1rem;
}

.os-card h2 { font-family: var(--font-serif); font-size: 1.15rem; margin-bottom: .6rem; }
.os-card h3 { font-size: .95rem; margin: .8rem 0 .4rem; }
.os-card h3 small { color: var(--ink-soft); font-weight: 400; }

.os-cols { display: grid; gap: 1rem; }
@media (min-width: 860px) { .os-cols { grid-template-columns: 1.2fr .8fr; align-items: start; } }
.os-stack > .os-card { margin-bottom: 1rem; }

.os-grid-2 { display: grid; gap: .7rem; }
@media (min-width: 560px) { .os-grid-2 { grid-template-columns: 1fr 1fr; } }

/* ── Tabs ── */

.os-tabs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  position: sticky;
  top: 56px;
  z-index: 15;
  background: var(--surface);
  padding: .45rem 0 .6rem;
  margin-bottom: .9rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.os-tabs::-webkit-scrollbar { display: none; }

.os-tab {
  flex: none;
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .5rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.os-tab:active { transform: scale(.96); }
.os-tab i { font-style: normal; background: var(--surface-2); border-radius: 999px; padding: 0 .45rem; margin-left: .15rem; font-size: .74rem; }
.os-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(143, 57, 133, .3);
}
.os-tab.active i { background: rgba(255, 255, 255, .22); }

.os-tabpane { display: none; animation: paneIn .22s ease; }
.os-tabpane.active { display: block; }
@keyframes paneIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── Overview stats ── */

.os-statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.os-stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-align: center;
  padding: .65rem .3rem .55rem;
}
.os-stat b { display: block; font-size: 1.05rem; }
.os-stat small { color: var(--ink-soft); font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; }
.os-stat.low b { color: var(--bad); }

.os-sheet-flag {
  background: #FBF1E2;
  color: #8a5a17;
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
  font-size: .85rem;
  margin-top: .5rem;
}

.os-notes-preview { font-size: .9rem; line-height: 1.6; }

/* ── Quest cards (lessons as quests) ── */

.os-action-row { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 1rem; }
.os-btn-big { width: 100%; padding: .95rem 1.3rem; font-size: 1.02rem; }

.os-level {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  background: var(--mint-soft);
  color: var(--mint-ink);
  border-radius: 999px;
  padding: .18rem .55rem;
  vertical-align: middle;
}

.os-quests { display: flex; flex-direction: column; gap: .5rem; }

.os-quest {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .65rem .8rem;
  color: var(--ink);
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.os-quest:hover { box-shadow: var(--shadow-sm); border-color: var(--brand); border-left-color: var(--brand); }
.os-quest:active { transform: scale(.99); }
.os-quest.upcoming { border-left-color: #b9a7e0; }
.os-quest.ready { border-left-color: #e8a13d; background: #FFFDF7; }
.os-quest.done { border-left-color: var(--mint); }

.os-quest-when { flex: none; text-align: center; min-width: 3.4rem; }
.os-quest-when b { display: block; font-size: .92rem; }
.os-quest-when small { color: var(--ink-soft); font-size: .68rem; }

.os-quest-body { flex: 1; min-width: 0; }
.os-quest-title { display: block; font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-quest-meta { display: block; color: var(--ink-soft); font-size: .78rem; margin-top: .1rem; }

.os-quest-chip {
  flex: none;
  font-size: .7rem;
  font-weight: 800;
  border-radius: 999px;
  padding: .28rem .6rem;
  white-space: nowrap;
}
.os-quest-chip.upcoming { background: #EFE9F8; color: #5b3f8f; }
.os-quest-chip.ready { background: #FCF0DA; color: #8a5a17; }
.os-quest-chip.done { background: var(--mint-soft); color: var(--mint-ink); }

@media (max-width: 480px) {
  .os-quest-chip { display: none; }               /* the border color carries the state */
  .os-quest.ready .os-quest-meta::before { content: '⚡ '; }
}

/* Prep checklist (upcoming lesson) */

.os-prep { list-style: none; padding: 0; }
.os-prep li { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; font-size: .92rem; }
.os-prep li i {
  flex: none;
  font-style: normal;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.os-prep li.ok i { background: var(--mint-soft); color: var(--mint-ink); font-weight: 900; }
.os-prep li.ok span { color: var(--ink-soft); }
.os-prep b { color: var(--ink); }

.os-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.os-mini-link { font-size: .82rem; font-weight: 700; }
.os-mini { font-size: .74rem; color: var(--ink-soft); font-weight: 400; font-family: var(--font-sans); }
.os-body-text { font-size: .92rem; line-height: 1.65; }

.os-attn.ready { border-left: 4px solid #e8a13d; }
.os-attn.sheets { border-left: 4px solid var(--brand); }

.os-attach-form { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .8rem; }

/* ── Forms ── */

.os-form label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .7rem; color: var(--ink); }
.os-form label small { font-weight: 400; color: var(--ink-soft); }
.os-form input, .os-form select, .os-form textarea {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .65rem .75rem;
  font: inherit;
  font-size: .95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}
.os-form input:focus, .os-form select:focus, .os-form textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
.os-check { display: flex !important; align-items: center; gap: .5rem; }
.os-check input { width: auto; margin: 0; }

.os-btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: .92rem;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
}
.os-btn:active { transform: scale(.97); }
.os-btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(143, 57, 133, .3);
}
.os-btn-primary:hover { background: var(--brand-bright); }

.os-collapsed { display: none; }
.os-collapsed.open { display: block; }

.os-success, .os-error {
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .88rem;
  margin-bottom: 1rem;
}
.os-success { background: var(--mint-soft); color: var(--mint-ink); }
.os-error { background: #fdecea; color: var(--bad); }

/* ── Auth ── */

.os-auth { max-width: 420px; margin: clamp(1rem, 6vw, 3rem) auto 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: clamp(1.2rem, 4vw, 2rem); }
.os-auth h1 { margin-bottom: .2rem; }
.os-auth .os-sub { margin-bottom: 1.1rem; }
.os-auth .os-btn { width: 100%; margin-top: .3rem; }
.os-alt { font-size: .85rem; color: var(--ink-soft); text-align: center; margin-top: .9rem; }

/* ── Roster table ── */

.os-table-wrap { overflow-x: auto; margin: 0 -.2rem; }
.os-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.os-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: .45rem .55rem; border-bottom: 2px solid var(--line); }
.os-table td { padding: .6rem .55rem; border-bottom: 1px solid var(--line); }
.os-table tr[data-href] { cursor: pointer; }
.os-table tr[data-href]:hover td { background: var(--surface); }
.os-credits-low { color: var(--bad); font-weight: 700; }
.os-credits-ok { color: var(--good); font-weight: 700; }
.os-dim { color: var(--ink-soft); }

.os-tag { font-size: .68rem; background: var(--surface-2); border-radius: 999px; padding: .15rem .5rem; color: var(--ink-soft); font-weight: 600; }
.os-tag-plan { background: var(--mint-soft); color: var(--mint-ink); }

/* ── Lists ── */

.os-list { list-style: none; padding: 0; }
.os-list li { display: flex; justify-content: space-between; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; flex-wrap: wrap; }
.os-list li:last-child { border-bottom: none; }
.os-list span { color: var(--ink-soft); }
.os-list-tight li { padding: .3rem 0; font-size: .82rem; }
.os-pos { color: var(--good); }
.os-neg { color: var(--bad); }

.os-list-links li { padding: 0; }
.os-list-links a { display: flex; width: 100%; align-items: center; gap: .8rem; padding: .7rem .2rem; color: var(--ink); }
.os-list-links a:hover { background: var(--surface); }
.os-list-links a b { min-width: 6.5rem; }
.os-list-links a span { flex: 1; color: var(--ink-soft); }
.os-list-links a i { color: var(--brand); font-style: normal; }

.os-alert-card { border-left: 4px solid var(--brand); }

/* ── Balance chip ── */

.os-balance {
  flex: none;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: .55rem 1rem;
  min-width: 86px;
}
.os-balance b { font-size: 1.5rem; color: var(--good); display: block; line-height: 1.1; }
.os-balance.low b { color: var(--bad); }
.os-balance small { color: var(--ink-soft); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Scores ── */

.os-scores { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .3rem; }
.os-score-row { display: grid; grid-template-columns: 8.2rem 1fr 2rem; align-items: center; gap: .6rem; margin-bottom: .45rem !important; }
.os-score-name { display: flex; align-items: center; gap: .45rem; font-size: .84rem; font-weight: 600; }
.os-score-name i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.os-score-row input[type=range] { margin: 0; padding: 0; accent-color: var(--brand); }
.os-score-row output { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.os-score-note { margin-bottom: .5rem; }

.os-scorebars { display: grid; gap: .55rem; }
.os-scorebar { display: grid; grid-template-columns: 8.2rem 1fr 2rem; align-items: center; gap: .6rem; }
.os-scorebar-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.os-scorebar-track span { display: block; height: 100%; border-radius: 999px; }
.os-scorebar b { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Lessons (coach) ── */

.os-lessons { list-style: none; padding: 0; }
.os-lesson { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem .9rem; margin-bottom: .7rem; }
.os-lesson.planned { background: var(--surface); border-style: dashed; }
.os-lesson-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; }
.os-lesson-song { color: var(--ink-soft); font-size: .85rem; }
.os-lesson p { font-size: .88rem; margin: .3rem 0; }
.os-homework { background: var(--mint-soft); border-radius: var(--radius-sm); padding: .45rem .6rem; }

.os-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.os-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .55rem; }
.os-pill i { width: 8px; height: 8px; border-radius: 50%; }

.os-atts { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .5rem; }
.os-atts a { font-size: .82rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; }
.os-atts a:hover { border-color: var(--brand); }

.os-details summary { cursor: pointer; font-size: .84rem; color: var(--brand); margin-top: .5rem; }

/* ── Student dash ── */

.os-welcome p { margin: .5rem 0; line-height: 1.6; }
.os-cta-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.os-next { border-left: 4px solid var(--mint); }
.os-next-when { font-size: 1.05rem; font-weight: 700; }
.os-hw-card { border-left: 4px solid var(--mint); }
.os-report { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }

/* ── Chart ── */

.os-chart { position: relative; }
.os-chart svg { display: block; width: 100%; height: auto; font-family: var(--font-sans); }
.os-chart-hint { font-size: .74rem; color: var(--ink-soft); margin-top: .4rem; }

.os-legend { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.os-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .28rem .65rem;
  cursor: pointer;
}
.os-chip i { width: 9px; height: 9px; border-radius: 50%; }
.os-chip.off { opacity: .38; }
.os-chip:active { transform: scale(.96); }

.os-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--stage);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .55rem .7rem;
  font-size: .76rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  z-index: 5;
  max-width: 220px;
  display: none;
}
.os-tooltip.show { display: block; }
.os-tooltip b { display: block; margin-bottom: .15rem; }
.os-tooltip .tt-row { display: flex; align-items: center; gap: .4rem; }
.os-tooltip .tt-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.os-tooltip .tt-open { display: block; margin-top: .25rem; color: var(--mint); font-weight: 700; }

/* ── Availability editor ── */

.os-availgrid { display: flex; flex-direction: column; gap: .45rem; }
.os-availrow { display: grid; grid-template-columns: 8.5rem 1fr auto 1fr; gap: .5rem; align-items: center; }
.os-availrow input[type=time] { margin: 0; }
.os-availday { margin: 0 !important; }
.os-avail-to { color: var(--ink-soft); font-size: .8rem; }
@media (max-width: 460px) { .os-availrow { grid-template-columns: 6.4rem 1fr auto 1fr; } }

/* ── Coach chat console ── */

.os-navbadge {
  display: inline-block;
  background: var(--mint);
  color: var(--mint-ink);
  font-size: .68rem;
  font-weight: 900;
  border-radius: 999px;
  padding: .08rem .42rem;
  vertical-align: middle;
}

.os-chatapp { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 860px) { .os-chatapp { grid-template-columns: .9fr 1.4fr; } .os-chatapp .os-chatthread { display: block !important; } }

.os-chatitem {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  margin-bottom: .45rem;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.os-chatitem:hover { border-color: var(--brand); }
.os-chatitem b { flex: 1; font-size: .92rem; }
.os-chatitem span { color: var(--ink-soft); font-size: .74rem; }

.os-chatthread-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.os-chat-back { padding: .4rem .8rem; }
@media (min-width: 860px) { .os-chat-back { display: none; } }
@media (max-width: 859px) {
  .os-chatapp.in-thread .os-chatlist { display: none; }
}

.os-chatmsgs {
  height: min(48vh, 420px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .8rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.os-chatmsg {
  max-width: 82%;
  padding: .5rem .75rem;
  border-radius: 14px;
  font-size: .88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.os-chatmsg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.os-chatmsg.them { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }

.os-chatsend { display: flex; gap: .5rem; margin-top: .6rem; }
.os-chatsend input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: .6rem .9rem; font: inherit; font-size: .92rem; }

/* ── Booking manage card ── */

.os-bookcard { max-width: 480px; }
.os-bookinfo { margin-bottom: .9rem; }
.os-bookcard .os-details { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }

/* ── Cleanup tools + report studio ── */

.os-att-wrap { display: inline-flex; align-items: center; gap: .2rem; }
.os-att-del { display: inline; }
.os-att-del button {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: .78rem;
  cursor: pointer;
  padding: .2rem .3rem;
  border-radius: 50%;
}
.os-att-del button:hover { color: var(--bad); background: #fdecea; }

.os-danger-row { text-align: center; margin: 1.4rem 0 .4rem; }
.os-link-danger {
  background: none;
  border: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: .8rem;
  text-decoration: underline;
  cursor: pointer;
}
.os-link-danger:hover { color: var(--bad); }
.os-link-danger-btn { border-color: var(--bad); color: var(--bad); }
.os-link-danger-btn:hover { background: #fdecea; }
.os-btn-quiet { color: var(--ink-soft); }

.os-code { font-family: ui-monospace, Consolas, monospace; font-size: .78rem !important; }

.os-report-frame {
  margin-top: .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.os-report-frame iframe { display: block; width: 100%; height: min(78vh, 900px); border: 0; }

.os-feedurl code {
  display: block;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  font-size: .78rem;
  word-break: break-all;
  user-select: all;
}

.os-chatemail { display: block; font-weight: 400; font-size: .72rem; color: var(--ink-soft); }

/* ── Footer ── */

.os-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(.9rem, 3vw, 1.6rem) calc(1rem + env(safe-area-inset-bottom, 0));
  color: var(--ink-soft);
  font-size: .8rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ── account + siblings (0.6.0) ── */
.os-students { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1rem; }
.os-student-chip { display: inline-block; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none; }
.os-student-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.os-h2 { font-size: 1.05rem; margin: 1.4rem 0 .7rem; }
.os-form input[readonly] { background: var(--surface); color: var(--ink-soft); }

/* ── coach calendars (0.9.0) ── */
.os-cal-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.os-cal-head h2 { margin: 0; }
.os-cal-nav { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--ink); display: grid; place-items: center; font-size: 1.2rem; text-decoration: none; }
.os-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
.os-cal-dow { text-align: center; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding-bottom: .2rem; }
.os-cal-day { min-height: 74px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: .3rem .35rem .35rem; display: flex; flex-direction: column; gap: .2rem; font-size: .74rem; color: var(--ink); text-decoration: none; min-width: 0; }
.os-cal-day.closed { background: var(--surface); color: var(--ink-soft); }
.os-cal-day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.os-cal-num { font-weight: 700; font-size: .8rem; }
.os-cal-lesson { display: block; border-radius: 6px; padding: .15rem .35rem; background: var(--brand); color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .7rem; }
.os-cal-lesson.done { background: var(--surface-2, #e9e2ea); color: var(--ink); }
.os-cal-lesson b { font-weight: 700; }
.os-cal-foot { margin-top: .6rem; }
.os-cal-hours .os-cal-day { min-height: 64px; cursor: pointer; }
.os-cal-hours .os-cal-day:hover { border-color: var(--brand); }
.os-cal-hours .os-cal-day.editing { background: var(--brand); color: #fff; border-color: var(--brand); }
.os-cal-hours .os-cal-day.editing .os-cal-hrs, .os-cal-hours .os-cal-day.editing .os-cal-count { color: rgba(255,255,255,.85); }
.os-cal-hrs { font-size: .68rem; color: var(--ink-soft); line-height: 1.2; }
.os-cal-count { font-size: .66rem; color: var(--brand); font-weight: 700; }
.os-cal-flag { font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--good); }
.os-daymodes { display: grid; gap: .35rem; margin: .5rem 0; }
@media (max-width: 640px) {
  .os-cal { gap: .15rem; }
  .os-cal-day { min-height: 54px; padding: .2rem; border-radius: 7px; }
  .os-cal-lesson { font-size: .6rem; padding: .1rem .2rem; }
  .os-cal-hrs { display: none; }
  .os-cal-hours .os-cal-day.closed::after { content: "·"; color: var(--ink-soft); }
}

/* ── the report draft gate (0.10.0) ── */
.os-draft-card { border: 2px solid var(--brand); }
.os-draft-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .4rem 0 .6rem; }
.os-draft-card .os-report-frame iframe { min-height: 420px; }
.os-draft-scores { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem .8rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem .8rem; }
.os-draft-scores legend { font-size: .84rem; font-weight: 700; padding: 0 .3rem; }
.os-draft-scores label { font-size: .84rem; }
.os-draft-scores input { width: 100%; }
.os-draft-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
@media (max-width: 520px) { .os-draft-actions .os-btn { flex: 1 1 100%; } }

/* ── 0.13.0 fixes for everyone ── */
/* the 7 score sliders kept their grid (".os-form label" was winning, so the number dropped under the slider) */
.os-form .os-score-row { display: grid; }
/* a report on a phone uses the card's full width; os.js grows the frame to the report's own height (no box to scroll inside) */
@media (max-width: 640px) {
  .os-card > .os-report-frame { margin-left: calc(-1 * clamp(1rem, 2.5vw, 1.4rem)); margin-right: calc(-1 * clamp(1rem, 2.5vw, 1.4rem)); border-left: 0; border-right: 0; border-radius: 0; }
}
.os-report-frame iframe[data-fit] { min-height: 320px; }

/* ── 0.13.0 the new screens (body.os-new, behind the admin switch) ── */
.os-new .os-main { max-width: 1160px; }
.os-new .os-nav { padding-top: calc(.7rem + env(safe-area-inset-top, 0px)); }
.os-new { --tabbar: 0px; }

/* phone tab bar: an installed app has no back button */
.os-tabbar { display: none; }
@media (max-width: 760px) {
  body.os-new { --tabbar: calc(60px + env(safe-area-inset-bottom, 0px)); padding-bottom: var(--tabbar); }
  .os-new .os-nav-links a:not(.os-logout) { display: none; }
  .os-new .os-tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(29, 20, 33, .97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: .3rem .35rem calc(.3rem + env(safe-area-inset-bottom, 0px));
  }
  .os-new .os-footer { padding-bottom: 1rem; }
}
.os-tab-link { position: relative; display: flex; flex-direction: column; align-items: center; gap: .12rem; padding: .32rem 0 .28rem; border-radius: 12px; color: rgba(255, 255, 255, .72); font-size: .68rem; font-weight: 700; letter-spacing: .01em; }
.os-tab-link:active { background: rgba(255, 255, 255, .08); }
.os-tab-link.on { color: var(--mint); }
.os-tab-ico { font-size: 1.22rem; line-height: 1; filter: saturate(.9); }
.os-tab-link .os-navbadge { position: absolute; top: .05rem; left: calc(50% + .45rem); }

/* dashboard grid: one column on phones, main + side from 980 px */
.os-dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; }
@media (min-width: 980px) { .os-dash { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; } }
.os-hello { margin-bottom: .7rem; }
.os-new .os-page-head { flex-wrap: nowrap; }
.os-new .os-page-head > div:first-child { flex: 1; min-width: 0; }
.os-new .os-balance { padding: .45rem .75rem; min-width: 72px; }
.os-dash-side .os-scards { grid-template-columns: minmax(0, 1fr); }
.os-hello h1 { font-size: clamp(1.6rem, 5vw, 2.1rem); }
a.os-balance { color: inherit; }

.os-chiprow { display: flex; gap: .45rem; overflow-x: auto; margin: 0 0 1rem; padding: .1rem .1rem .35rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.os-chiprow::-webkit-scrollbar { display: none; }
.os-statchip { flex: none; display: inline-flex; align-items: baseline; gap: .32rem; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; color: var(--ink); font-size: .84rem; box-shadow: var(--shadow-sm); }
.os-statchip b { font-size: 1.02rem; }
.os-statchip.hot { background: var(--brand); border-color: var(--brand); color: #fff; }

.os-needs { border-left: 4px solid var(--brand); }
.os-card-foot { margin-top: .75rem; font-size: .86rem; font-weight: 700; }
.os-btn-small { padding: .45rem .95rem; font-size: .82rem; }
.os-inset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem; margin: .2rem 0 .9rem; background: var(--surface); }

/* rows: time | who + what | a pill */
.os-rows { display: flex; flex-direction: column; gap: .4rem; }
.os-row { display: flex; align-items: center; gap: .75rem; min-height: 52px; padding: .58rem .7rem; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.os-row:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.os-row:active { transform: scale(.995); }
.os-row.is-ready { border-left-color: var(--brand); background: #FCF7FB; }
.os-row.is-stuck { border-left-color: var(--bad); background: #FFF8F7; }
.os-row.is-done { border-left-color: var(--mint); }
.os-row-when { flex: none; min-width: 3.6rem; text-align: center; line-height: 1.15; }
.os-row-when b { display: block; font-size: .9rem; }
.os-row-when small { color: var(--ink-soft); font-size: .68rem; }
.os-row-body { flex: 1; min-width: 0; }
.os-row-title { display: block; font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-row-meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-soft); font-size: .78rem; margin-top: .08rem; }
.os-row-aside { flex: none; }
.os-warn { color: #9a5b00; font-weight: 700; }
.os-card .os-dayhead { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); margin: 1rem 0 .45rem; }
.os-card .os-card-head + .os-dayhead { margin-top: .2rem; }

/* status pills */
.os-pill { display: inline-flex; align-items: center; gap: .32rem; font-size: .72rem; font-weight: 800; border-radius: 999px; padding: .26rem .62rem; white-space: nowrap; background: var(--surface-2); color: var(--ink-soft); }
.os-pill-wait { background: #EFE9F8; color: #5b3f8f; }
.os-pill-busy { background: #F6E9F4; color: var(--brand-dark); }
.os-pill-busy::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: osPulse 1.2s ease-in-out infinite; }
.os-pill-ready { background: var(--brand); color: #fff; }
.os-pill-stuck { background: #fdecea; color: var(--bad); }
.os-pill-done { background: var(--mint-soft); color: var(--mint-ink); }
@keyframes osPulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* students */
.os-search { display: block; width: 100%; padding: .62rem .95rem; margin: 0 0 .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font: inherit; font-size: .92rem; }
.os-search:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.os-scards { display: grid; gap: .45rem; }
@media (min-width: 560px) { .os-scards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.os-scard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .12rem .6rem; padding: .62rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--ink); }
.os-scard:hover { border-color: var(--brand); }
.os-scard[hidden] { display: none; }
.os-scard-name { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-scard-meta { grid-column: 1; color: var(--ink-soft); font-size: .78rem; }
.os-scard-credits { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: center; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.os-scard-credits b { display: block; font-size: 1.12rem; letter-spacing: 0; color: var(--good); }
.os-scard-credits.low b { color: var(--bad); }

/* hours */
.os-hours { list-style: none; padding: 0; display: grid; gap: .2rem; }
.os-hours li { display: grid; grid-template-columns: 4.4rem 1fr auto; gap: .5rem; align-items: center; padding: .45rem .6rem; border-radius: 8px; font-size: .86rem; }
.os-hours li:nth-child(odd) { background: var(--surface); }
.os-hours li.closed { color: var(--ink-soft); }
.os-hours li.today b { color: var(--brand); }
.os-hours em { font-style: normal; font-size: .76rem; font-weight: 800; color: var(--good); }

/* folds: a card whose heading opens it */
.os-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.os-fold > summary::-webkit-details-marker { display: none; }
.os-fold > summary h2 { margin: 0; }
.os-fold > summary::after { content: '▾'; color: var(--ink-soft); font-size: .9rem; transition: transform .2s; }
.os-fold[open] > summary::after { transform: rotate(180deg); }
.os-fold[open] > summary { margin-bottom: .75rem; }
.os-report-card .os-fold { margin: .2rem 0 .6rem; }
.os-report-card .os-fold > summary { font-size: .88rem; font-weight: 700; color: var(--brand); }

/* the lesson report card (coach) */
.os-report-card { border-top: 4px solid var(--line); scroll-margin-top: 70px; }
.os-report-ready { border-top-color: var(--brand); }
.os-report-wait, .os-report-busy { border-top-color: #b9a7e0; }
.os-report-stuck { border-top-color: var(--bad); }
.os-report-done { border-top-color: var(--mint); }
.os-report-line { display: flex; align-items: center; gap: .5rem; font-size: .92rem; margin: -.15rem 0 .8rem; }
.os-spinner { flex: none; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: osSpin .8s linear infinite; }
@keyframes osSpin { to { transform: rotate(360deg); } }
.os-quote { margin: 0 0 .7rem; padding: .6rem .85rem; border-left: 3px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface); font-style: italic; line-height: 1.5; }
.os-inline-form { margin-top: .2rem; }
.os-review-panel { margin-top: .9rem; padding: .95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.os-card .os-review-panel h3 { margin: 0 0 .35rem; font-size: 1rem; }
.os-review-panel .os-sub { margin-bottom: .7rem; }
.os-review-bar {
  position: sticky; bottom: calc(var(--tabbar, 0px) + 10px); z-index: 12;
  display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; padding: .55rem;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgba(40, 20, 40, .18);
}
.os-review-bar .os-approve { flex: 1 1 100%; padding: .8rem 1rem; font-size: .98rem; }
.os-review-bar .os-btn:not(.os-approve) { flex: 1 1 0; padding: .6rem .7rem; }
.os-review-bar .os-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--brand); color: var(--brand-dark); }
@media (min-width: 700px) { .os-review-bar .os-approve { flex: 2 1 0; } }
.os-draft-scores .os-score-name { font-size: .8rem; }
.os-advanced { margin-top: 1rem; padding-top: .4rem; border-top: 1px dashed var(--line); }
.os-resend { margin-top: .4rem; }
.os-check-2 { align-items: flex-start !important; }
.os-check-2 input { margin-top: .2rem; }
.os-check-2 small { display: block; margin-top: .1rem; }

/* a report, edge to edge on a phone */
.os-report-full { background: #0b0a0d; margin-left: calc(-1 * clamp(1rem, 2.5vw, 1.4rem)); margin-right: calc(-1 * clamp(1rem, 2.5vw, 1.4rem)); border-left: 0; border-right: 0; border-radius: 0; }
.os-report-wrap { margin-bottom: 1rem; }
.os-report-wrap .os-report-full { margin: 0 calc(-1 * clamp(.9rem, 3vw, 1.6rem)); border-top: 0; border-bottom: 0; }
@media (min-width: 700px) {
  .os-report-full, .os-report-wrap .os-report-full { margin: .8rem 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
}

/* student dashboard */
.os-preview-bar { background: #FCF0DA; color: #6b4510; border-radius: var(--radius-sm); padding: .55rem .85rem; font-size: .86rem; margin-bottom: 1rem; }
.os-preview-bar a { font-weight: 700; }
.os-where { font-size: .84rem; color: var(--ink-soft); margin: .5rem 0 .2rem; line-height: 1.5; }
.os-next .os-cta-row { margin-top: .8rem; }
.os-latest { border-left: 4px solid var(--brand); }
.os-latest-when { font-weight: 700; margin-bottom: .35rem; }
.os-latest-teaser { line-height: 1.55; margin-bottom: .85rem; font-size: .94rem; }
.os-practice { margin: 0; padding-left: 1.25rem; display: grid; gap: .5rem; font-size: .94rem; line-height: 1.5; }
.os-practice li::marker { color: var(--brand); font-weight: 800; }
.os-scorebars-delta .os-scorebar { grid-template-columns: 7rem minmax(0, 1fr) 1.5rem 2.1rem; }
.os-delta { font-style: normal; font-size: .74rem; font-weight: 800; color: var(--ink-soft); text-align: right; }
.os-delta.up { color: var(--good); }
.os-delta.down { color: var(--bad); }
.os-scorebars-delta + .os-chart { margin-top: 1.1rem; }
.os-acct-left { font-size: .98rem; }
.os-acct-left b { font-size: 1.7rem; margin-right: .25rem; vertical-align: -3px; }
.os-links { list-style: none; padding: 0; margin-top: .75rem; border-top: 1px solid var(--line); }
.os-links a { display: block; padding: .62rem 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .9rem; }
.os-pager { display: flex; justify-content: space-between; gap: 1rem; margin: .4rem 0 1rem; font-weight: 700; }
.os-pager a { padding: .55rem .9rem; background: var(--white); border: 1px solid var(--line); border-radius: 999px; }

/* "put the app on your phone" hint */
.os-install { display: flex; align-items: center; gap: .65rem; margin: 0 0 1rem; padding: .7rem .75rem .7rem .85rem; border-radius: var(--radius); background: var(--stage); color: #fff; box-shadow: var(--shadow-sm); }
.os-install[hidden], .os-install [hidden] { display: none !important; }
.os-install-ico { font-size: 1.45rem; line-height: 1; }
.os-install-text { flex: 1; min-width: 0; font-size: .86rem; line-height: 1.45; }
.os-install-text b { color: #fff; }
.os-btn-mint { background: var(--mint); border-color: var(--mint); color: var(--mint-ink); }
.os-install-x { flex: none; background: none; border: 0; color: rgba(255, 255, 255, .7); font-size: 1rem; padding: .35rem; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .os-pill-busy::before, .os-spinner { animation: none; }
}

/* ── 0.13.0 proof fixes ── */
/* B5: the form's first (default) button is an off-screen Save, so Enter can never approve */
.os-default-submit { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
/* B23 (recheck): every tap target at least 44 px tall - header, form links, footer, and the small app controls */
.os-brand { min-height: 44px; }
.os-nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; }
.os-alt a:not(.os-btn), .os-footer a, .os-back, .os-cal-foot a { display: inline-flex; align-items: center; min-height: 44px; }
.os-alt a:not(.os-btn) { padding: 0 .35rem; }   /* not on buttons: "Book another lesson" keeps its own padding */
/* links inside a line of text: vertical padding gives a 44 px tap area without moving the text (inline padding adds no line height) */
.os-sub a:not(.os-btn), .os-where a, .os-card-foot a, .os-preview-bar a, .os-chart-hint a, .os-welcome p a { padding: .8rem 0; }
.os-btn { min-height: 44px; }
.os-links a { display: flex; align-items: center; min-height: 44px; }
.os-pager a { display: inline-flex; align-items: center; min-height: 44px; }
.os-install-x { min-width: 44px; min-height: 44px; }
.os-fold > summary { min-height: 44px; }   /* the folded cards' own headers (Website accounts, the month, Show the report) */
.os-back { margin-bottom: 0; }
.os-mini-link, .os-link-danger { display: inline-flex; align-items: center; min-height: 44px; }
.os-chip, .os-statchip, .os-btn-small, .os-student-chip { min-height: 44px; }
.os-chip, .os-student-chip { display: inline-flex; align-items: center; }
.os-atts a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .8rem; }
.os-att-del button { min-width: 44px; min-height: 44px; }
.os-cal-nav { width: 44px; height: 44px; }
/* the fold-outs keep their triangle: a summary stays a list item, padded to 44 px */
.os-details summary { display: list-item; min-height: 44px; padding: .7rem 0; margin-top: .2rem; }
/* month-calendar lessons on a touch screen: a full 44 px row each (the day grows) */
@media (pointer: coarse) {
  .os-cal-lesson { display: flex; align-items: center; min-height: 44px; }
}
/* "Send it again" on the unverified bar */
.os-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .6rem; }
.os-banner-form { display: inline; }
.os-banner-btn { min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--mint-ink); background: transparent; color: var(--mint-ink); font: inherit; font-weight: 700; cursor: pointer; }
/* B28: emails the mail server refused */
.os-mailfail { border-left: 4px solid var(--bad); }
.os-inline-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin-top: .6rem; }
.os-inline-tools label { flex: 1 1 220px; margin: 0; }
