@font-face {
  font-family: "IBM Plex Sans";
  src: url("/plex.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --frame: #f6f4f3;
  --surface: #fff;
  --raised: #faf8f7;
  --selected: #eeeae8;
  --rule: #eeeae8;
  --border: #e7e2df;
  --control: #dcd6d2;
  --ink: #211d1c;
  --muted: #6c615d;
  --subtle: #837872;
  --brand: #9c2435;
  --brand-wash: #fbf3f3;
  --primary: #262021;
  --on-primary: #fff;
  --good: #225c43;
  --good-bg: #e7f3eb;
  --good-line: #d3e9da;
  --bad: #962c40;
  --bad-bg: #faedf0;
  --bad-line: #f2dce1;
  --neutral: #615854;
  --neutral-bg: #f4f2f1;
  --neutral-line: #eeebe9;
  --overlay: #251e1bc0;
  --shadow: #2118192b;
  --sidebar: 226px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --frame: #171515;
  --surface: #201e1e;
  --raised: #272424;
  --selected: #302c2c;
  --rule: #322e2e;
  --border: #3b3535;
  --control: #514848;
  --ink: #f4efec;
  --muted: #bdb0aa;
  --subtle: #a69a94;
  --brand: #ee95a2;
  --brand-wash: #312426;
  --primary: #f1e8e5;
  --on-primary: #271e20;
  --good: #a4d8b8;
  --good-bg: #263a30;
  --good-line: #354b3f;
  --bad: #f0a9b4;
  --bad-bg: #3e2b30;
  --bad-line: #53383f;
  --neutral: #b6ada7;
  --neutral-bg: #2b2828;
  --neutral-line: #383333;
  --overlay: #0a0808c0;
  --shadow: #0007;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--frame); scroll-padding-block: 16px 80px; }
body { margin: 0; color: var(--ink); font: 400 14px/1.45 var(--font); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: 29px; font-weight: 600; letter-spacing: -.035em; line-height: 1.16; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.013em; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; }
strong { font-weight: 600; }
::selection { background: var(--bad-line); color: var(--ink); }
.icon { flex: 0 0 auto; display: block; }
.muted { color: var(--muted); }
.quiet { color: var(--muted); padding: 8px; font-size: 13px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); }
.mobile-only, .mobile-brand, .mobile-nav { display: none !important; }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); grid-template-rows: 56px 1fr; min-height: 100vh; }
.sidebar { grid-row: 1 / 3; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; min-height: 0; padding: 19px 13px 13px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 0 5px; }
.brand img { display: block; border-radius: 9px; background: #080606; object-fit: cover; flex: 0 0 auto; }
.brand div { display: grid; gap: 1px; }
.brand strong { font-size: 15px; line-height: 1.1; letter-spacing: -.025em; }
.brand span { color: var(--muted); font-size: 12px; }
.main-nav { display: grid; gap: 3px; }
.nav-item { width: 100%; border: 0; background: transparent; border-radius: 7px; padding: 0 10px; min-height: 40px; display: flex; align-items: center; gap: 10px; text-align: left; color: var(--muted); font-weight: 500; }
.nav-item:hover, .group-item:hover { background: var(--raised); color: var(--ink); }
.nav-item.active { color: var(--ink); background: var(--selected); font-weight: 600; }
.nav-item .icon { width: 17px; height: 17px; }
.sidebar-groups { display: flex; flex-direction: column; min-height: 0; }
.sidebar-label { display: flex; align-items: center; justify-content: space-between; padding-left: 10px; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.sidebar-label .icon-button { width: 32px; height: 32px; border-color: transparent; background: transparent; --icon-surface: var(--frame); }
.group-list { overflow: auto; scrollbar-width: thin; }
.group-item { display: grid; grid-template-columns: 7px 1fr auto; gap: 8px; align-items: center; min-height: 37px; width: 100%; padding: 5px 9px; background: none; border: 0; border-radius: 7px; color: var(--muted); text-align: left; font-size: 13px; }
.group-item i, .local-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--control); }
.group-item small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.group-item.selected { background: var(--selected); color: var(--ink); font-weight: 600; }
.group-item.selected i { background: var(--brand); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 11px 8px 4px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.sidebar-foot small { margin-left: auto; font-size: 11px; }
.sidebar-foot .local-dot { background: var(--good); }
.topbar { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 22px 0 17px; min-width: 0; }
.breadcrumbs, .top-tools { display: flex; gap: 9px; align-items: center; }
.breadcrumbs { color: var(--muted); font-size: 13px; white-space: nowrap; }
.breadcrumbs strong { color: var(--ink); }
.breadcrumbs .icon { width: 13px; height: 13px; color: var(--subtle); }
.demo-label { border: 0; padding: 0 7px; min-height: 36px; color: var(--brand); background: transparent; border-radius: 6px; font-size: 12px; font-weight: 600; }
.demo-label span + span { display: none; }
.demo-label:hover { background: var(--brand-wash); }
.course-select, .filter-select, .month-select { display: flex; position: relative; align-items: center; background: var(--surface); border: 1px solid var(--control); border-radius: 7px; min-width: 0; }
.course-select { border-color: var(--border); }
.course-select .icon, .filter-select .icon, .month-select .icon { color: var(--muted); pointer-events: none; width: 15px; height: 15px; position: absolute; }
.course-select .icon:first-child, .filter-select .icon:first-child { left: 10px; }
.course-select .icon:last-child, .filter-select .icon:last-child, .month-select .icon:last-child { right: 9px; width: 13px; height: 13px; }
.course-select select, .filter-select select, .month-select select { min-height: 36px; min-width: 0; width: 100%; border: 0; border-radius: inherit; appearance: none; background: transparent; color: var(--ink); padding: 0 27px 0 32px; font-weight: 500; }
.top-tools .icon-button { border-color: var(--border); }
.sheet { grid-column: 2; min-width: 0; min-height: calc(100vh - 64px); margin: 0 8px 8px 0; padding: 26px 27px 34px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); outline: none; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.page-header .muted { margin-top: 6px; }
.page-heading { min-width: 0; }
.overline { color: var(--brand); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.metadata, .head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.metadata { color: var(--muted); gap: 5px 14px; margin-top: 8px; }
.metadata span { display: inline-flex; align-items: center; gap: 5px; }
.metadata .icon { width: 15px; height: 15px; color: var(--subtle); }
.head-actions { flex: 0 0 auto; }
.button, .icon-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border-radius: 7px; color: var(--ink); font-weight: 500; white-space: nowrap; }
.button { padding: 0 12px; border: 1px solid var(--control); background: var(--surface); }
.button .icon, .text-button .icon { width: 16px; height: 16px; }
.button:hover, .icon-button:hover { background: var(--raised); }
.button.primary { color: var(--on-primary); background: var(--primary); border-color: var(--primary); font-weight: 600; }
.button.primary:hover { opacity: .88; }
.button:disabled { opacity: .56; }
.icon-button { width: 37px; height: 37px; padding: 0; background: var(--surface); border: 1px solid var(--control); color: var(--muted); flex: 0 0 auto; }
.icon-button:disabled { opacity: .38; }
.text-button { border: 0; padding: 0 5px; background: transparent; color: var(--muted); }
.text-button:hover { color: var(--ink); }
.danger { color: var(--bad); }

.tabs { display: flex; align-items: stretch; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; min-height: 42px; padding: 0 2px; margin-bottom: -1px; color: var(--muted); font-weight: 500; }
.tabs button.active { color: var(--ink); border-color: var(--brand); font-weight: 600; }
.tabs small { margin-left: 5px; color: var(--muted); font-size: 11px; }
.summary { display: grid; grid-template-columns: minmax(128px,.85fr) minmax(155px,1.4fr) minmax(110px,.76fr) minmax(112px,.9fr); border: 1px solid var(--border); border-radius: 9px; background: var(--raised); }
.summary > div { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 82px; min-width: 0; padding: 11px 17px; gap: 1px; }
.summary > div + div { border-left: 1px solid var(--border); }
.small-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.summary strong { font-size: 23px; font-weight: 500; line-height: 1.22; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.summary-month strong { font-size: 19px; }
.summary .short-label { display: none; }
.summary strong small { color: var(--muted); font-size: 13px; letter-spacing: 0; }
.summary .track-label { display: flex; justify-content: space-between; align-items: baseline; width: 100%; }
.track-label > span { color: var(--muted); font-size: 12px; }
.summary .text-bad { color: var(--bad); }
progress { appearance: none; width: 100%; height: 4px; margin-top: 3px; border: 0; border-radius: 3px; background: var(--border); color: var(--brand); }
progress::-webkit-progress-bar { border-radius: 3px; background: var(--border); }
progress::-webkit-progress-value { border-radius: 3px; background: var(--brand); }
progress::-moz-progress-bar { border-radius: 3px; background: var(--brand); }

.register { margin-top: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title > div { min-width: 0; }
.section-title .muted { display: block; margin-top: 3px; font-size: 13px; }
.segmented { display: flex; align-items: center; flex: 0 0 auto; gap: 2px; padding: 3px; background: var(--raised); border: 1px solid var(--border); border-radius: 8px; }
.segmented button { display: flex; align-items: center; gap: 5px; min-height: 29px; padding: 0 9px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.segmented button.active { background: var(--surface); border-color: var(--border); color: var(--ink); font-weight: 600; }
.segmented .icon { width: 14px; height: 14px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin: 12px 0 11px; min-width: 0; }
.search { width: min(265px,100%); display: flex; position: relative; align-items: center; min-width: 0; }
.search .icon { width: 17px; height: 17px; position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search input { min-width: 0; width: 100%; height: 38px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); padding: 0 9px 0 34px; border-radius: 7px; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
.filter-select { flex: 0 1 145px; }
.filter-select select { text-overflow: ellipsis; }
.period-hint { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-left: auto; white-space: nowrap; font-size: 12px; }
.period-hint .icon { width: 15px; height: 15px; }
.month-nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.month-select select { padding-left: 9px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 11px; color: var(--muted); font-size: 12px; }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend .key { width: 9px; height: 9px; border: 1px solid currentColor; border-radius: 3px; }
.legend .letter-key { margin-left: auto; }
.letter-key b { padding: 0 4px; border: 1px solid var(--border); border-radius: 3px; color: var(--ink); font-size: 11px; font-weight: 600; }

.table-scroll { overflow: auto; max-width: 100%; max-height: 62vh; border: 1px solid var(--border); border-radius: 8px; scrollbar-width: thin; }
.ledger-table { width: 100%; min-width: 918px; border-spacing: 0; font-variant-numeric: tabular-nums; }
.ledger-table thead { position: sticky; top: 0; z-index: 3; }
.ledger-table th, .ledger-table td { padding: 0; }
.ledger-table thead th { border-bottom: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 500; height: 43px; vertical-align: middle; }
.ledger-table .fixed-col { position: sticky; left: 0; z-index: 2; text-align: left; background: var(--surface); box-shadow: 1px 0 var(--rule); width: 176px; min-width: 176px; max-width: 205px; }
.identity-header { display: grid; grid-template-columns: 43px auto; align-items: center; padding-left: 8px; }
.ledger-table tbody tr + tr > * { border-top: 1px solid var(--rule); }
.ledger-table tbody th, .ledger-table tbody td { height: 47px; }
.ledger-table td:last-child { text-align: center; min-width: 39px; }
.ledger-table td:last-child .icon-button { width: 29px; height: 29px; min-height: 29px; border: 0; background: transparent; }
.ledger-table td:last-child .icon-button:hover { background: var(--raised); }
.ledger-table .month-focus { background: var(--brand-wash); }
.ledger-table thead .month-focus { color: var(--brand); box-shadow: inset 0 2px var(--brand); }
.month-heading { border: 0; background: transparent; font-weight: 600; color: inherit; width: 100%; min-width: 68px; min-height: 27px; padding: 0 3px; }


.row-id { display: flex; align-items: center; gap: 6px; padding: 0 7px; }
.member-button { display: inline-flex; justify-content: center; align-items: center; border: 0; background: transparent; min-width: 36px; min-height: 40px; padding: 0; flex: 0 0 auto; border-radius: 6px; }
.membership { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 22px; padding: 0 5px; border-radius: 5px; border: 1px solid transparent; font-size: 12px; font-weight: 500; white-space: nowrap; }
.membership .icon { width: 13px; height: 13px; }
.member-button .membership .icon { width: 16px; height: 16px; stroke-width: 2; }
.member-button .membership { min-width: 23px; padding: 0; border: 0; background: transparent; }
.student-link { max-width: 100%; padding: 2px 0; min-height: 33px; text-align: left; border: 0; background: transparent; color: var(--ink); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.student-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.pay-pair { display: flex; justify-content: center; gap: 3px; padding: 0 4px; }
.pay { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 28px; height: 31px; padding: 0 2px; border: 1px solid transparent; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pay:hover:not(:disabled), .member-button:hover .membership { filter: brightness(.95); }
.pay-mark { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; position: relative; }
.pay-mark::after { content: ""; display: block; position: absolute; }
.pay-mark.paid::after { width: 7px; height: 4px; top: 1px; left: 1px; border-left: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(-45deg); }
.pay-mark.waiting::after { width: 6px; height: 1px; top: 4px; left: 2px; background: currentColor; }
.pay-mark.upcoming::after { width: 3px; height: 3px; top: 3px; left: 3px; border-radius: 50%; background: currentColor; }
.pay:disabled { opacity: .55; }
.good { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }
.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.neutral { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-line); }

.monthly-list { border: 1px solid var(--border); border-radius: 8px; }
.monthly-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 10px; min-height: 59px; padding: 4px 11px; }
.monthly-row + .monthly-row { border-top: 1px solid var(--rule); }
.monthly-person { display: flex; min-width: 0; align-items: center; gap: 5px; }
.monthly-person > div { min-width: 0; }
.monthly-person .student-link { min-height: 20px; }
.monthly-pay { display: flex; gap: 6px; }
.monthly-pay .pay { min-width: 83px; gap: 5px; min-height: 41px; font-size: 12px; }

.monthly-row > .icon-button { border: 0; }
.row-caption { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

.empty { display: grid; justify-items: start; gap: 7px; padding: 22px; background: var(--raised); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); }
.empty strong { font-size: 16px; }
.empty p { color: var(--muted); }
.empty .button { margin-top: 5px; }
.section-stack { display: grid; gap: 12px; }
.section-stack > .section-title { margin-bottom: 4px; }
.extra-panel, .note { border: 1px solid var(--border); border-radius: 8px; }
.extra-panel summary { min-height: 63px; padding: 10px 15px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.extra-panel summary::-webkit-details-marker { display: none; }
.extra-panel summary > span { display: flex; align-items: center; gap: 10px; }
.extra-panel summary small { display: block; color: var(--muted); font-size: 12px; }
.extra-panel summary .icon { color: var(--muted); }
.extra-panel[open] > summary > .icon { transform: rotate(180deg); }
.extra-content { padding: 9px 14px 12px; border-top: 1px solid var(--rule); }
.extra-content .list-row { gap: 8px; padding: 4px 0; }
.extra-content .list-row .student-link { margin-right: auto; }
.extra-actions { margin-bottom: 5px; }
.payment-state.good { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }
.payment-state.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.note { padding: 14px; }
.note time { color: var(--muted); font-size: 12px; }
.note p, .profile-note p { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.plain-list { border-top: 1px solid var(--rule); }
.list-row { display: flex; align-items: center; gap: 11px; min-height: 57px; border-bottom: 1px solid var(--rule); padding: 4px 2px; }
.list-row .student-link { min-height: 22px; }
.row-grow { flex: 1; min-width: 0; }
.list-count { white-space: nowrap; font-size: 12px; }
.directory-tools { margin-bottom: 15px; }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; background: var(--selected); color: var(--ink); border-radius: 50%; font-size: 12px; font-weight: 600; }
.settings-list { border-top: 1px solid var(--border); }
.setting { display: grid; grid-template-columns: minmax(175px,.75fr) minmax(0,1fr); gap: 20px; align-items: start; padding: 17px 0; border-bottom: 1px solid var(--rule); }
.setting p { max-width: 45ch; margin-top: 4px; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.settings-items { display: grid; margin-top: 7px; }
.settings-item { display: flex; align-items: center; gap: 8px; min-height: 40px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; text-align: left; padding: 0 2px; }
.settings-item:last-child { border-bottom: 0; }
.settings-item span { margin-left: auto; color: var(--muted); }
.settings-item .icon { width: 15px; height: 15px; color: var(--muted); }
.settings-item strong + .icon { margin-left: auto; }

dialog { width: min(590px,calc(100% - 32px)); max-height: min(82vh,780px); max-height: min(82dvh,780px); padding: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 10px 40px var(--shadow); overscroll-behavior: contain; }
dialog::backdrop { background: var(--overlay); }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 15px 19px; background: var(--surface); border-bottom: 1px solid var(--rule); }
.dialog-header h2 { font-size: 21px; }
.dialog-header p { color: var(--muted); margin-top: 3px; }
.dialog-header .icon-button { border-color: var(--border); }
.dialog-body { padding: 16px 19px; }
form .dialog-body { display: grid; gap: 12px; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 10px 19px; border-top: 1px solid var(--rule); background: var(--surface); position: sticky; bottom: 0; z-index: 1; }
.dialog-delete { margin-right: auto; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { color: var(--muted); font-size: 13px; font-weight: 500; }
.field input, .field select, .field textarea { min-width: 0; width: 100%; min-height: 39px; padding: 6px 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--control); border-radius: 6px; }
.field textarea { resize: vertical; min-height: 80px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.field input[type="file"] { padding: 6px; }
.field input::file-selector-button { color: var(--ink); background: var(--raised); border: 1px solid var(--border); border-radius: 5px; padding: 3px 8px; }
.check-field { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.check-field input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
fieldset { margin: 0; padding: 3px 10px 6px; min-width: 0; border: 1px solid var(--border); border-radius: 6px; }
legend { padding: 0 5px; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; }
.form-error { color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: 6px; padding: 7px 9px; }
.choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 8px; }
.menu-list { display: grid; gap: 4px; margin-top: 3px; }
.menu-row { min-height: 43px; display: flex; align-items: center; text-align: left; gap: 9px; padding: 4px 8px; border-radius: 6px; border: 0; background: transparent; }
.menu-row:hover { background: var(--raised); }
.menu-row .icon { color: var(--muted); }
.profile-intro { display: flex; align-items: center; gap: 10px; }
.profile-intro .avatar { width: 46px; height: 46px; }
.profile-intro > div { flex: 1; display: grid; }
.profile-intro > div strong { font-size: 18px; overflow-wrap: anywhere; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 15px; margin: 15px 0; }
.contact-grid dt { font-size: 12px; color: var(--muted); }
.contact-grid dd { overflow-wrap: anywhere; }
.profile-section, .profile-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.profile-row { display: flex; align-items: center; gap: 5px; min-height: 42px; padding: 4px 0; }
.profile-row + .profile-row { border-top: 1px solid var(--rule); }
.profile-row > div:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.profile-row .icon-button { border-color: transparent; width: 31px; min-height: 31px; height: 31px; }
.profile-section .hint { padding: 5px 0; }

.notice { position: fixed; z-index: 9; right: 20px; bottom: 19px; display: flex; align-items: center; gap: 8px; max-width: min(calc(100% - 36px),430px); padding: 7px 9px 7px 12px; color: var(--ink); border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 5px 20px var(--shadow); }
.notice > .icon { color: var(--good); }
.notice.error > .icon { color: var(--bad); }
.notice button { min-height: 35px; border: 0; border-radius: 5px; padding: 0 5px; background: transparent; color: var(--brand); font-weight: 600; }
.notice button:hover { background: var(--raised); }
.notice .notice-close { color: var(--muted); margin-left: auto; }
.login { display: grid; min-height: 100vh; place-items: center; padding: 16px; }
.login-card { width: min(100%,420px); padding: 23px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.login-card .brand { margin-bottom: 18px; padding: 0; }
.login-card .muted { margin-top: 5px; }
.login-card form { display: grid; gap: 10px; margin-top: 14px; }
.login-card .button { justify-self: start; }

@media (max-width: 1100px), (pointer: coarse) and (hover: none) {
  .shell { display: flex; flex-direction: column; padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .mobile-brand { display: block !important; }
  .mobile-only { display: inline-flex !important; }
  .topbar { min-height: 58px; padding: 5px 15px; }
  .breadcrumbs { display: none; }
  .top-tools .icon-button, .top-tools select, .demo-label { min-height: 44px; }
  .top-tools .icon-button { width: 44px; }
  .sheet { min-height: calc(100vh - 131px); margin: 0 8px; padding: 20px 22px 26px; }
  .mobile-nav { display: grid !important; grid-template-columns: repeat(4,1fr); position: fixed; z-index: 5; inset: auto 0 0; padding: 4px max(10px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); border-top: 1px solid var(--border); background: var(--frame); }
  .mobile-nav .nav-item { min-height: 52px; flex-direction: column; justify-content: center; gap: 2px; font-size: 12px; }
  .mobile-nav .nav-item.active { background: transparent; color: var(--brand); }
  .mobile-nav .nav-item .icon { width: 19px; height: 19px; }
  .context-line { display: flex; gap: 12px; align-items: center; }
  .context-line .text-button { flex-direction: row-reverse; min-height: 34px; font-size: 13px; }
  .context-line .overline { margin-bottom: 0; }
  .ledger-table { min-width: 1185px; }
  .ledger-table .fixed-col { min-width: 190px; }
  .ledger-table tbody th, .ledger-table tbody td { height: 54px; }
  .ledger-table .pay { min-width: 44px; min-height: 44px; font-size: 12px; }
  .ledger-table .month-heading { min-height: 44px; }
  .ledger-table td:last-child .icon-button { min-width: 44px; min-height: 44px; }
  .button, .icon-button, .search input, .filter-select select, .month-select select, .field input, .field select { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  .notice { bottom: calc(69px + env(safe-area-inset-bottom)); }
}

@media (max-width: 680px) {
  .topbar { min-height: 57px; gap: 6px; padding: 4px 10px 4px 12px; }
  .top-tools { gap: 4px; }
  .top-tools .icon-button { width: 44px; border: 0; background: transparent; }
  .top-tools .demo-label { padding: 0 6px; }
  .demo-label span:first-child { display: none; }
  .demo-label span + span { display: inline; }
  .course-select { width: 109px; }
  .topbar:has([data-action="logout"]) .mobile-brand .brand > div { display: none; }
  .course-select .icon:first-child { display: none; }
  .course-select select { padding: 0 23px 0 7px; font-size: 13px; }
  .course-select .icon:last-child { right: 6px; }
  .mobile-brand .brand { padding: 0; gap: 6px; }
  .mobile-brand .brand img { width: 35px; height: 35px; border-radius: 7px; }
  .mobile-brand .brand strong { font-size: 13px; white-space: nowrap; }
  .mobile-brand .brand span { display: none; }
  .sheet { border: 0; border-radius: 0; margin: 0; padding: 8px 16px 22px; }
  h1 { font-size: 24px; }
  h2 { font-size: 16px; }
  .page-header { align-items: flex-end; gap: 8px; margin-bottom: 12px; }
  .page-header:not(.ledger-header) { flex-wrap: wrap; }
  .ledger-header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  .ledger-header .head-actions { gap: 4px; flex-direction: row-reverse; padding-bottom: 1px; }
  .ledger-header .head-actions .primary { width: 44px; padding: 0; }
  .ledger-header .head-actions .primary span { display: none; }
  .ledger-header .head-actions .primary .icon { width: 21px; height: 21px; }
  .context-line { justify-content: flex-start; gap: 4px; margin-bottom: 1px; }
  .context-line .overline { font-size: 11px; }
  .context-line .text-button { font-size: 12px; }
  .context-line .text-button { min-height: 44px; }
  .metadata { font-size: 13px; margin-top: 6px; }
  .tabs { margin-bottom: 11px; gap: 22px; }
  .tabs button { min-height: 44px; }
  .summary { grid-template-columns: .8fr 1.13fr .76fr 1fr; }
  .summary > div { min-height: 59px; gap: 3px; padding: 5px 6px; }
  .summary .small-label { font-size: 11px; line-height: 1.12; }
  .summary strong { font-size: 16px; overflow-wrap: anywhere; }
  .summary strong small { font-size: 11px; }
  .summary-month strong { font-size: 12px; overflow-wrap: normal; white-space: nowrap; }
  .summary .month-label { display: none; }
  .summary .short-label { display: inline; }
  .track-label > span { display: none; }
  .summary progress { margin-top: 0; }
  .summary .muted { font-size: 10px; }
  .register { margin-top: 12px; }
  .section-title .muted { margin-top: 1px; }
  .segmented { padding: 1px; }
  .segmented button { min-height: 44px; padding: 0 6px; }
  .segmented .icon { display: none; }
  .toolbar { flex-wrap: wrap; margin: 7px 0; gap: 5px; }
  .toolbar .search { width: auto; flex: 1 1 145px; }
  .toolbar .filter-select { flex: 0 1 125px; }
  .period-hint { display: none; }
  .month-nav { width: 100%; gap: 5px; }
  .month-select { flex: 1; }
  .month-select select { text-align: center; }
  .monthly-row { min-height: 55px; gap: 4px; padding: 3px 3px; }
  .monthly-person { gap: 0; }
  .monthly-person .student-link { min-height: 24px; font-size: 13px; }
  .monthly-person .row-caption { font-size: 11px; }
  .member-button { min-width: 31px; min-height: 44px; }
  .monthly-pay { gap: 3px; }
  .monthly-pay .pay { min-width: 49px; min-height: 44px; padding: 0 3px; gap: 2px; font-size: 11px; }

  .monthly-row > .icon-button { width: 44px; }
  .legend { gap: 6px 9px; font-size: 11px; }
  .legend .letter-key { margin-left: 0; }
  .list-row { gap: 5px; }
  .list-count { font-size: 11px; }
  .setting { grid-template-columns: 1fr; gap: 8px; }
  .field input, .field select, .field textarea, .search input { font-size: 16px; }
  .dialog-header { padding: 10px 13px; }
  .dialog-body { padding: 12px 13px; }
  .dialog-foot { padding: 8px 13px; }
  .dialog-foot .button { padding: 0 9px; }
  .profile-row .icon-button { width: 36px; height: 44px; }
  .menu-row, .check-field { min-height: 44px; }
  .notice { right: 10px; max-width: calc(100% - 20px); }
}
@media (max-width: 374px) {
  .mobile-brand .brand > div, .context-line .overline { display: none; }
  .ledger-header { display: block; position: relative; }
  .ledger-header .head-actions { position: absolute; top: 0; right: 0; }
  .summary > div { padding-inline: 4px; }
  .monthly-row > .icon-button { width: 44px; }
  .monthly-pay .pay { font-size: 10.5px; }
}




.demo-steps { display: grid; gap: 10px; margin: 16px 0 18px; padding-left: 21px; }
.demo-steps li { padding-left: 4px; }
.demo-steps li::marker { color: var(--brand); font-weight: 600; }
.demo-guide-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pay.demo-focus { outline: 2px solid var(--brand); outline-offset: 2px; }

.login-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.offline-action { margin-top: 14px; }
.top-tools .install-button { flex: 0 0 auto; font-size: 13px; }
@media (max-width: 680px) {
  .top-tools:has(.install-button:not([hidden])) { flex-wrap: wrap; justify-content: flex-end; }
  .topbar:has(.install-button:not([hidden])) .mobile-brand .brand > div { display: none; }
  .top-tools .install-button { padding-inline: 6px; font-size: 12px; }
  .top-tools .install-button .icon { display: none; }
}

@media (max-width: 1100px), (pointer: coarse) and (hover: none) {
  .topbar { padding-block-start: max(4px, env(safe-area-inset-top)); }
}
