:root {
  color-scheme: light;
  --bg: #f4f8fb;
  --surface: #fffefa;
  --surface-2: #edf5f8;
  --surface-3: #f8fbff;
  --ink: #1d2433;
  --muted: #667085;
  --line: #d6e0ea;
  --primary: #146c67;
  --primary-strong: #0b4541;
  --blue: #2458b8;
  --green: #02ca79;
  --amber: #fff144;
  --red: #e65454;
  --coral: #ef6f4e;
  --gold: #f7c948;
  --shadow: 0 16px 38px rgba(29, 36, 51, 0.11);
  --shadow-tight: 0 8px 18px rgba(29, 36, 51, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 248, 251, 0.92)),
    linear-gradient(90deg, rgba(36, 88, 184, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 108, 103, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 44px 44px, 44px 44px, auto;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(50, 103, 168, 0.35);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px clamp(12px, 3vw, 28px) 13px;
  background: rgba(255, 254, 250, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 26px rgba(29, 36, 51, 0.08);
  backdrop-filter: blur(18px);
}

.topbar::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--blue), var(--gold), var(--coral));
  content: "";
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(20, 108, 103, 0.22);
}

.brand h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0;
  line-height: 0.96;
}

.brand p,
.helper,
.muted {
  color: var(--muted);
}

.brand p {
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 650;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.account-chip {
  display: inline-flex;
  max-width: min(320px, 42vw);
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 4px;
  padding-left: 12px;
  color: #0b4541;
  background: #eef8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  color: #fff;
  background: linear-gradient(180deg, #187b74, var(--primary));
  border: 1px solid rgba(11, 69, 65, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow-tight);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.signout-button span {
  transform: translateY(-1px);
}

.teacher-notification-settings {
  position: relative;
  display: inline-grid;
  justify-items: end;
}

.teacher-title-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: flex-start;
}

.notification-settings-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  color: #123d2b;
  background: #e9f8f0;
  border-color: #b8e0c9;
  box-shadow: 0 6px 14px rgba(18, 61, 43, 0.12);
}

.teacher-settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  width: min(286px, calc(100vw - 32px));
  gap: 6px;
  padding: 8px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(29, 36, 51, 0.18);
}

.teacher-settings-toggle {
  display: flex;
  width: 100%;
  min-height: 44px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid #d5e0ec;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}

.teacher-settings-action {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: #123d2b;
  background: #fff7dc;
  border: 1px solid #e5bd55;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
}

.teacher-voice-picker {
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #f8fbff;
  border: 1px solid #d5e0ec;
  border-radius: 8px;
}

.teacher-voice-picker label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.teacher-voice-select {
  width: 100%;
  min-width: 0;
  height: 40px;
  font-size: 14px;
}

.setting-switch {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.16s ease;
}

.setting-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  content: "";
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(29, 36, 51, 0.24);
  transition: transform 0.16s ease;
}

.teacher-settings-toggle.active {
  background: #eefff8;
  border-color: #a0e6c5;
}

.teacher-settings-toggle.active .setting-switch {
  background: var(--green);
}

.teacher-settings-toggle.mute-active {
  background: #fff1f0;
  border-color: #f3aaa6;
}

.teacher-settings-toggle.mute-active .setting-switch {
  background: #c24135;
}

.teacher-settings-toggle.active .setting-switch::after {
  transform: translateX(18px);
}

.select,
.input,
.textarea {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 13px;
  color: #fff;
  background: linear-gradient(180deg, #187b74, var(--primary));
  border-radius: 8px;
  box-shadow: var(--shadow-tight);
  font-weight: 700;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

.button.secondary {
  color: var(--primary-strong);
  background: #eef8f6;
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.warn {
  color: #221705;
  background: #f4c86a;
}

.button.danger {
  color: #fff;
  background: linear-gradient(180deg, #f26d67, var(--red));
}

.button.ghost {
  color: var(--primary-strong);
  background: #fffefa;
  border: 1px solid var(--line);
  box-shadow: none;
}

.button:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(560px, 100%);
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.auth-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.auth-actions .button {
  width: 100%;
}

.text-button {
  justify-self: start;
  margin-top: 12px;
  padding: 0;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.text-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.auth-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.google-button {
  width: 100%;
  color: #1d2433;
  background: #fffefa;
  border-color: #cdd9e8;
  box-shadow: 0 8px 18px rgba(29, 36, 51, 0.08);
}

.auth-help {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 280px;
  padding: 6px 10px;
  color: #8a340f;
  background: #fff0d0;
  border: 1px solid #f4d184;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 10px clamp(12px, 3vw, 28px) 12px;
  overflow-x: auto;
  background: rgba(255, 254, 250, 0.78);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(29, 36, 51, 0.04);
}

.tab {
  white-space: nowrap;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  font-weight: 750;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.tab.active {
  color: #fff;
  background: linear-gradient(180deg, #273a62, #1d2b4b);
  border-color: #1d2b4b;
  box-shadow: 0 10px 20px rgba(29, 43, 75, 0.18);
}

.main {
  padding: clamp(12px, 3vw, 28px);
}

.main:has(.parking-shell) {
  padding-top: 12px;
  padding-bottom: 12px;
}

.parking-focused-shell {
  height: 100dvh;
  overflow: hidden;
}

.classroom-focused-shell {
  height: 100dvh;
  overflow: hidden;
}

.parking-focused-main {
  height: 100dvh;
  padding: 8px;
  overflow: hidden;
}

.classroom-focused-main {
  height: 100dvh;
  padding: 8px;
  overflow: hidden;
}

.parking-focused-main .parking-shell {
  height: 100%;
}

.classroom-focused-main .teacher-board {
  height: 100%;
  min-height: 0;
}

.classroom-focused-main .teacher-bus-panel,
.classroom-focused-main .teacher-queue-panel,
.classroom-focused-main .teacher-class-called-panel {
  min-height: 0;
  overflow: hidden;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(14px, 2vw, 20px);
  position: relative;
}

.roster-editor-panel {
  display: grid;
  gap: 10px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.section-title {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  letter-spacing: 0;
}

.section-title h2 {
  font-size: clamp(22px, 3vw, 34px);
  color: #162033;
  line-height: 1;
}

.section-title h3 {
  font-size: 18px;
  color: #1f2a44;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.metric {
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, var(--surface-3));
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 14px rgba(29, 36, 51, 0.05);
}

.metric strong {
  display: block;
  font-size: 26px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.teacher-board {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  grid-template-rows: minmax(0, 1fr) clamp(80px, 11dvh, 96px);
  grid-template-areas:
    "buses queue"
    "called called";
  gap: 16px;
  height: calc(100dvh - 170px);
  min-height: 430px;
  padding: clamp(8px, 1.2vw, 14px);
  overflow: hidden;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 42%, rgba(89, 50, 24, 0.12)),
    url("cork-board.jpg");
  background-color: #bd814d;
  background-position: center;
  background-size: cover;
  border: 2px solid #111827;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -10px 24px rgba(85, 47, 22, 0.14),
    0 24px 54px rgba(49, 33, 20, 0.2);
}

.teacher-bus-panel,
.teacher-queue-panel {
  min-height: 0;
  background: rgba(255, 254, 250, 0.96);
  border: 2px solid #111827;
  box-shadow:
    0 18px 30px rgba(66, 44, 28, 0.2),
    0 2px 0 rgba(255, 255, 255, 0.75);
}

.teacher-bus-panel {
  grid-area: buses;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.teacher-bus-panel .section-title {
  align-items: flex-start;
}

.teacher-bus-panel .bus-strip {
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  padding: 8px;
  background: rgba(82, 48, 27, 0.1);
  border: 2px solid #111827;
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(74, 42, 23, 0.12);
}

.teacher-queue-panel {
  grid-area: queue;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.teacher-queue-panel .section-title {
  margin-bottom: 6px;
}

.teacher-queue-panel .section-title h3 {
  font-size: 16px;
}

.teacher-queue-scroll {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.teacher-change-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background: #ffffff;
  border: 2px solid #111827;
  border-radius: 8px;
  box-shadow:
    0 14px 26px rgba(66, 44, 28, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.9);
}

.teacher-change-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.teacher-change-head h3 {
  margin: 0;
  color: #192033;
  font-size: 18px;
}

.teacher-change-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.teacher-change-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 2px;
}

.teacher-change-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  background: #ffffff;
  border: 2px solid #111827;
  border-left: 6px solid #94a3b8;
  border-radius: 8px;
  box-shadow: 0 7px 14px rgba(31, 41, 55, 0.08);
}

.teacher-change-item.change-type-bus {
  background: #fff1a8;
  border-color: #111827;
  border-left-color: #c89400;
}

.teacher-change-item.change-type-pickup {
  background: #f0e4ff;
  border-color: #111827;
  border-left-color: #7c3aed;
}

.teacher-change-item strong,
.teacher-change-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-change-item strong {
  color: #111827;
  font-size: 16px;
  line-height: 1.1;
}

.teacher-change-item span {
  margin-top: 3px;
  color: #5d6b82;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.teacher-change-item.change-type-bus span {
  color: #6d520d;
}

.teacher-change-item.change-type-pickup span {
  color: #5b21b6;
}

.teacher-change-empty {
  padding: 9px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.teacher-class-called-panel {
  grid-area: called;
  display: flex;
  min-height: 0;
  padding: 7px 9px;
  overflow: hidden;
  background: rgba(255, 254, 250, 0.97);
  border: 2px solid #111827;
  box-shadow:
    0 18px 30px rgba(66, 44, 28, 0.2),
    0 2px 0 rgba(255, 255, 255, 0.75);
}

.teacher-class-called-count {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 9px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  transform: translateY(-50%);
  font-size: 14px;
  border: 2px solid #111827;
  border-radius: 999px;
  box-shadow: 0 5px 10px rgba(31, 41, 55, 0.22);
}

.teacher-class-called-grid {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 5px 4px 8px 43px;
  scroll-padding-left: 43px;
  -webkit-overflow-scrolling: touch;
}

.teacher-class-called-card {
  flex: 0 0 clamp(104px, 11vw, 150px);
  min-width: 104px;
  height: clamp(36px, 5dvh, 44px);
  min-height: 36px;
  max-height: 44px;
  display: grid;
  place-items: center;
  padding: 5px 7px;
  color: #063c2d;
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  background: #dffced;
  border: 2px solid #111827;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(2, 202, 121, 0.16);
  overflow: hidden;
  overflow-wrap: anywhere;
}

.teacher-class-called-card.fresh-pickup {
  color: #042f22;
  background: #bff3dc;
  box-shadow: 0 4px 8px rgba(4, 120, 87, 0.24);
}

.teacher-class-called-empty {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 8px 8px 8px 43px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.note-icon-button {
  display: grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  background: #fff5b0;
  border: 2px solid #111827;
  border-radius: 8px;
}

.note-icon {
  position: relative;
  width: 17px;
  height: 21px;
  background: #fffefa;
  border: 2px solid #5f4106;
  border-radius: 3px;
}

.note-icon::before,
.note-icon::after {
  position: absolute;
  left: 3px;
  right: 3px;
  height: 2px;
  background: #5f4106;
  content: "";
}

.note-icon::before {
  top: 6px;
}

.note-icon::after {
  top: 12px;
}

.bus-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.bus-tile {
  min-height: 74px;
  padding: 11px 12px;
  color: var(--ink);
  border: 2px solid #111827;
  border-radius: 8px;
  box-shadow:
    0 12px 20px rgba(49, 33, 20, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.bus-number {
  display: block;
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
}

.bus-status {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-not_here {
  background: #f6f6f6;
}

.status-here {
  background: #02ca79;
  border-color: #111827;
}

.status-last_call {
  background: #fff144;
  border-color: #111827;
}

.status-left {
  color: #fff;
  background: #e65454;
  border-color: #111827;
}

.queue {
  display: grid;
  gap: 4px;
}

.queue.compact .queue-name {
  font-size: clamp(18px, 3vw, 26px);
}

.classroom-queue .queue-item {
  grid-template-columns: minmax(0, 1fr) minmax(72px, auto) 70px;
  min-height: 38px;
  gap: 7px;
  padding: 4px 7px;
}

.classroom-queue .queue-name {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(15px, 1.5vw, 19px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classroom-queue .queue-meta {
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fffefa;
  border: 2px solid #111827;
  border-left: 7px solid transparent;
  border-radius: 8px;
  box-shadow: 0 12px 22px rgba(66, 44, 28, 0.12);
}

.queue-student {
  min-width: 0;
}

.queue-note {
  display: block;
  min-width: 0;
  margin-top: 1px;
  overflow: hidden;
  color: #64748b;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-classroom {
  min-width: 0;
  max-width: 112px;
  padding: 4px 7px;
  overflow: hidden;
  color: #15324a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #dfefff;
  border: 1px solid #111827;
  border-radius: 6px;
}

.queue-classroom.green,
.queue-classroom.fresh-green {
  color: #063c2d;
  background: #dffced;
}

.queue-classroom.fresh-green {
  background: #bff3dc;
}

.queue-audit {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: end;
}

.queue-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.queue-caller {
  max-width: 70px;
  padding-top: 0;
  overflow: hidden;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.05;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-card-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 4px;
}

.queue-time {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.queue-item.mine {
  background: #eefff8;
  border-left-color: var(--green);
  border-top-color: #111827;
  border-right-color: #111827;
  border-bottom-color: #111827;
  box-shadow:
    0 14px 24px rgba(2, 202, 121, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.78);
}

.queue-item.mine.fresh-pickup {
  background: #bff3dc;
  border-color: rgba(4, 120, 87, 0.34);
  border-left-color: #047857;
  box-shadow: 0 10px 22px rgba(4, 120, 87, 0.24);
}

.call-log-item {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 70px;
}

.queue-name {
  font-size: clamp(21px, 4vw, 34px);
  font-weight: 850;
  line-height: 1.05;
  color: #111827;
}

.queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  color: var(--ink);
  background: #f3f6fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  color: #123d2b;
  background: #dbf3e5;
  border-color: #b8e0c9;
}

.badge.fresh-green {
  color: #fff;
  background: #047857;
  border-color: #03684b;
}

.badge.blue {
  color: #183b65;
  background: #e5f0fb;
  border-color: #c6dcef;
}

.badge.yellow {
  color: #5f4106;
  background: #fff7c7;
  border-color: #e5c64f;
}

.badge.red {
  color: #6e201a;
  background: #fee9e7;
  border-color: #efc1bd;
}

.compact-button {
  min-width: 82px;
  padding-inline: 12px;
}

.parking-log-panel {
  grid-column: 1 / -1;
}

.parking-shell {
  display: grid;
  gap: 14px;
  height: calc(100dvh - 174px);
  min-height: 0;
  overflow: hidden;
}

.changes-shell {
  display: grid;
  gap: 14px;
  height: calc(100dvh - 174px);
  min-height: 0;
  overflow: hidden;
}

.parking-board-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.changes-board-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.parking-board-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  align-items: end;
  padding: clamp(14px, 2vw, 20px);
  background: linear-gradient(180deg, #fffefa, #f8fbff);
  border-bottom: 1px solid var(--line);
}

.parking-board-head h2 {
  margin: 0;
  color: #162033;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.parking-thumb-board {
  display: grid;
  grid-template-columns: clamp(104px, 13vw, 138px) minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  flex: 1;
}

.changes-board {
  display: grid;
  grid-template-columns: clamp(104px, 13vw, 138px) minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  flex: 1;
}

.teacher-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 10px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #eef2f7;
  border-right: 1px solid var(--line);
}

.teacher-rail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-height: 0;
  flex: 0 0 clamp(44px, 7.2dvh, 72px);
}

.teacher-rail-item.reorderable {
  grid-template-columns: 28px minmax(0, 1fr);
}

.teacher-rail-item.dragging {
  opacity: 0.72;
  transform: scale(0.98);
}

.classroom-reorder-active {
  cursor: grabbing;
  user-select: none;
}

.classroom-drag-handle {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 0;
  color: #23304a;
  background: #e4e9f1;
  border: 2px solid #111827;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
}

.classroom-drag-handle:active {
  cursor: grabbing;
}

.classroom-drag-handle span,
.classroom-drag-handle span::before,
.classroom-drag-handle span::after {
  display: block;
  width: 14px;
  height: 3px;
  background: currentColor;
  border-radius: 999px;
  content: "";
}

.classroom-drag-handle span {
  position: relative;
}

.classroom-drag-handle span::before,
.classroom-drag-handle span::after {
  position: absolute;
  left: 0;
}

.classroom-drag-handle span::before {
  top: -6px;
}

.classroom-drag-handle span::after {
  top: 6px;
}

.teacher-rail-item .teacher-rail-button {
  width: 100%;
  height: 100%;
}

.teacher-rail-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 0;
  flex: 0 0 clamp(44px, 7.2dvh, 72px);
  padding: 8px 6px;
  text-align: center;
  background: #cfd3db;
  border-color: #9aa4b2;
  box-shadow: none;
}

.teacher-rail-button strong {
  overflow: hidden;
  font-size: clamp(16px, 1.75vw, 22px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-rail-button span {
  display: none;
  min-width: 30px;
  min-height: 30px;
  place-items: center;
  color: #324055;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.teacher-rail-button.active {
  color: #0d2344;
  background: #86c5f4;
  border-color: #2467a9;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.54);
}

.parking-thumb-board.parking-editing {
  grid-template-columns: clamp(132px, 16vw, 170px) minmax(0, 1fr);
}

.parking-action-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(150px, 28dvh, 220px);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 10px;
}

.changes-action-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(170px, 31dvh, 250px);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 10px;
}

.student-side {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-tight);
}

.changes-student-side {
  border-color: #ead57a;
  box-shadow: 0 8px 18px rgba(95, 65, 6, 0.08);
}

.student-side-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.student-side-head h3 {
  margin: 0;
  color: #1f2a44;
  font-size: clamp(20px, 2.4vw, 28px);
}

.student-count {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.parking-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.parking-control-button {
  min-width: 54px;
  min-height: 38px;
  padding: 6px 9px;
  color: #173553;
  background: #e6f1fb;
  border: 1px solid #bad5ec;
  border-radius: 8px;
  box-shadow: 0 5px 12px rgba(29, 36, 51, 0.06);
  font-size: 13px;
  font-weight: 900;
}

.parking-control-button.teacher-focus-button {
  min-width: 58px;
}

.parking-control-button.plus {
  min-width: 42px;
  color: #fff;
  background: linear-gradient(180deg, #187b74, var(--primary));
  border-color: #0b5b55;
  font-size: 22px;
  line-height: 1;
}

.parking-control-button.edit-toggle.active {
  color: #221705;
  background: #f4c86a;
  border-color: #d49b20;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.parking-control-button.add-student {
  min-width: 84px;
}

.parking-control-button.reset-action {
  color: #fff;
  background: linear-gradient(180deg, #f26d67, var(--red));
  border-color: #b93434;
}

.changes-list-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.changes-filter-select {
  width: min(190px, 34vw);
  min-height: 36px;
  padding: 6px 32px 6px 10px;
  font-size: 13px;
  font-weight: 850;
}

.changes-reset-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.25);
}

.live-call-preview {
  margin-bottom: 10px;
  padding: 9px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.preview-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #1f2a44;
}

.preview-head strong {
  font-size: 14px;
}

.preview-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px;
  overflow: hidden;
  padding-right: 2px;
}

.preview-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 6px 7px;
  background: #fffefa;
  border: 1px solid #dce7f1;
  border-left: 5px solid var(--green);
  border-radius: 8px;
}

.preview-item strong,
.preview-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-item strong {
  color: #111827;
  font-size: 14px;
  line-height: 1.1;
}

.preview-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-delete {
  min-height: 30px;
  padding: 4px 7px;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
}

.mini-delete.neutral {
  color: #173553;
  background: #e6f1fb;
}

.manual-entry-popover {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 8;
  width: min(520px, calc(100% - 28px));
  padding: 12px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(29, 36, 51, 0.2);
}

.manual-entry-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.manual-entry-head strong {
  color: #1f2a44;
  font-size: 15px;
}

.manual-entry-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.62fr) auto;
  gap: 8px;
  align-items: center;
}

.edit-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 28, 43, 0.38);
}

.edit-dialog-panel {
  width: min(520px, 100%);
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(29, 36, 51, 0.28);
}

.pronunciation-panel {
  display: flex;
  width: min(820px, 100%);
  max-height: calc(100dvh - 36px);
  flex-direction: column;
}

.pronunciation-list {
  display: grid;
  min-height: 0;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.pronunciation-row {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 5px 13px rgba(29, 36, 51, 0.05);
}

.pronunciation-row.editing {
  background: #f8fbff;
  border-color: #a9c6e8;
}

.pronunciation-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.pronunciation-name {
  min-width: 0;
}

.pronunciation-name strong,
.pronunciation-name span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pronunciation-name strong {
  color: #111827;
  font-size: 18px;
}

.pronunciation-name span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pronunciation-actions,
.pronunciation-options,
.pronunciation-save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.pronunciation-editor-form {
  display: grid;
  gap: 9px;
  padding-top: 2px;
}

.pronunciation-form-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
}

.edit-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.preview-empty {
  padding: 8px;
  color: var(--muted);
  background: #fffefa;
  border: 1px dashed #cbd7e5;
  border-radius: 8px;
  font-size: 13px;
}

.student-tile-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(58px, 1fr));
  grid-auto-rows: minmax(58px, 1fr);
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  align-content: stretch;
}

.thumb-student-button {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
  place-items: center;
  overflow: hidden;
  padding: 6px;
  font-size: var(--student-name-size, 16px);
  line-height: var(--student-name-line, 1.04);
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: none;
}

.change-student-button {
  background: #fffefa;
  border-color: #d5e0ec;
}

.change-student-button.has-change {
  box-shadow:
    0 8px 18px rgba(31, 41, 55, 0.12),
    inset 0 0 0 2px rgba(255, 255, 255, 0.62);
}

.change-student-button.has-change.change-type-bus {
  color: #3d2a05;
  background: #fff4a6;
  border-color: #d9b820;
}

.change-student-button.has-change.change-type-pickup {
  color: #3b126a;
  background: #f0e4ff;
  border-color: #a56cf2;
}

.change-student-button.has-change.change-type-other {
  color: #173553;
  background: #e6f1fb;
  border-color: #8fbbe1;
}

.live-connection-notice {
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px 16px;
  border: 2px solid #92400e;
  border-radius: 6px;
  background: #fff3c4;
  color: #713f12;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 18px #0003;
  pointer-events: none;
}

.live-connection-notice[hidden] { display: none; }

.moved-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #f6faf9;
}

.moved-page {
  width: min(100%, 660px);
  padding: 32px 20px;
  text-align: center;
}

.moved-logo { width: 170px; height: 170px; object-fit: contain; }
.moved-page h1 { font-size: 30px; line-height: 1.2; margin: 24px 0 12px; }
.moved-address { font-size: 20px; overflow-wrap: anywhere; margin: 0 0 28px; }
.moved-button { display: inline-flex; min-height: 52px; padding: 14px 28px; text-decoration: none; }

.student-name-text {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parking-edit-grid {
  gap: 5px;
}

.parking-edit-tile {
  position: relative;
  place-items: stretch;
  padding: 3px;
  background: #fff7dc;
  border-color: #e5bd55;
  box-shadow: 0 6px 14px rgba(127, 91, 18, 0.12);
}

.parking-edit-tile.active {
  border-color: #2467a9;
  box-shadow: inset 0 0 0 2px rgba(36, 103, 169, 0.22);
}

.parking-student-edit-name {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 5px 18px 4px 5px;
  place-items: center;
  overflow: hidden;
  color: inherit;
  background: transparent;
  border-radius: 6px;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: center;
}

.parking-student-edit-name small {
  display: block;
  width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: #6c5a20;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.parking-student-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 21px;
  min-width: 21px;
  height: 21px;
  min-height: 21px;
  place-items: center;
  padding: 0;
  color: #fff;
  background: var(--red);
  border: 1px solid rgba(126, 24, 24, 0.28);
  border-radius: 999px;
  box-shadow: 0 4px 9px rgba(126, 24, 24, 0.16);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.student-editor-panel {
  width: min(640px, 100%);
}

.change-editor-panel {
  width: min(620px, 100%);
}

.change-editor-form {
  display: grid;
  gap: 12px;
}

.change-type-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.change-type-button {
  min-width: 0;
  min-height: 58px;
  padding: 9px 8px;
  color: #354154;
  background: #f8fbff;
  border: 1px solid #d5e0ec;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 850;
}

.change-type-button.active {
  color: #3d2a05;
  background: #fff144;
  border-color: #d0ad16;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.change-type-button[data-change-type="bus"].active {
  color: #3d2a05;
  background: #fff1a8;
  border-color: #ddb722;
}

.change-type-button[data-change-type="pickup"].active {
  color: #3b126a;
  background: #f0e4ff;
  border-color: #a56cf2;
}

.change-type-button[data-change-type="other"].active {
  color: #173553;
  background: #e6f1fb;
  border-color: #8fbbe1;
}

.student-editor-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr);
}

.student-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.student-editor-actions .button.danger {
  margin-right: auto;
}

.parking-support-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 14px;
}

.called-column {
  display: flex;
  max-height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-tight);
}

.called-column-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.called-column-head h3 {
  margin: 0;
  color: #1f2a44;
  font-size: clamp(18px, 2vw, 24px);
}

.called-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
  padding-right: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.called-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  background: #fffefa;
  border: 1px solid #dce7f1;
  border-left: 5px solid var(--green);
  border-radius: 8px;
}

.change-list-item {
  border-left-color: #e2b714;
  box-shadow: 0 8px 16px rgba(31, 41, 55, 0.08);
}

.change-list-item.change-type-bus {
  background: #fff1a8;
  border-color: #ddb722;
  border-left-color: #c89400;
}

.change-list-item.change-type-pickup {
  background: #f0e4ff;
  border-color: #a56cf2;
  border-left-color: #7c3aed;
}

.change-list-item.change-type-other {
  background: #e6f1fb;
  border-color: #8fbbe1;
  border-left-color: #2458b8;
}

.change-list-item.change-type-bus span {
  color: #6d520d;
}

.change-list-item.change-type-pickup span {
  color: #5b21b6;
}

.called-item strong,
.called-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.called-item strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.1;
}

.called-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.manual-pickup-panel {
  box-shadow: var(--shadow-tight);
}

.compact-empty {
  grid-column: 1 / -1;
  min-height: 120px;
}

.classroom-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.classroom-button {
  min-height: 58px;
  padding: 10px;
  text-align: left;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(29, 36, 51, 0.05);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.classroom-button.active {
  color: #fff;
  background: linear-gradient(180deg, #3467ca, var(--blue));
  border-color: #1d4894;
  box-shadow: 0 10px 20px rgba(36, 88, 184, 0.22);
}

.classroom-button strong {
  display: block;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.student-button {
  min-height: 68px;
  padding: 10px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(29, 36, 51, 0.06);
  font-size: 18px;
  font-weight: 820;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.student-button:active {
  transform: translateY(1px);
}

.student-button.inactive {
  opacity: 0.45;
}

.status-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.bus-card {
  min-width: 0;
  padding: 14px;
  border-color: rgba(23, 33, 29, 0.22);
  box-shadow: 0 12px 26px rgba(29, 36, 51, 0.1);
}

.bus-board-grid {
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
}

.bus-card .helper {
  color: currentColor;
  opacity: 0.72;
}

.bus-card .badge {
  color: currentColor;
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(23, 33, 29, 0.18);
}

.status-button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 7px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(29, 36, 51, 0.08);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-align: center;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.status-button.status-not_here {
  background: #f6f6f6;
}

.status-button.status-here {
  background: #02ca79;
}

.status-button.status-last_call {
  background: #fff144;
}

.status-button.status-left {
  color: #fff;
  background: #e65454;
}

.status-button.active {
  border-color: rgba(23, 33, 29, 0.74);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.65),
    0 0 0 2px rgba(23, 33, 29, 0.18);
}

.table {
  width: 100%;
  overflow: hidden;
  border-collapse: collapse;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-tight);
}

.table th,
.table td {
  padding: 9px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  color: #3e4b63;
  background: #edf5f8;
  font-size: 12px;
  text-transform: uppercase;
}

.inactive-admin-row {
  color: #6b7280;
  background: #f8fafc;
}

.inactive-admin-row .editable-staff-field {
  color: #4b5563;
}

.role-field {
  grid-column: 1 / -1;
}

.role-checklist,
.role-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-details {
  min-width: 190px;
}

.role-details summary {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 6px 9px;
  color: #0b4541;
  background: #e9fbf5;
  border: 1px solid #9bdcca;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}

.role-details summary::-webkit-details-marker {
  display: none;
}

.role-details summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}

.role-details summary small {
  color: #2458b8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.role-details[open] summary {
  margin-bottom: 7px;
}

.editable-staff-field {
  display: inline-flex;
  max-width: 220px;
  min-height: 34px;
  align-items: center;
  padding: 5px 8px;
  color: #1f2a44;
  background: #fffefa;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 750;
  text-align: left;
  touch-action: manipulation;
  user-select: none;
  -webkit-touch-callout: none;
}

.editable-staff-field.email {
  max-width: 280px;
  color: #2458b8;
  font-size: 13px;
  font-weight: 700;
}

.editable-staff-field.student-call-field {
  max-width: 180px;
  color: #0b4541;
  background: #effbf7;
  border-color: #bddfd5;
}

.editable-staff-field:hover,
.editable-staff-field:focus-visible {
  background: #f8fbff;
  border-color: var(--line);
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  color: #334155;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.check-pill.active,
.check-pill:has(input:checked) {
  color: #0b4541;
  background: #e9fbf5;
  border-color: #9bdcca;
}

.check-pill input {
  margin: 0;
  accent-color: var(--primary);
}

.check-pill:has(input:disabled) {
  opacity: 0.72;
}

.compact-select {
  min-width: 150px;
}

.staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  background: #f8fbff;
  border: 1px dashed #bdcad8;
  border-radius: 8px;
}

.notice {
  padding: 12px;
  color: #594017;
  background: #fff6d6;
  border: 1px solid #edd07e;
  border-radius: 8px;
}

.danger-notice {
  color: #7e1717;
  background: #ffeded;
  border-color: #f3b0ad;
}

.success-notice {
  color: #0b554a;
  background: #e9fbf4;
  border-color: #a8e5d2;
}

@media (hover: hover) {
  .button:hover,
  .tab:hover,
  .classroom-button:hover,
  .student-button:hover,
  .status-button:hover {
    transform: translateY(-1px);
  }

  .button:hover,
  .classroom-button:hover,
  .student-button:hover,
  .status-button:hover {
    box-shadow: 0 12px 24px rgba(29, 36, 51, 0.12);
  }

  .tab:hover,
  .classroom-button:hover,
  .student-button:hover,
  .status-button:hover {
    border-color: rgba(36, 88, 184, 0.35);
  }

  .table tbody tr:hover {
    background: #f8fbff;
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .teacher-bus-panel .bus-strip {
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  }

  .grid.two,
  .grid.three,
  .metric-row,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions > * {
    flex: 1 1 160px;
  }

  .status-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parking-board-head {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 270px);
    padding: 12px;
  }

  .parking-shell {
    height: calc(100dvh - 170px);
  }

  .parking-board-panel {
    min-height: 0;
  }

  .parking-thumb-board {
    grid-template-columns: clamp(94px, 16vw, 122px) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .parking-thumb-board.parking-editing {
    grid-template-columns: clamp(122px, 19vw, 156px) minmax(0, 1fr);
  }

  .parking-support-grid {
    display: none;
  }

  .parking-action-column {
    grid-template-rows: minmax(0, 1fr) clamp(145px, 27dvh, 205px);
    gap: 10px;
    padding: 10px;
  }

  .teacher-rail {
    gap: 6px;
    padding: 8px 6px;
  }

  .teacher-rail-button {
    min-height: 0;
  }

  .student-tile-grid {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(54px, 1fr));
    grid-auto-rows: minmax(54px, 1fr);
    gap: 4px;
  }

  .thumb-student-button {
    min-height: 0;
    padding: 6px;
  }

  .called-column {
    padding: 8px;
  }

  .called-item {
    min-height: 36px;
  }
}

@media (orientation: portrait) and (min-width: 721px) and (max-width: 900px) {
  .parking-thumb-board {
    grid-template-columns: clamp(112px, 18vw, 138px) minmax(0, 1fr);
  }

  .parking-thumb-board.parking-editing {
    grid-template-columns: clamp(140px, 22vw, 170px) minmax(0, 1fr);
  }

  .parking-action-column {
    grid-template-rows: minmax(0, 1fr) clamp(170px, 22dvh, 230px);
    gap: 8px;
    padding: 8px;
  }

  .student-side {
    padding: 8px;
  }

  .student-tile-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(62px, 1fr);
    gap: 6px;
  }

  .thumb-student-button {
    padding: 6px 4px;
  }

  .teacher-rail-button strong {
    font-size: 16px;
  }
}

@media (max-width: 720px) {
  .teacher-board {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "buses"
      "queue"
      "called";
  }

  .classroom-focused-main .teacher-board {
    height: 100%;
    grid-template-rows: minmax(0, 1.05fr) minmax(0, 0.8fr) 90px;
  }

  .teacher-queue-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .tabs {
    padding: 8px 10px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 10px;
  }

  .topbar .brand p {
    display: none;
  }

  .account-chip {
    max-width: 38vw;
    padding-left: 8px;
  }

  .account-name {
    font-size: 12px;
  }

  .panel {
    padding: 12px;
  }

  .parking-board-panel {
    padding: 0;
  }

  .student-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parking-thumb-board {
    grid-template-columns: minmax(76px, 24vw) minmax(0, 1fr);
  }

  .parking-action-column {
    grid-template-rows: minmax(0, 1fr) 142px;
    gap: 7px;
    padding: 7px;
  }

  .teacher-rail,
  .student-side {
    padding: 6px;
  }

  .teacher-rail-button {
    min-height: 0;
    padding: 5px;
  }

  .teacher-rail-button strong {
    font-size: 13px;
  }

  .student-tile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(58px, 1fr));
    grid-auto-rows: minmax(58px, 1fr);
    gap: 6px;
  }

  .thumb-student-button {
    min-height: 0;
    padding: 5px;
  }

  .student-side-head {
    align-items: flex-start;
    gap: 6px;
  }

  .parking-controls {
    gap: 4px;
  }

  .parking-control-button {
    min-width: 44px;
    min-height: 34px;
    padding: 5px 7px;
    font-size: 12px;
  }

  .parking-control-button.plus {
    min-width: 36px;
    font-size: 20px;
  }

  .parking-control-button.add-student {
    min-width: 66px;
  }

  .parking-student-delete {
    width: 19px;
    min-width: 19px;
    height: 19px;
    min-height: 19px;
    font-size: 14px;
  }

  .student-editor-grid {
    grid-template-columns: 1fr;
  }

  .pronunciation-row-head,
  .pronunciation-form-grid {
    grid-template-columns: 1fr;
  }

  .pronunciation-actions,
  .pronunciation-options,
  .pronunciation-save-row {
    justify-content: stretch;
  }

  .pronunciation-actions .button,
  .pronunciation-options .button,
  .pronunciation-save-row .button {
    flex: 1 1 120px;
  }

  .manual-entry-popover {
    right: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
    padding: 10px;
  }

  .manual-entry-form {
    grid-template-columns: 1fr;
  }

  .called-column-head h3 {
    font-size: 16px;
  }

  .called-item {
    min-height: 34px;
    padding: 5px 6px;
  }

  .called-item strong {
    font-size: 13px;
  }

  .queue-item {
    grid-template-columns: 1fr;
  }

  .classroom-queue .queue-item {
    grid-template-columns: minmax(0, 1fr) minmax(70px, auto);
  }

  .classroom-queue .queue-audit {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-content: space-between;
  }
}
