:root {
  --ink: #173c3a;
  --muted: #63706e;
  --paper: #fbfaf5;
  --line: #dce5dd;
  --sea: #159a8c;
  --sun: #ef7d32;
  --sky: #2e6ea6;
  --leaf: #7aa95c;
  --teal: #2d91a9;
  --gold: #d7ac21;
  --cream: #f6f5ed;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(26, 61, 58, 0.12);
  --page-max: 1340px;
  --page-gutter: clamp(18px, 4vw, 42px);
}

* {
  box-sizing: border-box;
}

[hidden],
.is-hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(220, 242, 239, 0.72), transparent 500px),
    var(--cream);
  font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 118px;
  padding: 0 var(--page-gutter);
  color: var(--white);
  background: var(--teal);
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(26px, 5vw, 78px);
  width: min(var(--page-max), 100%);
  min-height: inherit;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.project-brand img {
  display: block;
  width: clamp(190px, 16vw, 250px);
  height: auto;
  max-height: 74px;
  object-fit: contain;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--white);
  background: var(--ink);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.header-navigation {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 62px);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 800;
}

.language-switcher span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.language-switcher select {
  width: auto;
  min-width: 96px;
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  border-color: rgba(255, 255, 255, 0.38);
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.language-switcher option {
  color: var(--ink);
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.98rem;
  font-weight: 800;
}

nav a,
.nav-button {
  color: inherit;
}

nav a:hover,
nav a[aria-current="page"],
.nav-button:hover {
  color: var(--white);
}

.admin-nav {
  opacity: 0.7;
}

.county-crest {
  display: block;
  width: 58px;
  height: auto;
  max-height: 76px;
  object-fit: contain;
}

.nav-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

main {
  width: min(var(--page-max), calc(100% - (var(--page-gutter) * 2)));
  margin: 0 auto;
  padding: 0 0 56px;
}

.hero {
  min-height: min(690px, calc(78vh - 58px));
  display: grid;
  grid-template-columns: minmax(320px, 0.84fr) minmax(520px, 1.16fr);
  align-items: center;
  gap: clamp(46px, 6vw, 104px);
  padding: 44px 0 34px;
}

.home-hero {
  position: relative;
  min-height: clamp(390px, 48vh, 560px);
  grid-template-columns: minmax(280px, 560px);
  align-items: center;
  margin-top: 0;
  padding: clamp(46px, 7vw, 86px) clamp(22px, 5vw, 84px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.33) 38%, rgba(0, 0, 0, 0.04) 70%),
    url("assets/img/hero-cycling-alt.jpg") center / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 540px;
}

.home-hero .hero-copy {
  max-width: 520px;
  color: var(--white);
}

.home-hero .hero-copy h1 {
  display: inline;
  padding: 0.16em 0.28em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: var(--white);
  background: rgba(0, 0, 0, 0.78);
  font-size: clamp(1.9rem, 2.8vw, 3.15rem);
  line-height: 1.28;
}

.home-hero .hero-copy > p {
  display: inline-block;
  max-width: 880px;
  margin: 24px 0 0;
  padding: 12px 16px;
  color: #ffffff;
  background: rgba(18, 94, 111, 0.96);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--sea);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 3.4vw, 3.9rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.25vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 22px 0 10px;
  font-size: 1.02rem;
}

.hero-copy > p:not(.eyebrow),
.admin-intro p {
  max-width: 680px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.project-card {
  overflow: hidden;
  border: 1px solid rgba(23, 60, 58, 0.12);
  border-radius: 0;
  background: var(--white);
  box-shadow: 0 28px 58px rgba(26, 61, 58, 0.16);
}

.project-card-bottom {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: clamp(50px, 6vw, 88px);
}

.project-card-bottom img {
  width: min(580px, 92%);
  height: auto;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  color: var(--white);
  background: var(--ink);
}

.button.ghost {
  color: var(--ink);
  background: transparent;
}

.hero-map {
  position: relative;
  min-height: 360px;
  border: 1px solid rgba(23, 60, 58, 0.14);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-map svg {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: block;
}

.toolbar {
  display: grid;
  gap: 18px;
  padding: 28px 0 18px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  gap: 4px;
}

.area-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 12px;
}

.area-tile {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 13px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(23, 60, 58, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.area-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 154, 140, 0.45);
  box-shadow: 0 16px 34px rgba(23, 60, 58, 0.1);
}

.area-tile.active {
  color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 18px 38px rgba(23, 60, 58, 0.18);
}

.area-tile strong {
  font-size: 0.91rem;
  line-height: 1.22;
}

.area-tile span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.area-tile.active span {
  color: rgba(255, 255, 255, 0.78);
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  margin: 0 0 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--white);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sea);
  box-shadow: 0 0 0 4px rgba(21, 154, 140, 0.12);
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.route-list,
.route-grid {
  display: grid;
  gap: 12px;
}

.route-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.route-card {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 212px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.route-card:hover,
.route-card.active {
  transform: translateY(-2px);
  border-color: rgba(21, 154, 140, 0.55);
  box-shadow: 0 14px 36px rgba(23, 60, 58, 0.1);
}

.route-card strong {
  font-size: 1.03rem;
}

.route-number {
  color: var(--sun);
  margin-right: 4px;
}

.route-card span:not(.badge):not(.route-type-badge) {
  color: var(--muted);
  line-height: 1.45;
}

.route-card span.route-type-badge {
  color: #ffffff;
}

.badge,
.route-type-badge {
  justify-self: start;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--sea);
  background: rgba(21, 154, 140, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.route-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.route-type-badge {
  color: #ffffff;
  background: #4a5754;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.route-type-badge.mtb {
  background: #b8271f;
}

.route-type-badge.trekking {
  background: #247345;
}

.route-type-badge.road {
  background: #1f5f9f;
}

.home-hero .hero-copy > p:not(.eyebrow) {
  color: #ffffff;
  background: rgba(10, 82, 98, 0.98);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.route-card .route-type-badge,
.route-overview .route-type-badge {
  color: #ffffff;
}

.metrics,
.detail-footer,
.surface-row,
.difficulty-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metrics span,
.detail-footer span,
.detail-footer a,
.surface-badge,
.difficulty-badge {
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--ink);
  background: #f1f5ec;
  font-size: 0.82rem;
  font-weight: 800;
}

.surface-badge,
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
}

.surface-badge small {
  color: var(--sea);
  font-weight: 900;
}

.difficulty-badge strong {
  font-size: 0.78rem;
  line-height: 1.25;
}

.difficulty-dots {
  display: inline-flex;
  gap: 3px;
}

.difficulty-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #c9d4cd;
}

.difficulty-dot.active {
  background: var(--sun);
}

.route-detail,
.admin-form {
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.detail-head p,
.empty-state p {
  color: var(--muted);
  line-height: 1.65;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.stat-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.stat-grid strong,
.stat-grid span {
  display: block;
}

.stat-grid strong {
  font-size: 1.04rem;
}

.stat-grid span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 800;
}

.route-map,
.elevation,
.leaflet-route-map {
  width: 100%;
  display: block;
  border-radius: 8px;
  overflow: hidden;
}

.leaflet-route-map {
  height: min(520px, 58vh);
  min-height: 390px;
  border: 1px solid var(--line);
  background: #dcefed;
}

.detail-map {
  height: min(620px, 68vh);
}

.leaflet-route-map .leaflet-control-attribution {
  font-size: 0.68rem;
}

.service-station-marker {
  display: grid;
  place-items: center;
}

.service-station-marker-inner {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid #f59f00;
  border-radius: 999px;
  color: #143433;
  background: #fffaf0;
  box-shadow: 0 8px 22px rgba(23, 60, 58, 0.22), 0 0 0 3px rgba(23, 60, 58, 0.18), 0 0 0 6px rgba(255, 255, 255, 0.74);
}

.service-station-marker-inner span {
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-1px);
}

.route-marker {
  border: 4px solid var(--white);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(23, 60, 58, 0.3);
}

.start-marker {
  background: var(--sea);
}

.finish-marker {
  background: var(--sun);
}

.route-map rect {
  fill: #dcefed;
}

.terrain.t1 {
  fill: #d7e8c9;
}

.terrain.t2 {
  fill: none;
  stroke: rgba(23, 60, 58, 0.14);
  stroke-width: 22;
  stroke-linecap: round;
}

.route-shadow {
  fill: none;
  stroke: rgba(23, 60, 58, 0.2);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-line {
  fill: none;
  stroke: var(--sun);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start {
  fill: var(--sea);
  stroke: var(--white);
  stroke-width: 4;
}

.finish {
  fill: var(--sun);
  stroke: var(--white);
  stroke-width: 4;
}

.elevation {
  background: #f4f8f1;
  border: 1px solid var(--line);
}

.elevation-area {
  fill: rgba(122, 169, 92, 0.28);
}

.elevation-line {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 4;
}

.map-empty,
.profile-empty,
.service-empty,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.profile-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.generated-profile-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.generated-profile {
  display: block;
  width: 100%;
  height: auto;
}

.profile-bg {
  fill: #ffffff;
}

.profile-title,
.profile-axis {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.profile-label {
  fill: #52615f;
  font-size: 12px;
  font-weight: 700;
}

.profile-grid {
  stroke: #dfe8e0;
  stroke-width: 1;
}

.profile-area {
  fill: rgba(122, 169, 92, 0.22);
}

.profile-line {
  fill: none;
  stroke: #4d9a54;
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.profile-hit-area {
  fill: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.profile-hover-line {
  stroke: var(--sun);
  stroke-width: 2;
  stroke-dasharray: 5 4;
  pointer-events: none;
}

.profile-hover-dot {
  fill: var(--sun);
  stroke: var(--white);
  stroke-width: 3;
  pointer-events: none;
}

.profile-readout {
  min-height: 24px;
  margin-top: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.profile-min {
  stroke: #3b8265;
  stroke-dasharray: 7 5;
  stroke-width: 2;
}

.profile-max {
  stroke: #ef7d32;
  stroke-dasharray: 7 5;
  stroke-width: 2;
}

.rotate {
  transform: rotate(-90deg);
}

.profile-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.profile-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-legend i {
  display: inline-block;
  width: 18px;
  border-top: 2px dashed currentColor;
}

.legend-min {
  color: #3b8265;
}

.legend-max {
  color: #ef7d32;
}

.route-page {
  max-width: 1180px;
}

.route-hero {
  display: grid;
  gap: 14px;
  padding: 44px 0 20px;
}

.route-hero h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.route-hero h1 span {
  color: var(--sun);
}

.route-actions {
  display: flex;
  gap: 10px;
}

.button.disabled {
  color: var(--muted);
  border-color: var(--line);
  cursor: default;
}

.back-link {
  color: var(--sea);
  font-weight: 900;
}

.detail-section {
  margin-top: 24px;
}

.split-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.route-overview {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(150px, 0.9fr) minmax(220px, 1.4fr) minmax(260px, 1.8fr);
  gap: 12px;
  align-items: stretch;
}

.route-overview > div {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.route-overview h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.route-number-card {
  color: var(--sun);
  font-size: 1.55rem;
  font-weight: 900;
}

.route-description {
  max-width: 860px;
  color: #344947;
  line-height: 1.72;
}

.visitor-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.visitor-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(23, 60, 58, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(23, 60, 58, 0.06);
}

.visitor-link:hover,
.visitor-link:focus-visible {
  border-color: rgba(21, 154, 140, 0.5);
  color: var(--sea);
}

.route-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.route-gallery-item {
  display: grid;
  gap: 7px;
  margin: 0;
}

.route-gallery img,
.route-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8.5;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(23, 60, 58, 0.1);
}

.route-gallery-item figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.site-footer {
  position: relative;
  width: 100%;
  margin-top: 26px;
  background: var(--white);
}

.site-footer img {
  display: block;
  width: 100%;
  height: auto;
}

.footer-dubrovnik-link {
  position: absolute;
  top: 8%;
  right: 7%;
  width: 28%;
  height: 34%;
  border-radius: 8px;
}

.footer-dubrovnik-link:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 4px;
}

.footer-current-year {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 1;
  min-width: 0;
  padding: 0;
  color: var(--white);
  background: transparent;
  font-size: clamp(0.68rem, 0.9vw, 0.82rem);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.footer-tools {
  position: absolute;
  left: 7%;
  bottom: 18px;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  padding: 0;
  background: transparent;
}

.footer-link-button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: var(--white);
  background: rgba(23, 60, 58, 0.18);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.footer-link-button:hover,
.footer-link-button:focus-visible {
  background: rgba(23, 60, 58, 0.34);
  outline: none;
}

.cookie-banner {
  position: fixed;
  left: var(--page-gutter);
  right: var(--page-gutter);
  bottom: 18px;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(23, 60, 58, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 70px rgba(10, 35, 32, 0.22);
}

.cookie-banner strong,
.accessibility-panel strong {
  display: block;
  margin-bottom: 8px;
}

.cookie-banner p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.cookie-toggle {
  display: flex;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
}

.cookie-toggle input,
.accessibility-panel input {
  width: auto;
  margin-top: 3px;
}

.cookie-toggle span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  line-height: 1.45;
}

.cookie-toggle b {
  color: var(--ink);
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.accessibility-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 49;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.cookie-banner + .accessibility-widget,
body:has(.cookie-banner) .accessibility-widget {
  bottom: 180px;
}

.accessibility-toggle {
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--white);
  border-radius: 999px;
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 10px 26px rgba(10, 35, 32, 0.2);
  cursor: pointer;
  font-weight: 900;
}

.accessibility-panel {
  width: min(280px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 46px rgba(10, 35, 32, 0.2);
}

.accessibility-panel label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--ink);
}

.a11y-large-text {
  font-size: 112%;
}

.a11y-underline-links a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.a11y-high-contrast body {
  --ink: #001f1d;
  --muted: #223330;
  --paper: #ffffff;
  --cream: #ffffff;
  --line: #667570;
  background: #ffffff;
}

.a11y-high-contrast .site-header,
.a11y-high-contrast .area-tile.active,
.a11y-high-contrast .button.primary {
  background: #001f1d;
}

.a11y-high-contrast .route-card,
.a11y-high-contrast .safety-card,
.a11y-high-contrast .admin-form,
.a11y-high-contrast .route-overview > div {
  border-color: #001f1d;
}

.a11y-reduce-motion *,
.a11y-reduce-motion *::before,
.a11y-reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

.service-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.service-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.service-list span,
.fallback-note {
  color: var(--muted);
}

.fallback-note {
  margin: 10px 0 0;
  font-weight: 700;
}

.compact-hero {
  min-height: 44vh;
}

.safety-page {
  max-width: 1180px;
}

.safety-hero {
  max-width: 820px;
  padding: clamp(54px, 8vw, 104px) 0 clamp(24px, 4vw, 40px);
}

.safety-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.safety-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.safety-card {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(26, 61, 58, 0.08);
}

.safety-card.wide {
  grid-row: span 2;
}

.safety-card h2 {
  margin-bottom: 16px;
  color: var(--sea);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.safety-card ul {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.safety-card li {
  position: relative;
  padding-left: 22px;
  color: #344947;
  line-height: 1.55;
}

.safety-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sun);
}

.emergency-card {
  display: grid;
  align-content: center;
  background: var(--ink);
  color: var(--white);
}

.emergency-card h2 {
  color: rgba(255, 255, 255, 0.78);
}

.emergency-card strong {
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.95;
}

.responsibility-note {
  margin: 22px 0 0;
  padding: 18px 20px;
  border-left: 5px solid var(--sun);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  font-weight: 900;
}

.admin-shell {
  max-width: 980px;
  padding-top: 48px;
}

.admin-workspace {
  width: min(1500px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-top: 24px;
}

.login-screen {
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 32px clamp(18px, 4vw, 56px);
}

.login-box {
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-box h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.login-box p {
  color: var(--muted);
  line-height: 1.6;
}

.admin-intro {
  grid-column: 2;
  margin-bottom: 0;
}

.admin-form {
  display: grid;
  gap: 18px;
}

.admin-layout {
  display: contents;
}

.admin-route-panel {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  top: 142px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  height: calc(100dvh - 166px);
  max-height: calc(100dvh - 166px);
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-panel-head,
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.admin-search {
  min-height: 42px;
}

.admin-route-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-top: 8px;
  padding-right: 6px;
  border-top: 1px solid rgba(23, 60, 58, 0.08);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 154, 140, 0.88) rgba(23, 60, 58, 0.12);
}

.admin-route-list::-webkit-scrollbar {
  width: 12px;
}

.admin-route-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(23, 60, 58, 0.1);
}

.admin-route-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(21, 154, 140, 0.98), rgba(46, 110, 166, 0.92));
}

.admin-route-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(13, 133, 120, 0.98), rgba(37, 92, 139, 0.96));
}

.admin-route-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
}

.admin-route-item:hover,
.admin-route-item.active {
  border-color: rgba(21, 154, 140, 0.58);
  box-shadow: 0 10px 24px rgba(23, 60, 58, 0.08);
}

.admin-route-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.route-editor {
  grid-column: 2;
  min-width: 0;
}

.editor-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.repeater-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repeater-list {
  display: grid;
  gap: 12px;
}

.repeater-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(249, 251, 245, 0.78);
}

.repeater-grid {
  display: grid;
  gap: 12px;
}

.repeater-remove {
  justify-self: start;
}

.repeater-empty {
  margin: 0;
  padding: 13px;
  border: 1px dashed rgba(23, 60, 58, 0.2);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-weight: 700;
}

.json-transfer-field {
  display: none;
}

.translation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label small {
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96) 28%);
}

.button.danger {
  color: #8a261e;
  border-color: #e3b8b3;
  background: #fff6f4;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

#formStatus {
  color: var(--muted);
  font-weight: 800;
}

.inline-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: #f5f7f2;
  font-weight: 900;
}

.save-status {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--white);
  font-weight: 900;
}

.save-status:empty,
.inline-status:empty {
  display: none;
}

.save-status.loading,
.inline-status.loading {
  color: #7a4b12;
  border-color: #f0cf95;
  background: #fff8ea;
}

.save-status.loading::before,
.inline-status.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(122, 75, 18, 0.25);
  border-top-color: #7a4b12;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.save-status.success,
.inline-status.success {
  color: #17613d;
  border-color: #a9d9bf;
  background: #eefaf3;
}

.save-status.error,
.inline-status.error {
  color: #8a261e;
  border-color: #e3b8b3;
  background: #fff6f4;
}

.admin-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .admin-workspace {
    display: block;
    padding-top: 24px;
  }

  .admin-intro {
    margin-bottom: 24px;
  }

  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .home-hero {
    padding-top: 34px;
  }

  .site-header {
    min-height: 96px;
  }

  .site-header-inner {
    gap: 22px;
  }

  .header-navigation {
    gap: 24px;
  }

  .hero-map {
    min-height: 320px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .route-overview {
    grid-template-columns: 1fr 1fr;
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-route-panel {
    grid-column: auto;
    grid-row: auto;
    position: static;
    height: min(72dvh, calc(100dvh - 160px));
    max-height: min(72dvh, calc(100dvh - 160px));
  }

  .route-editor {
    grid-column: auto;
  }

  .safety-grid {
    grid-template-columns: 1fr;
  }

  .safety-card.wide {
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    text-align: center;
  }

  .site-header-inner,
  .header-navigation {
    flex-direction: column;
  }

  .site-header-inner {
    gap: 14px;
  }

  .header-navigation {
    gap: 12px;
  }

  .project-brand img {
    width: 184px;
    max-height: 58px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
    font-size: 0.9rem;
  }

  .county-crest {
    display: none;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .project-card-bottom {
    min-height: 0;
    padding: 24px;
  }

  .stat-grid,
  .form-grid,
  .translation-grid,
  .split-detail,
  .route-overview,
  .route-gallery,
  .three-cols,
  .two-cols {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) and (max-width: 1220px) {
  .route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
