:root {
 color-scheme: light;
 font: 16px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
 color: #151c2c;
 background: #f5f6fa;
 --text: #151c2c;
 --muted: #536079;
 --line: #d8deea;
 --surface: #fff;
 --accent: #234db5;
 --accent-soft: #eaf0ff;
 --error: #932a36;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.page { max-width: 620px; margin: auto; padding: max(22px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.heading { margin: 0 0 20px; }
.product { margin: 0 0 4px; color: var(--accent); font-weight: 650; }
h1 { margin: 0; font-size: clamp(28px, 7vw, 40px); line-height: 1.12; letter-spacing: -.03em; }
h2 { margin: 0 0 10px; font-size: 19px; line-height: 1.2; }
p { margin: 0 0 12px; color: var(--muted); }
.card { padding: 16px; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.setup input { width: 100%; font: inherit; color: var(--muted); }
.setup input::file-selector-button { margin-right: 8px; padding: 8px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 7px; color: var(--accent); font: inherit; }
.segments { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; margin-bottom: 16px; gap: 3px; background: #eff2f8; border-radius: 9px; }
button, a, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
.segments button { min-height: 42px; padding: 5px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; }
.segments button[aria-pressed="true"] { color: var(--accent); background: var(--surface); border-color: var(--line); font-weight: 650; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields .full { grid-column: 1/-1; }
.fields label { display: grid; min-width: 0; gap: 4px; font-weight: 600; }
.fields :is(input, select, textarea) { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 400; }
.fields textarea { resize: vertical; }
.primary, .secondary { display: block; min-height: 44px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; text-align: center; font-weight: 650; text-decoration: none; cursor: pointer; }
.primary { background: var(--accent); color: white; }
.secondary { background: var(--accent-soft); color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
#add-entry { margin-top: 16px; }
.hint { margin: 12px 0 0; }
.report-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.report-heading output { color: var(--muted); font-variant-numeric: tabular-nums; }
#entries { list-style: none; padding: 0; margin: 0; }
#entries li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
#entries li strong, #entries li small { display: block; overflow-wrap: anywhere; }
#entries li small { color: var(--muted); }
#entries li button { color: var(--error); background: transparent; border: 1px solid var(--line); border-radius: 7px; padding: 7px; min-height: 40px; }
.report-actions { display: grid; gap: 8px; margin-top: 12px; }
#status { margin: 10px 2px 0; overflow-wrap: anywhere; }
#status.error { color: var(--error); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
