:root {
  --ground: #f4f5f1; --surface: #ffffff; --sunk: #eceee8; --line: #dde0d8; --line-strong: #c6cbc1;
  --ink: #1b2230; --ink-2: #4a5552; --muted: #6d7773;
  --accent: #0f6b66; --accent-ink: #ffffff; --accent-soft: #dcefec;
  --good: #2f7d4f; --good-soft: #e1f1e7; --warn: #a86a12; --warn-soft: #f8ecd6; --bad: #b83b27; --bad-soft: #f8e1dc;
  --shadow: 0 1px 2px rgba(27,34,48,.06), 0 8px 24px rgba(27,34,48,.06);
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #111517; --surface: #181d20; --sunk: #1f2528; --line: #2a3134; --line-strong: #3a4246;
    --ink: #e7ece9; --ink-2: #b9c2be; --muted: #8b9692;
    --accent: #4fb8ae; --accent-ink: #0b1716; --accent-soft: #173432;
    --good: #5cc28a; --good-soft: #17301f; --warn: #e0a54a; --warn-soft: #33270f; --bad: #ef7d68; --bad-soft: #3a1c16;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #111517; --surface: #181d20; --sunk: #1f2528; --line: #2a3134; --line-strong: #3a4246;
  --ink: #e7ece9; --ink-2: #b9c2be; --muted: #8b9692;
  --accent: #4fb8ae; --accent-ink: #0b1716; --accent-soft: #173432;
  --good: #5cc28a; --good-soft: #17301f; --warn: #e0a54a; --warn-soft: #33270f; --bad: #ef7d68; --bad-soft: #3a1c16;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 var(--sans); }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: 20px; padding-block: 20px 48px; display: grid; gap: 20px; }
.wrap > *, .panel, .panel > * { min-width: 0; }         /* a wide table scrolls in its box, never the page */
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 600; }
.num, td.n, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.demo { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
        border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* ---------------------------------------------------------------- header -- */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-text { display: grid; gap: 2px; }
.brand-logo { height: 44px; width: auto; max-width: 160px; object-fit: contain; }
.login-logo { height: 56px; width: auto; max-width: 220px; object-fit: contain; justify-self: start; }
:root[data-theme="dark"] .brand-logo, :root[data-theme="dark"] .login-logo { background: #f4f5f1; border-radius: 8px; padding: 4px 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo, :root:not([data-theme="light"]) .login-logo { background: #f4f5f1; border-radius: 8px; padding: 4px 6px; } }
.brand h1 { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.brand .sub { color: var(--muted); font-size: 13px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 12px; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }

/* pilot countdown: 14 day ticks */
.pilot { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: min(100%, 340px); }
.pilot .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.pilot b { font-weight: 600; }
.ticks { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }   /* one tick a day, however long the pilot */
.ticks i { height: 8px; border-radius: 2px; background: var(--sunk); }
.ticks i.done { background: var(--accent); }
.ticks i.today { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pilot.ending .ticks i.done, .pilot.ending .ticks i.today { background: var(--warn); }

/* --------------------------------------------------------------- summary -- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.stat .label { color: var(--muted); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
.stat .value { font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; font-weight: 400; color: var(--muted); }
.stat .hint { font-size: 12.5px; color: var(--ink-2); }
.bar { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }

/* ------------------------------------------------------------ panels ------ */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.panel > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel > .body { padding: 14px 16px; }
.chart svg { display: block; width: 100%; height: auto; }
/* a phone: the chart keeps readable text and scrolls — RTL makes it open at the latest days */
@media (max-width: 560px) { .chart { overflow-x: auto; direction: rtl; } .chart svg { direction: ltr; min-width: 600px; } }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .limit { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .axis { fill: var(--muted); font: 11px var(--sans); }
.chart rect.b { fill: var(--accent); }
.chart rect.b.over { fill: var(--bad); }
.chart rect.b.today { fill: var(--accent); opacity: .55; }
.chart .limit-t { fill: var(--bad); font: 11px var(--sans); }

.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0; width: 220px; max-width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 10px; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- table --- */
.tablewrap { overflow-x: auto; }
.nowrap { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: .02em; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.row { cursor: pointer; }
tr.row:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
tr.off td { color: var(--muted); }
td.n { text-align: right; white-space: nowrap; }
.name { font-weight: 600; } .name .role { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.band { display: inline-block; min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--sunk); }
.band.hi { background: var(--good-soft); color: var(--good); } .band.lo { background: var(--bad-soft); color: var(--bad); } .band.mid { background: var(--warn-soft); color: var(--warn); }
.band.none { background: transparent; color: var(--muted); font-weight: 400; }
.band.est { outline: 1px dashed currentColor; outline-offset: -1px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.chip { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.on { background: var(--good-soft); color: var(--good); } .pill.idle { background: var(--warn-soft); color: var(--warn); } .pill.off { background: var(--sunk); color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); padding: 10px 16px; }

/* ------------------------------------------------------ add + code ticket -- */
.add { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.add label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.add input, .add select { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.ticket { margin-top: 12px; display: grid; gap: 8px; justify-items: start; border: 1.5px dashed var(--accent); border-radius: 12px; padding: 14px 16px; background: var(--accent-soft); }
.ticket .code { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: .08em; color: var(--ink); user-select: all; }
.ticket .who { font-size: 13px; }
.ticket .warn { font-size: 12.5px; color: var(--ink-2); }

/* -------------------------------------------------------------- drawer ---- */
.scrim { position: fixed; inset: 0; background: rgba(12,16,20,.35); z-index: 10; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--surface); z-index: 11;
          border-left: 1px solid var(--line); box-shadow: var(--shadow); display: grid; grid-template-rows: auto 1fr;
          padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer > header { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer > .content { overflow-y: auto; padding: 16px 18px; display: grid; gap: 18px; align-content: start; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.hist { display: grid; gap: 6px; }
.hist .h { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 7px 10px; border-radius: 8px; background: var(--sunk); }
.spot { display: grid; gap: 2px; padding: 8px 10px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 8px 8px 0; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; padding: 10px; border-radius: 8px; background: var(--bad-soft); }

/* ---------------------------------------------------------- login / misc -- */
.login { max-width: 380px; margin: 12vh auto 0; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.login h1 { font-family: var(--display); font-size: 20px; font-weight: 600; }
.login input { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; width: 100%; }
.err { color: var(--bad); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--ground);
         padding: 9px 14px; border-radius: 8px; font-size: 13px; z-index: 20; }
details.audit summary { cursor: pointer; padding: 14px 16px; font-weight: 600; }
details.audit .body { padding: 0 16px 14px; display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.limitform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.limitform input { width: 90px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 6px 8px; }

@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .brand h1 { font-size: 18px; }
  .who { width: 100%; justify-content: space-between; }
  .stat .value { font-size: 22px; }
  .search { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: slide .18s ease-out; }
  @keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.goal { white-space: nowrap; }
.goal .course { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--muted, #6b6b76); }
.goalbox { display: grid; gap: 8px; }
.goalbox h3 { font-size: 13px; }
.goalline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.goalform { display: grid; gap: 10px; }
.goalform .grow { display: flex; gap: 10px; }
.goalform .grow[hidden] { display: none; }
.goalform label { flex: 1; display: grid; gap: 4px; font-size: 12px; }
.goalform .err:empty { display: none; }
.goalform select { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 10px; }
.goalform .seg { justify-self: start; }
.goal .pending { font-size: 11px; color: #a05a00; white-space: nowrap; }
.goalline .actions { display: flex; gap: 6px; }
.add .pair { display: flex; align-items: center; gap: 6px; }
.add label[hidden] { display: none; }
.teacherpick { display: grid; gap: 4px; font-size: 12px; }
.teacherpick select, .add .pair select { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .goal .pending { color: #e0a24a; } }
:root[data-theme="dark"] .goal .pending { color: #e0a24a; }
.report .summary { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.unverified { color: #a05a00; font-size: 12px; }

/* ------------------------------------------------------------ course pages -- */
/* Each course is a page: the navigation on top stays in view while its table and report scroll. */
.pages { display: grid; gap: 20px; }
.pages > *, .coursenav .tabs { min-width: 0; }
.coursenav { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px;
             padding: 8px 0; background: var(--ground); }
.coursenav .tabs { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.coursenav .tabs::-webkit-scrollbar { display: none; }
.coursenav [role="tab"] { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface);
                          color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font-weight: 500; white-space: nowrap; }
.coursenav [role="tab"]:hover { border-color: var(--ink-2); }
.coursenav [role="tab"][aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.coursenav .count { min-width: 22px; padding: 0 6px; border-radius: 999px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums;
                    background: color-mix(in srgb, currentColor 14%, transparent); }
.coursenav .sep { flex: none; width: 1px; height: 22px; margin: 0 4px; background: var(--line-strong); }
.coursenav .flip { flex: none; display: flex; gap: 6px; }
.coursenav .flip .btn { width: 34px; padding: 4px 0; font-size: 17px; line-height: 1.2; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
.words { display: inline-grid; justify-items: end; gap: 4px; }
.minibar { display: block; width: 64px; height: 4px; border-radius: 2px; background: var(--sunk); overflow: hidden; }
.minibar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 560px) { .coursenav .flip { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .pages.flipped > .panel { animation: pagein .18s ease-out; }
  @keyframes pagein { from { opacity: .35; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
.ticket .course-line { font-size: 13px; }
.nocourse { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
            border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.nocourse .linkbtn { color: inherit; font-weight: 600; }
.teachersel { border:1px solid var(--line-strong); background:var(--surface); border-radius:6px; padding:3px 6px; font-size:12.5px; max-width:180px; }

/* ---------------------------------------------------- sentence of the day -- */
.sentences .body { display:grid; gap:12px; }
.senttoday { border-radius:12px; padding:12px 16px; color:#fff; background:linear-gradient(135deg,#8e1f16,#c0392b); }
.senttoday .cap { font-size:12px; opacity:.8; margin-bottom:4px; }
.senttoday .zh { font-size:26px; font-weight:700; line-height:1.25; } .senttoday .py { color:#ffe8d6; } .senttoday .ru { opacity:.92; }
.sentform { display:flex; flex-wrap:wrap; gap:8px; align-items:end; }
.sentform label { display:grid; gap:4px; font-size:12px; color:var(--muted); flex:1 1 180px; }
.sentform input, .sentlink { border:1px solid var(--line-strong); background:var(--surface); border-radius:8px; padding:7px 10px; min-width:0; }
.sentlist { margin:0; padding-left:22px; display:grid; gap:6px; }
.sentlist li { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
.sentlist .zh { font-size:17px; font-weight:600; } .sentlist .py { color:var(--ink-2); } .sentlist .ru { color:var(--muted); }
.sentlist .btn { margin-left:auto; }
.sentshare { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.sentlink { flex:1 1 280px; font-family:var(--mono); font-size:12.5px; }

/* --------------------------------------------------------------- homework -- */
.homework .body { display:grid; gap:12px; }
.hwform { display:flex; flex-wrap:wrap; gap:8px; align-items:end; }
.hwform label { display:grid; gap:4px; font-size:12px; color:var(--muted); }
.hwform label.wide { flex:1 1 100%; }
.hwform textarea, .hwform input, .hwform select { border:1px solid var(--line-strong); background:var(--surface); border-radius:8px; padding:7px 10px; font:inherit; min-width:0; }
.hwform textarea { resize:vertical; }
.hwlist { display:grid; gap:8px; }
.hw { border:1px solid var(--line); border-radius:10px; padding:9px 12px; display:grid; gap:4px; }
.hw.past { opacity:.7; }
.hwhead { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; font-size:13px; }
.hwhead .btn { margin-left:auto; }
.hwcount { display:inline-flex; align-items:center; gap:8px; }
.hwtext { white-space:pre-wrap; }
.hwwho { font-size:12.5px; }

/* ---------------------------------------------------------- parent report -- */
.reportbox { display:grid; gap:8px; }
.reportbox h3 { font-size:13px; }
.reporttext { width:100%; font:12.5px/1.45 var(--sans); color:var(--ink); background:var(--surface); border:1px solid var(--line-strong); border-radius:8px; padding:8px 10px; resize:vertical; }
.parentsline { font-size:12.5px; }

/* the week's reports for everyone */
.weekly { display: grid; gap: 12px; }
.weeklyrow { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.weeklyrow .check { display: flex; align-items: center; gap: 6px; font-weight: 600; }

/* the journal (01.10) */
.groupsel { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 6px 10px; max-width: 100%; }
.jtools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.jtools input[type=date] { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 4px 8px; }
.jtable { min-width: 0; width: auto; }
.jtable .jname { position: sticky; left: 0; background: var(--surface); z-index: 1; white-space: nowrap; min-width: 150px; font-weight: 600; }
.jtable th.jday { text-align: center; white-space: nowrap; padding: 8px 6px; }
.jtable th.jday.today, .jtable td.today { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.jdaytools { display: flex; gap: 6px; justify-content: center; font-weight: 400; }
.jtable td.jcell { padding: 6px 4px; text-align: center; }
.jbox { display: inline-flex; gap: 2px; align-items: center; }
.jbox button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; min-width: 26px; height: 26px; padding: 0 4px; font: 600 13px var(--sans); color: var(--muted); cursor: pointer; }
.jbox button:disabled { cursor: default; opacity: 1; }
.jbox .on { background: var(--good-soft); color: var(--good); border-color: transparent; }
.jbox .off { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.jbox .jc { font-size: 11px; opacity: .35; border-color: transparent; min-width: 22px; }
.jbox .jc.has { opacity: 1; background: var(--warn-soft); }
.groups { display: grid; gap: 10px; margin-top: 12px; }
.grouprow { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.grouprow .ghead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grouprow .ghead select, .gmembers select { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; }
.gmembers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 560px) { .jbox button { min-width: 32px; height: 32px; } .jbox .jc { min-width: 26px; } .jtable .jname { min-width: 120px; } }

/* groups as shelves on a course page (04.10) */
.shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.shelf { display: grid; gap: 6px; align-content: start; text-align: left; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.shelf:hover, button.shelf:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
.shelf .sname { font-weight: 700; font-size: 16px; }
.shelf .sstats { display: flex; gap: 14px; }
.shelf .sweek { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.shelf .sweek .minibar { width: 100%; }
.shelf .sopen { color: var(--accent); font-weight: 600; font-size: 13px; margin-top: 2px; }
.shelf.loose { border-style: dashed; }
.shelf.newgroup { cursor: default; border-style: dashed; background: transparent; }
.shelf.newgroup input, .shelf.newgroup select { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 6px 8px; font: inherit; }
.groupcard header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.groupcard .gtitle { display: grid; gap: 2px; flex: 1 1 220px; }
.groupcard .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.groupcard .teacherpick select { margin-left: 6px; }
.btn.back { white-space: nowrap; }
.addtogroup { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.addtogroup select { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 6px 8px; }
.issue { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.issue h3 { font-size: 14px; margin: 0 0 8px; }
.shelves { margin-top: 0; }
.themebtn { font-size: 15px; line-height: 1; padding: 6px 9px; }
.login { position: relative; }
.login .themebtn { position: absolute; top: 12px; right: 12px; }

/* lesson words for the characters game (08.10) */
.lessonwords .body { display:grid; gap:12px; }
.lw-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.lw-head { display:flex; flex-wrap:wrap; gap:8px; }
.lw-head label { display:grid; gap:4px; font-size:12px; color:var(--muted); flex:1 1 200px; }
.lw-head input, .lw-head select, .lw-table input { border:1px solid var(--line-strong); background:var(--surface); color:inherit; border-radius:8px; padding:7px 10px; min-width:0; width:100%; font:inherit; }
.lw-table { width:100%; border-collapse:collapse; }
.lw-table th { text-align:left; font-size:12px; color:var(--muted); font-weight:600; padding:4px; }
.lw-table td { padding:3px 4px; }
.lw-table td.zh input { font-size:18px; width:7em; }
.lw-hsk { font-size:11px; color:var(--muted); white-space:nowrap; }
.lw-notify { display:flex; gap:8px; align-items:center; font-size:14px; }
.lw-busy { font-weight:600; }
.lw-list { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.lw-list li { border:1px solid var(--line); border-radius:10px; padding:10px 12px; display:grid; gap:6px; }
.lw-list .zh { font-size:17px; letter-spacing:2px; }
@media (max-width:640px) { .lw-table th:nth-child(4), .lw-table td:nth-child(4) { display:none; } .lw-table td.zh input { width:5em; } }

/* ------------------------------------------------------ the students' base --- */
.dbtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dbsel { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0; max-width: 100%; }
.dbcourses { display: inline-flex; flex-direction: column; gap: 2px; }

/* the director's report (29.10): a sheet over the panel, printed alone */
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.print-sheet { position: fixed; inset: 0; z-index: 50; overflow: auto; background: var(--ground); padding: 16px; }
.ps-tools { max-width: 820px; margin: 0 auto 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ps-page { max-width: 820px; margin: 0 auto; background: #fff; color: #1b2230; padding: 36px 40px; border-radius: 10px; box-shadow: var(--shadow); display: grid; gap: 22px; }
.ps-page h1 { font: 700 22px/1.25 var(--display); }
.ps-page h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: #4a5552; margin-bottom: 8px; }
.ps-head { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid var(--accent); padding-bottom: 14px; }
.ps-head img { width: 56px; height: 56px; object-fit: contain; }
.ps-head p { margin: 4px 0 0; color: #6d7773; }
.ps-bigs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ps-big { background: #f4f5f1; border-radius: 8px; padding: 12px; display: grid; gap: 2px; }
.ps-big b { font: 700 22px/1.2 var(--display); color: var(--accent); }
.ps-big small { color: #6d7773; }
.ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ps-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eceee8; padding: 3px 0; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ps-table th, .ps-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #eceee8; }
.ps-table th { color: #6d7773; font-weight: 600; }
.ps-chart { width: 100%; height: 150px; display: block; }
.ps-bar { fill: var(--accent); } .ps-axis { font-size: 10px; fill: #6d7773; }
.ps-notes { min-height: 90px; border: 1px dashed #c6cbc1; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }
.ps-foot { color: #6d7773; font-size: 12px; }
@media (max-width: 640px) { .ps-page { padding: 20px 16px; } .ps-bigs { grid-template-columns: 1fr 1fr; } .ps-cols { grid-template-columns: 1fr; } }
@media print {
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { position: static; padding: 0; background: #fff; overflow: visible; }
  .ps-tools { display: none; }
  .ps-page { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .ps-notes { border-color: transparent; outline: none !important; padding: 0; }
  .ps-big { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
