/* EdRise parent portal. Tokens and components follow DESIGN.md; no literal colors outside the token blocks.
   Layout: a mesh hero carries the day's summary; below it a two-column work area (what to act on | what is
   coming) that stacks on phones; a dark band closes with the progress chart. */
:root {
  --topbar-h: 65px; /* the sticky top bar (12 + 40 + 12 + hairline); phones set it again. What sticks under the bar reads it. */
  --primary: #533afd;
  --primary-hover: #4434d4;
  --primary-press: #2e2b8c;
  --primary-soft: #b9b9f9;
  --primary-tint: #eeedff;
  --ink: #061b31;
  --ink-2: #273951;
  --mute: #64748d;
  --canvas: #ffffff;
  --canvas-soft: #f6f9fc;
  --hairline: #e3e8ee;
  --ok: #108c3d;
  --ok-bg: rgba(21, 190, 83, 0.14);
  --ok-line: rgba(21, 190, 83, 0.4);
  --warn: #9b6829;
  --warn-bg: rgba(245, 180, 80, 0.18);
  --warn-line: rgba(155, 104, 41, 0.35);
  --bad: #c41a50;
  --bad-bg: rgba(234, 34, 97, 0.1);
  --bad-line: rgba(234, 34, 97, 0.35);
  /* danger = true red, for what costs the child something now (overdue / missing work). Text 6.5:1 on white; --bad stays the ruby of grades D-F. */
  --danger: #b42318;
  --danger-bg: rgba(217, 45, 32, 0.08);
  --danger-line: rgba(180, 35, 24, 0.35);
  --danger-accent: #d92d20;
  --on-danger: #ffffff;
  --warn-strong: #7a4f12; /* amber text that keeps AA (6:1) on its own tint; --warn is for chips on a plain surface */
  --mesh-1: #ffcb57;
  --mesh-2: #ff5a5f;
  --mesh-3: #a960ee;
  --mesh-4: #90e0ff;
  --band-dark: #1c1e54;
  --on-dark: #ffffff;
  --on-dark-mute: rgba(255, 255, 255, 0.7);
  --on-dark-line: rgba(255, 255, 255, 0.12);
  --on-primary: #ffffff;
  --band-primary: #8b7dff; /* chart line/area on the dark band is the dark-theme primary in both themes */
  --band-up: #6ee7a0;
  --band-down: #ff8fb0;
  --zone-a: rgba(21, 190, 83, 0.07);
  --zone-c: rgba(245, 180, 80, 0.08);
  --zone-d: rgba(234, 34, 97, 0.06);
  --shadow-1: rgba(0, 55, 112, 0.08) 0 1px 3px;
  --shadow-2: rgba(0, 55, 112, 0.08) 0 8px 24px, rgba(0, 55, 112, 0.04) 0 2px 6px;
  --font: "Inter", "SF Pro Display", system-ui, -apple-system, sans-serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #8b7dff; --primary-hover: #a094ff; --primary-press: #6f5fff; --primary-soft: #3d3580; --primary-tint: #1d1a45;
    --ink: #e8edf6; --ink-2: #c3cddd; --mute: #8d9bb3;
    --canvas: #0b1324; --canvas-soft: #0f1a30; --hairline: #1f2c46;
    --ok: #4fd486; --ok-bg: rgba(79, 212, 134, 0.12); --ok-line: rgba(79, 212, 134, 0.35);
    --warn: #e6b56a; --warn-bg: rgba(230, 181, 106, 0.12); --warn-line: rgba(230, 181, 106, 0.35);
    --bad: #ff6b96; --bad-bg: rgba(255, 107, 150, 0.12); --bad-line: rgba(255, 107, 150, 0.35);
    --danger: #ff8a80; --danger-bg: rgba(255, 122, 110, 0.12); --danger-line: rgba(255, 138, 128, 0.4); --danger-accent: #ff6b5e; --on-danger: #2b0705; --warn-strong: #e6b56a;
    --mesh-1: #8a6420; --mesh-2: #8a2a3a; --mesh-3: #5a32a0; --mesh-4: #2a6a8a; --band-dark: #070a24;
    --zone-a: rgba(79, 212, 134, 0.07); --zone-c: rgba(230, 181, 106, 0.07); --zone-d: rgba(255, 107, 150, 0.07);
    --shadow-1: rgba(0, 0, 0, 0.4) 0 1px 3px;
    --shadow-2: rgba(0, 0, 0, 0.45) 0 8px 24px, rgba(0, 0, 0, 0.3) 0 2px 6px;
    color-scheme: dark;
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  --primary: #8b7dff; --primary-hover: #a094ff; --primary-press: #6f5fff; --primary-soft: #3d3580; --primary-tint: #1d1a45;
  --ink: #e8edf6; --ink-2: #c3cddd; --mute: #8d9bb3;
  --canvas: #0b1324; --canvas-soft: #0f1a30; --hairline: #1f2c46;
  --ok: #4fd486; --ok-bg: rgba(79, 212, 134, 0.12); --ok-line: rgba(79, 212, 134, 0.35);
  --warn: #e6b56a; --warn-bg: rgba(230, 181, 106, 0.12); --warn-line: rgba(230, 181, 106, 0.35);
  --bad: #ff6b96; --bad-bg: rgba(255, 107, 150, 0.12); --bad-line: rgba(255, 107, 150, 0.35);
  --danger: #ff8a80; --danger-bg: rgba(255, 122, 110, 0.12); --danger-line: rgba(255, 138, 128, 0.4); --danger-accent: #ff6b5e; --on-danger: #2b0705; --warn-strong: #e6b56a;
  --mesh-1: #8a6420; --mesh-2: #8a2a3a; --mesh-3: #5a32a0; --mesh-4: #2a6a8a; --band-dark: #070a24;
  --zone-a: rgba(79, 212, 134, 0.07); --zone-c: rgba(230, 181, 106, 0.07); --zone-d: rgba(255, 107, 150, 0.07);
  --shadow-1: rgba(0, 0, 0, 0.4) 0 1px 3px;
  --shadow-2: rgba(0, 0, 0, 0.45) 0 8px 24px, rgba(0, 0, 0, 0.3) 0 2px 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas-soft);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.45;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 300; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }

/* Top bar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--canvas) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "brand student nav end"; align-items: center; gap: 16px; padding-block: 12px; }
.wordmark { grid-area: brand; display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 17px; letter-spacing: -0.3px; color: var(--ink); }
.wordmark:hover { color: var(--ink); }
.wordmark svg { width: 22px; height: 22px; }
.topbar-end { grid-area: end; display: flex; align-items: center; }

/* Primary navigation: Resumen and Recursos as pills, and Escuela as a pill that opens a dropdown (a disclosure: a button and a list of links).
   The dropdown panel looks like the account menu (.menu). On phones this row is hidden: the drawer carries the same links. */
.nav { grid-area: nav; display: flex; gap: 4px; min-width: 0; justify-content: flex-start; }
.nav > a, .nav-group-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 9999px;
  color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 400; border: 1px solid transparent; background: transparent; cursor: pointer;
}
.nav > a:hover, .nav-group-btn:hover, .nav-group-btn[aria-expanded="true"] { background: var(--primary-tint); color: var(--ink-2); }
.nav > a[aria-current="page"], .nav-group-btn[aria-current="true"] { background: var(--primary); color: var(--on-primary); }
.nav-group-btn svg { width: 10px; height: 10px; flex: none; }
.nav-group { position: relative; }
.nav-group-list {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 6; min-width: 220px; max-width: min(320px, calc(100vw - 32px)); margin: 0; padding: 6px; list-style: none;
  display: grid; gap: 2px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-2);
}
.nav-group-list[hidden] { display: none; }
.nav-group-list a {
  display: flex; align-items: center; min-height: 40px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 400;
}
.nav-group-list a:hover, .nav-group-list a:focus-visible { background: var(--canvas-soft); color: var(--ink); }
.nav-group-list a[aria-current="page"] { background: var(--primary-tint); color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .nav-group-list { animation: menu-in 140ms ease-out; transform-origin: top left; }
}
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9999px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--primary-tint); color: var(--ink-2); }
.icon-btn:disabled { opacity: 0.4; cursor: default; background: transparent; }

/* Phone menu: the hamburger in the bar and the drawer it opens. Both are off on wide screens (the pills above are the navigation there);
   the rules that turn them on are in the max-width: 720px block further down. */
.nav-menu { grid-area: menu; display: none; }
.nav-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--hairline); border-radius: 9999px;
  background: var(--canvas); color: var(--ink); cursor: pointer;
}
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background: var(--primary-tint); }
.nav-toggle svg { width: 22px; height: 22px; }
.drawer { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 45%, transparent); }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--canvas); border-right: 1px solid var(--hairline); box-shadow: var(--shadow-2);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 12px 8px 20px; border-bottom: 1px solid var(--hairline); }
.drawer-title { font-weight: 500; font-size: 17px; letter-spacing: -0.3px; color: var(--ink); }
.drawer-close { width: 44px; height: 44px; }
.drawer-nav { padding: 4px 12px 24px; }
.drawer-group { margin: 18px 8px 6px; font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.drawer-nav ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.drawer-link { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: 15px; font-weight: 400; }
.drawer-link:hover { background: var(--primary-tint); color: var(--ink); }
.drawer-link[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
@media (prefers-reduced-motion: no-preference) {
  .drawer-panel { animation: drawer-in 180ms ease-out; }
  .drawer-backdrop { animation: drawer-fade 180ms ease-out; }
  @keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
  @keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }
}

/* Who the page is about (the student), on the left next to the nav */
.student-ctx { grid-area: student; min-width: 0; }
.ctx-label { color: var(--mute); }
.ctx-name { font-weight: 500; color: var(--ink); }
.ctx-static, .ctx-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; max-width: 100%; font: inherit; font-size: 14px; white-space: nowrap;
}
.ctx-static { padding: 6px 4px; }
.ctx-btn {
  padding: 6px 12px; border: 1px solid var(--hairline); border-radius: 9999px; background: var(--canvas); color: var(--ink); cursor: pointer;
}
.ctx-btn:hover { background: var(--primary-tint); }
.ctx-btn svg { width: 10px; height: 10px; color: var(--mute); flex: none; }
.ctx-name { overflow: hidden; text-overflow: ellipsis; }
.switcher { position: relative; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); font-weight: 500; font-size: 13px; }

/* The parent's account: avatar button and its menu */
.account { position: relative; }
.account-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--hairline); border-radius: 50%;
  background: var(--primary-tint); color: var(--primary); font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; overflow: hidden;
}
.account-btn:hover, .account-btn[aria-expanded="true"] { border-color: var(--primary); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-initials { line-height: 1; }
.menu {
  position: absolute; top: calc(100% + 8px); min-width: 220px; max-width: min(320px, calc(100vw - 32px)); margin: 0; padding: 6px; list-style: none;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-2);
}
.menu-right { right: 0; }
.menu-left { left: 0; }
.menu button, .menu a[role="menuitem"] {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font: inherit; font-weight: 400; font-size: 14px; text-align: left; cursor: pointer;
}
.menu button:hover, .menu button[aria-pressed="true"], .menu a[role="menuitem"]:hover, .menu a[aria-current="page"] { background: var(--primary-tint); color: var(--ink); }
.menu-head { display: grid; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--hairline); margin-bottom: 6px; }
.menu-name { font-weight: 500; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.menu-email { font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.menu-sep { border: 0; border-top: 1px solid var(--hairline); margin: 6px 0; }

/* Account menu: profile header, icon rows, one-tap theme switch, sign out apart */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.account-menu { width: 288px; padding: 0; overflow: hidden; }
.account-menu .menu-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 16px; margin: 0; border-bottom: 1px solid var(--hairline); background: var(--canvas-soft);
}
.menu-avatar {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--primary-tint); color: var(--primary); font-weight: 500; font-size: 16px; box-shadow: 0 0 0 2px var(--canvas), 0 0 0 3px var(--hairline);
}
.menu-who { display: grid; gap: 1px; min-width: 0; }
.menu-who .menu-name, .menu-who .menu-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.menu-role { justify-self: start; margin-top: 4px; padding: 1px 8px; border-radius: 9999px; font-size: 11px; font-weight: 400; color: var(--primary); background: var(--primary-tint); }
.menu-group { display: grid; gap: 2px; padding: 6px; }
.account-menu a[role="menuitem"] { gap: 12px; padding: 8px 10px; color: var(--ink-2); }
.account-menu a[role="menuitem"]:hover, .account-menu a[role="menuitem"]:focus-visible { background: var(--canvas-soft); color: var(--ink); }
.account-menu a[aria-current="page"] { background: var(--primary-tint); color: var(--ink); }
.mi { width: 18px; height: 18px; flex: none; color: var(--mute); }
.account-menu a:hover .mi, .account-menu a[aria-current="page"] .mi { color: var(--primary); }
.menu-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 9999px; font-size: 12px; text-align: center; color: var(--mute); background: var(--canvas-soft); border: 1px solid var(--hairline); }
.menu-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.menu-theme-label { font-size: 13px; color: var(--mute); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9999px; background: var(--canvas-soft); border: 1px solid var(--hairline); }
.account-menu .seg {
  display: inline-grid; place-items: center; width: 32px; min-height: 28px; height: 28px; padding: 0; border-radius: 9999px; color: var(--mute);
}
.account-menu .seg .mi { width: 16px; height: 16px; color: inherit; }
.account-menu .seg:hover { background: transparent; color: var(--ink); }
.account-menu .seg[aria-checked="true"] { background: var(--canvas); color: var(--primary); box-shadow: var(--shadow-1); }
.menu-language { border-top: 0; }
.account-menu .seg.seg-text { width: auto; padding: 0 10px; font-size: 13px; font-weight: 500; }
.menu-note { margin: 0; padding: 8px 16px; font-size: 13px; color: var(--bad); border-bottom: 1px solid var(--hairline); }
.menu-foot { padding: 6px; }
.account-menu a.menu-danger:hover, .account-menu a.menu-danger:focus-visible { background: var(--bad-bg); color: var(--bad); }
.account-menu a.menu-danger:hover .mi, .account-menu a.menu-danger:focus-visible .mi { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) {
  .account-menu { animation: menu-in 140ms ease-out; transform-origin: top right; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
}
@media (max-width: 400px) { .account-menu { width: calc(100vw - 32px); } }


/* Mesh hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--hairline); background: var(--canvas); }
/* Signature diagonal wave: a saturated band skewed across the top, fading into the page. */
.hero::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: -55%; height: 120%;
  transform: skewY(-8deg); transform-origin: top left;
  background:
    radial-gradient(38% 70% at 8% 60%, var(--mesh-1), transparent 72%),
    radial-gradient(34% 80% at 32% 55%, var(--mesh-2), transparent 72%),
    radial-gradient(40% 90% at 62% 45%, var(--mesh-3), transparent 72%),
    radial-gradient(36% 80% at 92% 55%, var(--mesh-4), transparent 72%),
    linear-gradient(90deg, var(--mesh-1), var(--mesh-2) 30%, var(--mesh-3) 62%, var(--mesh-4));
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 38%, var(--canvas) 78%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; padding-block: 56px 32px; display: grid; gap: 20px; }
.eyebrow { font-size: 11px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.96px; max-width: 22ch; }
.hero h1 em { font-style: normal; color: var(--primary); }
.digest {
  background: color-mix(in srgb, var(--canvas) 88%, transparent); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 20px 22px; box-shadow: var(--shadow-2); max-width: 680px; display: grid; gap: 10px;
}
.digest-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.digest p { font-size: 16px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.digest p a svg, .digest-links svg { width: 10px; height: 10px; }
.digest-practice { display: grid; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--hairline); }
.digest-practice-title { font-size: 13px; color: var(--mute); }
.digest-practice-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; font-size: 15px; color: var(--ink-2); }
.digest-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.digest .meta { font-size: 13px; color: var(--mute); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 9999px;
  font-size: 12px; font-weight: 400; border: 1px solid transparent; white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.chip.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.chip.danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.chip.plain { color: var(--primary); background: var(--primary-tint); }
.chip.plain::before { display: none; }

.grade {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px;
  font-weight: 500; font-size: 14px; border: 1px solid transparent;
}
.grade.A, .grade.B { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.grade.C { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.grade.D, .grade.F { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }

/* Main grid */
.work { padding-block: 32px 48px; display: grid; gap: 24px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.work > .banner { grid-column: 1 / -1; }
.col { display: grid; gap: 24px; min-width: 0; }
@media (max-width: 880px) { .work { grid-template-columns: minmax(0, 1fr); } }

/* Pages other than the summary: a heading, then panels */
.page { padding-block: 32px 48px; display: grid; gap: 24px; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(26px, 3.6vw, 32px); line-height: 1.1; letter-spacing: -0.64px; margin-top: 4px; }
.page-head h1:focus { outline: none; }
.hero h1:focus { outline: none; }
.page-head .lead { color: var(--ink-2); max-width: 62ch; margin-top: 8px; font-size: 15px; }
.detail-top { padding-bottom: 24px; gap: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; justify-self: start; }
.back::before { content: "‹"; font-size: 18px; line-height: 1; }
.head-score { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-score strong { font-size: 26px; font-weight: 300; letter-spacing: -0.26px; }
.trend { font-size: 13px; font-weight: 400; }
.more { font-size: 13px; font-weight: 400; }
.more.block { display: inline-block; margin-top: 12px; }
.compact { display: grid; gap: 12px; }
.status-line { font-size: 15px; color: var(--ink-2); }

/* Health banner */
.banner {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-radius: 12px;
  border: 1px solid var(--hairline); background: var(--canvas); box-shadow: var(--shadow-1);
}
.banner.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.banner.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.banner-text { flex: 1 1 280px; display: grid; gap: 4px; min-width: 0; }
.banner-title { font-size: 16px; font-weight: 400; color: var(--ink); }
.banner-text p { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.banner-next { color: var(--ink) !important; }

/* "Today needs your attention": the strip under the hero. One big card per thing to look at, a quiet line once it is answered. */
.work > .attention { grid-column: 1 / -1; display: grid; gap: 12px; }
.attention-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.attention-head h2 { font-size: clamp(22px, 3vw, 26px); letter-spacing: -0.26px; line-height: 1.2; }
.attention-head h2:focus { outline: none; }
.attention-lead { font-size: 14px; color: var(--ink-2); max-width: 70ch; }
.att-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.att-card {
  display: grid; gap: 12px; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--hairline);
  border-left-width: 6px; background: var(--canvas); box-shadow: var(--shadow-1); min-width: 0;
}
.att-card.bad { border-color: var(--bad-line); border-left-color: var(--bad); background: var(--bad-bg); }
.att-card.warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-bg); }
.att-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.att-child { font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.att-text { font-size: clamp(17px, 2.4vw, 20px); line-height: 1.35; letter-spacing: -0.1px; color: var(--ink); overflow-wrap: anywhere; }
.att-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 15px; }
.att-card .btn-ghost { background: var(--canvas); }
.att-note summary { cursor: pointer; font-size: 14px; color: var(--primary); width: fit-content; min-height: 32px; display: inline-flex; align-items: center; }
.att-note[open] summary { margin-bottom: 8px; }
.att-note textarea { width: 100%; }
.prev-line { font-size: 12px; color: var(--mute); }
.att-card.done {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 16px; box-shadow: none;
  border-left-width: 1px; border-color: var(--hairline); background: var(--canvas);
}
.att-card.done:focus { outline: none; }
.att-card.done:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.att-done-text { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.att-card.done .fine { color: var(--mute); }
@media (max-width: 560px) { .att-actions .btn { flex: 1 1 100%; justify-content: center; } }
/* The other children's items: one quiet line each (initial + first name + what happened), "Revisar" opens the big card, "Ver a <nombre>" switches the student. */
.att-row {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 12px 8px 16px; min-width: 0;
  border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas);
}
.att-row .avatar { flex: none; }
.att-row-text { flex: 1 1 240px; min-width: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.att-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.att-row .btn { min-height: 44px; padding: 8px 16px; font-size: 14px; }
@media (max-width: 560px) { .att-row-actions { width: 100%; } .att-row-actions .btn { flex: 1 1 0; justify-content: center; } }
.att-card:focus { outline: none; }
.att-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Pending count next to a child on the student picker: a number, never color alone (the label says "1 pendiente"). */
.pending-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 500; line-height: 1; color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad-line);
}

.panel { background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-1); min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 22px 0; flex-wrap: wrap; }
.panel-head h2 { font-size: 22px; letter-spacing: -0.22px; line-height: 1.2; }
.panel-head .hint { font-size: 13px; color: var(--mute); }
.panel-body { padding: 16px 22px 22px; }
.empty { font-size: 14px; color: var(--mute); }

/* Concerns */
.concerns { display: grid; gap: 12px; }
.concern { border: 1px solid var(--hairline); border-radius: 10px; padding: 16px; display: grid; gap: 12px; background: var(--canvas); }
.concern-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.concern h3 { font-size: 17px; line-height: 1.3; letter-spacing: -0.1px; overflow-wrap: anywhere; }
.concern .why { font-size: 14px; color: var(--mute); margin-top: 2px; overflow-wrap: anywhere; }
.concern .why b { font-weight: 400; color: var(--ink-2); }
.weight { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--mute); }
.weight-bar { flex: 1; max-width: 200px; height: 6px; border-radius: 9999px; background: var(--canvas-soft); border: 1px solid var(--hairline); overflow: hidden; }
.weight-bar span { display: block; height: 100%; background: var(--bad); opacity: 0.75; }
.topics { display: flex; flex-wrap: wrap; gap: 6px; }
.practice { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px dashed var(--hairline); padding-top: 12px; }
.practice .label { font-size: 13px; color: var(--mute); margin-right: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 9999px;
  font: inherit; font-weight: 400; font-size: 14px; line-height: 1; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-primary:active { background: var(--primary-press); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary-soft); }
.btn-ghost:hover { background: var(--primary-tint); }
.btn svg { width: 12px; height: 12px; }
.next-test { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Simulator */
.sim { display: grid; gap: 16px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  min-height: 36px; padding: 6px 14px; border-radius: 9999px; border: 1px solid var(--hairline); background: transparent;
  color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 400; cursor: pointer; text-align: left;
}
.pill:hover { background: var(--primary-tint); }
.pill[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; color: var(--ink-2); }
.field select {
  min-height: 40px; padding: 6px 10px; border: 1px solid var(--hairline); border-radius: 6px;
  background: var(--canvas); color: var(--ink); font: inherit; font-weight: 300; font-size: 14px; max-width: 100%;
}
.field select:focus { border-color: var(--primary); outline-offset: 0; }
.sim-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.sim label { font-size: 14px; color: var(--ink-2); }
.sim input[type="range"] { width: 100%; min-height: 40px; accent-color: var(--primary); }
.sim-score { font-family: var(--mono); font-size: 15px; color: var(--primary); }
.projection { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
.projection div { background: var(--canvas); padding: 14px; display: grid; gap: 4px; align-content: start; justify-items: start; min-width: 0; }
.projection small { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); font-weight: 400; overflow-wrap: anywhere; }
.projection strong { font-size: 26px; font-weight: 300; letter-spacing: -0.26px; }
.sim-verdict { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.sim-verdict b { font-weight: 500; color: var(--ink); }
.fine { font-size: 12px; color: var(--mute); }

/* Upcoming */
.agenda { list-style: none; margin: 0; padding: 0; display: grid; }
.agenda li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.agenda li:first-child { border-top: 0; padding-top: 0; }
.date { text-align: center; border: 1px solid var(--hairline); border-radius: 8px; padding: 6px 0; line-height: 1.1; align-self: start; }
.date b { display: block; font-size: 20px; font-weight: 300; }
.date small { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; }
.agenda h3 { font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.agenda p { font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.agenda .flag { margin-top: 6px; }

/* Subjects table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); padding: 0 8px 10px; white-space: nowrap; }
td { padding: 10px 8px; border-top: 1px solid var(--hairline); vertical-align: middle; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; text-align: right; }
th.right, td.right { text-align: right; }
.subject { font-weight: 400; color: var(--ink); min-width: 140px; }
.spark { width: 84px; height: 28px; display: block; }
.trend-up { color: var(--ok); } .trend-down { color: var(--bad); } .trend-flat { color: var(--mute); }

/* Topic map */
.topic-groups { display: grid; gap: 14px; }
.topic-groups h3 { font-size: 13px; font-weight: 400; color: var(--mute); margin-bottom: 8px; }

/* Attendance */
.attendance { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; }
.stat strong { font-size: 26px; font-weight: 300; letter-spacing: -0.26px; }
.stat small { font-size: 13px; color: var(--mute); }

/* Progress band (dark navy) */
.band { background: var(--band-dark); color: var(--on-dark); }
.band .wrap { padding-block: 48px; display: grid; gap: 24px; }
.band-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.band .eyebrow { color: var(--on-dark-mute); }
.band h2 { font-size: clamp(26px, 3.6vw, 32px); letter-spacing: -0.64px; line-height: 1.1; margin-top: 6px; }
.band .lead { color: var(--on-dark-mute); max-width: 52ch; margin-top: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  min-height: 36px; padding: 7px 14px; border-radius: 9999px; border: 1px solid var(--on-dark-line); background: transparent;
  color: var(--on-dark-mute); font: inherit; font-size: 13px; font-weight: 400; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--on-dark); color: var(--band-dark); border-color: var(--on-dark); }
.progress-card { border: 1px solid var(--on-dark-line); border-radius: 12px; padding: 20px; display: grid; gap: 16px; min-width: 0; }
.progress-summary { display: flex; gap: 28px; flex-wrap: wrap; align-items: end; }
.progress-summary .stat strong { color: var(--on-dark); }
.progress-summary .stat small { color: var(--on-dark-mute); }
.delta-up { color: var(--band-up) !important; } .delta-down { color: var(--band-down) !important; } .delta-flat { color: var(--on-dark-mute) !important; }
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; min-width: 520px; height: auto; display: block; }
.chart text { font-family: var(--font); }
.progress-data { color: var(--on-dark-mute); font-size: 13px; min-width: 0; }
.progress-data summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.progress-data summary:focus-visible { outline: 2px solid var(--on-dark); outline-offset: 2px; border-radius: 4px; }
.progress-data table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.progress-data caption { text-align: left; padding-bottom: 6px; }
.progress-data th, .progress-data td { text-align: left; font-weight: 400; padding: 6px 8px 6px 0; border-top: 1px solid var(--on-dark-line); vertical-align: top; }
.progress-data thead th { color: var(--on-dark-mute); font-size: 12px; }
.progress-data tbody th, .progress-data td.num { color: var(--on-dark); }

/* Compact summary cards */
.count-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.count-list strong { font-weight: 400; color: var(--ink); }
.notice-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; }
.notice-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.notice-list li:first-child { border-top: 0; padding-top: 0; }
.notice-list h3 { font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.notice-list p { font-size: 13px; color: var(--mute); }
.strip { display: grid; grid-template-columns: repeat(auto-fill, 12px); gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--hairline); background: transparent; }
.dot.ok { background: var(--ok); border-color: var(--ok); }
.dot.warn { background: var(--warn); border-color: var(--warn); }
.dot.bad { background: var(--bad); border-color: var(--bad); }
.dot.plain { background: var(--primary); border-color: var(--primary); }

/* Subjects */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.subject-card {
  display: grid; gap: 12px; padding: 18px 20px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px;
  box-shadow: var(--shadow-1); color: var(--ink); min-width: 0;
}
.subject-card:hover { color: var(--ink); border-color: var(--primary-soft); background: var(--primary-tint); }
.subject-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.subject-top h3 { font-size: 17px; line-height: 1.3; letter-spacing: -0.1px; overflow-wrap: anywhere; }
.subject-mid { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subject-mid strong { font-size: 26px; font-weight: 300; letter-spacing: -0.26px; }

/* Plain-language read of a subject: on the card (clamped on phones) and larger on the detail page */
.subject-summary { display: grid; gap: 6px; min-width: 0; }
.summary-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.summary-headline { font-size: 15px; font-weight: 400; color: var(--ink); }
.summary-detail { font-size: 13px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.subject-summary.card { padding-top: 12px; border-top: 1px dashed var(--hairline); }
@media (max-width: 520px) {
  .subject-summary.card .summary-detail { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
}
.subject-summary.detail { gap: 8px; padding: 18px 20px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-1); }
.subject-summary.detail .summary-headline { font-size: 22px; font-weight: 300; line-height: 1.2; letter-spacing: -0.22px; }
.subject-summary.detail .summary-detail { font-size: 16px; line-height: 1.55; max-width: 68ch; }

/* Result history */
.results { list-style: none; margin: 0 0 12px; padding: 0; display: grid; }
.result { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hairline); align-items: start; }
.result:first-child { border-top: 0; padding-top: 0; }
.result .date i { display: block; font-style: normal; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.result-main h3 { font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.result-main p { font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.result-main .correction { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.result-score { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.grade.NA { color: var(--mute); background: var(--canvas-soft); border-color: var(--hairline); }
.chip .count { color: inherit; opacity: 0.8; }
.chip.wrap { white-space: normal; }

/* Quarters: a subject is a timeline of grading periods (DESIGN.md, Quarters) */
.quarter-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.graded-count { margin: 0; }
.qdelta { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 400; }
.qdelta-up { color: var(--ok); } .qdelta-down { color: var(--bad); } .qdelta-flat { color: var(--mute); }
.quarter-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quarter-tile { display: grid; gap: 8px; align-content: start; justify-items: start; min-width: 0; padding: 14px 16px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-1); }
.quarter-tile.current { border-color: var(--primary); }
.quarter-tile.upcoming { background: var(--canvas-soft); box-shadow: none; border-style: dashed; }
.quarter-name { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.quarter-status { font-size: 13px; color: var(--mute); }
.quarter-score { display: flex; align-items: center; gap: 8px; }
.quarter-score strong { font-size: 22px; font-weight: 300; letter-spacing: -0.22px; }
.quarter-tile .chip { white-space: normal; }
@media (max-width: 720px) { .quarter-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quarter-table-wrap { overflow-x: auto; max-width: 100%; }
.quarter-table-wrap:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.quarter-table { min-width: 560px; }
.quarter-table th { white-space: normal; vertical-align: bottom; }
.quarter-table th[scope="row"] { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 400; padding: 10px 8px 10px 0; border-top: 1px solid var(--hairline); white-space: normal; overflow-wrap: anywhere; }
.quarter-table td:last-child, .quarter-table th:last-child { text-align: left; padding-right: 0; }
.qavg { display: inline-flex; align-items: center; gap: 8px; }
.qcell small { display: block; margin-top: 2px; }
.quarter-group + .quarter-group { margin-top: 20px; }
.quarter-heading { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h)); z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 8px 0; font-size: 15px; font-weight: 500; color: var(--ink); background: var(--canvas); border-bottom: 1px solid var(--hairline); }
.quarter-heading strong { font-weight: 300; font-size: 18px; }

/* Attendance calendar */
.att-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 880px) { .att-layout { grid-template-columns: minmax(0, 1fr); } }
.month-nav { display: flex; gap: 4px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); text-align: center; padding-bottom: 4px; }
.cal-day, .cal-blank { aspect-ratio: 1 / 1; min-height: 44px; border-radius: 8px; }
.cal-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid var(--hairline); background: var(--canvas); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 300; padding: 2px;
}
.cal-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
button.cal-day { cursor: pointer; }
button.cal-day:hover { background: var(--primary-tint); }
.cal-day.selected { background: var(--primary-tint); border-color: var(--primary); }
.mark {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 500; line-height: 1;
  border: 1px solid transparent; flex: none;
}
.mark.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.mark.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.mark.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.mark.plain { color: var(--primary); background: var(--primary-tint); border-color: var(--primary-soft); }
/* A school day the report leaves out (green) and an official day without school (grey): meaning is also in the aria-label and the legend. */
.mark.ok:empty { width: 12px; height: 12px; background: var(--ok); border-color: var(--ok); }
.mark.off { color: var(--mute); background: var(--canvas-soft); border-color: var(--hairline); }
.cal-day.no-school { background: var(--canvas-soft); color: var(--mute); border-style: dashed; }
.cal-day.disputed .mark { outline: 2px dashed var(--primary); outline-offset: 2px; }
.cal-day .conf { position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; color: var(--ok); }
.cal-day .conf svg, .conf-key svg { width: 100%; height: 100%; }
.legend { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.conf-key { width: 12px; height: 12px; color: var(--ok); display: inline-block; }
.ring-key { width: 14px; height: 14px; border-radius: 50%; outline: 2px dashed var(--primary); outline-offset: 1px; display: inline-block; margin: 0 2px; }
.today-key { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--primary); box-shadow: inset 0 0 0 1px var(--primary); display: inline-block; }
.day-detail { display: grid; gap: 16px; }
.incident { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 10px; }
.incident-title { font-size: 15px; font-weight: 400; color: var(--ink); overflow-wrap: anywhere; }
.incident .code { font-family: var(--mono); font-size: 13px; color: var(--primary); background: var(--primary-tint); padding: 1px 8px; border-radius: 6px; margin-right: 6px; }
.periods { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; color: var(--mute); }
.confirm { display: grid; gap: 12px; border-top: 1px dashed var(--hairline); padding-top: 16px; }
.confirm h3 { font-size: 17px; letter-spacing: -0.1px; }
.saved { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.field textarea {
  min-height: 40px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--canvas); color: var(--ink);
  font: inherit; font-weight: 300; font-size: 14px; width: 100%; resize: vertical;
}
.field textarea::placeholder { color: var(--mute); }
.field textarea:focus { border-color: var(--primary); outline-offset: 0; }
.error { font-size: 13px; color: var(--bad); }

/* Topics by subject */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; align-items: start; }

/* Report health */
.explain { list-style: none; margin: 0; padding: 0; display: grid; }
.explain li { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--hairline); }
.explain li:first-child { border-top: 0; padding-top: 0; }
.explain h3 { font-size: 15px; font-weight: 400; }
.explain p { font-size: 14px; color: var(--mute); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; }
.setting { display: grid; gap: 12px; }
.setting p { font-size: 15px; color: var(--ink-2); }
.setting code { font-family: var(--mono); font-size: 13px; color: var(--primary); background: var(--primary-tint); padding: 1px 8px; border-radius: 6px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.people li { display: flex; gap: 12px; align-items: flex-start; }
.people h3 { font-size: 17px; letter-spacing: -0.1px; }
.people p { font-size: 13px; color: var(--mute); }
.state-card.inline { margin-inline: auto; }

footer .wrap { padding-block: 24px 40px; font-size: 12px; color: var(--mute); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Full-page states: loading, signed out, empty, error */
.state { min-height: 56vh; display: grid; place-items: center; padding-block: 48px; }
.state-card {
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-2);
  padding: 32px 28px; max-width: 520px; display: grid; gap: 14px; justify-items: start;
}
.state-card h1 { font-size: clamp(26px, 4vw, 32px); line-height: 1.15; letter-spacing: -0.64px; }
.state-card p { font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.state-card code { font-family: var(--mono); font-size: 14px; color: var(--primary); background: var(--primary-tint); padding: 2px 8px; border-radius: 6px; }
.skeleton { width: 100%; max-width: 680px; display: grid; gap: 12px; }
.skeleton span { display: block; height: 18px; border-radius: 9999px; background: var(--hairline); }
.skeleton span:first-child { width: 40%; height: 28px; }
.skeleton span:last-child { width: 70%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton span { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.45; } }
  .projection strong { transition: color 0.2s ease; }
}

@media (max-width: 720px) {
  /* One row: hamburger, brand, who the page is about, the account. The sections are in the drawer, not in a second scrolling row. */
  :root { --topbar-h: 61px; }
  .topbar-row { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "menu brand student end"; gap: 8px 12px; padding-block: 8px; }
  .topbar-end { justify-self: end; min-width: 0; }
  .nav { display: none; }
  .nav-menu { display: flex; }
  .drawer:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 30; }
  html.nav-locked, html.nav-locked body { overflow: hidden; }
  .result { grid-template-columns: 52px minmax(0, 1fr); }
  .result-score { grid-column: 2; }
}
@media (max-width: 520px) {
  .wordmark span { display: none; }
  .ctx-name { max-width: 12ch; }
  .cal-day, .cal-blank { min-height: 40px; }
  .wrap { padding-inline: 16px; }
  .projection strong { font-size: 22px; }
  .projection div { padding: 12px 10px; }
  .panel-head, .panel-body { padding-inline: 16px; }
  .hero .wrap { padding-block: 40px 24px; }
  .state-card { padding: 24px 20px; }
}

/* Family: members, invitations, activity */
.family-grid { display: grid; gap: 24px; }
@media (min-width: 881px) { .family-grid { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; } }
.family-grid .panel:first-child { grid-column: 1 / -1; }
#family-root > .saved { min-height: 20px; margin-bottom: 8px; }
#family-root > .error { margin-bottom: 8px; }
.member-list li.member { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.member-list li.member:last-child { border-bottom: 0; padding-bottom: 0; }
.member-main { flex: 1 1 240px; min-width: 0; display: grid; gap: 4px; }
.member-main h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.member-main p { overflow-wrap: anywhere; }
.member-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.member-actions .field { min-width: 150px; }
.confirm-inline { display: grid; gap: 10px; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--canvas-soft); }
.confirm-inline p { font-size: 14px; color: var(--ink-2); }
.link-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-box input {
  flex: 1 1 260px; min-width: 0; min-height: 40px; padding: 6px 10px; border: 1px solid var(--hairline); border-radius: 6px;
  background: var(--canvas); color: var(--ink); font-family: var(--mono); font-size: 13px;
}
.link-box input:focus { border-color: var(--primary); outline-offset: 0; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.events li { display: flex; gap: 12px; align-items: baseline; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.event-at { flex: none; min-width: 88px; font-size: 12px; color: var(--mute); }
@media (max-width: 520px) { .events li { flex-direction: column; gap: 2px; } .member-actions { width: 100%; } }

/* Setup wizard, pending students, Gmail keys */
.banners { display: grid; gap: 12px; margin-bottom: 20px; }
.banner .btn { align-self: center; }
.wizard { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 760px; }
.wizard-step { background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-1); padding: 18px 22px; display: grid; gap: 12px; min-width: 0; }
.wizard-step.current { border-color: var(--primary-soft); }
.wizard-step.done { background: var(--canvas-soft); box-shadow: none; }
.wizard-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wizard-head h2 { flex: 1 1 200px; font-size: 20px; letter-spacing: -0.2px; line-height: 1.25; }
.step-num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--primary-tint); color: var(--primary); font-size: 14px;
}
.wizard-step.done .step-num { background: var(--ok-bg); color: var(--ok); }
.wizard-body { display: grid; gap: 14px; min-width: 0; }
.wizard-body p { font-size: 15px; color: var(--ink-2); }
.wizard-text { margin: 0; }
.done-card { margin-bottom: 20px; justify-items: start; text-align: left; }
.gmail-controls { display: grid; gap: 12px; min-width: 0; }
.key-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.script-box, .key-box { display: grid; gap: 10px; min-width: 0; }
.key-box .field label { font-size: 14px; color: var(--ink-2); }
.wizard-step.info { background: var(--canvas-soft); box-shadow: none; }
.gmail-note { padding: 10px 12px; border: 1px solid var(--warn-line); border-radius: 10px; background: var(--warn-bg); font-size: 14px; color: var(--ink-2); }
.gmail-note strong { font-weight: 500; color: var(--ink); }
.script-box textarea { font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre; overflow: auto; min-height: 180px; }
/* Gmail setup: controls and script on the left, the numbered guide on the right; stacked on narrow screens */
.settings-grid .span-all { grid-column: 1 / -1; }
.gmail-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px 28px; align-items: start; }
@media (max-width: 900px) { .gmail-controls { grid-template-columns: minmax(0, 1fr); } }
.gmail-main { display: grid; gap: 12px; min-width: 0; }
.gmail-guide { min-width: 0; }
.gsteps { list-style: none; margin: 14px 0 10px; padding: 0; display: grid; gap: 14px; counter-reset: none; }
.gstep { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.gstep-n {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-tint); color: var(--primary); font-weight: 500; font-size: 13px;
}
.gstep-body { display: grid; gap: 4px; min-width: 0; }
.gstep-body strong { font-weight: 500; font-size: 15px; color: var(--ink); }
.gstep-body p { font-size: 14px; color: var(--ink-2); }
.gstep-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gstep-links svg { width: 10px; height: 10px; }
.guide { border: 1px solid var(--hairline); border-radius: 10px; padding: 12px 16px; background: var(--canvas-soft); }
.guide summary { cursor: pointer; font-size: 15px; color: var(--ink); }
.guide ol { margin: 12px 0 8px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.pending-students { display: grid; gap: 12px; }
.pending-card { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--warn-line); border-radius: 10px; background: var(--warn-bg); }
.pending-card h3 { font-size: 17px; letter-spacing: -0.1px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.pending-card p { font-size: 14px; color: var(--ink-2); }
.merge-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.merge-row .field { flex: 1 1 220px; min-width: 0; }
.subhead { font-size: 16px; letter-spacing: -0.1px; margin-top: 4px; }

/* Reportes: filters (chips, segmented controls, date range picker, active filters, phone sheet), log table, paginator */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.reports-toolbar { display: grid; gap: 14px; margin-bottom: 18px; }
.reports-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 28px; align-items: start; }
.sheet-head, .filters-toggle, .sheet-backdrop { display: none; }
.rf-group { display: grid; gap: 8px; min-width: 0; align-content: start; }
.rf-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }

/* chip group: an initial in a disc and a name; a toggle, not a link */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip {
  font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 14px 4px 4px;
  color: var(--ink-2); background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: 9999px; cursor: pointer; text-align: left;
}
.fchip:hover { color: var(--ink); border-color: var(--primary-soft); }
.fchip[aria-pressed="true"] { background: var(--primary-tint); color: var(--ink); border-color: var(--primary); }
.fchip-av { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 500; background: var(--canvas); border: 1px solid var(--hairline); }
.tone-0 { color: var(--primary); }
.tone-1 { color: var(--ok); }
.tone-2 { color: var(--warn); }
.tone-3 { color: var(--bad); }
.tone-none { color: var(--mute); border-style: dashed; }
.fchip[aria-pressed="true"] .fchip-av { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.fchip-note { font-size: 12px; color: var(--mute); }
.fchip.is-active { padding: 4px 12px 4px 14px; background: var(--primary-tint); border-color: var(--primary); color: var(--ink); }

/* segmented control: one choice, "all" first */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; justify-self: start; background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: 12px; }
.seg-btn { font: inherit; font-size: 14px; min-height: 32px; padding: 4px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--mute); cursor: pointer; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"], .seg-btn[aria-checked="true"] { background: var(--canvas); color: var(--ink); box-shadow: 0 0 0 1px var(--primary) inset; }
.seg-btn:disabled { opacity: 0.55; cursor: default; }

/* date range picker: a button that opens a dialog with shortcuts and a calendar built here (no library) */
.rpicker { position: relative; }
.range-btn {
  font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px;
  color: var(--ink); background: var(--canvas); border: 1px solid var(--hairline); border-radius: 10px; cursor: pointer;
}
.range-btn:hover, .range-btn[aria-expanded="true"] { border-color: var(--primary); }
.range-pop {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 16px;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-2); max-width: min(720px, calc(100vw - 32px));
}
.range-presets { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; align-content: start; min-width: 150px; }
.preset { font: inherit; font-size: 14px; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.preset:hover { background: var(--canvas-soft); color: var(--ink); }
.preset[aria-pressed="true"] { background: var(--primary-tint); color: var(--ink); }
.range-cal { display: grid; gap: 10px; min-width: 0; }
.cal-nav { display: flex; justify-content: space-between; }
.cal-months { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.cal-month { min-width: 224px; flex: 1 1 224px; }
.cal-title { font-size: 15px; font-weight: 400; text-align: center; margin-bottom: 6px; }
.cal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-grid th { font-size: 11px; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute); padding: 4px 0; }
.cal-grid td { padding: 1px 0; text-align: center; }
.cal-day { font: inherit; font-size: 13px; width: 100%; max-width: 36px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.cal-day:hover:not(:disabled) { background: var(--canvas-soft); }
.cal-day:disabled { color: var(--mute); opacity: 0.4; cursor: default; }
.cal-day.is-in { background: var(--primary-tint); border-radius: 0; }
.cal-day.is-start, .cal-day.is-end, .cal-day.is-pending { background: var(--primary); color: var(--on-primary); border-radius: 8px; }
.cal-day.is-today { box-shadow: 0 0 0 1px var(--primary) inset; }
.range-hint { margin: 0; min-height: 1.4em; }
.range-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* what is filtered, removable one by one */
.rf-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rf-active-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* the log */
.table-wrap { overflow-x: auto; }
.reports-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.reports-table th { text-align: left; font-size: 11px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); padding: 0 12px 10px 0; }
.reports-table td { padding: 12px 12px 12px 0; border-top: 1px solid var(--hairline); vertical-align: top; overflow-wrap: anywhere; }
.reports-table tr:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.log-error { margin-top: 4px; color: var(--bad); overflow-wrap: anywhere; }
.srcs { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.src-copies { white-space: nowrap; }
.src-more { cursor: help; font-size: 12px; color: var(--primary); background: var(--primary-tint); border-radius: 9999px; padding: 1px 8px; }
.src-pop {
  display: none; position: absolute; z-index: 2; top: 100%; left: 0; min-width: 220px; margin-top: 6px; padding: 10px 12px;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: 8px; box-shadow: var(--shadow-2);
}
.srcs:hover .src-pop, .srcs:focus-within .src-pop { display: grid; gap: 6px; }
.src-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.log-state { display: grid; gap: 10px; justify-items: start; padding: 8px 0; font-size: 14px; }
.table-wrap.is-loading { opacity: 0.6; }
#reports-caption:focus { outline: none; }

/* the paginator: range, rows per page, previous / next (keyset: no page numbers to jump to) */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.pager-range { margin: 0; font-size: 14px; color: var(--ink-2); }
.pager-size { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--mute); }
.pager-nav { display: flex; gap: 8px; }

@media (prefers-reduced-motion: no-preference) {
  .table-wrap { transition: opacity 0.15s ease; }
  .reports-filters.is-open { animation: sheet-in 0.2s ease-out; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 720px) {
  .filters-toggle { display: inline-flex; justify-self: start; }
  .reports-filters { display: none; }
  .reports-filters.is-open {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto;
    padding: 0 16px 28px; background: var(--canvas); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-2);
  }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; padding: 14px 0 8px; background: var(--canvas); }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(6, 27, 49, 0.5); }
  .range-pop { position: static; grid-template-columns: minmax(0, 1fr); margin-top: 8px; box-shadow: none; max-width: none; }
  .range-presets { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .cal-month { min-width: 0; }
  .pager { justify-content: center; }
  .reports-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .reports-table, .reports-table tbody, .reports-table tr, .reports-table td { display: block; }
  .reports-table tr { border: 1px solid var(--hairline); border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; background: var(--canvas); }
  .reports-table td { position: relative; border-top: 0; padding: 6px 0 6px 98px; min-height: 32px; }
  .reports-table td::before { content: attr(data-label); position: absolute; left: 0; top: 9px; width: 88px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
  .src-pop { position: static; box-shadow: none; flex-basis: 100%; }
}

/* FAST results (fast.js): the student picker, the subject tabs and their parts, the upload dialog and its files, and the cut-score bar */
.fast-students { margin-top: -8px; }
a.fchip { text-decoration: none; }
a.fchip[aria-current="page"] { background: var(--primary-tint); color: var(--ink); border-color: var(--primary); }
a.fchip[aria-current="page"] .fchip-av { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.fast-empty .panel-body { display: grid; gap: 14px; }
.fast-empty .panel-body > p, .fast-body > p { margin: 0; }
.fast-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.fast-drop {
  display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 124px; padding: 24px 16px; text-align: center;
  color: var(--ink-2); background: var(--canvas-soft); border: 2px dashed var(--primary-soft); border-radius: 12px; cursor: pointer;
}
.fast-drop:hover, .fast-drop.is-dragging { background: var(--primary-tint); border-color: var(--primary); }
.fast-file-input:focus-visible + .fast-drop { outline: 2px solid var(--primary); outline-offset: 2px; }
.fast-drop-title { font-size: 18px; color: var(--ink); }
.fast-drop-sub { font-size: 14px; }
.fast-files:empty { display: none; }
.fast-files { display: grid; gap: 10px; }
.fast-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fast-file { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 10px; min-width: 0; }
.fast-file-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fast-file-name { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.fast-file-msg { margin: 0; font-size: 14px; color: var(--ink-2); }
.fast-file-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fast-file progress { width: 100%; height: 6px; accent-color: var(--primary); }
.fast-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.fast-score { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fast-score-num { font-size: clamp(36px, 8vw, 48px); font-weight: 300; line-height: 1; letter-spacing: -0.96px; }
.fast-pct { font-size: 14px; color: var(--ink-2); }
.fast-bar-wrap { display: grid; gap: 8px; }
.fast-bar { position: relative; height: 14px; margin-block: 6px; border-radius: 9999px; background: var(--hairline); }
.fast-seg { position: absolute; top: 0; bottom: 0; }
.fast-seg + .fast-seg { box-shadow: -1px 0 0 var(--canvas); }
.fast-bar > .fast-seg:first-child { border-radius: 9999px 0 0 9999px; }
.fast-bar > .fast-seg:nth-last-child(2) { border-radius: 0 9999px 9999px 0; }
.fast-seg.s1 { background: var(--bad-line); }
.fast-seg.s2 { background: var(--warn-line); }
.fast-seg.s3 { background: var(--ok-bg); }
.fast-seg.s4 { background: var(--ok-line); }
.fast-seg.s5 { background: var(--ok); }
.fast-marker { position: absolute; top: -6px; width: 4px; height: 26px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--canvas); }
.fast-meter { height: 10px; border-radius: 9999px; background: var(--hairline); overflow: hidden; }
.fast-meter-fill { display: block; height: 100%; border-radius: 9999px; background: var(--ok-line); }
.fast-cuts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.fast-note { padding: 12px 14px; font-size: 14px; color: var(--ink-2); background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: 10px; }
.fast-summary ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 15px; }
.fast-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fast-cat { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 10px; min-width: 0; }
.fast-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fast-cat-name { font-size: 15px; overflow-wrap: anywhere; }
.fast-items { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; font-size: 13px; color: var(--ink-2); }
.fast-items div { display: flex; gap: 6px; }
.fast-items dt { color: var(--mute); }
.fast-items dd { margin: 0; }
.fast-link { font-size: 14px; }
/* FAST insights: the parts of a subject card, the level and percentile charts, the gaps and the upload archive */
.fast-part { display: grid; gap: 12px; min-width: 0; }
.fast-part > h3, .fast-part h4 { margin: 0; }
.fast-part p { margin: 0; }
.fast-chart { margin: 0; display: grid; gap: 8px; min-width: 0; }
.fast-chart svg { width: 100%; height: auto; max-width: 560px; overflow: visible; }
.fast-grid { stroke: var(--hairline); stroke-width: 1; }
.fast-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fast-tick, .fast-xl, .fast-axis { fill: var(--mute); font-size: 12px; }
.fast-xl-year { fill: var(--ink-2); }
/* PM3 (the end-of-year result) is a filled circle; PM1 and PM2 (informational) are hollow, so they never read as final */
.fast-pt { fill: var(--primary); stroke: var(--primary); stroke-width: 2; }
.fast-pt[data-kind="informational"] { fill: var(--canvas); }
.fast-legend { color: var(--ink-2); }
.fast-archive { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fast-entry { border: 1px solid var(--hairline); border-radius: 10px; min-width: 0; }
.fast-entry summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 14px; cursor: pointer; }
.fast-entry summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
.fast-entry-main { display: grid; gap: 2px; min-width: 0; }
.fast-entry-title { font-size: 15px; overflow-wrap: anywhere; }
.fast-entry-body { display: grid; gap: 14px; padding: 0 14px 14px; }
.fast-entry-body p { margin: 0; }
/* The plan of a subject: strengths first, then the priorities, then the habits. The grade question sits above the tabs. */
.fast-part .panel-body, .fast-grade .panel-body { display: grid; gap: 10px; }
.fast-part .panel-body p, .fast-grade p, .fast-cross p { margin: 0; }
.fast-plan-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
ul.fast-plan-list { list-style: none; padding-left: 0; }
.fast-narration { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.fast-narration p { overflow-wrap: anywhere; }
.fast-plan-item { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.fast-plan-name { font-weight: 600; }
/* Topics to practice under a weak category: a hairline-bordered list, links as 44px targets. */
.fast-practice { display: grid; gap: 6px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 10px; }
.fast-practice h4, .fast-practice p { margin: 0; }
.fast-practice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fast-practice-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; overflow-wrap: anywhere; }
.fast-practice-links { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.fast-practice-links .fast-link { display: inline-flex; align-items: center; min-height: 44px; }
.fast-grade-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fast-grade-form select { min-height: 44px; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--canvas); color: inherit; font: inherit; }
.fast-grade-form select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.fast-grade-error, .fast-delete-error { color: var(--bad, currentColor); font-weight: 600; }
.fast-entry-actions { margin: 12px 0 0; }
.fast-cross summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.fast-cross summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
.fast-cross-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.fast-cross-table th, .fast-cross-table td { border: 1px solid var(--hairline); padding: 10px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.fast-cross-table td.is-seen { background: var(--primary-tint, transparent); }
/* Header: the upload button next to the title, and one chip per subject */
.fast-upload-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.fast-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fast-chips .chip { font-size: 14px; }
.fast-honor { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--ok-line); background: var(--ok-bg); border-radius: 10px; }
.fast-honor .fine { color: var(--ink-2); }
/* The upload banner of the open FAST window */
.fast-reminder { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 10px; }
.fast-reminder a { justify-self: start; }
/* Tabs: one per subject, the selected one underlined; the panels are stacks of parts */
/* A row of tabs slides sideways on a narrow screen, like the nav: it scrolls, but never shows a bar. overflow-y is hidden on purpose:
   overflow-x alone turns the other axis to auto, and the tab's -1px margin (its underline over the hairline) then reads as a vertical
   overflow, which Windows draws as a bar. */
.fast-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.fast-tabs::-webkit-scrollbar { display: none; }
.fast-tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 12px 16px; min-height: 44px; font: inherit; color: var(--mute); cursor: pointer; white-space: nowrap; }
.fast-tab:hover { color: var(--ink); }
.fast-tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--primary); }
.fast-tab:focus-visible, .fast-panel:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 8px; }
.fast-panel { display: grid; gap: 16px; min-width: 0; }
.fast-panel[hidden] { display: none; }
/* Today: the level and the percentile, big */
.fast-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.fast-hero-item { display: grid; gap: 6px; align-content: start; justify-items: start; min-width: 0; }
.fast-hero-num { font-size: clamp(40px, 9vw, 56px); font-weight: 300; line-height: 1; letter-spacing: -0.96px; }
.fast-class-line { font-size: 16px; overflow-wrap: anywhere; }
.fast-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fast-reason { display: flex; align-items: flex-start; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.fast-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* The reports uploaded: one collapsed panel */
.fast-archive-box > summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer; font-weight: 600; }
.fast-archive-box > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
.fast-archive-box[open] > summary { border-bottom: 1px solid var(--hairline); }
.fast-archive-box > .panel-body { padding-top: 14px; }
/* The upload dialog: centered on a wide screen, a bottom sheet on a phone */
.fast-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(6, 27, 49, 0.5); }
.fast-dialog { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); border-radius: 14px; }
.fast-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--canvas); border-bottom: 1px solid var(--hairline); }
.fast-dialog-head h2 { margin: 0; font-size: 18px; }
.fast-dialog-body { position: relative; display: grid; gap: 12px; padding: 20px; }
@media (max-width: 720px) {
  .fast-dialog { left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto; max-height: 85dvh; border-radius: 14px 14px 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .fast-drop { transition: background 0.15s ease, border-color 0.15s ease; }
  .fast-dialog { animation: fast-dialog-in 0.18s ease-out; }
  @keyframes fast-dialog-in { from { opacity: 0; } to { opacity: 1; } }
}
@media (max-width: 520px) {
  .fast-file-actions .btn { flex: 1 1 100%; justify-content: center; }
  .fast-drop { padding: 20px 12px; }
}

/* ---------- platform admin (#admin) ---------- */
.admin-groups { display: grid; gap: 24px; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.admin-row, .admin-audit-row { padding: 14px 0; border-top: 1px solid var(--hairline); min-width: 0; }
.admin-row:first-child, .admin-audit-row:first-child { border-top: 0; padding-top: 0; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-key { font-family: "Source Code Pro", monospace; font-size: 13px; overflow-wrap: anywhere; }
.admin-value { margin: 6px 0 0; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.admin-meta { margin: 4px 0 0; font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.admin-form { display: grid; gap: 14px; margin-top: 14px; padding: 16px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); }
.admin-form textarea, .admin-form input[type="text"], .admin-form input[type="number"], .admin-dialog input[type="text"] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
.admin-form textarea { font-family: "Source Code Pro", monospace; font-size: 13px; }
.admin-error { margin: 0; color: var(--bad); font-size: 14px; }
.admin-op { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--hairline); min-width: 0; }
.admin-op:first-of-type { border-top: 0; padding-top: 0; }
.admin-op input[type="text"], .admin-op input[type="number"] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
.admin-op h3, .admin-op h4, .panel-body > h3 { margin: 0; font-size: 15px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 6px 8px; text-align: left; border-top: 1px solid var(--hairline); overflow-wrap: anywhere; }
.admin-table thead th { border-top: 0; color: var(--mute); font-weight: 600; }
.admin-table tr[data-failing="true"] { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.admin-list progress { width: 120px; vertical-align: middle; }
/* The tabs reuse the FAST tablist; the page never scrolls sideways, the tablist does */
.admin-tabs { margin: 0 0 20px; max-width: 100%; }
.admin-panel > .admin-tabs { margin-top: 12px; }
.admin-panel { align-content: start; }
/* Estado: the numbers to look at first */
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.admin-tile { display: grid; gap: 4px; align-content: start; min-width: 0; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); box-shadow: var(--shadow-1); }
.admin-tile-label { font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.admin-tile-num { font-size: clamp(26px, 6vw, 32px); font-weight: 300; line-height: 1.1; letter-spacing: -0.5px; color: var(--ink); }
.admin-tile-note { font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.admin-tile[data-tone="bad"] { border-color: var(--bad-line); background: var(--bad-bg); }
.admin-tile[data-tone="bad"] .admin-tile-num { color: var(--bad); }
.admin-tile[data-tone="warn"] { border-color: var(--warn-line); background: var(--warn-bg); }
.admin-tile[data-tone="warn"] .admin-tile-num { color: var(--warn); }
.admin-tile[data-tone="ok"] .admin-tile-num { color: var(--ok); }
.admin-table-wrap { overflow-x: auto; }
.admin-tile-link { text-decoration: none; color: inherit; }
.admin-tile-link:hover { border-color: var(--primary); }
.admin-tile-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Familias: the funnel of each family, one column per step; a stuck family is marked by its row, never by colour alone (the chip says it too) */
.admin-families { min-width: 880px; }
.admin-families tr[data-status="stuck"] { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.admin-families td, .admin-families th { vertical-align: top; }
.admin-mark { font-weight: 700; color: var(--mute); }
.admin-mark-done { color: var(--ok); }
/* Configuración: the secrets and wiring, collapsed at the end */
.admin-readonly { background: var(--canvas); border: 1px solid var(--hairline); border-radius: 12px; min-width: 0; }
.admin-readonly > summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer; font-weight: 600; }
.admin-readonly > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
.admin-readonly[open] > summary { border-bottom: 1px solid var(--hairline); }
.admin-readonly > .admin-meta, .admin-readonly > .admin-list { padding: 0 16px; }
.admin-readonly > .admin-list { padding-bottom: 14px; }
.admin-readonly > .admin-meta { padding-top: 12px; }
.admin-readonly .admin-row:first-child { padding-top: 14px; border-top: 0; }
/* Historial: the filter chips */
.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.admin-filter[aria-pressed="true"] { background: var(--primary-tint); color: var(--primary); border-color: var(--primary); font-weight: 600; }
/* Configuración: a settings page. Search on top, a nav of sections on the left (a scrolling row on a phone) and rows, not cards: label, key and
   help on the left, the control on the right. The list itself is the settings list of Avisos and Cuenta (.settings-group / .settings-row). */
.admin-settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.admin-settings-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.admin-search { flex: 1 1 280px; max-width: 420px; min-width: 0; }
.admin-search .settings-input { width: 100%; }
.admin-settings-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.admin-settings-nav { min-width: 0; }
.admin-settings-main { display: grid; gap: 8px; min-width: 0; align-content: start; }
.admin-settings-nav ul { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.admin-settings-nav ul::-webkit-scrollbar { display: none; }
.admin-nav-btn { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--hairline); border-radius: 9999px; background: var(--canvas-soft); color: var(--ink-2); font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; }
.admin-nav-btn:hover { background: var(--primary-tint); color: var(--primary); }
.admin-nav-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.admin-nav-count { font-size: 12px; color: var(--mute); }
.admin-section { scroll-margin-top: 96px; }
.admin-section .settings-group-title:focus, .admin-readonly > summary:focus { outline: none; }
.admin-section-desc { margin: 0 4px 2px; font-size: 13px; color: var(--mute); }
.admin-srow { flex-wrap: wrap; align-items: flex-start; }
.admin-srow .settings-row-text { flex: 1 1 260px; gap: 3px; }
.admin-srow .settings-row-control { flex: none; align-self: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-srow .admin-key { color: var(--mute); font-size: 12px; }
.admin-key-lead { color: var(--ink); font-size: 13px; }
.admin-row-meta { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; }
.admin-row-meta .chip { font-size: 11px; padding: 1px 8px; }
.admin-row-meta .admin-meta { margin: 0; }
.admin-row-note { margin: 4px 0 0; justify-self: start; }
.admin-revert { justify-self: start; margin-top: 4px; }
.admin-requires { margin: 2px 0 0; font-size: 13px; color: var(--mute); }
.admin-requires[data-unmet="true"] { color: var(--warn-strong); }
.admin-srow[data-dep-unmet="true"] .settings-row-label { color: var(--ink-2); }
.admin-srow-sub .settings-row-text { margin-left: 8px; padding-left: 14px; border-left: 2px solid var(--hairline); }
.admin-srow-form { flex: 1 1 100%; min-width: 0; }
.admin-srow-form .admin-form { margin: 0; padding: 12px 0 0; border: 0; border-top: 1px dashed var(--hairline); border-radius: 0; background: none; }
.admin-setting-value { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.admin-unit { font-size: 13px; color: var(--mute); }
.admin-input-unit { display: flex; align-items: center; gap: 8px; }
.admin-input-unit input[type="number"] { width: 140px; }
/* The switch: a real button (role="switch"), the state in words next to the track so it never relies on colour */
.admin-switch { appearance: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; }
.admin-switch-track { position: relative; flex: none; width: 42px; height: 24px; border: 1px solid var(--hairline); border-radius: 9999px; background: var(--canvas-soft); transition: background 0.15s; }
.admin-switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--mute); transition: transform 0.15s; }
.admin-switch[aria-checked="true"] { color: var(--ink); }
.admin-switch[aria-checked="true"] .admin-switch-track { border-color: var(--primary); background: var(--primary); }
.admin-switch[aria-checked="true"] .admin-switch-thumb { background: var(--on-primary); transform: translateX(18px); }
.admin-switch[data-pending="true"] .admin-switch-track { border-style: dashed; }
.admin-switch-text { min-width: 5.5em; text-align: left; }
.admin-switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 9999px; }
.admin-switch:disabled { cursor: default; opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .admin-switch-track, .admin-switch-thumb { transition: none; } }
@media (min-width: 840px) {
  .admin-settings-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
  .admin-settings-nav { position: sticky; top: calc(var(--topbar-h) + 32px); }
  .admin-settings-nav ul { flex-direction: column; overflow: visible; padding: 0; gap: 2px; }
  .admin-nav-btn { width: 100%; justify-content: space-between; border-color: transparent; background: none; border-radius: 8px; }
}
@media (max-width: 520px) {
  .admin-srow .settings-row-control { flex: 1 1 100%; justify-content: flex-start; }
  .admin-input-unit input[type="number"] { flex: 1 1 auto; width: auto; min-width: 0; }
}


/* Actividades (#admin/actividades): the catalog of the home activities. Reuses the settings rows, the chips and the admin tables. */
.act-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0; }
.act-toolbar .admin-filters, .act-toolbar .admin-actions { margin: 0; }
.act-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; margin: 0 0 16px; }
.act-filters .field { min-width: 0; }
.act-filters input, .act-form input[type="text"], .act-form input[type="number"], .act-form input[type="search"], .act-reason input[type="text"], .act-dialog input[type="text"], .act-dialog textarea, .act-form textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
.act-filters input[type="search"] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
.act-filters select, .act-form select { width: 100%; }
.act-dialog textarea { font-family: "Source Code Pro", monospace; font-size: 13px; }
.act-group { margin: 0 0 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); min-width: 0; }
.act-group > summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer; font-weight: 600; }
.act-group > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }
.act-group[open] > summary { border-bottom: 1px solid var(--hairline); }
.act-group > .settings-group { border: 0; border-radius: 0; }
.act-editor { display: grid; gap: 14px; min-width: 0; }
.act-editor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.act-editor-head h3 { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.act-form { display: grid; gap: 14px; min-width: 0; }
.act-form h4 { margin: 8px 0 0; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.act-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: start; }
.act-pair { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); min-width: 0; }
.act-pair-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.act-pair-cols > div { min-width: 0; display: grid; gap: 8px; align-content: start; }
.act-pair > .btn { justify-self: start; }
.act-lang { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--mute); }
.act-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--ink-2); }
.act-validation { padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas-soft); min-width: 0; }
.act-validation p { margin: 0; }
.act-problems { margin-top: 6px; }
.act-problems li, .act-changes li { padding: 4px 0; font-size: 13px; overflow-wrap: anywhere; }
.act-reason { margin: 0; }
.act-panel { display: grid; gap: 12px; min-width: 0; align-content: start; }
.act-frame { width: 100%; height: 420px; border: 1px solid var(--hairline); border-radius: 12px; background: #fff; }
.act-matrix { min-width: 560px; }
.act-matrix th[scope="row"] { white-space: nowrap; }
.act-matrix td { text-align: center; }
.act-matrix .act-miss { background: var(--bad-bg); color: var(--bad); }
.act-matrix .act-na { background: var(--canvas-soft); }
.act-dialog { width: min(720px, calc(100vw - 32px)); }
.act-dialog .admin-list { max-height: 220px; overflow: auto; }
@media (min-width: 720px) { .act-pair-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }


/* Configuración: one section with tabs. The tablist is the FAST one (it scrolls sideways on a phone without showing a bar), a strip on
   top says whether everything is connected, and each tab is a stack of panels. */
.settings-tabs { margin: 0 0 20px; max-width: 100%; }
.settings-panel { align-content: start; gap: 20px; }
.settings-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--ok-line); border-radius: 12px; background: var(--ok-bg); }
.settings-strip p { flex: 1 1 240px; min-width: 0; margin: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.settings-strip.ok p { color: var(--ok); font-weight: 500; }
.settings-strip.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.strip-mark { font-weight: 600; }
.settings-panel .seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; }
.settings-panel .seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.settings-panel .seg-btn .mi { width: 16px; height: 16px; color: inherit; }
/* Estudiantes: master-detail. A list on the left, the open student on the right; under 840px one pane at a time (data-view). */
.students-master { display: grid; gap: 20px; min-width: 0; }
.students-list-pane, .student-detail { min-width: 0; display: grid; gap: 12px; align-content: start; }
.students-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.student-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); color: var(--ink); text-decoration: none; }
.student-row:hover { background: var(--primary-tint); }
.student-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.student-row-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.student-row-name { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.student-row-name .chip { margin-left: 4px; vertical-align: middle; }
.student-row-sub { font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.student-row > .chip { flex: none; max-width: 42%; white-space: normal; text-align: center; }
.students-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 500; color: var(--primary); text-decoration: none; }
.students-back:hover { text-decoration: underline; }
.students-back:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.student-detail-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.student-detail-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 20px; letter-spacing: -0.2px; overflow-wrap: anywhere; }
.student-detail-head h2:focus { outline: none; }
.student-sub-tabs { margin: 0 0 16px; max-width: 100%; }
.student-panel { align-content: start; gap: 16px; }
@media (max-width: 839px) {
  .students-master[data-view="list"] .student-detail { display: none; }
  .students-master[data-view="detail"] .students-list-pane { display: none; }
}
@media (min-width: 840px) {
  .students-master { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .students-back { display: none; }
  .student-row[aria-current="true"] { border-color: var(--primary); background: var(--primary-tint); }
}
/* A row of the settings list that is a button (a quiet action) and the inline edit form that replaces a row. */
.settings-row-button { appearance: none; width: 100%; border-width: 0; background: none; font: inherit; font-size: 15px; font-weight: 500; color: var(--primary); text-align: left; justify-content: flex-start; cursor: pointer; }
.settings-row-button:hover { background: var(--primary-tint); }
.settings-row-button:disabled, button.settings-row-action:disabled { color: var(--mute); cursor: default; background: none; }
button.settings-row-action { appearance: none; width: 100%; border-width: 0; background: none; font: inherit; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; }
.settings-row-button:focus-visible, button.settings-row-action:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.settings-row-edit { display: block; }
.student-edit { display: grid; gap: 12px; }
.pending-actions { display: grid; gap: 10px; }
.pending-actions p { font-size: 14px; color: var(--ink-2); }
/* Conexiones: what is left of the setup, above the two connections */
.checklist { list-style: none; margin: 0; display: grid; gap: 14px; }
.checklist-step { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.checklist-step > .chip { flex: none; }
.checklist-step > div { flex: 1 1 240px; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.checklist-step.info > div { color: var(--mute); }
/* Familia: leaving or dissolving sits apart, at the end */
.danger-zone { display: grid; gap: 12px; margin-top: 32px; padding: 18px 20px; border: 1px solid var(--bad-line); border-radius: 12px; }
.danger-zone > h2 { font-size: 18px; color: var(--bad); }
.danger-zone > p { margin: 0; }
.danger-zone .panel { box-shadow: none; }
/* Settings list (Avisos and Cuenta): a small title over one rounded surface; rows split by hairlines, label and help left, control right */
.settings-section { display: grid; gap: 8px; margin: 0 0 24px; }
.settings-group-title { margin: 0; padding: 0 4px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.settings-group { list-style: none; margin: 0; padding: 0; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); overflow: hidden; }
.settings-group > li + li { border-top: 1px solid var(--hairline); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 56px; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.settings-row-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.settings-row-label { font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.settings-row-help { margin: 0; font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.settings-row-help code { font-size: 12px; }
.profile-evidence { margin-top: 6px; font-size: 13px; }
.profile-evidence summary { cursor: pointer; color: var(--mute); }
.profile-evidence-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--mute); overflow-wrap: anywhere; }
.settings-row-control { flex: none; display: flex; align-items: center; }
.settings-row-wide .seg { margin: 0; }
.settings-row-wide .seg-btn { min-height: 36px; }
.settings-row-link { cursor: pointer; }
.settings-row-link:hover { background: var(--primary-tint); }
.settings-row-link .settings-row-control svg { width: 14px; height: 14px; color: var(--mute); }
.settings-row-danger { padding: 0; }
.settings-row-action { flex: 1 1 auto; display: flex; align-items: center; min-height: 56px; padding: 12px 16px; font-size: 15px; font-weight: 500; color: var(--bad); text-decoration: none; }
.settings-row-action:hover { background: var(--bad-bg); }
.settings-row-link:focus-visible, .settings-row-action:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.settings-note { margin: 0 0 16px; }
@media (pointer: coarse) { .settings-row-wide .seg-btn { min-height: 44px; } }
@media (max-width: 420px) {
  .settings-row-wide { flex-wrap: wrap; }
  .settings-row-wide .settings-row-control { flex: 1 1 100%; }
  .settings-row-wide .seg { width: 100%; }
  .settings-row-wide .seg-btn { flex: 1 1 0; justify-content: center; }
}
/* the switch: a native checkbox with role="switch", 44px tall hit area through the row padding */
.settings-row-control input[type="checkbox"] { appearance: none; position: relative; flex: none; width: 42px; height: 24px; margin: 0; border: 1px solid var(--hairline); border-radius: 9999px; background: var(--canvas-soft); cursor: pointer; transition: background 0.15s; }
.settings-row-control input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--mute); transition: transform 0.15s; }
.settings-row-control input[type="checkbox"]:checked { border-color: var(--primary); background: var(--primary); }
.settings-row-control input[type="checkbox"]:checked::after { background: #fff; transform: translateX(18px); }
.settings-row-control input[type="checkbox"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .settings-row-control input[type="checkbox"], .settings-row-control input[type="checkbox"]::after { transition: none; } }

/* Per-student FAST Family Portal connection (Configuración → Estudiantes → FAST): a settings group, plus the form that opens in place. */
.fp-fields { display: grid; gap: 12px; }
.fp-fields { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.fast-portal .field input[type="text"],
.fast-portal .field input[type="date"] {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--canvas); color: var(--ink); font: inherit;
}
.fast-portal .field input:focus { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 2px; }
.fast-portal .field input[aria-invalid="true"] { border-color: var(--bad); }
.fast-portal .confirm { margin-top: 8px; padding: 12px; border: 1px solid var(--warn-line); border-radius: 10px; background: var(--warn-bg); display: grid; gap: 10px; }

/* Tareas (a student's assignments, imported by hand): the box for the JSON, the agenda by date group and the Resumen card */
.assignments-json { width: 100%; min-height: 160px; font: inherit; font-family: var(--mono); font-size: 12px; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); resize: vertical; }
.assignments-json:focus { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 2px; }
.assignments-api-url { width: 100%; min-width: 0; font-family: var(--mono); font-size: 12px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
/* Claves para integraciones (Conexiones): the name field and the new key sit under their text with their buttons, and wrap on a phone */
/* A text field inside a settings row (the name of a share link): the same box as the other inputs, in both themes. */
.settings-input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); font: inherit; font-size: 14px; }
/* the name field of a row with the text on the left takes the room the buttons of other rows would */
.settings-row-control:has(> .settings-input) { flex: 1 1 280px; max-width: 420px; }
.settings-input::placeholder { color: var(--mute); }
.settings-input:focus { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 2px; }
.settings-input:disabled { opacity: 0.6; }
.settings-input[aria-invalid="true"] { border-color: var(--bad); }
.api-keys { margin-top: 24px; }
.api-keys .settings-row-control { flex-wrap: wrap; gap: 8px; }
.api-keys .settings-row-wide { flex-wrap: wrap; }
.api-keys .settings-row-wide .settings-row-control { flex: 1 1 100%; }
.api-keys input[type="text"] { flex: 1 1 220px; min-width: 0; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); font: inherit; font-size: 14px; }
.api-keys #apikey-token { flex-basis: 320px; font-family: var(--mono); font-size: 12px; }

.tareas { display: grid; gap: 20px; min-width: 0; }
.tareas-asof { margin: 0; }
.tareas-stale { margin: 0; }
.tareas-stale .chip { white-space: normal; }
.tareas-filters { display: grid; gap: 10px; }
.tareas-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 14px; color: var(--ink-2); background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: 9999px; cursor: pointer; }
.filter-chip:hover { color: var(--ink); border-color: var(--primary-soft); }
.filter-chip[aria-pressed="true"] { background: var(--primary-tint); color: var(--ink); border-color: var(--primary); }
.filter-chip .count { color: var(--mute); }
.tareas-group { display: grid; gap: 8px; }
.tareas-group h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 4px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.tareas-group[data-group="missing"] h3, .tareas-group[data-group="overdue"] h3 { color: var(--danger); }
.tareas-group[data-group="missing"] h3 .chip.plain, .tareas-group[data-group="overdue"] h3 .chip.plain { color: var(--on-danger); background: var(--danger); border-color: transparent; }
.tareas-group[data-group="missing"] .tareas-list, .tareas-group[data-group="overdue"] .tareas-list { border-color: var(--danger-line); border-left: 4px solid var(--danger-accent); }
.tareas-group[data-group="today"] h3 { color: var(--warn-strong); }
.tareas-group[data-group="today"] .tareas-list { border-left: 4px solid var(--warn); }
.tareas-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); overflow: hidden; }
.tareas-list > li + li { border-top: 1px solid var(--hairline); }
.tareas-row { padding: 12px 16px; display: grid; gap: 2px; min-width: 0; }
.tareas-row h4 { margin: 0; font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.tareas-row p { margin: 0; font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.tareas-older, .tareas-retired { display: grid; gap: 8px; }
.tareas-older > summary, .tareas-retired > summary { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); cursor: pointer; }
.tareas-older[open] > summary, .tareas-retired[open] > summary { margin-bottom: 8px; }
.agenda-older { margin: 10px 0 0; }
.agenda-older a { color: inherit; text-decoration: underline; }
.tareas-import { display: grid; gap: 4px; }
.tareas-tools { margin-top: 24px; }
.tareas-tools > summary { min-height: 36px; padding: 0 4px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); cursor: pointer; }
.tareas-tools[open] > summary { margin-bottom: 8px; }
.agenda-groups { display: grid; gap: 14px; }
.agenda-group { display: grid; min-width: 0; border: 1px solid var(--hairline); border-left-width: 4px; border-radius: 10px; background: var(--canvas); overflow: hidden; }
.agenda-group h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 9999px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); background: var(--canvas-soft); border: 1px solid var(--hairline); }
.agenda-group.danger { border-color: var(--danger-line); border-left-color: var(--danger-accent); }
.agenda-group.danger h3 { color: var(--danger); background-color: var(--danger-bg); }
.agenda-group.danger .count-pill { color: var(--on-danger); background: var(--danger); border-color: transparent; }
.agenda-group.warn { border-color: var(--warn-line); border-left-color: var(--warn); }
.agenda-group.warn h3 { color: var(--warn-strong); background-color: var(--warn-bg); }
.agenda-group.warn .count-pill { color: var(--warn-strong); background: var(--warn-bg); border-color: var(--warn-line); }
.agenda-items { list-style: none; margin: 0; padding: 0 14px; display: grid; }
.agenda-items li { padding: 10px 0; border-top: 1px solid var(--hairline); min-width: 0; }
.agenda-items li:first-child { border-top: 0; }
.agenda-title { margin: 0; font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.agenda-items p { margin: 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.agenda-subject { color: var(--ink); }
.agenda-card .tareas-asof { margin-top: 12px; }
.subject-pending-line { margin: 0; }
.subject-pending { white-space: normal; }
.subject-assignments .panel-body { display: grid; gap: 16px; }
.subject-assignments .tareas-asof { margin: 0; }

/* Resumen snapshot: the status in one line and the tiles. Colour is never alone: the status, every reason and every tile carry words and a number. */
.snapshot {
  --snap: var(--ok); --snap-text: var(--ok); --snap-bg: var(--ok-bg); --snap-line: var(--ok-line);
  display: grid; gap: 16px; min-width: 0; padding: 20px 22px;
  background: color-mix(in srgb, var(--canvas) 92%, transparent); border: 1px solid var(--hairline); border-left: 6px solid var(--snap);
  border-radius: 12px; box-shadow: var(--shadow-2);
}
.snapshot.watch { --snap: var(--warn); --snap-text: var(--warn-strong); --snap-bg: var(--warn-bg); --snap-line: var(--warn-line); }
.snapshot.attention { --snap: var(--danger-accent); --snap-text: var(--danger); --snap-bg: var(--danger-bg); --snap-line: var(--danger-line); }
.snapshot-head { display: flex; align-items: center; gap: 14px; }
.snapshot-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; font-weight: 500; color: var(--snap-text); background: var(--snap-bg); border: 1px solid var(--snap-line); }
.snapshot-eyebrow { margin: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); overflow-wrap: anywhere; }
.snapshot h2 { margin: 0; font-size: clamp(24px, 4vw, 30px); line-height: 1.15; letter-spacing: -0.3px; color: var(--snap-text); }
.snapshot-lead { margin: 0; font-size: 15px; color: var(--ink-2); }
.snapshot-reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.snapshot-reasons .chip { font-size: 13px; white-space: normal; }
.snapshot .chip.warn { color: var(--warn-strong); }
.kpi-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi-item { min-width: 0; display: grid; }
.kpi {
  display: grid; align-content: start; gap: 2px; min-width: 0; min-height: 44px; padding: 12px 14px; color: inherit; text-decoration: none;
  background-color: var(--canvas); border: 1px solid var(--hairline); border-left: 4px solid var(--hairline); border-radius: 10px;
}
.kpi:hover { box-shadow: var(--shadow-1); border-color: var(--primary-soft); }
.kpi-label { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.kpi strong { font-size: 30px; font-weight: 300; line-height: 1.1; letter-spacing: -0.3px; color: var(--ink); }
.kpi-sub { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.kpi.danger { background-image: linear-gradient(var(--danger-bg), var(--danger-bg)); border-color: var(--danger-line); border-left-color: var(--danger-accent); }
.kpi.danger strong { color: var(--danger); }
.kpi.warn { background-image: linear-gradient(var(--warn-bg), var(--warn-bg)); border-color: var(--warn-line); border-left-color: var(--warn); }
.kpi.warn strong { color: var(--warn-strong); }
.kpi.ok { border-left-color: var(--ok); }
.kpi.ok strong { color: var(--ok); }
@media (max-width: 520px) {
  .snapshot { padding: 16px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi strong { font-size: 26px; }
}

/* Hero grid: on a phone the DOM order is the reading order (snapshot, Tareas card, digest); from 880px the digest sits left and the card right. */
.hero-grid { display: grid; gap: 20px; align-items: start; min-width: 0; }
.hero-grid > .digest { max-width: none; }
.hero-grid > .agenda-card { background: color-mix(in srgb, var(--canvas) 92%, transparent); }
@media (min-width: 881px) {
  .hero-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .hero-grid > .digest { order: 1; }
  .hero-grid > .agenda-card { order: 2; }
}

/* Home activities (Resumen and the page of a subject): short offline activities for the week. The only controls are the print link and, for a parent, "Lo hicimos" with its undo. */
.activities-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.activity { display: grid; gap: 8px; min-width: 0; padding-top: 20px; border-top: 1px solid var(--hairline); }
.activity:first-child { padding-top: 0; border-top: 0; }
.activity h3 { margin: 0; font-size: 17px; letter-spacing: -0.1px; line-height: 1.3; overflow-wrap: anywhere; }
.activity h4 { margin: 4px 0 0; font-size: 11px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.activity p { margin: 0; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.activity ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.activity .activity-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.activity .activity-standard { font-size: 13px; color: var(--mute); }
.activity .fine { font-size: 12px; color: var(--mute); }
.activity .activity-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.activity-total { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--mute); }
.activities-card .empty[role="alert"] { margin: 12px 0 0; }
.activity-resources { display: grid; gap: 6px; min-width: 0; }
.activity-resources ul { list-style: none; padding-left: 0; }
.activity-resources li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.activity-resources .chip { white-space: normal; }

/* Content studio. The admin tab (Contenido, admin-studio.js) reuses the settings list and the editor look of the activities admin; Cuadernos
   (studio.js) is a list of cards per subject. Tokens only, so dark mode follows. */
.astd-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0; }
.astd-toolbar .admin-filters, .astd-toolbar .admin-actions { margin: 0; }
.astd-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; margin: 0 0 16px; }
.astd-filters .field { min-width: 0; }
.astd-filters input[type="search"], .astd-form input[type="text"], .astd-form input[type="url"], .astd-form input[type="date"], .astd-form textarea, .astd-reason input[type="text"], .astd-dialog input[type="text"], .astd-dialog textarea, #astd-reports-reason { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
.astd-filters select, .astd-form select { width: 100%; }
.astd-dialog textarea { font-family: "Source Code Pro", monospace; font-size: 13px; }
.astd-editor { display: grid; gap: 14px; min-width: 0; }
.astd-editor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.astd-editor-head h3 { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.astd-form { display: grid; gap: 14px; min-width: 0; }
.astd-form h4, .astd-review h4, .astd-publish h4 { margin: 8px 0 0; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.astd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: start; }
.astd-pair { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); min-width: 0; }
.astd-pair-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.astd-pair-cols > div { min-width: 0; display: grid; gap: 8px; align-content: start; }
.astd-pair > .btn { justify-self: start; }
.astd-lang { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--mute); }
.astd-validation { padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas-soft); min-width: 0; }
.astd-validation p { margin: 0; }
.astd-problems { margin-top: 6px; }
.astd-problems li, .astd-changes li { padding: 4px 0; font-size: 13px; overflow-wrap: anywhere; }
.astd-reason { margin: 0; }
.astd-panel, .astd-review { display: grid; gap: 12px; min-width: 0; align-content: start; }
.astd-links-block { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; min-width: 0; }
.astd-links-block[data-block="links-broken"] { border-color: var(--bad); background: var(--bad-bg); }
.astd-links-block[data-block="links-unverified"] { border-color: var(--warn); background: var(--warn-bg); }
.astd-links-block p { margin: 0; }
.astd-links-block > .chip { justify-self: start; }
.astd-links-block code { overflow-wrap: anywhere; }
.astd-checks { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.astd-check { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); min-width: 0; }
.astd-check > div { flex: 1 1 240px; min-width: 0; }
.astd-check p { margin: 2px 0 0; overflow-wrap: anywhere; }
.astd-retire, .astd-publish { min-width: 0; }
.astd-dialog { width: min(720px, calc(100vw - 32px)); }
.astd-dialog .admin-list { max-height: 220px; overflow: auto; }
@media (min-width: 720px) { .astd-pair-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Resources directory. The admin tab (Recursos, admin-resources.js) reuses the settings list and the editor look of the content studio; the pipeline is a
   board of columns (one per state) that stacks on a phone. Tokens only, so dark mode follows. */
.ares-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0; }
.ares-toolbar .admin-actions { margin: 0; }
.ares-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; margin: 0 0 16px; }
.ares-filters .field { min-width: 0; }
.ares-filters .btn { justify-self: start; }
.ares-filters input[type="search"], .ares-editor input[type="text"], .ares-editor input[type="number"], .ares-editor input[type="date"], .ares-editor input[type="email"], .ares-editor input[type="datetime-local"], .ares-editor textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
.ares-filters select, .ares-editor select { width: 100%; }
.ares-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 8px; }
.ares-col { min-width: 0; display: grid; gap: 10px; align-content: start; }
.ares-col h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.ares-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ares-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); min-width: 0; }
.ares-card .btn { justify-self: start; }
.ares-card-text { display: grid; gap: 4px; min-width: 0; }
.ares-card-text .settings-row-label, .ares-card-text .admin-meta { overflow-wrap: anywhere; }
.ares-card-text .admin-row-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ares-empty { margin: 0; padding: 12px; border: 1px dashed var(--hairline); border-radius: 12px; }
.ares-editor { display: grid; gap: 14px; min-width: 0; }
.ares-editor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ares-editor-head h3 { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.ares-ops { margin: 0; }
.ares-form, .ares-review { display: grid; gap: 14px; min-width: 0; align-content: start; }
.ares-form h4, .ares-review h4, .ares-publish h4 { margin: 8px 0 0; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.ares-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: start; }
.ares-grid .field { min-width: 0; }
.ares-group { margin: 0; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 12px; min-width: 0; }
.ares-group legend { padding: 0 6px; font-size: 13px; color: var(--ink-2); }
.ares-boxes { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ares-check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; color: var(--ink); }
.ares-check input { width: 18px; height: 18px; flex: none; }
.ares-validation { padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas-soft); min-width: 0; }
.ares-validation:empty { display: none; }
.ares-validation p { margin: 0; }
.ares-problems li { padding: 4px 0; font-size: 13px; overflow-wrap: anywhere; }
.ares-save { margin: 0; }
.ares-panel { display: grid; gap: 12px; min-width: 0; align-content: start; }
.ares-checks { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.ares-check-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); min-width: 0; }
.ares-check-row > div { flex: 1 1 240px; min-width: 0; }
.ares-check-row p { margin: 2px 0 0; overflow-wrap: anywhere; }
.ares-blockers li { padding: 4px 0; overflow-wrap: anywhere; }
.ares-pause, .ares-publish, .ares-verify-form { min-width: 0; }
.ares-src { display: grid; gap: 16px; min-width: 0; align-content: start; }
.ares-src h3, .ares-src h4 { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.ares-meter { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas-soft); min-width: 0; }
.ares-meter p { margin: 0; overflow-wrap: anywhere; }
.ares-progress { width: 100%; height: 8px; accent-color: var(--ink-2); }
.ares-src-forms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ares-src-form { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas); }
.ares-src-form .field { min-width: 0; }
.ares-src input[type="text"], .ares-src textarea, .ares-src select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
.ares-src-filter { max-width: 240px; }
.ares-cand .admin-meta { overflow-wrap: anywhere; }
.ares-cand a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.ares-from { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--canvas-soft); min-width: 0; }
.ares-from p { margin: 0; overflow-wrap: anywhere; }
.ares-from a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 900px) { .ares-src-forms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .ares-board { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ares-board:has(.ares-col:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.studio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.studio-card { display: grid; gap: 8px; min-width: 0; padding-top: 20px; border-top: 1px solid var(--hairline); }
.studio-card:first-child { padding-top: 0; border-top: 0; }
.studio-card h3 { margin: 0; font-size: 17px; letter-spacing: -0.1px; line-height: 1.3; overflow-wrap: anywhere; }
.studio-card h4 { margin: 4px 0 0; font-size: 11px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.studio-card p { margin: 0; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.studio-card .activity-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.studio-card .studio-why strong { font-weight: 500; color: var(--ink); }
.studio-card .fine { font-size: 12px; color: var(--mute); }
.studio-card .studio-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.studio-card .studio-more ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 15px; overflow-wrap: anywhere; }
.studio-group + .studio-group { margin-top: 16px; }
.studio-card .studio-progress, .studio-program .studio-progress { margin: 0; }
/* Programas: the lessons of a program and its family mission. Same tokens as the notebook cards. */
.studio-program .panel-body { display: grid; gap: 12px; min-width: 0; }
.studio-program .panel-body > p { margin: 0; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.studio-program .panel-body > p.fine { font-size: 12px; color: var(--mute); }
.studio-program h3, .studio-mission h3 { margin: 8px 0 0; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.studio-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.studio-lesson { display: grid; gap: 6px; min-width: 0; padding: 16px 0; border-top: 1px solid var(--hairline); }
.studio-lesson:first-child { padding-top: 4px; border-top: 0; }
.studio-lesson-n { margin: 0; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.studio-lesson h4, .studio-mission h4 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -0.1px; line-height: 1.3; text-transform: none; color: var(--ink); overflow-wrap: anywhere; }
.studio-lesson p, .studio-mission p { margin: 0; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.studio-mission { display: grid; gap: 6px; min-width: 0; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.studio-lesson .studio-actions, .studio-mission .studio-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
/* Recursos: Tutores y Centros (resources.js). The cards are the .studio-card of Cuadernos; these are the search, the ZIP, the page of a provider and the request to be contacted. Same tokens. */
.res-top { display: grid; gap: 16px; margin: 16px 0; min-width: 0; }
.res-search { display: grid; gap: 12px; min-width: 0; }
.res-search .res-q { max-width: 520px; }
.res-search input[type="search"], .res-zip input[type="text"], .res-lead input[type="text"] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--canvas); color: var(--ink); }
.res-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.res-filters .field, .res-lead .field { min-width: 0; }
.res-filters select, .res-lead select { width: 100%; }
.res-zip { display: grid; gap: 8px; max-width: 360px; min-width: 0; }
.res-zip-line { margin: 0; font-size: 15px; color: var(--ink-2); }
.res-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.studio-card .res-where, .res-detail .res-where { margin: 0; font-size: 14px; color: var(--mute); }
.studio-card .res-price { font-size: 15px; font-weight: 500; color: var(--ink); }
.studio-card .res-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.res-detail .panel-head { align-items: center; }
.res-dl { margin: 0; display: grid; gap: 8px; }
.res-row { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr); gap: 12px; }
.res-row dt { font-size: 13px; color: var(--mute); }
.res-row dd { margin: 0; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.res-row.res-solo dd { grid-column: 2; }
.res-lead-block { display: grid; gap: 12px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.res-lead-block > p { margin: 0; }
.res-lead { margin-top: 0; }
.res-lead h3 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -0.1px; text-transform: none; color: var(--ink); overflow-wrap: anywhere; }
.res-lead-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.res-lead-child { margin: 0; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 12px; min-width: 0; display: grid; gap: 8px; }
.res-lead-child legend { padding: 0 6px; font-size: 13px; color: var(--ink-2); }
.res-lead-child p { margin: 0; }
.res-consent { align-items: flex-start; min-height: 0; }
.res-consent input { margin-top: 3px; }
.res-mine-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.res-mine-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.res-mine-name { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.res-mine .panel-body > p { margin: 8px 0 0; }
.res-recommended .panel-body > .fine { margin: 0 0 12px; }
@media (max-width: 520px) { .res-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } .res-row.res-solo dd { grid-column: 1; } }
@media (min-width: 900px) { .res-top { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); align-items: start; gap: 24px; } }
/* Plataforma -> Recursos -> Contactos: the relay of the parents' requests. Same board and cards as the pipeline. */
.ares-leads { margin-top: 16px; }
.ares-dl { margin: 0; display: grid; gap: 4px; }
.ares-dl-row { display: grid; grid-template-columns: minmax(80px, 120px) minmax(0, 1fr); gap: 8px; font-size: 14px; }
.ares-dl-row dt { color: var(--mute); }
.ares-dl-row dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.ares-card.ares-lead h4 { margin: 8px 0 0; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.ares-lead-panel { margin-top: 12px; }
.ares-lead-panel textarea { min-height: 200px; }
@media (min-width: 900px) { .ares-board.ares-leads { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
