:root {
  --ink: #17201c;
  --muted: #617069;
  --paper: #f8f3e8;
  --panel: #fffdf8;
  --line: #ded7c9;
  --accent: #0f7b66;
  --accent-dark: #085747;
  font-family: "Aptos", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 87% 7%, rgba(255, 140, 0, 0.13), transparent 22rem),
    linear-gradient(145deg, #f8f0df 0%, #edf4ee 52%, #f7efe0 100%);
}

.faq-shell {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 42px;
}

.faq-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "intro nav"
    "toc toc";
  align-items: start;
  gap: 18px 28px;
  padding: 0 0 30px;
  border-bottom: 1px solid var(--line);
}

.faq-header > div {
  grid-area: intro;
}

.faq-nav {
  grid-area: nav;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.faq-section-nav {
  grid-area: toc;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding-top: 10px;
}

.faq-section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 14px;
  border: 1px solid rgba(23, 32, 28, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.55);
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.faq-section-link:hover,
.faq-section-link:focus-visible {
  border-color: rgba(8, 87, 71, 0.24);
  background: rgba(255, 253, 248, 0.82);
  outline: none;
  transform: translateY(-1px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro {
  max-width: 58ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.faq-nav,
.faq-footer a {
  display: flex;
  gap: 6px;
}

.faq-nav a,
.faq-nav .language-toggle,
.faq-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.faq-nav a:hover,
.faq-nav .language-toggle:hover,
.faq-footer a:hover {
  background: var(--accent-dark);
}

.faq-nav a:not(.is-current) {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-dark);
}

.faq-nav .language-toggle {
  border: 1px solid var(--accent-dark);
  cursor: pointer;
}

.faq-nav a.missing-restrictions-link {
  display: block;
  flex: 0 0 auto;
  width: 100px;
  padding: 6px 8px;
  font-size: 0.76rem;
  line-height: 1.2;
  text-align: center;
}

.faq-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin-bottom: 14px;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.faq-section h2 {
  scroll-margin-top: 20px;
}

.faq-list {
  display: grid;
  gap: 8px;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 8px 22px rgba(34, 43, 37, 0.06);
}

summary {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 12px 46px 12px 15px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  position: relative;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  position: absolute;
  right: 16px;
  color: var(--accent-dark);
  content: "+";
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

details[open] summary::after {
  content: "−";
}

details p {
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

details .faq-answer {
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

details .faq-answer p {
  padding: 0;
}

details .faq-answer p + p {
  margin-top: 10px;
}

.impact-word {
  font-weight: 900;
}

.impact-word.critical {
  color: #ff1744;
}

.impact-word.major {
  color: #ff8c00;
}

.impact-word.moderate {
  color: #ffe600;
}

.impact-word.parking {
  color: #ff2bd6;
}

details .profile-link {
  margin-top: -8px;
  color: var(--ink);
}

details a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-table-wrap {
  overflow-x: auto;
  margin: 0 16px 16px;
}

.source-table-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 16px 10px;
}

.source-filter-menu {
  position: relative;
}

.source-filter-button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.source-filter-button::after {
  content: "▾";
  margin-left: 8px;
}

.source-table th[data-source-filter] {
  position: relative;
  padding: 0;
  text-transform: none;
}

.source-table th[data-source-filter] .source-filter-menu {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: none;
  vertical-align: middle;
}

.source-table th[data-source-filter="dataType"] {
  width: 160px;
}

.source-table th[data-source-filter="municipality"] {
  width: 145px;
}

.source-filter-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  display: grid;
  gap: 6px;
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(34, 43, 37, 0.16);
  z-index: 5;
}

.source-filter-options[hidden] {
  display: none !important;
}

.source-filter-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  text-transform: none;
}

.source-filter-all {
  padding-bottom: 7px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.source-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.source-table th,
.source-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.source-table th {
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.source-table th:nth-child(2),
.source-table th:nth-child(4) {
  text-align: center;
}

.source-col-municipality {
  width: 145px;
}

.source-col-name {
  width: 400px;
}

.source-col-type {
  width: 160px;
}

.source-col-link {
  width: 120px;
}

.source-table td:first-child {
  color: var(--muted);
  font-weight: 700;
}

.source-table td:nth-child(2) {
  color: var(--ink);
  font-weight: 700;
}

.source-table td:nth-child(3) {
  width: 120px;
  white-space: nowrap;
}

.source-table td:nth-child(4) {
  width: 112px;
  white-space: nowrap;
}

.source-table td:nth-child(3),
.source-table td:nth-child(4) {
  white-space: nowrap;
}

.snapshot-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.source-tooltip {
  position: fixed;
  z-index: 30;
  left: 0;
  top: 0;
  max-width: 200px;
  padding: 6px 8px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.3;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.source-tooltip[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .source-col-municipality { width: 120px; }
  .source-col-name { width: 260px; }
  .source-col-type { width: 140px; }
  .source-col-link { width: 120px; }
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent-dark);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(20, 29, 26, 0.2);
  color: #fff;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
  z-index: 10;
}

.back-to-top:hover {
  background: var(--accent-dark);
}

.faq-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 30px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.faq-footer p {
  max-width: 60ch;
}

@media (max-width: 640px) {
  .faq-shell {
    width: min(100% - 28px, 920px);
    padding: 28px 0 26px;
  }

  .faq-header,
  .faq-footer {
    align-items: flex-start;
  }

  .faq-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "nav"
      "toc";
    gap: 18px;
    padding-bottom: 24px;
  }

  .faq-nav {
    justify-content: flex-end;
    width: 100%;
    margin-top: 0;
  }

  .faq-section-nav {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .faq-nav a,
  .faq-nav .language-toggle {
    flex: 1 1 0;
  }

  h1 {
    font-size: 2rem;
  }

  .intro {
    font-size: 0.92rem;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }

  .faq-section {
    padding: 24px 0;
  }

  summary {
    min-height: 52px;
    padding-left: 13px;
  }

  details p {
    padding: 0 13px 14px;
    font-size: 0.9rem;
  }

  details .faq-answer {
    padding: 0 13px 14px;
    font-size: 0.9rem;
  }
}
