:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --bg: #fafafa;
  --card: #ffffff;
  --accent: #1f4e79;   /* PCS blue */
  --gold: #c9a44b;
  --good: #2f7a3e;
  --warn: #a05a2c;
  --bad: #a63232;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.site {
  background: var(--accent); color: #fff; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
header.site h1 { margin: 0; font-size: 17px; }
header.site .sub { font-size: 12px; opacity: .8; }
header.site nav a { color: #fff; margin-left: 16px; font-size: 14px; }
header.site nav a.active { text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 20px; }
h1, h2, h3 { color: var(--ink); }
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 20px 0 8px; }
h3 { font-size: 15px; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.lede { color: var(--muted); margin: 0 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
button, .btn {
  background: var(--accent); color: #fff; border: 0; padding: 8px 16px; border-radius: 6px;
  font: inherit; font-weight: 600; cursor: pointer;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button.secondary { background: #eee; color: var(--ink); }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; background: #fff;
}
textarea { min-height: 70px; resize: vertical; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 500; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.gold { background: #f6f0dc; color: var(--warn); }
.badge.good { background: #e6f4ea; color: var(--good); }
.badge.warn { background: #fdf1e0; color: var(--warn); }
.badge.bad  { background: #fbe4e4; color: var(--bad); }
.stat { display: inline-flex; flex-direction: column; margin-right: 20px; }
.stat .n { font-size: 32px; font-weight: 700; line-height: 1; }
.stat .u { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
/* iOS-style toggle */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #ccc; border-radius: 26px; transition: .2s; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background-color: var(--gold); }
.switch input:checked + .slider:before { transform: translateX(20px); }
/* Expandable lesson rows */
.lesson-row summary { list-style: none; outline: none; }
.lesson-row summary::-webkit-details-marker { display: none; }
.lesson-row summary > div:first-child::before {
  content: "\25B8";
  display: inline-block; width: 14px; color: var(--muted);
  transition: transform .15s ease; margin-right: 4px; font-weight: 400;
}
.lesson-row[open] > summary > div:first-child::before { transform: rotate(90deg); }
.lesson-row[open] { background: #fafafa; }
.lesson-row summary:hover { background: #f5f5f5; }
.notice { padding: 10px 14px; background: #fdf6df; border: 1px solid #f0e5a8; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.error { padding: 10px 14px; background: #fbe4e4; border: 1px solid #f0b8b8; border-radius: 8px; font-size: 14px; margin-bottom: 12px; color: var(--bad); }
