body { font: 16px/1.4 system-ui, sans-serif; margin: 0; background: #fafafa; color: #222; }
main { max-width: 32rem; margin: 0 auto; padding: 1rem; }
/* Headings sit close to what they describe, with room above to separate sections. */
h2 { margin: 2.25rem 0 .4rem; }
h2 + form > button:first-child { margin-top: .25rem; }
label { display: block; margin: .75rem 0 .25rem; font-weight: 600; }
label small { font-weight: normal; color: #666; }
input, select { display: block; width: 100%; box-sizing: border-box; padding: .5rem; font: inherit; margin-top: .25rem; }
input[type=checkbox] { display: inline; width: auto; }
fieldset { border: 1px solid #ddd; border-radius: 6px; margin: 1rem 0; padding: 0 .75rem .75rem; background: #fff; }
.row { display: flex; gap: .5rem; }
.row label { flex: 1; }
button, .button { display: inline-block; padding: .6rem 1rem; font: inherit; border: 0; border-radius: 6px;
    background: #2a5d9f; color: #fff; text-decoration: none; margin-top: 1rem; }
button.secondary { background: #e4e9f0; color: #2a5d9f; }
.error { color: #b00020; margin: .25rem 0; }
.confirm { font-weight: normal; }
.total { font-size: 1.25rem; padding: .75rem; border-radius: 6px; background: #e8f3ea; }
.total.over { background: #fbe9e7; }
.items { padding-left: 1.2rem; }
.muted { color: #666; }
nav { display: flex; flex-wrap: wrap; gap: .4rem .7rem; font-size: .9rem; max-width: 32rem; margin: 0 auto; padding: .75rem 1rem 0; }
nav a { color: #2a5d9f; }
nav a[aria-current] { color: #222; font-weight: 600; text-decoration: none; border-bottom: 2px solid #2a5d9f; }
.scale { background: none; border: 0; padding: 0; margin: .75rem 0 .25rem; }
.scale legend { font-weight: 600; padding: 0; }
.scale-options { display: flex; gap: .25rem; }
.scale-options label { flex: 1; margin: .25rem 0 0; }
.scale-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale-options span { display: block; padding: .6rem 0; border-radius: 6px; text-align: center;
    background: #e4e9f0; color: #2a5d9f; }
.scale-options input:checked + span { background: #2a5d9f; color: #fff; }
.scale-options input:focus-visible + span { outline: 2px solid #2a5d9f; outline-offset: 2px; }
input[type=radio] { width: auto; margin: 0 auto; }
.scale-anchors { display: flex; justify-content: space-between; font-size: .85rem; color: #666; }
.total.severity { background: #eef1f5; }
.day-links { display: flex; justify-content: space-between; }
.timeline { list-style: none; padding: 0; }
.timeline a { display: flex; gap: .5rem; align-items: baseline; padding: .6rem .75rem; margin: .4rem 0;
    background: #fff; border: 1px solid #ddd; border-radius: 6px; color: inherit; text-decoration: none; }
.timeline time { color: #666; font-variant-numeric: tabular-nums; }
.timeline .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline .fat, .timeline .flag { white-space: nowrap; }
.timeline .over a { background: #fbe9e7; border-color: #e5a39a; }
.timeline .flag { color: #b00020; }
.timeline .episode a { border-left: 4px solid #7b52b9; }
.actions, .form-buttons { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.actions *, .form-buttons button { margin-top: 0; }
button.danger { background: #b00020; }
.undo { display: flex; gap: 1rem; align-items: center; justify-content: space-between;
    padding: .5rem .75rem; border-radius: 6px; background: #fff7d6; }
.undo button { margin-top: 0; }
.hint { margin: .25rem 0; font-size: .9rem; color: #666; }
.empty { padding: .75rem; border: 1px dashed #ccc; border-radius: 6px; background: #fff; }
.empty p { margin-top: 0; }
.empty .button { margin-top: 0; }
.saved { padding: .5rem .75rem; border-radius: 6px; background: #e8f3ea; }
.two-by-two { width: 100%; border-collapse: collapse; background: #fff; margin: 1rem 0; }
.two-by-two caption { text-align: left; font-weight: 600; padding-bottom: .5rem; }
.two-by-two th, .two-by-two td { border: 1px solid #ddd; padding: .5rem; text-align: center; }
.two-by-two tbody th, .two-by-two tfoot th { text-align: left; }
.two-by-two td { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.two-by-two small { display: block; font-size: .8rem; color: #666; }
.two-by-two tfoot td { font-size: 1rem; color: #666; }
details summary { cursor: pointer; color: #2a5d9f; }
.recent { list-style: none; padding: 0; margin: 0; }
.recent button { display: flex; gap: .5rem; width: 100%; margin-top: .4rem; text-align: left; }
.recent .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-options { display: flex; gap: .25rem; }
.quick-options button { flex: 1; padding: .6rem 0; margin-top: .25rem; }
.timeline .incomplete { color: #7b52b9; white-space: nowrap; }
.incomplete-note { padding: .5rem .75rem; border-radius: 6px; background: #f1ecf8; }
.chart { position: relative; height: 22rem; background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: .5rem; }
.usda ul { list-style: none; padding: 0; margin: 0; }
.usda li button { display: flex; gap: .5rem; width: 100%; margin-top: .3rem; text-align: left; font-size: .9rem; }
.usda .what { flex: 1; }
button.link { background: none; color: #2a5d9f; padding: .4rem 0; text-decoration: underline; margin-top: .3rem; }
.spinner { display: inline-block; width: .9em; height: .9em; margin-right: .4em; vertical-align: -.1em;
    border: 2px solid #ccd; border-top-color: #2a5d9f; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.food-results { list-style: none; padding: 0; }
.food-results li { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: .6rem .75rem; margin: .4rem 0; }
.food-results p { margin: .25rem 0 0; }
.share-links { list-style: none; padding: 0; }
.share-links li { display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: .5rem .75rem; margin: .4rem 0; }
.share-links button { margin-top: 0; }
.shared-banner { padding: .5rem .75rem; border-radius: 6px; background: #eef1f5; }
.share-day { list-style: none; padding: 0; }
.share-day > li { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: .6rem .75rem; margin: .4rem 0; }
.share-day > li.over { background: #fbe9e7; border-color: #e5a39a; }
.share-day > li.episode { border-left: 4px solid #7b52b9; }
.share-day ul { margin: .25rem 0 0; padding-left: 1.2rem; }
