:root {
  color-scheme: light dark;
  --bg: #faf7f2; --surface: #fffdf9; --text: #2b2620; --text-muted: #71675c;
  --border: #dcd4c8; --accent: #835333; --accent-soft: #eee5da; --danger: #a42b2b;
  --radius-md: 6px; --radius-lg: 10px;
  font-family: var(--font-body, system-ui, sans-serif); font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1a17; --surface: #262320; --text: #efe9e0; --text-muted: #b9aea0; --border: #464039; --accent: #e2b38c; --accent-soft: #332b24; --danger: #ffaaaa; }
}
:root[data-theme="light"] { color-scheme: light; --bg: #faf7f2; --surface: #fffdf9; --text: #2b2620; --text-muted: #71675c; --border: #dcd4c8; --accent: #835333; --accent-soft: #eee5da; --danger: #a42b2b; }
:root[data-theme="dark"] { color-scheme: dark; --bg: #1c1a17; --surface: #262320; --text: #efe9e0; --text-muted: #b9aea0; --border: #464039; --accent: #e2b38c; --accent-soft: #332b24; --danger: #ffaaaa; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
main { max-width: 1040px; margin: 0 auto; padding: clamp(16px, 4vw, 44px); }
h1, h2, h3 { font-family: var(--font-heading, Georgia, serif); font-weight: 400; line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 0; }
h2 { font-size: 1.3rem; margin: 0; }
h3 { font-size: 1.15rem; margin-top: 0; }
p { margin: 0 0 12px; }
header, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
header { margin: 24px 0; }
.eyebrow { color: var(--accent); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.intro { color: var(--text-muted); margin: 8px 0 0; }
button, input, select { font: inherit; font-family: var(--font-ui, system-ui, sans-serif); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); background: var(--surface); min-height: 44px; padding: 9px 12px; }
button { cursor: pointer; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent), 0 1px 2px #0000000d; }
button:hover { background: var(--accent-soft); border-color: var(--accent); }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0 32px; border-block: 1px solid var(--border); }
.summary > div { padding: 16px 12px 16px 0; }
dt { color: var(--text-muted); font-size: .85rem; }
dd { margin: 4px 0 0; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.muted, .hint, footer, #status { color: var(--text-muted); font-size: .85rem; }
.section-heading p { margin: 0; }
.hint { margin: 12px 0 20px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters label { font-size: .8rem; color: var(--text-muted); flex: 1 1 130px; min-width: 0; }
.filters label:first-child { flex: 3 1 200px; }
input, select { display: block; width: 100%; margin-top: 5px; font-size: .9rem; }
.file-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.file-list li { display: block; padding: 8px 0; }
.empty { text-align: center; padding: 32px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-muted); }
.empty p { margin-bottom: 0; }
#error { color: var(--danger); }
.notice, [data-gezel-demo-banner] { padding: 12px 16px; background: var(--accent-soft); border-radius: var(--radius-md); font-size: .85rem; }
[data-gezel-demo-banner] { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
section + section { margin-top: 32px; }
#reports-section h2 { margin-bottom: 16px; }
footer { margin-top: 28px; }
.source-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .85rem; overflow-wrap: anywhere; }
.table-summary { margin-block: 16px 24px; }
#table-stamp { font-size: .85rem; overflow-wrap: anywhere; }
#insights-error { color: var(--danger); font-size: .85rem; overflow-wrap: anywhere; }
.chart-figure { margin: 20px 0 28px; }
figcaption { color: var(--text-muted); font-size: .85rem; margin-bottom: 16px; }
#chart { list-style: none; padding: 0; margin: 0; }
#chart li { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(80px, 3fr) minmax(56px, 1fr); gap: 12px; align-items: center; font-size: .85rem; margin-block: 10px; }
#chart li > :first-child { overflow-wrap: anywhere; }
#chart li > :last-child { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bar-track { display: block; position: relative; height: 24px; background: var(--accent-soft); }
.bar-track::after { content: ''; position: absolute; left: var(--zero, 0%); top: -3px; bottom: -3px; border-left: 1px solid var(--text-muted); }
.bar { position: absolute; height: 100%; background: var(--accent); }
details { border-top: 1px solid var(--border); padding-block: 12px; }
summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.table-scroll { overflow-x: auto; }
.table-scroll th { font-weight: 600; }
.table-scroll td { font-variant-numeric: tabular-nums; }
#numeric-summary th, #numeric-summary td { white-space: nowrap; }
#schema-body th, #schema-body td { max-width: 240px; overflow-wrap: anywhere; }
dialog { max-width: min(540px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); padding: 24px; }
dialog::backdrop { background: #0008; }
dialog h2 { overflow-wrap: anywhere; }
dialog p { margin-top: 12px; }
table { border-collapse: collapse; width: 100%; margin-bottom: 20px; font-size: .85rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
@media (max-width: 480px) {
  .file-list li { display: block; padding: 8px 0; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  dd { font-size: 1.2rem; }
  [data-gezel-demo-banner] { align-items: flex-start; flex-direction: column; }
}

/* Shared components own file presentation; the page owns its layout. */
#add-files { margin: 20px 0; }
