:root,
[data-theme="ivory"] {
  --bg: #f3eee6;
  --surface: #fffdf9;
  --surface-2: #f7f1e8;
  --ink: #1e1a16;
  --muted: #6e675e;
  --line: #e3dacd;
  --accent: #8c2f3b;
  --accent-ink: #fffdf9;
  --soft: #f6e6e8;
  --sidebar: #241c18;
  --side-ink: #f7f1e8;
  --side-muted: #cbbbaa;
  --side-active: #3a2e28;
  --good: #1d7a4a;
  --warn: #9a6410;
  --danger: #a3262d;
  --shadow: 0 18px 40px rgba(36, 28, 24, 0.08);
  color-scheme: light;
}
[data-theme="midnight"] {
  --bg: #0f141c; --surface: #182232; --surface-2: #121b2a; --ink: #e7eef8; --muted: #9aabbf; --line: #2c3b50;
  --accent: #e2b15a; --accent-ink: #1c1408; --soft: #3a3120; --sidebar: #0a0e14; --side-ink: #e7eef8; --side-muted: #8ea0b5; --side-active: #243246;
  --good: #6dcea0; --warn: #e2b15a; --danger: #f0a0a0; --shadow: 0 18px 40px rgba(0, 0, 0, 0.35); color-scheme: dark;
}
[data-theme="emerald"] {
  --bg: #eef5f0; --surface: #fbfffc; --surface-2: #e7f3ec; --ink: #13241b; --muted: #5c6f64; --line: #d5e4da;
  --accent: #0f6b45; --accent-ink: #ffffff; --soft: #e2f3ea; --sidebar: #0e2a20; --side-ink: #e7f6ee; --side-muted: #b7d2c4; --side-active: #184233;
  --good: #0f6b45; --warn: #8a6414; --danger: #9d2b32; --shadow: 0 18px 40px rgba(14, 42, 32, 0.08); color-scheme: light;
}
[data-theme="ocean"] {
  --bg: #e8f2f5; --surface: #f8fdfd; --surface-2: #e5f4f7; --ink: #102328; --muted: #5a7178; --line: #cfe0e4;
  --accent: #0b6e84; --accent-ink: #ffffff; --soft: #d9f1f5; --sidebar: #082830; --side-ink: #e5f6f8; --side-muted: #a9c9d0; --side-active: #0e3d48;
  --good: #1c7a52; --warn: #9a6410; --danger: #a3262d; --shadow: 0 18px 40px rgba(8, 40, 48, 0.08); color-scheme: light;
}
[data-theme="sunset"] {
  --bg: #fbf1e8; --surface: #fffaf6; --surface-2: #f8eadf; --ink: #2a1c14; --muted: #7a6558; --line: #ead9ca;
  --accent: #c4541a; --accent-ink: #ffffff; --soft: #fde6d6; --sidebar: #3a2218; --side-ink: #fff1e6; --side-muted: #e2c2ae; --side-active: #553226;
  --good: #2d7a45; --warn: #a15c10; --danger: #a3262d; --shadow: 0 18px 40px rgba(58, 34, 24, 0.08); color-scheme: light;
}
[data-theme="royal"] {
  --bg: #161226; --surface: #221c38; --surface-2: #1b1630; --ink: #f3eefe; --muted: #b7adc9; --line: #3a3154;
  --accent: #d7b15a; --accent-ink: #241c08; --soft: #3a3150; --sidebar: #100c1c; --side-ink: #f4efff; --side-muted: #b3a8c8; --side-active: #2c2444;
  --good: #7dcea0; --warn: #e2c06a; --danger: #f0a8b4; --shadow: 0 18px 40px rgba(0, 0, 0, 0.35); color-scheme: dark;
}
[data-theme="slate"] {
  --bg: #eef1f4; --surface: #fbfcfd; --surface-2: #e8eef3; --ink: #1b232c; --muted: #5e6b78; --line: #d5dde5;
  --accent: #2f5f8a; --accent-ink: #ffffff; --soft: #e4eef6; --sidebar: #1c2833; --side-ink: #eef3f7; --side-muted: #b7c4d0; --side-active: #2c3e4e;
  --good: #1d7a4a; --warn: #9a6410; --danger: #a3262d; --shadow: 0 18px 40px rgba(28, 40, 51, 0.08); color-scheme: light;
}
[data-theme="blossom"] {
  --bg: #f8eef2; --surface: #fffafb; --surface-2: #f6e4eb; --ink: #2a1820; --muted: #7a5d68; --line: #ead6de;
  --accent: #a33b62; --accent-ink: #ffffff; --soft: #f8e0e8; --sidebar: #351824; --side-ink: #ffeef3; --side-muted: #e3b8c6; --side-active: #4e2434;
  --good: #2b7a48; --warn: #9a6410; --danger: #8f2438; --shadow: 0 18px 40px rgba(53, 24, 36, 0.08); color-scheme: light;
}
[data-theme="bamboo"] {
  --bg: #f1f4ea; --surface: #fcfdf8; --surface-2: #e8f0dc; --ink: #1c2414; --muted: #616b54; --line: #dde4cf;
  --accent: #4e6b2c; --accent-ink: #ffffff; --soft: #e7f0d6; --sidebar: #1d2914; --side-ink: #f3f7ea; --side-muted: #c5d2b0; --side-active: #31441f;
  --good: #3d6b28; --warn: #8a6414; --danger: #9d2b32; --shadow: 0 18px 40px rgba(29, 41, 20, 0.08); color-scheme: light;
}
[data-theme="crimson"] {
  --bg: #f8eeee; --surface: #fffafa; --surface-2: #f8e4e6; --ink: #241416; --muted: #745c60; --line: #ead6d8;
  --accent: #9d1c2c; --accent-ink: #ffffff; --soft: #f8e0e3; --sidebar: #2c1216; --side-ink: #fff0f1; --side-muted: #e2b8bc; --side-active: #451c22;
  --good: #1d7a4a; --warn: #9a6410; --danger: #7a1522; --shadow: 0 18px 40px rgba(44, 18, 22, 0.08); color-scheme: light;
}
[data-theme="arctic"] {
  --bg: #eef4fb; --surface: #f9fbfe; --surface-2: #e7f0fa; --ink: #142033; --muted: #5d6e84; --line: #d5e1ef;
  --accent: #2a6fdb; --accent-ink: #ffffff; --soft: #e3eeff; --sidebar: #102033; --side-ink: #eaf2ff; --side-muted: #b7c8e0; --side-active: #1c3554;
  --good: #1d7a4a; --warn: #9a6410; --danger: #a3262d; --shadow: 0 18px 40px rgba(16, 32, 51, 0.08); color-scheme: light;
}
[data-theme="amber"] {
  --bg: #f8f1e4; --surface: #fffdf8; --surface-2: #f6ead6; --ink: #271c10; --muted: #756554; --line: #eadcc6;
  --accent: #8a5a12; --accent-ink: #ffffff; --soft: #f6e7cc; --sidebar: #2c2114; --side-ink: #fff6e8; --side-muted: #e0cbae; --side-active: #433220;
  --good: #2d7a45; --warn: #8a5a12; --danger: #a3262d; --shadow: 0 18px 40px rgba(44, 33, 20, 0.08); color-scheme: light;
}
[data-theme="graphite"] {
  --bg: #141516; --surface: #1e2022; --surface-2: #17181a; --ink: #f2f1ef; --muted: #b0ada8; --line: #34373b;
  --accent: #d6d3cc; --accent-ink: #161514; --soft: #2c2e31; --sidebar: #0e0f10; --side-ink: #f4f3f1; --side-muted: #b7b4ae; --side-active: #2a2c2f;
  --good: #8fceb0; --warn: #e2c27a; --danger: #f0b0b0; --shadow: 0 18px 40px rgba(0, 0, 0, 0.35); color-scheme: dark;
}
[data-theme="lagoon"] {
  --bg: #e7f6f5; --surface: #f6fffe; --surface-2: #dff3f1; --ink: #0e2424; --muted: #567170; --line: #c9e4e2;
  --accent: #0e7c78; --accent-ink: #ffffff; --soft: #d7f3f1; --sidebar: #08302e; --side-ink: #e7fbf9; --side-muted: #a9d4d0; --side-active: #0e4744;
  --good: #1d7a4a; --warn: #9a6410; --danger: #a3262d; --shadow: 0 18px 40px rgba(8, 48, 46, 0.08); color-scheme: light;
}
[data-theme="plum"] {
  --bg: #f5eef6; --surface: #fefaff; --surface-2: #f3e6f6; --ink: #241428; --muted: #6e5a74; --line: #e4d5e8;
  --accent: #7a3e86; --accent-ink: #ffffff; --soft: #f3e4f6; --sidebar: #2a1630; --side-ink: #fbefff; --side-muted: #d7bddc; --side-active: #412048;
  --good: #2d7a45; --warn: #9a6410; --danger: #a3262d; --shadow: 0 18px 40px rgba(42, 22, 48, 0.08); color-scheme: light;
}
[data-theme="sandstone"] {
  --bg: #f6f0e6; --surface: #fffcf7; --surface-2: #f3e8d8; --ink: #2a241c; --muted: #74695c; --line: #e6dccb;
  --accent: #8d6239; --accent-ink: #ffffff; --soft: #f4e6d4; --sidebar: #3a2e24; --side-ink: #fff6ec; --side-muted: #e0cdb8; --side-active: #524233;
  --good: #2d7a45; --warn: #9a6410; --danger: #a3262d; --shadow: 0 18px 40px rgba(58, 46, 36, 0.08); color-scheme: light;
}
[data-theme="pine"] {
  --bg: #e9f2ee; --surface: #f7fbf9; --surface-2: #e1efe7; --ink: #10241c; --muted: #56685f; --line: #cfe0d7;
  --accent: #1e5c45; --accent-ink: #ffffff; --soft: #dceee4; --sidebar: #0c241c; --side-ink: #e8f6ef; --side-muted: #b5d0c4; --side-active: #16382c;
  --good: #1e5c45; --warn: #8a6414; --danger: #9d2b32; --shadow: 0 18px 40px rgba(12, 36, 28, 0.08); color-scheme: light;
}
[data-theme="cobalt"] {
  --bg: #eaf0fb; --surface: #f8faff; --surface-2: #e4ebf8; --ink: #121a33; --muted: #5c6888; --line: #d4def2;
  --accent: #243e9b; --accent-ink: #ffffff; --soft: #e1e8fb; --sidebar: #121a38; --side-ink: #eef2ff; --side-muted: #b7c2e4; --side-active: #1e2c58;
  --good: #1d7a4a; --warn: #9a6410; --danger: #a3262d; --shadow: 0 18px 40px rgba(18, 26, 56, 0.08); color-scheme: light;
}
[data-theme="rosewood"] {
  --bg: #f8eee9; --surface: #fffaf8; --surface-2: #f6e6df; --ink: #2a1814; --muted: #7a6158; --line: #ead9d2;
  --accent: #8e3d36; --accent-ink: #ffffff; --soft: #f8e4de; --sidebar: #351c18; --side-ink: #fff1ec; --side-muted: #e4c2b8; --side-active: #4e2a24;
  --good: #2d7a45; --warn: #9a6410; --danger: #8f2430; --shadow: 0 18px 40px rgba(53, 28, 24, 0.08); color-scheme: light;
}
[data-theme="mono"] {
  --bg: #f4f4f4; --surface: #ffffff; --surface-2: #ececec; --ink: #111111; --muted: #5c5c5c; --line: #dddddd;
  --accent: #111111; --accent-ink: #ffffff; --soft: #ececec; --sidebar: #111111; --side-ink: #f5f5f5; --side-muted: #c8c8c8; --side-active: #2a2a2a;
  --good: #1d6b3a; --warn: #7a5a10; --danger: #8f1d1d; --shadow: 0 18px 40px rgba(0, 0, 0, 0.08); color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3, h4 { font-family: Palatino, "Palatino Linotype", Georgia, serif; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 0.3em; }
h1 { font-size: 2.4rem; line-height: 1.1; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 0.95rem; margin-top: 1rem; text-transform: uppercase; letter-spacing: 0.08em; font-family: "Segoe UI", sans-serif; }
p { margin: 0 0 0.8rem; }
a { color: var(--accent); }
img { max-width: 100%; }

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(400px, 0.9fr);
}
.auth-story {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--side-ink) 9%, transparent) 0, transparent 38%),
    linear-gradient(color-mix(in srgb, var(--side-ink) 5%, transparent) 1px, transparent 1px) 0 0 / 100% 44px,
    var(--sidebar);
  color: var(--side-ink);
  padding: 48px clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-width: 0;
}
.auth-story h1 { font-size: clamp(2.2rem, 3.6vw, 3.2rem); line-height: 1.05; margin: 6px 0 14px; overflow-wrap: anywhere; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand .auth-dept { margin: 0; }
.auth-login .seal-lg { width: 56px; height: 56px; font-size: 1rem; flex: none; }
.auth-features { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; max-width: 34rem; }
.auth-features li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--side-ink) 14%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--side-ink) 4%, transparent); }
.auth-features b { font-family: Palatino, Georgia, serif; font-size: 0.9rem; letter-spacing: 0.06em; opacity: 0.7; padding-top: 2px; }
.auth-features span { color: var(--side-muted); font-size: 0.95rem; line-height: 1.45; }
.auth-features strong { display: block; color: var(--side-ink); font-weight: 600; margin-bottom: 2px; }
.auth-story .auth-foot { margin: 0; font-size: 0.85rem; }
.auth-dept { margin: 18px 0 0; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.85rem; opacity: 0.85; }
.auth-story p { color: var(--side-muted); max-width: 38rem; font-size: 1.08rem; }
.seal, .seal-lg {
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--side-ink) 35%, transparent);
  border-radius: 50%;
  font-family: Palatino, Georgia, serif;
  letter-spacing: 0.08em;
}
.seal { width: 48px; height: 48px; }
.seal-lg { width: 84px; height: 84px; font-size: 1.4rem; }
.auth-panel { display: grid; place-items: center; padding: 72px 24px 40px; min-width: 0; }
.auth-card { width: min(440px, 100%); }
.auth-card h2 { font-size: 2rem; }
.auth-login .auth-card { padding: 36px 34px 30px; border-radius: 20px; }
.auth-login .auth-card h2 { margin-bottom: 4px; }
.auth-sub { color: var(--muted); margin-bottom: 20px; font-size: 0.95rem; }
.auth-form { display: grid; gap: 16px; }
.auth-form .field { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.auth-form input { width: 100%; min-height: 46px; padding: 10px 14px; font-size: 1rem; border-radius: 12px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.auth-label-row a { font-weight: 500; font-size: 0.85rem; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 74px; }
.password-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 6px 8px; border-radius: 8px; cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { background: var(--surface-2); color: var(--ink); }
.caps-warning { color: var(--warn); font-weight: 600; font-size: 0.82rem; }
.auth-submit { width: 100%; min-height: 48px; justify-content: center; font-size: 1rem; margin-top: 4px; }
.auth-submit[disabled] { opacity: 0.7; cursor: progress; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--muted); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-secondary { width: 100%; min-height: 46px; justify-content: center; }
.auth-links { margin: 16px 0 0; text-align: center; font-size: 0.85rem; }
.auth-links a { color: var(--muted); }
.auth-reset .auth-story { position: sticky; top: 0; align-self: start; min-height: 100vh; justify-content: center; gap: 28px; padding-bottom: 72px; }
.auth-reset .auth-pitch h1 { margin-top: 0; }
.auth-reset .auth-features { margin-top: 20px; gap: 10px; }
.auth-reset .auth-foot { position: absolute; left: clamp(28px, 5vw, 64px); bottom: 28px; }
.auth-reset .auth-panel { padding-top: 64px; padding-bottom: 32px; }
.auth-reset .auth-card { width: min(460px, 100%); padding-top: 30px; padding-bottom: 24px; }
.auth-reset .auth-sub { margin-bottom: 14px; }
.auth-reset .auth-form { gap: 12px; }
.auth-reset .auth-form .field { gap: 4px; }
.auth-reset .auth-divider { margin: 16px 0 12px; }
.guest-lang:has(+ .auth-reset) { position: absolute; }
.auth-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 4px 0 18px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.auth-methods a { padding: 9px 10px; border-radius: 9px; text-align: center; font-weight: 600; font-size: 0.9rem; color: var(--muted); text-decoration: none; }
.auth-methods a:hover { color: var(--ink, inherit); background: var(--surface); }
.auth-methods a.is-active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.picture-quality { max-width: 360px; margin: 10px 0; }
.program-table td { vertical-align: top; }
.program-table tr.is-editing td { background: var(--surface-2); }
.program-specs { margin: 0; padding-left: 18px; }
.program-actions { white-space: nowrap; }
.program-actions .inline-form { display: inline; }
.program-form-title { margin: 20px 0 8px; }
.rank-steps td:first-child { width: 30%; }
.rank-steps td.num { font-weight: 700; width: 80px; }
.rank-steps tr.total td { border-top: 2px solid var(--line); background: var(--surface-2); }
.rank-math { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rank-rule-table td:first-child { width: 18%; }
.rank-rule-table td:nth-child(3) { width: 30%; }
.rank-formula { padding: 10px 14px; border-left: 3px solid var(--line); background: var(--surface-2); }
.reset-account { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.reset-account > span { color: var(--muted); font-size: 0.85rem; }
.reset-account strong { overflow-wrap: anywhere; }
.reset-code { font-family: Consolas, "Courier New", monospace; font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; }
.change-password { width: min(520px, 100%); margin: 0 auto; }
.change-password .auth-form { display: grid; gap: 14px; margin-top: 16px; }
.change-password-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.change-password-out { margin-top: 14px; }
.auth-step { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 10px; }
.auth-step legend { width: 100%; display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 8px; font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.auth-step + .auth-step legend { padding-top: 14px; border-top: 1px solid var(--line); }
.auth-step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 0.8rem; font-weight: 700; }
.auth-form .field-hint { margin-top: 0; font-weight: 400; }
.auth-help { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.auth-fine { margin: 0; text-align: center; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }

.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
  background: var(--sidebar);
  color: var(--side-ink);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; padding: 4px 8px 18px; }
.nav-close { display: none; }
.brand strong { display: block; font-family: Palatino, Georgia, serif; font-size: 1.35rem; line-height: 1.1; }
.brand small { display: block; font-size: 0.8rem; }
.brand small { color: var(--side-muted); }
.nav { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; margin: 0 -6px; padding: 0 6px 12px; scrollbar-width: thin; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { border-top: 1px solid color-mix(in srgb, var(--side-muted) 22%, transparent); padding-top: 6px; }
.nav-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--side-muted); border-radius: 8px; user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary span { flex: 1; }
.nav-group summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; margin-right: 2px; }
.nav-group:not([open]) summary::after { transform: rotate(-45deg); }
.nav-group summary:hover { color: var(--side-ink); }
.nav-group summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: none; }
.nav-group:not([open]) .nav-dot { display: block; }
.nav-group > a { padding-left: 16px; }
.nav-main > a { padding-left: 12px; }
.nav a {
  color: var(--side-muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav a.active, .nav a:hover { background: var(--side-active); color: var(--side-ink); }
.nav em {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 99px;
  min-width: 1.4rem;
  text-align: center;
  font-style: normal;
  font-size: 0.75rem;
  padding: 0 6px;
}
.main { padding: 0 28px 56px; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  margin: 0 -28px 12px; padding: 10px 28px; min-height: 60px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { color: var(--muted); margin: 0; font-size: 0.9rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb strong { color: var(--ink); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 99px; color: var(--ink); text-decoration: none; }
.user-chip:hover { background: var(--surface-2); }
.user-chip .avatar.tiny { width: 32px; height: 32px; border-radius: 50%; font-size: 0.75rem; }
.user-chip strong, .user-chip small { display: block; line-height: 1.2; }
.user-chip strong { font-size: 0.88rem; font-weight: 600; }
.user-chip small { color: var(--muted); font-size: 0.75rem; }
.signout { margin: 0; }
.btn.signout-btn { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); background: var(--surface); }
.btn.signout-btn:hover { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }

.tabs {
  display: flex; gap: 4px; margin: 4px 0 16px; padding: 0 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 12px 14px 10px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 0.92rem; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs em { font-style: normal; font-size: 0.72rem; padding: 0 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.tabs button.active em { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
html:not(.js) .tabs { display: none; }
html:not(.js) .tab-panel + .tab-panel { margin-top: 16px; }
html.js .tab-panel:not(.active) { display: none; }
.tab-panel > * + * { margin-top: 16px; }
.tab-panel > :first-child { margin-top: 0 !important; }
.nav-toggle, .backdrop { display: none; }

.flash { padding: 12px 14px; border-radius: 12px; margin: 12px 0 18px; background: var(--soft); border: 1px solid var(--line); }
.flash.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.flash.ok { background: color-mix(in srgb, var(--good) 12%, var(--surface)); }

.hero, .card, .auth-card, .letter-sheet, .stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.hero { display: grid; grid-template-columns: auto 1fr; gap: 22px; padding: 22px; margin: 12px 0 18px; align-items: center; }
.hero.compact { gap: 16px; padding: 16px 18px; margin: 8px 0 12px; }
.hero.compact .avatar { width: 72px; height: 72px; border-radius: 18px; font-size: 1.4rem; }
.hero.compact h1 { margin: 0 0 2px; font-size: 1.6rem; }
.hero.compact .sub { margin: 0 0 8px; }
.kicker { margin: 0 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; }
.sub { color: var(--muted); }
.pills, .toolbar, .section-head, .predict-top, .match-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-head, .toolbar { justify-content: space-between; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 3px 10px; font-size: 0.82rem; background: var(--surface-2); border: 1px solid var(--line); }
.pill.good { color: var(--good); }
.pill.bad { color: var(--danger); }
.pill.muted { color: var(--muted); }
.pill.warn { color: var(--warn); }
.pill.good::before, .pill.muted::before, .pill.bad::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}

.avatar, .avatar.placeholder {
  width: 112px; height: 112px; border-radius: 28px; object-fit: cover;
  display: grid; place-items: center; background: var(--soft); color: var(--accent);
  font-family: Palatino, Georgia, serif; font-size: 2rem;
}
.avatar.small { width: 42px; height: 42px; border-radius: 12px; font-size: 0.95rem; }
.avatar.tiny { width: 36px; height: 36px; border-radius: 10px; font-size: 0.8rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 18px; }
.card, .stat { padding: 18px; }
.stat strong { display: block; font-size: 1.6rem; font-family: Palatino, Georgia, serif; }
.stat span, .quiet { color: var(--muted); }
.sign-card .glyph, .reading .glyph { font-size: 3rem; line-height: 1; }
.sign-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.element { margin: 0; color: var(--accent); }
.span { color: var(--muted); margin: 0; }
.traits { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0 0; list-style: none; }
.traits li { background: var(--soft); border-radius: 99px; padding: 3px 10px; font-size: 0.85rem; }
.facts, .lucky { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.facts div, .lucky div { border-top: 1px solid var(--line); padding-top: 8px; }
.facts dt, .lucky dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.facts dd, .lucky dd { margin: 2px 0 0; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; text-decoration: none; cursor: pointer; font: inherit;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { background: var(--danger); color: white; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.field.full, .form-grid > .full { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 12px; padding: 10px 12px; font: inherit;
}
textarea { min-height: 180px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack-form, .inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.backup-actions .inline-form { margin-top: 0; }
.backup-name { overflow-wrap: anywhere; }
.backup-create { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
#picture-storage .table-wrap { margin-bottom: 14px; }
.storage-table td:nth-child(5), .storage-table td:last-child, .storage-table .btn { white-space: nowrap; }
#picture-storage .check-line { margin: 14px 0 10px; }
.choice { display: flex; gap: 16px; }
.choice label { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.choice input { width: auto; margin: 0; flex: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.person { display: flex; gap: 10px; align-items: center; }
.person small { display: block; color: var(--muted); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.filters .field { min-width: 180px; }
.pdf-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.letter-sheet { padding: 36px 40px; max-width: 760px; }
.letter-sheet p, .letter-body { font-family: Palatino, Georgia, serif; font-size: 1.05rem; }
.letter-body { white-space: pre-wrap; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 120px 1fr 32px; gap: 8px; align-items: center; font-size: 0.9rem; }
.bar i { display: block; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.check strong { display: flex; justify-content: space-between; gap: 8px; }
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.theme-card { text-align: left; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: inherit; cursor: pointer; font: inherit; }
.theme-card.active { outline: 2px solid var(--accent); }
.swatches { display: flex; gap: 6px; margin-bottom: 8px; }
.swatches i { width: 22px; height: 22px; border-radius: 50%; display: block; border: 1px solid var(--line); }
.reading-grid, .predict-grid, .match-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.person-block { margin: 18px 0 28px; }
.meter { display: inline-flex; gap: 4px; }
.meter i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; }
.meter[data-score="2"] i:nth-child(-n+2),
.meter[data-score="3"] i:nth-child(-n+3),
.meter[data-score="4"] i:nth-child(-n+4),
.meter[data-score="5"] i:nth-child(-n+5) { background: var(--accent); }
.combined { margin-top: 16px; }
.combined-summary { font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.12rem; line-height: 1.6; }
.agreed { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.trait-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 8px; }
.trait-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); border-top: 4px solid var(--good); }
.trait-box.bad { border-top-color: var(--danger); }
.trait-box h4 { margin-top: 0; }
.trait-box ul { margin: 0; padding-left: 18px; }
.trait-box li { margin: 4px 0; }
.toggles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 12px 0 16px; }
.toggle {
  display: flex; gap: 10px; align-items: center; padding: 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer;
}
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.toggle strong, .toggle small { display: block; }
.toggle small { color: var(--muted); }
.toggle:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.note { font-size: 0.92rem; color: var(--muted); }
.analytics { margin-top: 16px; }
.analytics-title { margin: 22px 0 4px; font-size: 1.1rem; }
.analytics-title h3 { margin: 0; font-size: 1.1rem; }
.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.analytics-grid .span-2 { grid-column: span 2; }
.chart-card h3 { margin: 0 0 14px; font-size: 1.02rem; }
.chart-foot { margin: 8px 0 0; font-size: 0.82rem; }
.stat small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.78rem; }
.cols { display: flex; align-items: stretch; gap: 5px; height: 170px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.col em { font-style: normal; font-size: 0.72rem; color: var(--muted); min-height: 1.1em; }
.col i { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 8px 8px 4px 4px; overflow: hidden; }
.col b { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; }
.col span { margin-top: 4px; font-size: 0.72rem; color: var(--muted); }
.donut-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.donut, .ring { flex: none; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; }
.ring { background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.donut > div, .ring > div { width: 64%; height: 64%; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.donut strong, .ring strong { font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.4rem; line-height: 1.1; }
.donut span, .ring span { font-size: 0.72rem; color: var(--muted); }
.legend { flex: 1; min-width: 150px; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.88rem; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 38px; gap: 8px; align-items: center; }
.legend i { display: block; width: 12px; height: 12px; border-radius: 4px; }
.legend small { color: var(--muted); text-align: right; }
.checklist { flex: 1; min-width: 150px; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.9rem; }
.checklist li::before { content: "✓"; margin-right: 8px; color: var(--good); font-weight: 700; }
.checklist li.missing { color: var(--muted); }
.checklist li.missing::before { content: "○"; color: var(--muted); }
.bars.wide .bar { grid-template-columns: minmax(90px, 140px) 1fr 44px; }

body.has-bg { --bg-veil: color-mix(in srgb, var(--bg) 72%, transparent); }
body.has-bg.bg-subtle { --bg-veil: color-mix(in srgb, var(--bg) 86%, transparent); }
body.has-bg.bg-vivid { --bg-veil: color-mix(in srgb, var(--bg) 45%, transparent); }
body.has-bg {
  background-color: var(--bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.has-bg .main > h1, .has-bg .main > .kicker, .has-bg .analytics-title, .has-bg .analytics > .section-head, .has-bg .crumb {
  text-shadow: 0 1px 10px var(--bg), 0 0 2px var(--bg);
}
.has-bg .auth-panel { backdrop-filter: blur(2px); }
.theme-thumb { display: block; height: 74px; margin: -12px -12px 10px; border-radius: 16px 16px 0 0; background: center / cover no-repeat; }
.bg-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.bg-option { position: relative; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; font-size: 0.88rem; }
.bg-option input { position: absolute; top: 8px; left: 8px; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.bg-option:has(input:checked) { outline: 2px solid var(--accent); background: var(--soft); }
.bg-option:has(input:focus-visible) { outline: 2px dashed var(--accent); }
.bg-preview { display: grid; place-items: center; height: 78px; border-radius: 10px; background: center / cover no-repeat var(--bg); border: 1px solid var(--line); }
.bg-preview.empty { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 16px); }
.bg-preview b { padding: 2px 10px; border-radius: 99px; background: var(--surface); font-size: 0.78rem; }
.inline-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-settings .field { min-width: 240px; }
.check-line { display: flex; gap: 8px; align-items: center; font-size: 0.92rem; padding-bottom: 10px; }
.check-line input { accent-color: var(--accent); width: auto; flex: none; margin: 0; }
.upload-steps { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; }
.upload-steps .button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.curriculum-year h3 { margin: 18px 0 6px; font-size: 1rem; }
.curriculum-year h3:first-of-type { margin-top: 4px; }
.curriculum-table td.num, .curriculum-table th.num, .table-wrap th.num, .table-wrap td.num { text-align: center; width: 64px; white-space: nowrap; }
.curriculum-table tfoot th, .curriculum-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line); }
.curriculum-table tfoot th { text-transform: none; letter-spacing: 0; font-size: 0.92rem; color: inherit; text-align: right; }
.curriculum-table td:first-child { white-space: nowrap; }
.toolbar select { min-width: 280px; }
.cert-type { margin-bottom: 14px; }
.system-suggestion { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.system-suggestion h3 { margin: 0; }
.suggestion-text { margin: 8px 0 0; white-space: pre-wrap; font: inherit; font-size: 0.9rem; line-height: 1.5; }
.comment-text { white-space: pre-wrap; }
.invite-link { display: flex; gap: 6px; align-items: center; min-width: 260px; }
.invite-link input { flex: 1; min-width: 0; padding: 4px 8px; font-size: 0.8rem; font-family: ui-monospace, Consolas, monospace; }
.term-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 6px; }
.term-head h3, .curriculum-year .term-head h3 { margin: 0; }
.curriculum-year > .term-head:first-of-type, .curriculum-year > .grade-form:first-of-type .term-head { margin-top: 4px; }
.term-year { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.term-year select { min-width: 0; padding: 4px 8px; }
.grade-select { min-width: 78px; padding: 4px 6px; }
.remarks-input { width: 100%; min-width: 120px; padding: 4px 8px; }
.lock-all { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.curriculum-table tr.is-locked td { background: var(--surface-2); }
.grade-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 4px; }
.slip-terms { display: grid; gap: 18px; margin-top: 16px; }
.slip-term h3 { margin: 0 0 8px; font-size: 1rem; }
.slip-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.slip-thumbs figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.slip-thumbs img { display: block; width: 100%; height: 200px; object-fit: cover; }
.slip-thumbs figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; }

.display-toggles { grid-template-columns: repeat(4, 1fr); }
.single { display: grid; grid-template-columns: 1fr; }

.learning-grid { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 20px; align-items: start; }
.learning-bars { display: grid; gap: 10px; }
.lbar { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; align-items: center; font-size: 0.92rem; }
.lbar span { display: flex; gap: 8px; align-items: center; }
.lbar span b, .vark-legend b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: #fff; font-size: 0.8rem; }
.lbar i { display: block; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.lbar em { display: block; height: 100%; border-radius: 99px; }
.lbar strong { text-align: right; }
.lbar.primary { font-weight: 600; }
.learning-detail { display: grid; gap: 14px; }
.learning-style { border: 1px solid var(--line); border-left: 5px solid var(--style); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.learning-style h3 { color: var(--style); margin-bottom: 4px; }
.learning-lists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.learning-lists h4 { margin-top: 4px; }
.learning-lists ul { margin: 0; padding-left: 18px; font-size: 0.92rem; }
.learning-lists li { margin: 3px 0; }
.learning-basis { margin-top: 12px; }
.vark-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 8px; }
.vark-legend span { display: inline-flex; gap: 8px; align-items: center; }
.vark-form { display: grid; gap: 12px; margin-top: 16px; }
.vark-q { margin: 0; border: 1px solid var(--line); transition: border-color 0.2s; }
.vark-q.answered { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.vark-q.missing:not(.answered) { border-color: var(--danger); }
.vark-q legend { display: flex; gap: 10px; align-items: baseline; padding: 0 6px; font-weight: 600; float: left; width: 100%; margin-bottom: 10px; }
.vark-q legend span { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--accent); font-size: 0.85rem; }
.vark-options { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vark-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.vark-option input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.vark-option:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.vark-submit { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.vark-submit p { margin: 0; }
.iq-form { display: grid; gap: 12px; margin-top: 16px; }
.iq-timerbar { position: sticky; top: 70px; z-index: 5; display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.iq-timerbar p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.iq-timer { flex: none; font: 600 1.6rem/1 Palatino, Georgia, serif; font-variant-numeric: tabular-nums; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.iq-timer.low { color: var(--danger); border-color: var(--danger); }
.iq-sequence { clear: both; margin: 0 0 12px; font-size: 1.35rem; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.iq-grid { clear: both; display: grid; grid-template-columns: repeat(3, minmax(56px, 84px)); gap: 6px; margin: 0 0 12px; }
.iq-grid span { display: grid; place-items: center; min-height: 52px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 1.15rem; }
.iq-grid span.ask { border-style: dashed; border-color: var(--accent); font-weight: 700; }
.iq-summary { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); gap: 20px; align-items: center; margin-bottom: 8px; }
.iq-summary > * { min-width: 0; }
.iq-score { text-align: center; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.iq-score strong { display: block; font: 600 3rem/1 Palatino, Georgia, serif; }
.iq-score span { display: block; margin-top: 6px; font-weight: 600; }
.iq-score small { display: block; margin-top: 4px; color: var(--muted); }
.iq-domains { display: grid; gap: 10px; }
.iq-domains .lbar { grid-template-columns: 170px minmax(0, 1fr) 44px; }
.iq-domains .lbar em { background: var(--accent); }
.iq-submit { display: flex; justify-content: flex-end; }
.iq-rules { margin: 0 0 14px; padding-left: 20px; }
.iq-rules li { margin: 4px 0; }
.match-decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.match-deck { display: flex; flex-direction: column; gap: 8px; }
.match-deck h2 { margin: 0; font-size: 1.2rem; }
.match-deck p { margin: 0; }
.match-levels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.match-levels .btn small { margin-left: 6px; font-size: 0.76rem; opacity: 0.8; }
.btn.disabled { opacity: 0.5; pointer-events: none; }
.match-bar { position: sticky; top: 70px; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 12px; }
.match-stats { display: flex; flex-wrap: wrap; gap: 22px; }
.match-stats span { display: grid; gap: 2px; }
.match-stats small { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.match-stats strong { font: 600 1.3rem/1 Palatino, Georgia, serif; font-variant-numeric: tabular-nums; }
.match-stats b { font-weight: inherit; }
.match-actions { display: flex; gap: 6px; }
.match-help { margin: 10px 0 0; }
.match-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; perspective: 1000px; }
.match-board.level-hard { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.match-card { position: relative; height: 116px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; transform-style: preserve-3d; transition: transform 0.35s ease; border-radius: 14px; }
.match-card.open, .match-card.matched { transform: rotateY(180deg); cursor: default; }
.match-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.match-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: center; }
.match-back { background: var(--sidebar); border-color: var(--sidebar); box-shadow: inset 0 0 0 5px var(--sidebar), inset 0 0 0 6px var(--side-muted); }
.match-back::after { content: "CCS"; color: var(--side-ink); font: 600 1rem/1 Palatino, Georgia, serif; letter-spacing: 0.12em; opacity: 0.85; }
.match-front { background: var(--surface); transform: rotateY(180deg); font-size: 0.92rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.match-front small { color: var(--muted); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.match-front.term > span { font: 600 1.05rem/1.2 Palatino, Georgia, serif; }
.match-card.matched .match-front { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.match-card.miss .match-front { border-color: var(--danger); }
.match-done { margin: 16px 0 0; text-align: center; font-weight: 600; }
.match-score { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 16px; }
.match-score span { padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); text-align: center; }
.match-score strong { display: block; font: 600 1.8rem/1 Palatino, Georgia, serif; font-variant-numeric: tabular-nums; }
.match-score small { display: block; margin-top: 6px; color: var(--muted); }
.match-result h3 { margin: 0 0 8px; font-size: 1rem; }
.match-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 0 0 16px; }
.match-review div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.match-review dt { font-weight: 700; }
.match-review dd { margin: 2px 0 0; color: var(--muted); }
.match-leaders tr.mine td { background: var(--soft); }
.game-timer { height: 6px; margin: 12px 0; border-radius: 99px; background: var(--line); overflow: hidden; }
.game-timer span { display: block; height: 100%; width: 100%; background: var(--accent); transition: width 0.2s linear; }
.game-timer.low span { background: var(--danger); }
.game-run { display: grid; gap: 12px; }
.game-item { margin: 0; }
.quiz-q { border: 1px solid var(--line); }
.quiz-q legend { display: grid; gap: 6px; float: left; width: 100%; margin-bottom: 14px; padding: 0; }
.quiz-q legend small { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.quiz-q legend strong { font: 600 1.5rem/1.25 Palatino, Georgia, serif; overflow-wrap: anywhere; }
.quiz-options { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quiz-option { min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.quiz-option:hover:not(:disabled) { border-color: var(--accent); }
.quiz-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-option:disabled { cursor: default; }
.quiz-option.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.quiz-option.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.scramble-clue { margin: 0 0 4px; font: 600 1.4rem/1.3 Palatino, Georgia, serif; }
.scramble-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.scramble-tile { display: grid; place-items: center; width: 46px; height: 50px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: 600 1.35rem/1 Palatino, Georgia, serif; cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.scramble-tile.used { opacity: 0.3; box-shadow: none; }
.scramble-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scramble-input { font: 600 1.25rem/1.2 Palatino, Georgia, serif; letter-spacing: 0.08em; text-transform: uppercase; }
.scramble-actions { margin-top: 12px; }
.scramble-feedback { min-height: 1.4em; margin: 10px 0 0; font-weight: 600; }
.scramble-q.solved .scramble-input { border-color: var(--good); }
.scramble-q.solved .scramble-feedback { color: var(--good); }
.scramble-q.revealed .scramble-feedback { color: var(--danger); }
.scramble-q.shake { animation: game-shake 0.3s; }
@keyframes game-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.game-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.game-review li { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 12px; }
.game-review li.miss { border-left-color: var(--danger); }
.game-review li div { display: grid; gap: 2px; }
.game-review li span { color: var(--muted); }
.game-review em { font-size: 0.86rem; font-style: normal; color: var(--danger); }
.game-review li.ok em { color: var(--muted); }
.versus-callout { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 16px; }
.versus-callout h2 { margin: 0; font-size: 1.2rem; }
.versus-callout p { margin: 4px 0 0; }
.versus-callout.invite { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent), var(--shadow); }
.versus-form { display: grid; gap: 14px; }
.versus-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px; }
.versus-player { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.versus-player input { width: auto; flex: none; margin: 0; accent-color: var(--accent); }
.versus-player:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.versus-player span:last-child { display: grid; min-width: 0; }
.versus-player strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versus-player small { color: var(--muted); }
.versus-group { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; margin: 6px 2px 0; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.versus-group:first-child { margin-top: 0; }
.versus-group-empty { grid-column: 1 / -1; margin: 0 2px; }
.presence { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.presence.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.versus-race { display: grid; gap: 6px; flex: 1 1 260px; min-width: 0; }
.versus-lane { display: grid; grid-template-columns: 90px minmax(0, 1fr) 52px; gap: 10px; align-items: center; }
.versus-lane > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.9rem; }
.versus-lane strong { font-variant-numeric: tabular-nums; text-align: right; }
.versus-lane b { font-weight: inherit; }
.versus-track { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.versus-track i { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.3s ease; }
.versus-lane.them .versus-track i { background: var(--muted); }
.versus-countdown { margin: 14px 0 0; text-align: center; font: 600 2.4rem/1 Palatino, Georgia, serif; }
.versus-result { margin-top: 16px; text-align: center; }
.versus-result .row-actions { justify-content: center; }
.versus-result.won { border-color: var(--good); box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 25%, transparent), var(--shadow); }
.match-board.waiting .match-card { cursor: wait; }
.versus-toast { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 10px; max-width: min(360px, calc(100vw - 36px)); padding: 14px 16px; border: 1px solid var(--accent); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.versus-toast p { margin: 0; }
.versus-toast .row-actions { justify-content: flex-end; }
.code-block { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow-x: auto; }
.code-block pre { margin: 0; padding: 12px 14px; font: 0.95rem/1.55 Consolas, "Courier New", monospace; white-space: pre; tab-size: 4; }
.code-block code { font: inherit; }
.code-block.small { margin: 0; border-radius: 10px; }
.code-block.small pre { padding: 8px 10px; font-size: 0.82rem; }
.game-note { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--soft); }
.game-next { margin-top: 12px; }
.game-next[hidden], .game-note[hidden], .game-answer[hidden], .versus-wait[hidden] { display: none; }
.arrange-task { margin: 0 0 4px; font: 600 1.2rem/1.35 Palatino, Georgia, serif; }
.arrange-list { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; }
.arrange-line { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: grab; user-select: none; }
.arrange-line.dragging { border-color: var(--accent); background: var(--soft); box-shadow: var(--shadow); cursor: grabbing; }
.arrange-grip { flex: none; width: 18px; height: 28px; border-radius: 6px; background: radial-gradient(circle, var(--muted) 1.4px, transparent 1.6px) 0 0 / 6px 7px; touch-action: none; }
.arrange-code { flex: 1 1 auto; min-width: 0; overflow-x: auto; font: 0.95rem/1.5 Consolas, "Courier New", monospace; white-space: pre; }
.arrange-move { flex: none; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 0.95rem; cursor: pointer; }
.arrange-move:hover:not(:disabled) { border-color: var(--accent); }
.arrange-move:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.arrange-q.locked .arrange-line { cursor: default; }
.arrange-q.solved .arrange-line { border-color: var(--good); }
.arrange-q.solved .game-feedback { color: var(--good); }
.arrange-q.revealed .game-feedback { color: var(--danger); }
.arrange-q .game-feedback { min-height: 1.4em; margin: 10px 0 0; font-weight: 600; }
.arrange-q .game-answer { margin: 10px 0 0; }
.arrange-q.shake, .bug-q.shake { animation: game-shake 0.3s; }
.game-review.code { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.game-review.code li { align-content: start; }
.code-items { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.code-items li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.code-item-body { display: grid; gap: 6px; align-content: start; }
.code-input { font: 0.92rem/1.5 Consolas, "Courier New", monospace; tab-size: 4; }
.versus-games { display: flex; flex-wrap: wrap; gap: 8px; }
.versus-game { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); cursor: pointer; font-weight: 600; }
.versus-game input { width: auto; margin: 0; accent-color: var(--accent); }
.versus-game:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.versus-lane.wide { grid-template-columns: 90px minmax(0, 1fr) 120px; }
.versus-lane strong small { font-size: 0.8rem; color: var(--muted); }
.versus-wait { margin: 16px 0 0; text-align: center; font-weight: 600; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .match-card, .game-timer span { transition: none; }
  .scramble-q.shake, .arrange-q.shake, .bug-q.shake { animation: none; }
}
.vark-mini { white-space: nowrap; }
.vark-mini span { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 99px; font-size: 0.78rem; border: 1px solid var(--style); color: var(--ink); }

.bday-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; cursor: pointer; font: inherit; font-size: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--surface); color: var(--ink);
}
.bday-btn em { font-style: normal; min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 0.78rem; text-align: center; }
.bday-cake { position: relative; display: inline-block; width: 16px; height: 11px; margin-top: 5px; border-radius: 3px 3px 2px 2px; background: var(--accent); }
.bday-cake::before { content: ""; position: absolute; left: 7px; top: -7px; width: 2px; height: 6px; background: var(--muted); }
.bday-cake::after { content: ""; position: absolute; left: 5.5px; top: -12px; width: 5px; height: 6px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #f2a93b; }
.bday-cake.big { width: 54px; height: 34px; margin: 22px auto 10px; display: block; border-radius: 8px 8px 5px 5px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.12), inset 0 8px 0 rgba(255,255,255,.18); }
.bday-cake.big::before { left: 25px; top: -18px; width: 4px; height: 16px; border-radius: 2px; }
.bday-cake.big::after { left: 22px; top: -30px; width: 10px; height: 13px; animation: flicker 1.4s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.15) rotate(4deg); } }

.bday-modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: auto;
}
.bday-modal[open] { animation: pop 0.25s ease-out; }
.bday-modal::backdrop { background: rgba(10, 8, 6, 0.55); backdrop-filter: blur(3px); }
@keyframes pop { from { transform: translateY(12px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.bday-head { position: relative; overflow: hidden; padding: 12px 24px 18px; text-align: center; background: linear-gradient(160deg, var(--soft), var(--surface)); border-bottom: 1px solid var(--line); }
.bday-head h2 { margin-bottom: 6px; }
.bday-head p:last-child { color: var(--muted); margin: 0; }
.confetti i { position: absolute; top: -10px; width: 7px; height: 12px; border-radius: 2px; opacity: 0.85; animation: fall 3.2s linear infinite; }
.confetti i:nth-child(4n+1) { background: #d9534f; }
.confetti i:nth-child(4n+2) { background: #3b82c4; }
.confetti i:nth-child(4n+3) { background: #d99a2b; }
.confetti i:nth-child(4n) { background: #3f9b5f; }
.confetti i:nth-child(1) { left: 5%; animation-delay: 0s; }
.confetti i:nth-child(2) { left: 12%; animation-delay: 1.1s; }
.confetti i:nth-child(3) { left: 19%; animation-delay: 2.3s; }
.confetti i:nth-child(4) { left: 26%; animation-delay: 0.6s; }
.confetti i:nth-child(5) { left: 33%; animation-delay: 1.8s; }
.confetti i:nth-child(6) { left: 40%; animation-delay: 2.8s; }
.confetti i:nth-child(7) { left: 47%; animation-delay: 0.3s; }
.confetti i:nth-child(8) { left: 54%; animation-delay: 1.5s; }
.confetti i:nth-child(9) { left: 61%; animation-delay: 2.5s; }
.confetti i:nth-child(10) { left: 68%; animation-delay: 0.9s; }
.confetti i:nth-child(11) { left: 75%; animation-delay: 2s; }
.confetti i:nth-child(12) { left: 82%; animation-delay: 0.4s; }
.confetti i:nth-child(13) { left: 89%; animation-delay: 1.3s; }
.confetti i:nth-child(14) { left: 95%; animation-delay: 2.6s; }
@keyframes fall { to { transform: translateY(260px) rotate(540deg); opacity: 0; } }
.bday-body { padding: 8px 24px 4px; }
.learn-head { padding-top: 22px; }
.learn-letters { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.learn-letters b { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; font-size: 1.2rem; box-shadow: 0 6px 14px rgba(0,0,0,.15); }
.learn-letters b:nth-child(odd) { transform: rotate(-6deg); }
.learn-letters b:nth-child(even) { transform: translateY(4px) rotate(5deg); }
.learn-modal .bday-body p { margin: 12px 0; }
.bday-body h3 { margin: 14px 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-family: "Segoe UI", sans-serif; }
.bday-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bday-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.bday-list li.today { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--soft); }
.bday-list strong, .bday-list span { display: block; }
.bday-list span { color: var(--muted); font-size: 0.86rem; }
.bday-list strong .pill { display: inline-flex; font-size: 0.72rem; padding: 1px 8px; }
.bday-list em { font-style: normal; font-size: 0.8rem; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.bday-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px 20px; }
.bday-foot .note { margin: 0; }
.eval-component { border-top: 3px solid var(--c); }
.eval-item { border: 0; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.eval-item legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; }
.eval-item legend span { color: var(--muted); margin-right: 4px; }
.eval-item.missing legend { color: var(--danger); }
.eval-scale { clear: both; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.eval-scale label { position: relative; cursor: pointer; }
.eval-scale input { position: absolute; opacity: 0; pointer-events: none; }
.eval-scale span { display: grid; gap: 2px; text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); transition: border-color 0.15s, background 0.15s; }
.eval-scale b { font-size: 1.05rem; }
.eval-scale small { color: var(--muted); font-size: 0.72rem; line-height: 1.2; }
.eval-scale label:hover span { border-color: var(--c, var(--accent)); }
.eval-scale input:checked + span { border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--surface)); }
.eval-scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.eval-submit { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.eval-submit p { margin: 0; }
.eval-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.eval-person { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.eval-person strong, .eval-person span { display: block; }
.eval-person div span { color: var(--muted); font-size: 0.85rem; }
.eval-person.done { opacity: 0.75; }
.meter { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter b { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.eval-bars { display: grid; gap: 12px; }
.eval-bars > div { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) 44px; gap: 12px; align-items: center; }
.eval-bars > div > span small { color: var(--muted); }
.eval-bars > div > strong { text-align: right; font-variant-numeric: tabular-nums; }
.eval-score { font-family: Palatino, Georgia, serif; font-size: 1.8rem; }
.eval-table th small { color: var(--muted); font-weight: normal; }
.eval-table td { font-variant-numeric: tabular-nums; }
.eval-table .pill { margin: 2px 0; white-space: nowrap; }
.eval-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.eval-comments li { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.comment-author { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 0.82rem; }
.steps { list-style: none; display: flex; gap: 8px; margin: 0 0 16px; padding: 0; flex-wrap: wrap; }
.steps li { flex: 1 1 180px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.85rem; flex: none; }
.steps li.current { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.steps li.current b { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps li.done b { background: color-mix(in srgb, #3f9b5f 18%, var(--surface)); border-color: #3f9b5f; color: #3f9b5f; }
.term-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.term-strip span { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.term-strip strong { font-size: 1.05rem; }
.term-strip p { margin: 0 0 0 auto; color: var(--muted); font-size: 0.85rem; }
.eval-start { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 16px; align-items: start; }
.eval-start > *, .grid-2 > *, .grid-3 > *, .form-grid > *, .analytics-grid > *, .learning-grid > * { min-width: 0; }
.stack { display: grid; gap: 16px; }
.stack > .card { margin: 0; }
.eval-setup { display: grid; gap: 14px; }
.eval-setup .grid-2 { gap: 12px; }
.locked-fields input { background: var(--surface-2); color: var(--ink); font-weight: 600; cursor: not-allowed; }
.locked-fields .field::after { content: "Set by the administrator"; display: block; margin-top: 4px; color: var(--muted); font-size: 0.75rem; }
.btn.big { padding: 12px 22px; font-size: 1rem; justify-self: start; }
.form-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); }
.combo-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.combo { position: relative; margin-top: 6px; }
.combo-input { width: 100%; padding-right: 36px !important; }
.combo-input:disabled { opacity: 0.6; cursor: not-allowed; }
.field[hidden] { display: none; }
#tab-ccs td select { min-width: 96px; }
#tab-ccs td input { min-width: 80px; }
.ccs-add { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.eval-classes { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.eval-classes legend { padding: 0; margin-bottom: 6px; }
.eval-classes.invalid .eval-class:not([hidden]), .eval-classes.invalid .eval-classes-wait { border-color: #d9534f; }
.eval-class { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.eval-class[hidden] { display: none; }
.eval-class:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.eval-class.muted { opacity: 0.55; cursor: not-allowed; }
.eval-class input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; padding: 0; }
.eval-class span { display: grid; gap: 2px; flex: 1; }
.eval-class small { color: var(--muted); }
.eval-class-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.eval-class-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.load-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.load-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.load-list li div { display: grid; gap: 2px; }
.load-list li small { color: var(--muted); }
.load-list form { margin: 0; }
.section-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip-remove { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 0.8rem; }
.chip-remove:hover { border-color: #d9534f; color: #d9534f; }
.combo::before { content: ""; position: absolute; right: 38px; top: 50%; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; opacity: 0.6; }
.combo.has-value::before { display: none; }
.combo-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; display: none; }
.combo.has-value .combo-clear { display: block; }
.combo-clear:hover { background: var(--surface-2); color: var(--ink); }
.combo.invalid .combo-input, input.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.combo.invalid::after { content: "Please choose from the list."; display: block; margin-top: 4px; color: var(--danger); font-size: 0.8rem; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18); display: none;
}
.combo-list.open { display: block; }
.combo-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-list li strong { display: block; font-weight: 600; }
.combo-list li small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.35; margin-top: 2px; }
.combo-list li.active, .combo-list li:hover { background: var(--soft); }
.combo-list li.selected strong::after { content: " \2713"; color: var(--accent); }
.combo-list li.disabled { opacity: 0.5; cursor: not-allowed; }
.combo-list li.disabled:hover { background: none; }
.combo-list .combo-empty { color: var(--muted); cursor: default; }
.combo-detail { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 0.85rem; font-weight: normal; }
.eval-summary-head { display: flex; align-items: center; gap: 12px; }
.eval-summary-head h2 { margin: 0; }
.eval-summary-head .btn { margin-left: auto; }
.eval-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 0; }
.eval-facts div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.eval-facts .wide { grid-column: 1 / -1; }
.eval-facts dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.eval-facts dd { margin: 2px 0 0; font-weight: 600; }
.eval-facts dd small { display: block; font-weight: normal; color: var(--muted); margin-top: 2px; }
.done-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.done-list li { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid #3f9b5f; }
.done-list strong, .done-list span { display: block; }
.done-list span { color: var(--muted); font-size: 0.82rem; }
.toolbar .grow { flex: 1; }
td.actions { white-space: nowrap; }

.confidential, .confidential-bar {
  margin: 12px 0; padding: 12px 16px; border-radius: 12px; color: var(--ink);
  border: 1px solid color-mix(in srgb, #e0a800 60%, var(--line));
  border-left: 5px solid #e0a800;
  background: color-mix(in srgb, #ffd54a 22%, var(--surface));
}
.confidential-title { display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.confidential-title::before { content: "\1F512"; margin-right: 6px; }
.confidential p { margin: 0; }
.confidential ul { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 3px; }
.confidential-bar { margin: 0 0 16px; }
.eval-comment-fields .comment-positive textarea { border-left: 4px solid #3f9b5f; }
.eval-comment-fields .comment-negative textarea { border-left: 4px solid #d9534f; }
.comments-positive { border-top: 3px solid #3f9b5f; }
.comments-negative { border-top: 3px solid #d9534f; }
.eval-comments.positive li { border-left-color: #3f9b5f; }
.eval-comments.negative li { border-left-color: #d9534f; }
.comment-suggestion { margin-top: 16px; }
.comment-suggestion textarea { border-left: 4px solid #3b82c4; }
.comments-suggestion { border-top: 3px solid #3b82c4; }
.eval-comments.suggestion li { border-left-color: #3b82c4; }
.fair-rule {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, #3f9b5f 45%, var(--line));
  border-left: 5px solid #3f9b5f;
  background: color-mix(in srgb, #3f9b5f 10%, var(--surface));
}
.field-hint { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--muted); }
.needs-positive textarea { border-color: #d9534f; box-shadow: 0 0 0 3px color-mix(in srgb, #d9534f 18%, transparent); }
.needs-positive .field-hint { color: #d9534f; font-weight: 600; }
.eval-review { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0 0 10px; }
.eval-review dt { color: var(--muted); }
.eval-review dd { margin: 0; font-weight: 600; }
.assessment-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.assessment-list { border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 10px 14px; }
.assessment-list.good { border-left-color: #3f9b5f; }
.assessment-list.bad { border-left-color: #d9534f; }
.assessment-list.warn { border-left-color: #d99a2b; }
.assessment-list h3 { margin: 0 0 6px; font-size: .9rem; }
.assessment-list ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.rubric { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; min-width: 0; }
.rubric legend { font-weight: 700; padding: 0 6px; }
.rubric > .form-grid { margin-bottom: 8px; }
.rubric-row { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 8px; }
.rubric-row.is-missing .rubric-head strong { color: #d9534f; }
.rubric-head { display: grid; gap: 2px; }
.rubric-scale { display: flex; flex-wrap: wrap; gap: 6px; }
.rubric-scale label { cursor: pointer; }
.rubric-scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rubric-scale span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .85rem; white-space: nowrap; }
.rubric-scale input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.rubric-scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rubric-desc { margin: 0; font-size: .85rem; color: var(--muted); }
.rubric-total { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rubric-total strong { font-size: 1.4rem; }
.rubric-total .btn { margin-left: auto; }
.rubric-result { margin: 10px 0; }
.rubric-result summary { cursor: pointer; font-weight: 600; }
.rubric-table td { vertical-align: top; min-width: 130px; }
.rubric-rule { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 8px 0 12px; }
.rubric-rule p { margin: 2px 0 6px; font-size: .85rem; }
.rubric-rule ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: .88rem; }
.rubric-rule b { display: inline-block; min-width: 150px; }
.rubric-checks { display: grid; gap: 4px; padding: 8px 12px; border-left: 3px solid var(--line); }
.rubric-checks-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.rubric-checks label { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.rubric-checks input { width: auto; margin: 3px 0 0; flex: none; }
.rubric-hint { margin: 2px 0 0; font-size: .85rem; font-weight: 600; }
.rubric-guide summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.rubric-guide dl { margin: 6px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .85rem; }
.rubric-guide dt { font-weight: 700; }
.rubric-guide dd { margin: 0; }
.rubric-indicators { margin: 6px 0 0; padding-left: 18px; font-size: .82rem; }
.rubric-observed { margin-top: 6px; }
.rubric-observed ul { margin: 4px 0 0; padding: 0; list-style: none; font-size: .82rem; }
.rubric-observed li.unseen { color: var(--muted); }
.rubric-observed li.seen span { font-weight: 700; }
.print-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.period-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.segmented a { padding: 6px 16px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.segmented a.active { background: var(--ink); color: var(--surface); }
.trend { font-weight: 700; white-space: nowrap; }
.trend.up { color: var(--good); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--muted); }
.line-chart { width: 100%; height: auto; display: block; }
.score-chart { width: 100%; height: auto; display: block; }
.score-chart.radar { max-width: 480px; margin: 0 auto; }
.score-chart.columns { max-height: 300px; }
.score-hbars { display: grid; gap: .55rem; margin: .5rem 0 .25rem; font-size: .85rem; }
.score-hbar { display: grid; grid-template-columns: 1fr 2.6rem; align-items: center; column-gap: .6rem; row-gap: .15rem; }
.score-hbar-label { grid-column: 1 / -1; line-height: 1.3; }
.score-hbar-track { position: relative; height: 1rem; background: repeating-linear-gradient(to right, #e6e6e6 0 1px, transparent 1px 20%); border-left: 1px solid #ccc; }
.score-hbar-fill { display: block; height: 100%; border-radius: 0 3px 3px 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.score-hbar-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.score-hbar-axis { font-size: .72rem; color: #777; }
.score-hbar-ticks { display: flex; justify-content: space-between; margin: 0 -.25rem; }
.analytics-grid .span-3 { grid-column: 1 / -1; }
.chart-row { margin-bottom: 16px; }
.chart-row .chart-card { margin: 0; }
.line-chart .grid { stroke: var(--line); stroke-width: 1; }
.line-chart text { fill: var(--muted); font-size: 11px; }
.legend.inline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.legend.inline li { display: flex; gap: 6px; align-items: center; }
.legend.inline i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.rank-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.eval-table tr.table-group th { text-align: left; background: #f1f1f1; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: #555; padding-top: .6rem; padding-bottom: .6rem; }
.rank-list li span { margin-right: 8px; }
.eval-table tr.is-current td { background: var(--surface-2); }

.stack-main, .stack-aside { display: grid; gap: 16px; align-content: start; }
.stack-aside > .confidential, .stack-aside > .confidential-bar { margin: 0; }
.complaint-form { display: grid; gap: 14px; }
.complaint-form fieldset { border: 0; padding: 0; margin: 0; }
.complaint-form legend { margin-bottom: 8px; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.category-card { position: relative; display: block; cursor: pointer; }
.category-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.category-card span { display: block; height: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); border-top: 4px solid var(--cat, var(--accent)); background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; }
.category-card strong { display: block; }
.category-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.category-card:hover span { border-color: var(--cat, var(--accent)); }
.category-card input:checked + span { border-color: var(--cat, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat, var(--accent)) 25%, transparent); background: color-mix(in srgb, var(--cat, var(--accent)) 8%, var(--surface)); }
.category-card input:focus-visible + span { outline: 2px solid var(--cat, var(--accent)); outline-offset: 2px; }
.cat-classroom { --cat: #3b82c4; }
.cat-faculty { --cat: #7c5cc4; }
.cat-facilities { --cat: #2f9e8f; }
.cat-bullying { --cat: #d9534f; }
.cat-payment { --cat: #d99a1e; }
.cat-others { --cat: #7a7a7a; }
.urgent-note { display: none; margin: 0; padding: 10px 14px; border-radius: 10px; border-left: 5px solid #d9534f; background: color-mix(in srgb, #d9534f 12%, var(--surface)); }
.complaint-form:has(input[value="bullying"]:checked) .urgent-note { display: block; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); border-left: 4px solid var(--cat, var(--accent)); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.88rem; }
.chip em { font-style: normal; font-weight: 700; color: var(--cat, var(--accent)); }
.chip.active { background: color-mix(in srgb, var(--cat, var(--accent)) 14%, var(--surface)); border-color: var(--cat, var(--accent)); }
.chip.small { padding: 2px 8px; font-size: 0.8rem; white-space: nowrap; }
.filters .grow { flex: 1; min-width: 220px; }
form.filters { align-items: flex-end; }
td .pill { white-space: nowrap; }
tr.row-unread td { font-weight: 600; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.msg { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); max-width: 88%; }
.msg.from-student { border-left: 4px solid var(--cat, #7a7a7a); justify-self: start; }
.msg.from-office { border-right: 4px solid #3f9b5f; justify-self: end; background: color-mix(in srgb, #3f9b5f 8%, var(--surface)); }
.msg-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.msg-head span { color: var(--muted); font-size: 0.8rem; }
.msg-body { white-space: normal; line-height: 1.5; }
.msg-event { justify-self: center; font-size: 0.82rem; color: var(--muted); padding: 4px 12px; border-radius: 99px; background: var(--surface-2); }
.eval-facts.one-col { grid-template-columns: 1fr; }

.regform-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.regform-year h3 { margin: 0 0 10px; }
.regform-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.regform-slot { display: grid; gap: 8px; align-content: start; padding: 10px; border-radius: 12px; border: 1px dashed var(--line); background: var(--surface-2); min-width: 0; }
.regform-slot.has-form { border-style: solid; background: var(--surface); }
.regform-slot.is-current { border: 2px solid var(--accent); }
.regform-slot header strong, .regform-slot header small { display: block; }
.regform-slot header small { color: var(--muted); font-size: 0.78rem; }
.regform-slot .quiet { margin: 0; font-size: 0.85rem; }
.regform-slot .btn { justify-self: start; }
.regform-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.regform-thumbs a { position: relative; display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.regform-thumbs img { display: block; width: 100%; height: 130px; object-fit: cover; }
.regform-thumbs span { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 99px; font-size: 0.7rem; background: rgba(0,0,0,.65); color: #fff; }
.regform-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.regform-meta .pill { font-size: 0.74rem; padding: 2px 8px; }
.regform-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; border-left: 4px solid #d9534f; background: color-mix(in srgb, #d9534f 10%, var(--surface)); font-size: 0.9rem; }
.regform-slot .regform-note { margin: 0; font-size: 0.8rem; }
.regform-check { display: grid; gap: 6px; }
.regform-check input { width: 100%; font-size: 0.82rem; padding: 6px 8px; }
.regform-slot .note { margin: 0; font-size: 0.75rem; }
.regform-upload { display: grid; gap: 14px; }
.regform-drops { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.regform-drop { position: relative; display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface-2); cursor: pointer; transition: border-color 0.15s; }
.regform-drop:hover, .regform-drop:focus-within { border-color: var(--accent); }
.regform-drop.chosen { border-style: solid; border-color: #3f9b5f; }
.regform-drop.invalid { border-color: #d9534f; }
.regform-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.regform-drop-title { font-weight: 600; }
.regform-drop-title small { font-weight: normal; color: var(--muted); }
.regform-preview { display: grid; place-items: center; min-height: 190px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.regform-preview img { display: block; max-width: 100%; max-height: 260px; object-fit: contain; }
.regform-preview em { color: var(--muted); font-style: normal; padding: 12px; text-align: center; }
.regform-file-name { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.regform-drop.invalid .regform-file-name { color: #d9534f; font-weight: 600; }
.regform-icons { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.regform-icons span { display: grid; place-items: end center; width: 56px; height: 72px; padding-bottom: 6px; border-radius: 6px; border: 2px solid currentColor; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; background: repeating-linear-gradient(180deg, transparent 0 10px, color-mix(in srgb, currentColor 18%, transparent) 10px 12px); }
.regform-checklist { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.field-end { display: flex; align-items: end; }
.form-grid .span-2 { grid-column: span 2; }
.activity-drop { margin: 14px 0 12px; }
.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.activity-card { display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; }
.activity-proof { display: block; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.activity-proof img { display: block; width: 100%; height: 180px; object-fit: cover; }
.activity-body { display: grid; gap: 8px; align-content: start; padding: 14px 16px 16px; }
.activity-body h3 { margin: 0; }
.activity-term { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.activity-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.activity-facts dt { color: var(--muted); font-size: 0.85rem; }
.activity-facts dd { margin: 0; overflow-wrap: anywhere; }
.activity-actions, .row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.activity-actions form, .row-actions form { margin: 0; }
.field input[readonly] { background: var(--surface-2); color: var(--muted); cursor: default; }
.certificate-meter { margin: 0 0 16px; }
.loi-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.loi-steps li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.loi-steps h2, .loi-steps h3 { font-size: 1.05rem; margin: 0 0 4px; }
.loi-steps p { margin: 0 0 10px; }
.loi-step-no { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.letter-pdf iframe { width: 100%; height: 75vh; min-height: 480px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.certificate-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 180px; gap: 4px; text-decoration: none; color: var(--muted); }
.certificate-pdf span { font-size: 2rem; font-weight: 700; letter-spacing: 0.08em; color: var(--ink, inherit); }
.lang-switch { display: inline-flex; gap: 0; }
.lang-switch .btn { border-radius: 0; }
.lang-switch .btn:first-child { border-radius: 999px 0 0 999px; }
.lang-switch .btn:last-child { border-radius: 0 999px 999px 0; margin-left: -1px; }
.guest-lang { position: fixed; top: 12px; right: 14px; z-index: 30; }
.top-actions .lang-switch .btn { padding: 5px 10px; font-size: 0.82rem; }
.secret-nudge { margin: 0 0 14px; padding: 9px 14px; border-left: 3px solid var(--warn); background: var(--surface); border-radius: 0 10px 10px 0; }
.link-menu { position: relative; }
.link-menu > summary { list-style: none; cursor: pointer; padding: 5px 12px; font-size: 0.82rem; border-radius: 999px; white-space: nowrap; }
.link-menu > summary::-webkit-details-marker { display: none; }
.link-menu > summary::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.link-menu[open] > summary::after { transform: translateY(-2px) rotate(180deg); }
.link-menu-list {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 230px; max-width: 320px; max-height: 60vh; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.link-menu-list a { display: grid; gap: 1px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.link-menu-list a:hover, .link-menu-list a:focus-visible { background: var(--surface-2); }
.link-menu-list small { color: var(--muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-link-menu { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 14px; }
.site-link-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(180px, 2fr) auto; gap: 8px; align-items: end; padding: 8px 0; border-top: 1px dashed var(--line); }
.site-link-row .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.site-link-roles { display: flex; flex-wrap: wrap; gap: 6px 14px; }
@media (max-width: 760px) {
  .link-menu-list { left: auto; right: 0; }
  .site-link-row { grid-template-columns: 1fr; }
}

.about-guest { max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; display: grid; gap: 16px; }
.about-hero { display: flex; gap: 20px; align-items: flex-start; }
.about-hero h1 { margin: 2px 0; }
.about-lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.about-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.about-modules article { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.about-modules h3 { margin: 0 0 4px; font-size: 1rem; }
.about-modules p { margin: 0 0 6px; }

@media (prefers-reduced-motion: reduce) {
  .confetti i, .bday-cake.big::after, .bday-modal[open] { animation: none; }
}

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-story { padding: 32px 24px; }
  .auth-story h1 { font-size: 2.3rem; }
  .auth-login .auth-story { padding: 64px 22px 26px; gap: 14px; }
  .auth-login .auth-story h1 { font-size: 1.7rem; margin-bottom: 6px; }
  .auth-login .auth-pitch p { font-size: 0.95rem; margin: 0; }
  .auth-login .auth-features, .auth-login .auth-foot { display: none; }
  .auth-login .auth-panel { padding: 24px 16px 40px; place-items: start center; }
  .auth-login .auth-card { padding: 28px 22px 24px; }
  .auth-reset .auth-story { position: relative; min-height: 0; }
  .auth-reset .auth-card h2 { font-size: 1.7rem; line-height: 1.15; }
  .grid-2, .grid-3, .grid-stats, .checks, .themes, .reading-grid, .facts, .lucky, .form-grid, .predict-grid, .match-row { grid-template-columns: minmax(0, 1fr); }
  .themes, .toggles, .trait-grid { grid-template-columns: 1fr 1fr; }
  .analytics-grid, .learning-grid, .learning-lists, .vark-options { grid-template-columns: minmax(0, 1fr); }
  .display-toggles { grid-template-columns: 1fr 1fr; }
  .analytics-grid .span-2, .form-grid .span-2 { grid-column: auto; }
  .eval-scale small { display: none; }
  .eval-start, .eval-facts { grid-template-columns: minmax(0, 1fr); }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .regform-grid, .regform-drops { grid-template-columns: minmax(0, 1fr); }
  .msg { max-width: 100%; }
  .term-strip p { margin-left: 0; }
  .eval-bars > div { grid-template-columns: 1fr 44px; }
  .eval-bars > div > .meter { grid-column: 1 / -1; grid-row: 2; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; transform: translateX(-105%); transition: transform 0.2s ease; width: min(300px, 86vw); }
  .side.open { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 15; }
  .backdrop[hidden] { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 8px 12px; min-height: 40px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  }
  .nav-toggle::before { content: ""; width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; }
  .nav-close {
    display: inline-flex; align-items: center; padding: 6px 12px; margin-top: 4px; min-height: 36px;
    border: 1px solid color-mix(in srgb, var(--side-muted) 40%, transparent); border-radius: 10px; background: transparent; color: var(--side-ink); font: inherit; font-size: 0.85rem; cursor: pointer;
  }
  .side { overflow: hidden; }
  .nav a { padding-top: 12px; padding-bottom: 12px; }
  .nav-group summary { padding: 10px 12px; font-size: 0.74rem; }
  body.menu-open { overflow: hidden; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card, .stat { padding: 16px; }
  .stat strong { font-size: 1.35rem; overflow-wrap: anywhere; }
  .toolbar { align-items: stretch; }
  .toolbar .field, .toolbar .grow { flex: 1 1 100%; min-width: 0; }
  .toolbar select { min-width: 0; width: 100%; }
  .toolbar > .btn { flex: 1 1 auto; justify-content: center; }
  .top-actions { gap: 6px; }
  .btn.signout-btn { white-space: nowrap; }
  .lang-switch .btn { padding-left: 10px; padding-right: 10px; }
  .hero { grid-template-columns: 1fr; }
  .main { padding: 0 16px 40px; }
  .topbar { margin: 0 -16px 12px; padding: 8px 16px; }
  .crumb span, .user-chip span { display: none; }
  .user-chip { padding: 3px; }
  .bday-btn { padding: 6px 10px; }
  .letter-sheet { padding: 22px; }
  .iq-summary { grid-template-columns: minmax(0, 1fr); }
  .iq-domains .lbar { grid-template-columns: minmax(0, 1fr) 70px 40px; }
  .match-board.level-hard { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .crumb { display: none; }
  .nav-toggle { padding: 8px 10px; }
  .main h1 { font-size: 1.8rem; overflow-wrap: anywhere; }
  .tabs button { padding: 11px 10px 9px; font-size: 0.88rem; }
  .actions .btn, td .btn.small { white-space: nowrap; }
  .bday-btn span:not(.bday-cake) { display: none; }
  .iq-timerbar { padding: 10px 14px; }
  .iq-timer { font-size: 1.25rem; padding: 6px 10px; }
  .match-bar { padding: 10px 14px; gap: 8px; }
  .match-stats { gap: 14px; }
  .match-stats strong { font-size: 1.1rem; }
  .match-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .match-board.level-medium, .match-board.level-hard { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .match-card { height: 100px; }
  .match-board.level-hard .match-card { height: 92px; }
  .match-face { padding: 6px 4px; }
  .match-front { font-size: 0.76rem; }
  .match-front.term > span { font-size: 0.9rem; }
  .match-score { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quiz-options { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .quiz-option { min-height: 52px; }
  .quiz-q legend strong, .scramble-clue { font-size: 1.2rem; }
  .scramble-tiles { gap: 6px; }
  .scramble-tile { width: 40px; height: 44px; font-size: 1.15rem; }
  .scramble-actions .btn { flex: 1 1 auto; justify-content: center; }
  .versus-lane { grid-template-columns: 70px minmax(0, 1fr) 44px; gap: 8px; }
  .versus-players { grid-template-columns: minmax(0, 1fr); max-height: 300px; }
  .versus-countdown { font-size: 2rem; }
  .versus-toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
  .versus-lane.wide { grid-template-columns: 64px minmax(0, 1fr) 96px; }
  .code-block pre { padding: 10px; font-size: 0.85rem; }
  .arrange-task { font-size: 1.05rem; }
  .arrange-line { gap: 6px; padding: 5px 6px; }
  .arrange-code { font-size: 0.82rem; }
  .arrange-move { width: 30px; height: 30px; }
  .arrange-actions .btn { flex: 1 1 auto; justify-content: center; }
  .code-items li { grid-template-columns: minmax(0, 1fr); }
  .game-review.code { grid-template-columns: minmax(0, 1fr); }
}
.compliance-table td { vertical-align: top; }
.compliance-table .stack-form { flex-direction: column; align-items: stretch; margin-top: 0; min-width: 200px; }
.compliance-table textarea { min-height: 56px; }
.compliance-table input[type="file"] { max-width: 240px; font-size: 0.85rem; }
.compliance-table .regform-note { margin: 6px 0 0; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link.active { color: var(--accent); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pager-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pager-links [aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.eval-comment-link { margin-top: 6px; }
.faculty-comments h3 { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 1rem; }
.archive-advice { display: block; max-width: 340px; line-height: 1.4; }
.bulk-verify { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.bulk-delete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.bulk-delete button:disabled { opacity: 0.5; cursor: not-allowed; }
.check-col { width: 34px; text-align: center; }
.check-col input { width: 16px; height: 16px; }
tr.group-row th { background: var(--surface-2); font-size: 0.82rem; font-weight: 600; color: var(--muted); text-align: left; letter-spacing: 0.02em; }
.identical-pill { margin-top: 4px; text-decoration: none; font-size: 0.75rem; }
.bday-matrix td, .bday-matrix thead th:not(:first-child) { text-align: center; }
.bday-matrix tbody th { text-align: left; white-space: nowrap; }
.bday-matrix input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.inline-edit { display: inline-block; margin-right: 6px; }
.inline-edit summary { list-style: none; cursor: pointer; }
.inline-edit summary::-webkit-details-marker { display: none; }
.inline-edit[open] { display: block; margin-bottom: 8px; }
.file-jump { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.file-jump a { padding: 5px 11px; border-radius: 999px; font-size: 0.85rem; text-decoration: none; color: var(--ink); background: var(--surface-2); }
.file-jump a:hover, .file-jump a:focus-visible { background: var(--accent); color: var(--accent-ink); }
.file-section { scroll-margin-top: 72px; margin-top: 22px; }
.file-title { margin: 0 0 10px; font-size: 1.35rem; }
.file-title small { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.file-details summary { cursor: pointer; font-weight: 600; }
.file-details h3 { margin: 16px 0 6px; font-size: 1rem; }
.faculty-file-list .person { text-decoration: none; color: inherit; }
.faculty-file-hero .sub { overflow-wrap: anywhere; }
.print-only { display: none; }

@media print {
  .side, .topbar, .toolbar, .stack-form, .btn, .flash { display: none !important; }
  .no-print, .file-jump, .inline-settings { display: none !important; }
  .print-only { display: block; }
  .file-jump { position: static; }
  .shell { display: block; }
  .letter-sheet, .card { box-shadow: none; }
}

.existing-account { margin: 0 0 20px; padding: 18px 20px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; background: var(--surface-2); scroll-margin-top: 64px; }
.existing-account h3 { margin: 2px 0 8px; font-size: 1.2rem; }
.existing-account p { margin: 0 0 10px; }
.existing-account-user { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line); }
.existing-account-user span { color: var(--muted); font-size: 0.85rem; }
.existing-account-user strong { font-size: 1.15rem; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.existing-account-status { font-weight: 600; }
.existing-account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.existing-account .note { margin: 0; }
.security-table td { vertical-align: top; }
.security-ban { display: inline-flex; gap: 6px; align-items: center; margin: 0 6px 6px 0; }
.security-ban select { min-height: 32px; padding: 4px 8px; font-size: 0.85rem; }
.security-agent { display: inline-block; max-width: 260px; overflow-wrap: anywhere; }
