:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #162c25;
  background: #f2f6f3;
  --ink: #162c25;
  --muted: #456057;
  --line: #ceddd4;
  --accent: #086348;
  --surface: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #087659; outline-offset: 3px; }
button:disabled { opacity: .47; cursor: default; }
.skip-link:not(:focus), .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 12px; z-index: 3; padding: 11px; background: white; border-radius: 6px; }

.site-header { border-bottom: 1px solid var(--line); background: #fbfdfb; }
.header-inner { max-width: 1136px; padding: 14px 20px; margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.03rem; letter-spacing: -.02em; font-weight: 760; }
.brand-icon { flex: 0 0 34px; height: 34px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 8px 0; border-radius: 8px; background: #b7e8ca; }
.brand-icon i { width: 4px; height: 6px; border-radius: 2px; background: #164e39; }
.brand-icon i:nth-child(2) { height: 10px; }
.brand-icon i:nth-child(3) { height: 16px; }
.guide-link { font-size: .9rem; font-weight: 690; color: #245746; text-underline-offset: 4px; white-space: nowrap; }

main { max-width: 1136px; margin: auto; padding: 40px 20px 10px; }
.intro { max-width: 650px; margin: 0 0 25px; }
h1 { font-size: clamp(2rem, 5.7vw, 3.75rem); font-weight: 770; letter-spacing: -.063em; line-height: 1.02; }
.intro p { margin-top: 14px; max-width: 58ch; line-height: 1.55; color: var(--muted); }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 17px 19px; box-shadow: 0 2px 4px #19392b05; }
.upload-panel { padding: 14px; }
.file-drop { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 21px 12px; text-align: center; border: 1.5px dashed #91b8a4; border-radius: 10px; background: #f5faf6; }
.file-drop.dragging { background: #deefe3; border-color: var(--accent); }
.file-drop h2 { font-size: 1.17rem; letter-spacing: -.02em; }
.file-drop p { color: var(--muted); font-size: .94rem; }
.drop-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; background: #dcefe4; margin-bottom: 2px; }
.page-icon { display: block; width: 14px; height: 18px; border: 1.5px solid #215b41; border-radius: 2px; position: relative; }
.page-icon::after { position: absolute; content: ''; top: 5px; left: 2px; width: 7px; height: 1px; background: #215b41; box-shadow: 0 3px #215b41; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-drop .actions { justify-content: center; margin-top: 6px; }
.button { min-height: 43px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; font-weight: 690; font-size: .9rem; }
.primary { background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: #064f3b; }
.secondary { border-color: #bdcfc4; background: white; color: #204034; }
.secondary:hover:not(:disabled) { background: #eaf5ee; border-color: #7fa88e; }
.file-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 3px 10px; color: var(--muted); padding: 5px 2px; font-size: .84rem; }
.text-button { min-height: 43px; color: #245746; background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; padding: 0; font-weight: 640; }
.options { border-top: 1px solid #e3ebe6; padding: 6px 2px 0; }
summary { font-weight: 710; color: #244839; padding-block: 7px; }
.options-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 5px 0 7px; }
.options-grid label { display: grid; align-content: start; gap: 4px; font-weight: 640; font-size: .88rem; }
select, #row-search { background: white; min-height: 41px; color: var(--ink); border: 1px solid #b7cfc1; border-radius: 6px; min-width: 0; }
select { appearance: none; padding: 7px 24px 7px 8px; width: 100%; font-weight: 520; background-image: linear-gradient(45deg, transparent 50%, #38634f 50%), linear-gradient(135deg, #38634f 50%, transparent 50%); background-position: calc(100% - 12px) 17px, calc(100% - 7px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.status:not(:empty), .note { color: var(--muted); font-size: .86rem; line-height: 1.45; margin-top: 7px; }
.banner { border: 1px solid #dfb57f; background: #fff3e2; color: #704014; border-radius: 6px; padding: 8px 10px; font-size: .88rem; line-height: 1.4; margin-bottom: 8px; }

.report { margin-top: 24px; scroll-margin-top: 16px; }
.report-header { display: flex; align-items: flex-end; gap: 12px; justify-content: space-between; margin-bottom: 13px; }
.report-header h2 { font-size: clamp(1.37rem, 3vw, 1.85rem); margin-top: 3px; letter-spacing: -.04em; }
.eyebrow { color: #28634c; font-size: .83rem; font-weight: 710; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.metric { min-width: 0; padding: 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; gap: 4px; }
.metric span { font-size: .88rem; font-weight: 670; color: var(--muted); }
.metric strong { font-size: clamp(1.27rem, 3.3vw, 1.92rem); letter-spacing: -.05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.metric-sales { background: #e3f2e8; border-color: #c4e2ce; }
.metric-sales strong { color: #104c35; }
.results { margin-top: 12px; }
.panel-heading { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.panel-heading h3 { font-size: 1.05rem; letter-spacing: -.02em; }
.panel-heading p { color: var(--muted); font-size: .87rem; margin-top: 4px; line-height: 1.42; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 7px; background: #eaf1ed; }
.tabs button { border: 0; min-height: 36px; border-radius: 5px; padding: 5px 8px; color: #365548; background: transparent; font-size: .84rem; font-weight: 720; white-space: nowrap; }
.tabs button[aria-selected=true] { background: white; color: #17523a; box-shadow: 0 1px 3px #18372a29; }
.tabs span { display: inline-block; margin-left: 3px; border-radius: 4px; padding: 1px 3px; background: #e5f2e9; font-size: .75rem; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 8px; color: var(--muted); font-size: .86rem; }
#row-search { padding: 8px 9px; width: min(16rem, 64%); }
#row-search::placeholder { color: var(--muted); }
.table-scroll { overflow-x: auto; border: 1px solid #dce6df; border-radius: 7px; }
table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: .88rem; line-height: 1.42; }
th, td { text-align: left; vertical-align: top; padding: 9px 11px; }
th { white-space: nowrap; background: #ecf4ee; color: #345647; }
td { overflow-wrap: anywhere; max-width: 290px; }
tbody tr + tr { border-top: 1px solid #e8efea; }
tbody tr:nth-child(even) { background: #f8faf9; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty-row { text-align: center; color: var(--muted); padding: 14px; }
.exception-pill { display: inline-block; background: #f7ebdb; color: #6f451f; border-radius: 4px; padding: 2px 6px; font-size: .81rem; font-weight: 700; white-space: nowrap; }
.pagination { display: flex; justify-content: flex-end; gap: 7px; margin-top: 9px; }
.report-details { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 10px; align-items: start; }
.report-details .panel { padding-block: 8px; }
.chart { display: grid; gap: 9px; margin: 9px 0 5px; }
.bar-item { display: grid; gap: 3px; }
.bar-value { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; color: #345548; }
.bar-value span { overflow-wrap: anywhere; }
.bar-value strong { white-space: nowrap; }
.bar-track { height: 7px; border-radius: 5px; overflow: hidden; background: #e9f1eb; }
.bar-fill { height: 100%; display: block; min-width: 2px; border-radius: 5px; background: #27946c; }
.bar-fill.negative { background: #b85e39; }
.file-list { list-style: none; margin: 4px 0 5px; padding: 0; }
.file-list li { display: flex; justify-content: space-between; gap: 9px; padding: 7px 0; font-size: .88rem; }
.file-list li + li { border-top: 1px solid #e8efea; }
.file-list li span { overflow-wrap: anywhere; }
.file-list li span:last-child { text-align: right; color: var(--muted); }
.file-list li.file-error span:last-child { color: #814a20; }
.format { margin-top: 12px; scroll-margin-top: 12px; padding-block: 8px; }
.format-body { display: grid; gap: 10px; color: var(--muted); line-height: 1.52; padding: 4px 0 10px; max-width: 80ch; }
footer { color: var(--muted); margin: 15px 0 5px; font-size: .85rem; }

@media (max-width: 660px) {
  main { padding: 24px 12px 10px; }
  .header-inner { padding: 11px 12px; }
  .intro { margin-bottom: 16px; }
  .wide-only { display: none; }
  .options-grid, .report-details { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-heading, .report-header { flex-direction: column; align-items: flex-start; }
  .report-header { gap: 7px; }
  .panel { padding-inline: 11px; }
  .table-tools { align-items: flex-start; }
}
@media (max-width: 370px) {
  .file-drop .actions { width: 100%; }
  .file-drop .actions > button { flex: 1 1 125px; }
  .button { padding-inline: 9px; }
}
