* { box-sizing: border-box; }
body { margin: 0; }

header, main, footer {
  margin: 0 auto;
  padding: var(--s4) var(--s5);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
}
.brand, header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.brand { color: inherit; font-weight: 700; text-decoration: none; }
header nav a { min-width: 44px; }
main p, main li, main a, main code { overflow-wrap: anywhere; }
h1 { line-height: 1.15; }

/* The picker label stays visible alongside the native button. */
.dropzone label.field-label {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  white-space: normal;
}
.dropzone #input { min-width: 0; }
.date-field, .capture-head .file, .source figcaption .file, .progress progress { min-width: 0; }
[dir="auto"] { text-align: start; }
.report .ref { flex-shrink: 0; }
.privs th { overflow-wrap: anywhere; }

/* House cards use the template's reserved slot when the factory supplies them. */
.ad-slot { height: 250px; overflow: hidden; contain: strict; margin: var(--s6) 0; padding: var(--s3); }
.ads-off .ad-slot { display: none; }
.ad-label { display: block; margin-bottom: var(--s2); }
.house-card { display: block; padding: var(--s3) var(--s4); text-decoration: none; }
.house-card strong, .house-card span { display: block; }
.house-card span { margin-top: var(--s1); }
.consent { position: fixed; inset: auto var(--s3) var(--s3); max-width: 44rem; margin: 0 auto; padding: var(--s4); z-index: 10; }
.consent div { display: flex; gap: var(--s3); flex-wrap: wrap; }
.consent button { flex: 1; }
footer { margin-top: var(--s7); }

@media (max-width: 40rem) {
  body > header:first-child { padding-inline: var(--s4); }
  .dropzone #input::file-selector-button { width: 100%; margin-inline-end: 0; }
}

@media print {
  .source.source { overflow: visible; }
}

/* Source appendix: wrap long lines inside the card; the page never scrolls sideways. */
.appendix .source pre { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: visible; tab-size: 8; }
