/* dkwatt UI styles (requirements.md §U8/U9/UG5/UG8). Mobile-first; light/dark via
   custom properties; AA-contrast text; visible focus. No build step. */

:root {
  --bg: #ffffff;
  --surface: #f4f6f9;
  --text: #1b2430;        /* on --bg: ~13:1 contrast (AA/AAA) */
  --text-muted: #4a5566;  /* on --bg: ~7:1 */
  --border: #d6dbe2;
  --accent: #0a66c2;
  --accent-text: #ffffff;
  --focus: #0a66c2;
  --warn-bg: #fff3cd;
  --warn-text: #6a4b00;   /* on --warn-bg: AA */
}
:root[data-theme="dark"] {
  --bg: #11161d;
  --surface: #1a212b;
  --text: #e6edf3;        /* on --bg: ~13:1 */
  --text-muted: #aab4c0;  /* on --bg: ~7:1 */
  --border: #2a3140;
  --accent: #7fd1ff;
  --accent-text: #08111c;
  --focus: #7fd1ff;
  --warn-bg: #3a2f0a;
  --warn-text: #ffe08a;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
  overflow-x: hidden;
}

a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-text); padding: .5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0; }

.site-header { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
h1 { font-size: 1.4rem; margin: 0; }
.subtitle { color: var(--text-muted); margin: .1rem 0; }
.freshness { color: var(--text-muted); font-size: .9rem; margin: 0; }

.controls { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.control-group { display: inline-flex; gap: .25rem; align-items: center; }
.control-label { color: var(--text-muted); font-size: .85rem; margin-right: .15rem; }

button, .theme-toggle {
  font: inherit; cursor: pointer; padding: .4rem .7rem; min-height: 40px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.taxes { display: inline-flex; gap: .35rem; align-items: center; font-size: .9rem; min-height: 40px; }
.taxes input { width: 18px; height: 18px; }

.stale-banner {
  background: var(--warn-bg); color: var(--warn-text);
  border: 1px solid var(--border); border-radius: 6px; padding: .6rem .8rem; margin: 0 0 1rem;
}

.chart { width: 100%; height: 360px; }
figure { margin: 0; }
.summary { color: var(--text-muted); font-size: .9rem; margin: .5rem 0 0; }

section { margin: 1.5rem 0; }
h2 { font-size: 1.1rem; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-muted); font-weight: 600; }

.alt-table summary { cursor: pointer; color: var(--accent); }

.site-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; }
.site-footer p { margin: .3rem 0; }

@media (min-width: 720px) {
  .site-header { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .controls { justify-content: flex-end; max-width: 60%; }
  .chart { height: 420px; }
}
