/* ========================================================================
   Abucear classes — component layer (ABU-24, from the approved ABU-23
   mockups). Consumes skin.css without editing it. Only skin roles and TFD
   scale tokens are used: no raw colours, radii or spacing values except 1px
   hairlines and the focus geometry the skin already names.
   CSP is `style-src 'self'`: templates carry no style attributes; every
   layout variation is a named class here.
   ======================================================================== */

/* ---------- Approved skin additions ---------- */
:root {
  /* Poppins ships no `tnum` and proportional digits (measured). Montserrat
     ships `tnum`. Aligned numerals (date blocks, times in lists) use it. */
  --abucear-font-numeric: var(--abucear-font-heading);
  /* 15px semibold field labels; 13px stays for table headers/eyebrows. */
  --abucear-text-field-label: var(--fs-subheadline);
  --abucear-page-max: 1200px;
  /* One text inset for flush card heads, list heads and class rows. */
  --abucear-row-inset: var(--space-lg);
}

/* ---------- Base ---------- */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--abucear-bg);
  color: var(--abucear-text);
  font-family: var(--abucear-font-body);
  font-size: var(--abucear-text-body);
  line-height: var(--abucear-line-body);
}
h1, h2, h3, h4 { font-family: var(--abucear-font-heading); line-height: var(--abucear-line-heading); margin: 0; color: var(--abucear-text); overflow-wrap: anywhere; }
h1 { font-size: var(--fs-title-1); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-title-3); font-weight: 600; }
h3 { font-size: var(--fs-headline); font-weight: 600; font-family: var(--abucear-font-body); }
h4 { font-size: var(--abucear-text-small); font-weight: 600; font-family: var(--abucear-font-body); }
p { margin: 0; }
p + p { margin-top: var(--space-xs); }
a { color: var(--abucear-brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--abucear-brand-hover); text-decoration-thickness: 2px; }
strong { font-weight: 600; }
small, .meta { font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); }
.meta-id { font-size: var(--abucear-text-label); color: var(--abucear-text-tertiary); white-space: nowrap; }
.eyebrow { font-size: var(--abucear-text-eyebrow); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--abucear-text-secondary); }
.num { font-family: var(--abucear-font-numeric); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.icon-sm { width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- Focus (skin: 3px ring, 2px offset; amber on brand fills) ---------- */
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--abucear-focus-width) solid var(--abucear-focus);
  outline-offset: var(--abucear-focus-offset);
}
/* Skin adjustment: the offset ring is painted on the light surface around a
   blue button, where amber would be 1.67:1. Amber is kept for controls that
   sit ON a blue band (none today). */
.on-brand :is(a, button):focus-visible { outline-color: var(--abucear-focus-on-brand); }
.skip-link { position: absolute; left: var(--space-md); top: -100px; z-index: 10; background: var(--abucear-bg-secondary); padding: var(--space-xs) var(--space-md); border-radius: var(--abucear-radius-control); }
.skip-link:focus { top: var(--space-xs); }

/* ---------- Staff chrome: white header, blue wordmark ---------- */
.app-header { background: var(--abucear-bg-secondary); border-bottom: 1px solid var(--abucear-border); }
.app-header-inner { max-width: var(--abucear-page-max); margin: 0 auto; padding: 0 var(--space-xl); display: flex; align-items: center; gap: var(--space-xl); min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; min-height: var(--abucear-control-h); padding: var(--space-xs) 0; flex: 0 0 auto; }
.wordmark img { height: 24px; width: auto; display: block; }
.app-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-xxs); }
.app-nav a { display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 0 var(--space-sm); color: var(--abucear-text-secondary); font-weight: 600; font-size: var(--abucear-text-small); text-decoration: none; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.app-nav a:hover { color: var(--abucear-text); background: var(--abucear-bg-tertiary); }
.app-nav a[aria-current="page"] { color: var(--abucear-brand); border-bottom-color: var(--abucear-brand); }
.app-main { max-width: var(--abucear-page-max); margin: 0 auto; padding: var(--space-xl) var(--space-xl) var(--space-xxl); }
.app-footer { max-width: var(--abucear-page-max); margin: 0 auto; padding: var(--space-lg) var(--space-xl) var(--space-xl); border-top: 1px solid var(--abucear-border); display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.app-footer form { margin: 0; }
.footer-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }

/* ---------- Page heading ---------- */
.crumb { display: inline-flex; align-items: center; gap: var(--space-xxs); min-height: var(--abucear-control-h); font-size: var(--abucear-text-small); font-weight: 600; text-decoration: none; margin-bottom: var(--space-xxs); }
.crumb:hover { text-decoration: underline; }
.page-head { display: flex; flex-wrap: wrap; gap: var(--space-md) var(--space-lg); align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-lg); }
.page-head .lede { margin-top: var(--space-xs); color: var(--abucear-text-secondary); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.facts-line { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); margin-top: var(--space-sm); color: var(--abucear-text); }
.facts-line > span { display: inline-flex; align-items: center; gap: var(--space-xs); }
.facts-line .icon { color: var(--abucear-text-secondary); }

/* ---------- Layout ---------- */
.stack > * + * { margin-top: var(--space-lg); }
.stack-sm > * + * { margin-top: var(--space-sm); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--space-lg); align-items: start; }
.split-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--space-lg); align-items: start; }
.sticky { position: sticky; top: var(--space-lg); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); align-items: center; }

/* ---------- Cards / sections (flat, no shadow) ---------- */
.card { background: var(--abucear-bg-secondary); border: 1px solid var(--abucear-border); border-radius: var(--abucear-radius-card); padding: var(--space-lg); min-width: 0; }
.card-tight { padding: var(--space-md); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-md); }
.card-head p { color: var(--abucear-text-secondary); font-size: var(--abucear-text-small); }
.panel { background: var(--abucear-bg-tertiary); border-radius: var(--abucear-radius-card); padding: var(--space-md); }
.private-mark { display: inline-flex; align-items: center; gap: var(--space-xxs); font-size: var(--abucear-text-label); font-weight: 600; color: var(--abucear-text-secondary); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: var(--abucear-control-h); padding: var(--space-xs) var(--space-lg); border-radius: var(--abucear-radius-control); border: 1px solid transparent; font: 600 var(--abucear-text-small)/1.25 var(--abucear-font-body); text-decoration: none; cursor: pointer; text-align: center; max-width: 100%; }
.btn-primary { background: var(--abucear-brand); color: var(--abucear-on-brand); border-color: var(--abucear-brand); }
.btn-primary:hover { background: var(--abucear-brand-hover); color: var(--abucear-on-brand); }
.btn-secondary { background: var(--abucear-bg-secondary); color: var(--abucear-brand); border-color: var(--abucear-brand); }
.btn-secondary:hover { background: var(--abucear-bg-tertiary); color: var(--abucear-brand-hover); }
.btn-quiet { background: transparent; color: var(--abucear-brand); padding-inline: var(--space-sm); text-decoration: underline; text-underline-offset: 3px; }
.btn-quiet:hover { background: var(--abucear-bg-tertiary); }
.btn-danger { background: var(--abucear-danger); color: var(--abucear-on-danger); border-color: var(--abucear-danger); }
.btn-danger:hover { filter: brightness(0.9); }
.btn-public { background: var(--abucear-accent); color: var(--abucear-on-accent); border-color: var(--abucear-accent); }
.btn-public:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--abucear-bg-tertiary); color: var(--abucear-text-tertiary); border-color: var(--abucear-border-strong); cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--space-xxs); min-width: 0; }
.field + .field, .field + fieldset, fieldset + .field { margin-top: var(--space-md); }
label, .label { font-size: var(--abucear-text-field-label); font-weight: 600; color: var(--abucear-text); }
.label-opt { font-weight: 400; color: var(--abucear-text-secondary); }
.help { font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); }
input[type="text"], input[type="search"], input[type="tel"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; min-width: 0; min-height: var(--abucear-control-h);
  padding: var(--space-xs) var(--space-sm);
  font: 400 var(--abucear-text-body)/1.4 var(--abucear-font-body);
  color: var(--abucear-text); background: var(--abucear-bg-secondary);
  border: 1px solid var(--abucear-border-strong); border-radius: var(--abucear-radius-control);
}
select { appearance: none; -webkit-appearance: none; padding-right: var(--space-xxl);
  background-image: linear-gradient(45deg, transparent 50%, var(--abucear-text-secondary) 50%), linear-gradient(135deg, var(--abucear-text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
textarea { min-height: 96px; resize: vertical; }
input[type="search"] { appearance: none; -webkit-appearance: none; }
input::placeholder, textarea::placeholder { color: var(--abucear-text-tertiary); opacity: 1; }
input[readonly] { background: var(--abucear-bg-tertiary); }
[aria-invalid="true"] { border-color: var(--abucear-danger) !important; border-width: 2px !important; }
.field-error { display: flex; gap: var(--space-xxs); align-items: flex-start; color: var(--abucear-danger); font-size: var(--abucear-text-small); font-weight: 600; }
.field-error .icon { margin-top: 2px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-family: var(--abucear-font-heading); font-weight: 600; font-size: var(--fs-headline); margin-bottom: var(--space-sm); }
/* Keep fieldset cards flat: float the legend off the border. */
fieldset.card > legend { float: left; width: 100%; }
fieldset.card > legend ~ * { clear: both; }
legend.legend-sm { font-family: var(--abucear-font-body); font-size: var(--abucear-text-field-label); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.grid-2 > .field + .field { margin-top: 0; }

/* Choice rows: whole row is the 44/48px target */
.choice { display: flex; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; gap: var(--space-sm); min-height: var(--abucear-control-h); padding: var(--space-sm) var(--space-md); border: 1px solid var(--abucear-border-strong); border-radius: var(--abucear-radius-control); background: var(--abucear-bg-secondary); cursor: pointer; font-weight: 400; font-size: var(--abucear-text-body); }
.choice + .choice { margin-top: var(--space-xs); }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--abucear-brand); }
.choice:hover { background: var(--abucear-bg-tertiary); }
.choice:has(input:checked) { border-color: var(--abucear-brand); border-width: 2px; padding: calc(var(--space-sm) - 1px) calc(var(--space-md) - 1px); background: var(--abucear-bg-tertiary); }
.choice:has(input:focus-visible) { outline: var(--abucear-focus-width) solid var(--abucear-focus); outline-offset: var(--abucear-focus-offset); }
.choice input:focus-visible { outline: none; }
.choice .choice-sub { display: block; font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); }
.choice-plain { border: 0; padding: var(--space-xs) 0; background: none; }
.choice-plain:hover, .choice-plain:has(input:checked) { background: none; border: 0; padding: var(--space-xs) 0; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.choice-grid .choice + .choice { margin-top: 0; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.segmented .choice { margin: 0; align-items: center; font-weight: 600; overflow-wrap: normal; }

.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--abucear-border); }
.form-actions .spacer { flex: 1 1 auto; }

/* ---------- Status words (always icon + word, never colour alone) ---------- */
.status { display: inline-flex; align-items: center; gap: var(--space-xxs); font-size: var(--abucear-text-small); font-weight: 600; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.status > svg { flex: 0 0 auto; }
.status.ok { color: var(--abucear-success); }
.status.warn { color: var(--abucear-warning); }
.status.danger { color: var(--abucear-danger); }
.status.none { color: var(--abucear-text-secondary); font-weight: 400; }
.status.info { color: var(--abucear-info); }
.chip { display: inline-flex; align-items: center; gap: var(--space-xxs); padding: var(--space-xxxs) var(--space-xs); border-radius: var(--abucear-radius-control); font-size: var(--abucear-text-label); font-weight: 600; line-height: 1.5; border: 1px solid currentColor; white-space: nowrap; }
.chip.ok { color: var(--abucear-success); background: var(--abucear-success-bg); }
.chip.warn { color: var(--abucear-warning); background: var(--abucear-warning-bg); }
.chip.danger { color: var(--abucear-danger); background: var(--abucear-danger-bg); }
.chip.info { color: var(--abucear-info); background: var(--abucear-info-bg); }
.chip.neutral { color: var(--abucear-text-secondary); background: var(--abucear-bg-secondary); border-color: var(--abucear-border-strong); }
/* The one amber highlight per staff screen */
.hoy { display: inline-flex; align-items: center; padding: 0 var(--space-xs); border-radius: var(--abucear-radius-control); background: var(--abucear-accent); color: var(--abucear-on-accent); font-size: var(--abucear-text-label); font-weight: 600; line-height: 1.7; }

/* ---------- Notices ---------- */
.notice { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-md); border-radius: var(--abucear-radius-control); border: 1px solid; border-left-width: 4px; overflow-wrap: anywhere; }
.notice .icon { margin-top: 2px; }
.notice strong { display: block; }
.notice.error { color: var(--abucear-danger); background: var(--abucear-danger-bg); }
.notice.warn { color: var(--abucear-warning); background: var(--abucear-warning-bg); }
.notice.ok { color: var(--abucear-success); background: var(--abucear-success-bg); }
.notice.info { color: var(--abucear-info); background: var(--abucear-info-bg); }
.notice > div { color: var(--abucear-text); }
.notice > div strong { color: inherit; }
.notice.error > div strong { color: var(--abucear-danger); }
.notice.warn > div strong { color: var(--abucear-warning); }
.notice.ok > div strong { color: var(--abucear-success); }

/* ---------- Empty state ---------- */
.empty { display: grid; justify-items: start; gap: var(--space-xs); padding: var(--space-lg); border: 1px dashed var(--abucear-border-strong); border-radius: var(--abucear-radius-card); background: var(--abucear-bg-secondary); }
.empty .icon { width: 24px; height: 24px; color: var(--abucear-text-secondary); }
.empty p { color: var(--abucear-text-secondary); }
.empty .empty-title { color: var(--abucear-text); font-weight: 600; }
/* Inside a card the card is the frame: no second border. */
.card .empty { padding: 0; border: 0; background: none; }

/* ---------- Disclosure ---------- */
details > summary { list-style: none; display: flex; align-items: center; gap: var(--space-xs); min-height: var(--abucear-control-h); cursor: pointer; font-weight: 600; color: var(--abucear-brand); }
details > summary::-webkit-details-marker { display: none; }
details > summary .chev { transition: transform 150ms ease; }
details[open] > summary .chev { transform: rotate(90deg); }
details.card > summary { margin: calc(-1 * var(--space-sm)) 0; }
details[open].card > summary { margin-bottom: var(--space-sm); }
@media (prefers-reduced-motion: reduce) { details > summary .chev { transition: none; } }

/* ---------- Section nav (course sections; ordinary links) ---------- */
.section-nav { display: flex; gap: var(--space-xxs); border-bottom: 1px solid var(--abucear-border); margin-bottom: var(--space-lg); overflow-x: auto; scrollbar-width: thin; }
.section-nav a { display: inline-flex; align-items: center; min-height: var(--touch-pref); padding: 0 var(--space-md); color: var(--abucear-text-secondary); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.section-nav a:hover { color: var(--abucear-text); background: var(--abucear-bg-tertiary); }
.section-nav a[aria-current="page"] { color: var(--abucear-brand); border-bottom-color: var(--abucear-brand); }
.filter-nav { display: inline-flex; padding: var(--space-xxs); gap: var(--space-xxs); border-radius: var(--abucear-radius-control); background: var(--abucear-bg-tertiary); }
.filter-nav a { display: inline-flex; align-items: center; min-height: var(--abucear-control-h); padding: 0 var(--space-md); border-radius: var(--abucear-radius-control); font-weight: 600; font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); text-decoration: none; }
.filter-nav a[aria-current="page"] { background: var(--abucear-bg-secondary); color: var(--abucear-brand); box-shadow: inset 0 0 0 1px var(--abucear-brand); }

/* ---------- Class list (table-like list: reflows on phones, keeps list semantics) ---------- */
.class-list { list-style: none; margin: 0; padding: 0; }
.class-list-head, .class-row { display: grid; grid-template-columns: 104px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--space-md); align-items: start; }
.class-list-head { padding: 0 var(--abucear-row-inset) var(--space-xs); font-size: var(--abucear-text-label); font-weight: 600; color: var(--abucear-text-secondary); border-bottom: 1px solid var(--abucear-border-strong); }
.class-row { padding: var(--space-md) var(--abucear-row-inset); border-bottom: 1px solid var(--abucear-border); }
.class-row:hover { background: var(--abucear-bg-tertiary); }
.class-row:has(h3 a:focus-visible) h3 a { outline: none; }
/* Column names stay for screen readers; the list head shows them on wide screens. */
.class-row .col-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.date-block { display: grid; gap: 2px; }
.date-block .dow { font-size: var(--abucear-text-small); font-weight: 600; color: var(--abucear-text-secondary); text-transform: capitalize; }
.date-block .day { font-family: var(--abucear-font-numeric); font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--fs-headline); line-height: 1.2; white-space: nowrap; }
/* Class rows and class list items: two type sizes, 17px title and 15px for
   everything else (day line, course, IDs, times, chips, staff). */
.c-day { font-size: var(--abucear-text-small); font-weight: 600; line-height: 1.4; color: var(--abucear-text-secondary); }
.c-day::first-letter { text-transform: uppercase; }
.class-row > .c-day { display: none; }
.class-row h3, .class-item h3 { font-size: var(--fs-headline); }
.class-row h3 a, .class-item h3 a { color: var(--abucear-text); text-decoration: none; }
.class-row h3 a:hover, .class-item h3 a:hover { color: var(--abucear-brand); text-decoration: underline; }
.class-row .sub, .class-item .sub { font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); margin-top: 2px; }
.class-row .sub .meta-id, .class-item .sub .meta-id { font-size: inherit; }
.class-row .num, .class-item .num { font-size: var(--abucear-text-small); }
:is(.class-row, .class-item) :is(.chip, .hoy) { font-size: inherit; line-height: 1.3; vertical-align: 1px; }
.class-item .c-day + h3 { margin-top: 2px; }
.staff-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-xs); }
/* One line per person at every width: status icon | name · role | conflict
   flag. Icon shapes differ (check, cross, dashed circle, triangle), so colour
   is never the only cue; the role drops under the name in narrow columns. */
.staff-line { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--space-xxs) var(--space-xs); align-items: start; font-size: var(--abucear-text-small); line-height: 1.4; }
.staff-mark, .staff-flag { display: flex; justify-content: center; min-height: 1.4em; align-items: center; }
.staff-line .who { font-weight: 600; min-width: 0; }
.staff-line .who-role { font-weight: 400; color: var(--abucear-text-secondary); }
.staff-line .staff-word { font-size: inherit; }
.staff-line .status.staff-word { display: inline; white-space: nowrap; }
.own-conflict { align-items: flex-start; }
.own-conflict > svg { margin-top: 2px; }
.own-conflict .conflict-detail { font-weight: 400; color: var(--abucear-text); }
.staff-line.is-removed .who-name, .staff-line.is-removed .staff-word, .staff-line > .who.staff-word { font-weight: 400; color: var(--abucear-text-secondary); }
.staff-legend { display: flex; flex-wrap: wrap; gap: var(--space-xxs) var(--space-md); font-size: var(--abucear-text-label); padding: var(--space-sm) var(--abucear-row-inset) var(--space-xs); }
.staff-legend .status { font-size: inherit; font-weight: 400; color: var(--abucear-text-secondary); }
.staff-legend .status.ok > svg { color: var(--abucear-success); }
.staff-legend .status.warn > svg { color: var(--abucear-warning); }
.row-action { justify-self: end; }

/* ---------- Definition facts ---------- */
.facts { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: var(--space-xs) var(--space-lg); margin: 0; }
.facts dt { font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts-stack { display: grid; gap: var(--space-sm); margin: 0; }
.facts-stack dt { font-size: var(--abucear-text-label); color: var(--abucear-text-secondary); font-weight: 600; }
.facts-stack dd { margin: 0; }

/* ---------- Lists of people / records ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-md); padding: var(--space-sm) 0; border-bottom: 1px solid var(--abucear-border); min-height: var(--touch-pref); }
.rows > li:last-child { border-bottom: 0; }
.rows .row-main { min-width: 0; flex: 1 1 220px; }
.rows .row-link { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-md); width: 100%; min-height: var(--touch-pref); color: var(--abucear-text); text-decoration: none; }
/* The chevron never wraps to its own line; the label shrinks instead. */
.rows .row-link > :first-child { min-width: 0; }
.rows .row-link:hover strong { color: var(--abucear-brand); text-decoration: underline; }
.rows .row-link .icon { color: var(--abucear-text-secondary); }
/* Class lists: the whole row opens the class (stretched title link). */
.rows-linked > li { flex-wrap: nowrap; position: relative; padding-inline: var(--space-xs); margin-inline: calc(-1 * var(--space-xs)); border-radius: var(--abucear-radius-control); }
.rows-linked > li:hover { background: var(--abucear-bg-tertiary); }
.rows-linked .row-main > a::after, .rows-linked .row-main h3 > a::after { content: ""; position: absolute; inset: 0; }
.rows-linked > li > .row-main { flex: 1 1 auto; }
.rows-linked > li > .icon { color: var(--abucear-text-secondary); }
/* A list that is itself the card keeps the card's padding. */
.rows.card { padding: var(--space-xs) var(--space-lg); }
.rows.card-tight { padding: var(--space-xxs) var(--space-md); }

/* ---------- Follow-up (Pendiente) item ---------- */
.followup { border: 1px solid var(--abucear-border); border-left: 4px solid var(--abucear-warning); border-radius: var(--abucear-radius-control); padding: var(--space-md); background: var(--abucear-bg-secondary); }
.followup.resolved { border-left-color: var(--abucear-success); }
.followup + .followup { margin-top: var(--space-sm); }
.followup .wording { font-size: var(--fs-headline); font-weight: 600; white-space: pre-wrap; }
.followup .followup-meta { margin-top: var(--space-xxs); font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); }
.followup .followup-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-xs) var(--space-md); margin-top: var(--space-sm); }
.history-entry { border-top: 1px solid var(--abucear-border); padding-block: var(--space-sm); font-size: var(--abucear-text-small); }

/* ---------- Sizing reference table ---------- */
.ref-table { max-width: 100%; overflow-x: auto; margin-top: var(--space-sm); border: 1px solid var(--abucear-border-strong); border-radius: var(--abucear-radius-control); }
.ref-table table { border-collapse: collapse; min-width: 640px; font-size: var(--abucear-text-label); }
.ref-table caption { text-align: left; font-weight: 600; padding: var(--space-xs) var(--space-sm); }
.ref-table th, .ref-table td { padding: var(--space-xxs) var(--space-xs); border-top: 1px solid var(--abucear-border); white-space: nowrap; text-align: left; }
.ref-table thead th { background: var(--abucear-bg-tertiary); }

/* ---------- Copy text (announcement) ---------- */
.copy-box { font: 400 var(--abucear-text-small)/1.5 var(--abucear-font-body); white-space: pre-wrap; }

/* ---------- Public (framed in abucear.mx): no logo, no header ---------- */
.public-body { background: var(--abucear-bg); }
.public-main { max-width: 760px; margin: 0 auto; padding: var(--space-lg) var(--space-md) var(--space-xxl); }
.public-main.wide { max-width: 1120px; }
.course-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-lg); }
.course-card { display: grid; gap: var(--space-sm); height: 100%; align-content: start; }
.course-card h3 { font-family: var(--abucear-font-heading); font-size: var(--fs-title-3); font-weight: 700; }
.course-card .when { display: grid; gap: var(--space-xxs); }
.course-card .when span { display: flex; gap: var(--space-xs); align-items: flex-start; }
.course-card .when .icon { color: var(--abucear-text-secondary); margin-top: 3px; }
.course-card .btn { margin-top: var(--space-xs); justify-self: start; }
.month-head { margin: var(--space-xl) 0 var(--space-md); }
.month-head::first-letter { text-transform: uppercase; }

/* ---------- Equipment fields without an "Actualizar campos" round trip ----------
   Pure CSS progressive disclosure (approved option B). The server renders
   every field; the form hides groups only where :has() is supported, and
   the handler clears exactly the hidden fields before saving (intake.go
   visibleEquipment). Without :has() every group stays visible with its
   legend. No JavaScript. */
.opt-b:has(input[name="gear_mode"][value="none"]:checked) .needs-gear,
.opt-b:has(input[name="gear_mode"][value="unanswered"]:checked) .needs-gear,
.opt-b:not(:has(input[name="gear_mode"]:checked)) .needs-gear,
.opt-b:not(:has(input[name="gear_mode"][value="selected"]:checked)) .needs-pieces,
.opt-b:has(input[name="reuse"]:checked) .needs-new-fit { display: none; }
.opt-b:not(:has(input[name="reuse"]:checked)) .reuse-note { display: none; }
.choice:has(input:disabled) { cursor: not-allowed; color: var(--abucear-text-tertiary); background: var(--abucear-bg); }

.my-records { display: grid; gap: var(--space-xl); }
@media (min-width: 601px) { .my-records { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); } }

/* ---------- Phones: one column, compact class rows ---------- */
@media (max-width: 600px) {
  .split, .split-even { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .class-list-head { display: none; }
  /* The day becomes a full-width line above the title: no date column. */
  .class-row { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: var(--space-sm) var(--space-md); }
  .class-row .staff-lines { gap: var(--space-xxs); }
  .class-row > .c-day { display: block; margin-bottom: 2px; }
  .class-row > .c-date, .class-row > .c-when > .num { display: none; }
  .class-row > .c-when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-md); }
  .class-row > .c-staff { margin-top: var(--space-xs); }
}

/* ---------- Tablets and narrow desktops (601–1180px) ----------
   Purpose-built tiers between the phone (≤600) and desktop (≥1181)
   layouts. 901–1180 keeps the desktop two-column pages; 601–900 stacks
   them. From 601 up Mis clases gives its class list the full width, with
   its side cards in a row underneath (three from 1181, otherwise two):
   ≥901      the desktop four-column table;
   720–900   date | class, time and place | staff;
   601–719   date | class, time and place, then staff below. */
@media (min-width: 601px) {
  .split:has(.class-list) { grid-template-columns: minmax(0, 1fr); }
  .split:has(.class-list) > aside { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg); }
  .split:has(.class-list) > aside > * + * { margin-top: 0; }
}
@media (min-width: 601px) and (max-width: 1180px) {
  .split:has(.class-list) > aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split:has(.class-list) > aside > :last-child { grid-column: 1 / -1; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .app-header-inner { gap: var(--space-md); padding: 0 var(--space-lg); }
  .app-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .app-nav a { padding: 0 var(--space-xs); white-space: nowrap; }
  .app-main { padding: var(--space-lg) var(--space-lg) var(--space-xl); }
  .app-footer { padding: var(--space-md) var(--space-lg) var(--space-lg); }
  .split, .split-even { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .class-row { row-gap: var(--space-xs); }
  .class-row > .c-class, .class-row > .c-when { grid-column: 2; }
  .class-row > .c-when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-sm); }
  .class-row > .c-when > p { margin-top: 0; }
  .class-row > .c-when > p:last-child { flex: 1 0 100%; }
}
@media (min-width: 720px) and (max-width: 900px) {
  .class-list-head, .class-row { grid-template-columns: 88px minmax(0, 1fr) minmax(0, 1fr); }
  .class-list-head > :nth-child(3) { display: none; }
  .class-row { grid-template-rows: auto 1fr; }
  .class-row > .c-date { grid-row: 1 / span 2; }
  .class-row > .c-class { grid-row: 1; }
  .class-row > .c-when { grid-row: 2; }
  .class-row > .c-staff { grid-column: 3; grid-row: 1 / span 2; }
}
@media (min-width: 601px) and (max-width: 719px) {
  .class-list-head { display: none; }
  .class-row { grid-template-columns: 80px minmax(0, 1fr); column-gap: var(--space-md); }
  .class-row > .c-date { grid-row: 1 / span 3; }
  .class-row > .c-staff { grid-column: 2; margin-top: var(--space-xs); }
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  :root { --abucear-control-h: var(--abucear-control-h-touch); --abucear-row-inset: var(--space-md); }
  h1 { font-size: var(--fs-title-2); }
  .app-header-inner { flex-wrap: wrap; gap: 0; padding: 0 var(--space-md); min-height: 0; }
  .wordmark { padding: var(--space-sm) 0 var(--space-xxs); }
  .wordmark img { height: 22px; }
  /* Every destination stays visible: items share the row and wrap whole. */
  .app-nav { margin: 0 calc(-1 * var(--space-md)); width: calc(100% + 2 * var(--space-md)); }
  /* Equal columns at every phone width: four tabs, three for non-planners. */
  .app-nav ul { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 0 var(--space-xxs); gap: 0; }
  .app-nav a { width: 100%; justify-content: center; text-align: center; min-height: var(--touch-pref); padding: 0 var(--space-xxs); white-space: nowrap; }
  .section-nav { flex-wrap: wrap; justify-content: space-between; overflow-x: visible; }
  .section-nav a { padding: 0 var(--space-xs); }
  .app-main { padding: var(--space-md) var(--space-md) var(--space-xl); }
  .app-footer { padding: var(--space-md); }
  .card { padding: var(--space-md); border-radius: var(--abucear-radius-card); }
  .rows.card { padding: var(--space-xxs) var(--space-md); }
  .card-head:has(> a:not(.btn)) { margin-bottom: var(--space-xs); }
  .page-head { align-items: flex-start; margin-bottom: var(--space-md); }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn, .card .btn-row .btn { flex: 1 1 auto; }
  .page-head .actions .btn-quiet, .card .btn-row .btn-quiet { flex: none; padding-inline: 0; }
  .card-head > .btn:not(.btn-quiet) { flex: 1 1 100%; }
  .card > .btn:not(.btn-quiet) { width: 100%; }
  .rows > li > .btn-quiet { padding-inline: 0; }
  /* Chips stack beside the chevron instead of pushing it to its own line. */
  .rows .row-link > .cluster.end { display: grid; grid-template-columns: auto auto; justify-items: end; align-items: center; gap: 0 var(--space-xs); }
  .rows .row-link > .cluster.end > :not(.icon) { grid-column: 1; margin-block: 2px; }
  .rows .row-link > .cluster.end > .icon { grid-column: 2; grid-row: 1 / span 2; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-2.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .refresh-bar .spacer { display: none; }
  .row-action { justify-self: stretch; }
  .row-action .btn { width: 100%; }
  .date-block .day { font-size: var(--fs-headline); }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; }
  .form-actions .btn-quiet { width: auto; align-self: flex-start; padding-inline: 0; }
  .form-actions .spacer { display: none; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dd { margin-bottom: var(--space-sm); }
  .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .public-main { padding: var(--space-md) var(--space-md) var(--space-xl); }
  .course-cards { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
  .course-card .btn { justify-self: stretch; }
}
@media (max-width: 420px) {
  .grid-2.keep { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .app-nav ul:has(> li:nth-child(4)) a { font-size: var(--abucear-text-label); }
}
@media (max-width: 400px) {
  .segmented { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---------- Named replacements for the mockups' inline styles ---------- */
.mt-xxs { margin-top: var(--space-xxs); }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.block { display: block; }
.grow { flex: 1 1 auto; min-width: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.cluster.end { justify-content: flex-end; }
.cluster.between { justify-content: space-between; }
.cluster.bottom { align-items: flex-end; flex-wrap: nowrap; }
.emph { color: var(--abucear-text); }
.card-flush { padding-inline: 0; padding-bottom: var(--space-xs); }
.card-flush > .card-head, .card-flush > .card-body { padding-inline: var(--abucear-row-inset); }
/* Phone-only duplicates (class links) and their wide-screen counterparts. */
.phone-only { display: none; }
.card-emphasis { border-color: var(--abucear-brand); border-width: 2px; }
.panel-tight { padding: var(--space-sm) var(--space-md); }
.lede-tight { margin-top: var(--space-xxs); }
.intro { margin: var(--space-xs) 0 var(--space-lg); }
.meta-gap { margin: var(--space-xxs) 0 var(--space-md); }
.form-actions.flush { border-top: 0; padding-top: 0; margin-top: 0; }
.card + .form-actions.flush { margin-top: var(--space-lg); }
.row-selected { background: var(--abucear-bg-tertiary); border-radius: var(--abucear-radius-control); padding-inline: var(--space-sm); }
.rows > li.row-plain { justify-content: flex-start; }
.private-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.history-entry p { margin-top: var(--space-xxs); }
details > :not(summary) + :not(summary) { margin-top: var(--space-xs); }
figure { margin: var(--space-sm) 0 0; }
figcaption { font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); margin-top: var(--space-xxs); }
.sizing-reference { display: block; width: 100%; height: auto; border-radius: var(--abucear-radius-control); }
.copy-text { min-height: 320px; font: 400 var(--abucear-text-small)/1.5 var(--abucear-font-body); white-space: pre-wrap; }
.lesson-row + .lesson-row { margin-top: var(--space-md); }
.record-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); }
.record-cards details + p { margin-top: 0; }
.page-head h1 + .lede, .page-head .eyebrow + h1 { margin-top: var(--space-xxs); }
.inline-list { margin: var(--space-xs) 0 0; padding-left: var(--space-lg); }
@media (max-width: 600px) {
  .cluster.bottom { flex-wrap: wrap; }
  .cluster.bottom .btn { width: 100%; }
}

/* Standalone text links get the full target height (not links inside sentences). */
.card-head > a:not(.btn), .empty > a, .row-main > a, .meta-link { display: inline-flex; align-items: center; min-height: var(--abucear-control-h); }
/* Whole row/card is the target for the title link (stretched link). */
.class-row, .stretch { position: relative; }
.class-row h3 a::after, .stretch h3 a::after { content: ""; position: absolute; inset: 0; }
.stretch .btn, .stretch .panel { position: relative; z-index: 1; }
.class-row:has(h3 a:focus-visible) { outline: var(--abucear-focus-width) solid var(--abucear-focus); outline-offset: -3px; }
.class-row h3 a:focus-visible, .stretch h3 a:focus-visible { outline-offset: 4px; }
.empty > a { min-height: var(--abucear-control-h); }

/* ---------- Page-specific ---------- */
.signin { max-width: 440px; margin: var(--space-xxl) auto 0; }
.signin h1 { margin-bottom: var(--space-xs); }
.signin .lede { color: var(--abucear-text-secondary); margin-bottom: var(--space-lg); }
.refresh-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); padding: var(--space-xs) var(--space-md); border-radius: var(--abucear-radius-control); background: var(--abucear-bg-tertiary); font-size: var(--abucear-text-small); margin-bottom: var(--space-lg); }
.refresh-bar .btn { padding: var(--space-xxs) var(--space-md); }
.refresh-bar .spacer { flex: 1 1 auto; }
/* Staff rows wrap as whole units: the status drops below the name on a
   narrow phone instead of squeezing it, and a name never breaks between
   its words while it fits the line (ABU-24 fix for mockup 06b). */
.staff-card { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xxs) var(--space-md); padding: var(--space-md) 0; border-bottom: 1px solid var(--abucear-border); }
.staff-cards > .staff-card:last-child { border-bottom: 0; }
.staff-card > .who { flex: 1 1 12rem; min-width: 0; }
.staff-card > .status { flex: 0 0 auto; }
.staff-card > :not(.who):not(.status) { flex: 1 0 100%; }
.who-name { display: inline-block; max-width: 100%; }
.staff-card .attrib { font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); }
.inline-form { border-left: 3px solid var(--abucear-border-strong); padding: var(--space-xs) 0 var(--space-xs) var(--space-md); margin-top: var(--space-xs); }
.capture-row { padding: var(--space-md) 0; border-bottom: 1px solid var(--abucear-border); }
.capture-row:last-child { border-bottom: 0; }
.capture-row .who { font-weight: 600; }
.capture-row .planned { font-size: var(--abucear-text-small); color: var(--abucear-text-secondary); margin-bottom: var(--space-xs); }
.my-reply { margin-top: var(--space-xs); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.form-narrow { max-width: 640px; }

/* ---------- Phones: page-specific overrides (after their base rules) ---------- */
@media (max-width: 600px) {
  .staff-card > .status { flex: 1 0 100%; }
  .phone-only { display: block; }
  .hide-phone { display: none; }
}
