/* Agenda — lista infinita per giorno + ricerca */
.agenda { --top: 56px; padding-top: 6px; }

/* ricerca */
.ag-search { position: relative; display: flex; align-items: center; margin: 4px 0 8px; }
.ag-search .ic { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--fg3); pointer-events: none; display: grid; }
.ag-search .ic svg { width: 18px; height: 18px; }
.ag-search input { padding: 11px 40px 11px 40px; border-radius: 999px; background: var(--bg3); border-color: transparent; font-size: 16px; -webkit-appearance: none; appearance: none; }
.ag-search input::-webkit-search-cancel-button { display: none; }
.ag-search input:focus { background: var(--bg2); border-color: var(--accent); }
.ag-search .clr { position: absolute; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--line2); color: var(--fg2); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* chip filtro: persone + categorie, una riga scorrevole */
.ag-chips { margin: 0 -16px 4px; padding: 4px 16px; }
.ag-chips .chip { flex: none; }
.ag-chips .chip.cat { padding: 5px 11px; text-transform: capitalize; }
.ag-chips .chip.cat.on { --c: var(--accent); }
.ag-sep { width: 1px; height: 22px; background: var(--line2); flex: none; align-self: center; margin: 0 2px; }

.ag-sum { font-size: 13px; color: var(--fg3); margin: 10px 2px 2px; }
.ag-sum b { color: var(--fg); font-weight: 800; }
.ag-sum .tiny { color: var(--accent); font-weight: 700; }

/* giorno */
.ag-day { margin-top: 8px; }
.ag-h { position: sticky; top: var(--top); z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 2px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ag-h .n { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; font-weight: 800; letter-spacing: -.02em; background: var(--bg2); border: 1px solid var(--line); flex: none; font-variant-numeric: tabular-nums; }
.ag-day.today .ag-h .n { background: var(--today); color: #fff; border-color: var(--today); }
.ag-h b { display: block; font-size: 15px; line-height: 1.2; text-transform: capitalize; }
.ag-day.today .ag-h b { color: var(--today); }
.ag-h small { display: block; font-size: 12px; color: var(--fg3); }
.ag-h .meal { font-size: 12px; color: var(--fg3); max-width: 42%; }
.ag-h .add { width: 30px; height: 30px; border-radius: 10px; color: var(--accent); display: grid; place-items: center; flex: none; opacity: .8; }
.ag-h .add svg { width: 16px; height: 16px; }
.ag-card { padding: 4px 16px; }

/* giorni liberi (singolo o run compresso) */
.ag-free { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px 48px; padding: 9px 12px; border: 1.5px dashed var(--line2); border-radius: 12px; color: var(--fg3); font-size: 13px; cursor: pointer; transition: .15s; }
.ag-free:hover { border-color: var(--accent); color: var(--fg2); }
.ag-free.run { margin: 10px 0 2px; background: var(--bg2); border-style: solid; border-color: var(--line); }
.ag-free.run .d { font-weight: 700; color: var(--fg2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.ag-more { padding: 22px 0 10px; text-align: center; }
.ag-more .tiny { color: var(--accent); font-weight: 700; }

/* tasto "Oggi" flottante */
.ag-today { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 25; display: flex; align-items: center; gap: 6px; padding: 9px 16px 9px 12px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); animation: up .2s; }
.ag-today svg { width: 18px; height: 18px; }
@media (min-width: 900px) { .ag-today { bottom: 28px; left: auto; right: 32px; transform: none; } }

/* risultati ricerca */
.ag-res { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.ag-res:first-child { border-top: 0; }
.ag-res .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c, var(--accent)); flex: none; }
.ag-res .ic { width: 28px; text-align: center; font-size: 18px; flex: none; }
.ag-res .t { font-weight: 600; }
.ag-res .sub { font-size: 13px; color: var(--fg2); }
.ag-res .who { display: flex; margin-left: auto; }
.ag-res.past { opacity: .6; }
.ag-res.done .t { text-decoration: line-through; color: var(--fg3); }
.ag-res mark, .agenda mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; font-weight: 700; }
