@import url("./variables.css");

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--color-carbon);
  color: var(--color-paper);
  font-family: var(--font-inter);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

img,
svg {
  display: block;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-buttons);
  background: var(--color-paper);
  color: var(--color-obsidian);
  transform: translateY(-140%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 78px;
  padding: 14px 26px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid rgba(47, 43, 36, 0.08);
  background: rgba(250, 249, 243, 0.95);
  color: #25231e;
  box-shadow: rgba(45, 37, 24, 0.08) 0 10px 28px;
  backdrop-filter: blur(18px) saturate(1.08);
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 0 38%, rgba(254, 44, 2, 0.98) 38% 47%, transparent 47% 100%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.76) 0 2px, rgba(255, 255, 255, 0.22) 2px 5px),
    var(--color-carbon);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.brand span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand strong {
  color: #1f211d;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.brand small {
  color: #817b70;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

.workspace-nav {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.workspace-nav::-webkit-scrollbar {
  display: none;
}

.text-button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
}

.nav-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-buttons);
  background: transparent;
  color: rgba(38, 35, 29, 0.68);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-tab:hover,
.nav-tab.is-active {
  background: rgba(37, 34, 28, 0.08);
  color: #23201b;
}

.header-actions {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 10px;
}

.app-header .button-light {
  min-height: 46px;
  padding: 0 24px;
  background: #52750f;
  color: #ffffff;
  box-shadow: rgba(65, 91, 12, 0.18) 0 8px 22px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-main {
  min-height: calc(100svh - 78px);
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.view-routes.is-active {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(420px, 1fr) minmax(300px, 380px);
  min-height: calc(100svh - 78px);
}

.route-sidebar,
.inspector,
.editor-panel,
.review-list,
.review-detail,
.upload-panel,
.contribution-form {
  background: var(--color-carbon);
}

.route-sidebar {
  padding: 22px 18px 18px;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-intro,
.view-header,
.map-toolbar,
.editor-topbar {
  display: grid;
  gap: 10px;
}

.panel-intro {
  margin-bottom: 18px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-slate);
  font-family: var(--font-geist-mono);
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
}

.section-label span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-sprout);
}

.section-label-muted span {
  background: var(--color-ember);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  font-family: var(--font-emilio-light);
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  color: var(--color-paper);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
}

.route-sidebar h1 {
  font-size: clamp(30px, 2.8vw, 40px);
  line-height: 1.12;
}

h2 {
  color: var(--color-paper);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.28;
}

p {
  margin-bottom: 0;
  color: var(--color-slate);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-buttons);
  padding: 0 16px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-light {
  background: var(--color-paper);
  color: var(--color-obsidian);
}

.button-dark {
  background: var(--color-carbon);
  color: var(--color-paper);
}

.button-outline-light {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(22, 23, 23, 0.25);
  color: var(--color-paper);
}

.text-button {
  padding: 0;
  color: var(--color-slate);
  font-size: 12px;
}

.text-button:hover {
  color: var(--color-paper);
}

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
}

label > span,
legend {
  color: var(--color-slate);
  font-family: var(--font-geist-mono);
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-inputs);
  background: rgba(255, 255, 255, 0.075);
  color: var(--color-paper);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

select option {
  color: var(--color-obsidian);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(73, 222, 128, 0.72);
  box-shadow: 0 0 0 3px rgba(73, 222, 128, 0.1);
}

.filter-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  border-radius: var(--radius-cards);
  background: rgba(255, 255, 255, 0.055);
}

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

.route-list-header {
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-slate);
  font-family: var(--font-geist-mono);
  font-size: 11px;
  text-transform: uppercase;
}

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

.route-card {
  width: 100%;
  padding: 14px;
  display: grid;
  gap: 10px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-cards);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-paper);
}

.route-card:hover,
.route-card.is-active {
  border-color: rgba(73, 222, 128, 0.48);
  background: rgba(255, 255, 255, 0.075);
}

.route-card h3 {
  margin: 0;
  font-size: 15px;
}

.route-card p {
  font-size: 12px;
  line-height: 1.55;
}

.route-meta,
.badge-row,
.metric-row,
.review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.badge {
  min-height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-badges);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 500;
}

.badge.status-verified {
  color: var(--color-sprout);
  box-shadow: inset 0 0 0 1px rgba(73, 222, 128, 0.32);
}

.badge.status-seasonal,
.badge.status-restricted {
  color: #ffd2c8;
  box-shadow: inset 0 0 0 1px rgba(254, 44, 2, 0.34);
}

.badge.status-community,
.badge.status-unverified {
  color: var(--color-fog);
}

.map-column {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr);
  gap: 12px;
  background:
    radial-gradient(circle at 28% 18%, rgba(73, 222, 128, 0.07), transparent 25%),
    #101211;
}

.map-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.map-toolbar strong {
  font-size: 18px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-map-shell,
.preview-map-shell,
.editor-map-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-cards);
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #0c1010;
  background-size: 38px 38px;
  box-shadow: var(--shadow-xl);
}

.route-map-shell {
  min-height: 0;
}

.map-canvas {
  position: absolute;
  inset: 0;
}

.route-map-shell > .map-canvas,
.preview-map-shell > .map-canvas,
.editor-map-shell > .map-canvas,
.map-canvas.mapboxgl-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mapboxgl-ctrl-logo,
.mapboxgl-ctrl-attrib {
  opacity: 0.92;
}

.map-status,
.map-token-panel,
.editor-hint {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(22, 23, 23, 0.78);
  color: var(--color-paper);
  backdrop-filter: blur(12px);
}

.map-status,
.editor-hint {
  top: 18px;
  right: 18px;
  padding: 9px 11px;
  border-radius: var(--radius-badges);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-geist-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.map-status {
  border-color: rgba(47, 43, 36, 0.12);
  background: rgba(252, 251, 246, 0.92);
  color: #514c42;
  box-shadow: rgba(45, 37, 24, 0.12) 0 10px 24px;
}

.map-status.is-hidden {
  display: none;
}

.map-token-panel {
  top: 50%;
  left: 50%;
  width: min(460px, calc(100% - 40px));
  padding: 18px;
  display: none;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-cards);
}

.map-token-panel {
  border-color: rgba(47, 43, 36, 0.12);
  background: rgba(252, 251, 246, 0.96);
  color: #25231e;
  box-shadow: rgba(45, 37, 24, 0.12) 0 18px 46px;
}

.map-token-panel.is-visible {
  display: grid;
  gap: 12px;
}

.map-token-panel > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.map-token-panel input {
  min-width: 0;
  border-color: rgba(47, 43, 36, 0.14);
  background: #f1efe5;
  color: #25231e;
}

.map-token-panel input::placeholder {
  color: rgba(37, 35, 30, 0.42);
}

.map-token-panel .button-light {
  background: #52750f;
  color: #ffffff;
}

.inspector {
  padding: 18px;
  overflow: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.view-routes.is-active {
  display: block;
  min-height: calc(100svh - 78px);
}

.routes-map-app {
  position: relative;
  min-height: calc(100svh - 78px);
  overflow: hidden;
  background: #d8dfc2;
}

.routes-map-app > .map-canvas,
.routes-map-app > .map-canvas.mapboxgl-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.routes-map-header {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 6;
  pointer-events: none;
}

.routes-search-card,
.routes-activity-legend,
.route-selection-card {
  pointer-events: auto;
}

.routes-search-card {
  width: min(520px, calc(100vw - 48px));
  min-height: 74px;
  padding: 12px 18px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-obsidian);
  box-shadow: rgba(0, 0, 0, 0.12) 0 10px 30px;
}

.routes-search-card input {
  min-width: 0;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-obsidian);
  font-family: var(--font-inter);
  font-size: 28px;
  font-weight: 650;
  line-height: 1;
  box-shadow: none;
}

.routes-search-card input:focus {
  box-shadow: none;
}

.routes-search-card input::placeholder {
  color: rgba(0, 0, 0, 0.88);
}

.routes-search-card span {
  color: #6f6b61;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.routes-activity-legend {
  position: absolute;
  right: 24px;
  bottom: 138px;
  z-index: 6;
  padding: 12px 14px;
  display: grid;
  gap: 9px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #2a261f;
  box-shadow: rgba(0, 0, 0, 0.14) 0 10px 28px;
  font-size: 13px;
  font-weight: 650;
}

.routes-activity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-line {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: #1167d8;
}

.legend-line.cycling {
  background: #ef3f35;
}

.legend-line.selected {
  height: 6px;
  background:
    radial-gradient(circle, #ffffff 0 35%, transparent 38%) 0 50% / 10px 6px repeat-x,
    #1167d8;
}

.route-selection-card {
  position: absolute;
  left: 24px;
  top: 124px;
  z-index: 7;
  width: min(430px, calc(100vw - 48px));
  max-height: calc(100svh - 180px);
  overflow: auto;
}

.route-selection-card:empty {
  display: none;
}

.route-summary-card {
  padding: 18px;
  display: grid;
  gap: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  color: #1f1d1b;
  box-shadow: rgba(0, 0, 0, 0.18) 0 18px 46px;
}

.route-summary-media {
  position: relative;
  min-height: 202px;
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  overflow: hidden;
  border-radius: 16px;
}

.route-summary-photo {
  min-height: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.12)),
    url("./assets/hero-mountain.jpg") center / cover;
}

.photo-large {
  grid-row: 1 / 3;
  background-position: center 54%;
}

.photo-small-a {
  background-position: 58% 38%;
}

.photo-small-b {
  background-position: 42% 70%;
}

.route-image-count,
.route-card-close {
  position: absolute;
  z-index: 2;
  border: 0;
  color: #ffffff;
  box-shadow: rgba(0, 0, 0, 0.18) 0 8px 20px;
}

.route-image-count {
  left: 14px;
  bottom: 14px;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  background: rgba(32, 27, 20, 0.78);
  font-size: 13px;
  font-weight: 650;
}

.route-card-close {
  top: 14px;
  right: 14px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #24201d;
  font-size: 28px;
  line-height: 1;
}

.route-summary-card h2 {
  margin: 0;
  color: #1f1d1b;
  font-family: var(--font-inter);
  font-size: 30px;
  font-weight: 650;
  line-height: 1.12;
}

.route-summary-card p {
  color: #6e685f;
  font-size: 15px;
  line-height: 1.58;
}

.route-summary-meta,
.route-summary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.route-summary-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #70695e;
  font-size: 16px;
  font-weight: 650;
}

.route-summary-alert {
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  background: #ffe2d3;
  color: #33231c;
  font-weight: 650;
}

.route-summary-alert span {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: #77a719;
  color: #ffffff;
  font-size: 17px;
}

.route-summary-alert small {
  grid-column: 2;
  color: #7a5543;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.route-summary-actions .button {
  flex: 1 1 150px;
  min-height: 52px;
  border: 0;
  font-size: 15px;
}

.route-summary-actions .button-outline-light {
  background: #eadbbd;
  color: #466015;
}

.route-summary-actions .button-light {
  background: #52750f;
  color: #ffffff;
}

.route-summary-hiking .badge:first-child {
  background: rgba(17, 103, 216, 0.12);
  color: #1167d8;
}

.route-summary-cycling .badge:first-child {
  background: rgba(239, 63, 53, 0.12);
  color: #d62f25;
}

.route-updated {
  font-size: 13px;
}

.route-summary-empty {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.route-summary-empty h2 {
  font-size: 20px;
}

.route-summary-empty p {
  font-size: 13px;
}

.route-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 3px, transparent 4px),
    linear-gradient(90deg, transparent 0 26%, #1167d8 26% 36%, transparent 36% 55%, #ef3f35 55% 65%, transparent 65%),
    #f1eee7;
  box-shadow: inset 0 0 0 1px rgba(35, 32, 29, 0.08);
}

.detail-card,
.docs-grid article,
.permission-note,
.suggestion-card,
.preview-grid article,
.metric-card,
.change-card,
.review-detail-inner {
  border-radius: var(--radius-cards);
  background: rgba(255, 255, 255, 0.055);
}

.detail-card {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.detail-card h2 {
  font-family: var(--font-inter);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.detail-actions {
  display: grid;
  gap: 8px;
}

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

.metric-card,
.preview-grid article {
  padding: 12px;
  display: grid;
  gap: 4px;
}

.metric-card span,
.preview-grid span,
.docs-grid span,
.change-card span {
  color: var(--color-slate);
  font-family: var(--font-geist-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.metric-card strong,
.preview-grid strong {
  color: var(--color-paper);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.08;
}

.risk-list,
.history-list {
  display: grid;
  gap: 8px;
}

.risk-list div,
.history-list div {
  padding: 10px 12px;
  border-radius: var(--radius-inputs);
  background: rgba(255, 255, 255, 0.055);
  color: var(--color-fog);
  font-size: 13px;
}

.view-contribute,
.view-review,
.view-docs {
  min-height: calc(100svh - 78px);
  padding: 28px;
}

.view-header {
  width: min(100%, 1180px);
  margin: 0 auto 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  align-items: end;
}

.view-header p {
  font-size: 14px;
  line-height: 1.7;
}

.contribution-layout {
  width: min(100%, 1180px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
}

.upload-panel,
.contribution-form {
  padding: 18px;
  display: grid;
  gap: 14px;
  border-radius: var(--radius-cards);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dropzone {
  min-height: 150px;
  padding: 18px;
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-cards);
  background: rgba(255, 255, 255, 0.04);
}

.dropzone.is-dragover {
  border-color: var(--color-sprout);
  background: rgba(73, 222, 128, 0.08);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.dropzone label {
  cursor: pointer;
}

.dropzone strong {
  font-size: 18px;
}

.dropzone span {
  color: var(--color-slate);
  font-size: 13px;
}

.preview-map-shell {
  min-height: 340px;
}

.suggestion-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

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

.suggestion-item {
  width: 100%;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-inputs);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-paper);
  text-align: left;
}

.suggestion-item:hover {
  border-color: rgba(73, 222, 128, 0.42);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius-buttons);
  background: rgba(255, 255, 255, 0.07);
}

.segmented-control button,
.tool-grid button,
.poi-tools button {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-buttons);
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 500;
}

.segmented-control button.is-active,
.tool-grid button:hover,
.poi-tools button:hover,
.poi-tools button.is-active {
  background: var(--color-paper);
  color: var(--color-obsidian);
}

.contribution-form {
  align-content: start;
}

.contribution-form fieldset,
.privacy-checks {
  display: grid;
  gap: 10px;
}

.privacy-checks {
  padding: 14px;
  border-radius: var(--radius-cards);
  background: rgba(255, 255, 255, 0.05);
}

.privacy-checks label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--color-fog);
  font-size: 13px;
  line-height: 1.55;
}

.privacy-checks input {
  width: 15px;
  min-height: 15px;
  margin-top: 3px;
  accent-color: var(--color-sprout);
}

.privacy-checks.compact {
  padding: 0;
  background: transparent;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view-editor.is-active {
  display: grid;
  min-height: calc(100svh - 78px);
  grid-template-rows: auto minmax(0, 1fr);
}

.editor-topbar {
  padding: 16px 20px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-topbar h2 {
  font-size: 34px;
}

.editor-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(420px, 1fr) minmax(280px, 340px);
}

.editor-panel {
  min-height: 0;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
}

.editor-panel:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-submit-panel {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-map-shell {
  min-height: 0;
  border-radius: 0;
}

.metric-stack {
  display: grid;
  gap: 8px;
}

.metric-stack .metric-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-stack .metric-card strong {
  font-size: 18px;
}

.tool-grid,
.poi-tools {
  display: grid;
  gap: 8px;
}

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

.tool-grid button,
.poi-tools button {
  background: rgba(255, 255, 255, 0.07);
}

.poi-tools span {
  color: var(--color-slate);
  font-size: 12px;
}

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

.poi-item {
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  border-radius: var(--radius-inputs);
  background: rgba(255, 255, 255, 0.055);
}

.poi-item strong {
  font-size: 13px;
}

.poi-item span {
  color: var(--color-slate);
  font-family: var(--font-geist-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.permission-note {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 20px;
  color: var(--color-fog);
}

.review-layout {
  width: min(100%, 1180px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 14px;
}

.review-layout.is-hidden,
.permission-note.is-hidden {
  display: none;
}

.review-list,
.review-detail {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-cards);
}

.review-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.change-card {
  width: 100%;
  padding: 14px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-paper);
  text-align: left;
}

.change-card.is-active {
  border-color: rgba(73, 222, 128, 0.48);
}

.review-detail-inner {
  padding: 16px;
  display: grid;
  gap: 14px;
}

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

.diff-grid article {
  padding: 12px;
  border-radius: var(--radius-inputs);
  background: rgba(255, 255, 255, 0.055);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.docs-grid {
  width: min(100%, 1180px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.docs-grid article {
  min-height: 250px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.docs-grid h3 {
  color: var(--color-paper);
  font-family: var(--font-emilio-light);
  font-size: 30px;
  font-weight: 400;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-cards);
  background: rgba(22, 23, 23, 0.92);
  color: var(--color-paper);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.home-page {
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--surface-photographic-canvas);
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  color: var(--color-paper);
}

.home-nav-shell {
  width: calc(100% - 112px);
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 44px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--color-paper);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.home-brand .brand-mark {
  width: 30px;
  height: 30px;
}

.home-nav-links,
.home-nav-actions {
  display: flex;
  align-items: center;
  gap: 34px;
}

.home-nav-links {
  flex: 1;
}

.home-nav-links a,
.home-link {
  color: rgba(255, 255, 255, 0.74);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
}

.home-nav-links a:hover,
.home-link:hover {
  color: var(--color-paper);
}

.home-demo-button {
  min-width: 126px;
}

.home-hero {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  background: var(--surface-photographic-canvas);
}

.home-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
  filter: saturate(0.78) contrast(1.06) brightness(0.88);
}

.home-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 43%, rgba(18, 27, 31, 0) 0%, rgba(8, 12, 13, 0.16) 70%, rgba(0, 0, 0, 0.46) 100%),
    linear-gradient(180deg, rgba(45, 74, 82, 0.22) 0%, rgba(24, 31, 31, 0.1) 45%, rgba(0, 0, 0, 0.9) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.05) 75%, rgba(0, 0, 0, 0.36) 100%);
}

.home-hero-inner {
  position: absolute;
  top: clamp(210px, 31svh, 360px);
  left: 50%;
  z-index: 2;
  width: min(calc(100% - 96px), 1080px);
  transform: translateX(-50%);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 20px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-badges);
  background: rgba(82, 99, 104, 0.44);
  color: rgba(255, 255, 255, 0.84);
  font-family: var(--font-geist-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--color-paper);
}

.status-arrow {
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--font-inter);
  font-size: 22px;
  line-height: 1;
}

.home-hero h1 {
  margin: 0;
  display: grid;
  gap: 2px;
  max-width: 1040px;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-emilio-light);
  font-size: clamp(42px, 4.45vw, 76px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

.home-hero h1 span {
  display: block;
}

.home-hero h1 .home-title-mobile {
  display: none;
}

.home-hero-inner p {
  width: min(100%, 720px);
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(15px, 1.06vw, 19px);
  font-weight: 400;
  line-height: 1.62;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
}

.home-cta {
  min-width: 124px;
  min-height: 48px;
}

.home-cta.button-outline-light {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(8, 10, 10, 0.16);
  color: rgba(255, 255, 255, 0.82);
}

.home-trust-strip {
  position: absolute;
  left: 50%;
  bottom: 62px;
  z-index: 2;
  width: min(calc(100% - 120px), 1840px);
  overflow: hidden;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.36);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
}

.home-logo-track {
  width: max-content;
  display: flex;
  align-items: center;
  gap: clamp(52px, 7vw, 128px);
  padding: 0 22vw;
  animation: home-logo-scroll 38s linear infinite;
}

.home-logo-track span {
  flex: 0 0 auto;
  font-size: clamp(15px, 1.25vw, 22px);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

@keyframes home-logo-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - clamp(28px, 3.5vw, 66px)));
  }
}

.home-dark-section {
  padding: 68px 0;
  background: var(--surface-dark-panel);
}

.home-section-shell {
  width: min(calc(100% - 40px), var(--page-max-width));
  margin: 0 auto;
}

.home-section-heading {
  width: min(100%, 780px);
  margin: 0 auto 46px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.home-section-heading h2 {
  color: var(--color-paper);
  font-family: var(--font-emilio-light);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.12;
}

.home-section-heading p {
  width: min(100%, 660px);
  color: var(--color-slate);
  font-size: 14px;
  line-height: 1.75;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.home-feature-grid article {
  min-height: 190px;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 8px;
  border-radius: var(--radius-cards);
  background: rgba(255, 255, 255, 0.045);
}

.home-feature-grid span {
  color: var(--color-slate);
  font-family: var(--font-geist-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.home-feature-grid h3 {
  margin: 0;
  color: var(--color-paper);
}

.home-feature-grid p {
  color: var(--color-slate);
  font-size: 13px;
  line-height: 1.68;
}

:focus-visible {
  outline: 2px solid var(--color-sprout);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .home-nav-shell {
    width: min(calc(100% - 28px), var(--page-max-width));
    min-height: 76px;
    gap: 20px;
  }

  .home-nav-links {
    display: none;
  }

  .home-brand {
    flex: 1;
    font-size: 20px;
  }

  .home-hero-inner {
    top: clamp(150px, 25svh, 260px);
  }

  .home-feature-grid {
    grid-template-columns: 1fr;
  }

  .app-header {
    min-height: auto;
    padding: 12px 18px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
  }

  .workspace-nav {
    grid-column: 1 / -1;
    justify-content: start;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    justify-content: end;
  }

  .view-routes.is-active,
  .editor-layout,
  .contribution-layout,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .view-routes.is-active {
    display: block;
    min-height: calc(100svh - 78px);
  }

  .routes-map-app {
    min-height: calc(100svh - 126px);
  }

  .route-sidebar,
  .inspector,
  .editor-panel:first-child,
  .editor-submit-panel {
    border-left: 0;
    border-right: 0;
  }

  .map-column {
    min-height: 640px;
  }

  .routes-map-header {
    right: 24px;
  }

  .editor-map-shell {
    min-height: 620px;
    border-radius: var(--radius-cards);
  }

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

@media (max-width: 720px) {
  .home-nav-shell {
    width: calc(100% - 24px);
    min-height: 68px;
    gap: 12px;
  }

  .home-brand {
    flex: 0 1 auto;
    min-width: 0;
    gap: 8px;
    font-size: 18px;
  }

  .home-brand .brand-mark {
    width: 26px;
    height: 26px;
  }

  .home-nav-actions {
    gap: 8px;
    flex: 0 0 auto;
  }

  .home-link {
    display: none;
  }

  .home-demo-button {
    min-width: 104px;
    min-height: 42px;
    padding: 0 14px;
  }

  .home-hero-inner {
    top: clamp(150px, 24svh, 196px);
    width: min(calc(100% - 32px), 430px);
    gap: 16px;
  }

  .home-hero h1 {
    max-width: 360px;
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.18;
  }

  .home-hero h1 .home-title-desktop {
    display: none;
  }

  .home-hero h1 .home-title-mobile {
    display: block;
  }

  .home-hero-inner p {
    max-width: 316px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.58;
  }

  .home-status-badge {
    max-width: 100%;
    font-size: 10px;
  }

  .home-trust-strip {
    bottom: 36px;
    width: calc(100% - 28px);
  }

  .home-logo-track {
    gap: 48px;
  }

  .home-logo-track span {
    font-size: 15px;
  }

  .view-contribute,
  .view-review,
  .view-docs {
    padding: 14px;
  }

  .app-header {
    padding: 10px 12px;
    gap: 8px 10px;
  }

  .app-header .header-actions {
    display: none;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    display: none;
  }

  .nav-tab {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .app-header .button-light {
    min-height: 40px;
    padding: 0 16px;
    font-size: 13px;
    box-shadow: none;
  }

  .toolbar-actions,
  .form-actions,
  .review-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .view-header,
  .map-toolbar,
  .editor-topbar,
  .filter-grid,
  .form-grid,
  .metrics-grid,
  .preview-grid,
  .diff-grid,
  .docs-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 32px;
  }

  .map-column {
    padding: 14px;
    min-height: 560px;
  }

  .route-map-shell,
  .preview-map-shell,
  .editor-map-shell {
    min-height: 520px;
  }

  .routes-map-app {
    min-height: calc(100svh - 116px);
  }

  .routes-map-header {
    top: 12px;
    left: 12px;
    right: auto;
    width: min(360px, calc(100% - 24px));
  }

  .routes-search-card {
    width: 100%;
    min-height: 64px;
    padding: 10px 14px 8px;
    border-radius: 18px;
  }

  .routes-search-card input {
    min-height: 42px;
    font-size: 22px;
  }

  .routes-activity-legend {
    right: auto;
    left: 12px;
    bottom: 24px;
    padding: 10px 12px;
  }

  .map-token-panel {
    left: 14px;
    right: auto;
    width: min(360px, calc(100% - 28px));
    transform: translateY(-50%);
  }

  .map-status {
    display: none;
  }

  .route-selection-card {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 78px;
    width: auto;
    max-height: min(52svh, 520px);
  }

  .route-summary-card {
    padding: 14px;
    border-radius: 20px;
  }

  .route-summary-media {
    min-height: 138px;
  }

  .route-summary-card h2 {
    font-size: 24px;
  }

  .segmented-control,
  .tool-grid {
    grid-template-columns: 1fr;
    border-radius: var(--radius-cards);
  }

  .map-token-panel > div {
    grid-template-columns: 1fr;
  }
}
