:root {
  --ground: #F4F1EA; --card: #FDFCF8; --ink: #22261F; --muted: #5E6458; --line: #E6E1D6;
  --go: #4F6B3F; --go-ink: #34492A; --go-soft: #E3EAD8;
  --wait-ink: #6E4A0E; --wait-soft: #F3E7CC;
  --late: #A3412B; --late-ink: #8A3320; --late-soft: #F5DDD5;
  --calm-ink: #4A4F45; --calm-soft: #ECEAE3;
  --radius: 22px; --shadow: 0 1px 2px rgba(34,38,31,.06), 0 8px 24px rgba(34,38,31,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #171915; --card: #21241F; --ink: #EDEBE4; --muted: #A9AEA2; --line: #34382F;
    --go: #8FB079; --go-ink: #B9D3A6; --go-soft: #2B3626;
    --wait-ink: #E6C27E; --wait-soft: #3A3020;
    --late: #E08A72; --late-ink: #F0A893; --late-soft: #42261F;
    --calm-ink: #C9CCC2; --calm-soft: #2C2F29;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.45 ui-sans-serif, "Instrument Sans", "Segoe UI", system-ui, sans-serif; }
a { color: var(--go-ink); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
header.top { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: 1080px; margin: 0 auto; }
header.top .who { font-family: "Instrument Serif", Georgia, serif; font-size: 34px; line-height: 1; }
nav.main { display: flex; flex-wrap: wrap; gap: 6px; }
nav.main a { text-decoration: none; color: var(--ink); padding: 10px 14px; border-radius: 14px; font-weight: 600; font-size: 16px; }
nav.main a.on { background: var(--card); box-shadow: var(--shadow); }
nav.main form { display: inline; }
h1 { font-size: 28px; margin: 8px 0 16px; letter-spacing: -.3px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 28px 0 10px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.summary { border-radius: 26px; padding: 22px 24px; }
.summary .headline { font-size: 24px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.summary ul { margin: 8px 0 0; padding-left: 20px; }
.tone-GO.summary { background: var(--go); color: #fff; } .tone-GO.summary .muted, .tone-GO.summary li { color: #E3EAD8; }
.tone-WAIT.summary { background: var(--wait-soft); color: var(--wait-ink); }
.tone-LATE.summary { background: var(--late-soft); color: var(--late-ink); }
.tone-CALM.summary { background: var(--calm-soft); color: var(--calm-ink); }
.pill { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.pill.tone-GO { background: var(--go-soft); color: var(--go-ink); }
.pill.tone-WAIT { background: var(--wait-soft); color: var(--wait-ink); }
.pill.tone-LATE { background: var(--late-soft); color: var(--late-ink); }
.pill.tone-CALM { background: var(--calm-soft); color: var(--calm-ink); }
.med h3 { margin: 10px 0 2px; font-size: 24px; letter-spacing: -.3px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.kv b { display: block; font-size: 20px; }
.kv span { font-size: 14px; color: var(--muted); }
table.tl { width: 100%; border-collapse: collapse; }
table.tl td { padding: 11px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tl tr:last-child td { border-bottom: none; }
table.tl td.t { width: 64px; font-weight: 700; font-size: 18px; }
table.tl td.s { text-align: right; white-space: nowrap; font-weight: 600; font-size: 15px; }
.k-TAKEN { color: var(--go-ink); } .k-TAKEN_OUT_OF_RULE { color: var(--wait-ink); } .k-CANCELLED { color: var(--muted); text-decoration: line-through; }
.k-MISSED, .k-OVERDUE { color: var(--late-ink); } .k-PLANNED, .k-POSSIBLE, .k-DUE, .k-SKIPPED { color: var(--muted); }
.scroll { overflow-x: auto; }
button, .btn { font: inherit; font-weight: 700; border: none; border-radius: 16px; padding: 12px 18px; cursor: pointer; background: var(--go); color: #fff; text-decoration: none; display: inline-block; min-height: 48px; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
button.danger { background: var(--late); }
button.link { background: none; color: var(--go-ink); padding: 6px; min-height: 0; text-decoration: underline; font-weight: 600; }
form.inline { display: inline; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  font: inherit; width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--go); outline-offset: 2px; }
fieldset { border: none; padding: 0; margin: 0; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.hint { font-size: 14px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.notice { padding: 14px 16px; border-radius: 16px; margin: 12px 0; }
.notice.error { background: var(--late-soft); color: var(--late-ink); }
.notice.warn { background: var(--wait-soft); color: var(--wait-ink); }
.notice.ok { background: var(--go-soft); color: var(--go-ink); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; }
.diff-old { color: var(--late-ink); text-decoration: line-through; }
.diff-new { color: var(--go-ink); font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .d { background: var(--card); border-radius: 14px; padding: 8px; min-height: 74px; text-decoration: none; color: var(--ink); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.cal .d.out { opacity: .35; }
.cal .d .n { font-weight: 700; font-size: 16px; }
.cal .h { text-align: center; font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 99px; display: inline-block; }
.dot.GO { background: var(--go); } .dot.WAIT { background: #C9962F; } .dot.LATE { background: var(--late); } .dot.CALM { background: var(--line); }
.code { font-family: ui-monospace, monospace; font-size: 34px; letter-spacing: 4px; font-weight: 700; }
.qr { background: #fff; padding: 12px; border-radius: 16px; width: 240px; height: 240px; }
.qr svg { width: 100%; height: 100%; }
.center { max-width: 460px; margin: 6vh auto; padding: 0 16px; }
.center .btn { display: block; text-align: center; font-size: 20px; padding: 18px; }
.center b { overflow-wrap: anywhere; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.tabs a.on { background: var(--card); box-shadow: var(--shadow); }
@media (max-width: 640px) {
  body { font-size: 16px; }
  header.top .who { font-size: 28px; }
  .cal .d { min-height: 56px; padding: 6px; font-size: 12px; }
  table.tl tr { display: grid; grid-template-columns: 64px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
  table.tl tr:last-child { border-bottom: none; }
  table.tl td { border-bottom: none; padding: 8px 6px 2px; }
  table.tl td.s { grid-column: 2; text-align: left; padding: 0 6px 10px; }
  nav.main a { padding: 8px 10px; }
}
.grow { flex: 1 1 240px; }
