:root {
  --page:#16283A; --paper:#E4EEF4; --paper-dim:#D2E0EA;
  --ink:#16283A; --red:#BC4130; --gold:#D6A54C; --line:#3A4952;
  --display: 'Special Elite', 'Courier New', monospace;
  --body: 'Source Serif 4', Georgia, serif;
  --mono: 'IBM Plex Mono', monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; background: var(--page);
  display: flex; justify-content: center; padding: 24px 16px;
  font-family: var(--body);
}
.wrap { width: 100%; max-width: 560px; }
h1 { font-family: var(--display); color: var(--paper); font-size: 2rem; text-align: center; margin: 0; line-height: 1.2; }
.subtitle { font-family: var(--body); color: var(--paper-dim); font-size: 14px; text-align: center; margin: 6px 0 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-band {
  padding: 7px 10px; background: var(--paper-dim);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--ink);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-body { padding: 22px; }
label.section-label { font-family: var(--mono); font-size: 10px; color: var(--line); letter-spacing: 1.5px; text-transform: uppercase; display: block; margin-bottom: 8px; }
textarea {
  width: 100%; font-family: var(--body); font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 12px; resize: none; min-height: 100px;
}
textarea:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
.meta-row { display: flex; justify-content: space-between; margin-top: 4px; }
.meta-row span { font-family: var(--mono); font-size: 10px; color: var(--line); }

.route-header { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 12px; }
.route-btn {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink);
  border: 1px solid var(--ink); background: transparent; border-radius: 4px;
  padding: 6px 10px; cursor: pointer;
}
.trail { position: relative; width: 100%; }
.trail-line { position: absolute; top: 20px; left: 0; right: 0; border-top: 2px dashed var(--line); z-index: 0; }
.trail-stops { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.stamp-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; }
.stamp {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line); background: var(--paper); transition: all 0.35s ease; font-size: 13px; flex-shrink: 0;
}
.stamp.done { border-style: solid; border-color: var(--red); background: var(--paper); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--red); color: var(--red); }
.stamp.active { border-color: var(--gold); }
.stamp .spin { width: 15px; height: 15px; border: 2px solid var(--gold); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stamp .idx { font-family: var(--mono); font-size: 10px; color: var(--line); }
.stamp-label { font-family: var(--mono); font-size: 10px; color: var(--ink); text-align: center; line-height: 1.15; max-width: 58px; opacity: 0.85; }
.stamp-label.lit { opacity: 1; }

.send-btn {
  width: 100%; margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-size: 15px; color: var(--paper);
  background: var(--red); border: none; border-radius: 999px; padding: 13px;
  cursor: pointer; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--red);
}
.send-btn:disabled { background: var(--line); box-shadow: none; cursor: not-allowed; }
.send-btn .spin { width: 16px; height: 16px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }

.error-box { margin-top: 16px; background: #F6E4E1; border: 1px solid var(--red); border-radius: 4px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.error-box span { font-family: var(--body); font-size: 13px; color: var(--red); }
.error-box button { font-family: var(--mono); font-size: 11px; color: var(--red); background: none; border: none; text-decoration: underline; cursor: pointer; white-space: nowrap; }

.result { margin-top: 24px; display: none; }
.divider-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.divider-row hr { flex: 1; border: none; border-top: 1px dashed var(--line); }
.divider-row span { font-family: var(--mono); font-size: 9.5px; color: var(--red); letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; }
.result-box { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 16px; position: relative; }
.result-box p { font-family: var(--body); font-size: 16px; color: var(--ink); line-height: 1.5; margin: 0; }
.copy-btn { position: absolute; top: 12px; right: 12px; background: none; border: none; cursor: pointer; font-family: var(--mono); font-size: 10px; color: var(--line); }
.journey-toggle { margin-top: 10px; background: none; border: none; padding: 0; font-family: var(--mono); font-size: 11px; color: var(--line); text-decoration: underline; cursor: pointer; }
.journey { margin-top: 10px; display: none; }
.journey-item { padding-left: 12px; border-left: 2px solid var(--line); margin-bottom: 12px; }
.journey-item .stop-label { font-family: var(--mono); font-size: 9.5px; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; display: block; margin-bottom: 3px; }
.journey-item p { font-family: var(--body); font-size: 13.5px; color: var(--ink); line-height: 1.45; margin: 0; }

.footnote { font-family: var(--mono); font-size: 10px; color: var(--paper-dim); text-align: center; margin-top: 16px; }

body .floatingchat-container-wrap,
body .floatingchat-container-wrap-mobi { left: 50% !important; transform: translateX(-50%); }
body .floating-chat-kofi-popup-iframe,
body .floating-chat-kofi-popup-iframe-mobi { left: 50% !important; transform: translateX(-50%); }

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(22,40,58,0.78);
  align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal { width: 100%; max-width: 380px; background: var(--paper); border-radius: 8px; overflow: hidden; max-height: 88vh; display: flex; flex-direction: column; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-head h2 { font-family: var(--display); font-size: 18px; color: var(--ink); margin: 0; }
.modal-head button { background: none; border: none; font-size: 20px; color: var(--ink); cursor: pointer; line-height: 1; }
.modal p.intro { font-family: var(--body); font-size: 12.5px; color: var(--line); margin: 6px 0 16px; }
.stop-field { margin-bottom: 12px; }
.stop-field label { font-family: var(--mono); font-size: 9.5px; color: var(--line); letter-spacing: 1px; text-transform: uppercase; display: block; margin-bottom: 4px; }
.stop-field select { width: 100%; font-family: var(--body); font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px; }
.modal-actions-row { display: flex; gap: 8px; margin-top: 4px; }
.modal-actions-row button {
  flex: 1; font-family: var(--mono); font-size: 11px; color: var(--ink);
  border: 1px solid var(--ink); background: transparent; border-radius: 4px; padding: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.save-route-btn {
  width: 100%; margin-top: 14px; font-family: var(--display); font-size: 14px; color: var(--paper);
  background: var(--red); border: none; border-radius: 999px; padding: 11px; cursor: pointer;
}
