.an { max-width: 960px; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.an-title { margin: 2px 0 6px; font-size: 26px; }
.periods { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.periods button { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; color: var(--muted); font-size: 14px; }
.periods button.active { background: var(--card-2); color: var(--text); border-color: #3a4a60; }
.compare { font-size: 14px; color: var(--muted); }
.small { font-size: 12.5px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 24px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat .cmp { font-size: 12px; margin-top: 4px; }
.better { color: var(--ok); }
.worse { color: var(--high); }

.rangebar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; margin: 6px 0 10px; }
.rangebar i { display: block; height: 100%; }
.rangelist { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 14px; font-size: 14px; align-items: center; }
.rangelist .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.rangelist .goal { color: var(--muted); font-size: 12px; }
.rangelist .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.insights { margin: 4px 0 8px; padding-left: 18px; }
.insights li { margin: 6px 0; }
.insights li.info { color: var(--muted); list-style: '· '; }

.an-chart { width: 100%; height: 280px; position: relative; }
.an-chart.short { height: 170px; }
.an-chart svg { width: 100%; height: 100%; display: block; }

.table-wrap { overflow-x: auto; }
.days { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.days th { text-align: right; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.days td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.days th:first-child, .days td:first-child { text-align: left; }
.days tr.clickable { cursor: pointer; }
.days tr.clickable:hover td { background: var(--card-2); }
.days tr.sel td { background: #1d2a3b; }
.mini { display: inline-flex; width: 70px; height: 8px; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.mini i { display: block; height: 100%; }

.mealrow, .lowrow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mealrow:first-child, .lowrow:first-child { border-top: 0; }
.mealsum { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }

button.primary { background: #2b6cb0; border: 0; border-radius: 10px; padding: 9px 14px; color: #fff; font-weight: 600; }
button.secondary { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; color: var(--text); }
