/* ScenExpat — mobile-first stylesheet. Design tokens documented in docs/DESIGN.md. */
:root {
  --navy: #14213d;
  --ink: #0b1020;
  --accent: #f4a259; /* warm saffron, the single accent */
  --accent-strong: #b4570f; /* accent for text on light backgrounds (AA) */
  --bg: #f8f6f1;
  --surface: #ffffff;
  --text: #16192b;
  --muted: #545b70;
  --line: #e3e0d8;
  --ok: #1d6b45;
  --err: #a8261b;
  --radius: 14px;
  --tap: 44px;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --nav-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #141b31;
    --text: #eef0f6;
    --muted: #a7aec4;
    --line: #26304d;
    --accent-strong: #f4a259;
    --ok: #6fd3a0;
    --err: #ff9a8f;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 16px/1.5 var(--sans);
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
img,
svg {
  max-width: 100%;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
}
h2 {
  font-size: 1.3rem;
}
h3 {
  font-size: 1.08rem;
}
p {
  margin: 0 0 0.75em;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-strong);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  background: var(--accent);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus {
  top: 8px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.block {
  display: block;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--navy);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: var(--tap);
  color: #fff;
}
.brand:hover {
  color: #fff;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--accent);
  font: 700 22px/1 var(--serif);
}
.brand-name {
  font: 700 1.25rem/1.1 var(--serif);
  letter-spacing: 0.01em;
}
.brand-accent {
  color: var(--accent);
}
.lang-switch {
  display: inline-grid;
  place-items: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.lang-switch:hover {
  color: var(--accent);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}
.hero {
  background: var(--navy);
  color: #fff;
  margin: -16px -16px 16px;
  padding: 20px 16px 24px;
}
.hero h1 {
  color: #fff;
}
.hero .lede {
  color: #d8dcea;
}
.hero .eyebrow {
  color: var(--accent);
}
.eyebrow {
  color: var(--accent-strong);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 0.4em;
}
.section {
  margin: 28px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
.cta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

/* Forms */
.search-form {
  display: grid;
  gap: 10px;
}
.field {
  display: grid;
  gap: 4px;
  position: relative;
}
.field > label,
.field > span,
fieldset > legend {
  font-weight: 600;
  font-size: 0.9rem;
}
.hero .field > label {
  color: #e6e9f2;
}
.field.inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
input[type='text'],
input[type='search'],
input[type='tel'],
input[type='date'],
input[type='number'],
select {
  font: inherit;
  font-size: 16px; /* no iOS zoom */
  min-height: var(--tap);
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.field.inline select {
  width: auto;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  min-width: 0;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--navy);
  margin: 0;
}
.check:has(input:checked) {
  border-color: var(--navy);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
}
.check.consent {
  border-radius: 12px;
  align-items: flex-start;
  padding: 12px;
}
.check.consent input {
  margin-top: 2px;
  flex: none;
}
.ac-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
  max-height: 60vh;
  overflow: auto;
}
.ac-list li {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.ac-list li[aria-selected='true'],
.ac-list li:hover {
  background: color-mix(in srgb, var(--accent) 25%, var(--surface));
}
.ac-list small {
  margin-left: auto;
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 1rem/1.1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.btn-primary {
  background: var(--accent);
  color: var(--ink);
}
.btn-primary:hover {
  color: var(--ink);
  filter: brightness(1.05);
}
.btn-accent {
  background: var(--navy);
  color: #fff;
}
.btn-accent:hover {
  color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  .btn-accent {
    background: var(--accent);
    color: var(--ink);
  }
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.actions,
.toolbar,
.near-controls,
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.8rem;
}

/* Chips */
.chips {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chips li {
  flex: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.95rem;
}
.chip[aria-current],
.chip[aria-pressed='true'] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.hero .chip {
  background: rgb(255 255 255 / 8%);
  border-color: rgb(255 255 255 / 25%);
  color: #fff;
}

/* Cards */
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
@media (min-width: 720px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}
.card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card:focus-within {
  outline: 3px solid var(--accent);
}
.card-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  font-size: 28px;
  background: color-mix(in srgb, var(--navy) 10%, var(--surface));
}
.card-body {
  min-width: 0;
  flex: 1;
}
.card-when {
  margin: 0 0 2px;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: capitalize;
}
.card-title {
  margin: 0 0 2px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.card-title a {
  text-decoration: none;
}
.card-title a::after {
  /* whole card is the tap target */
  content: '';
  position: absolute;
  inset: 0;
}
.card-where {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--navy) 10%, var(--surface));
}
.badge-soft {
  background: transparent;
  border: 1px solid var(--line);
}
.badge-warn {
  background: var(--err);
  color: #fff;
}
.badge-accent {
  background: var(--accent);
  color: var(--ink);
}
.dist {
  font-weight: 600;
}

/* Breadcrumbs, pager, notices */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
  align-items: center;
}
.crumbs li + li::before {
  content: '›';
  margin: 0 6px;
}
.crumbs a {
  display: inline-block;
  padding: 10px 0;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}
.notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.notice.ok {
  border-color: var(--ok);
  color: var(--ok);
}
.notice.err,
.error {
  border-color: var(--err);
  color: var(--err);
}
.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.count-line {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Drawer: <details> without JS; bottom sheet with JS (.is-sheet) */
.drawer > summary {
  list-style: none;
}
.drawer > summary::-webkit-details-marker {
  display: none;
}
.drawer-body {
  margin-top: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.drawer.is-sheet[open] .drawer-body {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-height: 85vh;
  overflow: auto;
  margin: 0;
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgb(0 0 0 / 30%);
  animation: sheet-up 0.22s ease-out;
}
.drawer.is-sheet[open]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgb(11 16 32 / 55%);
}
.drawer-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-top: 8px;
  margin-bottom: 0;
}
@keyframes sheet-up {
  from {
    transform: translateY(30%);
    opacity: 0;
  }
}

/* Show page */
.show-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--line);
}
.facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 20px;
  margin: 12px 0;
}
@media (min-width: 560px) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }
}
.facts dt {
  font-weight: 700;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.desc {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.map {
  height: 320px;
  border-radius: var(--radius);
  margin: 12px 0;
  border: 1px solid var(--line);
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.row > * {
  flex: 1 1 140px;
}
.alert-form {
  display: grid;
  gap: 12px;
  max-width: 560px;
}

/* Footer + sticky bottom nav */
.foot {
  max-width: 960px;
  margin: 24px auto 0;
  padding: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.foot a {
  display: inline-block;
  padding: 10px 4px;
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--navy);
  border-top: 1px solid rgb(255 255 255 / 10%);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tap);
  color: #c9cfe0;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
}
.nav-item svg {
  width: 24px;
  height: 24px;
}
.nav-item[aria-current='page'] {
  color: var(--accent);
}
.nav-item:hover {
  color: #fff;
}
@media (min-width: 960px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    width: 480px;
    transform: translateX(-50%);
    bottom: 12px;
    border-radius: 999px;
    height: var(--nav-h);
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .bottom-nav,
  .top .lang-switch,
  .actions {
    display: none;
  }
}

/* /bot crawler page */
.bot-page h2,
.bot-page h3 {
  margin: 1.2em 0 0.4em;
}
.bot-page ul {
  padding-left: 1.2em;
}
.bot-page li {
  margin: 0.3em 0;
}
.bot-page pre {
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #ddd);
}
.bot-page code.ua {
  overflow-wrap: anywhere;
}
