:root {
  --bg: #fafaf9; --fg: #1c1917; --muted: #78716c; --line: #e7e5e4; --card: #fff;
  --accent: #13294b; --accent-fg: #fff; --hi: #e84a27; --ok: #166534; --ok-bg: #dcfce7;
  --err: #991b1b; --err-bg: #fee2e2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1917; --fg: #f5f5f4; --muted: #a8a29e; --line: #44403c; --card: #292524;
    --accent: #93b4e8; --accent-fg: #0c0a09; --ok: #bbf7d0; --ok-bg: #14532d; --err: #fecaca; --err-bg: #7f1d1d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 42rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
header { margin-bottom: 1.5rem; }
.owner { color: var(--muted); text-decoration: none; font-weight: 600; letter-spacing: .02em; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.types { list-style: none; padding: 0; display: grid; gap: .75rem; }
.types a { display: grid; gap: .15rem; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line);
  border-radius: .6rem; text-decoration: none; color: inherit; }
.types a:hover { border-color: var(--accent); }
.types .title { font-weight: 600; font-size: 1.1rem; }
.types .meta, .types .desc { color: var(--muted); font-size: .92rem; }
fieldset { border: 0; padding: 0; margin: 1.5rem 0; }
legend { font-weight: 600; margin-bottom: .5rem; }
label { display: block; margin: .5rem 0; }
input:not([type=radio]), textarea { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem;
  font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: .4rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choices label { margin: 0; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 2rem;
  background: var(--card); cursor: pointer; }
.choices label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.picker { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .picker { grid-template-columns: 19rem 1fr; align-items: start; } }

.cal { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: .75rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cal-title { font-weight: 600; }
.cal-head .nav { font: inherit; font-size: 1.3rem; line-height: 1; width: 2.2rem; height: 2.2rem; border: 0;
  border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.cal-head .nav:hover:not(:disabled) { background: var(--line); }
.cal-head .nav:disabled { opacity: .25; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .2rem; text-align: center; }
.cal-grid .dow { font-size: .75rem; color: var(--muted); padding: .2rem 0; }
.cal-grid button { font: inherit; aspect-ratio: 1; border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; }
.cal-grid button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.cal-grid button:disabled { background: transparent; color: var(--muted); font-weight: 400; opacity: .55; cursor: default; }
.cal-grid button.today { box-shadow: inset 0 0 0 1px var(--muted); }
.cal-grid button[aria-pressed=true] { background: var(--accent); color: var(--accent-fg); }

.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .4rem; align-content: start; }
.times-head { grid-column: 1 / -1; margin: 0 0 .25rem; font-weight: 600; }
.times button { font: inherit; padding: .55rem .7rem; border: 1px solid var(--accent); border-radius: .4rem;
  background: var(--card); color: var(--accent); font-weight: 600; cursor: pointer; }
.times button[aria-pressed=true] { background: var(--accent); color: var(--accent-fg); }
button[type=submit], .button { display: inline-block; font: inherit; font-weight: 600; padding: .65rem 1.3rem;
  border: 0; border-radius: .4rem; background: var(--accent); color: var(--accent-fg); cursor: pointer; text-decoration: none; }
button[type=submit]:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line); list-style: none; }
.button.secondary::-webkit-details-marker { display: none; }
.danger { background: var(--hi) !important; color: #fff !important; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; }
details[open] form { margin-top: .75rem; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.ok, .error { padding: .7rem .9rem; border-radius: .4rem; }
.ok { background: var(--ok-bg); color: var(--ok); }
.error { background: var(--err-bg); color: var(--err); }
.tag { font-size: .8rem; vertical-align: middle; padding: .1rem .5rem; border-radius: 1rem; background: var(--err-bg); color: var(--err); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
