:root {
  color-scheme: light dark;
  --accent: #2456e6;
  --accent-text: #1f4bd1;
  --line: #8884;
}
@media (prefers-color-scheme: dark) { :root { --accent-text: #9bb4ff; } }
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 17px/1.6 system-ui, sans-serif;
}
header, main, footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 16px 20px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand, header nav a { display: inline-block; min-height: 44px; line-height: 44px; }
.brand { font-weight: 700; text-decoration: none; color: inherit; }
a { color: var(--accent-text); }
/* Long URLs and code never push the page sideways on a narrow phone. */
main p, main li, main td, main a, main code { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.15; margin: 12px 0; text-wrap: balance; }
h2 { margin-top: 2.2rem; }
h3 { margin-bottom: 0; font-size: 1rem; }
.lede { font-size: 1.1rem; }
.tool > * { margin-top: 0; }
.check, .drop, .row, .actions { margin-bottom: 20px; }
.check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.check input { width: 28px; height: 28px; margin: 8px 0; accent-color: var(--accent); }
.check label { flex: 1 1 14rem; min-height: 44px; display: flex; align-items: center; }
.check .hint { flex-basis: 100%; }
.hint { display: block; margin-top: 6px; font-size: .9rem; color: color-mix(in srgb, CanvasText 72%, Canvas); }
.drop { display: block; margin-bottom: 0; }
.drop span { display: block; font-weight: 600; margin-bottom: 6px; }
.drop input[type="file"] {
  display: block;
  width: 100%;
  min-height: 8rem;
  padding: 28px 12px;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.drop.over input[type="file"] { background: #2456e61a; }
.drop-hint { margin-bottom: 20px; }
.row { display: grid; grid-template-columns: 1fr; gap: 20px 16px; }
@media (min-width: 36rem) { .row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field select { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: Canvas; color: CanvasText; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions button { min-height: 44px; padding: 8px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
button.fill { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
button.outline { border: 1px solid var(--accent); background: transparent; color: CanvasText; }
button:disabled { opacity: .45; cursor: not-allowed; }
#status { min-height: 1.6em; font-weight: 400; margin-bottom: 16px; }
#status.error { color: #c53030; font-weight: 600; }
@media (prefers-color-scheme: dark) { #status.error { color: #ff8a8a; } }
#preview { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.sheet { background: #fff; color: #000; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.sheet[hidden] { display: none; }
#preview-caption { margin: 0 0 16px; }
#preview-caption:empty { margin: 0; }
.label { font-weight: 600; margin: 0 0 6px; }
.mono { font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.mono:empty { display: none; }
.downloads { margin-top: 16px; }
.closing { margin: 0 0 12px; }
/* The ad slot keeps its height whatever fills it, so the page never shifts. It is only rendered
   when the build has something to put in it (src/pages.mjs). */
.ad-slot { height: 250px; overflow: hidden; contain: strict; margin: 36px 0; padding: 12px; border-radius: 12px; }
.ads-off .ad-slot { display: none; }
.ad-label { display: block; opacity: .65; font-size: .75rem; margin-bottom: 8px; }
.house-card { display: block; padding: 14px 16px; border-radius: 10px; background: #2456e612; color: inherit; text-decoration: none; }
.house-card strong { display: block; color: var(--accent-text); }
.house-card span { display: block; margin-top: 4px; font-size: .95rem; }
.consent { position: fixed; inset: auto 12px 12px 12px; max-width: 44rem; margin: 0 auto; padding: 14px 16px; border-radius: 12px; background: Canvas; color: CanvasText; border: 1px solid var(--line); box-shadow: 0 6px 24px #0004; z-index: 10; }
.consent div { display: flex; gap: 10px; flex-wrap: wrap; }
.consent button { flex: 1; min-height: 44px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--accent); background: transparent; color: inherit; font: inherit; cursor: pointer; }
footer { margin-top: 40px; opacity: .7; font-size: .9rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
