:root {
  color-scheme: light dark;
  --bg: #f4f7fa; --paper: #fff; --ink: #172f44; --muted: #4f6577;
  --line: #c3d0d9; --control-line: #778999; --accent: #244d70; --selected: #e8f1f8; --warning: #923b23;
  --button: #183b57; --on-button: #fff; --sample: #f2e9cf; --sample-ink: #584820;
  --skeleton: #d5e0e8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111b24; --paper: #192733; --ink: #f0f5f9; --muted: #b3c3cf;
    --line: #485d6d; --control-line: #7890a4; --accent: #a8d6fa; --selected: #223b50; --warning: #ffb29b;
    --button: #bddff6; --on-button: #142d41; --sample: #3c3527; --sample-ink: #f4e3ae;
    --skeleton: #415565;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 -apple-system, BlinkMacSystemFont, "Noto Sans CJK JP", sans-serif; font-variant-numeric: tabular-nums; }
main { max-width: 720px; margin: 0 auto; padding: 20px 16px 32px; }
.symbols { display: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, a { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#sample { background: var(--sample); color: var(--sample-ink); border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; font-size: .8125rem; margin-bottom: 18px; }
#sample a { display: inline-flex; align-items: center; min-height: 44px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
h1, h2, p { margin: 0; }
h1 { font-size: 1.75rem; letter-spacing: .02em; line-height: 1.3; }
#stamp { font-size: .875rem; color: var(--muted); }
#stamp:not(:empty) { margin-top: 4px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--control-line); border-radius: 8px; background: var(--paper); color: var(--accent); }
#cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 16px 0 22px; }
.card { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; display: grid; gap: 3px; text-align: left; align-content: start; border: 1px solid var(--control-line); border-radius: 8px; color: var(--ink); background: var(--paper); transition: background-color 100ms; }
.card[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--selected); }
.card-label { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; font-weight: 650; font-size: .875rem; }
.card-label svg { color: var(--accent); width: 18px; height: 18px; }
.number { font: 650 1.875rem/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.unit { font-size: .8125rem; margin-left: 4px; color: var(--muted); }
.card.zero .number { color: var(--muted); }
.card.overdue:not(.zero) .number, .card.overdue .card-label svg { color: var(--warning); }
.tick { align-self: end; margin-bottom: 3px; width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
.card[aria-pressed="true"] .tick { visibility: visible; }
#details { min-height: 115px; }
h2 { font-size: 1.125rem; border-bottom: 2px solid var(--accent); padding-bottom: 8px; }
ul { list-style: none; margin: 0; padding: 0; }
li { border-bottom: 1px solid var(--line); padding: 11px 0; overflow-wrap: anywhere; }
.case-name { font-weight: 650; }
.meta { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 0 16px; font-size: .8125rem; color: var(--muted); }
.meta span { max-width: 100%; }
#remainder:not(:empty), #sampleHint { margin-top: 10px; color: var(--muted); font-size: .875rem; }
.action { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 8px 18px; border: 0; border-radius: 8px; text-decoration: none; font-weight: 650; background: var(--button); color: var(--on-button); }
#sheet { width: 100%; margin-top: 20px; }
#sheet svg:last-child { width: 15px; height: 15px; }
#sheet[aria-disabled="true"] { background: var(--line); color: var(--ink); }
#sampleHint { text-align: center; }
#notice { margin: 24px 0; }
#notice .action { margin-top: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.loading .number, .loading .unit, .loading #groupTitle span, .skeleton-line { color: transparent; background: var(--skeleton); border-radius: 4px; }
.loading .card { cursor: wait; }
.skeleton-line { display: block; width: 60%; height: 1em; margin: 7px 0; }
.skeleton-line + .skeleton-line { width: 38%; height: .75em; }
@media (min-width: 600px) {
  main { padding: 32px 24px 40px; }
  .card { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* 日本語の文節で折り返し、句読点だけが次行に残らないようにする */
p, h1, h2 { word-break: auto-phrase; text-wrap: pretty; }
