/* Standalone tracker only. Reuse PRISM's DS2 palette without loading the desktop shell. */
.bt-page {
  --bt-bg: var(--ds-shell-bg);
  --bt-paper: var(--ds-shell-panel);
  --bt-text: var(--ds-shell-text);
  --bt-muted: var(--ds-shell-muted);
  --bt-line: var(--ds-shell-border);
  --bt-depth: var(--ds-depth);
  --bt-soft: var(--ds-shell-card-selected);
  --bt-rule: color-mix(in srgb, var(--bt-line) 26%, var(--bt-paper));
  --bt-danger: color-mix(in srgb, var(--danger) 65%, var(--bt-text));
  margin: 0;
  background: var(--bt-bg);
  color: var(--bt-text);
  font:
    15px/1.4 "Poppins",
    system-ui,
    -apple-system,
    sans-serif;
  color-scheme: light;
}
/* Preserve the existing device appearance preference, using shared dark surface tokens. */
.bt-page[data-bt-dark="true"] {
  --bt-bg: var(--sidebar-surface);
  --bt-paper: var(--slate-surface);
  --bt-text: var(--text-inverse);
  --bt-muted: var(--muted-light);
  --bt-line: var(--muted-light);
  --bt-depth: var(--slate-border);
  --bt-soft: color-mix(in srgb, var(--ds-accent-primary) 15%, var(--bt-paper));
  color-scheme: dark;
}
.bt-page * {
  box-sizing: border-box;
}
.bt-page [hidden] {
  display: none !important;
}
.bt-page #bt-root {
  max-width: 1120px;
  margin: auto;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.bt-page h1 {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0;
}
.bt-page h2 {
  font-size: 17px;
  line-height: 1.3;
  margin: 8px 0;
}
.bt-page p {
  margin: 6px 0;
}
.bt-page button,
.bt-page input,
.bt-page select {
  font: inherit;
  color: var(--bt-text);
  border: 2px solid var(--bt-line);
  border-radius: var(--prism-radius-small);
  background: var(--bt-paper);
  min-height: 44px;
  padding: 6px 10px;
}
.bt-page button {
  cursor: pointer;
  touch-action: manipulation;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transform: none;
}
.bt-page button:disabled {
  opacity: 0.45;
  cursor: default;
}
.bt-page button:not(:disabled):active {
  background: var(--bt-soft);
  transform: none;
}
.bt-page button:focus-visible,
.bt-page input:focus-visible,
.bt-page select:focus-visible,
.bt-page a:focus-visible,
.bt-page .bt-table-scroll:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 3px;
}
.bt-page svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bt-page .bt-icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
}
.bt-page .bt-heading,
.bt-page .bt-heading-copy,
.bt-page .bt-heading-actions,
.bt-page .bt-sheet-head,
.bt-page .bt-save-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bt-page .bt-heading,
.bt-page .bt-sheet-head {
  justify-content: space-between;
}
.bt-page .bt-brand {
  color: var(--bt-text);
  font-weight: 850;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  border: 2px solid var(--bt-line);
  border-radius: 6px;
  padding: 3px 5px;
  background: var(--bt-paper);
  box-shadow: 2px 2px 0 var(--bt-depth);
}
.bt-page .bt-heading-actions button {
  border-color: var(--bt-rule);
}
.bt-page .bt-banner {
  color: var(--bt-muted);
  font-size: 10.5px;
  line-height: 14px;
  margin: 3px 0 6px;
}
.bt-page .bt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin: 10px 0;
}
.bt-page .bt-controls label:first-child {
  flex: 1;
}
.bt-page .bt-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  max-width: 640px;
  margin: 8px 0;
}
.bt-page label {
  display: grid;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  min-width: 0;
  color: var(--bt-muted);
}
.bt-page select,
.bt-page input {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}
.bt-page .bt-context :is(select, input) {
  font-size: 16px;
  height: 44px;
  width: 100%;
}
.bt-page .bt-tabs {
  display: flex;
  gap: 4px;
  border: 2px solid var(--bt-line);
  border-radius: 10px;
  padding: 3px;
  background: var(--bt-paper);
  box-shadow: 2px 2px 0 var(--bt-depth);
}
.bt-page .bt-tabs button {
  flex: 1;
  min-height: 38px;
  border: 0;
  background: transparent;
  font-size: 13px;
}
.bt-page .bt-tabs [aria-pressed="true"],
.bt-page .bt-tabs [aria-pressed="true"]:active {
  background: color-mix(in srgb, var(--ds-focus) 96%, var(--ds-ink));
  color: var(--ds-accent-contrast);
}
.bt-page .bt-report-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}
.bt-page .bt-report-tabs button {
  min-width: 100px;
  font-size: 13px;
}
.bt-page .bt-report-tabs [aria-pressed="true"] {
  background: var(--bt-soft);
  box-shadow: inset 0 -3px 0 var(--ds-focus);
}
.bt-page .bt-save-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px max-content;
  margin: 6px 0;
  min-height: 44px;
}
.bt-page .bt-sync {
  grid-column: 1;
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 5px;
  color: var(--bt-muted);
}
.bt-page .bt-status-icon {
  width: 14px;
  height: 14px;
}
.bt-page [data-state-icon] {
  display: none;
}
.bt-page .bt-sync:has([data-state="saved"]) [data-state-icon="saved"],
.bt-page .bt-sync:has([data-state="saving"]) [data-state-icon="saving"],
.bt-page .bt-sync:has([data-state="offline"]) [data-state-icon="offline"],
.bt-page .bt-sync:has([data-state="failed"]) [data-state-icon="failed"] {
  display: initial;
}
.bt-page #bt-status {
  flex: 1;
  min-width: 0;
  height: 32px;
  line-height: 16px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
}
.bt-page #bt-status[data-state="failed"] {
  color: var(--bt-danger);
}
.bt-page #bt-status[data-state="offline"] {
  color: var(--bt-text);
}
.bt-page #bt-undo {
  grid-column: 3;
  font-size: 12px;
}
.bt-page #bt-retry {
  grid-column: 2;
  width: 100%;
  padding-inline: 4px;
  font-size: 11px;
  white-space: nowrap;
  border-color: var(--bt-rule);
}
.bt-page #bt-error {
  padding: 9px;
  border: 2px solid var(--bt-danger);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.bt-page .bt-roster {
  border: 2px solid var(--bt-line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bt-paper);
  box-shadow: 3px 3px 0 var(--bt-depth);
}
.bt-page .bt-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(5, minmax(48px, 70px));
  gap: 5px;
  align-items: center;
  border-bottom: 1px solid var(--bt-rule);
  padding: 2px 6px;
}
.bt-page .bt-student {
  overflow-wrap: anywhere;
  font-weight: 650;
}
.bt-page .bt-phone-student {
  display: none;
}
.bt-page .bt-tally {
  position: relative;
  height: 44px;
  min-width: 0;
  padding-inline: 4px;
  line-height: 20px;
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-color: var(--bt-rule);
}
.bt-page .bt-tally[data-count]:not([data-count="0"]) {
  background: var(--bt-soft);
  border-color: var(--bt-line);
}
.bt-page .bt-tally.bt-ack {
  outline: 2px solid var(--ds-focus);
  outline-offset: -3px;
  background: var(--bt-soft);
}
.bt-page .bt-tally:focus-visible,
.bt-page .bt-phone-student:focus-visible {
  outline-offset: -3px;
}
.bt-page .bt-pending-mark {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bt-muted);
}
.bt-page .bt-info {
  padding: 12px;
  margin: 8px 0;
  border: 2px solid var(--bt-line);
  border-radius: 10px;
  background: var(--bt-paper);
  font-size: 12px;
}
.bt-page .bt-info h2 {
  margin-top: 0;
  font-size: 14px;
}
.bt-page .bt-legend {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}
.bt-page .bt-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bt-page .bt-help,
.bt-page footer {
  color: var(--bt-muted);
  font-size: 11px;
}
.bt-page footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin-top: 14px;
}
.bt-page footer button {
  margin-left: auto;
  border-color: var(--bt-rule);
  font-size: 11px;
}
.bt-page #bt-sheet {
  position: fixed;
  top: auto;
  bottom: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 550px;
  max-height: calc(100dvh - 12px);
  overflow: auto;
  border: 2px solid var(--bt-line);
  border-bottom: 0;
  border-radius: var(--prism-radius-dialog) var(--prism-radius-dialog) 0 0;
  background: var(--bt-paper);
  color: var(--bt-text);
  padding: 10px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}
.bt-page #bt-sheet::backdrop {
  background: color-mix(in srgb, var(--ds-ink) 40%, transparent);
}
.bt-page .bt-sheet-head h2 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}
.bt-page .bt-sheet-head h2:focus {
  outline: none;
}
.bt-page #bt-sheet-close {
  border-color: var(--bt-rule);
}
.bt-page #bt-sheet-categories {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.bt-page #bt-sheet-categories button {
  height: 44px;
  min-height: 44px;
  justify-content: flex-start;
  text-align: left;
  padding: 4px 10px;
  gap: 12px;
  font-size: 14px;
  white-space: nowrap;
}
.bt-page .bt-category-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: var(--bt-soft);
  font-weight: 800;
}
.bt-page .bt-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}
.bt-page .bt-report {
  padding: 12px;
  border: 2px solid var(--bt-line);
  border-radius: 10px;
  background: var(--bt-paper);
  margin-top: 10px;
}
.bt-page .bt-report table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  margin: 12px 0;
}
.bt-page .bt-report caption {
  text-align: left;
  font-weight: 700;
  padding: 4px 0;
}
.bt-page .bt-report th,
.bt-page .bt-report td {
  border: 1px solid var(--bt-rule);
  padding: 5px;
  text-align: left;
}
.bt-page .bt-report thead {
  background: var(--bt-soft);
}
.bt-page .bt-week-grid {
  min-width: 950px;
}
.bt-page .bt-week-grid td {
  text-align: center;
}
.bt-page .bt-report details {
  margin: 14px 0;
}
.bt-page .bt-report summary {
  cursor: pointer;
  min-height: 44px;
  padding-top: 10px;
}
@media (max-width: 599px), (max-height: 500px) and (pointer: coarse) {
  .bt-page .bt-context {
    grid-template-columns: minmax(0, 1fr) 148px;
    max-width: none;
  }
  .bt-page .bt-row {
    display: block;
    padding: 0 4px;
  }
  .bt-page .bt-row > .bt-student,
  .bt-page .bt-row > .bt-tally {
    display: none;
  }
  .bt-page .bt-phone-student {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
    height: 49px;
    min-height: 49px;
    padding: 6px 8px;
  }
  .bt-page .bt-phone-student > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .bt-page .bt-phone-student[aria-expanded="true"] {
    background: var(--bt-soft);
  }
  .bt-page .bt-phone-count {
    flex-shrink: 0;
    min-width: 3ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--bt-muted);
  }
  .bt-page .bt-controls label {
    flex: 1;
  }
  .bt-page #bt-range-controls label {
    flex: 1 1 45%;
  }
}
@media (max-width: 359px) {
  .bt-page h1 {
    font-size: 17px;
  }
  .bt-page .bt-brand {
    font-size: 10px;
    padding: 3px;
  }
  .bt-page .bt-heading-copy {
    gap: 6px;
  }
  .bt-page .bt-heading-actions {
    gap: 4px;
  }
  .bt-page .bt-context {
    grid-template-columns: minmax(0, 1fr) 140px;
  }
}
@media (max-height: 500px) and (pointer: coarse) {
  .bt-page #bt-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 12px;
  }
  .bt-page #bt-workspace > :not(.bt-context, .bt-tabs) {
    grid-column: 1 / -1;
  }
  .bt-page .bt-tabs {
    align-self: end;
    margin-bottom: 8px;
  }
  .bt-page #bt-sheet-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@page {
  size: A4 landscape;
  margin: 12mm;
}
@media print {
  .bt-page {
    background: white;
    color: black;
    font-size: 10pt;
  }
  .bt-page #bt-root {
    max-width: none;
    padding: 0;
  }
  .bt-page .bt-heading,
  .bt-page #bt-gate,
  .bt-page #bt-workspace > :not(#bt-report-view),
  .bt-page #bt-report-view > :not(#bt-report),
  .bt-page #bt-sheet,
  .bt-page #bt-info {
    display: none !important;
  }
  .bt-page .bt-report table {
    font-size: 8pt;
    margin: 8px 0;
  }
  .bt-page .bt-report {
    border: 0;
    padding: 0;
    margin: 0;
    background: white;
    color: black;
  }
  .bt-page .bt-report thead {
    background: white;
    color: black;
  }
  .bt-page .bt-report th,
  .bt-page .bt-report td {
    border-color: #777;
    padding: 2px;
  }
  .bt-page .bt-week-grid {
    min-width: 0;
    table-layout: fixed;
  }
  .bt-page .bt-week-grid thead tr:first-child th:first-child,
  .bt-page .bt-week-grid tbody th:first-child {
    width: 38mm;
    overflow-wrap: anywhere;
  }
  .bt-page .bt-table-scroll {
    overflow: visible;
  }
  .bt-page .bt-report tr {
    break-inside: avoid;
  }
  .bt-page .bt-report thead {
    display: table-header-group;
  }
  .bt-page .bt-report details:not([open]) {
    display: none;
  }
  .bt-page .bt-report details[open] summary {
    display: none;
  }
}

.bt-page .bt-review-entry {
  margin: 8px 0;
  overflow-wrap: anywhere;
}
