/* ClassGuard website colours, light and dark: a calm, paper-like look (white or soft charcoal pages, near-black ink, pastel
   tints for cards), with ClassGuard green for accents. theme.js sets data-theme on <html> from the visitor's choice (System,
   Light or Dark); without JavaScript the system setting is used. --btn is the solid button colour; --tint-* are card tints. */
:root, :root[data-theme="dark"] {
  --bg: #191919; --panel: #202020; --panel2: #252525; --line: #2f2f2f; --ink: #e9e9e7; --muted: #a3a3a0; --faint: #8f8f8b;
  --accent: #6fcf97; --accent-hover: #86dba9; --accent-ink: #0f1a13; --accent-dim: #243128;
  --btn: #f2f2f0; --btn-hover: #ffffff; --btn-ink: #191919; --soft: #2c2c2b; --soft-hover: #353534;
  --tint-yellow: #372e20; --tint-blue: #1f282d; --tint-green: #242b26; --tint-purple: #2a2430; --tint-pink: #2e2328; --tint-orange: #36291f; --tint-gray: #252525;
  --warn: #e6c069; --warn-dim: #372e20; --warn-line: #4a3d24;
  --danger: #f0938a; --danger-dim: #36221f; --danger-line: #4d2c28;
  --glow: rgba(111, 207, 151, 0.10); --shadow: rgba(0, 0, 0, 0.5); --chart-on: #4dab7a; --chart-late: #d39a3c;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #ffffff; --panel: #ffffff; --panel2: #f7f6f3; --line: #e9e9e7; --ink: #191919; --muted: #6f6e69; --faint: #706f6a;
    --accent: #2a7a55; --accent-hover: #226646; --accent-ink: #ffffff; --accent-dim: #edf3ec;
    --btn: #191919; --btn-hover: #000000; --btn-ink: #ffffff; --soft: #f1f1ef; --soft-hover: #e9e9e6;
    --tint-yellow: #fbf3db; --tint-blue: #e7f3f8; --tint-green: #edf3ec; --tint-purple: #f6f3f9; --tint-pink: #faf1f5; --tint-orange: #fbecdd; --tint-gray: #f1f1ef;
    --warn: #956400; --warn-dim: #fbf3db; --warn-line: #f1e2b4;
    --danger: #c4413a; --danger-dim: #fdebec; --danger-line: #f6cdcc;
    --glow: rgba(42, 122, 85, 0.08); --shadow: rgba(15, 15, 15, 0.10); --chart-on: #2a9d6c; --chart-late: #c97a1a;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #ffffff; --panel: #ffffff; --panel2: #f7f6f3; --line: #e9e9e7; --ink: #191919; --muted: #6f6e69; --faint: #706f6a;
  --accent: #2a7a55; --accent-hover: #226646; --accent-ink: #ffffff; --accent-dim: #edf3ec;
  --btn: #191919; --btn-hover: #000000; --btn-ink: #ffffff; --soft: #f1f1ef; --soft-hover: #e9e9e6;
  --tint-yellow: #fbf3db; --tint-blue: #e7f3f8; --tint-green: #edf3ec; --tint-purple: #f6f3f9; --tint-pink: #faf1f5; --tint-orange: #fbecdd; --tint-gray: #f1f1ef;
  --warn: #956400; --warn-dim: #fbf3db; --warn-line: #f1e2b4;
  --danger: #c4413a; --danger-dim: #fdebec; --danger-line: #f6cdcc;
  --glow: rgba(42, 122, 85, 0.08); --shadow: rgba(15, 15, 15, 0.10); --chart-on: #2a9d6c; --chart-late: #c97a1a;
  color-scheme: light;
}
body { background: var(--bg); color: var(--ink); transition: background-color .2s ease, color .2s ease; }

/* Settings button and panel (theme.js) */
.cg-gear { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 20; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer; box-shadow: 0 4px 14px var(--shadow); }
.cg-gear.inline { position: static; box-shadow: none; }
.cg-gear:hover { color: var(--ink); }
.cg-gear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cg-gear svg { width: 20px; height: 20px; }
dialog.cg-settings { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--panel); color: var(--ink); box-shadow: 0 24px 60px var(--shadow); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
dialog.cg-settings::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); }
dialog.cg-settings[open] { animation: cg-pop .18s ease-out; }
@keyframes cg-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.cg-settings[open] { animation: none; } body { transition: none; } }
.cg-settings header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; margin: 0; }
.cg-settings header h2 { font-size: 1.15rem; margin: 0; }
.cg-settings .cg-close { background: none; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.cg-settings .cg-close:hover { color: var(--ink); background: var(--panel2); }
.cg-settings section { padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.cg-settings section:first-of-type { border-top: 0; }
.cg-settings h3 { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; font-weight: 600; }
.cg-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.cg-seg button { font: inherit; font-size: .9rem; font-weight: 600; border: 0; border-radius: 9px; padding: 8px 6px; background: transparent; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cg-seg button svg { width: 18px; height: 18px; }
.cg-seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px var(--shadow); }
.cg-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.cg-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-row small { display: block; color: var(--muted); font-size: .82rem; }
.cg-row button, .cg-btn { font: inherit; font-size: .85rem; font-weight: 600; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 9px; padding: 6px 12px; cursor: pointer; }
.cg-row button.danger { color: var(--danger); }
.cg-switch { position: relative; width: 42px; height: 24px; flex: none; }
.cg-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.cg-switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .15s; cursor: pointer; }
.cg-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.cg-switch input:checked + span { background: var(--accent); }
.cg-switch input:checked + span::after { transform: translateX(18px); }
.cg-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* December Santa hat on the logo (theme.js) */
.cg-hat-wrap { position: relative; display: inline-block; line-height: 0; vertical-align: middle; }
.cg-hat-wrap > img { display: block; }
.cg-hat-wrap .cg-hat { position: absolute; left: -10.61%; top: -19.52%; width: 121.42%; height: auto; pointer-events: none; }
