:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #f5f8fc;
  font-synthesis: none;
  --blue: #103468;
  --blue-soft: #e8f5fd;
  --sky: #50b8f0;
  --yellow: #f8d050;
  --pink: #f7aab3;
  --green: #16784a;
  --green-soft: #e7f7ef;
  --red: #c53b36;
  --red-soft: #fff0ef;
  --border: #d4e0ee;
  --muted: #506078;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f5f8fc;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.app-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 255, 255, .7);
}

.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 18px;
}

.login-card {
  width: 100%;
  padding: 30px 22px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: white;
  box-shadow: 0 18px 48px rgba(28, 46, 80, .13);
  text-align: center;
}

.login-mark { margin: 0 auto 18px; }
.login-help { margin: 10px 0 24px; color: var(--muted); line-height: 1.5; }
.pin-field { display: block; margin-bottom: 8px; text-align: left; font-size: 13px; font-weight: 850; }
.pin-input {
  width: 100%;
  height: 68px;
  border: 2px solid #96c9ea;
  border-radius: 17px;
  color: #172033;
  background: #f8fbff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .34em;
  text-align: center;
}
.pin-input:focus { outline: 4px solid rgba(18, 70, 160, .12); border-color: var(--blue); }
.login-error { min-height: 22px; margin: 8px 0 6px; color: var(--red); font-size: 13px; font-weight: 750; }
.login-card .primary-button { width: 100%; }

.teacher-bar {
  position: sticky;
  z-index: 9;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
  border-bottom: 2px solid var(--sky);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}
#teacher-name { min-width: 0; overflow-wrap: anywhere; }
.teacher-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.teacher-bar button {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 850;
  white-space: nowrap;
}
.admin-panel { max-height: min(88vh, 820px); overflow-y: auto; }
.teacher-account-list { display: grid; gap: 12px; padding-bottom: 18px; }
.teacher-account-card { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--border); border-radius: 17px; background: #f8fafc; }
.teacher-account-heading { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.teacher-account-heading b { font-size: 18px; }
.teacher-account-heading small { color: var(--muted); }
.teacher-account-card label { display: grid; gap: 5px; color: #48546a; font-size: 12px; font-weight: 800; }
.teacher-account-card input[type="text"], .teacher-account-card input[type="password"] { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: white; color: #172033; }
.teacher-account-card .teacher-status { display: flex; align-items: center; grid-template-columns: auto 1fr; font-size: 14px; }
.teacher-account-card .teacher-status input { width: 22px; height: 22px; }
.teacher-account-card .quick-button { width: 100%; margin: 0; }

.view { padding: 18px 18px max(28px, env(safe-area-inset-bottom)); }

.brand-header, .attendance-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-header { justify-content: space-between; }
.brand-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  height: 54px;
  border-radius: 16px;
  color: white;
  background: var(--blue);
  font-size: 27px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(18, 70, 160, .22);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .1em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 7vw, 34px); line-height: 1.18; letter-spacing: -.03em; }

.branch-grid, .class-grid { display: grid; gap: 13px; }
.class-session { display: grid; gap: 10px; }
.class-session h3 { margin: 10px 0 0; font-size: 16px; }

.branch-card, .class-card {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: inherit;
  background: white;
  box-shadow: 0 7px 22px rgba(28, 46, 80, .07);
  cursor: pointer;
}

.branch-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: 1fr 1fr;
  column-gap: 15px;
  padding: 16px;
  text-align: left;
}

.branch-card:active, .class-card:active, .status-btn:active, .primary-button:active { transform: scale(.985); }

.branch-code {
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  width: 56px;
  height: 56px;
  align-self: center;
  border-radius: 16px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 14px;
  font-weight: 900;
}

.branch-name { align-self: end; font-size: 21px; font-weight: 850; }
.branch-english { color: var(--muted); font-size: 14px; }

.device-note {
  margin: 24px 6px 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

.back-button, .text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.section-heading { margin: 16px 0 20px; }

.date-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
  font-weight: 800;
}

.date-field input {
  min-height: 44px;
  max-width: 172px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 10px;
  color: #172033;
  background: #f8fafc;
}

.class-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 18px;
  text-align: left;
}

.class-card span { display: grid; gap: 3px; }
.class-card b { font-size: 19px; font-style: normal; font-weight: 850; }
.class-card em { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 650; }
.class-card small { color: var(--muted); }

.attendance-view { padding-inline: 0; padding-bottom: 0; }
.attendance-header { padding: 0 18px; margin-bottom: 16px; }
.attendance-header .compact { flex: 0 0 58px; }
.attendance-header h1 { font-size: 22px; }
.attendance-header p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 18px 12px;
}

.summary-bar span {
  display: grid;
  place-items: center;
  min-height: 62px;
  border-radius: 15px;
  color: #48546a;
  background: white;
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 12px;
}

.summary-bar b { color: #172033; font-size: 23px; line-height: 1; }
.summary-bar .needs-action { color: #9c6a00; background: #fff8e3; box-shadow: inset 0 0 0 1px #f2dca0; }
.summary-bar .complete { color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px #bde7d1; }

.quick-button {
  width: calc(100% - 36px);
  min-height: 50px;
  margin: 0 18px;
  border: 1px solid #96c9ea;
  border-radius: 14px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 850;
  cursor: pointer;
}

.hint { margin: 12px 18px 9px; color: var(--muted); font-size: 12px; text-align: center; }
.roster { margin: 0; padding: 0 18px 120px; list-style: none; }

.student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
  margin-bottom: 10px;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: white;
  box-shadow: 0 4px 16px rgba(26, 46, 80, .06);
}

.student-row.present { border-color: #a9dec2; background: #fbfffd; }
.student-row.absent { border-color: #f1b8b5; background: #fffdfd; }
.student-info { display: flex; align-items: center; gap: 10px; min-width: 0; }

.student-info strong { display: block; font-size: 17px; }
.student-info small { display: block; margin-top: 3px; color: #98a2b3; font-size: 11px; }
.student-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; }
.student-name-line strong { min-width: 0; }

.talk-button {
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.talk-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 9px;
  color: white;
  background: var(--blue);
  font-size: 10px;
}
.status-actions { display: flex; gap: 7px; flex: 0 0 auto; }

.status-btn {
  min-width: 58px;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: #5d677a;
  background: #f8fafc;
  font-weight: 900;
  cursor: pointer;
}

.status-btn span { font-size: 18px; }
.present-btn.active { border-color: var(--green); color: white; background: var(--green); box-shadow: 0 7px 16px rgba(22, 120, 74, .2); }
.absent-btn.active { border-color: var(--red); color: white; background: var(--red); box-shadow: 0 7px 16px rgba(197, 59, 54, .2); }

.sticky-finish {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 0;
  width: min(100%, 540px);
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(220, 227, 239, .9);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}

.primary-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: var(--blue);
  box-shadow: 0 9px 22px rgba(18, 70, 160, .22);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button:disabled { color: #97a0ae; background: #e6e9ee; box-shadow: none; cursor: not-allowed; }
.sticky-finish small { display: block; margin-top: 5px; color: var(--muted); text-align: center; font-size: 10px; }

.completion {
  min-height: calc(100vh - 110px);
  padding: 36px 20px;
  text-align: center;
}

.completion h2 { margin-bottom: 9px; font-size: 30px; }
.completion > p { color: var(--muted); line-height: 1.6; }

.completion-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 25px 0 12px;
}

.completion-counts span, .absent-list {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: white;
}

.completion-counts b { display: block; margin-bottom: 3px; font-size: 30px; }
.absent-list { margin-bottom: 24px; text-align: left; }
.absent-list p { margin: 7px 0 0; color: var(--muted); }
.completion .text-button { width: 100%; margin-top: 8px; }

.edit-view { padding-bottom: 110px; }
.edit-header { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; margin-bottom: 18px; }
.edit-header h1 { font-size: 25px; }
.edit-branch-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }

.edit-branch-tab {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: #596579;
  background: white;
  font-weight: 850;
  cursor: pointer;
}

.edit-branch-tab.active { border-color: var(--blue); color: white; background: var(--blue); }
.edit-help { margin: 12px 3px 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.edit-class-list { display: grid; gap: 14px; }

.edit-class-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: white;
  box-shadow: 0 6px 20px rgba(26, 46, 80, .06);
}

.edit-class-card summary { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 13px 15px; cursor: pointer; list-style: none; }
.edit-class-card summary::-webkit-details-marker { display: none; }
.edit-class-card summary strong { font-size: 17px; }
.edit-class-card summary small { color: var(--muted); }
.edit-class-card[open] summary { border-bottom: 1px solid var(--border); }
.edit-class-body { padding: 14px; }
.edit-class-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 13px; }
.edit-field { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 750; }

.edit-field input, .student-edit-row input, .student-edit-row select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 10px;
  color: #172033;
  background: #fbfcfe;
}

.student-edit-list { display: grid; gap: 9px; }
.student-edit-row { padding: 11px; border: 1px solid #e7ebf2; border-radius: 14px; background: #f9fbfd; }
.student-edit-main { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; }
.student-edit-number { color: var(--muted); text-align: center; font-size: 12px; font-weight: 850; }
.student-edit-more { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 8px 0 0 40px; }

.mini-delete, .danger-text-button {
  border: 0;
  color: var(--red);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.mini-delete { min-width: 44px; min-height: 44px; font-size: 13px; }
.student-add-button { width: 100%; min-height: 46px; margin-top: 11px; border: 1px dashed #96c9ea; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-weight: 850; cursor: pointer; }
.class-delete-button { width: 100%; min-height: 42px; margin-top: 12px; border: 1px solid #f0c4c2; border-radius: 11px; color: var(--red); background: var(--red-soft); font-weight: 800; cursor: pointer; }
.edit-bottom-actions { display: grid; gap: 8px; margin-top: 16px; }
.edit-add-class { width: 100%; margin: 0; }
.danger-text-button { min-height: 44px; }

.sticky-save {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: 0;
  width: min(100%, 540px);
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(220, 227, 239, .9);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px);
}

.note-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  top: var(--visible-top, 0px);
  bottom: auto;
  height: 100%;
  height: var(--visible-height, 100dvh);
  background: rgba(15, 25, 45, .48);
  backdrop-filter: blur(4px);
}

.note-panel {
  width: min(100%, 540px);
  max-height: 92vh;
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
  max-height: calc(var(--visible-height, 100dvh) - max(12px, env(safe-area-inset-top)));
  overscroll-behavior: contain;
  overflow-y: auto;
  padding: 20px 18px max(24px, env(safe-area-inset-bottom));
  border-radius: 25px 25px 0 0;
  background: #f7f9fc;
  box-shadow: 0 -16px 50px rgba(15, 25, 45, .22);
}

.note-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.note-header h2 { margin: 0; font-size: 23px; }
.note-close-button { flex: 0 0 46px; width: 46px; height: 46px; border: 0; border-radius: 14px; color: #536078; background: #e9edf4; font-size: 28px; cursor: pointer; }
.note-compose { display: grid; gap: 7px; margin-bottom: 12px; color: #4e5a70; font-size: 13px; font-weight: 800; }

.note-compose textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 13px;
  color: #172033;
  background: white;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}

.note-history-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.note-history-heading small { color: var(--muted); }
.note-history { display: grid; gap: 9px; }
.note-empty { padding: 23px 15px; border: 1px dashed #cbd3df; border-radius: 15px; color: var(--muted); text-align: center; font-size: 13px; }
.note-entry { padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: white; }
.note-entry p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.note-entry-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.note-entry-delete { min-height: 44px; border: 0; color: var(--red); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }

@media (min-width: 541px) {
  .app-shell { margin-top: 20px; min-height: calc(100vh - 40px); border-radius: 28px 28px 0 0; box-shadow: 0 20px 60px rgba(30, 52, 90, .13); }
}

@media (max-width: 370px) {
  .brand-mark { flex-basis: 46px; height: 46px; }
  .brand-header h1 { font-size: 22px; }
  .student-row { padding: 9px; }
  .student-info strong { font-size: 15px; }
  .status-btn { min-width: 52px; }
  .student-edit-more { grid-template-columns: 1fr; }
}


button { touch-action: manipulation; }
.student-info > span:last-child { min-width: 0; }
.student-name-line strong { overflow-wrap: anywhere; }
.student-edit-main { grid-template-columns: 32px minmax(0, 1fr) auto; }
.edit-class-fields, .student-edit-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.edit-field input, .student-edit-row input, .student-edit-row select,
.teacher-account-card input, .date-field input { min-width: 0; font-size: 16px; }
#attendance-weekday { white-space: nowrap; }
.date-field { flex-wrap: wrap; }
:root { scroll-padding-top: 110px; scroll-padding-bottom: 110px; }
.sticky-finish, .sticky-save { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

@media (max-width: 420px) {
  .student-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .status-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-edit-more { grid-template-columns: minmax(0, 1fr); margin-left: 0; }
}

#change-confirmation {
  width: min(calc(100% - 32px), 390px);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: inherit;
  background: white;
}
#change-confirmation::backdrop { background: rgba(15, 25, 45, .55); }
#change-confirmation h2 { margin: 0; font-size: 20px; }
#change-confirmation p { margin: 10px 0 18px; overflow-wrap: anywhere; }
#change-confirmation form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#change-confirmation button {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 850;
}
#change-confirmation button[value="confirm"] { color: white; background: var(--blue); }

.history-entry { width: 100%; margin: 0 0 12px; }
.history-filters { display: grid; gap: 8px; margin-bottom: 12px; }
.history-filters label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 750; }
.history-filters input, .history-filters select {
  min-height: 44px;
  padding: 0 10px;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}
.history-class { margin-bottom: 10px; }
.history-class ul { margin: 0; padding: 0 14px; list-style: none; }
.history-class li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.history-class li span { overflow-wrap: anywhere; }
.history-class li strong { flex-shrink: 0; }

.history-class summary { flex-wrap: wrap; gap: 8px; }
.history-class li { align-items: center; }
.history-counts { display: flex; flex-wrap: wrap; gap: 5px; }
.history-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.history-present { color: #125f38; background: #e1f5e9; }
.history-absent { color: #982b26; background: #ffebe9; }
.history-unmarked { color: #455064; background: #edf1f6; }

.class-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
.class-card .class-progress { display: flex; grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.class-card .history-status { display: inline-block; }

#absence-reason { width: 100%; font: inherit; font-size: 16px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.history-class li strong { flex-shrink: 1; white-space: normal; overflow-wrap: anywhere; }

.student-profile-button {
  min-height: 44px;
  padding: 0;
  text-align: left;
  color: var(--blue);
  background: none;
  border: 0;
  font-weight: 850;
  cursor: pointer;
  overflow-wrap: anywhere;
}
#student-profile-dialog {
  width: min(calc(100% - 32px), 440px);
  max-height: 85dvh;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  color: inherit;
  overflow-wrap: anywhere;
}
#student-profile-dialog::backdrop { background: rgba(15, 25, 45, .55); }
#student-profile-dialog h2, #student-profile-details dd { margin: 0; }
#student-profile-details dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; }
#student-profile-details dt { font-weight: 750; }

#student-profile-details form { display: grid; gap: 8px; margin: 12px 0; }
#student-profile-details label { display: grid; gap: 3px; font-weight: 750; }
#student-profile-details input { width: 100%; min-height: 42px; padding: 7px; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; }

.student-reminder {
  display: block;
  margin: 4px 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: #fff4cd;
  border-inline-start: 3px solid var(--yellow);
  color: #70490a;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.student-allergy { background: #fce6e4; color: #87251d; border-inline-start-color: var(--red); }

.student-reminder-empty { border: 0; background: transparent; color: var(--muted); padding: 2px 0; }

/* Shared action styling for compact controls and expandable cards. */
button:focus-visible, summary:focus-visible {
  outline: 3px solid #2879aa;
  outline-offset: 2px;
}
.back-button, .text-button, .student-profile-button, .note-close-button,
.mini-delete, .note-entry-delete, .danger-text-button {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.student-profile-button { max-width: 100%; line-height: 1.35; }
.note-close-button { flex: 0 0 auto; width: auto; height: auto; color: var(--blue); font-size: 14px; font-weight: 750; }
.student-row { border-width: 1px; border-color: var(--border); box-shadow: none; }
.login-card, .edit-class-card, .branch-card, .class-card, .primary-button,
.present-btn.active, .absent-btn.active { box-shadow: none; }
.disclosure-label {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  white-space: nowrap;
}
.disclosure-label span:last-child, details[open] > summary .disclosure-label span:first-child { display: none; }
details[open] > summary .disclosure-label span:last-child { display: inline; }

.primary-button:not(:disabled) {
  color: var(--blue);
  background: var(--sky);
  border: 1px solid #3199d2;
}
#open-history, #mark-all-present {
  color: var(--blue);
  background: var(--yellow);
  border-color: #cda22c;
}
.branch-card[data-branch="temerloh"] { background: #fff5d4; border-color: #e9c45a; }
.branch-card[data-branch="temerloh"] .branch-code { background: var(--yellow); }
.branch-card[data-branch="mentakab"] { background: #e6f5ff; border-color: #89c9ed; }
.branch-card[data-branch="mentakab"] .branch-code { background: var(--sky); }
.branch-card[data-branch="kuantan"] { background: #ffedf0; border-color: #efb2bd; }
.branch-card[data-branch="kuantan"] .branch-code { background: var(--pink); }

.daily-reminders { border: 1px solid #e9c45a; border-radius: 14px; background: #fff5d4; margin: 0 0 12px; padding: 12px; }
#class-reminders { margin-inline: 18px; }
.daily-reminders h2 { font-size: 16px; margin: 0 0 8px; }
.daily-reminders ul { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.daily-reminders li { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.daily-reminders strong, .daily-reminders li span { display: block; overflow-wrap: anywhere; }
.daily-reminders strong { font-size: 12px; color: var(--muted); }
.daily-reminders button { min-height: 44px; padding: 6px 10px; color: var(--blue); background: white; border: 1px solid var(--border); border-radius: 8px; white-space: nowrap; }
.reminder-create { width: 100%; margin: 0 0 12px; }
#reminder-dialog { width: min(calc(100% - 32px), 420px); max-height: 85dvh; padding: 18px; border: 1px solid var(--border); border-radius: 16px; color: inherit; }
#reminder-dialog::backdrop { background: rgba(15, 25, 45, .55); }
#reminder-form { display: grid; gap: 9px; }
#reminder-form label { display: grid; gap: 3px; }
#reminder-form input, #reminder-form select, #reminder-form textarea { font: inherit; font-size: 16px; min-height: 42px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; }
#reminder-status:empty, #reminder-save-status:empty { display: none; }

#absence-report { display: block; width: 100%; margin: 8px 0 12px; padding: 10px; resize: vertical; border: 1px solid var(--border); border-radius: 8px; background: #f8fbff; color: inherit; font: inherit; line-height: 1.5; }
#copy-absence-report { margin-bottom: 0; }
#copy-absence-status:empty { display: none; }

.roster-grade-heading { margin: 14px 0 8px; padding: 7px 10px; border-radius: 8px; background: var(--grade-soft); color: var(--blue); }
.roster-grade-heading h2 { margin: 0; font-size: 16px; }
.roster-grade-1 { --grade-soft: #fff2c7; --grade-accent: #d59912; }
.roster-grade-2 { --grade-soft: #e1f4ff; --grade-accent: #258bcc; }
.roster-grade-3 { --grade-soft: #ffe8ef; --grade-accent: #cc5888; }
.roster-grade-4 { --grade-soft: #e8f6e7; --grade-accent: #529651; }
.student-row[class*="roster-grade-"] { border-inline-start: 4px solid var(--grade-accent); }

.roll-call-date { margin-inline: 18px; }
#manage-branch-reminders { margin-bottom: 12px; }
.roster-session { margin: 20px 0 8px; padding: 10px 12px; border-radius: 8px; color: var(--blue); background: #e8edf4; }
.roster-session h2 { margin: 0; font-size: 19px; }
.roster-session-morning { background: #9ddcff; }
.roster-session-afternoon { background: #ffd978; }
.roster-grade-5 { --grade-soft: #efe7fc; --grade-accent: #8260ba; }
.roster-grade-6 { --grade-soft: #ffeadd; --grade-accent: #d2723c; }
.roster-grade-7 { --grade-soft: #e0f5f1; --grade-accent: #358b80; }
.roster-grade-8 { --grade-soft: #eef0f4; --grade-accent: #708196; }

.home-actions, .log-card { display: grid; gap: 14px; }
.home-actions .quick-button { width: 100%; margin: 0; background: var(--yellow); border-color: #cda22c; }
.log-card { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: white; }
.log-card label { display: grid; gap: 5px; font-weight: 750; }
.log-card input, .log-card textarea { width: 100%; min-height: 44px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; background: #f8fbff; color: inherit; font: inherit; font-size: 16px; }
.log-card textarea { resize: vertical; }
#copy-teacher-log-status { margin: 0; }
#copy-teacher-log-status:empty { display: none; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.admin-actions .quick-button { flex: 1 1 120px; width: auto; margin: 0; }
#add-teacher-form { margin-bottom: 12px; }
#add-teacher-form input, #add-teacher-form select { width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 16px; }
#add-teacher-status { margin: 0; }
#add-teacher-status:empty { display: none; }

.approval-dialog { width: min(calc(100% - 32px), 480px); max-height: 85dvh; padding: 18px; border: 1px solid var(--border); border-radius: 16px; color: inherit; }
.approval-dialog::backdrop { background: rgba(15, 25, 45, .55); }
#roster-approval-list { display: grid; gap: 10px; margin-bottom: 12px; }
#roster-approval-list ul { padding-inline-start: 20px; margin: 0; overflow-wrap: anywhere; }
#roster-approval-list p { margin: 0; }

/* Material-inspired roles shared by the staff workspace and its dialogs. */
:root {
  --ink: #182437;
  --surface: #f8faff;
  --surface-low: #eef3fa;
  --surface-raised: #e7eef8;
  --blue: #175d96;
  --blue-soft: #dceeff;
  --border: #cbd5e2;
  --outline: #788598;
  --muted: #506078;
  --green: #126749;
  --red: #a12d39;
  --warning: #624500;
  --warning-surface: #fff0c3;
  --shell-width: 580px;
  color: var(--ink);
  background: var(--surface-low);
}

body { background: var(--surface-low); }
.app-shell {
  width: min(100%, var(--shell-width));
  min-height: 100dvh;
  margin-top: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
@media (min-width: 700px) {
  .app-shell { border-inline: 1px solid var(--border); }
}
h1 { font-weight: 750; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 720; }
.brand-mark { width: 54px; box-shadow: none; background: var(--blue-soft); color: var(--blue); }
.login-card { max-width: 390px; background: var(--surface-raised); border: 0; border-radius: 28px; }
.pin-input { background: white; border: 1px solid var(--outline); }
.pin-input:focus { outline: 2px solid var(--blue); outline-offset: 2px; }

.teacher-bar {
  padding: calc(7px + env(safe-area-inset-top)) 16px 7px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 650;
}
.teacher-actions { gap: 2px; }
.teacher-bar button, .back-button, .text-button, .note-close-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  border-radius: 999px;
  font-weight: 700;
}
#global-edit-button { background: var(--blue-soft); padding-inline: 13px; }
#logout-button { color: var(--muted); }
button { font-weight: 700; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; }
.primary-button, .primary-button:not(:disabled),
#change-confirmation button[value="confirm"] {
  min-height: 48px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--blue);
  box-shadow: none;
  font-size: 16px;
  font-weight: 730;
}
.primary-button:disabled { color: #526177; background: #e0e6f0; }
.quick-button, #open-history, .student-add-button, .daily-reminders button,
#change-confirmation button {
  min-height: 44px;
  padding: 6px 13px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}
#change-confirmation button[value="confirm"] {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.quick-button:disabled { color: var(--muted); border-color: var(--border); }
.mini-delete, .note-entry-delete, .danger-text-button, .class-delete-button {
  background: transparent;
  color: var(--red);
  border: 1px solid transparent;
  border-radius: 999px;
}
@media (hover: hover) {
  button:not(:disabled):hover { filter: brightness(.94); }
}
.home-actions { gap: 12px; }
#home-view .section-heading { margin: 16px 0 22px; }
.attendance-hero { padding: 22px; background: var(--blue-soft); border-radius: 28px; }
.attendance-hero h2 { margin: 11px 0 18px; font-size: 26px; }
.ui-icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.hero-icon { display: grid; place-items: center; width: 49px; height: 49px; border-radius: 16px; background: #f2f8ff; color: var(--blue); }
.home-shortcut {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 13px;
  min-height: 60px;
  padding: 12px 16px;
  text-align: left;
  color: var(--ink);
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
}
.home-shortcut .ui-icon { color: var(--blue); }
.branch-card[data-branch], .class-card { background: white; border-color: var(--border); }
.branch-card[data-branch] .branch-code { background: var(--blue-soft); }
.branch-card[data-branch="temerloh"] .branch-code { background: #fbefcf; color: #694700; }
.branch-card[data-branch="kuantan"] .branch-code { background: #eeebfc; color: #514482; }
.date-field, .log-card, .edit-class-card, .teacher-account-card { box-shadow: none; background: white; }
.edit-branch-tab { border-color: var(--outline); border-radius: 999px; color: var(--blue); }
.edit-branch-tab.active { border-color: var(--blue); background: var(--blue); color: white; }

.attendance-header { align-items: flex-start; gap: 8px; }
.attendance-header .compact { flex: 0 0 auto; }
.attendance-header > div { min-width: 0; align-self: center; }
.summary-bar span { min-height: 56px; background: var(--surface-low); font-size: 13px; }
#mark-all-present { display: block; margin-left: auto; margin-right: 18px; width: auto; background: transparent; border-color: var(--outline); color: var(--blue); }
.hint { font-size: 13px; line-height: 1.5; }
.daily-reminders { background: var(--warning-surface); border-color: #d7bc71; color: var(--warning); }
.daily-reminders button { background: white; }
.roster { padding-bottom: calc(103px + env(safe-area-inset-bottom)); }
.roster-grade-heading, .roster-session { background: var(--surface-raised); color: var(--ink); }
.roster-session { border-inline-start: 3px solid var(--blue); }
.student-row, .student-row.present, .student-row.absent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 8px;
  margin: 0;
  min-height: 64px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.student-row[class*="roster-grade-"] { border-inline-start: 0; }
.student-info { display: block; }
.student-name-line { column-gap: 5px; row-gap: 0; }
.student-profile-button {
  padding: 3px 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  text-decoration: underline;
  text-decoration-color: #8fa9c2;
  text-underline-offset: 4px;
}
.talk-button {
  padding: 3px 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
}
.student-info small { color: var(--muted); font-size: 13px; margin: 2px 4px; }
.student-reminder { color: var(--warning); background: var(--warning-surface); }
.student-allergy { color: #802434; background: #ffedf0; }
.status-actions { display: flex; gap: 6px; }
.status-btn {
  width: 56px;
  min-width: 0;
  min-height: 44px;
  padding: 0 5px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 730;
}
.status-btn[aria-pressed="true"]::before {
  display: inline-block;
  width: 8px;
  height: 4px;
  margin: 0 4px 3px 0;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
  content: "";
}
.sticky-finish, .sticky-save {
  width: min(100%, var(--shell-width));
  background: var(--surface);
  border-top-color: var(--border);
  backdrop-filter: none;
}
.sticky-finish { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.finish-progress strong { font-size: 15px; }
.finish-progress small { text-align: left; font-size: 12px; }

#student-profile-dialog, #change-confirmation, .approval-dialog, #reminder-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}
#student-profile-dialog { width: min(calc(100% - 28px), 480px); padding: 20px; }
#student-profile-dialog #student-profile-title { margin-bottom: 15px; }
#student-profile-details > div > p { color: var(--muted); font-size: 14px; }
.profile-section { margin-bottom: 9px; padding: 13px; border-radius: 16px; background: var(--surface-low); }
.profile-section h3 { margin: 0 0 8px; font-size: 16px; }
.profile-section dl, .profile-section p { margin: 0; font-size: 14px; }
.profile-section dt { color: var(--muted); }
.profile-section .profile-allergy { padding: 8px; border-radius: 8px; color: var(--warning); background: var(--warning-surface); }
.profile-close { text-align: right; }
.note-panel { width: min(100%, var(--shell-width)); background: var(--surface); }

#teacher-log-form select { min-height: 44px; font: inherit; background: white; border: 1px solid var(--outline); border-radius: 12px; padding: 6px; }
#log-sync-status { margin: 0; color: var(--muted); font-size: 14px; }
#log-day-notes { min-width: 0; border: 1px solid var(--border); border-radius: 14px; }
#log-day-notes label { display: flex; align-items: center; gap: 8px; min-height: 44px; overflow-wrap: anywhere; }
#log-day-notes input { width: 20px; min-height: 20px; flex: 0 0 20px; }
#log-tag-options { display: grid; gap: 4px; padding: 6px; border-radius: 14px; background: var(--surface-low); }
#log-tag-options button { min-height: 44px; border: 0; border-radius: 10px; background: white; color: var(--blue); text-align: left; padding-inline: 12px; }
#log-teacher-mentions summary { cursor: pointer; min-height: 44px; align-content: center; }
#log-teacher-mentions li { overflow-wrap: anywhere; margin-bottom: 8px; }
#log-tag-status { margin: 0; padding: 4px 6px; color: var(--muted); font-size: 13px; }
#log-tag-list { display: grid; gap: 4px; max-height: 190px; overflow-y: auto; }
#log-tag-list button:focus-visible { outline-offset: -3px; }

.activity-stack { display: grid; gap: 12px; }
#activity-title { margin: 10px 0 16px; }
#activity-message { margin-bottom: 10px; color: var(--muted); }
#activity-message:empty { display: none; }
.activity-button, .activity-card {
  min-height: 44px; padding: 6px 12px; border: 1px solid var(--outline);
  border-radius: 14px; background: white; color: var(--blue); cursor: pointer;
}
.activity-card { display: grid; gap: 4px; text-align: left; padding: 13px; }
.activity-card small, .activity-student small { display: block; color: var(--muted); font-size: 13px; }
.activity-stack label { display: grid; gap: 4px; }
.activity-stack input:not([type="checkbox"]), .activity-stack textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--outline); border-radius: 10px;
  padding: 7px 10px; background: white; color: var(--ink); font: inherit;
}
.activity-choices { min-width: 0; border: 1px solid var(--border); border-radius: 14px; }
.activity-choice-list { max-height: 190px; overflow-y: auto; margin-top: 6px; }
.activity-choice-list label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.activity-choice-list input { width: 20px; height: 20px; flex: 0 0 auto; }
.activity-summary { padding: 10px; background: var(--blue-soft); border-radius: 12px; }
.activity-roster { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.activity-student { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.activity-marks { display: flex; gap: 4px; }
.activity-marks button { padding-inline: 7px; }
.activity-marks [aria-pressed="true"] { background: var(--blue); color: white; border-color: var(--blue); }

.activity-team-board { display: grid; gap: 10px; }
.activity-team { padding: 12px; background: white; border: 1px solid var(--border); border-radius: 14px; }
.activity-team h3, .activity-team p { margin: 0 0 5px; }
.activity-team p { color: var(--muted); }
.activity-stack select { min-height: 44px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--outline); border-radius: 10px; background: white; font: inherit; }
.activity-stack .activity-parent-option { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.activity-student button[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); }

#staff-helper-title { margin: 10px 0; }
.staff-helper-intro { color: var(--muted); }
.staff-helper-card { margin: 12px 0; padding: 14px; border-radius: 18px; border: 1px solid var(--border); background: white; }
.staff-helper-card h2 { margin: 0 0 7px; font-size: 18px; }
.staff-helper-card p { margin: 0 0 8px; white-space: pre-line; line-height: 1.55; }
.staff-helper-card p:empty { display: none; }
#staff-helper-form { display: grid; gap: 8px; }
#staff-helper-question { width: 100%; min-height: 46px; padding: 8px 10px; border: 1px solid var(--outline); border-radius: 12px; font: inherit; }
#staff-helper-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

#home-view { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.cat-helper-float {
  position: fixed;
  right: max(14px, calc((100vw - var(--shell-width)) / 2 + 14px));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.cat-helper-greeting {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 2px 0 12px;
  margin-bottom: 10px;
  background: #fff6e5;
  color: #513421;
  border: 1px solid #d8a76b;
  border-radius: 18px 18px 5px 18px;
  font-size: 14px;
}
.cat-helper-greeting button, #staff-helper-close {
  min-width: 44px; min-height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: #62422c; font-size: 22px; cursor: pointer;
}
#open-staff-helper {
  display: grid; place-items: center;
  width: 82px; height: 82px; padding: 0; border: 1px solid #d8a76b; border-radius: 50%;
  background: #fff6e5; box-shadow: 0 5px 16px rgb(83 54 30 / 18%); cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .cat-helper-greeting { animation: cat-greeting-in 260ms ease-out both; }
  @keyframes cat-greeting-in {
    from { opacity: 0; transform: translate(7px, 6px) scale(.95); }
    to { opacity: 1; transform: none; }
  }
}
#staff-helper-dialog {
  width: min(calc(100% - 24px), 520px);
  max-height: min(80dvh, 680px);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface);
  overscroll-behavior: contain;
}
#staff-helper-dialog::backdrop { background: rgb(24 36 55 / 44%); }
.cat-helper-header { display: grid; grid-template-columns: 48px minmax(0, 1fr) 44px; align-items: center; gap: 9px; }
.cat-helper-header #staff-helper-title { margin: 0; font-size: 21px; }

#open-staff-helper {
  width: 92px;
  height: 92px;
  background: radial-gradient(circle at 40% 30%, #fff8e8 20%, #ffe8c2 100%);
}
.cat-motion { display: block; border-radius: 50%; overflow: hidden; pointer-events: none; }
.cat-motion video { display: block; object-fit: cover; }
.cat-motion img { display: none; }
@media (prefers-reduced-motion: reduce) {
  .cat-motion video { display: none; }
  #open-staff-helper .cat-motion img, .cat-helper-header .cat-motion img { display: block; }
}
@media (prefers-reduced-motion: no-preference) {
  #open-staff-helper { animation: live-cat-entrance 430ms cubic-bezier(.19,.8,.3,1.22) both; }
  @keyframes live-cat-entrance {
    from { opacity: 0; transform: translateY(18px) scale(.82); }
    to { opacity: 1; transform: none; }
  }
}

.fee-tools,#fee-tabs,.fee-row{display:flex;gap:.65rem;align-items:center}.fee-tools{flex-wrap:wrap}.fee-tools label{display:grid;gap:.3rem;flex:1}.fee-tools select,.fee-tools input,#fee-tabs button{font:inherit;border:1px solid #ccd6df;background:white;border-radius:12px;padding:.65rem;color:#263e52}.fee-tools input{min-width:0;width:100%}#fee-tabs{margin-top:1rem;flex-wrap:wrap}#fee-tabs [aria-pressed=true]{background:#294969;color:white}#fee-list h2{font-size:1rem;margin:1.15rem 0 .45rem}.fee-row{background:white;border-bottom:1px solid #e1e8ee;padding:.65rem .9rem;min-height:48px;cursor:pointer}.fee-row input{width:20px;height:20px;accent-color:#276c59}.fee-row span{margin-left:auto}.fee-bottom{position:sticky;bottom:0;background:#f8faff;padding:.75rem 0}.fee-bottom button{width:100%}.fee-bottom button:disabled{opacity:.55}.student-name-line .student-profile-button.fee-red{color:#a92e35}.student-name-line .student-profile-button.fee-green,.fee-green{color:#14735a}#confirmation-message{white-space:pre-line;max-height:50vh;overflow:auto}

.attendance-fee-label {
  padding: 2px 7px;
  border-radius: 6px;
  background: #fff0ef;
  color: #9d2634;
  font-size: .875rem;
  line-height: 1.45;
  white-space: nowrap;
}
button.attendance-fee-label {border:0;font-weight:500;font-size:.8rem;min-height:25px;cursor:pointer}
#roll-fee-dialog label{display:flex;gap:.6rem;align-items:center;min-height:44px}
#roll-fee-dialog input{width:20px;height:20px}

#global-home {display:inline-flex;align-items:center;gap:5px;background:var(--blue-soft);padding-inline:12px}
#global-home .ui-icon {width:18px;height:18px}

/* Material 3 color roles shared across the teacher workbench. */
:root {
  --blue: #005bc7;
  --blue-soft: #d7e9ff;
  --sky: #d1e7ff;
  --surface: #f7faff;
  --surface-raised: #fff;
  --border: #c8d8ed;
}
body { background: #f2f7ff; color: #102342; }
.app-shell { background: #f7faff; }
.teacher-bar { background: #edf5ff; }
.section-heading, .attendance-hero {
  background: linear-gradient(145deg,#d4eaff,#edf6ff);
  border-radius: 24px;
  padding: 20px;
}
.home-shortcut, .branch-card, .edit-class-card, .activity-card, .student-row,
.student-row.present, .student-row.absent {
  border: 1px solid #c8d8ed;
  border-radius: 18px;
  background: #fff;
}
.primary-button:not(:disabled) { background: #005ecb; color: white; border-radius: 18px; }
.status-btn { border-radius: 14px; }
.status-actions .present-btn { background: #d7e9ff; color: #074a9d; }
.status-actions .present-btn[aria-pressed="true"] { background: #0a59b5; color: #fff; }
.status-actions .absent-btn:not([aria-pressed="true"]) { background: #fff; border: 1px solid #aebdd0; color: #404c5b; }
.student-name-line { gap: 5px; }
.attendance-fee-label, button.attendance-fee-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .8125rem;
  line-height: 1.35;
}
.attendance-fee-label.fee-paid-chip { background: #ccf2df; color: #075439; }
.attendance-fee-label.fee-current-chip { background: #ffebc1; color: #704400; }
.attendance-fee-label.fee-overdue-chip { background: #ffdadc; color: #8c2331; }
dialog { border-radius: 28px; }

.student-class-label { margin-inline-start: .35em; color: #4a6079; font-size: .85rem; font-weight: 500; }

.intake-month {list-style:none;padding:0;border:1px solid var(--border);border-radius:18px;background:white;overflow:hidden}
.intake-month li {display:flex;align-items:baseline;flex-wrap:wrap;gap:.5rem;padding:.75rem 1rem}
.intake-month li+li {border-top:1px solid var(--border)}
.intake-month time {color:var(--blue);min-width:4.5em}
.intake-month span {color:#4a6079}

.intake-student-name {
  border: 0;
  background: transparent;
  color: var(--primary, #005fa8);
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 0.35rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

#intake-registration-link:not([hidden]),
#profile-registration-link:not([hidden]) {
  display: inline-flex;
  margin-block: 0.5rem 1rem;
  text-decoration: none;
}

/* Material 3 Expressive workbench */
.workbench {
  --blue: #2457a6;
  --blue-soft: #d8e5ff;
  --ink: #191e2b;
  --muted: #454f64;
  --outline: #758096;
  --surface: #f8f9ff;
  --surface-low: #f0f3fb;
  --surface-raised: #fff;
  --surface-container: #eaeef8;
  --surface-high: #e4eaf7;
  --border: #d1d8e8;
  --shell-width: 1040px;
  --gutter: clamp(14px, 4vw, 36px);
  --card-padding: clamp(16px, 3vw, 24px);
  width: min(100%, var(--shell-width));
  color: var(--ink);
  background: var(--surface);
  font-size: 1rem;
  line-height: 1.5;
}

body:has(.workbench) { min-width: 0; background: #edf1fa; }
.workbench .view { padding: 16px var(--gutter) max(28px, env(safe-area-inset-bottom)); }
.workbench .view > *, .workbench .teacher-actions > *, .workbench fieldset { min-inline-size: 0; }
.workbench h1, .workbench h2, .workbench h3, .workbench label,
.workbench .student-profile-button, .workbench .intake-student-name { overflow-wrap: anywhere; }
.workbench h1 { font-size: clamp(1.65rem, 4.6vw, 2.35rem); line-height: 1.16; }
.workbench h2 { line-height: 1.25; }

.workbench .teacher-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 12px;
  padding: calc(8px + env(safe-area-inset-top)) var(--gutter) 8px;
  background: var(--surface-container);
  border-bottom: 1px solid var(--border);
}
.workbench #teacher-name { justify-self: end; text-align: end; font-size: .875rem; }
.workbench .teacher-actions { grid-column: 1 / -1; gap: 4px; margin: 0; }
.workbench .teacher-bar button { min-height: 44px; padding-inline: 10px; white-space: normal; }
.workbench #global-home, .workbench #global-edit-button { background: var(--blue-soft); }
.workbench #global-home { justify-self: start; }
.workbench .teacher-actions #logout-button { margin-inline-start: auto; }
.workbench :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.workbench .login-view { min-height: 100dvh; background: var(--surface-container); }
.workbench .login-card {
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: clamp(20px, 6vw, 40px);
}
.workbench .login-error:empty { display: none; }
.workbench #login-button { margin-top: 14px; }
.workbench .section-heading, .workbench #home-view .section-heading,
.workbench .brand-header, .workbench .attendance-header, .workbench .edit-header {
  margin: 8px 0 18px;
  padding: var(--card-padding);
  border-radius: 24px;
  background: var(--surface-container);
}
.workbench .attendance-header, .workbench .edit-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.workbench :is(.attendance-header, .edit-header) > div { grid-column: 1; grid-row: 1; }
.workbench :is(.attendance-header, .edit-header) > button { grid-column: 2; grid-row: 1; }
.workbench :is(.section-heading, .brand-header, .attendance-header, .edit-header) h1 { margin: 0; }

.workbench .home-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.workbench .attendance-hero {
  background: var(--blue-soft);
  border-radius: 30px;
  padding: var(--card-padding);
}
.workbench .hero-icon { background: var(--surface); }
.workbench .home-shortcut { background: var(--surface-raised); min-height: 62px; border-radius: 20px; }
.workbench .home-shortcut > :first-child { justify-self: center; color: var(--blue); }
.workbench #home-view { padding-bottom: max(105px, env(safe-area-inset-bottom)); }
.workbench .cat-helper-float { right: max(12px, env(safe-area-inset-right)); }

.workbench :is(.primary-button, .primary-button:not(:disabled)) { border-radius: 999px; }
.workbench :is(.quick-button, .back-button, .text-button) {
  min-block-size: 44px;
  max-inline-size: 100%;
  white-space: normal;
}
.workbench :is(.fee-tools, .history-filters) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  align-items: start;
  gap: 12px;
}
.workbench :is(.fee-tools, .history-filters) label { display: grid; min-inline-size: 0; gap: 5px; }
.workbench :is(.fee-tools, .history-filters, .date-field, .edit-class-card, .activity-stack, .log-card, dialog, .note-panel)
  :is(select, textarea, input:not([type="checkbox"], [type="radio"])) {
  max-inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  font: inherit;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--outline);
  border-radius: 12px;
}
.workbench :is(select, textarea) { overflow-wrap: anywhere; }
.workbench :is(.date-field, .daily-reminders li, .edit-bottom-actions, .activity-marks) { flex-wrap: wrap; }
.workbench :is(.log-card, .edit-class-card, .teacher-account-card, .activity-card, .activity-team) {
  padding: var(--card-padding);
  border-radius: 22px;
  background: var(--surface-raised);
  border-color: var(--border);
}
.workbench .student-row {
  border-radius: 16px;
  padding: 8px 10px;
  gap: 6px 12px;
  align-items: center;
}
.workbench .student-info, .workbench .student-name-line { min-inline-size: 0; }
.workbench .student-profile-button { text-align: start; }
.workbench .status-actions { gap: 6px; }
.workbench .status-actions button { min-height: 44px; }
.workbench :is(.sticky-finish, .sticky-save, .fee-bottom) {
  background: var(--surface-container);
  border-color: var(--border);
}
.workbench .fee-bottom { padding: 8px 12px max(8px, env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
.workbench .fee-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.workbench .fee-row > * { min-inline-size: 0; overflow-wrap: anywhere; }
.workbench .fee-row span { margin: 0; }
.workbench #fee-tabs button { min-height: 44px; border-radius: 999px; }
.workbench #fee-tabs [aria-pressed="true"] { background: var(--blue); color: white; }
.workbench .intake-month { margin: 8px 0 18px; border-radius: 22px; }
.workbench .intake-month li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0 10px;
  padding: 8px 12px;
}
.workbench .intake-month li > span { overflow-wrap: anywhere; font-size: .875rem; }
.workbench .intake-month time { min-width: 0; font-size: .875rem; }
.workbench .intake-student-name { min-height: 44px; color: var(--blue); }
.workbench :is(#intake-status, #fee-status) { color: var(--muted); overflow-wrap: anywhere; }

.workbench dialog {
  max-inline-size: min(540px, calc(100% - 24px));
  max-block-size: calc(100dvh - 24px);
  padding: var(--card-padding);
  border-radius: 28px;
  color: var(--ink);
  background: var(--surface-high);
  border: 1px solid var(--border);
  overflow: auto;
  overscroll-behavior: contain;
}
.workbench dialog::backdrop { background: rgb(20 29 52 / 46%); }
.workbench dialog > h2 { margin-block: 0 10px; }
.workbench dialog :is(a, p, dd, dt) { overflow-wrap: anywhere; }
.workbench .note-panel { max-inline-size: min(100%, 620px); background: var(--surface-high); }

@media (max-width: 440px) {
  .workbench .student-row { grid-template-columns: minmax(0, 1fr); }
  .workbench .status-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench .status-actions button { width: 100%; }
  .workbench .edit-class-fields, .workbench .student-edit-more { grid-template-columns: minmax(0, 1fr); margin-inline-start: 0; }
  .workbench .fee-row { grid-template-columns: auto minmax(0, 1fr); }
  .workbench .fee-row span { grid-column: 2; }
}

@media (min-width: 600px) {
  .workbench .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench .attendance-hero { grid-column: 1 / -1; }
  .workbench .attendance-hero .primary-button { width: auto; padding-inline: 24px; }
  .workbench .branch-grid, .workbench .activity-team-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench .intake-month li { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr); }

}

@media (min-width: 840px) {
  .workbench .teacher-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .workbench .teacher-actions { grid-column: auto; }
  .workbench .teacher-actions #logout-button { margin-inline-start: 0; }
  .workbench .branch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.workbench .intake-day-heading { margin: 1.15rem 0 .35rem; font-size: 1rem; }

#intake-enroll-controls { display: grid; gap: 10px; margin-block: 8px 14px; }
#intake-enroll-controls label { display: grid; gap: 5px; }
#intake-enroll-status { margin: 0; }
#intake-enroll-status:empty { display: none; }

#teacher-account {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  background: var(--surface-raised);
}
.account-notice-count {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  color: white;
  background: var(--red);
}
#account-notice-ticker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-inline: 14px;
  border-radius: 16px;
  color: var(--blue);
  background: var(--blue-soft);
  text-align: start;
}
#account-notice-ticker .ui-icon { inline-size: 19px; block-size: 19px; }
.notice-ticker-window { min-width: 0; overflow: hidden; }
#account-notice-message {
  display: inline-block;
  min-width: 100%;
  white-space: nowrap;
  animation: account-notice-slide 12s linear infinite;
}
#account-notice-ticker:is(:hover, :focus-visible) #account-notice-message {
  animation: none;
  white-space: normal;
}
@keyframes account-notice-slide {
  0%, 22% { transform: translateX(0); }
  85%, 100% { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  #account-notice-message { animation: none; white-space: normal; }
}
#teacher-account-dialog { width: min(460px, calc(100% - 24px)); }
#change-own-pin-form, #change-own-pin-form label { display: grid; gap: 6px; }
#change-own-pin-form { margin: 10px 0; }
#change-own-pin-form input { width: 100%; padding: 8px 12px; }
#change-own-pin-form p { margin: 0; }
#teacher-account-dialog summary { min-height: 44px; align-content: center; cursor: pointer; }

/* Lincoln Educare 2027 */
body:has(.workbench) { background: #f5ede4; }
.workbench {
  --blue: #006b5b;
  --blue-soft: #d8f3eb;
  --ink: #142b45;
  --muted: #4e5e6e;
  --outline: #87786c;
  --border: #e3d7cc;
  --surface: #fff9f2;
  --surface-low: #f8eee4;
  --surface-raised: #fffdfa;
  --surface-container: #faf0e6;
  --surface-high: #fff6ed;
  --peach: #ffead9;
  --mint: #e1f5ed;
  --sky: #e4f2ff;
  --lavender: #f1e8ff;
  --pink: #ffe9e8;
  --elevation: 0 4px 14px rgb(105 62 32 / 9%);
  color-scheme: light;
}
.workbench:has(#workbench-nav:not([hidden])) { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.workbench .teacher-bar {
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--surface);
}
.workbench .teacher-actions { display: none; }
.workbench #global-home { background: transparent; color: var(--ink); font-size: 1rem; padding-inline: 0; }
.workbench #global-home svg { color: #be580f; }
.workbench #teacher-account { border: 1px solid var(--border); border-radius: 999px; }
.workbench #account-notice-ticker { color: #683c15; background: var(--peach); }
#account-notice-message { animation-iteration-count: 1; }
@keyframes account-notice-slide {
  0%, 24%, 100% { transform: translateX(0); }
  75%, 87% { transform: translateX(calc(-100% + 10rem)); }
}
.workbench .section-heading, .workbench .attendance-header, .workbench .edit-header {
  background: var(--peach);
}
.workbench :is(.primary-button, .primary-button:not(:disabled)) { background: var(--blue); }
.workbench .primary-button:disabled { background: #e9e4df; color: #585d64; }
.workbench button, .workbench #profile-registration-link, .workbench #intake-registration-link { min-block-size: 48px; }
.workbench :is(.talk-button, .attendance-fee-label, .mini-delete, .note-entry-delete) { min-block-size: 36px; }
.workbench button { transition: background-color 180ms ease, transform 160ms ease; }
.workbench button:not(:disabled):active { transform: scale(.98); }
.workbench :is(.view,.welcome-card,.attendance-hero,dialog) { min-inline-size: 0; }
.welcome-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(68px, 24vw, 126px);
  align-items: center;
  gap: 12px;
  padding: 8px 4px 14px;
}
.welcome-card p { margin: 4px 0; color: var(--muted); }
.welcome-card h1 { margin: 4px 0; }
.welcome-card img { display: block; width: 100%; height: auto; max-height: 126px; object-fit: contain; }
.workbench .attendance-hero { background: var(--mint); border: 1px solid #cbe5db; box-shadow: var(--elevation); }
.workbench .attendance-hero h2, .class-overview h2 { margin: 0; font-size: 1.23rem; }
.hero-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.workbench .attendance-hero .primary-button { width: auto; max-width: 100%; padding-inline: 18px; }
#home-attendance-status { margin: 3px 0; color: var(--muted); font-size: .875rem; }
#home-attendance-progress { width: 100%; height: 12px; margin-block: 12px 0; accent-color: var(--blue); }
.home-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0 0; }
.home-metrics > button { min-width: 0; border-radius: 14px; padding: 8px; background: #ffffffb8; }
.home-metrics .home-stat-label { font-size: .78rem; line-height: 1.25; }
.home-metrics strong { margin: 2px 0 0; font-size: clamp(1rem, 5vw, 1.65rem); font-weight: 800; }
.class-overview { padding: var(--card-padding); border: 1px solid var(--border); border-radius: 24px; background: var(--surface-raised); }
#home-class-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 1fr)); gap: 6px; margin-top: 12px; }
.class-count { padding: 6px; border: 0; border-radius: 14px; background: var(--sky); color: var(--ink); font: inherit; font-size: .84rem; font-weight: 700; }
.class-count:nth-child(3n+2) { background: var(--peach); }
.class-count:nth-child(3n) { background: var(--lavender); }
.workbench #home-view { padding-bottom: 24px; }
.workbench .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workbench :is(.attendance-hero, .class-overview) { grid-column: 1 / -1; }
.workbench .home-shortcut { grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 9px 10px; background: var(--surface-raised); }
.workbench .home-shortcut > :last-child:nth-child(3) { display: none; }
.workbench #home-students { background: var(--mint); }
.workbench #open-intake { background: var(--peach); }
.workbench #start-teacher-log { background: var(--sky); }
.workbench #open-activities { background: var(--lavender); }
.workbench .cat-helper-float { display: none; }
.workbench-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.workbench .workbench-links button { display: block; }
#workbench-nav {
  position: fixed; z-index: 8; inset-inline: 0; bottom: 0; margin: auto;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 640px);
  padding: 5px 6px max(6px, env(safe-area-inset-bottom));
  border: 1px solid #e3d7cc; border-radius: 22px 22px 0 0;
  background: #fffdfa; box-shadow: 0 -4px 16px rgb(69 39 18 / 10%);
}
#workbench-nav button {
  display: grid; justify-items: center; align-content: center; gap: 0;
  min-width: 0; min-height: 53px; border: 0; border-radius: 16px;
  background: transparent; color: var(--ink); font: inherit; font-size: .77rem; font-weight: 750;
}
#workbench-nav [aria-current="page"] { background: var(--mint); color: var(--blue); }
#workbench-nav button span { font-size: 1.35rem; line-height: 1.15; }
.workbench:has(#attendance-view:not([hidden]), #edit-view:not([hidden])) #workbench-nav { display: none; }
.workbench-filters {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  border-radius: 18px; background: var(--surface-container); padding: 10px;
}
.workbench-filters label { display: grid; gap: 4px; min-width: 0; font-size: .82rem; }
.workbench-filters label:first-child { grid-column: 1 / -1; }
.workbench :is(.workbench-filters, .class-overview) :is(input, select) {
  width: 100%; min-width: 0; min-height: 48px; padding: 6px 9px;
  border: 1px solid var(--outline); border-radius: 12px; background: var(--surface-raised);
  color: var(--ink); font: inherit; font-size: 1rem;
}
.directory-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }
#directory-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
#directory-list button {
  display: grid; gap: 2px; width: 100%; min-height: 54px; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-raised); color: var(--ink); text-align: start; overflow-wrap: anywhere;
}
#directory-list small { font-size: .8rem; color: var(--muted); }
.workbench .attendance-filters { margin: 10px var(--gutter); }
.workbench #attendance-filter-empty { margin-inline: var(--gutter); }
.workbench .summary-bar { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.workbench .summary-bar span { background: var(--surface-raised); padding-inline: 2px; font-size: .76rem; }
.workbench .summary-bar span b { font-size: clamp(.85rem, 4vw, 1.2rem); }
.workbench .student-row { margin-block: 5px; background: var(--surface-raised); }
.workbench .status-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.workbench .status-btn { min-width: 0; width: 100%; padding-inline: 5px; }
.workbench .status-actions .present-btn { color: #125944; background: var(--mint); }
.workbench .status-actions .present-btn[aria-pressed="true"] { color: white; background: var(--blue); }
.workbench .leave-btn[aria-pressed="true"] { background: var(--lavender); color: #512c84; border-color: #78569d; }
.workbench .student-profile-button { color: var(--ink); }
.workbench .sticky-finish { background: var(--surface-raised); padding-inline: var(--gutter); border-radius: 22px 22px 0 0; }
.completion-cat { display: block; margin-inline: auto; object-fit: contain; }
@media (min-width: 768px) {
  .workbench .home-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workbench-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workbench-filters label:first-child { grid-column: auto; }
  .workbench .status-btn { min-width: 68px; }
}
@media (min-width: 1240px) {
  .workbench:has(#workbench-nav:not([hidden])) { padding-bottom: 0; }
  #workbench-nav {
    inset-inline: max(12px, calc((100vw - 1290px) / 2)) auto;
    inset-block: 92px auto; width: 76px;
    grid-template-columns: minmax(0, 1fr); border-radius: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .workbench button { transition: none; }
  .workbench button:not(:disabled):active { transform: none; }
}

.workbench .teacher-bar { grid-template-columns: minmax(0, 1fr) minmax(0, auto); }
.account-actions { display: flex; align-items: center; gap: 5px; min-width: 0; }
.workbench #notification-bell {
  position: relative; display: grid; place-items: center; min-width: 48px;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--ink);
}
#notification-bell .account-notice-count {
  position: absolute; inset-block-start: 3px; inset-inline-end: 3px;
  inline-size: 9px; block-size: 9px; padding: 0;
}
.workbench #teacher-account { max-width: clamp(70px, 29vw, 210px); }
.workbench #teacher-name { text-align: start; font-size: .8rem; }

/* Home visual review */
.workbench:has(#home-view:not([hidden])) {
  background: radial-gradient(ellipse at 92% 16%, #ffeadb 0, transparent 44%),
    linear-gradient(180deg, #fffcf7, #fff3e7 76%, #fffbf6);
}
.workbench:has(#home-view:not([hidden])) .teacher-bar {
  background: #fffbf6;
  border-bottom: 0;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 4px;
}
.workbench:has(#home-view:not([hidden])) #global-home { gap: 7px; text-align: start; }
.lincoln-book {
  display: grid; place-items: center; flex: 0 0 35px; height: 35px;
  border-radius: 12px; background: #ffead6; color: #a94e16;
}
.workbench #global-home .lincoln-book svg { width: 23px; height: 23px; }
.lincoln-wordmark { display: grid; min-width: 0; line-height: 1.08; }
.lincoln-wordmark strong { font-size: clamp(13px, 4.1vw, 23px); letter-spacing: -.045em; }
.lincoln-wordmark small { font-size: .72rem; margin-top: 4px; letter-spacing: .07em; }
.workbench #home-view { padding-top: 2px; }
.workbench .welcome-card {
  position: relative; isolation: isolate; overflow: hidden;
  grid-template-columns: minmax(0, 1fr) clamp(92px, 29vw, 150px);
  min-height: 116px; gap: 6px; padding: 9px 4px 8px;
}
.welcome-card::before, .welcome-card::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 166px; height: 92px; border-radius: 50%; transform: rotate(-14deg);
}
.welcome-card::before { inset: auto -32px -23px auto; background: #bcebdc; }
.welcome-card::after { inset: 11px 13px auto auto; width: 92px; height: 80px; background: #ffe0cb; z-index: -2; }
.workbench .welcome-card img {
  width: 100%; height: clamp(98px, 28vw, 139px); max-height: initial; object-fit: contain;
  filter: drop-shadow(0 5px 5px rgb(126 73 30 / 14%));
}
.workbench .welcome-card h1 { font-size: clamp(20px, 6vw, 36px); letter-spacing: -.035em; margin: 5px 0; }
.workbench .welcome-card p { font-size: .75rem; margin: 0; }
.workbench .home-actions { gap: 10px; }
.workbench .attendance-hero {
  border: 1px solid #fff; padding: 11px 12px 9px; border-radius: 22px;
  background: linear-gradient(125deg, #fffefa 22%, #dff4ec 100%);
  box-shadow: 0 4px 13px #75421117;
}
.workbench .attendance-hero .hero-head { flex-wrap: nowrap; align-items: start; }
.workbench .attendance-hero h2, .workbench .class-overview h2, .home-quick-panel h2 {
  display: flex; align-items: center; gap: 6px; margin: 0; font-size: 1.03rem; font-weight: 850;
}
.workbench .attendance-hero h2 svg { color: #00765f; }
.workbench .attendance-hero .primary-button {
  background: linear-gradient(150deg,#007d69,#00594f); box-shadow: 0 3px 7px #00685225;
  padding-inline: clamp(9px,4vw,21px); font-size: .9rem; white-space: nowrap; min-height: 45px;
}
#home-attendance-status { font-size: .75rem; margin: 3px 0 0; }
#home-attendance-progress {
  display: block; height: 8px; margin: 8px 0 0; appearance: none; overflow: hidden;
  border: 0; border-radius: 99px; background: #e1e9e6;
}
#home-attendance-progress::-webkit-progress-bar { background: #e1e9e6; }
#home-attendance-progress::-webkit-progress-value { background: linear-gradient(90deg,#00a279,#007c69); border-radius: 99px; }
#home-attendance-progress::-moz-progress-bar { background: #008b72; border-radius: 99px; }
.home-metrics { margin-top: 8px; gap: 5px; }
.home-metrics > button { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 5px; padding: 5px 6px; border-radius: 10px; }
.home-metrics > button:nth-child(1) { background: #dcf1f5; }
.home-metrics > button:nth-child(2) { background: #e7f3d9; }
.home-metrics > button:nth-child(3) { background: #fae7e6; }
.home-metrics strong { order: -1; font-size: 1.16rem; line-height: 1; margin: 0; }
.home-metrics .home-stat-label { font-size: .65rem; }
.workbench .class-overview, .home-quick-panel {
  grid-column: 1 / -1; padding: 9px 10px; background: #fffaf5;
  border: 1px solid #fff; border-radius: 20px; box-shadow: 0 3px 11px #75421113;
}
.workbench .class-overview .hero-head { flex-wrap: nowrap; }
.workbench .class-overview h2 svg, .home-quick-panel h2 svg { color: #ad5714; }
.workbench .class-overview label { font-size: 0; }
.workbench .class-overview select {
  min-height: 31px; font-size: .76rem; width: auto; max-width: 95px;
  padding: 3px 6px; border: 1px solid #dccabb; border-radius: 99px;
}
#home-class-counts { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
.workbench .class-count {
  min-height: 38px; padding: 3px; line-height: 1.15; overflow-wrap: anywhere;
  font-size: clamp(.57rem, 2.45vw, .83rem); border-radius: 9px; color: #173550;
}
.workbench .class-count:nth-child(6n+3) { background:#ddf2e9; }
.workbench .class-count:nth-child(6n+4) { background:#fbe7e5; }
.workbench .class-count:nth-child(6n+5) { background:#efe3fa; }
.workbench .class-count:nth-child(6n+6) { background:#dfeefb; }
.home-quick-grid {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin-top: 7px;
}
.workbench .home-quick-grid .home-shortcut {
  display: grid; grid-template-columns: 1fr; justify-items: center; align-content: center; gap: 2px;
  min-height: 55px; padding: 4px 2px; border: 0; border-radius: 12px;
  font-size: .78rem; line-height: 1.15; background: #f4eee8;
}
.home-quick-grid .home-shortcut svg { width: 21px; height: 21px; }
.workbench .home-quick-grid #home-students { background:#d9f3eb; }
.workbench .home-quick-grid #open-intake { background:#fbe5e1; }
.workbench .home-quick-grid #start-teacher-log { background:#deecfc; }
.workbench .home-quick-grid #open-fees { background:#f0e5fa; }
.workbench .home-quick-grid #open-activities { background:#fff0ce; }
.workbench .home-quick-grid #home-history { background:#eaf0f8; }
.workbench .home-quick-grid #open-intake svg { color:#ab4135; }
.workbench .home-quick-grid #start-teacher-log svg, .workbench .home-quick-grid #home-history svg { color:#275687; }
.workbench .home-quick-grid #open-fees svg { color:#6a3d93; }
.workbench .home-quick-grid #open-activities svg { color:#875112; }
#workbench-nav .ui-icon { width: 21px; height: 21px; }
@media (min-width: 650px) {
  .home-quick-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
.workbench .welcome-card { min-height: 108px; padding-block: 4px; }
.workbench .welcome-card h1 { font-weight: 850; }
.workbench .welcome-card img { height: clamp(94px, 27vw, 139px); }
.workbench .home-actions { gap: 8px; }
.home-metrics { grid-column: 1 / -1; margin: 0; gap: 6px; }
.home-metrics > button {
  flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 46px; padding: 6px 9px; border: 1px solid #fff; border-radius: 14px;
  box-shadow: 0 3px 9px #75421112;
}
.home-metrics strong { font-size: 1.28rem; }
.home-metrics .home-stat-label { font-size: .68rem; }
.workbench #home-view { padding-bottom: 10px; }
@media (max-width: 430px) {
  .workbench:has(#home-view:not([hidden])) #account-notice-ticker { min-height: 38px; }
  .workbench:has(#home-view:not([hidden])) .teacher-bar { row-gap: 2px; padding-bottom: 0; }
  .workbench .welcome-card { min-height: 95px; }
  .workbench .welcome-card img { height: 90px; }
  .workbench .home-quick-grid .home-shortcut { min-height: 49px; }
}

/* Lincoln mobile homepage */
.workbench:has(#home-view:not([hidden])) {
  background: radial-gradient(ellipse 85% 250px at 100% 12%, #ffe5d0 0%, transparent 84%),
    linear-gradient(180deg, #fffaf4 0%, #fff1e4 82%, #fffbf7 100%);
}
.workbench:has(#home-view:not([hidden])) .teacher-bar { background: #fffbf3; }
.workbench:has(#home-view:not([hidden])) #global-home .lincoln-book {
  background: linear-gradient(145deg,#ffcc96,#ff9e52); color:#773108;
  border: 1px solid #fff0d7; box-shadow: 0 2px 5px #a6582326;
}
.workbench:has(#home-view:not([hidden])) #global-home .lincoln-book svg { color: #773108; }
.workbench:has(#home-view:not([hidden])) #home-view { padding-top: 0; }
.workbench #home-view .welcome-card {
  grid-template-columns: minmax(0,1fr) minmax(92px,33%);
  min-height: 105px; padding: 6px 3px 2px; gap: 4px;
}
.welcome-copy { z-index: 1; position: relative; min-width: 0; }
.workbench .welcome-card h1 { color: #112c44; font-weight: 880; font-size: clamp(21px, 6.2vw, 36px); letter-spacing: -.055em; }
.workbench .welcome-card::before { width: 150px; height: 66px; bottom: -12px; right: -20px; background: linear-gradient(125deg,#dff6ec,#91ddc8); }
.workbench .welcome-card::after { width: 90px; height: 86px; top: 8px; right: 15px; background: #ffd9bd; }
.welcome-mascot { position: relative; display: grid; place-items: end center; min-width: 0; align-self: stretch; }
.workbench #home-view .welcome-mascot img { display: block; width: 100%; height: 105px; object-fit: contain; object-position: center bottom; transform-origin: 60% 95%; }
.workbench #home-view .attendance-hero {
  position: relative; z-index: 1; padding: 10px 11px 9px; border-radius: 22px;
  background: linear-gradient(115deg,#fffdf9 20%,#d9f5e9 100%);
  box-shadow: 0 5px 12px #6940231b, inset 0 1px #fff;
}
.workbench #home-view #start-attendance { min-height: 44px; padding-inline: 12px; }
.home-metrics > button { flex-direction: row; align-items: center; justify-content: flex-start; gap: 5px; min-height: 52px; padding: 5px 6px; }
.home-metrics > button > .home-stat-value { display: flex; flex-direction: column; min-width: 0; }
.home-metrics > button:nth-child(1) { background: linear-gradient(135deg,#f4fffb,#d5f3ed); }
.home-metrics > button:nth-child(2) { background: linear-gradient(135deg,#fcfff3,#e8f6d9); }
.home-metrics > button:nth-child(3) { background: linear-gradient(135deg,#fff7f5,#fde1df); }
.home-stat-icon { display:grid; place-items:center; width:25px; height:25px; flex:none; border-radius:50%; background:#b8eadc; color:#086c55; }
.home-stat-icon svg { width:16px; height:16px; stroke-width:2.3; }
.home-metrics > button:nth-child(2) .home-stat-icon { background:#cbeeb3; color:#316b24; }
.home-metrics > button:nth-child(3) .home-stat-icon { background:#ffcdc7; color:#993b31; }
.home-metrics strong { font-size: 1.2rem; }
.home-metrics .home-stat-label { margin-top: 3px; font-size: .64rem; white-space: nowrap; }
.workbench #home-class-counts { grid-template-columns: repeat(3,minmax(0,1fr)); grid-auto-rows: 43px; gap: 5px; }
.workbench #home-class-counts .class-count {
  display: flex; flex-direction: column; justify-content: center; align-items:center; gap:2px;
  min-height: 0; height: 100%; padding: 3px 4px; font-size: .68rem; line-height:1.12;
  border-radius: 11px; box-shadow: inset 0 1px #ffffffb8, 0 2px 4px #623b1e0d;
}
.class-count strong { font-size: .82rem; }
.workbench .home-quick-grid .home-shortcut {
  min-height: 56px; border: 1px solid #ffffffa8; border-radius: 14px;
  box-shadow: 0 3px 6px #73421614, inset 0 1px #fff8;
}
.workbench .home-quick-grid .home-shortcut svg {
  width: 26px; height: 26px; padding: 4px; border-radius: 9px; background: #ffffffa8; stroke-width: 1.95;
}
.workbench .home-quick-grid #home-students { background:linear-gradient(150deg,#eefbf7,#cbeee3); }
.workbench .home-quick-grid #open-intake { background:linear-gradient(150deg,#fff4f2,#f9dcd5); }
.workbench .home-quick-grid #start-teacher-log { background:linear-gradient(150deg,#f2f8ff,#d5e8fa); }
.workbench .home-quick-grid #open-fees { background:linear-gradient(150deg,#fcf6ff,#ebdbf8); }
.workbench .home-quick-grid #open-activities { background:linear-gradient(150deg,#fff9e8,#fae8b9); }
.workbench .home-quick-grid #home-history { background:linear-gradient(150deg,#f6f9ff,#e1eaf7); }
#open-staff-helper .cat-motion img, .cat-helper-header .cat-motion img { display:block; object-fit:contain; }
/* Visual tokens for the mobile dashboard. */
#home-view {
  --dashboard-paper: #fffdf8;
  --dashboard-navy: #102c45;
  --dashboard-soft-green: #e7f7ef;
  --dashboard-mint: #d4f3e8;
  --dashboard-lime: #e9f7d8;
  --dashboard-peach: #ffeadd;
  --dashboard-rose: #fbe2e4;
  --dashboard-sky: #e0eefc;
  --dashboard-lilac: #efe3fa;
  --dashboard-gold: #fff1cf;
  --dashboard-radius: 20px;
  --dashboard-shadow: 0 4px 12px #70462015, inset 0 1px #fff;
}
.workbench #home-view .welcome-card { align-items: center; min-height: 98px; padding: 3px 4px 2px; }
.workbench #home-view .welcome-card::before { right: -9px; width: 147px; height: 68px; border-radius: 65% 60% 35% 40%; }
.workbench #home-view .welcome-card::after { right: 15px; top: 4px; background: linear-gradient(140deg,#ffe9d7,#ffdac2); }
.workbench #home-view .welcome-mascot img { height: 101px; }
.workbench #home-view .welcome-card h1 { color: var(--dashboard-navy); line-height: 1.13; }
.workbench #home-view .attendance-hero {
  padding: 10px 12px 8px; border-radius: var(--dashboard-radius);
  background: linear-gradient(120deg,var(--dashboard-paper) 26%,var(--dashboard-soft-green));
  box-shadow: var(--dashboard-shadow);
}
#home-view #home-attendance-status { font-weight: 680; color: #43586a; }
.home-progress-caption {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 5px;
  color: #38574d; font-size: .72rem; font-weight: 650;
}
#home-unmarked { color: #825014; }
#home-view .home-metrics > button { min-height: 49px; }
#home-view .class-overview,#home-view .home-quick-panel { border-radius: var(--dashboard-radius); box-shadow: var(--dashboard-shadow); }
#home-view .class-count { background: linear-gradient(135deg,var(--dashboard-paper),var(--grade-surface,var(--dashboard-sky))); }
#home-view .class-count:nth-child(6n+2){--grade-surface:var(--dashboard-gold)}
#home-view .class-count:nth-child(6n+3){--grade-surface:var(--dashboard-mint)}
#home-view .class-count:nth-child(6n+4){--grade-surface:var(--dashboard-rose)}
#home-view .class-count:nth-child(6n+5){--grade-surface:var(--dashboard-lilac)}
#home-view .class-count:nth-child(6n+6){--grade-surface:var(--dashboard-sky)}
#home-view .home-quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
#home-view .home-quick-grid .home-shortcut {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 6px;
  align-items: center; justify-items: start; min-height: 55px; padding: 5px 7px;
  color: var(--dashboard-navy); text-align: start; font-size: .81rem;
  background: linear-gradient(132deg, var(--dashboard-paper),var(--shortcut-surface));
}
#home-view .home-quick-grid .home-shortcut > .home-shortcut-arrow { display: block; font-size: 1rem; opacity: .58; }
.home-shortcut-icon { border-radius: 10px; background: #ffffffb5; display:grid; place-items:center; }
#home-view .home-quick-grid .home-shortcut svg { width: 31px; height: 31px; padding: 5px; background: transparent; stroke-width: 1.9; }
#home-students { --shortcut-surface: var(--dashboard-mint); }
#start-teacher-log,#home-history { --shortcut-surface: var(--dashboard-sky); }
#open-intake { --shortcut-surface: var(--dashboard-rose); }
#open-fees { --shortcut-surface: var(--dashboard-lilac); }
#open-activities { --shortcut-surface: var(--dashboard-gold); }

.workbench #home-view .welcome-card { min-height: 88px; }
.workbench #home-view .welcome-mascot img { height: 91px; }
.workbench #home-view .attendance-hero {
  border: 1px solid #fffdf8;
  box-shadow: 0 5px 13px #284e3e15, 0 1px 2px #8e684c19, inset 0 1px #fff;
}
#home-view #home-attendance-progress { box-shadow: inset 0 1px 2px #1e4d3822; }
#home-view .home-quick-grid .home-shortcut svg { width: 34px; height: 34px; padding: 5px; }
#home-view .home-quick-grid #home-students svg { color:#00755d; }
#home-view .home-quick-grid #open-intake svg { color:#b74138; }
#home-view .home-quick-grid #start-teacher-log svg { color:#215ca1; }
#home-view .home-quick-grid #open-fees svg { color:#743ca0; }
#home-view .home-quick-grid #open-activities svg { color:#975516; }
.workbench #home-view #home-class-counts { grid-auto-rows: 44px; }

/* Mobile roll call */
#attendance-view {
  --roll-paper: #fffdf8;
  --roll-border: #ecdccd;
  --roll-ink: #132e48;
  --roll-green: #006d58;
  --roll-shadow: 0 3px 12px #67401e13;
  color: var(--roll-ink);
  padding-top: 5px;
}
#attendance-view .attendance-header {
  margin: 2px 0 7px; padding: 8px 10px;
  background: linear-gradient(120deg,#fff9f0,#fbe8db);
  border: 1px solid #fff; border-radius: 17px;
}
#attendance-view #attendance-title { font-size: 1.35rem; }
#attendance-view #attendance-date-label { margin: 3px 0 0; font-size: .76rem; }
#attendance-view .roll-call-date {
  display: flex; gap: 7px; align-items: center;
  margin: 0 0 8px; padding: 3px 8px; border-radius: 12px;
  box-shadow: none; background: var(--roll-paper); font-size: .78rem;
}
#attendance-view .roll-call-date input { width: auto; max-width: 100%; min-height: 36px; padding: 2px 4px; }
#attendance-view .summary-bar {
  display: grid; grid-template-columns: 1fr; gap: 7px;
  margin: 5px 0 8px; padding: 8px; border: 1px solid #fff;
  border-radius: 17px; background: linear-gradient(130deg,#fffdf9,#e6f6ed); box-shadow: var(--roll-shadow);
}
.roll-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px; padding: 0 2px; font-size: .8rem; }
.roll-progress small { color: #425b52; }
.roll-progress progress { grid-column: 1 / -1; width: 100%; height: 8px; border: 0; border-radius: 99px; accent-color: var(--roll-green); overflow: hidden; }
.roll-stats { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; margin: 0; }
.roll-stats div { display: flex; flex-direction: column-reverse; text-align: center; padding: 4px 2px; border-radius: 9px; background: #e3effb; }
.roll-stats div:nth-child(2) { background: #d9f2df; }
.roll-stats div:nth-child(3) { background: #fae0e0; }
.roll-stats div:nth-child(4) { background: #eee3f9; }
.roll-stats div:nth-child(5) { background: #fff0d8; }
.roll-stats dt { font-size: .66rem; }
.roll-stats dd { margin: 0; font-size: 1rem; font-weight: 850; line-height: 1.12; }
#attendance-view #mark-all-present { min-height: 36px; font-size: .73rem; margin: 0 0 5px; }
#attendance-view #mark-all-present + .hint { margin: 0 0 5px; }
.attendance-tools { display: grid; gap: 5px; }
.attendance-lookups { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 5px; }
.attendance-lookups label { min-width: 0; }
.attendance-lookups input,.attendance-lookups select {
  width: 100%; min-width: 0; min-height: 42px; padding: 3px 5px;
  border: 1px solid var(--roll-border); border-radius: 9px; color: var(--roll-ink);
  background: var(--roll-paper); font: inherit; font-size: .75rem;
}
.attendance-lookups input { font-size: 16px; }
.attendance-lookups input::placeholder { font-size: .73rem; }
.attendance-status-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; }
.attendance-status-tabs button,#attendance-density {
  min-height: 42px; color: var(--roll-ink); background: #fffdf8;
  border: 1px solid var(--roll-border); border-radius: 9px; padding: 3px 4px; font-size: .76rem;
}
.attendance-status-tabs button[aria-pressed="true"],#attendance-density[aria-pressed="true"] { background:#d9f1e7; border-color:#88b8a7; color:#005c4b; }
.attendance-list-heading { display:flex; align-items:center; justify-content:space-between; font-size:.76rem; }
#attendance-density { min-height: 36px; padding-inline: 8px; }
#attendance-view .roster { margin: 4px 0 0; padding: 0; }
#attendance-view .student-row {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 4px;
  margin: 0 0 6px; padding: 5px 7px 6px; border: 1px solid var(--roll-border);
  border-radius: 13px; background: var(--roll-paper); box-shadow: var(--roll-shadow);
}
#attendance-view .student-name-line { display:flex; align-items:center; flex-wrap:wrap; gap: 2px 5px; }
#attendance-view .student-profile-button {
  min-height: 38px; height:auto; text-align:start; overflow-wrap:anywhere;
  padding: 2px 3px; font-size: .9rem; color:var(--roll-ink);
}
#attendance-view .student-class-label { margin: 0; font-size:.69rem; }
.attendance-state { border-radius: 7px; padding: 2px 5px; background:#ffefd8; color:#744817; font-size:.66rem; white-space:nowrap; }
.attendance-state[data-state="present"] { background:#e0f5e9; color:#086347; }
.attendance-state[data-state="absent"] { background:#fce5e5; color:#9b3939; }
.attendance-state[data-state="leave"] { background:#efe5fa; color:#64358b; }
#attendance-view .status-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
#attendance-view .status-btn { width: 100%; min-height: 44px; min-width: 0; padding: 3px; font-size:.8rem; border-radius:10px; }
#attendance-view .status-btn[aria-pressed="true"] { outline:2px solid currentColor; outline-offset:-3px; font-weight:850; }
#attendance-view .leave-btn[aria-pressed="true"] { background:#663699; color:#fff; border-color:#663699; }
#attendance-view .absent-btn[aria-pressed="true"] { background:#b42332; color:#fff; border-color:#b42332; }
#attendance-view .roster-compact .student-row {
  grid-template-columns: minmax(0,1fr) minmax(144px,47%); align-items:center;
  gap: 4px; padding: 4px 6px;
}
#attendance-view .roster-compact .status-actions { gap:3px; }
#attendance-view .roster-compact .status-btn { font-size:.71rem; }
#attendance-view .sticky-finish {
  position:sticky; bottom:0; left:auto; width:100%; transform:none; z-index:4; margin-top:5px; padding:7px 8px max(7px,env(safe-area-inset-bottom));
  display: flex; align-items:center; gap:6px; border:1px solid var(--roll-border); border-radius:13px;
  background: #fffaf3; box-shadow: 0 -2px 9px #57331516;
}
#attendance-view .finish-progress { flex: 1; min-width: 0; }
#attendance-view .finish-progress small { text-align:start; overflow-wrap:anywhere; }
#attendance-view #finish-button { width:auto; flex:none; min-height:44px; padding:5px 10px; font-size:.82rem; }
#attendance-view #attendance-reload { min-height:44px; max-width:92px; padding:3px; font-size:.75rem; }
#completion { background:var(--roll-paper); border-radius:18px; box-shadow:var(--roll-shadow); }
.roll-confirmed { display:flex; align-items:center; gap:9px; padding:7px; border-radius:12px; background:#dff4ea; text-align:start; }
.roll-confirmed p { margin:0; font-size:.74rem; color:#215a49; }
.roll-confirmed h2 { margin:2px 0 0; font-size:1rem; }
.roll-confirmed img { flex:none; object-fit:contain; }
/* Student management */
.student-hub-tabs, .student-profile-tabs {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px;
  padding: 4px; margin-bottom: 12px; border-radius: 17px; background: #f4eadf;
}
.student-hub-tabs button, .student-profile-tabs button {
  min-height: 44px; border: 0; border-radius: 13px; background: transparent;
  color: #283e54; font: inherit; font-size: .86rem; font-weight: 750; padding: 4px;
}
.student-hub-tabs [aria-current="page"], .student-profile-tabs [aria-pressed="true"] {
  background: #d5f1e6; color: #075b4e; box-shadow: 0 2px 5px #17352a10;
}
.home-branch-tabs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding: 4px;
  border-radius: 17px;
  background: #f4eadf;
}
.home-branch-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #283e54;
  font: inherit;
  font-size: .875rem;
  font-weight: 750;
  cursor: pointer;
}
.home-branch-tabs [aria-selected="true"] {
  background: #d5f1e6;
  color: #075b4e;
  box-shadow: 0 2px 5px #17352a10;
}
.home-branch-tabs button:focus-visible {
  outline: 2px solid #075b4e;
  outline-offset: -2px;
}
.home-shift-pending {
  margin: 6px 0 0;
  color: #683c15;
  font-size: .8rem;
}
.student-hub-filters, #intake-view .fee-tools {
  padding: 10px 12px; border: 1px solid #e9dccd; border-radius: 17px;
  background: #fffdf8; margin-bottom: 8px;
}
.student-search { display: grid; gap: 4px; font-size: .85rem; font-weight: 700; }
.student-search input, .student-filter-grid select { min-height: 44px; width: 100%; }
.student-hub-filters summary, .intake-month summary { cursor: pointer; padding-block: 10px; font-weight: 700; }
.student-filter-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; font-size: .78rem; }
#directory-list { display: grid; gap: 6px; padding: 0; }
.workbench #directory-list li > button {
  display: flex; align-items: center; text-align: start; gap: 6px; min-height: 60px; width: 100%;
  padding: 8px 11px; background: linear-gradient(115deg,#fffdf8,#fff9ef);
  border: 1px solid #e9dccd; border-radius: 14px; box-shadow: 0 2px 5px #66452212;
}
.student-row-copy { display: grid; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.student-row-copy strong { color: #142b45; }
.student-state, .student-reminder-tag {
  flex: none; border-radius: 999px; padding: 3px 7px; font-size: .75rem;
  font-weight: 750; background: #dff4ea; color: #165748;
}
.student-reminder-tag { background: #ffead3; color: #78401b; }
#intake-list .intake-month li {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 2px 8px;
  background: linear-gradient(115deg,#fffdf8,#fff6e9); border: 1px solid #e9dccd;
  box-shadow: 0 2px 5px #66452212;
}
#intake-list .intake-month li > :nth-child(n+3) { grid-column: 1 / -1; overflow-wrap: anywhere; }
#intake-list .intake-month a { color: #075b4e; display: flex; align-items: center; min-height: 44px; font-weight: 750; }
#intake-list .intake-student-name { min-height: 44px; text-align: start; overflow-wrap: anywhere; }
#student-profile-dialog {
  background: #fff9f0; width: min(calc(100% - 24px),490px); max-height: min(85dvh,720px);
  border: 1px solid #e9dccd; border-radius: 23px; padding: 14px;
}
#student-profile-dialog h2, #student-profile-dialog dd, #student-profile-dialog p { overflow-wrap: anywhere; }
.student-profile-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); }
.student-profile-tabs button { font-size: .79rem; }
#student-profile-details [data-profile-content]:not([data-profile-content="basic"]) {
  background: #fffdf8; border: 1px solid #e9dccd; padding: 12px; border-radius: 14px;
}
#student-profile-details details { padding: 8px 0; border-bottom: 1px solid #e9dccd; }
.profile-registration-facts dd { margin: 0 0 8px; color: #142b45; }
.profile-registration-facts dt { font-size: .8rem; }

/* Teacher LOG, personal notifications and roster approvals */
.log-banner { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-radius:22px; background:linear-gradient(110deg,#fff0df,#e3f5ec); }
.log-banner h1 { margin:0; }
.log-banner img { object-fit:contain; }
.log-shortcuts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; margin:10px 0; }
.log-shortcuts button, .log-phrases button { min-height:44px; border:1px solid #e9dccd; border-radius:13px; background:#fff3e6; color:#142b45; font-weight:750; font-size:.76rem; padding:5px; }
.log-shortcuts button:nth-child(even) { background:#e0f3eb; }
.log-shortcuts span { display:block; font-size:1.05rem; color:#136454; }
.log-context-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.log-context-fields input,.log-context-fields select { min-width:0; width:100%; }
.log-phrases { display:flex; gap:6px; flex-wrap:wrap; }
.log-phrases button { padding-inline:10px; }
.log-success { padding:10px; border-radius:12px; background:#dff4ea; color:#145548; font-weight:800; }
#account-notice-message { animation:none; white-space:normal; }
#teacher-account-dialog,#roster-approval-dialog { width:min(calc(100% - 24px),500px); max-height:85dvh; padding:15px; background:#fffaf3; border:1px solid #e9dccd; border-radius:22px; }
.round6-account,#account-notices,#roster-approval-list .teacher-account-card { background:#fffdf8; border:1px solid #e9dccd; border-radius:16px; padding:12px; overflow-wrap:anywhere; }
#account-notice-list { list-style:none; padding:0; }
#account-notice-list li { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:7px 0; border-top:1px solid #eee0d2; }
#account-notice-list .account-notice-label { flex:1 1 12rem; min-width:0; white-space:normal; overflow-wrap:break-word; }
#account-notice-list button,#account-settings summary,#account-logout { min-height:44px; }
#account-notice-list button { flex:none; margin-inline-start:auto; white-space:nowrap; font-size:.76rem; }
#account-settings summary { padding-block:12px; cursor:pointer; }
#roster-approval-list { display:grid; gap:8px; }
#roster-approval-list small { display:block; color:#415466; }
.approval-state { width:fit-content; padding:4px 8px; border-radius:12px; background:#ffeaca; color:#754417; }
.approval-actions { display:flex; flex-wrap:wrap; gap:8px; }
.approval-actions button { min-height:44px; }

#sync-view h2 { font-size:1rem; margin:12px 0 6px; }
#sync-integrations,#sync-results section {
  padding:10px 13px; margin:9px 0; border-radius:15px;
  background:#fffdf8; border:1px solid #e9dccd; color:#142b45;
}
#sync-integrations p,#sync-results section p { margin:5px 0; font-size:.84rem; overflow-wrap:anywhere; }
#sync-retry { min-height:44px; }

/* Shared finishing rules for secondary workflows. */
.workbench :is(#history-view, #activity-view, #fees-view, #records-view, #management-view) > :is(h1, .section-heading) {
  color: var(--dashboard-navy, #142b45);
  margin-block: 10px;
}
.workbench :is(.history-filters, #fees-view .fee-tools) {
  padding: 10px;
  border: 1px solid #e9dccd;
  border-radius: 17px;
  background: #fffdf8;
}
.workbench :is(.history-filters, .fee-tools, .log-context-fields, .student-filter-grid) label { min-width: 0; }
.workbench :is(.history-filters, .fee-tools, .log-context-fields, .student-filter-grid) :is(input, select) {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
}
.workbench :is(.history-table, .activity-card, .teacher-account-card) { overflow-wrap: anywhere; }
.workbench :is(.workbench-links button, .activity-card, .history-entry, #sync-back) { min-height: 44px; }
.workbench :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid #007567; outline-offset: 2px; }

/* Round 9 · Mobile typography and student profile layout */
:root {
  --type-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  --type-greeting: clamp(1.625rem, 6.5vw, 1.75rem);
  --type-page: clamp(1.375rem, 5.6vw, 1.5rem);
  --type-card: 1.125rem;
  --type-student: 1.25rem;
  --type-body: .9375rem;
  --type-caption: .8125rem;
  --type-stat: clamp(1.625rem, 6.6vw, 1.875rem);
  --type-tab: .875rem;
  --type-medium: 500;
  --type-semibold: 600;
  --leading-heading: 1.25;
  --leading-body: 1.5;
}

body:has(.workbench) {
  font: 400 var(--type-body)/var(--leading-body) var(--type-family);
  font-variant-numeric: tabular-nums;
}
.workbench :is(button, input, select, textarea) {
  font-family: inherit;
  font-variant-numeric: inherit;
}
.workbench .view h1 {
  font-size: var(--type-page);
  font-weight: var(--type-semibold);
  line-height: var(--leading-heading);
  letter-spacing: normal;
}
.workbench #home-view .welcome-card h1 {
  font-size: var(--type-greeting);
  font-weight: var(--type-semibold);
  line-height: var(--leading-heading);
  letter-spacing: normal;
  word-break: normal;
}
.workbench #home-view :is(#home-date, #home-branch-label, #home-attendance-status, .home-progress-caption) {
  font-size: var(--type-caption);
  font-weight: 400;
  line-height: var(--leading-body);
  letter-spacing: normal;
}
.workbench #home-view :is(#today-heading, #class-overview-heading, #home-quick-heading) {
  font-size: var(--type-card);
  font-weight: var(--type-semibold);
  line-height: var(--leading-heading);
}
.workbench #home-view .attendance-hero { padding: 12px; }
.workbench #home-view #start-attendance { flex: none; }
.workbench :is(.primary-button, .profile-actions .back-button) {
  font-size: var(--type-body);
  font-weight: var(--type-semibold);
  line-height: var(--leading-heading);
}
.workbench .lincoln-wordmark strong { font-weight: var(--type-semibold); }
.workbench .lincoln-wordmark small, .workbench #teacher-name {
  font-size: var(--type-caption);
  font-weight: var(--type-medium);
  letter-spacing: normal;
}
.workbench #home-view .home-metrics > button {
  gap: 5px;
  min-height: 65px;
  padding: 7px 6px;
}
.workbench #home-view .home-metrics strong {
  font-size: var(--type-stat);
  font-weight: var(--type-semibold);
  line-height: 1.05;
}
.workbench #home-view .home-metrics .home-stat-label {
  font-size: var(--type-caption);
  font-weight: 400;
  white-space: normal;
}
.workbench #home-view #home-class-counts { grid-auto-rows: minmax(48px, auto); }
.workbench #home-view #home-class-counts .class-count {
  font-size: var(--type-caption);
  font-weight: 400;
  line-height: var(--leading-heading);
  padding-block: 5px;
}
.workbench #home-view .class-count strong {
  font-size: var(--type-body);
  font-weight: var(--type-semibold);
}
.workbench #home-view .home-shortcut {
  font-size: var(--type-tab);
  font-weight: var(--type-semibold);
  line-height: var(--leading-heading);
}
.workbench .student-hub-tabs button {
  font-size: var(--type-tab);
  font-weight: var(--type-medium);
}

body:has(#student-profile-dialog[open]) { overflow: hidden; }
.workbench:has(#student-profile-dialog[open]) #workbench-nav { visibility: hidden; }
#student-profile-dialog[open] {
  position: fixed;
  inset: var(--profile-viewport-center, 50%) 0 auto;
  transform: translateY(-50%);
  margin: 0 auto;
  width: min(calc(100% - 24px), 490px);
  max-height: min(720px, calc(min(100dvh, var(--profile-viewport-height, 100dvh)) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
  line-break: strict;
  word-break: normal;
}
#student-profile-dialog .profile-heading { padding: 14px 14px 10px; }
#student-profile-dialog #student-profile-title {
  margin: 0;
  font-size: var(--type-student);
  font-weight: var(--type-semibold);
  line-height: var(--leading-heading);
  letter-spacing: normal;
}
#student-profile-english {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--type-tab);
}
#student-profile-dialog .student-profile-tabs {
  display: flex;
  min-width: 0;
  gap: 3px;
  margin: 0 12px 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
#student-profile-dialog .student-profile-tabs button {
  flex: 1 0 auto;
  min-height: 44px;
  padding: 4px 8px;
  white-space: nowrap;
  font-size: var(--type-tab);
  font-weight: var(--type-medium);
}
#student-profile-dialog .student-profile-tabs button:focus-visible { outline-offset: -2px; }
#student-profile-details {
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 12px 5px;
  scroll-padding-block: 8px;
}
#student-profile-details .profile-section { padding: 9px 11px; margin-bottom: 7px; }
#student-profile-details .profile-section h3 {
  margin-bottom: 5px;
  font-size: var(--type-body);
  line-height: var(--leading-heading);
  font-weight: var(--type-semibold);
}
#student-profile-details dl {
  grid-template-columns: minmax(0, 6em) minmax(0, 1fr);
  gap: 4px 8px;
  align-items: baseline;
}
#student-profile-details dt {
  font-size: var(--type-caption);
  font-weight: 400;
}
#student-profile-details dd { font-size: var(--type-body); }
#student-profile-details label { font-weight: var(--type-medium); }
#student-profile-details :is(input, a) { max-width: 100%; }
#student-profile-details .profile-phone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 7px;
}
.profile-phone bdi { user-select: text; }
#student-profile-details .profile-copy {
  border: 0;
  border-radius: 8px;
  padding: 0 6px;
  min-height: 44px;
  background: transparent;
  color: #075b4e;
  font-size: var(--type-caption);
  font-weight: var(--type-medium);
}
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid #e9dccd;
  background: #fff9f0;
}

/* Round 10 · Compact roll call */
#attendance-view .student-row {
  min-height: 116px;
  gap: 4px;
  margin-bottom: 7px;
  padding: 6px 9px 8px;
  align-content: start;
}
#attendance-view .student-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
}
.roll-student-identity { min-width: 0; }
#attendance-view .student-profile-button {
  min-height: 32px;
  padding: 0;
  font-size: 1.125rem;
  font-weight: var(--type-semibold);
  line-height: var(--leading-heading);
}
#attendance-view .student-info :is(.roll-english-name, .student-class-label) {
  margin: 0;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.roll-student-tools {
  display: grid;
  justify-items: end;
  align-content: start;
}
#attendance-view .attendance-state { font-size: .75rem; }
#attendance-view .talk-button {
  min-height: 36px;
  padding: 0 5px;
  border-color: transparent;
  background: transparent;
  font-size: .75rem;
  font-weight: var(--type-medium);
  white-space: nowrap;
}
#attendance-view .status-btn {
  min-height: 44px;
  font-size: var(--type-tab);
  font-weight: var(--type-medium);
}
#attendance-view .status-btn[aria-pressed="true"] { font-weight: var(--type-semibold); }
#attendance-view .roll-health-reminder {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid #e6ba8e;
  border-radius: 8px;
  background: #fff0d9;
  color: #7b3812;
  font-size: var(--type-caption);
  font-weight: var(--type-semibold);
}
.roll-health-reminder b {
  display: inline-grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #7b3812;
  color: white;
}
.roll-health-text {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 500;
  line-height: 1.45;
}
#attendance-view .roster-compact .student-row:has(.roll-health-reminder:not([hidden])) .status-actions {
  grid-column: 1 / -1;
}
#attendance-shifts, #history-shifts { margin-block: 4px; }
#history-shifts { grid-column: 1 / -1; }
#attendance-view .roll-reason {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 6px 8px;
  font: inherit;
  font-size: 1rem;
  color: var(--roll-ink);
  border: 1px solid var(--roll-border);
  border-radius: 8px;
  background: var(--roll-paper);
}
.workbench:has(#attendance-view:not([hidden])) { padding-bottom: 0; }
.workbench #attendance-view { padding-bottom: 8px; }
#attendance-content { padding-bottom: calc(var(--roll-footer-height, 96px) + 6px); }
#attendance-view .sticky-finish {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--shell-width) - 2 * var(--gutter)));
  margin: 0;
  padding: 8px 9px calc(8px + env(safe-area-inset-bottom));
  flex-wrap: wrap;
}
#attendance-view .finish-progress { flex: 1 1 150px; }
#attendance-view .finish-progress strong { font-size: var(--type-tab); font-weight: var(--type-semibold); }
#attendance-view .finish-progress small { margin: 0; font-size: var(--type-caption); line-height: 1.35; }
#attendance-view #attendance-draft-count[data-pending="true"] { color: #80440e; font-weight: var(--type-medium); }
#attendance-save-feedback:empty { display: none; }
#student-profile-details [data-profile-content="fees"] .attendance-fee-label { margin-inline-end: 7px; }
.roll-student-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}
#attendance-view .status-btn.absent-btn[aria-pressed="false"] {
  background: #fff8f7;
  color: #85323b;
}
#attendance-view .status-btn.leave-btn[aria-pressed="false"] {
  background: #faf6ff;
  color: #603283;
}

/* Staff leave */
.leave-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.leave-banner img { object-fit: contain; }
#leave-content { display: grid; gap: 12px; }
.leave-card {
  display: grid; gap: 9px; padding: 14px; min-width: 0;
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface-raised);
  overflow-wrap: anywhere;
}
.leave-card h2, .leave-card h3, .leave-card p, .leave-card ul { margin: 0; }
.leave-card h2 { font: 600 1.125rem/1.25 var(--type-family); }
.leave-card h3 { font-size: 1rem; }
.leave-card label { display: grid; gap: 4px; min-width: 0; }
.leave-card :is(input, select, textarea) {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 16px;
}
.leave-card input[type="checkbox"] { width: 20px; min-height: 20px; accent-color: var(--blue); }
.leave-availability { padding: 8px 12px; background: var(--mint); border-radius: 12px; }
.leave-availability ul, ul.leave-availability { list-style: none; }
.leave-history { display: grid; gap: 8px; }
.leave-history article { display: grid; gap: 5px; padding: 10px; border-radius: 12px; background: var(--surface-low); }
#leave-message:empty { display: none; }

.whatsapp-copy { display: grid; gap: 6px; margin-block: 10px; }
.whatsapp-copy p { margin: 0; font-size: var(--type-caption, 13px); overflow-wrap: anywhere; }
.whatsapp-recipient { color: var(--muted); }
.whatsapp-copy p:empty { display: none; }
.whatsapp-copy textarea { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; }

/* 今日废话 */
#open-nonsense { grid-template-columns: 1fr; gap: 2px; }
#open-nonsense small { font-weight: 400; color: var(--muted); }
#nonsense-view { max-width: 560px; margin-inline: auto; padding-bottom: 25px; }
.nonsense-header p { margin: 3px 0 0; color: var(--muted); }
.nonsense-card {
  --nonsense-accent: #fce3c9;
  display: grid; justify-items: center; min-height: 244px; padding: 10px 16px 16px;
  text-align: center; background: linear-gradient(175deg,var(--nonsense-accent),#fffdf7 72%);
  border: 1px solid #fff9ed; border-radius: 24px; box-shadow: var(--elevation);
}
.nonsense-card[data-mood="angel"] { --nonsense-accent: #cfeee1; }
.nonsense-card[data-mood="devil"] { --nonsense-accent: #f3dbed; }
.nonsense-card[data-mood="boss"] { --nonsense-accent: #d4e3ef; }
.nonsense-card:is([data-mood="easter"],[data-mood="gold"]) { --nonsense-accent: #ffebae; }
.nonsense-mascot { position: relative; width: 176px; height: 143px; }
.nonsense-mascot img { display: block; width: 100%; height: 100%; object-fit: contain; }
#nonsense-accessory, #nonsense-side-accessory { position: absolute; font-size: 1.7rem; }
#nonsense-accessory { inset: 16px 8px auto auto; }
#nonsense-side-accessory { inset: 69px auto auto 2px; }
#nonsense-side-accessory:not(:empty) { color: #71380b; text-shadow: 0 1px #fff; font-weight: 800; }
.nonsense-theme { font-size: .8125rem; color: #71380b; font-weight: 600; }
.nonsense-reply { width: 100%; overflow-wrap: anywhere; }
#nonsense-mode { font-size: .8125rem; color: var(--muted); }
#nonsense-quote { margin: 6px 0 0; font-size: 1.18rem; font-weight: 600; line-height: 1.5; }
#nonsense-boss-note, #nonsense-extra { margin: 6px 0 0; font-size: .8125rem; }
#nonsense-extra:empty, #nonsense-mode:empty, #nonsense-status:empty, #nonsense-award-status:empty { display: none; }
.nonsense-controls { display: grid; gap: 7px; margin-top: 11px; }
.nonsense-controls textarea, .nonsense-award-actions textarea { width: 100%; min-height: 80px; font: inherit; }
#nonsense-status { margin: 0; }
#nonsense-draw { min-height: 54px; font-size: 1.05rem; }
.nonsense-counts {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 8px;
  padding: 9px 13px; background: var(--mint); border-radius: 14px; font-size: .875rem;
}
.nonsense-counts progress { grid-column: 1 / -1; width: 100%; height: 8px; accent-color: #006b5b; }
.nonsense-counts small { grid-column: 1 / -1; font-size: .8125rem; }
#nonsense-award { width: min(calc(100% - 28px), 460px); max-height: 90dvh; border: 1px solid #c59649; background: #fff9ec; }
.nonsense-certificate {
  display: grid; gap: 7px; text-align: center; padding: 13px;
  border: 4px double #b98532; background: #fffcf2;
}
.nonsense-certificate p, .nonsense-certificate h2, .nonsense-award-actions p { margin: 0; }
.nonsense-certificate p:first-child, .nonsense-certificate strong { color: #82561a; font-weight: 700; }
.nonsense-certificate h2 { font-size: 1.35rem; }
.nonsense-award-present { font-size: .9rem; color: #83541c; }
.nonsense-award-recipient { color: #b57916; font-size: clamp(1.65rem, 7vw, 2.35rem); font-weight: 800; overflow-wrap: anywhere; line-height: 1.12; }
.nonsense-trophy { font-size: 2.45rem; }
.nonsense-award-actions { display: grid; gap: 6px; margin-top: 10px; }
.nonsense-award-actions a { display: grid; place-items: center; text-decoration: none; }
@media (prefers-reduced-motion: no-preference) {
  #nonsense-award[open]::before {
    content: "";
    position: absolute;
    pointer-events: none;
    inset: 5px 10px auto;
    height: 82px;
    background:
      radial-gradient(circle at 8% 25%, #cb802e 0 3px, transparent 4px),
      radial-gradient(circle at 22% 48%, #65aa91 0 4px, transparent 5px),
      radial-gradient(circle at 76% 39%, #df9e48 0 4px, transparent 5px),
      radial-gradient(circle at 92% 22%, #85b8ab 0 3px, transparent 4px);
    animation: nonsense-confetti 560ms ease-out both;
  }
  @keyframes nonsense-confetti {
    from { opacity: 0; transform: translateY(-12px); }
    30% { opacity: 1; }
    to { opacity: 0; transform: translateY(20px); }
  }
}

@media (max-width: 1239px) {
  #workbench-nav { grid-template-columns: repeat(6, minmax(0,1fr)); }
  #workbench-nav button { padding-inline: 0; font-size: .75rem; }
}
#workbench-nav #nav-nonsense { background: #fff0dd; color: #733a14; }
#workbench-nav #nav-nonsense[aria-current="page"] { background: #f8d0a7; }
#workbench-nav #nav-nonsense img { object-fit: contain; }
.login-cat-bubble {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  margin: 3px 0 10px; padding: 4px 8px 4px 12px;
  border-radius: 14px; background: #fff0df; color: #61361d;
}
.login-cat-bubble p { flex: 1 1 180px; margin: 4px 0; font-size: .85rem; }
.login-cat-bubble button { white-space: nowrap; }
.home-savage-bubble { margin: -8px 0 12px; border: 1px solid #efb56b; background: #fff4dc; color: #6d421b; }
.workbench .home-quick-grid #home-leave { background: linear-gradient(150deg,#fff4e8,#f6d7ba); }
.workbench .home-quick-grid #home-leave svg { color:#a75520; }
.workbench .home-quick-grid #home-nonsense { background: linear-gradient(150deg,#fff3e6,#f7cfaa); }
.workbench .home-quick-grid #home-nonsense img { object-fit: contain; }
#nonsense-card:has(#nonsense-meme-stage:not([hidden])) .nonsense-mascot { display: none; }
#nonsense-card:has(#nonsense-meme-stage:not([hidden])) .nonsense-reply { display: contents; }
#nonsense-card:has(#nonsense-meme-stage:not([hidden])) #nonsense-mode { grid-row: 1; }
.nonsense-meme-stage {
  grid-row: 2; width: 100%; height: 204px; overflow: hidden; border-radius: 15px;
  background: #fff2df url(lincoln-mascot.webp) center / auto 90% no-repeat;
}
.nonsense-meme-stage img { width: 100%; height: 100%; object-fit: contain; }
.nonsense-sharing { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
#nonsense-meme-export { width: min(calc(100% - 24px), 420px); max-height: 88dvh; overflow: auto; }

/* Keep the exact WhatsApp payload readable before copying. */
.whatsapp-copy textarea { min-height: 16rem; max-height: 55dvh; padding: 14px; line-height: 1.6; font-size: 16px; border: 1px solid #cbded5; border-radius: 16px; background: #f5fbf7; color: var(--ink, #203047); white-space: pre-wrap; overflow-wrap: anywhere; }
.whatsapp-copy [hidden] { display: none !important; }
#restore-view:not([hidden]) { display:grid; min-height:90svh; place-items:center; text-align:center; }
#restore-view .login-mark {margin:0 auto 12px}
#restore-spinner:not([hidden]) {display:block;width:22px;height:22px;margin:18px auto;border:3px solid #dcebe3;border-top-color:#387e68;border-radius:50%;animation:restore-spin 1s linear infinite}
@keyframes restore-spin {to {transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#restore-spinner:not([hidden]){animation:none}}

/* Brand mascot motion: the original artwork stays untouched; only its wrapper moves. */
.workbench #home-view .welcome-mascot {
  width: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 12px;
  color: inherit; background: transparent; font: inherit; line-height: 0; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.workbench #home-view .welcome-mascot:focus-visible { outline: 3px solid #176c57; outline-offset: -3px; }
.welcome-mascot .mascot-motion { display: grid; place-items: end center; width: 100%; align-self: stretch; transform-origin: 60% 95%; }
.welcome-mascot img { pointer-events: none; user-select: none; }
.completion-mascot { display: grid; place-items: center; flex: 0 0 66px; width: 66px; height: 66px; overflow: visible; }
.completion-mascot .mascot-motion { display: grid; place-items: center; width: 100%; height: 100%; transform-origin: 50% 90%; }
.completion-mascot img { width: 66px; height: 66px; }
.mascot-motion.is-running { will-change: transform; }

@media (prefers-reduced-motion: no-preference) {
  .mascot-motion.is-running[data-state="welcome"] { animation: lincoln-mascot-wave 1250ms cubic-bezier(.2,.72,.3,1) both; }
  .mascot-motion.is-running[data-state="idle"] { animation: lincoln-mascot-breathe 1500ms ease-in-out both; }
  .mascot-motion.is-running[data-state="success"] { animation: lincoln-mascot-jump 950ms cubic-bezier(.2,.72,.3,1) both; }
  .mascot-motion.is-running[data-state="celebrate"] { animation: lincoln-mascot-cheer 1350ms cubic-bezier(.2,.72,.3,1) both; }
  .mascot-motion.is-running[data-state="curious"] { animation: lincoln-mascot-curious 900ms ease-in-out both; }
  .mascot-motion.is-running[data-state="playful"] { animation: lincoln-mascot-play 1050ms cubic-bezier(.2,.72,.3,1) both; }
  @keyframes lincoln-mascot-wave {
    0%,100% { transform: translateY(0) rotate(0); }
    22% { transform: translateY(-3px) rotate(-6deg); }
    48% { transform: translateY(-2px) rotate(5deg); }
    73% { transform: translateY(-1px) rotate(-3deg); }
  }
  @keyframes lincoln-mascot-breathe {
    0%,100% { transform: translateY(0) scale(1); }
    48% { transform: translateY(-2px) scale(1.012); }
  }
  @keyframes lincoln-mascot-jump {
    0%,100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-9px) scale(1.025); }
    65% { transform: translateY(1px) scale(.99); }
  }
  @keyframes lincoln-mascot-cheer {
    0%,100% { transform: translateY(0) rotate(0) scale(1); }
    22% { transform: translateY(-7px) rotate(-4deg) scale(1.02); }
    44% { transform: translateY(0) rotate(2deg) scale(1); }
    68% { transform: translateY(-5px) rotate(4deg) scale(1.018); }
  }
  @keyframes lincoln-mascot-curious {
    0%,100% { transform: rotate(0); }
    35%,70% { transform: translateY(-2px) rotate(7deg); }
  }
  @keyframes lincoln-mascot-play {
    0%,100% { transform: translateY(0) rotate(0); }
    20% { transform: translateY(-3px) rotate(-7deg); }
    40% { transform: translateY(0) rotate(6deg); }
    62% { transform: translateY(-4px) rotate(-5deg); }
    82% { transform: translateY(0) rotate(3deg); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-motion, .mascot-motion.is-running { animation: none !important; transition: none !important; }
}
#restore-view button {padding:10px 16px;border-radius:14px}
#login-cat-bubble:not([hidden]) {display:grid;gap:2px;margin:6px 0 12px;padding:9px 14px;background:#fff5e9;border:0;border-radius:5px 16px 16px;color:#25374a}
#login-cat-bubble small {font-size:12px;color:#785636}
#login-cat-bubble p {font-size:15px;line-height:1.45;margin:2px 0}
#login-cat-next {justify-self:end;width:auto;min-height:28px;padding:3px 8px;font-size:13px}
@media(max-width:700px){#workbench-nav{grid-template-columns:repeat(5,minmax(0,1fr))}}
.workbench #login-view:not([hidden]) { display:grid;place-items:center;min-height:92svh;padding:18px;background:transparent }
.workbench #login-view .login-card {width:min(100%,330px);box-sizing:border-box;padding:22px 24px 24px;text-align:center;border-radius:26px;background:#fffdf8;border:1px solid #ece6d9;box-shadow:0 6px 24px #5944210c}
.signin-cat {display:block;object-fit:contain;margin:0 auto;width:104px;height:104px}
#login-heading{font-size:26px;margin:4px 0;color:#233744}
#login-view .login-help{margin:3px 0 22px;font-size:14px;color:#52645e}
#login-view .pin-field{display:block;text-align:left;font-size:14px;margin:0 0 8px}
.pin-boxes{position:relative;display:grid;grid-template-columns:repeat(4,1fr);gap:9px}
.pin-boxes span{height:50px;display:grid;place-items:center;border-radius:12px;background:#f6f7f2;border:1px solid #c8d5cb;color:#205a49;font-size:17px}
.pin-boxes span:not(:empty){background:#e8f4ea}
.pin-boxes:focus-within .current{outline:2px solid #3c816c}
#login-view .pin-boxes input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:text;margin:0}
#login-button{background:#235c49;color:white;min-height:46px;border-radius:14px}
#login-button:active{transform:translateY(1px)}
#login-button:disabled{opacity:.7}
#login-error:empty{min-height:0;margin:12px 0 0}
@media(max-height:540px){.workbench #login-view:not([hidden]){min-height:0;padding:8px}.signin-cat{width:56px;height:56px}#login-view .login-help{margin-bottom:10px}}

/* Shared action hierarchy. Information panels retain their existing surfaces. */
:root {
  --action-primary:#175c4b; --action-ink:#173746; --action-edge:#607c72;
  --action-secondary:#e5f2ec; --action-warm:#ffead7; --action-cool:#e5edf5;
  --action-focus:#075eac; --action-disabled:#e4e6e3; --action-muted:#4f5955;
}
.workbench button:is(.primary-button,.primary-button:not(:disabled)), .workbench #login-button {
  background:var(--action-primary); color:white; border:1px solid var(--action-primary);
}
.workbench button:is(.quick-button,.back-button,.home-shortcut,.status-btn):not([aria-pressed=true]):not(.active) {
  border:1px solid var(--action-edge); background:var(--action-secondary);color:var(--action-ink)
}
.workbench #home-view .home-quick-grid button.home-shortcut[id] {
  min-height:56px;padding:7px 9px;gap:5px;border:1px solid var(--action-edge);
  background:var(--action-secondary);color:var(--action-ink);box-shadow:0 2px 3px #17374612
}
.workbench #home-view .home-quick-grid button.home-shortcut:nth-child(3n+2){background:var(--action-cool)}
.workbench #home-view .home-quick-grid button.home-shortcut:is(#home-nonsense,#home-leave){background:var(--action-warm)}
#home-view .home-quick-grid button[id] .home-shortcut-arrow {opacity:1;color:var(--action-ink);font-size:19px}
#home-view .home-quick-grid button[id] svg {color:var(--action-primary)}
.workbench #home-view #home-class-counts button.class-count {
  position:relative;border:1px solid var(--action-edge);background:#f2f7f3;color:var(--action-ink);padding-inline:6px 16px
}
.class-count::after {content:"";position:absolute;right:8px;top:45%;width:5px;height:5px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(-45deg)}
.workbench button:focus-visible,dialog button:focus-visible {outline:3px solid var(--action-focus);outline-offset:2px}
@media(hover:hover){button:enabled:hover{filter:brightness(.94)}}
button:enabled:active{transform:translateY(1px);filter:brightness(.86)}
.workbench button:disabled,dialog button:disabled {opacity:1!important;background:var(--action-disabled)!important;color:var(--action-muted)!important;border:1px dashed var(--action-muted)!important;box-shadow:none!important;cursor:not-allowed}
button[aria-busy=true]{cursor:progress}

#boss-view{max-width:68rem;margin:auto;padding:1rem 1rem 6rem;color:#19394a}
.boss-controls,.boss-grid{display:flex;flex-wrap:wrap;gap:.65rem}
.boss-controls [aria-pressed=true]{background:#185c50;color:white}
.boss-card{flex:1 1 14rem;border-radius:1rem;padding:1rem;background:#fffdf7;border:1px solid #cbdbd2;margin:.5rem 0}
#boss-view h2{font-size:1.2rem;margin-top:1.4rem}
#boss-entry[hidden]{display:none}

#boss-view .insight-head{display:flex;align-items:center;gap:14px;color:#193c49}
.insight-head img{width:66px;height:66px;object-fit:contain}.insight-head h1{margin:0}
.insight-nav,.insight-legend{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.insight-nav button{background:#fffaf0;border:1px solid #b2c7bb;color:#163b40;border-radius:18px;padding:9px 16px;min-height:44px;cursor:pointer}
.insight-nav button[aria-pressed=true]{background:#245f53;color:white}
.insight-stats,.insight-grid{display:grid;gap:12px}.insight-stats{grid-template-columns:repeat(auto-fit,minmax(134px,1fr))}
.insight-grid{margin-top:14px;grid-template-columns:repeat(2,minmax(0,1fr))}
.insight-panel{background:#fffdf6;border:1px solid #e3dfcf;border-radius:20px;padding:16px;color:#203e49;min-width:0;text-align:left}
#boss-view .insight-panel h2{font-size:1.03rem;margin:0 0 12px}.insight-panel h3{font-size:.94rem;margin-bottom:2px}
.insight-stats article:nth-child(3n+1){background:#e9f4e9}.insight-stats article:nth-child(3n+2){background:#fff0dc}
.insight-panel strong{display:block;font-size:1.8rem;line-height:1.25}.insight-panel small,.insight-head small{display:block;color:#57686b;font-size:.85rem}
.insight-panel svg{width:100%;display:block}.insight-panel summary{cursor:pointer;padding:10px 0}
.insight-ring{width:112px;height:112px;border-radius:100%;display:grid;place-items:center;margin:5px auto;background:#e3e7df}
.insight-ring b{width:77px;height:77px;display:grid;place-items:center;border-radius:100%;background:#fffdf6;font-size:1.4rem}.insight-legend{justify-content:center}.insight-legend span{border-bottom:3px solid;padding:3px}
@media(max-width:620px){.insight-grid{grid-template-columns:1fr}.insight-nav button{padding:8px 12px}.insight-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}

button.home-shift-pending { min-height: 44px; text-decoration: underline; cursor: pointer; }
#shift-review { overflow-y: auto; background: #fffaf3; }
.shift-review-student { margin-block: 10px; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow-wrap: anywhere; }
.shift-review-student h3, .shift-review-student p { margin: 0 0 8px; }
.shift-review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#shift-review button { min-height: 44px; }

.home-metrics > button { border: 1px solid transparent; color: inherit; text-align: left; cursor: pointer; }
.home-metrics > button:disabled { cursor: wait; }
.home-metrics > button:focus-visible { outline: 2px solid #187464; outline-offset: 2px; }
#home-unmarked, .attendance-status-tabs button { min-height: 44px; }
@media (max-width: 380px) { .home-metrics .home-stat-icon { display: none; } }

/* Material workbench roles shared by the daily attendance surfaces. */
.workbench {
  --md-primary: #914800;
  --md-on-primary: #fff;
  --md-primary-container: #ffdcc0;
  --md-on-primary-container: #2f1700;
  --md-surface: #fffbf7;
  --md-surface-container: #f6eee7;
  --md-surface-container-low: #fbf3eb;
  --md-on-surface: #231a14;
  --md-on-surface-variant: #57483b;
  --md-outline-variant: #ded1c5;
  --md-focus: #914800;
  --md-radius-medium: 12px;
  --md-radius-large: 16px;
}
.workbench .attendance-header, .workbench #workbench-nav { background: var(--md-surface); color: var(--md-on-surface); box-shadow: none; }
.workbench #workbench-nav button[aria-current="page"] { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.workbench #home-view .attendance-hero, .workbench #home-view .class-overview, .workbench #home-view .home-quick-panel {
  background: var(--md-surface); border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-large); box-shadow: none;
}
.workbench #home-view #start-attendance { background: var(--md-primary); color: var(--md-on-primary); min-height: 48px; }
.workbench #home-view .home-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.workbench #home-view .home-metrics > button { min-height: 56px; background: var(--md-surface-container-low); border-radius: var(--md-radius-medium); box-shadow: none; color: var(--md-on-surface); }
.workbench #home-view .home-metrics > button:nth-child(2) { background: #ecf3e4; }
.workbench #home-view .home-metrics > button:nth-child(3) { background: #f8e7e4; }
.workbench #home-view .home-metrics > button:nth-child(4) { background: #fff0d8; }
.workbench #home-view .home-attendance-date { color: var(--md-on-surface-variant); margin-block: 3px; font-size: .875rem; }
.workbench #attendance-view .student-row { border-color: var(--md-outline-variant); border-radius: var(--md-radius-medium); box-shadow: none; }
.workbench #attendance-view .attendance-status-tabs button { min-height: 48px; }
.workbench #attendance-view .attendance-status-tabs button[aria-pressed="true"] { background: var(--md-primary-container); color: var(--md-on-primary-container); border-color: transparent; }
.workbench :is(#home-view,#attendance-view) button:focus-visible { outline: 2px solid var(--md-focus); outline-offset: 2px; }
@media (max-width: 520px) { .workbench #home-view .home-metrics .home-stat-icon { display: none; } }

.workbench .material-snackbar {
  position: fixed; z-index: 20; inset-inline: max(12px, calc((100% - 480px) / 2));
  bottom: calc(env(safe-area-inset-bottom) + 160px); display: flex; align-items: center;
  padding: 4px 8px 4px 16px; gap: 8px; min-height: 48px; border-radius: 8px;
  color: #fff8f2; background: #382920; box-shadow: 0 2px 6px #38292038;
}
.workbench .material-snackbar[hidden] { display: none; }
.material-snackbar span { flex: 1; overflow-wrap: anywhere; }
.material-snackbar button { padding: 0 9px; min-width: 48px; min-height: 48px; color: #ffdab8; background: transparent; border: 0; }

.workbench #student-profile-dialog { background: var(--md-surface); color: var(--md-on-surface); }
.workbench #student-profile-dialog .profile-section { background: var(--md-surface-container-low); border: 0; box-shadow: none; }
.workbench #student-profile-dialog .profile-allergy dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.workbench #home-intake-todo { min-height: 48px; width: 100%; color: var(--md-on-primary-container); background: var(--md-primary-container); }

.nonsense-certificate img { display: block; margin-inline: auto; object-fit: contain; }
#nonsense-reopen { min-height: 44px; }
#nonsense-legacy { color: #6f533a; }

#nonsense-legacy { padding: 12px; border-radius: 12px; background: #fff3de; }
#nonsense-legacy button,#nonsense-collected-list button { min-height: 44px; }
#nonsense-collection { max-height: 84dvh; overflow: auto; }
#nonsense-collected-list { display: grid; gap: 6px; padding-inline-start: 24px; }
#nonsense-collected-list button { text-align: start; overflow-wrap: anywhere; }

#boss-teacher-reports { display:grid; gap:10px; margin-bottom:16px; }
#boss-teacher-reports[hidden] { display:none; }
#boss-teacher-reports :is(button,summary) { min-height:44px; }
#boss-report-results details { padding:10px; margin-bottom:8px; border:1px solid var(--md-outline-variant,#ded1c5); border-radius:12px; }
#boss-report-results summary { cursor:pointer; padding-block:8px; }
#boss-report-results p { white-space:pre-wrap; overflow-wrap:anywhere; }

.ops-observation, #ops-follow-up-list article { padding:10px; margin-block:8px; border:1px solid var(--md-outline-variant,#ded1c5); border-radius:12px; overflow-wrap:anywhere; }
.ops-observation button,#ops-follow-up-list button { margin:4px 4px 4px 0; }
.ops-observation select { max-width:100%; }

#teacher-log-follow-ups article {
  padding: .75rem;
  background: #fff7eb;
  border-radius: .75rem;
  margin-block: .5rem;
}
#teacher-log-follow-ups p, #ops-follow-up-list li {
  overflow-wrap: anywhere;
}
.ops-observation select, #ops-follow-up-list select, #ops-follow-up-list input {
  max-width: 100%;
}

#boss-report-home { display:grid; gap:.35rem; width:100%; text-align:left; }
#boss-report-home-metrics { font-weight:400; }
.daily-report { padding:.85rem .9rem; margin-block:.55rem; border:1px solid var(--border); border-radius:12px; background:var(--surface-raised); }
.daily-report header { display:flex; flex-wrap:wrap; gap:.4rem .75rem; align-items:center; }
.daily-report h4 { margin:0; }
.daily-report p { white-space:pre-wrap; overflow-wrap:anywhere; margin:.25rem 0 .65rem; }
.daily-report :is(button,select) { max-width:100%; }
.daily-report:focus { outline:2px solid var(--blue); }
#boss-report-digest button { display:block; text-align:left; margin-block:.35rem; overflow-wrap:anywhere; }
#boss-report-digest { margin-block:.65rem; }

#attendance-center { display:grid; gap:.65rem; }
#attendance-center :is(p,progress) { margin:.35rem 0; }
#attendance-center progress { display:block; width:100%; accent-color:#006b5b; }
.attendance-center-shifts, .attendance-center-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; }
.attendance-center-total, .attendance-center-shifts section { border-radius:12px; padding:.65rem; background:#fffaf4; }
.attendance-center-shifts section[data-shift="afternoon"] { background:#e8f6f1; }
.attendance-center-shifts section[data-emphasis="true"] { outline:1px solid #006b5b; }
#attendance-center button { white-space:normal; min-height:44px; }
#attendance-center-detail { width:min(92%, 42rem); max-height:85dvh; border:1px solid var(--border); border-radius:16px; padding:1rem; }
#attendance-center-detail-body section { border-top:1px solid var(--border); padding:.5rem 0; overflow-wrap:anywhere; }

#attendance-center progress.attendance-center-marking { accent-color:#805026; height: .56rem; }
#attendance-center[hidden], #home-legacy-metrics[hidden] { display:none; }

#attendance-view .status-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
#attendance-view .absence-inline { padding:.55rem; border-radius:10px; background:#fff7ec; }
#attendance-view .absence-inline[hidden] { display:none; }
#attendance-view .absence-presets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.4rem; }
#attendance-view .absence-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.4rem; margin:.5rem 0; }
#attendance-view .absence-inline :is(button,input[type="text"]) { min-height:44px; }
#attendance-view .absence-inline label { display:inline-flex; align-items:center; min-height:44px; margin-inline-end:.8rem; }
#attendance-view button.roll-reason { display:block; text-align:left; min-height:44px; overflow-wrap:anywhere; }

/* Lincoln Premium tokens */
:root {
  --lp-background:#faf7f1; --lp-surface:#fffdfa; --lp-secondary:#f3eee6;
  --lp-ink:#302d29; --lp-muted:#685e53; --lp-border:#e8e1d7;
  --lp-sage:#b6c9a7; --lp-green:#3f6850; --lp-gold:#d5aa71; --lp-teal:#83a99e; --lp-danger:#9f4439;
  --lp-s1:4px; --lp-s2:8px; --lp-s3:12px; --lp-s4:16px; --lp-s5:20px; --lp-s6:24px; --lp-s8:32px;
  --lp-card:20px; --lp-control:12px;
}
#attendance-center { color:var(--lp-ink); gap:var(--lp-s3); font-variant-numeric:tabular-nums; }
#attendance-center .premium-card { border:1px solid var(--lp-border); border-radius:var(--lp-card); background:var(--lp-surface); padding:var(--lp-s4); }
#attendance-center button:is(.premium-hero,.premium-metric,.premium-session,.premium-insight) {
  color:inherit; text-align:start; cursor:pointer; box-shadow:none; transition:background-color 150ms ease;
}
#attendance-center button:is(.premium-hero,.premium-metric,.premium-insight) { border:0; background:transparent; border-radius:var(--lp-control); }
#attendance-center button:hover { background:var(--lp-background); }
#attendance-center button:focus-visible { outline:2px solid var(--lp-green); outline-offset:2px; }
#attendance-center .premium-hero { display:flex; width:100%; align-items:center; justify-content:space-between; gap:var(--lp-s3); padding:0; }
.premium-hero > span:first-child,.premium-session,.premium-insight > span { display:grid; gap:var(--lp-s1); }
.premium-hero strong { font-size:clamp(1.55rem,7vw,2.75rem); line-height:1.12; letter-spacing:-.03em; }
#attendance-center small { color:var(--lp-muted); font-weight:500; }
.premium-ring { width:clamp(64px,23vw,104px); aspect-ratio:1; flex:none; display:grid; place-items:center; border-radius:50%; background:conic-gradient(var(--lp-sage) var(--ring-value),var(--lp-secondary) 0); }
.premium-ring-center { width:78%; aspect-ratio:1; display:grid; place-items:center; border-radius:50%; background:var(--lp-surface); color:var(--lp-green); font-size:1.25rem; }
#attendance-center .attendance-center-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; border-top:1px solid var(--lp-border); margin-top:var(--lp-s3); padding-top:var(--lp-s2); }
#attendance-center .premium-metric { display:grid; justify-items:center; align-content:center; padding:var(--lp-s1); min-height:48px; }
.premium-metric + .premium-metric { border-inline-start:1px solid var(--lp-border) !important; }
.premium-metric strong,.premium-session > strong { font-size:clamp(1.17rem,4vw,1.65rem); line-height:1.2; }
.premium-metric span,.premium-session > span:not(.premium-session-heading) { font-size:.78rem; color:var(--lp-muted); }
.premium-metric[data-metric="present"] strong { color:var(--lp-green); }
.premium-metric[data-metric="out"] strong { color:var(--lp-danger); }
#attendance-center .attendance-center-shifts { gap:var(--lp-s2); }
#attendance-center .premium-session { min-width:0; padding:var(--lp-s3); align-content:start; min-height:48px; --session-accent:var(--lp-gold); }
#attendance-center .premium-session[data-shift="afternoon"] { --session-accent:var(--lp-teal); }
#attendance-center .premium-session[data-emphasis="true"] { border-color:var(--session-accent); }
.premium-session-heading { display:flex; align-items:center; gap:var(--lp-s2); font-size:.91rem; }
.premium-session-heading span:first-child { display:grid; place-items:center; width:26px; height:26px; border-radius:8px; background:var(--session-accent); }
.premium-session-heading span:last-child { margin-inline-start:auto; }
#attendance-center .premium-session progress { height:.42rem; accent-color:var(--session-accent); }
#attendance-center .premium-insight { display:flex; width:100%; align-items:center; gap:var(--lp-s2); background:var(--lp-secondary); padding:var(--lp-s2) var(--lp-s3); }
.premium-insight img { flex:none; object-fit:contain; }
.premium-insight span span { font-size:.86rem; }
@media(prefers-reduced-motion:reduce) { #attendance-center button { transition:none; } }
