/* Base layout */
:root{
  --accent:#fc4c02; /* Strava-like orange */
  --accent-2:#ff7a2a;
  --muted:#6b6b6b;
  --bg:#fbfbfb;
  --card-bg:#ffffff;
  --danger:#d6453d;
  --glass: rgba(255,255,255,0.7);
}

* { box-sizing: border-box; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin: 0;
  background: linear-gradient(180deg,#ffffff 0%, #fbfbfd 100%);
  color: #222;
  -webkit-font-smoothing:antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }

/* Header */
.site-header { background: linear-gradient(90deg,var(--accent), var(--accent-2)); color: white; padding: 1.25rem 0; }
.header-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.brand { margin: 0; font-size: 1.4rem; letter-spacing: 0.6px; }
.tagline { margin: 0.5rem 0 0; font-size: 0.95rem; opacity: 0.95; color: rgba(255,255,255,0.95); padding-left: 1.25rem; }

/* Steps/top card */
.card { background: var(--card-bg); border-radius: 10px; box-shadow: 0 6px 18px rgba(17,17,17,0.06); padding: 1rem; margin-bottom: 1rem; }
.steps { display:flex; gap:0.5rem; align-items:center; margin-bottom: 0.75rem; }
.step { padding: 0.45rem 0.65rem; border-radius: 6px; background: #f2f2f2; color: #666; font-size: 0.85rem; }
.step.active { background: #fff; border: 1px solid rgba(0,0,0,0.04); color: #111; box-shadow: 0 3px 8px rgba(0,0,0,0.04); }

/* Grid helpers */
.card-row { display:flex; gap:1rem; flex-wrap:wrap; }
.half { flex:1 1 48%; min-width:280px; }
.small { font-size: 0.9rem; }

/* Buttons */
.btn { display:inline-block; padding: 0.55rem 0.85rem; border-radius: 8px; border: none; cursor: pointer; background: #f4f4f4; color: #222; }
.btn:hover { filter: brightness(0.98); }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 6px 18px rgba(252,76,2,0.12); }
.btn-secondary { background: #2b2b2b; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: transparent; border: 1px solid #eee; color: #333; }
.btn-cta { background: linear-gradient(180deg,var(--accent),var(--accent-2)); color:white; }

/* Form & inputs */
input[type=file], select, input[type=text] { padding: 0.5rem; border-radius: 6px; border: 1px solid #e6e6e6; }
.radio { display:block; margin: 0.35rem 0; font-weight:500; color: #222; }
.radio input { margin-right: 0.6rem; }

/* Saved routes */
.saved-list { list-style:none; padding:0; margin:0; }
.saved-list li { display:flex; justify-content:space-between; align-items:center; padding:0.45rem 0.6rem; border-bottom:1px solid #f2f2f2; }
.saved-list .route-name { font-weight:600; }
.saved-actions { display:flex; gap:0.5rem; }

/* Map container */
.map-card { margin-top: 0.5rem; border-radius: 8px; overflow:hidden; border: 1px solid #e9e9e9; }
#embedded-map-container { width:100%; height:420px; }
#embedded-map { width:100%; height:100%; }

/* marker-number */
.marker-number {
  background: var(--accent);
  color: white;
  font-weight: 700;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Preview & actions area */
.preview-grid { display:grid; grid-template-columns: 1fr 320px; gap:1rem; align-items:start; }
.preview-canvas .canvas-wrap { display:flex; justify-content:center; align-items:center; padding:0.5rem; background:#fafafa; border-radius:6px; }
.canvas-wrap canvas { max-width:100%; height:auto; border-radius:6px; border:1px solid #eee; }

/* Actions */
.controls-vertical { display:flex; flex-direction:column; gap:0.6rem; }
.controls { display:flex; gap:0.6rem; align-items:center; }

/* small helpers */
.muted { color: var(--muted); }
.small { font-size:0.85rem; }
.mt { margin-top:0.6rem; }

/* Log box */
.logbox { width:100%; height:220px; overflow:auto; background: #0f1720; color:#d7e6ff; padding: 0.9rem; border-radius:6px; font-family: monospace; }

/* Progress bars */
.progress { background:#f1f1f1; border-radius:6px; overflow:hidden; height:10px; margin-top:0.6rem; }
.progress.small { height:8px; }
.progress-bar { height:100%; width:0%; background: linear-gradient(90deg,var(--accent),var(--accent-2)); transition:width 0.15s linear; }

/* footer */
.site-footer { border-top: 1px solid #f0f0f0; padding: 0.75rem 0; color: #666; font-size:0.9rem; margin-top:1.5rem; }

/* responsive */
@media (max-width: 880px) {
  .preview-grid { grid-template-columns: 1fr; }
  .half { flex-basis:100%; }
  #embedded-map-container { height: 320px; }
}

.turn-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.turn-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fafafa;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid #eee;
}

.turn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
}

.turn-text {
  display: flex;
  flex-direction: column;
}

.turn-main {
  font-size: 0.95rem;
  font-weight: 600;
}

.turn-dist {
  font-size: 0.8rem;
  color: var(--muted);
}
