/* ==========================================================================
   ClassConnect Online — Landing, Auth & Legal design system
   Tokens below are shared by the landing (index.html), the legal pages and
   the portal overlays. The classroom app has its own tokens in style.css.
   ========================================================================== */

:root {
  /* ClassConnect brand palette — derived from the lighthouse logo.
     Navy (lighthouse body), coral (stripes), sunlight (beam), sea teal & sky (waves).
     All text pairs meet WCAG AA. */
  --p-bg: #FBF8F3;                /* paper */
  --p-bg-alt: #EAF1FA;            /* harbour tint (cards, previews) */
  --p-surface: #FFFFFF;
  --p-surface-subtle: #F3EEE6;
  --p-ink: #1B2A41;
  --p-ink-soft: #2E3E55;
  --p-muted: #4A5568;
  --p-primary: #22406A;           /* lighthouse navy */
  --p-primary-hover: #1B3354;
  --p-forest: #0F6E63;            /* sea teal */
  --p-accent: #C8452F;            /* coral stripe — fills */
  --p-accent-text: #B53A26;       /* coral for text on paper */
  --p-accent-hover: #9F3220;
  --p-accent-btn: #C8452F;        /* coral fill behind white text (4.6:1) */
  --p-sun: #F5C242;               /* sunlight beam — fills only */
  --p-info: #2B6CB0;
  --p-wave: #8DB4E8;
  --p-tint-ember: #FDF0E6;
  --p-tint-beam: #FDF6DC;
  --p-tint-tide: #E6F3EF;
  --p-band-harbour: #F2F6FB;      /* very light navy section band */
  --p-band-tide: #EFF6F3;         /* very light teal section band */
  --p-border: rgba(34, 64, 106, 0.12);
  --p-border-strong: rgba(34, 64, 106, 0.22);
  --p-warn-bg: #FDF6DC;
  --p-sage: #0F6E63;
  --p-sage-bg: #E6F3EF;
  --p-danger: #B53A26;
  --p-danger-bg: #FDE8E3;
  --p-pill-bg: #FDF6DC;
  --p-pill-ink: #6B4E00;
  --p-btn2-bg: #22406A;           /* secondary (navy) button */
  --p-btn2-ink: #FFFFFF;
  --p-btn2-hover: #1B3354;
  --p-font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --p-font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

  /* Type scale */
  --fs-display: clamp(2.5rem, 1.6rem + 3.2vw, 4.5rem);
  --fs-h2: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --fs-lead: clamp(1.06rem, 1rem + .35vw, 1.25rem);
  --fs-body: 1rem;
  --fs-eyebrow: .75rem;

  /* Spacing scale: 4/8/12/16/24/32/48/64/96/128 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;
  --section-pad: clamp(64px, 8vw, 128px);
  --gutter: clamp(16px, 4vw, 40px);
  --container-max: 1240px;
  --container-wide-max: 1440px;

  /* Radii */
  --r-xs: 6px; --r-sm: 10px; --r-md: 16px; --r-lg: 20px; --r-pill: 999px;

  /* Elevation */
  --sh-1: 0 1px 2px rgb(14 23 38 / .06), 0 1px 1px rgb(14 23 38 / .04);
  --sh-2: 0 2px 4px rgb(14 23 38 / .05), 0 16px 32px -16px rgb(14 23 38 / .24);
  --sh-shot: 0 2px 4px rgb(14 23 38 / .06), 0 24px 48px -24px rgb(14 23 38 / .35), 0 60px 120px -60px rgb(34 64 106 / .35);

  /* Motion */
  --ease-out: cubic-bezier(.22, .8, .24, 1);
}
@media (min-width: 1800px) {
  :root { --container-max: 1360px; }
}

html.portal-dark {
  color-scheme: dark;
  --p-bg: #0E1726;
  --p-bg-alt: #16223A;
  --p-surface: #16223A;
  --p-surface-subtle: #1B2A41;
  --p-ink: #EEF2F7;
  --p-ink-soft: #D3DCE8;
  --p-muted: #A9B6C8;
  --p-primary: #8DB4E8;
  --p-primary-hover: #A9C7EE;
  --p-forest: #0F6E63;
  --p-accent: #E8664C;            /* lighter coral: non-text accents only (stripes, outlines) */
  --p-accent-text: #F08A6E;
  --p-accent-hover: #9F3220;
  --p-accent-btn: #C8452F;        /* white text on #E8664C was 3.26:1 — buttons use this fill */
  --p-sun: #F5C242;
  --p-info: #8DB4E8;
  --p-tint-ember: #2A1E1E;
  --p-tint-beam: #262315;
  --p-tint-tide: #12302E;
  --p-band-harbour: #111D30;
  --p-band-tide: #0F1F26;
  --p-border: rgba(141, 180, 232, 0.16);
  --p-border-strong: rgba(141, 180, 232, 0.28);
  --p-warn-bg: rgba(245, 194, 66, 0.14);
  --p-sage: #4FC1A8;
  --p-sage-bg: rgba(15, 110, 99, 0.3);
  --p-danger: #F08A6E;
  --p-danger-bg: rgba(200, 69, 47, 0.24);
  --p-pill-bg: rgb(245 194 66 / .14);
  --p-pill-ink: #F5D27A;
  --p-btn2-bg: #8DB4E8;
  --p-btn2-ink: #0E1726;
  --p-btn2-hover: #A9C7EE;
  --sh-1: 0 1px 2px rgb(0 0 0 / .3);
  --sh-2: 0 2px 4px rgb(0 0 0 / .25), 0 16px 32px -16px rgb(0 0 0 / .6);
  --sh-shot: 0 2px 4px rgb(0 0 0 / .3), 0 24px 48px -24px rgb(0 0 0 / .65), 0 60px 120px -60px rgb(0 0 0 / .6);
}

/* Page scrolling: the landing scrolls on the viewport. Only overflow-x is clipped —
   setting overflow-y here would turn body into a scroll container and break
   position: sticky (lesson story board, header). The classroom workspace locks
   scrolling via html.workspace-active in style.css. */
body:not(.workspace-active),
html:not(.workspace-active) {
  height: auto;
  min-height: 100%;
  overflow-x: clip;
}
html:not(.workspace-active) { scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.workspace-active) { scroll-behavior: smooth; }
}

#portalRoot {
  font-family: var(--p-font-sans);
  font-size: var(--fs-body);
  background: var(--p-bg);
  color: var(--p-ink);
  min-height: 100dvh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
#portalRoot :focus-visible {
  outline: 2px solid var(--p-ink);
  outline-offset: 3px;
}

.hidden { display: none !important; }
.max-prose { max-width: 65ch; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 12000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--p-accent-btn);
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.16s ease;
}
.skip-link:focus { top: 14px; }

.portal-container {
  width: min(var(--container-max), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.portal-container-wide {
  width: min(var(--container-wide-max), 100% - 2 * var(--gutter));
}

/* ---------- Beta pill (nav, footer, legal) ---------- */
.cc-beta-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--p-pill-bg);
  color: var(--p-pill-ink);
  border: 1px solid color-mix(in srgb, var(--p-pill-ink) 22%, transparent);
  font-family: var(--p-font-sans);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
}

/* ================= Navigation ================= */
.portal-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 400;
  background: color-mix(in srgb, var(--p-bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--p-border);
}

.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: 68px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--p-ink);
  min-height: 44px;
  flex-shrink: 0;
}
.portal-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
}
.portal-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}
.portal-brand-text strong {
  font-family: var(--p-font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.portal-nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex: 1;
  min-width: 0;
}
.portal-nav-primary {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-inline: auto;
}
.portal-nav-links a:not(.portal-btn) {
  color: var(--p-ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  white-space: nowrap;
  padding: 10px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-xs);
  transition: color 0.15s ease;
}
.portal-nav-links a:not(.portal-btn):hover { color: var(--p-accent-text); }

.portal-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.portal-nav-actions .portal-btn { white-space: nowrap; }
.portal-nav-mobile-only { display: none; }

.portal-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--p-border-strong);
  background: var(--p-surface);
  color: var(--p-ink);
  cursor: pointer;
}
.portal-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: rgb(14 23 38 / .38);
  backdrop-filter: blur(2px);
}
.portal-nav-backdrop[hidden] { display: none; }

.portal-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--p-border);
  background: transparent;
  color: var(--p-ink);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.portal-icon-btn:hover { border-color: var(--p-border-strong); color: var(--p-accent-text); }

/* ================= Buttons ================= */
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: var(--p-font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.portal-btn:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 3px; }
.portal-btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.9rem; }
.portal-btn-lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.portal-btn-full { width: 100%; }

/* Navy filled — forms (sign in, reset, feedback) */
.portal-btn-primary {
  background: var(--p-primary);
  color: #FFFFFF;
  border-color: var(--p-primary);
}
.portal-btn-primary:hover { background: var(--p-primary-hover); border-color: var(--p-primary-hover); }
html.portal-dark .portal-btn-primary { color: #0E1726; }

/* Coral — the one main action per view */
.portal-btn-accent {
  background: var(--p-accent-btn);
  color: #FFFFFF;
  border-color: var(--p-accent-btn);
  box-shadow: 0 1px 0 rgb(255 255 255 / .18) inset, 0 6px 16px -8px rgb(200 69 47 / .55);
}
.portal-btn-accent:hover {
  background: var(--p-accent-hover);
  border-color: var(--p-accent-hover);
}

/* Navy secondary (light sky in dark mode) */
.portal-btn-secondary {
  background: var(--p-btn2-bg);
  color: var(--p-btn2-ink);
  border-color: var(--p-btn2-bg);
}
.portal-btn-secondary:hover { background: var(--p-btn2-hover); border-color: var(--p-btn2-hover); }

/* Ghost — bordered, transparent */
.portal-btn-ghost {
  background: transparent;
  color: var(--p-ink);
  border-color: var(--p-border-strong);
}
.portal-btn-ghost:hover { border-color: var(--p-ink); background: color-mix(in srgb, var(--p-ink) 4%, transparent); }

.portal-btn-outline {
  background: var(--p-surface);
  border-color: var(--p-border-strong);
  color: var(--p-ink);
}
.portal-btn-outline:hover {
  border-color: var(--p-ink);
  background: var(--p-surface-subtle);
}

.portal-btn-forest-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.36);
  color: #FBF8F3;
}
.portal-btn-forest-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.text-link-btn {
  background: none;
  border: 0;
  padding: 4px 2px;
  min-height: 24px;
  color: var(--p-accent-text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link-btn.strong { font-weight: 700; }

.portal-chip-btn {
  border: 1px solid var(--p-border-strong);
  background: var(--p-surface);
  color: var(--p-ink);
  border-radius: var(--r-xs);
  padding: 5px 11px;
  min-height: 36px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.portal-chip-btn:hover { border-color: var(--p-ink); }

/* ================= Hero ================= */
.portal-hero {
  padding: clamp(48px, 6vw, 96px) 0 clamp(64px, 7vw, 112px);
  background: var(--p-bg);
  border-bottom: 1px solid var(--p-border);
}

.portal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6.5fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
}

.portal-eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--p-accent-text);
  margin: 0 0 var(--sp-4);
}

.portal-hero-copy h1 {
  font-family: var(--p-font-serif);
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--p-ink);
  margin: 0 0 var(--sp-5);
  max-width: 16ch;
}

.portal-lead {
  max-width: 48ch;
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--p-ink-soft);
  margin: 0 0 var(--sp-6);
  text-wrap: pretty;
}

.portal-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* ================= Sections ================= */
.portal-section {
  padding: var(--section-pad) 0;
  background: var(--p-bg);
}
.portal-section-tinted {
  background: var(--p-band-harbour);
  border-block: 1px solid var(--p-border);
}

.editorial-split {
  display: grid;
  grid-template-columns: minmax(0, 4.5fr) minmax(0, 7.5fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.editorial-split-auth {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.section-kicker {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--p-accent-text);
  margin: 0 0 var(--sp-3);
}

/* One H2 style for every landing section */
.editorial-rail h2,
.lp-head h2,
.lp-schools h2 {
  font-family: var(--p-font-serif);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--p-ink);
  margin: 0 0 var(--sp-4);
  max-width: 20ch;
}
.editorial-rail p {
  font-size: 1rem;
  color: var(--p-ink-soft);
  margin: 0 0 var(--sp-5);
}
.editorial-rail p a { color: var(--p-ink); font-weight: 600; text-underline-offset: 3px; }

.sync-boundary-box {
  padding: var(--sp-4) 18px;
  border: 1px solid var(--p-border);
  border-left: 3px solid var(--p-forest);
  background: var(--p-surface);
  border-radius: var(--r-sm);
}
html.portal-dark .sync-boundary-box { border-left-color: #4FC1A8; }
.sync-boundary-box h3 {
  font-family: var(--p-font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  color: var(--p-ink);
}
.sync-boundary-box p {
  font-size: 0.9rem;
  margin: 0 0 6px;
  color: var(--p-ink-soft);
}
.sync-boundary-box p:last-child { margin-bottom: 0; }

.access-steps {
  list-style: none;
  margin: var(--sp-5) 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: access;
  border-top: 1px solid var(--p-border);
}
.access-steps li {
  counter-increment: access;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--p-border);
}
.access-steps li::before {
  content: counter(access);
  grid-row: span 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .82rem;
  font-weight: 700;
  color: var(--p-btn2-ink);
  background: var(--p-btn2-bg);
}
.access-steps strong {
  font-size: 1rem;
  color: var(--p-ink);
}
.access-steps span {
  font-size: 0.92rem;
  color: var(--p-muted);
}

/* ================= Hairline Auth & Form Cards ================= */
.portal-auth-card,
.portal-form-card {
  background: var(--p-surface);
  color: var(--p-ink);
  border: 1px solid var(--p-border);
  border-radius: var(--r-md);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--sh-2);
}

.auth-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--p-border);
}
.auth-mode-tab {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--p-muted);
  font-family: var(--p-font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.auth-mode-tab:hover { color: var(--p-ink); }
.auth-mode-tab.is-active {
  background: var(--p-surface-subtle);
  border-color: var(--p-border-strong);
  color: var(--p-ink);
}

.auth-header { margin-bottom: 16px; }
.auth-header h3,
.portal-form-card h3 {
  font-family: var(--p-font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
  color: var(--p-ink);
}
.auth-header p { font-size: 0.9rem; color: var(--p-muted); }

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--p-ink);
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.field-label-row label { margin-bottom: 0; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid var(--p-border-strong);
  background: var(--p-surface);
  color: var(--p-ink);
  font-family: var(--p-font-sans);
  font-size: 0.94rem;
  transition: border-color 0.15s ease;
}
.field textarea { min-height: 82px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--p-accent);
  outline-offset: 1px;
  border-color: var(--p-accent);
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--p-danger); }

.field-error {
  min-height: 1.1em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--p-danger);
  margin-top: 4px;
}
.field-error:empty { display: none; }
.field-hint { font-size: 0.82rem; color: var(--p-muted); margin-top: 6px; }
.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { padding-right: 68px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--p-border);
  background: var(--p-surface-subtle);
  color: var(--p-ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--p-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--p-muted);
}

.portal-alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.portal-alert.is-error {
  background: var(--p-danger-bg);
  color: var(--p-danger);
  border-color: color-mix(in srgb, var(--p-danger) 30%, transparent);
}
.portal-alert.is-success {
  background: var(--p-sage-bg);
  color: var(--p-sage);
  border-color: color-mix(in srgb, var(--p-sage) 30%, transparent);
}
.portal-alert.is-info {
  background: var(--p-surface-subtle);
  color: var(--p-ink);
  border-color: var(--p-border);
}

.portal-banner {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.84rem;
}
.portal-banner-warn {
  background: var(--p-warn-bg);
  color: var(--p-ink);
  border: 1px solid color-mix(in srgb, #D97706 40%, transparent);
}
.portal-banner p { margin: 4px 0 8px; color: var(--p-ink-soft); }
.sandbox-quick-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= Contact card & Footer ================= */
.contact-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--r-md);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--sh-1);
}
.contact-card h2,
.contact-card h3 {
  font-family: var(--p-font-serif);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--sp-4);
}
.contact-card p { color: var(--p-ink-soft); margin: 0 0 var(--sp-4); }

.contact-details {
  display: grid;
  gap: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--p-border);
}
.contact-item { display: flex; flex-direction: column; gap: 4px; }
.contact-lbl {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--p-muted);
}
.contact-email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.contact-email-row a {
  font-weight: 700;
  color: var(--p-ink);
  text-underline-offset: 3px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.portal-footer {
  padding: var(--sp-6) 0;
  border-top: 1px solid var(--p-border);
  background: var(--p-bg);
}
.portal-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-5);
}
.portal-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.92rem;
}
.portal-footer-brand img { border-radius: 5px; }
.portal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.9rem;
}
.portal-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  color: var(--p-ink);
  font-weight: 600;
  text-decoration: none;
}
.portal-footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.portal-footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--p-muted);
  flex-basis: 100%;
}
.portal-footer-meta a { color: var(--p-ink); font-weight: 600; }
@media (pointer: coarse) {
  .portal-footer-links a,
  .form-legal-note a,
  .contact-email-row a,
  .text-link-btn { min-height: 44px; }
  .form-legal-note a { display: inline-flex; align-items: center; }
}

/* ================= Account modal: collapsed danger zone ================= */
.cc-danger-details {
  margin-top: 14px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, .12));
  padding-top: 10px;
}
.cc-danger-details > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cc-danger-details > summary::-webkit-details-marker { display: none; }
.cc-danger-details > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: -45deg;
  transition: rotate .2s ease;
}
.cc-danger-details[open] > summary::before { rotate: 45deg; }
.cc-danger-details[open] > summary { color: var(--danger); }
.cc-danger-details .cc-danger-zone { margin-top: 8px; }

/* ================= Overlays: Transition & First-Login Onboarding ================= */
.portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(27, 42, 65, 0.72);
  backdrop-filter: blur(6px);
}

.transition-card,
.onboard-card {
  width: min(520px, 100%);
  background: var(--p-bg);
  color: var(--p-ink);
  border-radius: 10px;
  padding: 28px;
  border: 1px solid var(--p-border-strong);
}

.transition-card { text-align: left; }
.transition-card img { margin-bottom: 14px; border-radius: 8px; }
.transition-card h2 {
  font-family: var(--p-font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.transition-steps {
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--p-muted);
}
.transition-steps li {
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid var(--p-border);
  background: var(--p-surface);
}
.transition-steps li.is-done { color: var(--p-sage); font-weight: 600; border-color: color-mix(in srgb, var(--p-sage) 40%, transparent); }
.transition-steps li.is-active { color: var(--p-ink); font-weight: 700; }

.onboard-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.onboard-head img { border-radius: 8px; }
.onboard-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--p-accent-text);
}
.onboard-head h2 {
  font-family: var(--p-font-serif);
  font-size: 1.45rem;
  font-weight: 600;
}
.onboard-desc { font-size: 0.94rem; color: var(--p-ink-soft); margin-bottom: 18px; }

.brand-preview-box {
  background: var(--p-bg-alt);
  border: 1px solid var(--p-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}
.brand-preview-lbl {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-muted);
  margin-bottom: 8px;
}
.brand-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #FFFFFF;
  color: #1B2A41;
  padding: 7px 14px 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(27, 42, 65, 0.14);
}
.brand-preview-pill img {
  height: 28px;
  width: 28px;
  object-fit: contain;
  border-radius: 5px;
}

.logo-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.onboard-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.onboard-actions-split { justify-content: space-between; flex-wrap: wrap; }

/* ================= In-Workspace TopBar Cloud Controls & Admin ================= */
.cloud-status-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  flex-shrink: 0;
}
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid rgba(27, 42, 65, 0.12);
  box-shadow: var(--shadow-sm);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
body.dark .sync-pill {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94A3B8;
  flex-shrink: 0;
}
.sync-dot.synced { background: #16A34A; }
.sync-dot.saving { background: #D97706; }
.sync-dot.offline { background: #64748B; }
.sync-dot.error { background: #DC2626; }
.sync-dot.readonly { background: #A9B6C8; }

#brand { max-width: min(300px, 34vw); }
#brand img {
  height: 28px;
  width: 28px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.brand-txt { min-width: 0; }
.brand-txt .brand-school-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-btn.q-admin {
  width: auto;
  padding: 0 11px;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  background: #FEF3C7;
  color: #78350F;
}
.q-btn.q-account {
  width: auto;
  padding: 0 11px;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

/* ================= Admin Console Cards ================= */
.cc-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #C8452F;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
}

.cc-admin-card {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  margin-bottom: 10px;
}
.cc-admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cc-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cc-pill.ok { background: rgba(15, 110, 99, 0.14); color: #0F6E63; }
.cc-pill.warn { background: rgba(245, 194, 66, 0.26); color: #7A4E00; }   /* amber: attention, not error */
.cc-inline-confirm {
  margin-top: 10px; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--danger, #B53A26); background: var(--panel2);
}
.cc-inline-confirm p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.45; }
.cc-inline-confirm .modal-actions { margin-top: 0; }
.cc-pill.bad { background: rgba(153, 27, 27, 0.15); color: #991B1B; }
.cc-pill.info { background: rgba(34, 64, 106, 0.12); color: #22406A; }
body.dark .cc-pill.ok { color: #86EFAC; }
body.dark .cc-pill.warn { background: rgba(245, 194, 66, 0.18); color: #FCD34D; }
body.dark .cc-pill.bad { color: #FCA5A5; }
body.dark .cc-pill.info { color: #CBD5E1; }

.cc-cred-box {
  background: var(--panel);
  border: 1.5px dashed var(--brand);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0 14px;
}
.cc-cred-box pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0;
}

/* ================= Language Switcher & Honeypot (C3, D5) ================= */
.cc-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.cc-lang-switch[hidden] {
  display: none !important;
}
.cc-lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--p-border-strong);
  border-radius: 7px;
  overflow: hidden;
  background: var(--p-surface);
}
.cc-lang-btn {
  min-width: 34px;
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--p-muted);
  font-family: var(--p-font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.cc-lang-btn.is-active {
  background: var(--p-primary);
  color: #FFFFFF;
}
html.portal-dark .cc-lang-btn.is-active {
  background: var(--p-accent);
  color: #0E1726;
}

/* ================= Editorial Transition Overlay (D1) ================= */
.cc-transition-overlay {
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(8px);
  transition: opacity 260ms ease, visibility 260ms ease;
}
html.portal-dark .cc-transition-overlay {
  background: rgba(24, 24, 27, 0.92);
}
.cc-transition-overlay.is-fading {
  opacity: 0;
  pointer-events: none;
}
.cc-transition-editorial {
  border-top: 3px solid var(--p-accent);
}
.cc-transition-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cc-transition-head img {
  margin-bottom: 0;
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.cc-transition-org {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--p-accent-text);
}
.cc-transition-sub {
  font-size: 0.92rem;
  color: var(--p-muted);
  margin: -6px 0 16px;
}
.cc-tr-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.cc-tr-flow li {
  text-align: center;
  font-size: 0.82rem;
  padding: 8px 6px;
}

/* ================= Drag & Drop Emblem Zone (D3) ================= */
.cc-dropzone {
  border: 1.5px dashed var(--p-border-strong);
  border-radius: 9px;
  background: var(--p-surface-subtle);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.cc-dropzone:hover,
.cc-dropzone.is-dragover,
.cc-dropzone:focus-within {
  border-color: var(--p-accent);
  background: var(--p-surface);
}
.cc-dropzone-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--p-ink-soft);
}
.cc-size-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--p-border);
  background: var(--p-bg);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--p-forest);
}

/* ================= TopBar Brand, Sync Popover & Remote Banner (D2, A4, A6) ================= */
button#brand {
  appearance: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 140ms ease;
}
button#brand:hover {
  border-color: var(--brand);
}
button#brand:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
#brand .brand-school-name {
  font-family: var(--p-font-serif);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
#brand .brand-txt small {
  font-family: var(--p-font-sans);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.cloud-status-wrap {
  position: relative;
}
.sync-pill {
  appearance: none;
  cursor: pointer;
  min-height: 34px;
  font-family: var(--p-font-sans);
}
.sync-pill:hover {
  border-color: var(--brand);
}
.sync-dot.conflict { background: #C8452F; }
.cc-sync-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(286px, calc(100vw - 28px));
  padding: 14px;
  border-radius: 11px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(27, 42, 65, 0.16);
  z-index: 6500;
  display: grid;
  gap: 10px;
  font-size: 12.5px;
}
.cc-sync-pop-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.cc-sync-pop-lbl { color: var(--muted); font-weight: 600; }
.cc-sync-pop-val { font-weight: 700; text-align: right; word-break: break-word; }

.cc-remote-banner {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6200;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(640px, calc(100vw - 24px));
  padding: 8px 12px 8px 14px;
  border-radius: 10px;
  background: #FEF3C7;
  color: #78350F;
  border: 1px solid #F59E0B;
  box-shadow: 0 8px 22px rgba(27, 42, 65, 0.14);
  font-size: 13px;
  font-weight: 600;
}
body.dark .cc-remote-banner {
  background: #451A03;
  color: #FDE68A;
  border-color: #B45309;
}
.cc-remote-banner-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

/* ================= Missing Media Fallback Card & Conflict Dialog (B3, A3) ================= */
.cc-missing-media-card {
  width: 100%;
  height: 100%;
  min-height: 140px;
  padding: 18px;
  border-radius: 10px;
  border: 1px solid rgba(27, 42, 65, 0.12);
  background: #F3EEE6;
  color: #1B2A41;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
body.dark .cc-missing-media-card {
  background: #27272A;
  color: #F5F5F4;
  border-color: rgba(255, 255, 255, 0.14);
}
.cc-missing-media-card strong {
  font-family: var(--p-font-serif);
  font-size: 1rem;
  font-weight: 600;
}
.cc-missing-media-card p {
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 34ch;
  line-height: 1.45;
  margin: 0;
}

.cc-conflict-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}
.cc-conflict-card {
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 10px;
  padding: 13px;
  display: grid;
  gap: 6px;
  font-size: 12.5px;
}
.cc-conflict-card.is-cloud { border-top: 3px solid #0F6E63; }
.cc-conflict-card.is-local { border-top: 3px solid #C8452F; }
.cc-conflict-card h4 {
  font-family: var(--p-font-serif);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}
.cc-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cc-conflict-actions .btn {
  min-height: 44px;
  flex: 1 1 160px;
}

/* ================= Admin Console: Vertical Rail, Table, Skeletons (D4, C6) ================= */
#modalRoot .modal:has(.cc-admin-shell) {
  width: 95vw;
  max-width: min(1200px, 95vw);
  height: min(760px, 90vh);
  max-height: 90vh;
}
/* Fixed-height console: nav stays put, only the content column scrolls */
#modalRoot .modal:has(.cc-admin-shell) > .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#modalRoot .modal:has(.cc-admin-shell) .cc-admin-shell {
  flex: 1;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}
#modalRoot .modal:has(.cc-admin-shell) .cc-admin-nav { overflow-y: auto; min-height: 0; }
#modalRoot .modal:has(.cc-admin-shell) .cc-admin-main { overflow-y: auto; min-height: 0; padding-right: 4px; }
.cc-admin-filters > * { min-width: 0; }
.cc-admin-filters select.inp { flex: 0 1 auto; max-width: 100%; }
#ccUserSearch { min-width: 220px; flex: 1 1 220px; }
#modalRoot .modal:has(.cc-conflict-grid) {
  max-width: min(700px, 95vw);
}
.cc-admin-shell {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 16px;
  min-height: 360px;
  width: 100%;
}
.cc-admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--border);
  padding-right: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cc-admin-nav::-webkit-scrollbar { display: none; }
.cc-admin-nav-btn {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}
.cc-admin-nav-btn:hover { background: var(--panel2); }
.cc-admin-nav-btn.on {
  background: var(--panel2);
  border-color: var(--brand);
  color: var(--brand-text);
  font-weight: 700;
}
.cc-admin-main {
  min-width: 0;
  overflow-x: hidden;
}
.cc-admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}
.cc-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.cc-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.cc-users-table th,
.cc-users-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.cc-users-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--panel2);
}
.cc-users-table tr:last-child td { border-bottom: 0; }

.cc-retry-banner {
  border: 1px solid #C8452F;
  background: rgba(200, 69, 47, 0.1);
  border-radius: 9px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.cc-fb-group { margin-bottom: 14px; }
.cc-fb-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 12px 0 6px;
}
.cc-empty-state {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.cc-skeleton-list { display: grid; gap: 10px; }
.cc-skeleton-card {
  height: 68px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--panel2) 25%, var(--panel) 50%, var(--panel2) 75%);
  background-size: 200% 100%;
  animation: ccPulse 1.3s ease-in-out infinite;
}
@keyframes ccPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================= Responsive Breakpoints ================= */
@media (max-width: 1080px) {
  .portal-nav-toggle { display: inline-flex; }
  .portal-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--gutter) var(--sp-5);
    background: var(--p-bg);
    border-bottom: 1px solid var(--p-border-strong);
    box-shadow: var(--sh-2);
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
  }
  .portal-nav-links.is-open { display: flex; }
  .portal-nav-primary {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
  }
  .portal-nav-primary a:not(.portal-btn) {
    padding: 10px 4px;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--p-border);
  }
  .portal-nav-actions {
    flex-wrap: wrap;
    margin-top: var(--sp-2);
  }
  .portal-nav-actions .portal-btn { flex: 1 1 160px; min-height: 44px; }
  .portal-nav-mobile-only { display: inline-flex; }
  html.cc-nav-open,
  html.cc-nav-open body { overflow: hidden; }
}

@media (max-width: 1020px) {
  .portal-hero-grid,
  .editorial-split,
  .editorial-split-auth {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  #topBar { flex-wrap: wrap; row-gap: 8px; }
  #topLeft { flex: 1 1 100%; max-width: 100%; }
  #brand { max-width: 190px; }
  #quickBar {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .field-row-2,
  .cc-conflict-grid {
    grid-template-columns: 1fr;
  }
  .cloud-status-wrap .sync-label { display: none; }
  .cc-admin-shell { grid-template-columns: 1fr; }
  #modalRoot .modal:has(.cc-admin-shell) .cc-admin-shell { grid-template-rows: auto minmax(0, 1fr); }
  #ccUserSearch { min-width: 0; }
  .cc-admin-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 8px;
  }
  .cc-admin-nav-btn { width: auto; flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 420px) {
  .portal-hero-cta .portal-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================= Admin · Bulk import ================= */
.cc-bulk { margin-bottom: 14px; display: grid; gap: 12px; }
.cc-bulk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cc-bulk-head code { font-size: 12px; padding: 1px 5px; border-radius: 4px; background: var(--panel2, rgba(0,0,0,.05)); }
.cc-bulk-input { display: grid; gap: 10px; }
.cc-bulk-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 84px; padding: 14px; cursor: pointer; text-align: center;
  border: 1.5px dashed var(--border, rgba(0,0,0,.2)); border-radius: 12px;
  transition: border-color .2s, background .2s;
}
.cc-bulk-drop:hover, .cc-bulk-drop.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.cc-bulk-drop:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.cc-bulk-input textarea { width: 100%; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.cc-bulk-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cc-bulk-progress { display: grid; gap: 6px; }
.cc-bulk-bar { height: 8px; border-radius: 99px; background: var(--panel2, rgba(0,0,0,.06)); overflow: hidden; }
.cc-bulk-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .3s ease; }
.cc-bulk-table { max-height: 300px; overflow: auto; }
.cc-bulk-row.is-skipped td, .cc-bulk-row.is-failed td { color: var(--muted); }
.cc-bulk-row.is-sending { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.cc-bulk-actions { justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ================= Admin · Schools, manage row, activity ================= */
.cc-row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; margin-left: auto; }
.cc-users-table td:has(> .cc-row-actions) { text-align: right; }
.cc-manage-row > td { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.cc-manage { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.cc-manage label, .cc-school-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cc-manage-actions { display: flex; gap: 8px; margin-left: auto; }
.cc-school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cc-school-card { display: grid; gap: 12px; margin: 0; }
.cc-school-card.is-paused { opacity: .7; }
.cc-school-head { display: flex; gap: 10px; align-items: center; }
.cc-school-head > div { display: grid; flex: 1; }
.cc-school-name { font-family: var(--cc-font-serif, Georgia, serif); font-size: 1.05rem; line-height: 1.2; }
.cc-school-logo {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center;
  background: var(--panel2); border: 1px solid var(--border); overflow: hidden; font-size: 20px;
}
.cc-school-logo img { width: 100%; height: 100%; object-fit: contain; }
.cc-seat { display: grid; gap: 4px; }
.cc-audit { list-style: none; margin: 0; padding: 0; display: grid; }
.cc-audit li {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cc-audit li .hint { grid-column: 2; }
.cc-audit-text { font-size: 13.5px; }

/* ---------- Right to erasure: account danger zone & delete dialogs ---------- */
.cc-danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: 10px; background: color-mix(in srgb, var(--danger) 5%, transparent);
}
.cc-danger-zone p { margin: 2px 0 0; }
.cc-delete-account p { margin: 0 0 8px; line-height: 1.45; }
.cc-delete-account ul { margin: 0 0 10px 18px; padding: 0; line-height: 1.5; }
.cc-delete-account .inp { width: 100%; margin-bottom: 10px; }
.cc-delete-account .portal-alert { margin: 0 0 10px; }
.cc-field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.cc-inline-confirm .inp { width: 100%; max-width: 360px; margin-bottom: 8px; }

.cc-users-table td.cc-actions-cell { min-width: 200px; }
