:root {
  color-scheme: light;
  --ink: #24342c;
  --muted: #68746b;
  --paper: #f7f4ec;
  --panel: #fffdf7;
  --line: #b7ad96;
  --green: #1f513b;
  --red: #b43f32;
  --gold: #e5c45d;
  --blue: #2f5c8f;
  --shadow: 0 12px 30px rgba(41, 34, 21, .08);
  --name-col: 190px;
  --adm-col: 112px;
  --sex-col: 44px;
  --att-col: 36px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
body.dark {
  --ink: #edf2ec;
  --muted: #bac5bd;
  --paper: #111812;
  --panel: #19231b;
  --line: #536252;
  --shadow: none;
}
button, input, select { font: inherit; }
button, .file-button, .support-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  min-height: 36px;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}
button:disabled { opacity: .45; cursor: not-allowed; }
input, select {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  min-height: 36px;
  padding: 6px 8px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px clamp(12px, 3vw, 32px);
  background: var(--panel);
  border-bottom: 3px double var(--line);
  position: static;
  z-index: 1;
}
.topbar h1 { margin: 0; font-size: clamp(22px, 3vw, 34px); }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--red) !important; }
.actions, .import-export { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; }
.actions button, .import-export button, .import-export .file-button, .support-button { white-space: nowrap; }
.sync-status {
  align-self: center;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
}
.sync-status.offline, .sync-status.sync-failed { color: var(--red); }
.sync-status.syncing { color: var(--blue); }
.sync-status.synced { color: var(--green); }.help-mode-toggle.active {
  background: var(--gold);
  border-color: #9f7d14;
  color: #1f261e;
}
.help-heading {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.help-info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--blue);
  background: var(--panel);
  color: var(--blue);
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  z-index: 3;
}
.help-info:hover::after,
.help-info:focus-visible::after {
  content: attr(data-help-title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(260px, 80vw);
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--panel);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
  text-align: center;
  pointer-events: none;
}
.section-help-label {
  flex: 1 1 100%;
  color: var(--muted);
  font-weight: 800;
}
.summary-help-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 10px 12px;
  font-weight: 900;
}
.help-card-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(13, 17, 14, .45);
}
.help-card {
  position: relative;
  width: min(480px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  padding: 20px;
}
.help-card h2 { margin: 0 38px 10px 0; }
.help-card p { color: var(--muted); line-height: 1.55; }

.file-button { display: inline-grid; place-items: center; }
.file-button input { display: none; }
main { padding: 18px clamp(10px, 2vw, 28px) 40px; }
.app-loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
}.seo-public-landing {
  display: grid;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px clamp(12px, 4vw, 36px) 42px;
}
.seo-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 34px);
}
.seo-hero h1 {
  max-width: 760px;
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.05;
}
.seo-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}
.seo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.seo-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.seo-feature-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
}
.seo-feature-grid h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.seo-feature-grid p,
.landing-feature-list {
  color: var(--muted);
}
.landing-feature-list {
  padding-left: 20px;
}
.landing-feature-list li {
  margin-bottom: 6px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}
.school-logo, .logo-placeholder {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  background: var(--green);
  color: white;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 28px;
}
.error-banner {
  border: 1px solid var(--red);
  background: #fbe3df;
  color: #71251c;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-weight: 700;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px clamp(10px, 2vw, 28px);
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}
.onboarding {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 520px) minmax(260px, 480px);
  gap: 18px;
  align-items: start;
  justify-content: center;
  padding-top: 42px;
}
.welcome-card, .setup-card, .class-term-strip {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}
.welcome-card h1, .setup-card h1, .setup-card h2 { margin: 0 0 10px; }
.welcome-card p, .setup-card p { color: var(--muted); }
.setup-card {
  display: grid;
  gap: 10px;
}
.setup-card label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.class-term-list, .class-term-strip div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.class-term-list button, .class-term-strip button {
  background: var(--panel);
  color: var(--ink);
}
.class-term-strip {
  margin-bottom: 14px;
}
.class-term-strip button.active {
  background: var(--green);
  color: white;
}
.statistics-mode-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}
.statistics-mode-panel span,
.statistics-mode-panel legend {
  color: var(--muted);
  font-size: 12px;
}
.statistics-mode-panel strong {
  display: block;
  font-size: 20px;
}
.statistics-mode-panel fieldset {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  border: 0;
  margin: 0;
  padding: 0;
}
.statistics-mode-option {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 7px 10px;
  cursor: pointer;
}
.statistics-mode-option.active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
.statistics-mode-option input {
  min-height: auto;
}
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.dashboard article, .summary div, .history, .correction-summary {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px;
}
.dashboard span, .summary span { display: block; color: var(--muted); font-size: 12px; }
.dashboard strong, .summary strong { font-size: 24px; }
.subscription-panel {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 14px;
}
.subscription-panel span, .payment-card span { display: block; color: var(--muted); font-size: 12px; }
.subscription-panel strong { display: block; font-size: 18px; }
.subscription-panel small { color: var(--muted); overflow-wrap: anywhere; }
.subscription-panel.unpaid { border-color: var(--red); }
.subscription-panel.paid { border-color: var(--green); }
.payment-page {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px);
  gap: 14px;
  align-items: start;
  background: var(--panel);
  border: 2px solid var(--green);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.payment-page h2 { margin: 0 0 8px; }
.payment-card { display: grid; gap: 10px; }
.payment-card label { display: grid; gap: 4px; }
.payment-detail {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 10px;
}
.payment-detail strong { display: block; font-size: 18px; }
.payment-detail small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.badge {
  display: inline-block !important;
  width: fit-content;
  padding: 3px 8px;
  color: white;
  background: var(--green);
}
.badge.unpaid { background: var(--red); }
.payment-message { min-height: 20px; color: var(--red); margin: 0; }
.trial-notice {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: #fff6d8;
  color: #3d3212;
  border: 1px solid var(--gold);
  padding: 10px 12px;
  margin-bottom: 14px;
}
.locked-section {
  opacity: .45;
  pointer-events: none;
  filter: grayscale(.25);
}
.toolbar, .forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  align-items: end;
}
.toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.forms form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px;
}
.holiday-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px;
}
.holiday-list span {
  color: var(--muted);
  font-size: 12px;
}
.holiday-list button {
  min-height: 30px;
  padding: 4px 8px;
  background: #f6d8d2;
  color: #72291f;
  border-color: #d49b92;
}
.bulk-attendance-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.bulk-attendance-toolbar strong,
.bulk-attendance-toolbar span,
.bulk-attendance-toolbar em {
  display: block;
}
.bulk-attendance-toolbar span {
  color: var(--muted);
  font-size: 12px;
}
.bulk-attendance-toolbar em {
  color: var(--red);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.bulk-attendance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.register-wrap {
  position: relative;
  overflow: auto;
  max-height: 68vh;
  border: 2px solid var(--line);
  background: var(--panel);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-gutter: stable;
}
.register-wrap::after {
  content: "Scroll attendance columns";
  position: sticky;
  left: 0;
  bottom: 0;
  z-index: 25;
  display: none;
  width: fit-content;
  margin: 0 0 6px 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, .94);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}
.register {
  border-collapse: collapse;
  min-width: 1800px;
  width: max-content;
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 13px;
}
.register th, .register td {
  border: 1px solid var(--line);
  padding: 4px;
  text-align: center;
  min-width: var(--att-col);
  height: 34px;
  background: var(--panel);
  white-space: nowrap;
}
.register thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #efe5c8;
  color: #26372d;
}
body.dark .register thead th { background: #273528; color: var(--ink); }
.register thead tr:nth-child(2) th { top: 34px; }
.register thead tr:nth-child(3) th { top: 68px; }
.week-head { background: var(--green) !important; color: white !important; }
.sticky {
  position: sticky;
  z-index: 12;
  text-align: left !important;
  box-shadow: 1px 0 0 var(--line);
}
.name-col { left: 0; min-width: var(--name-col) !important; max-width: var(--name-col); white-space: normal !important; }
.adm-col { left: var(--name-col); min-width: var(--adm-col) !important; max-width: var(--adm-col); overflow: hidden; text-overflow: ellipsis; }
.sex-col { left: calc(var(--name-col) + var(--adm-col)); min-width: var(--sex-col) !important; max-width: var(--sex-col); text-align: center !important; }
thead .sticky { z-index: 20; }
.symbol button {
  width: 44px;
  min-height: 26px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  font-weight: 800;
  font-family: Georgia, serif;
  line-height: 1;
}
.holiday-head, .holiday-cell {
  background: #f6d8d2 !important;
  color: #72291f !important;
  font-weight: 700;
  min-width: 72px;
}
.total { background: #eef6ea !important; font-weight: 700; }
.percent { color: var(--blue); font-weight: 700; }
.tiny { width: 56px; }
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.history h2 { margin: 0 0 8px; font-size: 18px; }
.history ol { margin: 0; padding-left: 20px; }
.correction-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}
.correction-summary h2 { margin: 0 0 4px; font-size: 18px; }
.correction-summary p { margin: 0; color: var(--muted); }
.correction-summary ol {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}
.correction-modal {
  max-height: min(76vh, 680px);
  overflow: auto;
}
.correction-modal ol {
  margin: 0;
  padding-left: 20px;
}
.correction-modal li { margin-bottom: 8px; }
.history-page {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 14px;
}
.page-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.page-title h2 { margin: 0; }
.history-table-wrap { overflow: auto; border: 1px solid var(--line); }
.history-table { width: 100%; min-width: 980px; border-collapse: collapse; background: var(--panel); }
.history-table th, .history-table td { border: 1px solid var(--line); padding: 8px; text-align: left; }
.history-table th { background: #efe5c8; color: #26372d; }
.support-card, .about-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
  margin-top: 14px;
}
.support-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.support-card.compact {
  box-shadow: none;
}
.support-card h2, .about-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
}
.support-card p, .about-card p {
  margin: 4px 0;
  color: var(--muted);
}
.support-number {
  display: inline-block;
  margin-top: 4px;
}
.support-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.support-button.ghost-link {
  background: var(--panel);
  color: var(--green);
}
.admin-teachers {
  display: grid;
  gap: 12px;
}
.admin-teacher-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
}
.admin-teacher-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.admin-teacher-card p { margin: 3px 0; color: var(--muted); }
.admin-teacher-card small, .admin-term-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.admin-term-list {
  display: grid;
  gap: 8px;
}
.admin-term-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(150px, 180px) minmax(132px, 170px) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 8px;
}
.admin-status {
  border: 1px solid var(--line);
  background: #fff6d8;
  color: #3d3212;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-weight: 700;
}
.admin-term-row select,
.admin-term-row input {
  min-width: 0;
  width: 100%;
}
.status-badge {
  display: inline-block;
  padding: 3px 8px;
  color: white;
  background: var(--muted);
  text-transform: capitalize;
  font-weight: 700;
}
.status-badge.paid { background: var(--green); }
.status-badge.pending { background: var(--gold); color: #2d2410; }
.status-badge.expired { background: var(--red); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, .45);
  display: grid;
  place-items: center;
  padding: 18px;
}
.receipt-modal {
  position: relative;
  width: min(620px, 100%);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .25);
  padding: 22px;
}
.paste-student-modal {
  width: min(760px, 100%);
}
.paste-student-modal p {
  color: var(--muted);
  margin-top: 0;
}
.paste-student-modal textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 10px;
  font: inherit;
}
.paste-preview-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  margin-top: 10px;
}
.paste-preview-table {
  min-width: 0;
}
.paste-warnings {
  border: 1px solid var(--gold);
  background: #fff6d8;
  color: #3d3212;
  padding: 10px;
  margin-top: 10px;
}
.paste-warnings ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 12px;
}
.receipt-modal h2 { margin: 0 0 12px; }
.receipt-modal dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px; }
.receipt-modal dt { color: var(--muted); }
.receipt-modal dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 30px;
  padding: 2px 8px;
}
.paste-student-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 90vh;
  overflow: hidden;
  padding: 0;
}
.paste-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 18px 22px 12px;
}
.paste-student-modal .modal-close {
  position: static;
  flex: 0 0 auto;
}
.paste-modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 22px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.paste-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  align-items: center;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 12px 22px;
  margin-top: 0;
}
.paste-modal-footer strong {
  margin-right: auto;
  color: var(--ink);
}
.paste-preview-wrap {
  max-height: min(34vh, 320px);
  overflow-y: auto;
  overflow-x: auto;
}
.mass-delete-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.mass-delete-list {
  display: grid;
  gap: 6px;
  max-height: min(48vh, 460px);
  overflow: auto;
  border: 1px solid var(--line);
  padding: 8px;
}
.mass-delete-row {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) minmax(120px, auto);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 6px 2px;
}
.mass-delete-row:last-child { border-bottom: 0; }
.mass-delete-row input { min-height: auto; }
.mass-delete-row small { color: var(--muted); overflow-wrap: anywhere; }
.paste-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.help-menu {
  position: relative;
  align-self: center;
}
.help-menu summary {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  min-height: 36px;
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
}
.help-menu[open] {
  z-index: 30;
}
.help-menu[open] > :not(summary) {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.setup-guide-modal {
  width: min(920px, 100%);
  max-height: 90vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}
.setup-guide-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 18px 22px 12px;
}
.setup-guide-header p { color: var(--muted); margin: 4px 0; }
.setup-guide-header .modal-close { position: static; flex: 0 0 auto; }
.setup-guide-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(260px, 1fr);
  gap: 14px;
  padding: 16px 22px 22px;
}
.setup-progress-panel,
.setup-step {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 12px;
}
.setup-progress-panel h3,
.setup-step h3 { margin: 0 0 10px; }
.setup-progress-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}
.setup-progress-item span { color: var(--muted); font-weight: 900; }
.setup-progress-item.done span { color: var(--green); }
.setup-progress-item small { color: var(--muted); }
.setup-step p { color: var(--muted); }
.setup-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 720px) {
  :root {
    --name-col: 150px;
    --adm-col: 92px;
    --sex-col: 40px;
    --att-col: 30px;
  }
  .modal-backdrop { padding: 8px; }
  .help-menu { width: 100%; align-self: stretch; }
  .help-menu summary { width: 100%; text-align: center; }
  .setup-guide-modal { max-height: 94dvh; width: 100%; }
  .setup-guide-header { padding: 14px; }
  .setup-guide-body { grid-template-columns: 1fr; padding: 12px 14px 16px; }
  .setup-step-actions .support-button,
  .setup-step-actions button { flex: 1 1 100%; }
  .paste-student-modal { max-height: 94dvh; width: 100%; }
  .paste-modal-header { padding: 14px 14px 10px; }
  .paste-modal-body { padding: 12px 14px; }
  .paste-modal-footer { padding: 10px 14px; }
  .paste-modal-footer strong { flex: 1 0 100%; }
  .paste-student-modal textarea { min-height: 130px; }
  .paste-preview-wrap { max-height: 30dvh; }
  .mass-delete-row { grid-template-columns: auto 1fr; }
  .mass-delete-row small { grid-column: 2; }
  .mass-delete-list { max-height: 48dvh; }
  .onboarding { grid-template-columns: 1fr; padding-top: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar, .dashboard article, .summary div, .subscription-panel, .payment-page, .forms form, .holiday-list, .class-term-strip, .statistics-mode-panel { box-shadow: none; }
  .brand-block { align-items: flex-start; }
  .actions, .import-export { width: 100%; }
  .actions button, .import-export button, .import-export .file-button { flex: 1 1 132px; }
  .support-card { align-items: stretch; flex-direction: column; }
  .support-actions { justify-content: stretch; }
  .support-button { flex: 1 1 180px; }
  .help-info { width: 34px; min-width: 34px; height: 34px; min-height: 34px; }
  .help-info:hover::after,
  .help-info:focus-visible::after { display: none; }
  .help-card-backdrop { align-items: end; place-items: end center; padding: 0; }
  .help-card {
    width: 100%;
    max-height: 72dvh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  }
  .subscription-panel, .payment-page { grid-template-columns: 1fr; }
  .trial-notice { align-items: flex-start; flex-direction: column; }
  .statistics-mode-panel { align-items: stretch; flex-direction: column; }
  .statistics-mode-panel fieldset { justify-content: stretch; }
  .statistics-mode-option { flex: 1 1 160px; justify-content: center; }
  .bulk-attendance-toolbar { align-items: stretch; flex-direction: column; box-shadow: none; }
  .bulk-attendance-actions { justify-content: stretch; }
  .bulk-attendance-actions button { flex: 1 1 160px; }
  .forms { grid-template-columns: 1fr; }
  .forms form, .holiday-list { display: grid; grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.bulk-attendance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.register-wrap {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    margin-inline: -6px;
    border-left: 0;
    border-right: 0;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: pan-x pan-y;
  }
  .register-wrap::after { display: block; }
  .register {
    min-width: 1040px;
    font-size: 12px;
  }
  .register th, .register td {
    padding: 2px;
    height: 30px;
  }
  .register thead tr:nth-child(2) th { top: 30px; }
  .register thead tr:nth-child(3) th { top: 60px; }
  .sticky { z-index: 8; }
  thead .sticky { z-index: 18; }
  .symbol button {
    width: 32px;
    min-height: 24px;
    font-size: 13px;
  }
  .holiday-head, .holiday-cell { min-width: 54px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
  .tiny { width: 46px; min-height: 28px; padding: 2px; }
  .row-actions button { min-height: 28px; padding: 2px 6px; font-size: 11px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .correction-summary {
    grid-template-columns: 1fr;
    box-shadow: none;
  }
  .admin-teacher-card header,
  .admin-term-row {
    grid-template-columns: 1fr;
  }
  .admin-teacher-card header {
    display: grid;
  }
}
@media (max-width: 480px) {
  :root {
    --name-col: 128px;
    --sex-col: 34px;
    --att-col: 28px;
  }
  main { padding-inline: 8px; }
  .topbar h1 { font-size: 20px; }
  .topbar p { font-size: 12px; }
  .statistics-mode-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}
.statistics-mode-panel span,
.statistics-mode-panel legend {
  color: var(--muted);
  font-size: 12px;
}
.statistics-mode-panel strong {
  display: block;
  font-size: 20px;
}
.statistics-mode-panel fieldset {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  border: 0;
  margin: 0;
  padding: 0;
}
.statistics-mode-option {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 7px 10px;
  cursor: pointer;
}
.statistics-mode-option.active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
.statistics-mode-option input {
  min-height: auto;
}
.dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard article, .summary div { padding: 8px; }
  .dashboard strong, .summary strong { font-size: 18px; }
  .toolbar { grid-template-columns: 1fr; }
  .register {
    min-width: 980px;
    font-size: 11px;
  }
  .register .adm-col {
    display: none;
  }
  .register .sex-col {
    left: var(--name-col);
  }
  .name-col {
    min-width: var(--name-col) !important;
    max-width: var(--name-col);
  }
  .symbol button {
    width: 30px;
    font-size: 12px;
  }
  .week-head { font-size: 11px; }
  .actions button, .import-export button, .import-export .file-button, .support-button { flex-basis: 100%; }
  .statistics-mode-option { flex-basis: 100%; }
  .bulk-attendance-actions button { flex-basis: 100%; }
}
@media print {
  .help-info, .help-card-backdrop, .help-mode-toggle { display: none !important; }
  .topbar, .toolbar, .forms, .history, .correction-summary { display: none; }
  main { padding: 0; }

.bulk-attendance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.register-wrap { max-height: none; overflow: visible; border: 0; }
  .register { font-size: 8px; min-width: 0; width: 100%; }
  .register th, .register td { padding: 2px; min-width: 18px; height: 20px; }
  .register .adm-col { display: table-cell; }
  .register-wrap::after { display: none; }
  body.printing-receipt > *:not(.modal-backdrop) { display: none !important; }
  body.printing-receipt .modal-backdrop { position: static; display: block; background: white; padding: 0; }
  body.printing-receipt .receipt-modal { box-shadow: none; border: 0; width: 100%; }
  body.printing-receipt .modal-close,
  body.printing-receipt .receipt-modal button { display: none; }
}













