:root {
  --header-a: #0090d0;
  --header-b: #38b048;
  --menu: #0090d0;
  --menu-deep: #0077b3;
  --title: #0077a8;
  --ink: #241c14;
  --muted: #6f655b;
  --label: #6f655b;
  --paper: #ffffff;
  --canvas: #ffffff;
  --sidebar: #ffffff;
  --line: #e3d5c4;
  --panel: #ffffff;
  --panel-line: #e3d5c4;
  --row-line: #efe4d4;
  --yellow: #f8f1e2;
  --yellow-line: #e7d3ae;
  --blue: #0090d0;
  --rose: #8d2d2d;
  --rose-soft: #f8ecec;
  --teal: #17382c;
  --teal-dark: #10261d;
  --teal-soft: #e7f0ea;
  --navy: #0090d0;
  --gold: #38b048;
  --gold-soft: #f3eadb;
  --blue-soft: #e7f0ea;
  --frame: 1200px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--title); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--menu-deep);
  color: white;
  padding: 8px 12px;
  z-index: 30;
}
.skip:focus { top: 12px; }
.loading { padding: 48px 20px; color: var(--muted); }

.top {
  position: relative;
  overflow: hidden;
  color: #243038;
  background: #ffffff;
}
.top::after {
  content: none;
}
.bar, .menubar { position: relative; z-index: 1; }
.bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #243038; }
.logo {
  height: 52px;
  width: auto;
  max-width: min(420px, 62vw);
  display: block;
  object-fit: contain;
  background: transparent;
}
.eyebrow { margin: 0; color: #6d7380; font-size: 11px; letter-spacing: 0.08em; }
h1, h2, h3 { font-family: inherit; letter-spacing: 0; }
h1 { margin: 0; font-size: 18px; line-height: 1.2; font-weight: 650; color: #243038; }
h2 { margin: 0 0 12px; font-size: 22px; font-weight: 500; color: var(--title); }
h3 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink); }
.util { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.util time { color: #5c6570; font-variant-numeric: tabular-nums; }
.meta-col, .meta-col time { color: #8aa0b0; font-variant-numeric: tabular-nums; }
.meta-col {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin: 0 0 10px;
  text-align: right;
  color: #8aa0b0;
  font-size: 13px;
  line-height: 1.45;
}
.meta-col time { color: #8aa0b0; }
.menubar {
  display: flex;
  gap: 4px;
  min-height: 40px;
  align-items: stretch;
  padding: 0 10px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(100deg, #0077b3 0%, #0090d0 46%, #38b048 100%);
  background-size: 240% 100%;
  animation: flow 16s linear infinite;
}
.menubar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.28) 48%, transparent 66%);
  background-size: 220% 100%;
  animation: sheen 7s ease-in-out infinite;
}
.menubar a, .menubar span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  color: white;
  text-decoration: none;
  padding: 0 16px;
  font-weight: 650;
}
.menubar a[aria-current="page"], .menubar a:hover { background: rgba(0, 0, 0, 0.12); }

.bar, .menubar { padding-inline: max(14px, calc((100% - var(--frame)) / 2)); }
.workspace {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  width: min(var(--frame), 100%);
  margin: 0 auto;
  min-height: calc(100vh - 98px);
}
.workspace.solo { grid-template-columns: minmax(0, 1fr); }
.side-group { display: block; margin: 12px 16px 4px; color: #a3b0ba; font-size: 12px; font-weight: 650; }
.sidenav {
  background: #ffffff;
  border-right: 1px solid #e6e9ed;
  padding: 14px 0 24px;
  border-radius: 0;
  box-shadow: none;
}
.side-title {
  margin: 0 16px 8px;
  color: #8b97a1;
  font-size: 13px;
}
.sidenav nav { display: grid; }
.sidenav a {
  display: block;
  padding: 9px 14px 9px 16px;
  border-left: 3px solid transparent;
  border-radius: 0;
  text-decoration: none;
  color: #60788c;
  font-weight: 500;
  background: transparent;
}
.sidenav a[aria-current="page"] {
  border-left-color: var(--gold);
  color: var(--navy);
  background: #ffffff;
}
.page {
  position: relative;
  width: auto;
  margin: 0;
  padding: 16px 28px 56px;
  background: var(--canvas);
}
.stage { animation: rise 0.45s ease both; }
.lead { margin-top: 0; color: var(--muted); }

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e6ebf0;
  margin: 0 0 16px;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
  padding: 0;
}
.tabs a {
  position: relative;
  text-decoration: none;
  color: #8b97a3;
  font-weight: 650;
  padding: 8px 12px 10px;
  border-radius: 0;
}
.tabs a[aria-current="page"] { color: var(--blue); background: transparent; }
.tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 3px;
  background: var(--gold);
  transform-origin: left;
  animation: underline 0.35s ease;
}

.card, .lesson, .modal, .sheet, .banner, .phone, .teacher-fold, .stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: none;
}
.card, .lesson, .modal { padding: 16px 18px; }
.stack { display: grid; gap: 10px; }
:is(.card, .sheet, .stats, .stack) + :is(.card, .sheet, .stack) { margin-top: 14px; }
.grid { display: grid; gap: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat {
  min-width: 128px;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf3, #f3eadb);
  border: 1px solid var(--panel-line);
  animation: fade 0.5s ease both;
}
.stat:nth-child(2) { animation-delay: 0.05s; }
.stat:nth-child(3) { animation-delay: 0.1s; }
.stat:nth-child(4) { animation-delay: 0.15s; }
.stat:nth-child(5) { animation-delay: 0.2s; }
.stat b { display: block; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat.clay, .stat:last-child { background: linear-gradient(180deg, #fffdf6, #ffe9a8); border-color: var(--yellow-line); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.month-head { flex-wrap: wrap; }
.month-head h2 { margin: 0; }
.branch-pick { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.branch-pick span { color: var(--label); font-size: 14px; white-space: nowrap; }
.branch-pick select { width: auto; min-width: 140px; max-width: 220px; }
.form-grid, .form-grid.two { display: block; }
form.stack, form.form-grid, form.edit-form, .login-card form {
  background: linear-gradient(180deg, #f8fcff, #eef6fc);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 8px;
}
.field {
  display: grid;
  grid-template-columns: 148px minmax(180px, 420px);
  gap: 14px;
  align-items: center;
  margin: 0;
  padding: 11px 16px;
  border-bottom: 1px solid var(--row-line);
  font-weight: 500;
  background: transparent;
}
.field span { font-size: 14px; color: var(--label); text-align: right; font-weight: 500; }
.field[hidden] { display: none; }
input, select, textarea {
  width: 100%;
  max-width: 360px;
  height: 36px;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid #d9d3c6;
  background: white;
}
textarea { height: auto; min-height: 76px; max-width: 520px; padding: 8px 10px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #b0bec8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0, 144, 208, 0.28);
}
.checks { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.checks label { display: flex; gap: 8px; align-items: center; }
.checks input { width: auto; max-width: none; height: auto; }
.form-actions { padding: 12px 16px 14px 178px; }
form.stack > button,
form.form-grid > button,
form.edit-form > button,
.form-actions > button {
  width: auto;
  justify-self: start;
  margin: 12px 16px 14px 178px;
}
.help, .muted { color: var(--muted); }
.card > .help, form .help { padding: 0 16px 10px 178px; margin: 0; }

.btn, button, .textlink.button {
  border: 1px solid #d9d3c6;
  border-radius: 12px;
  padding: 6px 14px;
  background: white;
  color: #4d6272;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
button.primary, a.primary, .primary {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
  transition: background 0.2s ease;
}
button.primary:hover, a.primary:hover { background: #0077b3; }
button.danger { background: white; border-color: #f0c9d0; color: var(--rose); }
button.danger:hover { background: var(--rose-soft); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
#logout {
  background: transparent;
  color: #243038;
  border: 1px solid #cfd6dc;
  border-radius: 14px;
  padding: 3px 12px;
  white-space: nowrap;
}
#logout:hover { background: #f3f7fa; }

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  border-bottom: 1px solid #e6ebf0;
  margin: 4px 0 12px;
}
.step {
  display: inline-flex;
  gap: 8px;
  padding: 8px 2px 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #8b97a3;
  text-decoration: none;
  font-weight: 650;
}
.step::before { content: none; }
.step.done {
  color: var(--navy);
  border-bottom: 3px solid var(--gold);
  background: transparent;
}
.lesson {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--row-line);
  border-left: 3px solid #f0d78a;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.stack:has(> .lesson), .stack:has(.group-title) {
  gap: 0;
}
.lesson.submitted { border-left-color: #7eb7e6; }
.lesson.approved { border-left-color: #3dbe8b; }
.lesson.rejected { border-left-color: var(--rose); }
.lesson.cancelled { border-left-color: #d5dee6; opacity: 0.75; }
.when { margin: 0; color: var(--muted); }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 650;
  background: var(--yellow);
  color: #8a6a16;
}
.pill.submitted { background: #e7f3fb; color: #1d6fa8; }
.pill.approved { background: #e5f8ef; color: #1d8a52; }
.pill.rejected { background: var(--rose-soft); color: var(--rose); }
.pill.cancelled { background: #eef2f5; color: var(--muted); }
.note { margin: 0; padding: 8px 10px; background: var(--rose-soft); color: var(--rose); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 34px; height: 34px; padding: 0; font-size: 18px; }
.count {
  width: 72px;
  max-width: 72px;
  height: 34px;
  text-align: center;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.money { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.submitbar {
  position: sticky;
  bottom: 8px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  box-shadow: 0 -8px 18px rgba(7, 29, 73, 0.08);
}
.banner { padding: 10px 12px; margin: 0 0 12px; }
.banner.bad { background: var(--rose-soft); color: var(--rose); border-color: #f3d0d6; }
.banner.good { background: #e7f6fb; color: #14627a; border-color: #c5e4f0; }
.teacher-fold {
  margin-top: 10px;
  border: 1px solid var(--panel-line);
  background: white;
  border-radius: 16px;
  overflow: hidden;
  animation: rise 0.4s ease both;
}
.teacher-fold summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  list-style: none;
  color: var(--ink);
}
.teacher-fold summary::-webkit-details-marker { display: none; }
.teacher-fold summary .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.teacher-fold summary .who .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--title);
  border-bottom: 2px solid var(--title);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex: none;
}
.teacher-fold[open] .chev { transform: rotate(45deg); }
.teacher-fold[open] .fold-body { animation: rise 0.28s ease; }
.fold-body { padding: 0 14px 12px; }
.course-block { margin-top: 6px; }
.course-block h3 { margin: 8px 0 4px; font-size: 15px; color: var(--title); }
table.roster { width: 100%; border-collapse: collapse; }
table.roster th, table.roster td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--row-line);
  text-align: left;
  vertical-align: middle;
}
table.roster th { font-size: 12px; color: var(--label); font-weight: 650; }
table.roster tr:last-child td { border-bottom: 0; }
table.roster .roster-note td {
  padding-top: 0;
  color: var(--rose);
  font-size: 13px;
  border-bottom: 1px solid var(--row-line);
}
.group-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin: 14px 0 0;
  padding: 8px 2px;
}
.group-title h3 { color: var(--label); font-size: 13px; font-weight: 650; }
.record { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--row-line); }
.record-actions { flex: none; flex-wrap: nowrap; justify-content: flex-end; }
.edit-form { margin-top: 8px; }
details { border-top: 0; padding-top: 0; }
summary { cursor: pointer; font-weight: 650; color: var(--title); }
.phone { overflow: hidden; width: min(100%, 320px); border-color: var(--panel-line); }
.phone-head { background: linear-gradient(90deg, var(--header-a), var(--header-b)); color: white; padding: 14px; }
.phone-head p { margin: 0; color: rgba(255, 255, 255, 0.85); font-size: 12px; }
.phone-head h3 { color: white; }
.phone-body { padding: 14px; display: grid; gap: 8px; background: var(--panel); }
.phone-body ol { margin: 0; padding-left: 18px; }
.sheet { padding: 22px; max-width: 920px; }
.sheet-top { display: flex; justify-content: space-between; gap: 16px; align-items: start; border-bottom: 2px solid var(--title); padding-bottom: 10px; }
.sheet h2 { color: var(--title); }
.sheet table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.sheet th, .sheet td { padding: 9px 6px; border-bottom: 1px solid var(--row-line); text-align: left; vertical-align: top; }
.sheet th { font-size: 13px; color: var(--label); font-weight: 650; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.total { font-size: 26px; color: var(--title); }
.modal {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  z-index: 20;
  border-color: var(--panel-line);
  background: white;
}
.table-wrap { overflow-x: auto; }
table.log { width: 100%; }
.webhook {
  margin: 8px 16px;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: white;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  padding: 8px 10px;
}
table.log { border-collapse: collapse; }
table.log th, table.log td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--row-line);
  vertical-align: top;
}
.login-wrap { width: min(640px, calc(100% - 32px)); margin: 28px auto 48px; }
.login-card h2 { margin-bottom: 8px; }
.login-card > .btn, .login-card > .help, .login-card > .banner, .login-card > .webhook { margin-left: 16px; margin-right: 16px; }
.card { background: white; border: 1px solid var(--panel-line); border-radius: 16px; animation: rise 0.4s ease both; }
[hidden] { display: none !important; }

.intro { margin: 0; max-width: 680px; }
.pay-item { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--row-line); }
.pay-item p { margin: 2px 0 0; }
.rate-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.rate-form label { display: grid; gap: 4px; font-size: 13px; color: var(--label); }
.rate-form input { width: 160px; font-size: 16px; }
.rate-form select { width: 240px; }
.check { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 14px; color: var(--label); }
.check input { width: auto; max-width: none; height: auto; }
.tier-form { padding: 14px 16px; gap: 10px; }
.tier-form .field { padding: 0; grid-template-columns: 96px minmax(180px, 360px); }
.tier-form > .row { padding: 0; }
.tier-list { display: grid; gap: 8px; }
.tier-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.tier-row label { display: grid; gap: 4px; font-size: 13px; color: var(--label); }
.tier-row input { width: 130px; }
.tier-from { min-width: 130px; padding-bottom: 10px; font-size: 13px; color: var(--label); }
.tier-form .check { padding: 0; }
.slip-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.slip-lines li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.slip-lines li > span:first-child { display: grid; gap: 2px; }
.slip-lines small { color: var(--muted); font-size: 12px; }
.slip-lines b, .slip-total b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.slip-lines b.minus { color: var(--rose); }
.slip-end { display: flex; align-items: center; gap: 10px; }
.slip-total { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--row-line); font-weight: 700; }
.slip-total b { color: var(--blue); font-size: 18px; }
.link-button { padding: 2px 8px; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; min-height: 0; }
.link-button:hover { color: var(--rose); background: none; }
.app-rows.slip { display: grid; gap: 8px; padding: 14px; }
.app-rows.slip p { margin: 0; font-size: 13px; }
#adjust-form .check { grid-column: 1 / -1; }
.notice-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.notice-card p { margin: 0; }
.flex-lines { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.flex-lines li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.flex-lines li span { display: grid; gap: 2px; }
.flex-lines small { color: var(--muted); }
.flex-lines b, .flex-total b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.flex-total { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--row-line); font-weight: 650; }
.flex-total b { color: var(--blue); font-size: 18px; }
.flex-button { display: block; text-align: center; padding: 8px; border-radius: 10px; background: var(--blue); color: white; font-weight: 650; font-size: 14px; }

.app { min-height: 100vh; background: #f5f9fc; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.app-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: white;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #0077b3, #0090d0 46%, #38b048) 1;
}
.app-logo { height: 34px; width: auto; max-width: 58vw; display: block; }
.app-who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.app-main.page { max-width: 560px; margin: 0 auto; padding: 14px 14px 24px; }
.app-month { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.app-month strong { font-size: 18px; color: var(--title); }
.app-month a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: white;
  color: var(--title);
  font-size: 22px;
  text-decoration: none;
}
.app-hero {
  padding: 16px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(120deg, #0077b3, #0090d0 55%, #38b048);
  background-size: 200% 100%;
  animation: rise 0.4s ease both, flow 14s linear infinite alternate;
}
.app-hero h1 { margin: 0 0 4px; font-size: 21px; font-weight: 700; color: white; }
.app-hero p { margin: 0; color: rgba(255, 255, 255, 0.92); font-size: 14px; }
.app-hero .row { margin-top: 12px; }
.app-chip {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f5f8a;
  font-weight: 650;
  font-size: 13px;
  text-decoration: none;
}
.app-h { margin: 22px 2px 10px; font-size: 15px; font-weight: 700; color: #3d4a55; }
.app-list { display: grid; gap: 12px; }
.app-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: white;
  border: 1px solid #dde7ee;
  border-left: 4px solid #f0c24b;
  border-radius: 16px;
  animation: rise 0.35s ease both;
}
.app-card.rejected { border-left-color: var(--rose); }
.app-where { margin: 0; color: #3d4a55; }
.app-note { margin: 2px 0; padding: 8px 10px; border-radius: 10px; background: var(--rose-soft); color: var(--rose); font-size: 14px; }
.app-count { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }
.app-count > span { color: var(--label); font-size: 14px; }
.app-count .stepper button { width: 46px; height: 46px; border-radius: 999px; font-size: 22px; }
.app-count .count { width: 76px; max-width: 76px; height: 46px; font-size: 22px; }
.app-rows { background: white; border: 1px solid #dde7ee; border-radius: 16px; padding: 0 14px; }
.app-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--row-line); }
.app-row:first-child { border-top: 0; }
.app-row p { margin: 2px 0 0; font-size: 13px; }
.app-row-end { display: grid; justify-items: end; gap: 4px; font-size: 14px; white-space: nowrap; }
.app-submit {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid #dde7ee;
}
.app-submit button { min-height: 46px; padding: 0 22px; font-size: 16px; border-radius: 999px; }
.app-back { display: inline-block; margin-bottom: 12px; color: var(--title); font-weight: 650; text-decoration: none; }
.app .sheet { padding: 16px; }

.spread.wrap { flex-wrap: wrap; align-items: flex-end; }
.spread.wrap p { margin: 2px 0 0; }
.banner.warn { background: #fff7e6; color: #8a5a00; border-color: #f1d9a6; }
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fcff, #eef6fc);
  border: 1px solid #dbe9f3;
}
.inline-form label { display: grid; gap: 4px; font-size: 12px; color: var(--label); }
.inline-form input, .inline-form select { width: auto; min-width: 0; }
.inline-form input[type="time"] { width: 118px; }
.inline-form select[name="weekday"] { width: 92px; }
.inline-form select[name="teacher_id"] { width: 150px; }
.inline-form input[name="name"] { width: 200px; }
.inline-form > button { height: 36px; }
.inline-title { align-self: center; color: var(--title); font-size: 13px; }
.inline-form .inline-check { display: flex; align-items: center; gap: 6px; height: 36px; font-size: 13px; }
.inline-check input { width: auto; height: auto; }
.day-hint {
  flex-basis: 100%;
  margin: 0;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #dbe9f3;
  background: #f6f9fb;
  color: #60788c;
  font-size: 13px;
  animation: fade 0.25s ease;
}
.day-hint.clash { border-color: #f3c2b8; background: linear-gradient(90deg, #fdeae6, #fff5f2); color: #a8321e; }
.day-hint.clash::before { content: "注意："; font-weight: 700; }
form.edit-form .day-hint { margin: 10px 16px 0 178px; }

.branch-list { display: grid; gap: 12px; }
.branch-fold {
  border: 1px solid #dbe6ee;
  border-radius: 16px;
  background: white;
  overflow: hidden;
  animation: rise 0.4s ease both;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.branch-fold:hover { border-color: #bcd8ea; }
.branch-fold[open] { border-color: #b9d9ec; box-shadow: 0 10px 28px rgba(0, 119, 179, 0.09); }
.branch-fold.off { opacity: 0.72; }
.branch-fold > summary {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  list-style: none;
  background: linear-gradient(90deg, rgba(0, 144, 208, 0.07), rgba(56, 176, 72, 0.05));
}
.branch-fold > summary::-webkit-details-marker { display: none; }
.branch-fold > summary .who { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 16px; }
.branch-fold[open] > summary .chev { transform: rotate(45deg); }
.branch-fold > .fold-body { display: grid; gap: 14px; padding: 14px 16px 16px; }
.branch-fold[open] > .fold-body { animation: rise 0.28s ease; }
.branch-count { white-space: nowrap; font-size: 13px; font-weight: 500; }
.day-strip { display: flex; gap: 4px; }
.day-dot {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f1f5f8;
  color: #a3b0ba;
  font-size: 12px;
  font-weight: 650;
}
.day-dot.on { color: white; background: linear-gradient(135deg, #0090d0, #38b048); }
.day-dot.busy { color: white; background: linear-gradient(135deg, #f0a020, #e46a2c); box-shadow: 0 0 0 3px rgba(240, 160, 32, 0.2); }
.week-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-col {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 74px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #e6eef3;
  background: #f6f9fb;
}
.week-col.shared { border-color: #f1d9a6; background: linear-gradient(180deg, #fff8ea, #fff1d6); }
.week-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #60788c; }
.week-head span { padding: 0 6px; border-radius: 999px; background: #f0a020; color: white; font-size: 11px; white-space: nowrap; }
.week-chip {
  display: grid;
  gap: 1px;
  padding: 5px 7px;
  border-radius: 9px;
  border-left: 3px solid var(--blue);
  background: white;
  font-size: 12px;
  line-height: 1.3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  animation: fade 0.4s ease both;
}
.week-col.shared .week-chip { border-left-color: #f0a020; }
.week-chip b { color: var(--title); font-variant-numeric: tabular-nums; }
.week-chip span { color: var(--ink); overflow-wrap: anywhere; }
.week-chip small { color: var(--muted); }
.week-none { padding-top: 8px; text-align: center; color: #c3ccd3; font-size: 12px; }
.course-list { display: grid; gap: 10px; }
.course-card {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e3ecf2;
  border-left: 4px solid var(--blue);
  border-radius: 14px;
  background: white;
  animation: rise 0.35s ease both;
}
.course-card.off { border-left-color: #ccd6de; opacity: 0.75; }
.course-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.course-head h4 { margin: 0; font-size: 15px; color: var(--ink); }
.course-head p { margin: 2px 0 0; font-size: 13px; }
.slot-list { display: grid; gap: 6px; }
.slot-empty { margin: 0; font-size: 13px; }
.slot { border: 1px solid #e6eef3; border-radius: 12px; background: #fbfdfe; transition: border-color 0.2s ease; }
.slot:hover, .slot:has(.slot-body:not([hidden])) { border-color: #bcd8ea; background: white; }
.slot.off { opacity: 0.65; }
.slot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 7px 10px 7px 12px; color: var(--ink); }
.slot-row .record-actions, .lesson-line .record-actions { margin-left: auto; }
.slot-day { padding: 2px 10px; border-radius: 999px; background: linear-gradient(135deg, #0090d0, #38b048); color: white; font-size: 13px; font-weight: 700; }
.slot-time { font-variant-numeric: tabular-nums; font-weight: 650; }
.slot-who { color: var(--muted); }
.slot-warn { padding: 2px 8px; border-radius: 999px; background: #eef2f5; color: #60788c; font-size: 12px; font-weight: 650; }
.slot-warn.clash { background: #fdeae6; color: #a8321e; }
.slot-body { display: grid; gap: 8px; padding: 0 12px 12px; animation: rise 0.25s ease; }
.slot-body .record-actions, .person-body .record-actions { justify-content: flex-start; }
.add-slot { border-style: dashed; }
.edit-panel { animation: rise 0.25s ease; }
.list-filter { margin-top: 4px; }
.list-filter input[type="search"] { width: 180px; }
.list-filter #lesson-count { align-self: center; margin-left: auto; font-size: 13px; }
.lesson-list { display: grid; }
.lesson-record { gap: 8px; }
.lesson-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lock-note { margin-left: auto; font-size: 12px; }
.slip-lines .edit-link { color: var(--title); }
.slip-lines li.adjust-edit { display: block; }
.adjust-edit .inline-form input[name="label"] { width: 160px; }
.adjust-edit .inline-form input[name="amount"] { width: 110px; }
.help-line { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; }
.edit-panel > form.edit-form { margin-top: 0; }
.branch-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--row-line); }
.record-actions button { padding: 4px 12px; font-size: 13px; }
.record-actions button.edit { border-color: #b9d9ec; color: var(--title); }
.record-actions button.edit:hover, .record-actions button.edit[aria-expanded="true"] { background: #e7f3fb; }
.add-course, .add-person {
  padding: 10px 14px;
  border: 1px dashed #b9d9ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #f2f8fc);
}
.add-course[open], .add-person[open] { border-style: solid; }
.add-course > summary, .add-person > summary { color: var(--title); }
.add-course[open] > form, .add-person[open] > form, .add-toggle[open] > form { animation: rise 0.25s ease; }
.add-toggle > summary {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border: 1px dashed #9fcbe6;
  border-radius: 999px;
  background: white;
  color: var(--title);
  font-size: 13px;
  list-style: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.add-toggle > summary::-webkit-details-marker { display: none; }
.add-toggle > summary:hover { border-style: solid; background: #eef7fc; }
.add-toggle[open] > summary { border-style: solid; background: #e7f3fb; }
.add-toggle[open] > form { margin-top: 8px; }
.add-branch { display: grid; justify-items: end; }
.add-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 14px 178px; }
.add-actions > button { margin: 0; }
.form-sub { margin: 0; padding: 12px 16px 6px; border-bottom: 1px solid var(--row-line); color: var(--title); font-weight: 700; }
.field .time-pair { display: flex; gap: 8px; text-align: left; }
.time-pair input { width: 130px; }
.loose { border-color: #f1d9a6; background: linear-gradient(180deg, #fffdf7, #fff7e6); }
.loose-row > strong { align-self: center; min-width: 140px; }
.loose-row .record-actions { margin-left: auto; align-self: center; }

.card.people { display: grid; gap: 14px; }
.role-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.role-chip {
  display: grid;
  justify-items: start;
  padding: 12px 14px;
  border: 1px solid #e0e9ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f3f8fb);
  color: var(--ink);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.role-chip b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.role-chip span { color: var(--label); font-size: 13px; }
.role-chip small { color: var(--muted); font-size: 12px; font-weight: 500; }
.role-chip:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 119, 179, 0.1); }
.role-chip[aria-pressed="true"] {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, #0077b3, #0090d0 55%, #38b048);
  box-shadow: 0 8px 20px rgba(0, 119, 179, 0.22);
}
.role-chip[aria-pressed="true"] span, .role-chip[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.9); }
.people-tools input[type="search"] { max-width: 420px; height: 40px; }
.people-head, .person-row {
  display: grid;
  grid-template-columns: 40px minmax(130px, 1.2fr) 92px minmax(90px, 0.9fr) 96px 120px minmax(220px, auto);
  gap: 12px;
  align-items: center;
}
.people-head { padding: 0 14px; color: var(--label); font-size: 12px; font-weight: 650; }
.people-list { display: grid; gap: 16px; }
.people-group { display: grid; gap: 6px; }
.group-head { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--title); font-size: 13px; }
.group-head span { padding: 0 8px; border-radius: 999px; background: #e7f3fb; color: #1d6fa8; font-size: 12px; }
.person {
  border: 1px solid #e6eef3;
  border-radius: 14px;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.35s ease both;
}
.person:hover { border-color: #bcd8ea; }
.person:has(.person-body:not([hidden])) { border-color: #9fcbe6; box-shadow: 0 10px 26px rgba(0, 119, 179, 0.1); }
.person.off { opacity: 0.65; }
.person-row { padding: 10px 14px; color: var(--ink); }
.person-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 6px; }
.person-actions .record-actions { flex-wrap: nowrap; gap: 6px; }
.person-actions button { white-space: nowrap; flex: none; }
.person-actions > button { padding: 4px 12px; font-size: 13px; }
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #0090d0, #38b048);
  color: white;
  font-weight: 700;
}
.avatar.manager { background: linear-gradient(135deg, #6a5cd8, #0090d0); }
.avatar.accountant { background: linear-gradient(135deg, #e48a2c, #f0b429); }
.avatar.admin { background: linear-gradient(135deg, #243038, #5c7080); }
.person-name { display: grid; min-width: 0; }
.person-name strong, .person-name small, .person-detail, .person-seen { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name strong { display: flex; align-items: center; gap: 6px; }
.person-name small, .person-detail, .person-seen { color: var(--muted); font-size: 13px; }
.me { padding: 0 6px; border-radius: 999px; background: #e7f3fb; color: #1d6fa8; font-size: 11px; font-style: normal; }
.role-tag { justify-self: start; padding: 2px 10px; border-radius: 999px; background: #e5f6ec; color: #1d7a45; font-size: 12px; font-weight: 650; }
.role-tag.manager { background: #ece9fb; color: #4b3fb0; }
.role-tag.accountant { background: #fff1d6; color: #8a5a00; }
.role-tag.admin { background: #e9eef2; color: #3d4a55; }
.line-tag { justify-self: start; display: inline-flex; align-items: center; gap: 6px; color: #8b97a3; font-size: 12px; font-weight: 650; }
.line-tag::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: #c9d3da; }
.line-tag.on { color: #06a54a; }
.line-tag.on::before { background: #06c755; box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.18); }
.person-body { display: grid; gap: 8px; padding: 0 14px 14px; animation: rise 0.25s ease; }
.person-flags { margin: 0; color: #8a5a00; font-size: 13px; }
.person-contact { gap: 10px; font-size: 13px; }
.people-empty { margin: 0; padding: 20px; text-align: center; }

.side-count { float: right; min-width: 22px; padding: 0 7px; border-radius: 999px; background: #fff1d6; color: #8a5a00; font-size: 12px; text-align: center; }
.todo-list { display: grid; }
.todo-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--row-line); }
.todo-item:first-child { border-top: 0; padding-top: 0; }
.todo-item p { margin: 2px 0 0; font-size: 13px; }
.todo-item .record-actions { gap: 6px; }
.invite-card { border-color: #b9d9ec; background: linear-gradient(180deg, #fbfdff, #f2f8fc); }
.invite-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.invite-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: white; border: 1px solid #dbe9f3; font-size: 12px; color: #3d4a55; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.roster-card { display: grid; gap: 10px; align-content: start; }
.roster-card h3 { margin: 0; }
.roster-card p { margin: 2px 0 0; }
.roster-card .chips { gap: 6px; }
.pill.plain { background: #eef2f5; color: #60788c; }
.roster-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.roster-figures div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: #f6f9fb; border: 1px solid #e6eef3; }
.roster-figures div:first-child { grid-column: 1 / -1; }
.roster-figures span { color: var(--muted); font-size: 12px; }
.roster-figures b { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink); }
.roster-card .slot-list { margin: 0; padding-left: 18px; font-size: 13px; color: #3d4a55; gap: 2px; }
.roster-card { min-width: 0; }
.roster-card .field { grid-template-columns: 1fr; gap: 6px; padding: 10px 12px; }
.roster-card .field span { text-align: left; }
.roster-card input { max-width: none; }
.roster-card form.form-grid > button { margin: 10px 12px 12px; }
.charges > summary { list-style: none; }
.charges > summary::-webkit-details-marker { display: none; }
.charges > summary h3 { margin: 0; }
.charges[open] > summary { margin-bottom: 10px; }
.charge-lines li { padding-top: 8px; border-top: 1px solid var(--row-line); font-size: 14px; }
.charge-lines li:first-child { border-top: 0; padding-top: 0; }
.charge-note { margin: 12px 0 0; font-size: 13px; }
.charge-end { display: grid; justify-items: end; gap: 2px; text-align: right; }
.charge-end small { white-space: nowrap; }
.sub-tag { display: block; margin-top: 3px; color: #6a5cd8; font-size: 12px; font-weight: 650; }
.ok-tag { display: block; margin-top: 3px; color: #1d8a52; font-size: 12px; font-weight: 650; }
.slip-total.grand { padding: 10px 14px; border: 1px solid var(--yellow-line); border-radius: 14px; background: linear-gradient(180deg, #fffdf6, #ffe9a8); }
.chip-button { min-height: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid #b9d9ec; background: #eef7fc; color: #0f5f8a; font-size: 13px; font-weight: 650; }
.chip-button:hover { background: #dff0fa; }
.app-quick { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.app-h-row { margin: 22px 2px 10px; }
.app-h-row .app-h { margin: 0; }
.app-panel { display: grid; gap: 10px; margin-top: 18px; padding: 14px 16px; background: white; border: 1px solid #dde7ee; border-radius: 16px; }
.app-panel > summary { display: grid; gap: 2px; list-style: none; }
.app-panel > summary::-webkit-details-marker { display: none; }
.app-panel > summary .muted { font-size: 13px; font-weight: 500; }
.app-panel p { margin: 0; font-size: 14px; }
#slots-form { border-left: 4px solid #f0a020; background: linear-gradient(180deg, #fffdf7, #fff7e6); }
#slots-form .app-h { margin: 0; }
.app-slot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f1e4c4; }
.app-slot span { display: grid; gap: 2px; }
.app-slot small { color: var(--muted); }
.app-slot input { width: 128px; height: 44px; font-size: 17px; }
#slots-form > button { min-height: 46px; border-radius: 999px; }
.app-panel form.stack { margin-top: 4px; }

.banner.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 40;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(7, 29, 73, 0.16);
  transform: translateX(-50%);
}
.banner.good.toast { pointer-events: none; animation: toast 4.5s ease forwards; }
.banner.bad.toast { cursor: pointer; animation: drop 0.3s ease; }
.live-chip {
  position: fixed;
  right: 18px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 40;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #0077b3, #0090d0 55%, #38b048);
  box-shadow: 0 10px 24px rgba(0, 119, 179, 0.3);
  animation: fade 0.3s ease;
}
#app.calm :is(.stage, .card, .stat, .teacher-fold, .branch-fold, .course-card, .person, .week-chip, .app-card, .fold-body, .slot-body, .person-body) { animation: none; }
#app.calm .tabs a::after { animation: none; }
#app.calm .app-hero { animation: flow 14s linear infinite alternate; }

@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  8%, 82% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); visibility: hidden; }
}
@keyframes drop {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes flow {
  from { background-position: 0 0; }
  to { background-position: 240% 0; }
}
@keyframes sheen {
  0%, 60% { background-position: 140% 0; }
  100% { background-position: -40% 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes underline {
  from { transform: scaleX(0.25); }
  to { transform: scaleX(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; }
  .sidenav nav { display: flex; overflow-x: auto; }
  .sidenav a { white-space: nowrap; }
  .meta-col { position: static; text-align: left; margin-bottom: 8px; }
  .field, .form-actions, .card > .help, form .help { grid-template-columns: 1fr; padding-left: 12px; }
  .field span { text-align: left; }
  .form-actions { padding-left: 12px; }
  form.stack > button,
  form.form-grid > button,
  form.edit-form > button,
  .form-actions > button { margin-left: 12px; }
  .page { padding: 14px 12px 40px; }
  .notice-grid { grid-template-columns: 1fr; }
  form.edit-form .day-hint { margin-left: 12px; }
  .add-actions { padding-left: 12px; }
  .add-branch { justify-items: start; }
  .branch-fold > summary { grid-template-columns: 1fr; gap: 8px; }
  .week-board { grid-template-columns: repeat(7, minmax(84px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .course-head { flex-direction: column; }
  .role-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-head { display: none; }
  .person-row { display: flex; flex-wrap: wrap; gap: 6px 10px; }
  .person-actions { flex-basis: 100%; justify-content: flex-start; }
  .person-name { flex: 1 1 140px; }
}
@media (max-width: 720px) {
  .teacher-fold summary { align-items: flex-start; flex-direction: column; }
  table.roster, table.roster tbody, table.roster tr, table.roster td { display: block; }
  table.roster thead { display: none; }
  table.roster tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.roster td { border: 0; padding: 2px 0; text-align: left; }
  table.roster td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; }
  table.roster .roster-note td::before { content: none; }
  .sheet table, .sheet tbody, .sheet tr, .sheet td { display: block; }
  .sheet thead { display: none; }
  .sheet tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .sheet td { border: 0; padding: 2px 0; }
  .sheet td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; }
  .num { text-align: left; }
  .menubar { overflow-x: auto; }
  .todo-item { flex-direction: column; align-items: stretch; }
  .todo-item .record-actions { justify-content: flex-start; flex-wrap: wrap; }
  .invite-row { grid-template-columns: 1fr auto; }
  .invite-row code { grid-column: 1 / -1; grid-row: 2; }
  .roster-grid { grid-template-columns: 1fr; }
}
@media print {
  body, .page { background: white; }
  .top, .sidenav, .noprint, .menubar, #logout, .meta-col, .app-top, .app-submit, .app-back { display: none !important; }
  .app { background: white; padding: 0; }
  .teacher-fold, .teacher-fold .fold-body { display: block !important; }
  .workspace { display: block; }
  .page, .sheet { width: auto; margin: 0; padding: 0; }
  .sheet { border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
