:root {
  color-scheme: light dark;
  --accent: #2456e6;
  --accent-text: #1f4bd1;
  --line: #8884;
  --bg: Canvas;
  --surface: Canvas;
  --text: CanvasText;
  --muted: color-mix(in srgb, CanvasText 62%, Canvas);
  --border: var(--line);
  --on-accent: #fff;
  --danger: #c53030;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-s: 8px;
  --radius-m: 12px;
  --shadow: 0 6px 24px #0004;
  --text-sm: 0.9rem;
  --text-body: 17px;
  --text-lede: 1.1rem;
  --text-title: clamp(1.7rem, 5vw, 2.4rem);
  --text-mono: 0.875rem;
}
@media (prefers-color-scheme: dark) { :root { --accent-text: #9bb4ff; --danger: #ff8a8a; } }
* { 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 a, main code { overflow-wrap: anywhere; }
#output td { overflow-wrap: break-word; }
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; }
.drop { display: block; margin: 20px 0 8px; }
.drop span { display: block; font-weight: 600; margin-bottom: 6px; }
.drop textarea { width: 100%; min-height: 12rem; padding: 12px; border: 2px dashed var(--accent); border-radius: 12px; font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: transparent; color: inherit; resize: vertical; }
.drop.over textarea { background: #2456e61a; }
.file { margin: 8px 0 0; }
.file input { max-width: 100%; font: inherit; color: var(--muted); }
.file input::file-selector-button { font: inherit; min-height: 44px; padding: 8px 16px; margin-right: 12px; background: transparent; color: CanvasText; border: 1px solid var(--accent); border-radius: 8px; cursor: pointer; transition: background-color 160ms ease; }
.file input::file-selector-button:hover { background: #2456e61a; }
#status { min-height: 1.6em; font-weight: 600; }
#status.error { color: #c53030; }
@media (prefers-color-scheme: dark) { #status.error { color: #ff8a8a; } }
#output table { width: 100%; border-collapse: collapse; font-size: .95rem; }
#output th, #output td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions button { min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
/* 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; }
.tool { margin: 24px 0; }
fieldset.columns {
  border: 0;
  padding: 0;
  margin: 12px 0;
  min-inline-size: 0;
  display: grid;
  gap: 10px;
}
fieldset.columns legend { font-weight: 700; padding: 0; }
fieldset.columns > div { min-width: 0; }
@media (min-width: 50rem) {
  fieldset.columns { grid-template-columns: 1fr 1fr; }
  fieldset.columns legend { grid-column: 1 / -1; }
}
fieldset.columns label,
.tool label[for="product-query"],
.tool label[for="floor"] {
  display: block;
  font-weight: 700;
}
.tool label[for="product-query"],
.tool label[for="floor"] { margin-top: 12px; }
fieldset.columns select,
#product-query,
#floor {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: Canvas;
  color: CanvasText;
  font: inherit;
  font-weight: 400;
}
.file input { min-height: 44px; }
.picked {
  display: block;
  min-height: 1.5em;
  margin: 0 0 4px;
  font-size: .9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#product-query::placeholder,
#floor::placeholder { color: var(--muted); opacity: 1; }
.actions { margin-top: 24px; gap: 12px; }
.actions button.secondary { background: transparent; color: inherit; border: 1px solid var(--accent); }
.actions button:hover { background: #1d4ed8; }
.actions button:active { background: #1a46c4; }
.actions button.secondary:hover { background: #2456e61a; }
.actions button.secondary:active { background: #2456e633; }
.actions button:disabled, fieldset.columns select:disabled { opacity: .45; cursor: not-allowed; }
.actions button:disabled:hover, .actions button:disabled:active { background: var(--accent); }
.actions button.secondary:disabled:hover, .actions button.secondary:disabled:active { background: transparent; }
#status { margin: 12px 0 16px; overflow-wrap: anywhere; }
#output h2 { margin: 16px 0 0; font-size: 1rem; }
#output .record-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; max-width: 100%; }
@media (min-width: 44rem) {
  #output table { width: max-content; min-width: 100%; max-width: 44rem; }
}
#output th { border-bottom-width: 2px; white-space: nowrap; }
#output td.ver {
  font: .875rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}
#output td.repeat { color: var(--muted); }
.note { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }
#ticket {
  font: .875rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  margin: 16px 0 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.brand:hover { text-decoration: underline; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .actions button, a, select, input, textarea { transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
  #output.pop { animation: appear 160ms ease; }
}
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .actions button, a, select, input, textarea { transition: none; }
  .file input::file-selector-button { transition: none; }
  #output.pop { animation: none; }
}
