:root {
  color-scheme:dark;
  --bg:#101416;
  --surface:#1b2124;
  --text:#edf2f3;
  --muted:#a4b0b5;
  --line:#333d42;
  --accent:#b8efcf;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--text);
  background:var(--bg)
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
main {
  max-width:520px;
  margin:auto;
  padding:16px 20px max(28px,env(safe-area-inset-bottom))
}
header,.row {
  display:flex;
  align-items:center;
  gap:12px
}
header {
  justify-content:space-between;
  padding-bottom:26px
}
.brand {
  font-size:20px;
  font-weight:700;
  letter-spacing:-.8px;
  text-decoration:none;
  color:var(--text)
}
.brand span {
  color:var(--accent);
  padding-left:4px
}
h1,h2,p {
  margin:0
}
h1 {
  font-size:22px;
  font-weight:500;
  letter-spacing:-.5px
}
h2 {
  font-size:16px;
  font-weight:600
}
.muted,.map-note {
  color:var(--muted);
  font-size:14px;
  line-height:1.5
}
button,input,select,a.primary {
  font:inherit
}
button,select {
  cursor:pointer
}
button,a.primary {
  min-height:48px;
  border:0;
  border-radius:14px;
  padding:12px 18px;
  font-weight:600;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  color:var(--text);
  touch-action:manipulation
}
button:disabled {
  opacity:.55;
  cursor:wait
}
.quiet {
  background:transparent;
  padding:10px;
  color:var(--muted);
  font-size:14px
}
.secondary {
  background:var(--surface);
  border:1px solid var(--line)
}
.primary {
  background:var(--accent);
  color:#153526!important
}
.full {
  width:100%
}
:focus-visible {
  outline:3px solid var(--accent);
  outline-offset:4px
}
button:hover,a.primary:hover {
  filter:brightness(1.1)
}
.between {
  justify-content:space-between
}
.location {
  border-top:1px solid var(--line);
  padding:20px 0 24px
}
.location .row {
  margin-bottom:12px
}
.location p {
  margin-top:4px;
  overflow-wrap:anywhere
}
.status {
  font-size:14px;
  line-height:1.45;
  color:var(--muted);
  margin:12px 0
}
.status:empty {
  display:none
}
.status.error {
  color:#ffb4ab
}
.result {
  padding-top:24px;
  border-top:1px solid var(--line);
  margin-top:24px
}
.result>.row {
  margin-bottom:14px;
  flex-wrap:wrap
}
#map {
  height:260px;
  border-radius:16px;
  background:var(--surface);
  overflow:hidden;
  isolation:isolate
}
.map-note {
  font-size:13px;
  margin:10px 0 16px
}
.route-actions {
  margin-top:10px
}
.route-actions button {
  flex:1
}
.leaflet-container {
  font-family:inherit
}
.leaflet-control-attribution {
  font-size:10px!important
}
.leaflet-container a {
  color:#164c77
}
dialog {
  color:var(--text);
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:24px;
  padding:20px;
  width:min(480px,calc(100% - 24px));
  max-height:85dvh;
  overflow:auto
}
dialog::backdrop {
  background:#0009
}
.dialog-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px
}
.dialog-head h2 {
  font-size:20px
}
.dialog-section {
  border-top:1px solid var(--line);
  padding:20px 0
}
.dialog-section:last-child {
  padding-bottom:0
}
label {
  display:block;
  font-size:14px;
  color:var(--muted)
}
input,select {
  display:block;
  width:100%;
  min-height:48px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface);
  color:var(--text);
  padding:12px;
  margin:8px 0 16px;
  font-size:16px
}
.coordinates {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px
}
.stack {
  display:grid;
  gap:10px
}
.dialog-section p {
  font-size:14px;
  line-height:1.5;
  color:var(--muted);
  margin-top:12px
}
summary {
  cursor:pointer;
  min-height:48px;
  padding:12px 0;
  font-size:16px
}
details form {
  margin-top:8px
}
.history-item {
  text-align:left;
  justify-content:space-between;
  background:var(--surface);
  width:100%
}
.history-item span {
  font-size:14px;
  color:var(--muted)
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}
[hidden] {
  display:none!important
}
@media(max-width:380px) {
  main {
    padding-inline:16px
  }
  .brand {
    font-size:18px
  }
  header .row {
    gap:0
  }
  .coordinates {
    grid-template-columns:1fr
  }
  h1 {
    font-size:20px
  }
  
}
@media(min-width:700px) {
  main {
    padding-top:32px
  }
  
}
@media(prefers-reduced-motion:no-preference) {
  dialog[open] {
    animation:appear .15s ease-out
  }
  @keyframes appear {
    from {
      opacity:0;
      transform:translateY(8px)
    }
    to {
      opacity:1;
      transform:translateY(0)
    }
    
  }
  
}
:root {
  --accent:#b8efcf
}
.config-card {
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  margin-bottom:12px;
  background:var(--bg)
}
.config-card h1,.config-card h2 {
  font-size:16px;
  font-weight:600;
  letter-spacing:0;
  display:flex;
  align-items:center;
  gap:10px
}
.step {
  display:inline-grid;
  place-items:center;
  background:var(--surface);
  color:var(--muted);
  border-radius:50%;
  width:24px;
  height:24px;
  font-size:13px;
  font-weight:500
}
.config-trigger {
  width:100%;
  background:transparent;
  justify-content:space-between;
  text-align:left;
  padding:14px 0 0
}
.config-trigger strong {
  display:block;
  font-size:24px;
  font-weight:500;
  margin-bottom:3px
}
.config-trigger .muted {
  display:block
}
.config-card.location {
  padding:16px 18px
}
.location .row {
  margin-bottom:10px
}
.location p {
  margin-top:8px
}
.map-choice {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:16px
}
.map-choice label {
  position:relative;
  cursor:pointer
}
.map-choice input {
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
  min-height:0;
  margin:0
}
.map-choice span {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  border:1px solid var(--line);
  border-radius:12px;
  font-size:14px;
  color:var(--muted)
}
.map-choice input:checked+span {
  background:var(--accent);
  color:#153526;
  border-color:var(--accent)
}
.map-choice input:focus-visible+span {
  outline:3px solid var(--accent);
  outline-offset:3px
}
#appleNote {
  margin-top:10px
}
#generate {
  margin-top:4px
}
header {
  padding-bottom:16px
}
.waypoint {
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#146b4a;
  color:#fff;
  font:600 13px system-ui;
  border:2px solid #fff;
  
}
.dialog-section h3 { font-size: 16px; margin: 0 0 12px; }
.address-credit a { color: var(--muted); }
#addressStatus:empty { display: none; }
#addressPickForm { margin-top: 16px; }
.social-section { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.social-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.social-row a { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 14px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.social-row button { padding-inline: 8px; font-size: 14px; }
#quickShareStatus { margin-top: 8px; }
.dialog-section h3 { margin: 0 0 12px; font-size: 16px; }
#accentChoice { width: 100%; height: 48px; padding: 4px; }
.hex-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.hex-row label { margin: 0; }
.hex-row input { margin: 0; }
.hex-row .quiet { min-height: 42px; }
:root[data-theme="light"] { color-scheme: light; --bg: #f7faf8; --surface: #eaf0ec; --text: #17211c; --muted: #53635b; --line: #c9d7cf; }
:root[data-theme="light"] .map-choice input:checked + span { color: #153526; }
:root[data-theme="dark"] { color-scheme: dark; }
