/* TwinBrick it im Browser - the page. Colours follow the hexascan site (light and dark). No position:fixed: the site
   adds its own sticky navigation header (60 px) at the top of the body; this page scrolls normally below it. */
:root {
  --bg: #ECEEEC; --surface: #F8F9F7; --fg: #1B2A34; --muted: #56636A; --line: #CBD1CF;
  --accent: #8C6420; --accent-ink: #fff; --accent-soft: rgba(140, 100, 32, .11); --green: #3F6E5A;
  --warn: #9a3b1c; --code: #e3e6e3;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 8px; --wrap: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11181D; --surface: #18232B; --fg: #E6E3E0; --muted: #9AA6AB; --line: #2A3943;
    --accent: #D6AA55; --accent-ink: #11181D; --accent-soft: rgba(214, 170, 85, .13); --green: #7FB89D;
    --warn: #f0a07a; --code: #0d1317;
  }
}
:root[data-theme="dark"] {
  --bg: #11181D; --surface: #18232B; --fg: #E6E3E0; --muted: #9AA6AB; --line: #2A3943;
  --accent: #D6AA55; --accent-ink: #11181D; --accent-soft: rgba(214, 170, 85, .13); --green: #7FB89D;
  --warn: #f0a07a; --code: #0d1317;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(32px, 5.4vw, 56px); font-weight: 750; letter-spacing: -.015em; }
h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 17px; font-weight: 650; margin: 0 0 6px; }
p { margin: 0 0 12px; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
section { scroll-margin-top: 76px; }
.small, small { font-size: 13.5px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
       border-radius: 6px; padding: 7px 12px; text-decoration: none; color: var(--fg); font-size: 14.5px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.btn.primary:disabled { opacity: .55; cursor: wait; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* intro */
.intro { padding: 28px 16px 8px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; }
.intro .kicker { font: 500 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
                 margin-bottom: 10px; }
.intro .lead { font-size: 18px; margin-top: 14px; }
.intro figure { margin: 0; }
.intro figure img { border-radius: var(--r); border: 1px solid var(--line); }
.intro figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.steps { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px;
            font-size: 14.5px; margin: 0; }
.steps b { display: block; font-family: var(--display); font-size: 22px; color: var(--accent); }
.langs { display: inline-flex; gap: 4px; margin-left: 10px; vertical-align: middle; }
.langs button { border: 1px solid var(--line); background: transparent; border-radius: 5px; padding: 1px 8px;
                font-size: 13px; }
.langs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* consent */
#consent { margin-top: 18px; border-left: 4px solid var(--accent); }
#consent ul { margin: 8px 0 14px; padding-left: 20px; }
#consent li { margin: 4px 0; }
#consent .btn.primary { white-space: normal; text-align: left; line-height: 1.4; padding: 12px 16px; font-size: 15.5px;
                        max-width: 760px; }
.host { font-family: var(--mono); font-size: 13.5px; }

/* tool */
#tool { margin-top: 22px; }
.toolgrid { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
form.settings { display: grid; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; margin: 0;
           background: var(--surface); min-width: 0; }
.toolgrid > *, .rescols > * { min-width: 0; }
select { max-width: 100%; text-overflow: ellipsis; }
legend { font-weight: 650; font-size: 14.5px; padding: 0 4px; }
label { font-size: 14.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row + .row { margin-top: 8px; }
input[type=text], input[type=number], select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
  background: var(--bg); min-width: 0; }
input[type=number] { width: 92px; }
input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shapes label { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line);
                border-radius: 6px; padding: 6px 2px; font-size: 12.5px; cursor: pointer; background: var(--bg); }
.shapes input { position: absolute; opacity: 0; pointer-events: none; }
.shapes label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.shapes label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.shapes svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; }
.facts-mini { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.mapbox { position: relative; }
#map { height: 560px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); z-index: 0; }
.maphint { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }
.runbox { margin-top: 14px; display: grid; gap: 8px; }
.runline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#status { font-size: 14.5px; color: var(--muted); }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
#log { margin: 0; background: var(--code); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
       font: 12.5px/1.45 var(--mono); max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.warn { color: var(--warn); }

/* result */
#result { margin-top: 28px; }
.simplified { background: var(--accent-soft); border-radius: 6px; padding: 8px 12px; font-size: 14.5px; }
.viewer { position: relative; height: min(62vh, 580px); min-height: 320px; background: var(--surface);
          border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; touch-action: none; }
.viewer canvas { width: 100%; height: 100%; display: block; }
.viewer .hint { position: absolute; left: 10px; bottom: 8px; font-size: 12.5px; color: var(--muted); pointer-events: none; }
.vctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 18px; }
.vctl .lay { font-size: 14px; color: var(--muted); min-width: 120px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-bottom: 18px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.facts b { display: block; font-family: var(--display); font-size: 21px; }
.facts span { font-size: 13px; color: var(--muted); }
.rescols { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
table.parts { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--surface);
              border: 1px solid var(--line); border-radius: 6px; }
table.parts th, table.parts td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
table.parts td.n, table.parts th.n { text-align: right; font-variant-numeric: tabular-nums; }
.sw { display: inline-block; width: 13px; height: 13px; border: 1px solid rgba(0,0,0,.35); border-radius: 2px;
      margin-right: 6px; vertical-align: -1px; }
.partsbox { max-height: 460px; overflow: auto; }
.downloads { display: grid; gap: 8px; }
.downloads .btn { justify-content: space-between; }
.downloads small { margin-left: auto; color: inherit; opacity: .75; white-space: nowrap; }
#plan img { border: 1px solid var(--line); border-radius: 6px; background: #fff; margin-top: 12px; }

/* sources */
#sources { margin: 30px auto 40px; }
#sources ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; }
  .toolgrid, .rescols { grid-template-columns: 1fr; }
  #map { height: 380px; }
  .steps { grid-template-columns: 1fr; }
}
@media print { #consent, #tool, .vctl, .downloads { display: none; } }
#overpassHelp { border-left: 4px solid var(--warn); }
#overpassHelp p { margin-bottom: 6px; }
#overpassHelp p:last-child { margin-bottom: 0; }
