/* Day-Dot Kitchen Labels: analytics surfaces. Tokens and fonts come from scan.css; shared components (ink buttons, tape label,
   day dot, label paper, chips, action sheet, captions, empty states) come from
   kitchen.css (DESIGN.md). */

/* ---------- Analytics (/analytics) and Activity (/activity): one printed sheet each ---------- */
.an, .act { max-width: 860px; color: var(--dd-ink); }
.an-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 20px; margin: 4px 0 18px; }
.an-title { margin: 0; }
.an-period { display: flex; gap: 8px; flex-wrap: wrap; }
.an-chip:focus-visible, .an-details summary:focus-visible, .act-more:focus-visible { outline: 3px solid var(--dd-focus); outline-offset: 2px; }

.an-paper, .act-paper { padding: 18px 22px 20px; }
.an-empty { padding: 14px 4px 16px; }
.an-empty p { max-width: 42ch; }
.an-none { margin: 0; color: var(--dd-ink-2); }

/* Headline figures */
.an-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; padding-bottom: 14px; border-bottom: 1.5px solid var(--dd-rule); }
.an-fig { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.an-fig-num { font-family: var(--dd-cond); font-weight: 800; font-size: 2.7rem; line-height: 0.95; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.an-rate { margin: 12px 0 4px; font-size: 1.05rem; }

.an-block { margin-top: 20px; min-width: 0; }
.an-h { margin: 0 0 10px; }
.an-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }

/* Columns by month: ink on label stock, the running month solid. */
.an-cols { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: stretch; height: 190px; }
.an-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.an-col-num { font-family: var(--dd-cond); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; line-height: 1; }
.an-col-well { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; border-bottom: 1.5px solid var(--dd-ink); }
.an-col-bar { display: block; width: 100%; background: var(--dd-ink-2); border-radius: 4px 4px 0 0; }
.an-col--now .an-col-bar { background: var(--dd-ink); }
.an-col-label { font-family: var(--dd-cond); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dd-ink-2); }
.an-note { margin: 8px 0 0; font-size: 0.95rem; color: var(--dd-ink-2); }
.an-details { margin-top: 6px; }
.an-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; width: fit-content; }

/* Horizontal bars with the count at the end */
.an-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.an-bar-row { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) 2.2em; align-items: center; gap: 10px; min-height: 28px; }
.an-bar-name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.2; }
.an-bar-track { height: 14px; border-bottom: 1.5px solid var(--dd-ink); display: block; }
.an-bar-fill { display: block; height: 100%; background: var(--dd-ink); border-radius: 0 4px 4px 0; }
.an-bar-fill--hatch {
    background: repeating-linear-gradient(135deg, var(--dd-ink) 0 2px, transparent 2px 5px);
    box-shadow: inset 0 0 0 1.5px var(--dd-ink);
}
.an-bar-num { font-family: var(--dd-cond); font-weight: 800; font-size: 1.2rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Tables */
.an-table { width: 100%; border-collapse: collapse; }
.an-table th, .an-table td { padding: 9px 0; text-align: left; border-bottom: 1px solid rgba(29, 29, 29, 0.18); vertical-align: baseline; }
.an-table thead th { border-bottom: 1.5px solid var(--dd-rule); padding-top: 2px; padding-bottom: 6px; }
.an-table tbody tr:last-child th, .an-table tbody tr:last-child td { border-bottom: 0; }
.an-table th[scope="row"] { font-weight: 700; overflow-wrap: anywhere; padding-right: 12px; }
.an-table .an-num { text-align: right; font-family: var(--dd-cond); font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.an-table thead .an-num { font-size: 0.82rem; font-weight: 700; }
.an-foot { margin: 16px 0 0; font-size: 0.9rem; color: var(--dd-ink-2); }

/* Activity */
.act-day + .act-day { margin-top: 16px; }
.act-day-title { margin: 0 0 4px; padding-bottom: 5px; border-bottom: 1.5px solid var(--dd-rule); font-family: var(--dd-cond); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.1em; text-transform: uppercase; }
.act-rows { list-style: none; margin: 0; padding: 0; }
.act-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; min-height: 52px; padding: 6px 0; border-bottom: 1px solid rgba(29, 29, 29, 0.18); }
.act-row:last-child { border-bottom: 0; }
.act-ico { width: 22px; height: 22px; display: block; }
.act-ico-wrap { display: flex; align-items: center; justify-content: center; }
.act-text { line-height: 1.3; overflow-wrap: anywhere; }
.act-text .activity-actor { font-weight: 800; }
.act-text .activity-name { font-weight: 700; }
.act-text .activity-fields { color: var(--dd-ink-2); }
.act-time { font-family: var(--dd-cond); font-weight: 700; font-size: 0.98rem; letter-spacing: 0.04em; color: var(--dd-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.act-more { margin-top: 16px; }
.act-more:disabled { opacity: 0.6; }

@media (max-width: 760px) {
    .an-title { font-size: 2.15rem; }
    .an-paper, .act-paper { padding: 14px 14px 16px; margin: 0 -2px; }
    .an-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .an-fig-num { font-size: 2.3rem; }
    .an-pair { grid-template-columns: minmax(0, 1fr); }
    .an-cols { gap: 3px; height: 170px; }
    .an-bar-row { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) 2em; }
}
