.app-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.app-shell > .main:first-of-type {
  grid-row: 2;
}
.app-footer {
  grid-row: 3;
}
.app-header {
  background: white;
  border-bottom: 1px solid var(--dt-border);
}
.header-inner {
  min-height: 44px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.brand b {
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0.03em;
}
.brand small {
  display: block;
  font-size: 9px;
  line-height: 1.2;
  color: var(--dt-muted);
}
.brand-graphic {
  width: 40px;
  height: 40px;
  border: 1px solid #cce4d0;
  border-radius: var(--dt-radius);
  background: var(--dt-primary-soft);
  display: grid;
  place-items: center;
}
.brand-graphic img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.brand .brand-graphic {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}
.brand .brand-graphic img {
  width: 22px;
  height: 22px;
}
.header-inner nav {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 22px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-link {
  display: flex;
  flex-shrink: 0;
  white-space: nowrap;
  align-items: center;
  gap: 7px;
  height: 100%;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
}
.nav-active {
  color: var(--dt-accent-text);
  border-bottom-color: var(--dt-primary);
  font-weight: 600;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}
.header-actions select {
  height: 30px;
  min-height: 30px;
  max-width: 160px;
  padding: 4px 8px;
  font-size: 12px;
}
.header-actions .icon-button {
  height: var(--dt-control-height);
  width: var(--dt-control-height);
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 160px;
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid #dbe8de;
  border-radius: 20px;
  background: #f1f7f2;
  color: #315d38;
  font-size: 12px;
  text-decoration: none;
}
.user-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-badge:hover,
.user-badge[aria-current='page'] {
  border-color: #a9cfae;
  background: var(--dt-primary-soft);
}

.app-footer {
  padding: 4px 24px;
  border-top: 1px solid var(--dt-border);
  background: white;
  color: var(--dt-muted);
  font-size: 11px;
}

/* A borderless, editorial welcome. Authentication happens on the next screen. */
.welcome-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 92% 95%, #eaf2e8 0, transparent 55%), #fafbf8;
}
.welcome-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('./welcome-terrain.svg') center / cover no-repeat;
  pointer-events: none;
}
.welcome-header {
  padding: 32px 48px;
}
.welcome-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.welcome-brand .brand-graphic {
  width: 38px;
  height: 38px;
  background: #ffffffa6;
  border-color: #dbe7da;
}
.welcome-brand .brand-graphic img {
  width: 28px;
  height: 28px;
}
.welcome-brand b {
  display: block;
  color: #253e2d;
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 0.1em;
}
.welcome-brand span {
  display: block;
  margin-top: 3px;
  color: var(--dt-muted);
  font-size: 10px;
  line-height: 1.3;
}
.welcome-main {
  display: grid;
  place-items: center;
  padding: 40px 24px 60px;
}
.welcome-hero {
  width: min(100%, 800px);
  text-align: center;
}
.welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--dt-accent-text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.welcome-eyebrow::before,
.welcome-eyebrow::after {
  content: '';
  height: 1px;
  width: 24px;
  background: #aac7a5;
}
.welcome-hero h1 {
  color: #263e2e;
  font-size: clamp(48px, 6.4vw, 88px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.065em;
}
.welcome-hero h1 > span {
  display: block;
  color: var(--dt-primary);
}
.welcome-description {
  max-width: 440px;
  margin: 26px auto 0;
  color: #6b7869;
  font-size: 15px;
  line-height: 1.85;
  text-wrap: pretty;
}
.welcome-access {
  width: min(100%, 360px);
  margin: 34px auto 0;
}
.session-remember {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 13px;
}
.session-remember input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.welcome-enter {
  min-width: 248px;
  min-height: 52px;
  padding: 15px 22px;
  justify-content: space-between;
  gap: 24px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 5px 18px #4caf501a;
}
.welcome-enter:focus-visible {
  outline-offset: 5px;
}
.welcome-access-note {
  min-height: 36px;
  padding-top: 15px;
  color: var(--dt-muted);
  font-size: 10px;
}
.welcome-access-note p {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.welcome-access .notice {
  text-align: left;
  font-size: 12px;
  margin-bottom: 20px;
}
.app-footer a {
  margin-inline-start: 6px;
}

.map-info {
  display: flex;
  align-items: start;
  flex-direction: column;
  max-width: min(340px, calc(100vw - 56px));
  margin: 0;
  padding: 0;
  color: var(--dt-text);
  font:
    500 11px/1.45 Inter,
    system-ui,
    sans-serif;
}
.map-info summary {
  display: grid;
  place-items: center;
  width: var(--dt-control-height);
  height: var(--dt-control-height);
  margin-inline-start: auto;
  list-style: none;
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-control-radius);
  background: var(--dt-panel);
  color: var(--dt-info);
  box-shadow: var(--dt-shadow);
  cursor: pointer;
}
.map-info summary::-webkit-details-marker {
  display: none;
}
.leaflet-left .map-info summary {
  margin-inline: 0 auto;
}
.map-info summary:hover,
.map-info[open] summary {
  background: #edf4fd;
}
.map-info summary:focus-visible {
  outline: 2px solid var(--dt-info);
  outline-offset: 2px;
}
.map-info p {
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-control-radius);
  background: var(--dt-panel);
  box-shadow: var(--dt-shadow);
  overflow-wrap: anywhere;
}
.map-info a {
  color: var(--dt-info);
}
.legal-prose {
  display: flow-root;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.legal-prose :is(h1, h2, h3, h4, h5, h6, p, ul, ol, pre, blockquote) {
  margin: 0 0 0.9em;
}
.legal-prose h2:not(:first-child) {
  margin-top: 1.4em;
}
.legal-prose a,
.legal-back {
  color: var(--dt-accent-text);
  text-underline-offset: 3px;
}
.route-options {
  display: grid;
  gap: var(--dt-space-2);
}
.route-options label {
  display: grid;
  gap: var(--dt-space-1);
}
.route-options small {
  color: var(--dt-muted);
}
@media (max-width: 1000px) {
  .header-inner {
    padding: 0 20px;
  }
}
@media (max-width: 650px) {
  .app-footer {
    padding-inline: 12px;
  }
  .header-inner {
    flex-wrap: wrap;
    gap: 0 10px;
    padding: 0 12px;
  }
  .brand,
  .header-actions {
    margin-top: 5px;
    margin-bottom: 4px;
  }
  .header-inner nav {
    order: 3;
    height: 36px;
    width: 100%;
    gap: 12px;
    justify-content: space-between;
  }
  .header-actions {
    flex: 1;
    justify-content: flex-end;
    gap: 6px;
  }
  .header-actions select {
    width: 80px;
  }
  .user-badge {
    max-width: 125px;
    padding: 3px 8px;
  }
}
@media (pointer: coarse) {
  .map-info summary {
    width: 44px;
    height: 44px;
  }
}
