:root {
  color-scheme: light dark;
  --bg: #ffffff; --fg: #17202a; --muted: #4d5966; --line: #d5dbe1; --panel: #f5f7f9; --accent: #0b5cad; --accent-fg: #ffffff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161b; --fg: #e6eaee; --muted: #a9b3bd; --line: #2f3842; --panel: #1a2027; --accent: #7db7f0; --accent-fg: #0b1622; }
}
* { box-sizing: border-box; }
html { font-family: var(--sans); background: var(--bg); color: var(--fg); line-height: 1.5; }
body { margin: 0; }
a { color: var(--accent); }
code, pre { font-family: var(--mono); font-size: 0.875rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--accent); color: var(--accent-fg); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem 3rem; }

.top { border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; min-height: 3.25rem; padding: 0 1.25rem; }
.brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--fg); }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }

.button {
  display: inline-block; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; text-align: center; white-space: nowrap;
  padding: 0.4rem 0.8rem; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
}
.button.secondary { background: transparent; color: var(--accent); }
input[type="file"]:focus-visible + .button { outline: 3px solid var(--accent); }
select, input[type="url"] { font: inherit; font-size: 0.9rem; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }

.app main { padding: 0.75rem 1.25rem 1rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.toolbar label:not(.button) { font-size: 0.9rem; color: var(--muted); margin-left: 0.5rem; }
.status { font-size: 0.875rem; color: var(--muted); }
.app awp-editor { --awp-editor-height: calc(100vh - 9.5rem); min-height: 28rem; }
.note { color: var(--muted); font-size: 0.8rem; margin: 0.5rem 0 0; }

.url-form { margin: 1rem 0 1.5rem; }
.url-form label { font-weight: 600; display: block; margin-bottom: 0.35rem; }
.url-form .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.url-form input { flex: 1 1 22rem; }
.hint { color: var(--muted); font-size: 0.85rem; }
awp-viewer { border: 1px solid var(--line); border-radius: 8px; }

.prose { max-width: 900px; }
.prose h2 { margin-top: 2rem; }
.prose pre { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 0.75rem; overflow: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--panel); }
