:root {
  --bg: #14161a;
  --panel: #1c1e23;
  --panel-alt: #23262c;
  --border: #2e3138;
  --orange: #e0913a;
  --orange-bright: #f5a623;
  --text: #e8e8e8;
  --text-dim: #9a9ea6;
  --green: #4caf50;
  --history: #d98a3d;
  --language: #4fa3d1;
  --biology: #6ec26e;
  --culture: #b07dcf;
  --technology: #d15b5b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 420px;
  min-width: 420px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar h1 {
  font-size: 22px;
  margin: 0 0 18px 0;
  font-weight: 700;
}

.progress-block {
  margin-bottom: 18px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.progress-bar-track {
  height: 6px;
  background: #33363d;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--orange-bright));
  transition: width .3s ease;
}

.progress-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.progress-count {
  font-size: 13px;
  color: var(--text-dim);
}

.category-toggle-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
}
.category-toggle-btn:hover { color: var(--orange-bright); }
.category-toggle-arrow {
  display: inline-block;
  transition: transform .15s ease;
  font-size: 10px;
}
.category-toggle-btn[aria-expanded="false"] .category-toggle-arrow {
  transform: rotate(-90deg);
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 10px;
  border-radius: 4px;
  overflow: hidden;
}

.progress-detail-panel.collapsed { display: none; }
.progress-detail-panel .io-block { margin-top: 14px; }
.progress-detail-panel .bottom-actions { margin-top: 12px; }

.category-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-alt);
  padding: 10px 14px;
  font-size: 14px;
}

.category-row .cat-name { display:flex; align-items:center; gap: 8px; }
.category-row .dot { width: 9px; height: 9px; border-radius: 50%; display:inline-block; }
.category-row .count { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.category-row .count.done { color: var(--orange-bright); font-weight: 600; }

.route-block {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--panel-alt);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.route-block h2 {
  font-size: 15px;
  color: var(--orange);
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.route-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.route-inputs input {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}
#optimize-btn {
  background: var(--orange);
  border: none;
  color: #14161a;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
#optimize-btn:hover { background: var(--orange-bright); }

.route-status {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.route-status.error { color: #e08a8a; }

.route-results {
  display: flex;
  flex-direction: column;
}
.route-items-scroll {
  max-height: 38vh;
  overflow-y: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.route-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--panel);
  border-radius: 4px;
  font-size: 12px;
}
.route-item .route-info { cursor: pointer; }
.route-item:hover { background: #2a2c31; }
.route-retarget-btn {
  flex-shrink: 0;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--orange);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.route-retarget-btn:hover { background: var(--orange); color: #14161a; border-color: var(--orange); }
.route-item .route-step {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--orange);
  color: #14161a;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.route-item .route-info { flex: 1; min-width: 0; }
.route-item .route-system {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-item .route-meta {
  color: var(--text-dim);
  font-size: 11px;
}

.route-summary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--orange-bright);
  font-weight: 600;
  flex-shrink: 0;
}

.bottom-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-shrink: 0;
}

#undo-btn, #reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  flex: 1;
}
#undo-btn:hover:not(:disabled) { border-color: var(--orange); color: var(--orange-bright); }
#undo-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#reset-btn:hover { border-color: #b04b4b; color: #e08a8a; }

.io-block {
  margin-top: 12px;
  flex-shrink: 0;
}
.io-buttons {
  display: flex;
  gap: 8px;
}
#export-toggle-btn, #import-toggle-btn {
  flex: 1;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
#export-toggle-btn:hover, #import-toggle-btn:hover { border-color: var(--orange); }

.io-panel {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--panel-alt);
}
.io-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.io-panel textarea {
  width: 100%;
  min-height: 70px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: monospace;
  resize: vertical;
  margin-bottom: 6px;
}
#copy-export-btn, #import-apply-btn {
  width: 100%;
  background: var(--orange);
  border: none;
  color: #14161a;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
#copy-export-btn:hover, #import-apply-btn:hover { background: var(--orange-bright); }
.io-status {
  font-size: 11px;
  margin-top: 6px;
  min-height: 14px;
}
.io-status.ok { color: #7fc97f; }
.io-status.error { color: #e08a8a; }

/* ================= DETAIL COLUMN (right of map, same width as sidebar) ================= */
.detail-panel {
  width: 420px;
  min-width: 420px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  min-height: 0;
}

.manual-add {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
  padding: 12px 18px;
}
.manual-add-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
  padding: 4px 0;
}
.manual-add-toggle-btn:hover { color: var(--orange-bright); }
.manual-add-toggle-arrow {
  display: inline-block;
  transition: transform .15s ease;
  font-size: 10px;
}
.manual-add-toggle-btn[aria-expanded="true"] .manual-add-toggle-arrow {
  transform: rotate(180deg);
}
.manual-add-fields.collapsed { display: none; }
.manual-add-fields { margin-bottom: 8px; }
.manual-add-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.manual-add-row select,
.manual-add-row input {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  flex: 1;
  min-width: 0;
}
#manual-codex { flex: 0 0 70px; }
#manual-add-btn {
  width: 100%;
  background: var(--orange);
  border: none;
  color: #14161a;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-top: 2px;
}
#manual-add-btn:hover { background: var(--orange-bright); }
.manual-add-status {
  font-size: 11px;
  margin-top: 6px;
  min-height: 14px;
}
.manual-add-status.ok { color: #7fc97f; }
.manual-add-status.error { color: #e08a8a; }
.manual-add-log {
  margin-top: 8px;
  max-height: 90px;
  overflow-y: auto;
  font-size: 11px;
  color: var(--text-dim);
}
.manual-add-log-entry {
  padding: 3px 0;
  border-bottom: 1px solid #26282e;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.manual-add-log-entry:last-child { border-bottom: none; }

.detail-empty {
  color: var(--text-dim);
  font-size: 14px;
  padding-top: 20px;
  text-align: center;
}

.detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.detail-title {
  font-size: 18px;
  font-weight: 700;
}
#copy-system-btn {
  flex-shrink: 0;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
#copy-system-btn:hover { border-color: var(--orange); color: var(--orange-bright); }
#copy-system-btn.copied { border-color: #7fc97f; color: #7fc97f; }
.detail-body {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.detail-system-reset:empty { margin-bottom: 0; }
#reset-system-btn {
  background: transparent;
  border: 1px solid #b04b4b;
  color: #e08a8a;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 14px;
  width: 100%;
}
#reset-system-btn:hover { background: rgba(176, 75, 75, 0.15); }

/* ================= MAIN (map, takes remaining space) ================= */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.iframe-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.map-dependency-note {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.map-dependency-note strong { color: var(--orange-bright); }
#canonn-frame {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: none;
  background: #fff;
}

.sub-site {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.sub-site-active {
  border-color: var(--orange-bright);
  box-shadow: 0 0 0 1px var(--orange-bright);
}
.sub-site-header {
  background: var(--panel-alt);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.sub-site-header .type-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #33363d;
  color: var(--text-dim);
  white-space: nowrap;
}
.coord-badge { cursor: help; }
.coord-ok { color: #7fc97f; }
.coord-warn { color: #e0b23a; }
.coord-sync { color: var(--text-dim); }
.open-canonn-btn {
  display: block;
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  cursor: pointer;
  border: none;
  color: #14161a;
  background: var(--orange);
}
.open-canonn-btn:hover { background: var(--orange-bright); }

.active-badge {
  font-size: 11px;
  color: var(--orange-bright);
  font-weight: 700;
  white-space: nowrap;
}

.obelisk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #26282e;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.obelisk-row:last-child { border-bottom: none; }
.obelisk-row:hover { background: #24262b; }
.obelisk-row input[type="checkbox"] { flex-shrink: 0; }

.obelisk-row-disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.obelisk-row-disabled:hover { background: none; }
.obelisk-row-disabled input[type="checkbox"] { cursor: not-allowed; }
.obelisk-code { font-weight: 700; width: 32px; flex-shrink: 0; }
.obelisk-items {
  color: var(--text-dim);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.obelisk-codex { color: var(--text-dim); width: 30px; flex-shrink: 0; text-align: right; }

.cat-tag {
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #14161a;
  display: inline-block;
  width: 70px;
  flex-shrink: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-History { background: var(--history); }
.cat-Language { background: var(--language); }
.cat-Biology { background: var(--biology); }
.cat-Culture { background: var(--culture); }
.cat-Technology { background: var(--technology); }

.no-obelisks {
  color: var(--text-dim);
  font-size: 13px;
  padding: 14px;
  font-style: italic;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3d44; border-radius: 4px; }

/* ================= CUSTOM CONFIRM MODAL (replaces native confirm(), which some browsers can silently block) ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.modal-message {
  font-size: 13px;
  color: var(--text);
  white-space: pre-line;
  margin-bottom: 18px;
  line-height: 1.5;
}
.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-buttons button {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
#modal-cancel-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
#modal-cancel-btn:hover { border-color: #b04b4b; color: #e08a8a; }
#modal-confirm-btn {
  background: var(--orange);
  color: #14161a;
}
#modal-confirm-btn:hover { background: var(--orange-bright); }

/* ================= CELEBRATION (101/101) ================= */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}

.celebrate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1101;
  animation: celebrate-fade-in 0.4s ease;
}
@keyframes celebrate-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.celebrate-box {
  background: var(--panel);
  border: 2px solid var(--orange-bright);
  border-radius: 12px;
  padding: 36px 42px;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 0 60px rgba(245, 166, 35, 0.35);
  animation: celebrate-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes celebrate-pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.celebrate-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}
.celebrate-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--orange-bright);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.celebrate-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 22px;
}
#celebrate-close-btn {
  background: var(--orange);
  border: none;
  color: #14161a;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
#celebrate-close-btn:hover { background: var(--orange-bright); }

.celebrate-meene-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 18px;
}
#celebrate-copy-meene-btn {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--orange-bright);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
#celebrate-copy-meene-btn:hover { border-color: var(--orange); }
#celebrate-copy-meene-btn.copied { border-color: #7fc97f; color: #7fc97f; }

.sidebar-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}
.app-title-block { min-width: 0; }
.sidebar-header-row h1 { margin: 0; line-height: 1.2; }
.app-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
#lang-select {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.app-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  flex-shrink: 0;
}
.app-footer a {
  color: var(--text-dim);
  text-decoration: underline;
}
.app-footer a:hover { color: var(--orange-bright); }

.sync-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.sync-gears {
  position: relative;
  width: 28px;
  height: 22px;
  flex-shrink: 0;
}
.gear {
  position: absolute;
  font-size: 16px;
  color: var(--orange-bright);
  line-height: 1;
}
.gear-cw {
  left: 0;
  top: 2px;
  animation: gear-spin-cw 2.2s linear infinite;
}
.gear-ccw {
  left: 12px;
  top: -2px;
  font-size: 13px;
  color: var(--orange);
  animation: gear-spin-ccw 2.2s linear infinite;
}
@keyframes gear-spin-cw { to { transform: rotate(360deg); } }
@keyframes gear-spin-ccw { to { transform: rotate(-360deg); } }

.sync-label {
  font-size: 12px;
  color: var(--text-dim);
  flex: 1;
}
#skip-sync-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
#skip-sync-btn:hover { border-color: var(--orange); color: var(--orange-bright); }

.route-block-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.4;
  font-style: italic;
}

.field-label {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
}

/* ================= HEADER CONTROLS (tutorial + lang) ================= */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
#tutorial-btn {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 30px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
#tutorial-btn:hover { border-color: var(--orange); color: var(--orange-bright); }

/* ================= TUTORIAL OVERLAY ================= */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 30px;
}
.tutorial-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}
.tutorial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tutorial-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--orange-bright);
}
.tutorial-close-x {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}
.tutorial-close-x:hover { color: var(--orange-bright); }

.tutorial-content {
  padding: 20px 22px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.tutorial-content h3 {
  color: var(--orange);
  font-size: 14px;
  margin: 20px 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tutorial-content h3:first-child { margin-top: 0; }
.tutorial-content .step-num {
  background: var(--orange);
  color: #14161a;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.tutorial-content p { margin: 6px 0; color: var(--text-dim); }
.tutorial-content ul { margin: 6px 0; padding-left: 20px; color: var(--text-dim); }
.tutorial-content li { margin: 4px 0; }
.tutorial-content strong { color: var(--text); }
.tutorial-content .tip {
  background: var(--panel-alt);
  border-left: 3px solid var(--orange);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
}
.tutorial-content code {
  background: var(--panel-alt);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--orange-bright);
}

.tutorial-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.tutorial-footer button {
  background: var(--orange);
  border: none;
  color: #14161a;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.tutorial-footer button:hover { background: var(--orange-bright); }

/* ================= WELCOME SCREEN (first-load tutorial in the center panel) ================= */
.welcome-screen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  background: #0f1013;
}
.welcome-inner {
  max-width: 900px;
  width: 100%;
  padding: 50px 30px 60px;
}
.welcome-hero-image {
  display: block;
  width: 85%;
  max-width: 780px;
  margin: 28px auto 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.welcome-title-block {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.welcome-title {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 10px 0;
  letter-spacing: 1px;
}
.welcome-subtitle {
  font-size: 18px;
  color: var(--orange-bright);
  font-style: italic;
}
.welcome-tagline {
  font-size: 15px;
  color: var(--text);
  margin-top: 14px;
}
.welcome-tutorial {
  padding: 0;
  font-size: 14px;
}
.welcome-tutorial h3 { font-size: 16px; }

/* First-visit hint: pulses the two route inputs to draw the eye, only shown until the
   user has actually used them once (see JS: removed permanently after first "Calculer la route"). */
.field-hint-pulse {
  animation: field-hint-pulse 1.6s ease-in-out infinite;
}
@keyframes field-hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.55); border-color: var(--border); }
  50% { box-shadow: 0 0 0 4px rgba(245, 166, 35, 0); border-color: var(--orange-bright); }
}

.route-item-done {
  opacity: 0.45;
}
.route-item-done .route-step {
  background: #4a4d54;
  color: var(--text-dim);
}
.route-item-done:hover { opacity: 0.7; }
