:root {
  --color-navy: #022f66;
  --color-navy-2: #0a4a8f;
  --color-blue: #6cafe0;
  --color-coral: #f79994;
  --color-white: #ffffff;
  --color-off-white: #f5f7fa;
  --color-text-dark: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-success: #2f9e5c;
  --color-success-bg: #eafaf1;
  --color-warning: #b8791f;
  --color-warning-bg: #fdf3e7;
  --color-danger: #c94f4f;
  --color-danger-bg: #fdecea;
  --color-info: #0a4a8f;
  --color-info-bg: #eaf3fb;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-card: 16px;
  --radius-button: 12px;
  --radius-input: 10px;
  --shadow-soft: 0 2px 8px rgba(2, 47, 102, 0.05);
  --shadow-header: 0 10px 26px rgba(2, 47, 102, 0.18);
  --section-padding-desktop: 32px;
  --section-padding-mobile: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text-dark);
  background: var(--color-off-white);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 10px;
  color: var(--color-navy);
  font-family: var(--font-heading);
}

h2 {
  font-size: 1.45rem;
  line-height: 1.25;
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  line-height: 1.55;
}

a {
  color: var(--color-navy);
}

.hidden {
  display: none !important;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  color: var(--color-white);
  background: var(--color-navy);
  box-shadow: var(--shadow-header);
}

.topbar-inner {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.topbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand img {
  height: 44px;
  width: auto;
  max-width: 150px;
  border-radius: 10px;
  object-fit: contain;
  background: #ffffff;
  padding: 6px 10px;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  color: var(--color-white);
  font-size: 1.18rem;
  font-family: var(--font-heading);
  font-weight: 700;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-white);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, color 0.2s ease;
}

.topnav-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.topnav-link.active {
  color: var(--color-navy);
  background: var(--color-coral);
  font-weight: 700;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-meta .btn-ghost {
  flex: 0 0 auto;
}

.topbar-meta.admin-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.topbar-viewas-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-chip-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.topbar-meta-menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topnav-link .badge,
.bottomnav-link .badge {
  min-width: 20px;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--color-danger);
  color: var(--color-white);
  line-height: 1.1;
}

.topnav-link .badge[hidden],
.bottomnav-link .badge[hidden] {
  display: none;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 42px;
  border-radius: 999px;
  padding: 5px 14px 5px 5px;
  background: rgba(255, 255, 255, 0.1);
}

.user-chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-coral);
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
}

.user-chip-text {
  color: var(--color-white);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #f7c9c5;
  background: var(--color-coral);
  color: #7a2e2e;
}

.impersonation-banner button {
  min-height: 40px;
  padding-inline: 14px;
  white-space: nowrap;
}

.impersonation-banner-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.impersonation-banner-text strong {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.impersonation-banner-text span {
  font-size: 0.95rem;
  font-weight: 700;
}

/* Layout */
.page {
  max-width: min(1660px, 100%);
  margin: 0 auto;
  padding: var(--section-padding-desktop) 20px 28px;
}

.page.page-wide {
  max-width: min(1720px, 100%);
}

body.has-bottomnav .page {
  padding-bottom: 92px;
}

.card {
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 18px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.card-subtitle {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.muted {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.full {
  grid-column: 1 / -1;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Inputs */
label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.89rem;
  font-weight: 700;
  color: var(--color-text-dark);
}

input,
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 11px 13px;
  color: var(--color-text-dark);
  background: var(--color-white);
  font-size: 0.96rem;
  font-family: var(--font-body);
  line-height: 1.35;
}

input,
select {
  min-height: 48px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  flex: 0 0 auto;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:not([type="date"]):not([type="number"]):not([type="password"]),
textarea {
  unicode-bidi: plaintext;
  text-align: start;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(108, 175, 224, 0.22);
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 11px;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-button);
  padding: 11px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.05s ease, filter 0.15s ease, background 0.2s ease;
}

button:active,
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-navy);
  color: var(--color-white);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--color-blue);
  color: var(--color-navy);
}

.btn-secondary:hover {
  filter: brightness(0.98);
}

.btn-accent {
  background: var(--color-coral);
  color: var(--color-navy);
}

.btn-accent:hover {
  filter: brightness(0.98);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
}

.btn-danger:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  border: 1.5px solid rgba(255, 255, 255, 0.52);
  background: transparent;
  color: var(--color-white);
}

.btn-ghost-dark {
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-dark);
}

/* Lists / tables */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 10px;
  background: var(--color-white);
}

.list-item {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.thread-message {
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 10px;
}

.thread-message:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-white);
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 12px;
}

.filter-bar-controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-bar-search {
  flex: 1;
  min-width: 220px;
}

.filter-bar-select {
  width: auto;
  min-width: 160px;
}

.filter-bar-clear {
  min-height: 42px;
  padding: 8px 13px;
}

table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

.table-wrap td {
  overflow-wrap: anywhere;
}

.table-wrap td .chip {
  white-space: normal;
  line-height: 1.25;
  text-align: left;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 0.9rem;
}

th {
  color: #546171;
  background: var(--color-off-white);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.table-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.table-sort-btn:hover {
  color: var(--color-navy);
}

.table-sort-btn.active {
  color: var(--color-navy);
}

.table-sort-indicator {
  font-size: 0.72rem;
  line-height: 1;
}

.people-filter-controls {
  align-items: flex-start;
}

.people-secondary-filters {
  margin-top: 10px;
}

.people-type-pills {
  gap: 8px;
  overflow-x: auto;
}

.people-type-pills .pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.84rem;
}

.people-type-pills .pill-count {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e4ebf5;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.people-type-pills .pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.24);
  color: var(--color-white);
}

.people-desktop-only {
  display: block;
}

.people-mobile-only {
  display: none;
}

.people-card-link {
  text-decoration: none;
  color: inherit;
}

.people-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.person-list {
  max-height: none;
}

.person-warning-row {
  border-color: #f2d7ad;
  background: var(--color-warning-bg);
}

.classhub-tabs {
  margin-top: 14px;
}

.classhub-tab-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.classhub-tab {
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.classhub-tab.active {
  color: var(--color-navy);
  border-bottom-color: var(--color-navy);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--color-text-dark);
  background: var(--color-white);
}

.settings-link-card strong {
  display: block;
  margin-bottom: 2px;
  color: var(--color-text-dark);
}

.settings-link-card .muted {
  display: block;
}

.settings-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-info-bg);
  color: var(--color-info);
  flex-shrink: 0;
}

.settings-link-danger {
  border-color: #f1c6c6;
}

.settings-link-danger .settings-link-icon {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.settings-link-danger .muted {
  color: var(--color-danger);
}

.notif-group + .notif-group {
  margin-top: 14px;
}

.notif-group h4 {
  margin-bottom: 8px;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--color-white);
}

.notif-row-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notif-row-copy strong {
  color: var(--color-text-dark);
}

/* Shared components for redesigned pages */
.pill-select {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-dark);
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill-btn.active {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: var(--color-white);
}

.pill-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-info-bg);
  color: var(--color-info);
  font-size: 0.77rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pill-btn.active .pill-avatar {
  background: var(--color-blue);
  color: var(--color-navy);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.chip-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.chip-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.chip-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.chip-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--color-info);
}

.progress-card {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.progress-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-card-status {
  margin-top: 7px;
  font-size: 0.85rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 18px 20px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.stat-card > div {
  min-width: 0;
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.stat-value {
  margin-top: 3px;
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.05;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-info-bg);
  color: var(--color-info);
  flex-shrink: 0;
}

.chat-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  min-height: 520px;
}

.chat-conversations {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  overflow: auto;
  padding: 10px;
}

.chat-thread {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.chat-thread-head {
  padding: 13px 14px;
  border-bottom: 1px solid var(--color-border);
}

.chat-thread-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble-wrap {
  display: flex;
}

.bubble-wrap.own {
  justify-content: flex-end;
}

.bubble-wrap.other {
  justify-content: flex-start;
}

.bubble {
  max-width: 76%;
  border-radius: 16px;
  padding: 11px 14px;
  line-height: 1.45;
  font-size: 0.94rem;
}

.bubble.own {
  background: var(--color-navy);
  color: var(--color-white);
}

.bubble.other {
  background: #eef1f5;
  color: var(--color-text-dark);
}

.bubble-time {
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.75;
}

.chat-thread-input {
  border-top: 1px solid var(--color-border);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
}

.chat-thread-input input {
  border-radius: 999px;
}

.chat-thread-input button {
  min-width: 48px;
  border-radius: 999px;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 46% 1fr;
  background: var(--color-white);
}

.auth-hero {
  position: relative;
  padding: 64px;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-2));
  overflow: hidden;
}

.auth-hero::before,
.auth-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-hero::before {
  width: 230px;
  height: 230px;
  top: -70px;
  right: -70px;
  background: rgba(108, 175, 224, 0.22);
}

.auth-hero::after {
  width: 240px;
  height: 240px;
  bottom: -90px;
  left: -40px;
  background: rgba(247, 153, 148, 0.18);
}

.auth-hero-content {
  position: relative;
  max-width: 420px;
}

.auth-title {
  margin-top: 34px;
  color: var(--color-white);
  font-size: 2rem;
  line-height: 1.3;
}

.auth-text {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.auth-list {
  margin-top: 28px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.auth-list-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--color-white);
}

.auth-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-help {
  margin-top: 5px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.empty-state {
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  padding: 16px;
  color: var(--color-text-muted);
}

/* Bottom mobile nav */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 28;
  display: none;
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 -2px 12px rgba(2, 47, 102, 0.06);
}

.bottomnav-link {
  flex: 1;
  min-height: 58px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #9aa3b2;
  font-size: 0.72rem;
  font-weight: 600;
}

button.bottomnav-link {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.bottomnav-link.active {
  color: var(--color-navy);
  font-weight: 700;
}

/* Toast */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  max-width: min(420px, 90vw);
  border-radius: 10px;
  padding: 11px 14px;
  background: var(--color-navy);
  color: var(--color-white);
  box-shadow: 0 10px 22px rgba(2, 47, 102, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #8f1d1a;
}

/* Modal */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.modal-overlay.modal-transition {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.modal-overlay.modal-transition .modal-card {
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-overlay.modal-transition.show {
  opacity: 1;
}

.modal-overlay.modal-transition.show .modal-card {
  transform: translateY(0);
  opacity: 1;
}

.modal-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 20px 36px rgba(2, 47, 102, 0.22);
  padding: 18px;
}

.modal-sheet-overlay {
  align-items: flex-end;
}

.modal-sheet-card {
  width: min(460px, 100%);
  border-radius: 20px 20px 0 0;
  max-height: 88vh;
}

.modal-sheet-handle {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: #d9dee6;
  margin: -2px auto 12px;
}

.more-sheet-links {
  margin-top: 8px;
  border-top: 1px solid var(--color-border);
}

.more-sheet-row {
  width: 100%;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 6px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-dark);
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.more-sheet-close {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #f3f5f8;
  color: #485568;
  font-size: 0.94rem;
  font-weight: 600;
}

.viewas-modal-card {
  width: min(480px, 100%);
}

.viewas-modal-card .modal-sheet-handle {
  display: none;
}

.modal-card.modal-wide {
  width: min(640px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-close-btn {
  min-height: 36px;
  min-width: 36px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-dark);
  font-size: 1rem;
  font-weight: 700;
  padding: 0;
}

.modal-body {
  margin-top: 8px;
}

.modal-actions {
  margin-top: 14px;
}

.modal-message {
  margin: 2px 0 10px;
}

.modal-details {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-off-white);
}

.modal-details > div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}

.modal-details > div:last-child {
  margin-bottom: 0;
}

.modal-details dt {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 700;
}

.modal-details dd {
  margin: 0;
  color: var(--color-text-dark);
}

.modal-field {
  margin-top: 10px;
}

.modal-field:first-child {
  margin-top: 0;
}

.chrome-task .topnav {
  display: none !important;
}

.chrome-task .topbar-left {
  width: 100%;
}

.flow-shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.flow-shell.wide {
  max-width: 1040px;
}

.flow-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.flow-header-action {
  min-height: 40px;
  min-width: 40px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-text-dark);
  font-size: 1rem;
  font-weight: 700;
  padding: 0;
}

.flow-step-meta {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.flow-progress-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.flow-progress-step {
  border-top: 3px solid var(--color-border);
  padding-top: 8px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.flow-progress-step.active {
  color: var(--color-navy);
  border-top-color: var(--color-navy);
}

.flow-progress-step.complete {
  color: var(--color-success);
  border-top-color: var(--color-success);
}

.flow-phone-dots {
  display: none;
  gap: 5px;
}

.flow-phone-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #c8d1de;
}

.flow-phone-dot.active {
  background: var(--color-white);
}

.flow-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.flow-actions .btn-primary[disabled] {
  background: #b8c5d7;
  cursor: not-allowed;
  filter: none;
}

.flow-sticky-footer {
  display: none;
}

.flow-inline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-inline-controls input[type="search"] {
  flex: 1;
  min-width: 220px;
}

.flow-inline-controls select {
  width: auto;
  min-width: 150px;
}

.flow-students-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
}

.flow-chosen-pane .list {
  max-height: 380px;
}

.setup-banner {
  border: 1px solid #f2d7ad;
  border-radius: 12px;
  background: var(--color-warning-bg);
  color: #7d5a21;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.setup-banner.success {
  border-color: #bfe6cf;
  background: var(--color-success-bg);
  color: #1f7a44;
}

.rich-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rich-text,
.plan-read p,
.att-row-note,
.sched-row-title,
.sched-row-sub,
.tt-slot-head strong,
.tt-slot-internal,
.tt-slot-meta,
td,
.list-item,
.bidi-auto {
  unicode-bidi: plaintext;
  text-align: start;
}

.announce-banner-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.announce-banner {
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-2));
  color: var(--color-white);
  box-shadow: 0 10px 24px rgba(2, 47, 102, 0.18);
}

.announce-banner .muted {
  color: #dce9f8;
}

.announce-banner a {
  color: var(--color-white);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.announce-banner-action {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.announce-banner-action .btn {
  min-height: 44px;
}

.setup-gate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.setup-gate-row:last-child {
  border-bottom: 0;
}

.setup-gate-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.setup-gate-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.setup-gate-icon.ok {
  color: var(--color-success);
  background: var(--color-success-bg);
}

.setup-gate-icon.warn {
  color: var(--color-warning);
  background: var(--color-warning-bg);
}

.multiselect-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.multiselect-row {
  width: 100%;
  min-height: 56px;
  border-radius: 12px;
  border: 1px solid #d9e1ec;
  background: #f3f8ff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  color: var(--color-text-dark);
}

.multiselect-row.selected {
  border-color: #b5cbe6;
  background: #e6f0fd;
}

.multiselect-row.disabled {
  border-color: var(--color-border);
  background: #f7f8fa;
  color: #98a2b1;
}

.multiselect-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid #c8d5e8;
  background: var(--color-white);
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.multiselect-check.checked {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: var(--color-white);
}

.multiselect-main {
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.multiselect-title {
  color: var(--color-text-dark);
  font-size: 0.93rem;
  font-weight: 700;
}

.multiselect-subtitle {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.multiselect-row.disabled .multiselect-title,
.multiselect-row.disabled .multiselect-subtitle {
  color: #9aa6b5;
}

.day-chip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.day-chip-btn {
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-white);
  color: var(--color-text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 10px;
}

.day-chip-btn.active {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: var(--color-white);
}

.report-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.report-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.report-scope-select {
  min-height: 44px;
  min-width: 240px;
  width: min(360px, 100%);
}

.report-range-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-white);
}

.report-range-pill {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.83rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.report-range-pill.active {
  background: var(--color-navy);
  color: var(--color-white);
}

.report-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.attention-item {
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
}

.attention-item.chip-warning {
  border-color: #f3dcb7;
}

.attention-item.chip-danger {
  border-color: #f1c4c4;
}

.attention-item.chip-info {
  border-color: #c4d9f1;
}

.attention-count {
  font-size: 1.45rem;
  font-family: var(--font-heading);
  line-height: 1;
}

.attention-label {
  font-size: 0.86rem;
}

.attention-arrow {
  font-size: 1.2rem;
}

.attention-clear-line {
  min-height: 44px;
  border: 1px solid #bfe6cf;
  border-radius: 12px;
  background: var(--color-success-bg);
  color: #1f7a44;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 12px;
}

.report-primary {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.report-secondary-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-mini-card {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.report-mini-card h4 {
  margin: 0 0 6px;
}

.report-mini-card p {
  margin: 8px 0 0;
}

.report-mini-card-danger {
  border-color: #f1c4c4;
  background: var(--color-danger-bg);
}

.report-headline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.report-headline-number {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.chart-box {
  position: relative;
}

.chart-box-trend {
  height: 230px;
}

.chart-box-compare {
  height: 170px;
}

.chart-box-split {
  height: 82px;
}

.chart-legend {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.reason-bars {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reason-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.87rem;
}

.reason-row-head strong {
  font-weight: 600;
}

.reason-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #edf0f4;
  overflow: hidden;
}

.reason-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--color-danger);
}

.report-inline-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.report-inline-note.warning {
  color: #7d5a21;
}

.report-kpi-inline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.report-kpi-inline strong {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1;
}

.report-kpi-inline span {
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.parents-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.roster-strip {
  margin-top: 12px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px;
  background: var(--color-white);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.roster-value {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 1.75rem;
  line-height: 1;
}

.roster-label {
  margin-top: 6px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.scope-summary-card {
  margin-top: 12px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 12px;
  background: var(--color-white);
}

.scope-summary-head {
  margin-bottom: 10px;
}

.scope-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.scope-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #eef1f5;
  padding-bottom: 8px;
}

.scope-summary-row span {
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.scope-summary-row strong {
  color: var(--color-navy);
}

.report-info-card {
  margin-top: 10px;
  border: 1px solid #c7daf1;
  border-radius: 12px;
  background: var(--color-info-bg);
  color: var(--color-info);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-info-card .btn {
  align-self: flex-start;
}

.reg-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.15fr) minmax(180px, 0.95fr) minmax(220px, 1.25fr) minmax(110px, 0.65fr);
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}

.reg-row-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.reg-row-name strong {
  display: block;
  color: var(--color-text-dark);
}

.reg-flag {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--color-warning);
  font-weight: 700;
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #f2f4f8;
}

.seg-btn {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--color-navy);
  color: var(--color-white);
}

.part-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.part-chip {
  min-height: 52px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-white);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 8px;
  line-height: 1.2;
  cursor: pointer;
}

.part-chip.active {
  border-color: #95c2ea;
  background: #e8f3ff;
  color: var(--color-info);
}

.part-chips.is-disabled {
  opacity: 0.4;
}

.part-chips.is-disabled .part-chip {
  cursor: not-allowed;
}

.reg-note-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.reg-note-btn {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 600;
}

.reg-note-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

.save-bar-hint {
  margin-top: 3px;
  font-size: 0.84rem;
  font-weight: 700;
}

.save-bar-hint.warning {
  color: var(--color-warning);
}

.save-bar-hint.success {
  color: var(--color-success);
}

.job-row {
  min-height: 56px;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-white);
  padding: 8px 12px;
  color: var(--color-text-dark);
  text-decoration: none;
  font-weight: 600;
  font-family: inherit;
}

.job-row .chip {
  min-width: 42px;
}

.job-count {
  font-size: 1.05rem;
  font-weight: 700;
}

.thread-group {
  margin-bottom: 12px;
}

.thread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger);
  flex: 0 0 8px;
}

.range-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-white);
}

.range-tab {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.range-tab.active {
  background: var(--color-navy);
  color: var(--color-white);
}

.child-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.child-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.child-card-head h3 {
  margin: 0;
}

.hw-box {
  border-radius: 10px;
  border: 1px solid #d7e8f7;
  background: var(--color-info-bg);
  color: var(--color-info);
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.hw-box-empty {
  border-color: #e7eaf0;
  background: #f3f5f8;
  color: var(--color-text-muted);
}

.att-row {
  min-height: 56px;
  display: flex;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.att-row-date {
  width: 96px;
  flex: 0 0 96px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.att-row-date strong {
  color: var(--color-text-dark);
  font-size: 0.92rem;
}

.att-row-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.att-row-main strong {
  color: var(--color-text-dark);
}

.att-row-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.plan-card {
  border: 1px solid var(--color-border);
  border-top: 4px solid transparent;
  border-radius: 16px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.plan-card-returned {
  border-top-color: var(--color-danger);
}

.plan-card-draft {
  border-top-color: #f2d7ad;
}

.plan-card-approved {
  border-top-color: var(--color-success);
}

.plan-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-card-weeks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card-week-link {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-white);
  color: var(--color-text-dark);
  text-align: left;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
}

.plan-card-week-link.active {
  border-color: #8cbce5;
  background: #edf6ff;
}

.plan-card-note {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-info-bg);
  color: var(--color-info);
  padding: 12px;
  line-height: 1.45;
}

.plan-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.plan-card-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-card-mobile-link {
  display: none;
  margin-top: 10px;
}

.plan-field {
  margin-top: 10px;
}

.plan-field:first-child {
  margin-top: 0;
}

.plan-field textarea {
  min-height: 74px;
}

.plan-field .muted {
  margin-top: 5px;
}

.plan-comment {
  margin-top: 12px;
  border: 1px solid #f7c9c5;
  border-radius: 12px;
  background: var(--color-danger-bg);
  color: #7a2e2e;
  padding: 12px;
}

.plan-comment h4 {
  margin: 0 0 6px;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9b3838;
}

.plan-comment p {
  margin: 0;
  color: #7a2e2e;
}

.plan-read-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
}

.plan-read-main,
.plan-read-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.plan-read-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-read {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  padding: 12px 14px;
}

.plan-read p {
  margin: 0;
  color: var(--color-text-dark);
  line-height: 1.5;
}

.plan-read-label {
  margin: 0 0 8px;
  color: var(--color-text-dark);
  font-size: 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
}

.plan-read-muted {
  margin-top: 8px;
  color: var(--color-info);
  font-size: 0.84rem;
  line-height: 1.45;
}

.plan-materials {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-materials-item {
  position: relative;
  margin: 0 0 6px;
  padding-left: 16px;
  line-height: 1.45;
}

.plan-materials-item:last-child {
  margin-bottom: 0;
}

.plan-materials-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.63em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #be7e1c;
}

.pay-period-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(160px, 0.8fr) minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

.pay-period-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.payroll-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.payroll-month-nav {
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.payroll-nav-btn {
  min-height: 42px;
  min-width: 116px;
  justify-content: center;
}

.payroll-month-block {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 9px 12px;
  text-align: center;
}

.payroll-month-label {
  color: var(--color-navy);
  font-weight: 700;
}

.payroll-month-range {
  margin-top: 2px;
}

.payroll-status-chip {
  margin-left: auto;
}

.pay-family {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.pay-family + .pay-family {
  margin-top: 10px;
}

.pay-family-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pay-breakdown {
  min-width: 260px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}

.pay-breakdown-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  margin-bottom: 5px;
}

.pay-breakdown-line strong {
  color: var(--color-text-dark);
}

.pay-breakdown-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-dark);
  font-weight: 700;
}

.pay-breakdown-total strong {
  font-size: 1.4rem;
  color: var(--color-navy);
  line-height: 1;
}

.pay-child-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(200px, 1.3fr) minmax(120px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #eef1f5;
  padding: 9px 0;
}

.pay-child-row .chip {
  margin-right: 6px;
}

.pay-adj-chip {
  min-height: 22px;
  padding: 3px 10px;
  font-size: 0.73rem;
}

.pay-money {
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.pay-money-egp {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.pay-preview {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  padding: 14px;
}

.pay-preview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px solid #eef1f5;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.pay-preview-line:last-child {
  border-bottom: 0;
}

.pay-preview-line strong {
  color: var(--color-text-dark);
}

.sched-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 12px;
}

.sched-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sched-help {
  margin: 10px 0 0;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.sched-help summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 14px;
  color: var(--color-navy);
  font-weight: 700;
}

.sched-help-body {
  border-top: 1px solid #edf1f5;
  padding: 0 14px 12px;
}

.sched-help-body .muted {
  margin-top: 8px;
}

.live-card {
  border: 1px solid #d3e1f2;
  border-left: 5px solid var(--color-navy);
  border-radius: 14px;
  background: linear-gradient(180deg, #f4f8fd 0%, #ffffff 100%);
  padding: 14px;
}

.live-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(47, 158, 92, 0.44);
  animation: livePulse 1.8s ease-out infinite;
}

.live-card-title {
  color: var(--color-navy);
  font-weight: 700;
}

.live-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.sched-time {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sched-time-range {
  color: var(--color-text-dark);
  font-weight: 700;
}

.sched-time-class {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.sched-day {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.sched-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #edf1f5;
  padding: 12px 14px;
}

.sched-day-head h4 {
  margin: 0;
  color: var(--color-navy);
  font-size: 1rem;
}

.sched-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sched-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid #edf1f5;
  padding: 12px 14px;
}

.sched-row:last-child {
  border-bottom: 0;
}

.sched-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sched-row-title {
  color: var(--color-text-dark);
  font-weight: 700;
}

.sched-row-sub {
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.sched-muted-link {
  color: var(--color-text-muted);
  text-decoration: none;
  pointer-events: none;
}

.sched-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.sched-week-note {
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.sched-holiday-row {
  border: 1px dashed #f0c98a;
  border-radius: 12px;
  background: var(--color-warning-bg);
  color: #7d5a21;
  padding: 10px 12px;
}

.sched-holiday-row strong {
  color: #7d5a21;
}

.tt-surface-switch {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid #bed0e8;
  border-radius: 999px;
  padding: 5px;
  background: #edf3fb;
  box-shadow: inset 0 1px 2px rgba(2, 47, 102, 0.08);
}

.tt-surface-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 9px 16px;
  color: #3d4f64;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tt-surface-link.active {
  background: var(--color-navy);
  color: var(--color-white);
  box-shadow: 0 3px 8px rgba(2, 47, 102, 0.28);
}

.tt-surface-link:not(.active):hover {
  color: #22384f;
  background: rgba(255, 255, 255, 0.55);
}

.tt-mode-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tt-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid #bed0e8;
  border-radius: 999px;
  padding: 5px;
  background: #edf3fb;
  box-shadow: inset 0 1px 2px rgba(2, 47, 102, 0.08);
}

.tt-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: transparent;
  color: #3d4f64;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tt-mode-btn.active {
  background: var(--color-navy);
  color: var(--color-white);
  box-shadow: 0 3px 8px rgba(2, 47, 102, 0.28);
}

.tt-mode-btn:not(.active):hover {
  color: #22384f;
  background: rgba(255, 255, 255, 0.55);
}

#hoursToggleWrap {
  display: inline-flex;
}

.tt-week-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tt-grid-wrap {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-white);
}

.tt-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sched-week-grid .tt-grid {
  min-width: max-content;
}

.tt-grid th,
.tt-grid td {
  border-bottom: 1px solid #edf1f5;
  border-right: 1px solid #edf1f5;
  vertical-align: top;
  padding: 8px;
}

.tt-grid th:last-child,
.tt-grid td:last-child {
  border-right: 0;
}

.tt-grid thead th {
  background: var(--color-off-white);
  color: #546171;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tt-day-col {
  width: 140px;
  min-width: 140px;
  white-space: nowrap;
  text-align: left;
}

.sched-week-grid .tt-day-col {
  width: 170px;
  min-width: 170px;
}

.tt-hour-col {
  width: auto;
  min-width: 0;
  text-align: center;
}

.sched-week-grid .tt-hour-col {
  min-width: 210px;
}

.sched-week-grid .tt-grid thead .tt-day-col {
  text-transform: none;
  letter-spacing: normal;
}

.tt-day-hours {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 0.74rem;
  text-transform: none;
  letter-spacing: normal;
}

.tt-cell {
  height: 88px;
}

.sched-week-grid .tt-cell {
  height: auto;
  min-height: 76px;
}

.parent-week-grid .tt-grid tbody tr {
  height: 88px;
}

.parent-week-grid .tt-grid tbody .tt-day-col,
.parent-week-grid .tt-grid tbody .tt-cell {
  height: 88px;
}

.tt-cell-open {
  background: var(--color-white);
}

.tt-cell-closed {
  background: #f6f7f9;
}

.tt-free-label,
.tt-closed-label {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.tt-slot-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tt-slot {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--color-text-dark);
  padding: 8px;
  text-decoration: none;
}

.tt-slot:hover {
  border-color: #bdd8f1;
}

.tt-slot.is-cancelled {
  background: var(--color-danger-bg);
  border-color: #f1c6c6;
}

.tt-slot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tt-slot-head strong {
  overflow-wrap: anywhere;
}

.tt-slot-internal {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tt-slot-meta {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.tt-slot-time {
  margin-top: 5px;
}

.tt-slot-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tt-slot-actions .btn-primary,
.tt-slot-actions .btn-ghost-dark {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.tt-slot-actions .chip,
.tt-slot-mini-btn {
  white-space: nowrap;
}

.sched-week-grid .tt-hour-gap {
  border-left: 2px solid #d3deee;
}

.tt-mobile-days {
  display: none;
}

.tt-mobile-day + .tt-mobile-day {
  margin-top: 12px;
}

.tt-mobile-day h4 {
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.tt-mobile-hours {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tt-mobile-hour {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 8px;
}

.tt-mobile-hour-label {
  margin-bottom: 6px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.tt-week-holiday-cell {
  background: #fff7e9;
}

.tt-week-holiday-band {
  border: 1px dashed #e6c084;
  border-radius: 10px;
  background: #fff2dc;
  color: #7d5a21;
  padding: 10px 12px;
}

.tt-week-holiday-band strong {
  color: #7d5a21;
}

.tt-week-today-row > th.tt-day-col {
  background: #e9f2ff;
}

.tt-week-today-row > td.tt-cell {
  background: #f6faff;
}

.tt-week-today-row > td.tt-week-holiday-cell {
  background: #eef6ff;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 158, 92, 0.48);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(47, 158, 92, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 158, 92, 0);
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .chat-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attention-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parents-grid {
    grid-template-columns: 1fr;
  }

  .scope-summary-grid {
    grid-template-columns: 1fr;
  }

  .plan-card-grid,
  .plan-read-grid {
    grid-template-columns: 1fr;
  }

  .pay-period-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .pay-breakdown {
    width: 100%;
    min-width: 0;
  }

  .pay-child-row {
    grid-template-columns: 1fr;
  }

  .sched-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar-meta {
    width: 100%;
    justify-content: space-between;
    position: relative;
  }

  .topbar-meta.admin-meta {
    width: auto;
    align-self: flex-end;
    margin-top: -52px;
    z-index: 2;
    gap: 0;
  }

  .topbar-viewas-btn {
    display: none;
  }

  .topbar-meta.admin-meta .topbar-meta-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-navy);
    padding: 8px;
    box-shadow: 0 12px 24px rgba(2, 47, 102, 0.24);
  }

  .topbar-meta.admin-meta.menu-open .topbar-meta-menu {
    display: flex;
  }

  .topbar-meta.admin-meta .topbar-meta-menu .btn-ghost {
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
  }

  .topbar-meta.admin-meta .user-chip {
    max-width: none;
    min-height: 42px;
    padding-right: 8px;
  }

  .topbar-meta.admin-meta .user-chip-text {
    display: none;
  }

  .user-chip {
    min-width: 0;
    max-width: 70%;
  }

  .row,
  .row-3,
  .role-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .auth-hero {
    padding: 34px 22px;
  }

  .auth-title {
    margin-top: 18px;
    font-size: 1.7rem;
  }

  .auth-form-wrap {
    padding: 24px 18px 34px;
  }

  .page {
    padding-top: var(--section-padding-mobile);
    padding-bottom: 20px;
  }

  .announce-banner-stack {
    gap: 10px;
    margin-bottom: 10px;
  }

  .announce-banner {
    padding: 12px 14px;
  }

  .announce-banner-action .btn {
    width: 100%;
    justify-content: center;
  }

  body.has-bottomnav .bottomnav {
    display: flex;
  }

  body.has-bottomnav .topnav {
    display: none;
  }

  .modal-sheet-card {
    width: 100%;
    max-height: calc(100vh - 8px);
    border-radius: 18px 18px 0 0;
  }

  .viewas-modal-card {
    min-height: calc(100vh - 8px);
  }

  .viewas-modal-card .modal-sheet-handle {
    display: block;
  }

  .viewas-modal-card .modal-close-btn {
    display: none;
  }

  .impersonation-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar-search {
    min-width: 0;
    width: 100%;
  }

  .filter-bar-select {
    width: 100%;
    min-width: 0;
  }

  .plan-field textarea {
    font-size: 16px;
  }

  .plan-card-weeks {
    display: none;
  }

  .plan-card-mobile-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .plan-card-actions {
    display: none;
  }

  .plan-card .flow-sticky-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: block;
    margin: 12px -16px -16px;
    border-top: 1px solid var(--color-border);
    background: var(--color-white);
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .plan-card .flow-sticky-footer .btn-primary {
    width: 100%;
    min-height: 52px;
  }

  .plan-card .flow-sticky-footer .btn-secondary {
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
  }

  .plan-read-main,
  .plan-read-side,
  .plan-read-group {
    display: contents;
  }

  .plan-read-materials {
    order: 1;
  }

  .plan-read-practice {
    order: 2;
  }

  .plan-read-objectives {
    order: 3;
  }

  .plan-read-topics {
    order: 4;
  }

  .plan-read-message {
    order: 5;
  }

  .plan-read-weeks {
    order: 6;
  }

  .report-controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .report-scope-select {
    width: 100%;
    min-width: 0;
  }

  .report-range-pills {
    overflow-x: auto;
    width: 100%;
    padding: 5px;
  }

  .report-range-pill {
    min-height: 40px;
    white-space: nowrap;
    flex: 1;
  }

  .attention-grid {
    grid-template-columns: 1fr;
  }

  .attention-item {
    min-height: 56px;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .pay-family-head {
    flex-direction: column;
  }

  .pay-breakdown .btn-primary,
  .pay-breakdown .btn-secondary {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
  }

  .payroll-toolbar {
    align-items: stretch;
  }

  .payroll-month-nav {
    flex: 1 1 100%;
    grid-template-columns: 1fr 1fr;
  }

  .payroll-month-block {
    grid-column: 1 / -1;
    order: -1;
  }

  .payroll-nav-btn {
    width: 100%;
    min-width: 0;
  }

  .payroll-status-chip {
    margin-left: 0;
  }

  .chart-box-trend {
    height: 190px;
  }

  .chart-box-compare {
    height: 156px;
  }

  .chart-box-split {
    height: 74px;
  }

  .roster-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-mini-card-danger {
    order: -1;
  }

  .range-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding: 5px;
  }

  .range-tab {
    flex: 1;
  }

  .reg-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .seg-btn {
    font-size: 0.88rem;
  }

  .part-chip {
    font-size: 0.79rem;
  }

  .save-bar {
    margin: 0 -18px -18px;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  }

  .save-bar .btn-primary {
    min-height: 52px;
  }

  .att-row {
    flex-direction: column;
    gap: 8px;
  }

  .att-row-date {
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .people-desktop-only {
    display: none;
  }

  .people-mobile-only {
    display: flex;
  }

  .people-cards-mobile {
    border: 0;
    background: transparent;
    padding: 0;
    gap: 8px;
  }

  .people-cards-mobile .list-item {
    padding: 12px;
  }

  .person-grid {
    grid-template-columns: 1fr;
  }

  .person-grid .stats-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .chrome-task .topbar-meta.admin-meta {
    width: 100%;
    margin-top: 0;
    align-self: stretch;
    justify-content: flex-end;
  }

  .flow-progress-rail {
    display: none;
  }

  .flow-phone-dots {
    display: inline-flex;
  }

  .flow-actions {
    display: none;
  }

  .flow-sticky-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: block;
    margin: 12px -18px -18px;
    border-top: 1px solid var(--color-border);
    background: var(--color-white);
    padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  }

  .flow-sticky-footer .btn-primary {
    width: 100%;
    min-height: 52px;
  }

  .flow-sticky-footer .flow-skip-link {
    display: inline-block;
    margin-top: 10px;
  }

  .flow-inline-controls {
    align-items: stretch;
  }

  .flow-inline-controls input[type="search"],
  .flow-inline-controls select,
  .flow-inline-controls .btn-ghost-dark {
    width: 100%;
    min-width: 0;
  }

  .flow-students-grid {
    grid-template-columns: 1fr;
  }

  .flow-chosen-pane {
    display: none;
  }

  .setup-gate-row {
    flex-direction: column;
    align-items: stretch;
  }

  .setup-gate-row .btn-primary,
  .setup-gate-row .btn-secondary,
  .setup-gate-row .btn-ghost-dark {
    width: 100%;
  }

  .multiselect-row {
    min-height: 60px;
  }

  .day-chip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sched-day-head,
  .sched-row {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tt-mode-row {
    flex-direction: column;
    align-items: stretch;
  }

  #hoursToggleWrap {
    width: 100%;
  }

  #hoursToggleWrap .btn-ghost-dark {
    width: 100%;
  }

  .tt-mode-switch,
  .tt-surface-switch {
    width: 100%;
    justify-content: stretch;
  }

  .tt-mode-btn,
  .tt-surface-link {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .tt-week-nav {
    width: 100%;
    justify-content: space-between;
  }

  .tt-week-nav strong {
    width: 100%;
    order: -1;
    text-align: center;
  }

  .tt-grid-wrap {
    display: none;
  }

  .tt-mobile-days {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot {
    animation: none;
  }
}
