/* meter.css: styles for the Note meter page. */

.page > * { max-width: 880px; }

/* Setup */
.fields { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.field { display: grid; gap: 8px; align-content: start; min-width: 0; }
.field label, .field .label { font-size: 0.875rem; font-weight: 600; }
.hint { margin: 0; font-size: 0.875rem; color: var(--muted); }

.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix input { max-width: 120px; }
.input-suffix span { color: var(--muted); }

.segmented { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented button {
    flex: 1; font: inherit; border: 0; background: var(--surface); color: var(--text);
    padding: 8px 16px; min-height: 40px; cursor: pointer; white-space: nowrap;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button[aria-checked="true"] { background: var(--text); color: var(--surface); font-weight: 600; }

.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.or { color: var(--muted); font-size: 0.875rem; }

.button.primary[data-running="true"] { background: var(--surface); color: var(--bad); border-color: var(--bad); }
#fileInput:focus-visible + .button, .button.secondary:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Result */
.result-head { display: grid; gap: 16px; }
.result-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.badge { font-size: 0.75rem; font-weight: 600; color: var(--blend); border: 1px solid var(--blend); border-radius: 999px; padding: 0 8px; }
.big-number { font-size: 3.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin: 4px 0; }
.big-number .unit { font-size: 1.5rem; font-weight: 600; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.big-number .qualifier {
    display: inline-block; vertical-align: middle; margin-left: 12px; padding: 0 8px;
    font-size: 0.8125rem; font-weight: 600; line-height: 1.5; letter-spacing: 0;
    color: var(--warn); border: 1px solid var(--warn); border-radius: 999px;
}
.cents { font-size: 1.125rem; color: var(--muted); }
.cents strong { color: var(--text); font-weight: 700; }
.result[data-status="empty"] :is(.big-number, .facts, .table-wrap, .legend) { display: none; }
.result[data-status="empty"] .cents { margin-top: 8px; font-size: 1rem; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 48px; margin: 0; padding-top: 16px; border-top: 1px solid var(--border); }
.facts dt { font-size: 0.8125rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.result[data-stale="true"] :is(.big-number, .cents, .badge, .facts, tbody) { opacity: 0.4; }
.result[data-stale="true"] .result-label { color: var(--text); }

.table-wrap { overflow-x: auto; margin-top: 24px; }
.partials { width: 100%; border-collapse: collapse; }
.partials th {
    text-align: left; font-size: 0.8125rem; color: var(--muted); font-weight: 600;
    padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.partials td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: top; }
.partials .num { text-align: right; }
.partials .col-n { width: 64px; }
.partials th.col-notes { width: 100%; }
.partials tr[data-weak="true"] td { color: var(--muted); }
.partials tr[data-weak="true"] .freq { text-decoration: line-through; text-decoration-color: var(--border); }
.confidence { display: flex; align-items: center; gap: 8px; }
.confidence-track { width: 64px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.confidence-fill { height: 100%; background: var(--ok); }
tr[data-weak="true"] .confidence-fill { background: var(--muted); }
.tag { font-size: 0.8125rem; font-weight: 600; color: var(--blend); }
.subnote { display: block; font-size: 0.8125rem; color: var(--muted); }
.empty-row td { color: var(--muted); text-align: center; padding: 24px 8px; white-space: normal; }
.legend { margin: 16px 0 0; font-size: 0.8125rem; color: var(--muted); }

@media (max-width: 720px) {
    .card { padding: 16px; }
    .fields { grid-template-columns: 1fr; gap: 16px; }
    .actions { margin-top: 16px; padding-top: 16px; }
    .button.primary { flex: 1 1 100%; }
    .or { display: none; }
    .button.secondary { flex: 1 1 100%; }
    .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
    .big-number { font-size: 2.5rem; }
    .big-number .unit { font-size: 1.25rem; }
    /* Each partial becomes a four-column grid row; notes, when present, take a line of their own. */
    .partials, .partials thead, .partials tbody { display: block; }
    .partials tr { display: grid; grid-template-columns: 48px 1fr 1fr 84px; border-bottom: 1px solid var(--border); }
    .partials th, .partials td { padding: 8px 4px; border-bottom: 0; }
    .partials th { white-space: normal; align-self: end; }
    .partials .col-n { width: auto; }
    .partials th.col-notes { display: none; }
    .partials td.col-notes { grid-column: 1 / -1; padding-top: 0; }
    .partials td.col-notes:empty, .partials td.weak-note { display: none; }
    .partials .empty-row td { grid-column: 1 / -1; }
    .confidence-track { display: none; }
    .confidence { justify-content: flex-end; }
    .partials th:nth-child(4) { text-align: right; }
}
