/* poi. The same tokens as sync2garmin, ETA and roll; the bikit menu reads them too. */
:root {
  --ink: #0c1017;
  --ink-line: #2a3343;
  --ink-text: #eef1f6;
  --ink-muted: #9aa5b8;
  --volt: #c8f031;
  --on-volt: #12160a;

  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #eceee8;
  --text: #151a23;
  --muted: #5b6474;
  --line: #dfe2da;
  --link: #1f62d6;
  --primary: #151a23;
  --on-primary: #ffffff;
  --ok: #0f7a55;
  --ok-bg: #e0f4ea;
  --warn: #935400;
  --warn-bg: #fcefd9;
  --err: #bb2329;
  --err-bg: #fbe4e5;
  --shadow: 0 1px 2px rgba(20, 26, 35, .05), 0 8px 24px rgba(20, 26, 35, .05);
  --radius: 14px;
  color-scheme: light;
}

:root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #0f131a;
  --surface: #171c26;
  --surface-2: #1f2531;
  --text: #e9edf3;
  --muted: #9aa5b8;
  --line: #2a3140;
  --link: #7fb0ff;
  --primary: #c8f031;
  --on-primary: #12160a;
  --ok: #4fcf9f;
  --ok-bg: #15332a;
  --warn: #f1b75c;
  --warn-bg: #3a2c15;
  --err: #ff8a8f;
  --err-bg: #3d1d20;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
main { flex: 1; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin-top: 8px; }
.error-text { color: var(--err); font-weight: 500; margin-top: 12px; }

/* top bar and hero on ink */
.topbar { background: var(--ink); }
.topbar-in { display: flex; align-items: center; gap: 12px 24px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; color: var(--ink-text); text-decoration: none; margin-right: auto; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; align-items: center; gap: 12px 18px; }
.on-ink { --menu-fg: var(--ink-muted); --menu-fg-hover: var(--ink-text); --menu-line: var(--ink-line); }
.lang { color: var(--ink-muted); text-decoration: none; border: 1px solid var(--ink-line); border-radius: 6px; padding: 1px 7px; font-size: 13px; font-weight: 600; }
.lang:hover { color: var(--ink-text); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; cursor: pointer;
  border: 1px solid var(--ink-line); border-radius: 8px; background: transparent; color: var(--ink-muted);
}
.theme-toggle:hover { color: var(--ink-text); }
.theme-toggle svg { width: 16px; height: 16px; }
.icon-moon { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: none; }

.hero { background: var(--ink); color: var(--ink-text); padding-bottom: 40px; }
.hero-in { padding-top: 28px; }
.hero h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.08; letter-spacing: -.03em; max-width: 16em; }
.lead { margin-top: 12px; max-width: 40em; font-size: 18px; color: var(--ink-muted); }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin-top: 24px;
  padding: 28px 16px; border: 2px dashed var(--volt); border-radius: var(--radius); cursor: pointer; text-align: center;
}
.drop:hover, .drop.over { background: rgba(200, 240, 49, .08); }
.drop strong { font-size: 19px; color: var(--volt); }
.drop span { color: var(--ink-muted); font-size: 15px; }
.drop:focus-within { outline: 3px solid var(--volt); outline-offset: 2px; }

/* buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--primary);
  background: var(--primary); color: var(--on-primary);
}
.btn:hover { filter: brightness(1.12); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; text-decoration: underline; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--link); outline-offset: 2px;
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
fieldset.card { margin: 0; min-width: 0; }
legend { float: left; width: 100%; padding: 0; font-weight: 700; font-size: 17px; }
legend + * { clear: both; }
.field { margin-top: 14px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 5px; }
input[type=number], input[type=text], input[type=datetime-local], select {
  font: inherit; font-size: 15px; width: 100%; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
input[type=range] { width: 100%; accent-color: var(--volt); }
.with-unit { display: flex; align-items: center; gap: 6px; }
.with-unit span { color: var(--muted); font-size: 14px; min-width: 2em; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; color: var(--link); font-size: 15px; }
.summary { margin-top: 14px; font-weight: 600; }

/* the tool */
.tool { padding-block: 24px; }
.route-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.route-head h2 { font-size: 24px; overflow-wrap: anywhere; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.panel { display: grid; gap: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; font-size: 14px; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--text); background: var(--surface-2); font-weight: 600; }
.chip:has(input:focus-visible) { outline: 3px solid var(--link); outline-offset: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }

.map { height: 520px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 16px; }
.list-head h3 { font-size: 18px; }
.poi-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.poi { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.poi:hover, .poi.active { border-color: var(--volt); }
.poi .dot { width: 12px; height: 12px; }
.poi-main { min-width: 0; cursor: pointer; }
.poi-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poi-meta { color: var(--muted); font-size: 14px; }
.poi-when { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 13px; }
.badge { padding: 1px 8px; border-radius: 99px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.open { background: var(--ok-bg); color: var(--ok); }
.badge.closed { background: var(--err-bg); color: var(--err); }
.remove { font: inherit; font-size: 20px; line-height: 1; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; }
.remove:hover { color: var(--err); border-color: var(--err); }

/* map popups follow the theme */
.maplibregl-popup-content { background: var(--surface); color: var(--text); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); font: 14px/1.45 system-ui, sans-serif; }
.maplibregl-popup-tip { border-top-color: var(--surface) !important; border-bottom-color: var(--surface) !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; }
.popup strong { display: block; font-size: 15px; }
.popup .linkish { margin-top: 8px; color: var(--err); }

/* information */
.info { padding-block: 32px 8px; }
.info h2 { font-size: 26px; margin-top: 24px; }
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.steps li { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.steps span { color: var(--muted); font-size: 15px; }
.faq { max-width: 780px; margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 14px; }
.faq summary { font-weight: 650; font-size: 17px; cursor: pointer; }
.faq p { color: var(--muted); margin-top: 8px; }

.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 48px; padding-block: 24px; font-size: 14px; color: var(--muted); }
.footer-in { display: flex; gap: 10px 26px; flex-wrap: wrap; align-items: baseline; }
.footer a { color: var(--muted); }
.footer-note { flex-basis: 100%; font-size: 13px; }

@media (max-width: 860px) {
  .tool-grid { grid-template-columns: 1fr; }
  .results { order: -1; }
  .map { height: 380px; }
}
