/* Extracurricular Manager — shared styles (teal identity, 🎒) */
:root{
  --bg:#f2f8f6; --surface:#ffffff; --surface-2:#e9f3ef; --text:#16241f; --muted:#5c6b64; --line:#dbe8e2;
  --accent:#0d9488; --accent-600:#0f766e; --accent-weak:#e2f4ef; --ring:rgba(13,148,136,.28);
  --radius:16px; --radius-sm:10px; --shadow:0 10px 30px rgba(20,60,45,.10); --shadow-sm:0 2px 8px rgba(20,60,45,.06);
}
*{ box-sizing:border-box; }
html.booting body{ visibility:hidden; }
body{ margin:0; font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--text); line-height:1.5; }
body.dark{ --bg:#0d1714; --surface:#13201b; --surface-2:#19281f; --text:#e7f0eb; --muted:#94a8a0; --line:#26382f; --accent:#2dd4bf; --accent-600:#14b8a6; --accent-weak:#16302a; --ring:rgba(45,212,191,.35); }
a{ color:var(--accent-600); }   /* accent-600 (#0f766e) meets WCAG AA on white/light; plain --accent #0d9488 is only 3.74:1 */
button{ font:inherit; cursor:pointer; }
.wrap{ max-width:1040px; margin:0 auto; padding:0 20px; }

/* header */
header{ background:var(--surface); border-bottom:1px solid var(--line); }
.bar{ display:flex; align-items:center; gap:12px; padding:13px 0; }
.brand{ display:flex; align-items:center; gap:10px; color:inherit; margin-left:22px; text-decoration:none; }
.brand .badge{ width:34px; height:34px; flex:none; border-radius:10px; background:linear-gradient(135deg,#14b8a6,#0d9488); display:flex; align-items:center; justify-content:center; font-size:19px; box-shadow:0 2px 7px rgba(13,148,136,.4); }
.brand .name{ font-weight:800; font-size:18px; letter-spacing:-.01em; color:var(--text); }
.brand .name small{ display:block; font-weight:600; font-size:11.5px; color:var(--muted); letter-spacing:.02em; }
.spacer{ flex:1; }
.who{ color:var(--muted); font-size:14px; max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ghost{ background:transparent; border:1px solid var(--line); color:var(--text); padding:7px 12px; border-radius:10px; }
.ghost:hover{ background:var(--accent-weak); border-color:var(--accent); }
.classconvene-pill{ display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--text); font-weight:600; font-size:13.5px; }
.classconvene-pill:hover{ background:#e6f4ec; border-color:#7fcaa3; color:#1d2a25; }
body.dark .classconvene-pill:hover{ background:#16302a; border-color:#2f7d56; color:#e7f0eb; }
.crumb{ display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-size:13.5px; text-decoration:none; padding:6px 10px; border-radius:9px; }
.crumb:hover{ background:var(--accent-weak); color:var(--accent-600); }

/* landing */
.hero{ padding:32px 0 4px; }
.hero h1{ margin:0 0 6px; font-size:28px; letter-spacing:-.02em; }
.hero p{ margin:0; color:var(--muted); max-width:640px; }
.tiles{ display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:18px; margin:24px 0 40px; }
.tile{ display:block; text-align:left; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:22px; color:inherit; text-decoration:none; transition:transform .12s, box-shadow .12s, border-color .12s; position:relative; }
.tile.go:hover{ transform:translateY(-2px); box-shadow:var(--shadow); border-color:var(--accent); }
.tile.soon{ opacity:.9; cursor:default; }
.tile .ic{ width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:24px; margin-bottom:12px; background:var(--surface-2); }
.tile h3{ margin:0 0 4px; font-size:18px; }
.tile p{ margin:0; color:var(--muted); font-size:14px; line-height:1.45; }
.tag{ display:inline-block; margin-top:12px; font-size:12px; font-weight:700; padding:2px 9px; border-radius:999px; }
.tag.open{ background:var(--accent-weak); color:var(--accent-600); }
.tag.soon{ background:#fff4cc; color:#7a5800; }
body.dark .tag.soon{ background:#3a3416; color:#f0d77a; }

/* generator: two-pane */
.gen{ display:grid; grid-template-columns:390px 1fr; gap:24px; margin:22px 0 50px; align-items:start; }
@media (max-width:860px){ .gen{ grid-template-columns:1fr; } }
.panel{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:18px; }
.panel h2{ margin:0 0 2px; font-size:16px; }
.panel .sub{ margin:0 0 12px; color:var(--muted); font-size:13px; }
.field{ margin-bottom:11px; }
.field label{ display:block; font-size:12.5px; font-weight:700; color:var(--muted); margin-bottom:4px; }
.field input, .field textarea, .field select{ width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:9px; background:var(--bg); color:var(--text); font:inherit; font-size:14px; }
.field input:focus, .field textarea:focus, .field select:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--ring); }
.field textarea{ min-height:64px; resize:vertical; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.checkrow{ display:flex; align-items:center; gap:8px; font-size:13.5px; margin:8px 0; }
.checkrow input{ width:auto; }
.hsep{ border:0; border-top:1px solid var(--line); margin:14px 0; }

/* doc preview + toolbar */
.docwrap{ position:sticky; top:14px; }
.toolbar{ display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.btn{ padding:8px 13px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); font-weight:600; font-size:13.5px; }
.btn:hover{ background:var(--surface-2); }
.btn.primary{ background:#0f766e; color:#fff; border-color:#0f766e; }  /* fixed #0f766e (not the theme var): white text = 5.47:1 in BOTH light and dark (dark --accent-600 #14b8a6 failed white at 2.48:1) */
.btn.primary:hover{ background:#0b5f57; }
.docscroll{ background:#d9e2dd; border-radius:14px; padding:22px; overflow:auto; max-height:calc(100vh - 150px); }
body.dark .docscroll{ background:#0c130f; }
/* zoom pill for a document preview (sticky top-right inside the scroll area) */
.pdfzoom{ position:sticky; top:0; z-index:6; width:fit-content; margin:0 0 8px auto; display:flex; align-items:center; gap:5px;
  background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:4px 7px; box-shadow:0 2px 9px rgba(0,0,0,.16); }
.pdfzoom .pz{ width:27px; height:27px; padding:0; border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:50%; cursor:pointer; font-size:16px; line-height:1; display:flex; align-items:center; justify-content:center; }
.pdfzoom .pz:hover{ background:var(--surface-2); border-color:var(--accent); }
.pdfzoom .pzlbl{ font-size:12.5px; font-weight:600; color:var(--muted); min-width:40px; text-align:center; }
@media print{ .pdfzoom{ display:none !important; } }

/* the printable document */
.doc{ background:#fff; color:#1a1a1a; width:100%; max-width:740px; margin:0 auto; border-radius:6px; box-shadow:0 6px 22px rgba(0,0,0,.16); padding:42px 46px; font-size:14.5px; }
.doc .org{ font-size:13px; letter-spacing:.04em; text-transform:uppercase; color:#0f766e; font-weight:800; }
.doc h1{ margin:4px 0 2px; font-size:25px; color:#111; letter-spacing:-.01em; }
.doc .dsub{ margin:0 0 16px; color:#555; font-size:15px; }
.doc .meta{ display:grid; grid-template-columns:1fr 1fr; gap:7px 22px; margin:14px 0 6px; padding:14px 0; border-top:2px solid #0d9488; border-bottom:1px solid #e3e3e3; }
.doc .meta .m{ font-size:14px; }
.doc .meta .m b{ display:block; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:#0f766e; margin-bottom:1px; }
.doc h3{ margin:18px 0 6px; font-size:14px; text-transform:uppercase; letter-spacing:.04em; color:#0f766e; }
.doc p{ margin:6px 0; line-height:1.55; }
.doc ul{ margin:6px 0; padding-left:20px; }
.doc li{ margin:3px 0; }
.doc .callout{ background:#f0faf7; border-left:4px solid #0d9488; padding:10px 14px; border-radius:0 8px 8px 0; margin:12px 0; font-size:14px; }
.doc .tearoff{ margin-top:26px; padding-top:18px; border-top:2px dashed #9aa6a1; }
.doc .tearoff .scis{ font-size:12px; color:#888; margin-bottom:8px; }
.doc .sigline{ margin:18px 0 4px; border-bottom:1.5px solid #333; height:1px; }
.doc .siglabel{ font-size:11.5px; color:#555; }
.doc .twocol{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.doc .empty-note{ color:#aaa; font-style:italic; }
.doc .blank{ display:inline-block; min-width:130px; border-bottom:1px solid #555; line-height:1.1; }
.doc .filled{ font-weight:700; }
.doc .ft{ margin-top:22px; font-size:11px; color:#999; text-align:center; }

.hidden{ display:none; }
footer{ border-top:1px solid var(--line); color:var(--muted); font-size:13px; padding:18px 0 40px; }

/* ── Accessibility (WCAG 2.1 AA) ─────────────────────────────────────────
   Shared by every page that links ec.css. Keyboard-only focus rings, a
   screen-reader utility, a skip-to-content link, and reduced-motion. */

/* Visible focus ring for keyboard users only (:focus-visible = not on mouse
   click), so pointer users see no change but keyboard/AT users can see where
   they are. High-contrast against both themes. */
:focus-visible{
  outline:3px solid var(--accent);
  outline-offset:2px;
  border-radius:4px;
}
/* inputs already draw their own ring; keep that but add outline for AT */
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible{
  outline:3px solid var(--accent); outline-offset:1px;
}
/* never suppress the outline for keyboard users */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
  outline:3px solid var(--accent); outline-offset:2px;
}

/* Screen-reader-only text: present in the a11y tree, invisible on screen. */
.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;
}

/* Skip-to-content link: first tab stop, slides into view when focused. */
.skip-link{
  position:absolute; left:12px; top:-48px; z-index:1000;
  background:var(--accent); color:#fff; font-weight:700; font-size:14px;
  padding:9px 15px; border-radius:0 0 10px 10px; text-decoration:none;
  transition:top .15s ease;
}
.skip-link:focus{ top:0; outline:3px solid #fff; outline-offset:-3px; }

/* Respect users who ask the OS to minimize motion. */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration:.001ms !important; animation-iteration-count:1 !important;
    transition-duration:.001ms !important; scroll-behavior:auto !important;
  }
}

/* print: only the document */
@media print{
  .no-print{ display:none !important; }
  body{ background:#fff; }
  .gen{ display:block; margin:0; }
  .docwrap{ position:static; }
  .docscroll{ background:#fff; padding:0; max-height:none; overflow:visible; }
  .doc{ box-shadow:none; border-radius:0; max-width:100%; padding:0; }
}
