/* Mobile layout stays fluid; wide lesson tables scroll inside their cards. */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --viewport-height: 100vh;
  --keyboard-inset: 0px;
  --page-gap: clamp(12px, 3.8vw, 24px);
}
@supports (height: 100dvh) { :root { --viewport-height: 100dvh; } }
html { min-width: 0; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: only light; }
body { min-width: 0; min-height: 100vh; min-height: 100dvh; background:var(--surface,#fff); }
/* Fullscreen has a separate browser backdrop. Keep its uncovered area light,
   including the region exposed by Harmony's two-finger fullscreen gesture. */
html:fullscreen { background:var(--surface,#fff); }
html::backdrop { background:#fff; }
html:-webkit-full-screen { background:var(--surface,#fff); }
html::-webkit-backdrop { background:#fff; }
#app, #main { min-width: 0; width: 100%; }
.shell {
  --shell-left: max(var(--page-gap), var(--safe-left));
  --shell-right: max(var(--page-gap), var(--safe-right));
  width: 100%;
  padding: max(16px, var(--safe-top)) var(--shell-right)
    calc(var(--nav) + var(--safe-bottom) + 24px) var(--shell-left);
}
.topbar { flex-wrap: wrap; gap: 10px; }
.account-button { max-width: 100%; overflow-wrap: anywhere; }
.welcome-title { gap: 6px 12px; }
.welcome-title strong { font-size: clamp(30px, 9vw, 48px); max-width: 100%; overflow-wrap: anywhere; }
.welcome p, .card, .profile h1, .training-card { overflow-wrap: anywhere; }
.card-title > *, .profile > div:last-child { min-width: 0; }
.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 3vw, 18px); }
.stats .card { padding: clamp(12px, 3.6vw, 24px); }
.stats h2 { font-size: clamp(15px, 4vw, 18px); }
.stats .stat-label { font-size: clamp(12px, 3.5vw, 15px); }
.stats .stat-value { font-size: clamp(21px, 6vw, 28px); }
.action-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.action-tabs button { min-width: 0; min-height: 54px; font-size: clamp(14px, 4vw, 17px); white-space: nowrap; }
.form-grid, .student-filter-columns, .period-range, .training-grid, .balance-ends {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field, .field input, .field select, .field textarea, .time-picker, .time-picker input { min-width: 0; max-width: 100%; }
.field input, .field select, .field textarea { font-size: 16px; }
.radio-row { flex-wrap: wrap; }
.radio-row input { width: 18px; height: 18px; min-height: 18px; padding: 0; flex: none; accent-color: var(--accent); }
.table-scroll { min-width: 0; max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.lesson-card { padding-left: 4px; padding-right: 4px; }
.lesson-card > .card-title, .lesson-card > .backfill-heading,
.lesson-card > .section-subtitle, .lesson-card > .save-line,
.lesson-card > .form-error, .lesson-card > .rule,
.lesson-card > .archive > summary, .lesson-card .archive > .list-row { margin-left: 8px; margin-right: 8px; }
.lesson-card > .primary.wide { width: calc(100% - 16px); margin-left: 8px; margin-right: 8px; }
@media (max-width: 759px) {
  .lesson-card {
    margin-left: calc(max(6px, var(--safe-left)) - max(var(--page-gap), var(--safe-left)));
    margin-right: calc(max(6px, var(--safe-right)) - max(var(--page-gap), var(--safe-right)));
  }
}
.data-table { width: max-content; min-width: 100%; }
.data-table th, .data-table td { min-width: 86px; padding: 9px 8px; text-align: center; vertical-align: middle; }
.data-table .student-col {
  width: clamp(106px, 30vw, 160px); min-width: clamp(106px, 30vw, 160px);
  max-width: clamp(106px, 30vw, 160px); white-space: normal; overflow-wrap: anywhere;
}
.lesson-card.flush-table {
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  margin-left: calc(var(--safe-left) - var(--shell-left));
  margin-right: calc(var(--safe-right) - var(--shell-right));
}
.flush-table .table-scroll { width: 100%; border: 0; border-radius: 0; }
.flush-table .data-table { width: 100%; min-width: 100%; table-layout: auto; }
.flush-table .data-table th, .flush-table .data-table td { min-width: 78px; padding: 8px 6px; }
.flush-table .data-table .student-col {
  width: clamp(100px, 28vw, 145px); min-width: clamp(100px, 28vw, 145px);
  max-width: clamp(100px, 28vw, 145px);
}
.flush-table > .save-line, .flush-table > .archive > summary,
.flush-table .archive > .list-row { margin-left: 12px; margin-right: 12px; }
.student-click { min-height: 44px; }
.cell-input { width: clamp(64px, 18vw, 80px); max-width: 100%; min-height: 38px; font-size: 16px; }
.query-head { padding: 20px 4px; }
.query-block { padding: 0 clamp(3px, 1.5vw, 8px); }
.query-block h2 { font-size: clamp(14px, 4vw, 18px); white-space: normal; overflow-wrap: anywhere; }
.query-block > strong, .query-block > span { max-width: 100%; overflow-wrap: anywhere; }
.filter-choice { padding: 0; font-size: clamp(13px, 3.8vw, 17px); overflow-wrap: anywhere; }
.bill-modes { gap: clamp(6px, 2vw, 8px); }
.bill-mode { min-width: 0; padding: 15px 3px; }
.bill-mode > button { display: block; width: 100%; padding: 0; }
.bill-mode > .time-picker { display: flex; width: 100%; min-height: 22px; justify-content: center; }
.bill-mode strong { font-size: clamp(16px, 4.5vw, 18px); }
.bill-mode .time-picker { font-size: clamp(10px, 2.9vw, 13px); }
.balance-ends { gap: clamp(10px, 3vw, 18px); }
.balance-end strong { font-size: clamp(20px, 5.8vw, 29px); overflow-wrap: anywhere; }
.bill-total { font-size: clamp(20px, 5.8vw, 24px); overflow-wrap: anywhere; }
.plan-row > div { min-width: 0; flex: 1; }
.plan-row > strong { font-size: clamp(20px, 5.8vw, 25px); }
.training-card { min-width: 0; padding: clamp(12px, 3.6vw, 20px); }
.platform-hero { margin-bottom: 18px; }
.platform-section { --platform-inset: clamp(12px, 4vw, 16px); }
.platform-section h2 { padding-left: var(--platform-inset); padding-right: var(--platform-inset); }
.platform-content { padding-left: var(--platform-inset); padding-right: var(--platform-inset); }
.platform-content > .section-subtitle { margin-top: 14px; }
.period-range { gap: clamp(18px, 5vw, 28px); align-items: start; }
.period-range > .field { margin-top: 16px; }
.themes.theme-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.theme-grid .theme-option { min-width: 0; min-height: 66px; flex-direction: column; gap: 9px; padding: 5px 0; }
.theme-grid .theme-option i { width: 30px; height: 30px; flex: none; }
.theme-grid .theme-option span { font-size: 12px; white-space: nowrap; }
.profile > div:last-child { flex: 1; }
.avatar { flex: none; }
.profile button { padding: 0; max-width: 100%; }
.profile h1 { font-size: clamp(20px, 6vw, 25px); }
.menu-button { gap: 10px; flex-wrap: wrap; }
.menu-button small { margin-left: auto; }
.login {
  width: 100%; padding: max(var(--safe-top), clamp(24px, 8vh, 80px))
    max(20px, var(--safe-right)) calc(24px + var(--safe-bottom)) max(20px, var(--safe-left));
}
.login .card { padding: clamp(16px, 5vw, 22px); }
.bottom-nav {
  bottom: var(--keyboard-inset); height: calc(var(--nav) + var(--safe-bottom));
  min-height: calc(var(--nav) + var(--safe-bottom)); grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 8px max(4px, var(--safe-right)) calc(8px + var(--safe-bottom)) max(4px, var(--safe-left));
}
.bottom-nav button { min-width: 0; padding: 4px 0; font-size: clamp(10px, 2.8vw, 12px); line-height: 1.3; gap: 4px; }
.bottom-nav button span { white-space: nowrap; }
.bottom-nav svg { width: clamp(18px, 5vw, 22px); height: clamp(18px, 5vw, 22px); }
.balance-float {
  width: clamp(92px, 25vw, 112px); height: clamp(92px, 25vw, 112px);
  bottom: calc(var(--keyboard-inset) + var(--nav) + var(--safe-bottom) + 16px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--tint) 78%, white),
      transparent 42%, transparent 58%, color-mix(in srgb, var(--tint) 78%, white)),
    radial-gradient(circle at center, color-mix(in srgb, var(--accent) 34%, white) 0%,
      color-mix(in srgb, var(--accent) 16%, white) 48%, color-mix(in srgb, var(--tint) 85%, white) 100%);
}
#toast { bottom: calc(var(--keyboard-inset) + var(--nav) + var(--safe-bottom) + 16px); overflow-wrap: anywhere; }
dialog {
  left: 0; right: 0; width: min(540px, calc(100% - var(--safe-left) - var(--safe-right)));
  bottom: calc(var(--keyboard-inset) + var(--nav) + var(--safe-bottom));
  max-height: calc(var(--viewport-height) - var(--nav) - var(--safe-bottom) - 16px);
}
dialog[open] { display: flex; flex-direction: column; }
.sheet-heading, .sheet-footer, .rank-own { flex: 0 0 auto; padding-left: clamp(16px, 4.8vw, 24px); padding-right: clamp(16px, 4.8vw, 24px); }
.sheet-heading { padding-top: 12px; padding-bottom: 12px; gap: 10px; }
.sheet-heading h2 { min-width: 0; overflow-wrap: anywhere; }
.close-sheet { width: 40px; height: 40px; flex: none; }
.sheet-body { min-height: 0; flex: 1 1 auto; max-height: none; overflow-y: auto; overscroll-behavior-y: contain; padding: 8px clamp(16px, 4.8vw, 24px) 20px; }
.rank-row { grid-template-columns: 36px minmax(0, 1fr) minmax(68px, auto); overflow-wrap: anywhere; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; } }
@media (max-height: 480px) { .login { padding-top: max(20px, var(--safe-top)); } .login .brand-icon { margin-bottom: 12px; } }
@media (min-width: 760px) { .shell { --shell-left: max(38px, var(--safe-left)); --shell-right: max(38px, var(--safe-right)); } .stat { grid-template-columns: minmax(0, 1fr) auto; } }

/* Full-width segments and native form semantics for the two course choices. */
.action-tabs { padding: 0; gap: 0; }
.action-tabs button { border-radius: 0; align-self: stretch; }
.action-tabs button + button:before { left: 0; top: 0; height: 100%; background: var(--border); }
.course-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.course-option { position: relative; cursor: pointer; }
.course-option input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.course-option span { display: flex; min-height: 46px; justify-content: center; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--deep); }
.course-option input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.course-option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.month-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.bill-mode > button { min-height: 64px; }
.bill-mode .period-label { display: block; color: var(--accent); font-size: clamp(10px, 2.9vw, 13px); overflow-wrap: anywhere; line-height: 1.6; }
.bill-year-options { display: grid; gap: 10px; margin: 12px 0; }
.bill-year-option { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; text-align: left; color: var(--deep); }
.bill-year-option[aria-pressed=true] { background: var(--tint); border-color: var(--accent); font-weight: 700; }
dialog.ranking-sheet { height: min(640px, calc(var(--viewport-height) - var(--nav) - var(--safe-bottom) - 16px)); }
.ranking-sheet .sheet-body { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.ranking-sheet .sheet-footer { padding: 0; }
.ranking-sheet .rank-own { border: 0; }
.balance-ring { width: clamp(120px, 35vw, 220px); height: clamp(120px, 35vw, 220px); }
.wallet-hero .balance-ring { width: clamp(120px, 35vw, 220px); height: clamp(120px, 35vw, 220px); }
.wallet-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(10px, 3vw, 25px); }
.balance-number { max-width: 85%; font-size: clamp(24px, 7vw, 40px); }
.wallet-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
.wallet-tools button { min-height: 66px; min-width: 0; }
.wallet-tools button.active .tool-icon { background: var(--accent); color: white; }
.finance-panel h2 { margin-bottom: 8px; }
.platform-content .training-grid { grid-template-columns: minmax(0, 1fr); margin-left: calc(-1 * var(--platform-inset)); margin-right: calc(-1 * var(--platform-inset)); }
.training-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; align-items: center; }
.training-card > span { grid-row: span 2; white-space: nowrap; }
.training-card h3 { min-height: 0; margin-top: 0; }
.training-card strong { margin-top: 5px; }
.balance-float {
  will-change: transform; contain: layout style; transition: none;
  background: linear-gradient(90deg, #ffffff8f 0%, #ffffff12 33%, transparent 50%, #ffffff12 67%, #ffffff8f 100%),
    radial-gradient(circle at center, color-mix(in srgb, var(--accent) 65%, white) 0%,
      color-mix(in srgb, var(--accent) 45%, white) 30%, color-mix(in srgb, var(--accent) 18%, white) 64%,
      color-mix(in srgb, var(--tint) 50%, white) 100%);
}
.balance-float.dragging { cursor: grabbing; backdrop-filter: none; }

/* Both student tables share the header edges and the same text hierarchy. */
.lesson-card.flush-table { margin-left: 0; margin-right: 0; }
.flush-table .data-table { text-align: center; font-size: 14px; }
.flush-table .data-table th, .flush-table .data-table td { padding: 8px; }
.flush-table .data-table th { font-size: 13px; }
.flush-table .data-table th.student-col { font-size: 16px; }
.flush-table .data-table th small { font-size: 10px; }
.flush-table .data-table th.student-col small { font-size: 12px; }
.flush-table .student-click { text-align: center; }
.flush-table .student-name { font-size: 13px; }
:is(.flush-table,.student-notices) .partner { font-size: 10px; }
.flush-table .cell-input { text-align: center; margin-left: auto; margin-right: auto; }
.flush-table .can-delete { margin-left: auto; margin-right: auto; }
.flush-table .total-row td { font-size: 14px; }
.flush-table .total-row .student-col small { font-size: 12px; }

/* Reading hierarchy shared by the editable and read-only student tables. */
.flush-table .data-table thead th, .flush-table .data-table .total-row td { text-align: center; }
:is(.flush-table,.student-notices) .student-name { font-size: 15px; line-height: 1.5; }
.flush-table .data-table tbody td:not(.student-col) { font-size: 16px; font-variant-numeric: tabular-nums; }
.flush-table .data-table .total-row .student-col { font-size: 14px; }
.flush-table .data-table .total-row .student-col small { font-size: 12px; }

/* A hanging first character puts the second name character under 学. */
.entry-table, :is(.management-table,.backfill-table) { --student-heading-size: 16px; --student-name-size: 15px; --student-offset: 0px; }
.entry-table th.student-col, :is(.management-table,.backfill-table) th.student-col { font-size: var(--student-heading-size); }
.entry-table .student-name, :is(.management-table,.backfill-table) .student-name { font-size: var(--student-name-size); }
.entry-table .student-click, :is(.management-table,.backfill-table) .student-info { text-align: left; }
.entry-table .student-line, :is(.management-table,.backfill-table) .student-line {
  display: flex; align-items: baseline; text-align: left;
  padding-left: max(0px, calc(50% - var(--student-heading-size) - var(--student-name-size) + var(--student-offset)));
}
.entry-table .student-name, :is(.management-table,.backfill-table) .student-name { min-width: 0; overflow-wrap: anywhere; }
.entry-table .mode-mark, :is(.management-table,.backfill-table) .mode-mark { flex: none; }
.entry-table .partner, :is(.management-table,.backfill-table) .partner {
  text-align: left; white-space: normal;
  padding-left: max(0px, calc(50% - var(--student-heading-size) - var(--student-name-size) + var(--student-offset)));
}
.entry-table .can-delete, :is(.management-table,.backfill-table) .can-delete {
  text-align: left; margin-left: 0; margin-right: 0;
  padding-left: max(0px, calc(50% - var(--student-heading-size) - var(--student-name-size) + var(--student-offset)));
}
:is(.management-table,.backfill-table) .student-month-total { margin-left: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.flush-table :is(.management-table,.backfill-table) { width: 100%; min-width: 100%; table-layout: auto; }
.flush-table :is(.management-table,.backfill-table) th, .flush-table :is(.management-table,.backfill-table) td { min-width: 0; padding: 7px clamp(2px, .8vw, 6px); }
.flush-table :is(.management-table,.backfill-table) th:not(.student-col) { font-size: clamp(11px, 3vw, 13px); }
.flush-table :is(.management-table,.backfill-table) th small { font-size: 10px; }
.flush-table :is(.management-table,.backfill-table) .student-col { width: 100px; min-width: 100px; max-width: 130px; }
.flush-table :is(.management-table,.backfill-table) tbody td:not(.student-col) { font-size: clamp(12px, 3.6vw, 16px); }

/* Training is a clean typographic list, with no colored cards or textures. */
.platform-content .training-grid { gap: 0; }
.training-card {
  grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px;
  padding: 22px 0; background: transparent; border: 0; border-radius: 0; box-shadow: none;
  border-bottom: 1px solid var(--border);
}
.training-card:last-child { border-bottom: 0; }
.training-card > span { grid-row: auto; font-size: 24px; font-weight: 600; letter-spacing: 1px; }
.training-card h3 { font-size: 12px; line-height: 1.8; color: var(--muted); }
.training-card strong { margin: 0; font-size: clamp(18px, 5vw, 23px); text-align: right; white-space: nowrap; }
.training-card strong small { display: block; margin: 3px 0 0; font-size: 10px; color: var(--muted); }

/* Monthly, academic-year and range queries share a refined statement style. */
.bill-modes { gap: 10px; margin-bottom: 22px; }
.bill-mode { position: relative; border-radius: 18px; padding: 16px 4px; box-shadow: 0 4px 12px #173f2f03; }
.bill-mode.active { background: linear-gradient(145deg, var(--tint), var(--surface)); box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 8%, transparent); }
.bill-mode.active:after { content: ''; position: absolute; left: 35%; right: 35%; bottom: 8px; height: 3px; border-radius: 4px; background: var(--accent); }
.bill-mode strong { letter-spacing: .5px; }
.balance-end {
  position: relative; isolation: isolate; overflow: hidden; padding: 24px;
  background: linear-gradient(120deg, var(--tint), white 85%); border-radius: 22px;
  box-shadow: 0 8px 24px #173f2f04;
}
.balance-end:after { content: ''; position: absolute; z-index: -1; width: 150px; height: 150px; border: 1px solid var(--border); border-radius: 50%; right: -45px; top: -50px; box-shadow: 0 0 0 23px color-mix(in srgb, var(--tint) 45%, transparent); }
.balance-end .balance-caption { display: flex; align-items: center; gap: 8px; color: var(--deep); font-size: 14px; font-weight: 600; }
.balance-caption svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.balance-end strong { font-size: clamp(30px, 8vw, 38px); margin: 18px 0 14px; letter-spacing: .4px; font-variant-numeric: tabular-nums; }
.balance-end .balance-date { display: block; font-size: 12px; color: var(--muted); }
.bill-flow-card { border-radius: 22px; box-shadow: 0 8px 24px #173f2f04; }
.bill-flow-card .card-title { padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.bill-flow-card h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.bill-flow-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--tint); color: var(--accent); font-size: 22px; font-weight: 400; }
.bill-flow-icon.outgoing { background: color-mix(in srgb, var(--negative) 8%, white); color: var(--negative); }
.bill-flow-card .project summary { align-items: center; gap: 10px; padding: 18px 0; font-size: 13px; }
.bill-flow-card .project summary strong { margin-left: auto; font-size: 15px; font-variant-numeric: tabular-nums; }
.bill-flow-card .project summary:after { content: '+'; font-size: 17px; font-weight: 400; color: var(--muted); }
.bill-flow-card .project[open] summary:after { content: '−'; }
.bill-flow-card .entry { border-left: 2px solid var(--border); padding: 12px 14px; border-radius: 0 10px 10px 0; }
.period-range { gap: clamp(24px, 7vw, 36px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.period-range .range-part { min-width: 0; width: 100%; margin: 16px 0; }
.period-control { display: grid; gap: 10px; min-width: 0; width: 100%; }
.period-control select { display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; padding: 10px 8px; }

/* Account controls stay at the top right; the five finance tools stay in one row. */
.wallet-account-bar { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.wallet-account-bar .account-button { max-width: min(100%, 250px); padding: 9px 15px; }
.account-menu .menu-button { min-height: 58px; padding: 17px 0; }
.campus-setting { margin: 8px 0 4px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.campus-setting .field { margin-bottom: 0; }
.campus-setting .section-subtitle { margin: 8px 0 12px; }
.wallet-tools { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 3px; }
.wallet-tools button { min-width: 0; min-height: 62px; font-size: clamp(10px, 2.8vw, 12px); white-space: nowrap; font-weight: 400; }
.wallet-tools .tool-icon { width: clamp(30px, 8.5vw, 40px); height: clamp(30px, 8.5vw, 40px); border-radius: 11px; }
.wallet-tools .tool-icon svg { width: 21px; height: 21px; }

/* A compact teaching workspace, followed by the same monthly read-only table. */
.teaching-page .platform-account { margin-top: 0; margin-bottom: 18px; }
.flush-table .entry-table { --student-offset: 0px; }
.flush-table .entry-table .student-col { width: 1%; min-width: 96px; max-width: 160px; }
.home-monthly > .card-title { margin: 0; padding: 15px 12px; background: white; border-bottom: 1px solid var(--border); }
.home-monthly > .card-title h2 { font-size: 16px; }
.teaching-page .data-table tbody td:not(.student-col), .teaching-page .cell-input { font-size: 15px; }
.teaching-page .data-table tbody td[data-long-number=true]:not(.student-col), .teaching-page .cell-input[data-long-number=true] { font-size: 14px; }
.teaching-page .stat-value { font-size: clamp(20px, 5.7vw, 27px); }
.teaching-page .stat-value[data-long-number=true] { font-size: clamp(19px, 5.4vw, 26px); }
.teaching-page .account-metric strong { font-size: clamp(24px, 6.5vw, 27px); }
.teaching-page .account-metric strong[data-long-number=true] { font-size: clamp(23px, 6.2vw, 26px); }
.teaching-page .student-month-total { font-size: 9px; }
.teaching-page .student-month-total[data-long-number=true] { font-size: 8px; }
.teaching-page .total-row .student-col small { font-size: 11px; }
.teaching-page .total-row .student-col small[data-long-number=true] { font-size: 10px; }

/* Soft edges fade into the page without a hard circular boundary. */
.balance-float, .balance-float.dragging { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; isolation: isolate; }
.balance-float { will-change: transform; touch-action: none; user-select: none; -webkit-user-select: none; contain: layout style; }
.balance-float:before {
  content: ''; position: absolute; inset: -12px; z-index: -1; border-radius: 50%; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--accent) 18%, transparent) 46%, color-mix(in srgb, var(--accent) 18%, transparent) 54%, transparent 100%),
    radial-gradient(circle at center, color-mix(in srgb, var(--accent) 34%, white) 0%, color-mix(in srgb, var(--tint) 82%, transparent) 52%, transparent 74%);
  -webkit-mask-image: radial-gradient(circle at center, #000 35%, #000b 52%, transparent 72%);
  mask-image: radial-gradient(circle at center, #000 35%, #000b 52%, transparent 72%);
}

/* The wallet uses quiet tonal layers, a clear action hierarchy and lighter forms. */
.wallet-page .wallet-account-bar { align-items: center; justify-content: space-between; gap: 14px; margin: 2px 0 20px; }
.wallet-page-title { min-width: 0; }
.wallet-page-title > span { font-size: 9px; letter-spacing: 2px; color: var(--muted); }
.wallet-page-title h1 { font-size: 27px; letter-spacing: 1px; margin-top: 5px; }
.wallet-page .account-button { background: color-mix(in srgb, var(--tint) 55%, white); border-color: var(--border); box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 5%, transparent); }
.wallet-page .wallet-card { position: relative; isolation: isolate; overflow: hidden; padding: clamp(16px, 5vw, 28px); border-radius: 26px; background: linear-gradient(135deg, white 25%, var(--tint)); box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 8%, transparent); }
.wallet-page .wallet-card:before { content: ''; position: absolute; width: 230px; height: 230px; border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 50%; right: -120px; top: -110px; z-index: -1; box-shadow: 0 0 0 23px color-mix(in srgb, var(--accent) 3%, transparent); }
.wallet-page .wallet-hero { gap: clamp(15px, 5vw, 28px); padding-bottom: 24px; border-bottom-color: color-mix(in srgb, var(--accent) 15%, transparent); }
.wallet-page .balance-ring { box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 10%, transparent); }
.wallet-page .balance-ring:before { background: linear-gradient(150deg, white, color-mix(in srgb, var(--tint) 45%, white)); }
.wallet-page .balance-number { letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.wallet-page .wallet-main-actions { gap: 9px; }
.wallet-page .wallet-main-actions button { display: flex; align-items: center; gap: 9px; text-align: left; padding: 10px; border: 1px solid transparent; border-radius: 12px; font-size: clamp(13px, 3.7vw, 17px); min-height: 47px; white-space: nowrap; }
.wallet-page .wallet-main-actions button.active { background: white; border-color: var(--border); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 7%, transparent); }
.main-action-symbol { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--tint); color: var(--accent); font-size: 19px; font-weight: 400; }
.wallet-page .wallet-main-actions button.active .main-action-symbol { background: var(--accent); color: white; }
.wallet-page .wallet-tools { padding-top: 20px; gap: 8px 3px; }
.wallet-page .wallet-tools button { gap: 8px; border-radius: 12px; padding: 7px 1px; }
.wallet-page .wallet-tools .tool-icon { background: white; border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent); box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 5%, transparent); }
.wallet-page .wallet-tools button.active { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.wallet-page .wallet-tools button.active .tool-icon { background: var(--accent); color: white; border-color: var(--accent); }
.wallet-page .finance-panel { border-radius: 24px; padding: clamp(18px, 5vw, 26px); box-shadow: 0 7px 24px color-mix(in srgb, var(--accent) 5%, transparent); }
.finance-panel-title { display: flex; align-items: center; gap: 11px; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.finance-panel-title h2 { margin: 0; font-size: 19px; letter-spacing: .5px; }
.finance-title-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: var(--tint); color: var(--accent); }
.finance-title-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.wallet-page .field > span { color: var(--deep); font-size: 12px; }
.wallet-page .field input, .wallet-page .field select, .wallet-page .field textarea { border-radius: 12px; background: color-mix(in srgb, var(--tint) 20%, white); }
.wallet-page .finance-panel .primary { min-height: 46px; border-radius: 13px; background: linear-gradient(115deg, var(--accent), color-mix(in srgb, var(--accent) 85%, var(--deep))); }
.wallet-page .list-row { padding: 16px 0; }

/* Palette variants are owned by theme-palettes.css. */

.stats.period-stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.period-stats > .card { margin-bottom: 0; padding: clamp(16px, 4vw, 22px); }
.period-stat-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.period-stat-heading h2 { margin: 0; font-size: 16px; }
.period-stat-heading > small { font-size: 12px; white-space: nowrap; }
.period-stat-heading .time-picker { font-size: 12px; min-height: 32px; border: 1px solid var(--border); border-radius: 9px; padding: 5px 9px; background: white; }
.period-stat-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 17px; }
.period-stat-values .stat { min-width: 0; padding: 0 7px; text-align: center; border: 0; }
.period-stat-values .stat + .stat { border-left: 1px solid var(--border); }
.period-stat-values .stat-label { font-size: clamp(10px, 2.8vw, 12px); line-height: 1.6; }
.period-stat-values .stat-value { font-size: clamp(19px, 5.3vw, 25px); font-variant-numeric: tabular-nums; }
.period-stat-values .stat-value[data-long-number=true] { font-size: clamp(17px, 4.8vw, 23px); }
.period-stat-values .stat-value small { font-size: 10px; margin-left: 2px; }
.price-placeholder { letter-spacing: 2px; }
.remember-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.remember-row label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.remember-row input { width: 16px; height: 16px; padding: 0; min-height: 0; accent-color: var(--accent); }
.linked-accounts { display: grid; gap: 9px; margin: 14px 0; }
.linked-accounts > button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); text-align: left; }
.linked-accounts > button[aria-pressed=true] { background: var(--tint); border-color: var(--accent); }
.linked-accounts strong { font-size: 14px; color: var(--deep); }
.linked-accounts small { font-size: 11px; }
#profile-accounts .linked-accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
#profile-accounts .linked-accounts > button { justify-content: flex-start; min-width: 0; min-height: 44px; padding: 8px 13px; gap: 7px; }
#profile-accounts .linked-accounts strong { min-width: 0; font-size: 16px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
#profile-accounts .linked-accounts small { flex-shrink: 0; max-width: 50%; font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
#profile-accounts .linked-accounts > button[aria-pressed=true] { opacity: 1; }
@media (max-width: 360px) { #profile-accounts .linked-accounts > button { padding-inline: 10px; } }
