:root {
  --bg: #f3f1ec; --paper: #fffcf8; --paper-2: #ece8e1; --ink: #171716; --muted: #5f5a54;
  --line: #e3dfd6; --accent: #3e5668; --good: #1d6a42; --bad: #8d3b34;
  --shadow: 0 0 0 1px rgba(23,23,22,.06), 0 1px 2px -1px rgba(23,23,22,.06), 0 12px 32px -20px rgba(23,23,22,.28);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141311; --paper: #1e1d1a; --paper-2: #2a2926; --ink: #f4f1ea; --muted: #b7b1a8;
  --line: #3a3834; --accent: #a9c3d1; --good: #8ed4ae; --bad: #f0b0aa;
  --shadow: 0 0 0 1px rgba(244,241,234,.1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--ink); }
body { margin: 0; min-height: 100vh; font: 16px/1.5 var(--sans); background: var(--bg); }
button, select, input, textarea { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { opacity: .45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.noscript { padding: 1rem; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.display { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xs { font-size: .75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card { background: var(--paper); border-radius: 1.5rem; padding: 1rem; box-shadow: var(--shadow); }

header.top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1.25rem 0; flex-wrap: wrap; }
.brand { font-size: 1.9rem; line-height: 1; margin: 0; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.status { font-size: .8rem; color: var(--muted); min-width: 7rem; text-align: right; }
.status.err { color: var(--bad); }

.layout { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 3rem; }
.aside { order: 2; display: grid; gap: 1rem; align-content: start; }
.day { order: 1; min-width: 0; }
@media (min-width: 64rem) {
  .layout { flex-direction: row; align-items: flex-start; gap: 1.5rem; }
  .aside { order: 1; width: 20rem; flex-shrink: 0; }
  .day { order: 2; flex: 1; }
}

.btn { min-height: 2.75rem; padding: 0 1rem; border-radius: .5rem; border: 0; background: var(--ink); color: var(--paper); font-weight: 600; }
.btn.quiet { background: var(--paper-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--muted); padding: 0 .5rem; }
.btn.ghost:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.btn.danger { background: transparent; color: var(--bad); }
.btn.icon { width: 2.75rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cal-head h2 { margin: 0; font-size: 1.25rem; }
.grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; margin-top: 1rem; }
.wd { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); padding-bottom: .25rem; }
.cell { min-height: 2.75rem; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: .5rem; background: transparent; color: var(--ink); font-variant-numeric: tabular-nums; }
.cell.out { color: var(--muted); }
.cell:hover { background: var(--paper-2); }
.cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cell.sel { background: var(--ink); color: var(--paper); }
.mark { margin-top: .25rem; height: .25rem; width: 1rem; border-radius: 9999px; }
.mark.full { background: var(--accent); }
.mark.partial { background: color-mix(in oklab, var(--accent) 45%, transparent); }
.mark.miss { background: var(--bad); }
.mark.rest { height: .125rem; border-radius: 0; background: var(--muted); }
.cell.sel .mark { background: var(--paper); }
.legend { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .75rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: .5rem; }
.legend .mark { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .75rem 0 0; }
.stat { background: var(--paper-2); border-radius: .5rem; padding: .75rem .5rem; }
.stat dt { font-size: .75rem; color: var(--muted); }
.stat dd { margin: .25rem 0 0; font-family: var(--display); font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
h2.sub { margin: 0; font-size: .875rem; font-weight: 600; color: var(--muted); }

.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.day-head h1 { margin: 0; font-size: 1.9rem; line-height: 1.15; }
.score { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.ring { position: relative; width: 5rem; height: 5rem; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; }
.ring .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ring .arc { transition: stroke-dashoffset .4s cubic-bezier(.22,1,.36,1); }
.badge { display: inline-flex; align-items: center; min-height: 2rem; padding: 0 .75rem; border-radius: 9999px; font-size: .875rem; font-weight: 600; background: var(--paper-2); }
.badge.good { background: color-mix(in oklab, var(--good) 12%, transparent); color: var(--good); }
.badge.bad { background: color-mix(in oklab, var(--bad) 12%, transparent); color: var(--bad); }
.bar { margin-top: 1rem; height: .375rem; border-radius: 9999px; background: var(--paper-2); overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-radius: 9999px; transition: width .25s cubic-bezier(.22,1,.36,1); }

label.f { display: grid; gap: .25rem; font-size: .875rem; font-weight: 600; color: var(--muted); }
.field { min-height: 2.75rem; width: 100%; border: 0; border-radius: .5rem; background: var(--bg); padding: 0 .75rem; box-shadow: var(--shadow); font-weight: 400; color: var(--ink); }
textarea.field { padding: .75rem; min-height: 5rem; resize: none; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1.5rem; }
.sec-head h2 { margin: 0; font-size: 1.25rem; }

ul.ex { list-style: none; margin: .5rem 0 0; padding: 0; }
ul.ex li { display: flex; align-items: center; gap: .25rem; padding: .25rem 0; border-bottom: 1px solid var(--line); }
ul.ex li:last-child { border-bottom: 0; }
.chk { width: 2.75rem; height: 2.75rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: .5rem; }
.chk span { width: 1.25rem; height: 1.25rem; border-radius: .375rem; border: 1px solid var(--muted); background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: .8rem; line-height: 1; }
.chk[aria-checked="true"] span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ex .txt { min-width: 0; flex: 1; }
.ex .name { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex .name.done { color: var(--muted); text-decoration: line-through; }
.ex .meta { margin: 0; font-size: .875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

form.composer { display: grid; gap: .75rem; margin-top: 1.25rem; }
.cols2 { display: grid; gap: .75rem; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
@media (min-width: 40rem) { .cols2 { grid-template-columns: 1fr 1fr; } }
.err-text { color: var(--bad); font-size: .875rem; margin: 0; }
.tools { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }

.login { max-width: 26rem; margin: 12vh auto 0; text-align: center; padding: 2rem 1.5rem; }
.login h1 { font-size: 2.6rem; margin: 0; }
.login p { margin: .75rem 0 1.5rem; }
.login .btn { justify-content: center; width: 100%; }
.login .stack { display: grid; gap: .75rem; }
.yabtn { background: #fc3f1d; color: #fff; }

.ring .track { stroke: var(--line); }
.ring .arc { stroke: var(--accent); }
@media (prefers-reduced-motion: reduce) { .ring .arc, .bar > div { transition: none; } }
.mt { margin-top: 1rem; }
.mt-s { margin-top: .5rem; }
.stat dd, .stat dt { margin-left: 0; }
