/* ==========================================================================
   GPX Marker Tool — Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap');

:root{
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-ui);

  /* light theme */
  --color-bg: #f5f6f9;
  --color-bg-soft: #eef0f4;
  --color-surface: #ffffff;
  --color-surface-2: #fbfbfd;
  --color-border: #e3e6ec;
  --color-border-strong: #cdd2dc;
  --color-text: #171a21;
  --color-text-muted: #626a7a;
  --color-text-faint: #8890a0;

  --color-primary: #ff6a3d;
  --color-primary-hover: #ef5a2d;
  --color-primary-soft: #ffe7dd;
  --color-secondary: #0e9c8f;
  --color-secondary-soft: #dcf5f1;
  --color-accent: #2f6fed;
  --color-accent-soft: #e3ecfe;
  --color-success: #23a35a;
  --color-success-soft: #dff5e6;
  --color-danger: #e5453f;
  --color-danger-soft: #fde6e5;
  --color-warning: #e79a1f;
  --color-warning-soft: #fdf0da;

  --gradient-hero: linear-gradient(135deg, #ff6a3d 0%, #ff9457 45%, #ffb35c 100%);
  --gradient-dark: linear-gradient(135deg, #131722 0%, #1c2130 100%);

  --shadow-sm: 0 1px 2px rgba(20, 24, 36, .06), 0 1px 1px rgba(20,24,36,.04);
  --shadow-md: 0 6px 16px rgba(20, 24, 36, .08), 0 2px 6px rgba(20,24,36,.05);
  --shadow-lg: 0 18px 40px rgba(20, 24, 36, .14), 0 4px 12px rgba(20,24,36,.08);
  --shadow-glow: 0 0 0 4px rgba(255,106,61,.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --topbar-h: 64px;
  --transition: 180ms cubic-bezier(.4,0,.2,1);
}

:root[data-theme="dark"]{
  --color-bg: #10131b;
  --color-bg-soft: #161a24;
  --color-surface: #1a1f2b;
  --color-surface-2: #1e2431;
  --color-border: #2a3040;
  --color-border-strong: #38404f;
  --color-text: #eef0f5;
  --color-text-muted: #a2a9b8;
  --color-text-faint: #737b8c;

  --color-primary: #ff7a4d;
  --color-primary-hover: #ff8c63;
  --color-primary-soft: #3a2115;
  --color-secondary: #23c4b3;
  --color-secondary-soft: #103330;
  --color-accent: #6f9bff;
  --color-accent-soft: #17233f;
  --color-success: #3fce85;
  --color-success-soft: #123423;
  --color-danger: #ff6b65;
  --color-danger-soft: #3a1917;
  --color-warning: #f2b545;
  --color-warning-soft: #3a2d12;

  --gradient-hero: linear-gradient(135deg, #ff7a4d 0%, #e6522d 60%, #a83a22 100%);
  --gradient-dark: linear-gradient(135deg, #0c0e14 0%, #171b26 100%);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 6px 20px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
  --shadow-glow: 0 0 0 4px rgba(255,122,77,.2);
}

/* ---------- reset ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--font-ui);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
h1,h2,h3,h4{ font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
p{ margin: 0; }
a{ color: inherit; }
button{ font-family: inherit; }
ul{ margin: 0; padding: 0; list-style: none; }
img{ max-width: 100%; display: block; }
input, textarea, select{ font-family: inherit; }
::selection{ background: var(--color-primary-soft); }

/* scrollbar */
::-webkit-scrollbar{ width: 10px; height: 10px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--color-border-strong); border-radius: 999px; }

/* ---------- layout helpers ---------- */
.container{ max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.visually-hidden{ position:absolute; width:1px;height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.skip-link{ position:absolute; left:12px; top:-48px; background:var(--color-primary); color:#fff; padding:10px 16px; border-radius:var(--radius-sm); z-index:999; transition:top var(--transition); }
.skip-link:focus{ top:12px; }

/* ---------- top bar (global, fixed controls top-right) ---------- */
.topbar{
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--color-border);
}
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--color-text); }
.brand__mark{
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient-hero);
  display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-sm);
  flex: none;
}
.brand__mark svg{ width: 21px; height: 21px; }
.brand__name{ font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.1; white-space: nowrap; }
.brand__tag{ display:block; font-family: var(--font-ui); font-weight: 500; font-size: 11px; color: var(--color-text-faint); letter-spacing: .03em; white-space: nowrap; }
.beta-badge{
  display:inline-flex; align-items:center; margin-left:7px; padding: 2px 7px;
  border-radius: var(--radius-pill); background: var(--color-accent-soft); color: var(--color-accent);
  font-family: var(--font-ui); font-size: 10px; font-weight: 800; letter-spacing: .05em;
  vertical-align: middle; line-height: 1.5;
}
@media (max-width: 480px){
  .brand__tag{ display:none; }
  .brand__name{ font-size:15px; }
}

.topbar__controls{ display:flex; align-items:center; gap:8px; }

.iconbtn{
  display:inline-flex; align-items:center; justify-content:center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  color: var(--color-text); cursor: pointer; transition: all var(--transition);
}
.iconbtn:hover{ border-color: var(--color-border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.iconbtn svg{ width: 18px; height: 18px; }

.seg{
  display:inline-flex; background: var(--color-surface-2); border:1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: 3px; gap: 2px;
}
.seg__opt{
  border:none; background:transparent; color:var(--color-text-muted);
  padding: 6px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  cursor:pointer; transition: all var(--transition);
}
.seg__opt.is-active{ background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }

.menu-wrap{ position: relative; }
.menu{
  position:absolute; right:0; top: calc(100% + 8px);
  background: var(--color-surface); border:1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  min-width: 190px; padding: 6px; z-index: 80;
  opacity:0; visibility:hidden; transform: translateY(-6px);
  transition: all var(--transition);
}
.menu.is-open{ opacity:1; visibility:visible; transform: translateY(0); }
.menu__item{
  display:flex; align-items:center; gap:10px; width:100%;
  padding: 9px 10px; border-radius: var(--radius-sm); border:none; background:none;
  color: var(--color-text); font-size: 13.5px; font-weight: 500; cursor:pointer; text-align:left;
}
.menu__item:hover{ background: var(--color-bg-soft); }
.menu__item svg{ width:16px; height:16px; color: var(--color-text-muted); flex:none; }
.menu__divider{ height:1px; background:var(--color-border); margin: 6px 4px; }

.avatar{
  width: 36px; height:36px; border-radius: 50%; object-fit:cover;
  border: 2px solid var(--color-surface); box-shadow: 0 0 0 1px var(--color-border);
}
.avatar-fallback{
  width:36px; height:36px; border-radius:50%;
  background: var(--gradient-hero); color:#fff; display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:13px; box-shadow: 0 0 0 1px var(--color-border);
}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.btn svg{ width:16px; height:16px; flex:none; }
.btn-primary{ background: var(--color-primary); color:#fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover{ background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary{ background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn-secondary:hover{ background: var(--color-bg-soft); }
.btn-ghost{ background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover{ background: var(--color-bg-soft); color: var(--color-text); }
.btn-danger{ background: var(--color-danger-soft); color: var(--color-danger); }
.btn-danger:hover{ background: var(--color-danger); color:#fff; }
.btn-sm{ padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-block{ width: 100%; }
.btn:disabled{ opacity:.5; cursor:not-allowed; transform:none !important; }
.btn-google{ background:#fff; color:#1f1f1f; border:1px solid #dadce0; }
.btn-google:hover{ background:#f7f8f8; }

/* ---------- cards / surfaces ---------- */
.card{
  background: var(--color-surface); border:1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.panel{
  background: var(--color-surface); border:1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.panel__head{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
  padding: 14px 18px; border-bottom: 1px solid var(--color-border);
}
.panel__title{ font-size: 14px; font-weight: 700; display:flex; align-items:center; gap:8px; }
.panel__title svg{ width:16px; height:16px; color: var(--color-primary); }
.panel__body{ padding: 18px; }

/* ---------- form controls ---------- */
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.input, textarea.input{
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong);
  background: var(--color-surface-2); color: var(--color-text); font-size: 14px; width:100%;
  transition: all var(--transition);
}
.input:focus, textarea.input:focus{ outline:none; border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
textarea.input{ resize: vertical; min-height: 70px; }

/* ---------- badges / chips ---------- */
.badge{ display:inline-flex; align-items:center; gap:5px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; letter-spacing:.02em; }
.badge-secondary{ background: var(--color-secondary-soft); color: var(--color-secondary); }
.badge-accent{ background: var(--color-accent-soft); color: var(--color-accent); }
.badge-warning{ background: var(--color-warning-soft); color: var(--color-warning); }

/* ---------- utility ---------- */
.flex{ display:flex; }
.flex-col{ display:flex; flex-direction:column; }
.items-center{ align-items:center; }
.justify-between{ justify-content:space-between; }
.gap-1{ gap:6px;} .gap-2{ gap:12px;} .gap-3{ gap:18px;}
.text-muted{ color: var(--color-text-muted); }
.text-faint{ color: var(--color-text-faint); }
.mt-1{margin-top:8px;} .mt-2{margin-top:16px;} .mt-3{margin-top:24px;}

/* ---------- toast ---------- */
.toast-stack{ position: fixed; bottom: 20px; right: 20px; display:flex; flex-direction:column; gap:10px; z-index: 200; }
.toast{
  background: var(--color-surface); border:1px solid var(--color-border); box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; font-weight:600;
  display:flex; align-items:center; gap:10px; min-width:240px;
  animation: toast-in 220ms ease;
  border-left: 3px solid var(--color-primary);
}
.toast.success{ border-left-color: var(--color-success); }
.toast.error{ border-left-color: var(--color-danger); }
@keyframes toast-in{ from{ opacity:0; transform: translateY(8px);} to{opacity:1; transform:translateY(0);} }

/* ---------- modal ---------- */
.modal-overlay{
  position: fixed; inset:0; background: rgba(10,12,18,.5); backdrop-filter: blur(3px);
  display:flex; align-items:center; justify-content:center; z-index: 150; padding: 20px;
  opacity:0; visibility:hidden; transition: all var(--transition);
}
.modal-overlay.is-open{ opacity:1; visibility:visible; }
.modal{
  background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y:auto;
  transform: translateY(14px) scale(.98); transition: transform var(--transition);
  border: 1px solid var(--color-border);
}
.modal-overlay.is-open .modal{ transform: translateY(0) scale(1); }
.modal__head{ display:flex; align-items:center; justify-content:space-between; padding: 18px 20px; border-bottom:1px solid var(--color-border); }
.modal__title{ font-size:16px; font-weight:700; }
.modal__body{ padding: 20px; display:flex; flex-direction:column; gap:16px; }
.modal__foot{ padding: 16px 20px; border-top:1px solid var(--color-border); display:flex; justify-content:flex-end; gap:10px; }

/* ---------- login page ---------- */
.auth-shell{ min-height:100dvh; display:grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 880px){ .auth-shell{ grid-template-columns: 1fr; } .auth-shell__visual{ display:none; } }
.auth-shell__visual{
  background: var(--gradient-dark); position:relative; overflow:hidden;
  display:flex; flex-direction:column; justify-content:flex-end; padding: 56px;
  color:#fff;
}
.auth-shell__visual::before{
  content:""; position:absolute; inset:0; opacity:.5;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,122,77,.35), transparent 45%),
                     radial-gradient(circle at 80% 70%, rgba(35,196,179,.28), transparent 45%);
}
.auth-shell__visual svg{ position:relative; width: 100%; height: auto; opacity:.9; }
.auth-shell__quote{
  position:relative; font-size: 26px; font-family: var(--font-display); font-weight:700; line-height:1.3;
  max-width: 480px; margin-bottom: 18px; min-height: 68px;
  opacity: 1; transform: translateY(0); transition: opacity 380ms ease, transform 380ms ease;
}
.auth-shell__quote.is-fading{ opacity: 0; transform: translateY(8px); }
.auth-shell__sub{ position:relative; color: rgba(255,255,255,.7); font-size:14px; max-width:440px; }
.auth-shell__form{ display:flex; align-items:center; justify-content:center; padding: 40px 24px; position:relative; }
.auth-card{ width:100%; max-width: 380px; }
.auth-card__logo{ display:flex; align-items:center; gap:12px; margin-bottom: 34px; }
.auth-divider{ display:flex; align-items:center; gap:12px; color: var(--color-text-faint); font-size:12px; font-weight:600; margin: 18px 0; }
.auth-divider::before, .auth-divider::after{ content:""; flex:1; height:1px; background: var(--color-border); }
.auth-lang-theme{ position:fixed; top:16px; right:16px; z-index:70; }

/* ---------- dashboard ---------- */
.page{ min-height: 100dvh; display:flex; flex-direction:column; }
.page__main{ flex:1; padding: 32px 0 60px; }
.dash-hero{
  border-radius: var(--radius-lg); background: var(--gradient-hero); color:#fff;
  padding: 32px; display:flex; align-items:center; justify-content:space-between; gap:24px;
  box-shadow: var(--shadow-md); position: relative; overflow:hidden; margin-bottom: 28px;
}
@media (max-width: 640px){
  .dash-hero{ flex-direction: column; align-items:flex-start; padding:24px; }
  .dash-hero h1{ font-size:21px; }
  .dash-hero__actions{ width:100%; }
  .dash-hero__actions .btn{ width:100%; }
}
.dash-hero::after{
  content:""; position:absolute; right:-40px; bottom:-60px; width:260px; height:260px; border-radius:50%;
  background: rgba(255,255,255,.12);
}
.dash-hero h1{ font-size: 26px; margin-bottom:6px; }
.dash-hero p{ color: rgba(255,255,255,.85); font-size:14.5px; max-width: 480px; }
.dash-hero__actions{ position:relative; z-index:2; flex:none; }

.section-title{ display:flex; align-items:center; justify-content:space-between; margin: 30px 0 14px; gap:12px; flex-wrap:wrap; }
.section-title h2{ font-size:18px; }
@media (max-width: 480px){
  .section-title .field{ width:100% !important; }
}

.plans-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap:18px; }
.plan-card{
  border-radius: var(--radius-md); overflow:hidden; cursor:pointer; transition: all var(--transition);
  position: relative;
}
.plan-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }
.plan-card__thumb{ height:120px; background: var(--color-bg-soft); position:relative; overflow:hidden; }
.plan-card__thumb svg{ width:100%; height:100%; }
.plan-card__sport{ position:absolute; top:10px; left:10px; }
.plan-card__body{ padding: 14px 16px 16px; }
.plan-card__name{ font-weight:700; font-size:14.5px; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.plan-card__date{ font-size:12px; color: var(--color-text-faint); margin-bottom:12px; }
.plan-card__stats{ display:flex; gap:14px; flex-wrap:wrap; }
.plan-card__stat{ font-size:12px; color: var(--color-text-muted); display:flex; align-items:center; gap:4px; }
.plan-card__stat svg{ width:13px; height:13px; }
.plan-card__actions{ position:absolute; top:10px; right:10px; display:flex; gap:4px; opacity:0; transition: opacity var(--transition); }
.plan-card:hover .plan-card__actions{ opacity:1; }
.plan-card__actions .iconbtn{ width:30px; height:30px; background: rgba(255,255,255,.92); }
:root[data-theme="dark"] .plan-card__actions .iconbtn{ background: rgba(26,31,43,.9); }

.empty-state{
  text-align:center; padding: 60px 20px; border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}
.empty-state svg{ width:52px; height:52px; color: var(--color-text-faint); margin-bottom:14px; }
.empty-state h3{ font-size:16px; color: var(--color-text); margin-bottom:6px; }
.empty-state p{ font-size:13.5px; max-width:360px; margin: 0 auto 18px; }

/* ---------- upload dropzone ---------- */
.dropzone{
  border: 2px dashed var(--color-border-strong); border-radius: var(--radius-lg);
  padding: 48px 24px; text-align:center; cursor:pointer; transition: all var(--transition);
  background: var(--color-surface-2);
}
.dropzone:hover, .dropzone.is-drag{ border-color: var(--color-primary); background: var(--color-primary-soft); }
.dropzone__icon{
  width:58px; height:58px; border-radius:16px; margin:0 auto 16px; display:flex; align-items:center; justify-content:center;
  background: var(--gradient-hero); box-shadow: var(--shadow-sm);
}
.dropzone__icon svg{ width:28px; height:28px; color:#fff; }
.dropzone h3{ font-size:16px; margin-bottom:6px; }
.dropzone p{ font-size:13px; color: var(--color-text-muted); }
.dropzone .btn{ margin-top:16px; }

/* ---------- planner layout ---------- */
.planner-bar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding: 12px 0; flex-wrap:wrap;
}
.planner-bar__actions{ flex-wrap: wrap; }
@media (max-width: 560px){
  .planner-bar{ flex-direction: column; align-items: stretch; }
  .planner-bar__actions{ width:100%; flex-direction: column; }
  .planner-bar__actions .btn{ width:100%; }
}
.plan-name-input{
  font-family: var(--font-display); font-weight:700; font-size:18px; border:none; background:transparent;
  color: var(--color-text); padding: 6px 8px; border-radius: var(--radius-sm); min-width: 160px;
}
.plan-name-input:hover, .plan-name-input:focus{ background: var(--color-bg-soft); outline:none; }

.stats-row{
  display:grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 16px 0 20px;
}
@media (max-width: 980px){ .stats-row{ grid-template-columns: repeat(3, 1fr);} }
@media (max-width: 560px){ .stats-row{ grid-template-columns: repeat(2, 1fr);} }
.stat-tile{
  padding: 14px 16px; border-radius: var(--radius-md); background: var(--color-surface);
  border:1px solid var(--color-border);
}
.stat-tile__label{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color: var(--color-text-faint); display:flex; align-items:center; gap:6px; margin-bottom:6px;}
.stat-tile__label svg{ width:13px; height:13px; }
.stat-tile__value{ font-family: var(--font-display); font-size: 21px; font-weight:700; }
.stat-tile__value small{ font-size:12px; font-weight:600; color: var(--color-text-muted); margin-left:2px; }
.stat-tile.accent-up .stat-tile__value{ color: var(--color-danger); }
.stat-tile.accent-down .stat-tile__value{ color: var(--color-secondary); }

.workspace{ display:grid; grid-template-columns: 1fr; gap:18px; }
.map-elev-grid{ display:grid; grid-template-columns: 1fr; gap: 14px; }

#map{ height: 440px; width:100%; border-radius: var(--radius-md); overflow:hidden; z-index:1; background: var(--color-bg-soft); }
:root[data-theme="dark"] #map{ filter: brightness(.92) contrast(1.02) saturate(1.05); }

.elev-wrap{ position:relative; padding: 14px 16px 8px; }
.elev-canvas-holder{ position:relative; height: 220px; }
.elev-hint{ font-size:12px; color: var(--color-text-faint); margin-top:6px; text-align:center; }

.map-holder{ position: relative; }
.map-layer-overlay{
  position:absolute; top:12px; right:12px; z-index:30; max-width: calc(100% - 24px);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(6px); box-shadow: var(--shadow-md);
}
@media (max-width: 480px){
  .map-layer-overlay{ padding:2px; }
  .map-layer-overlay .seg__opt{ padding: 5px 7px; font-size: 10.5px; }
}
.mk-master-toggles{ display:flex; gap:8px; flex-wrap:wrap; }
.map-tools-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin: 10px 0 2px; }
.gradient-legend{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap; justify-content:center;
  margin-top:10px; padding-top:10px; border-top:1px dashed var(--color-border);
}
.gradient-legend__title{ font-size:11px; font-weight:700; color: var(--color-text-faint); text-transform:uppercase; letter-spacing:.03em; }
.gradient-legend__item{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color: var(--color-text-muted); font-weight:600; }
.gradient-legend__dot{ width:9px; height:9px; border-radius:50%; flex:none; }
.marker-toggle-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.toggle-chip{
  display:inline-flex; align-items:center; gap:6px; padding:7px 12px; border-radius: var(--radius-pill);
  border:1px solid var(--color-border-strong); background: var(--color-surface); font-size:12.5px; font-weight:600;
  cursor:pointer; color: var(--color-text-muted); transition: all var(--transition);
}
.toggle-chip svg{ width:14px; height:14px; }
.toggle-chip.is-active{ background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--color-primary); }

/* icon picker */
.icon-picker{ display:grid; grid-template-columns: repeat(4, 1fr); gap:8px; }
.icon-opt{
  display:flex; flex-direction:column; align-items:center; gap:6px; padding: 10px 4px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--color-border); background: var(--color-surface-2);
  cursor:pointer; transition: all var(--transition);
}
.icon-opt:hover{ border-color: var(--color-border-strong); }
.icon-opt.is-selected{ border-color: var(--color-primary); background: var(--color-primary-soft); box-shadow: var(--shadow-glow); }
.icon-opt .icon-opt__glyph{ width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; }
.icon-opt__glyph svg{ width:16px; height:16px; }
.icon-opt > span{ font-size:10.5px; font-weight:600; text-align:center; color: var(--color-text-muted); line-height:1.2; }

/* markers table */
.mk-table-wrap{ overflow-x:auto; }
table.mk-table{ width:100%; border-collapse: collapse; font-size: 13.5px; }
table.mk-table th{
  text-align:left; padding: 10px 14px; font-size:11px; text-transform:uppercase; letter-spacing:.04em;
  color: var(--color-text-faint); border-bottom: 1px solid var(--color-border); white-space:nowrap;
}
table.mk-table td{ padding: 11px 14px; border-bottom: 1px solid var(--color-border); vertical-align:middle; }
table.mk-table tr:last-child td{ border-bottom:none; }
table.mk-table tr{ transition: background var(--transition); }
table.mk-table tbody tr:hover{ background: var(--color-bg-soft); cursor:pointer; }
.mk-type-cell{ display:flex; align-items:center; gap:8px; }
.mk-type-icon{ width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; flex:none; }
.mk-type-icon svg{ width:13px; height:13px; }
.mk-comment-cell{ max-width: 260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color: var(--color-text-muted); }
.mk-actions-cell{ display:flex; gap:6px; justify-content:flex-end; }
.mk-action-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--color-surface-2); border: 1px solid var(--color-border-strong);
  color: var(--color-text); cursor: pointer; transition: all var(--transition); flex: none;
}
.mk-action-btn svg{ width: 19px; height: 19px; display:block; }
.mk-action-btn:hover{ background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-accent); transform: translateY(-1px); }
.mk-action-btn.is-danger:hover{ background: var(--color-danger-soft); border-color: var(--color-danger); color: var(--color-danger); }
.mk-action-btn.is-active{ background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--color-primary); }
.mk-action-btn:disabled{ opacity: .35; cursor: not-allowed; }
.mk-action-btn:disabled:hover{ background: var(--color-surface-2); border-color: var(--color-border-strong); color: var(--color-text); transform: none; }

.mk-th-eye{ text-align:center !important; }
.mk-th-eye svg{ width:13px; height:13px; display:block; margin: 0 auto 3px; color: var(--color-text-faint); }
.mk-td-eye{ text-align:center; }
.mk-eye-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--color-surface-2);
  border: 1px solid var(--color-border-strong); color: var(--color-text-faint); cursor:pointer; transition: all var(--transition);
}
.mk-eye-btn svg{ width:16px; height:16px; }
.mk-eye-btn:hover{ border-color: var(--color-border-strong); color: var(--color-text); transform: translateY(-1px); }
.mk-eye-btn.is-active{ background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--color-primary); }
.mk-eye-btn:disabled{ opacity:.3; cursor:not-allowed; }
.mk-eye-btn:disabled:hover{ transform:none; border-color: var(--color-border-strong); color: var(--color-text-faint); }

/* leaflet marker popup tweaks */
.leaflet-popup-content-wrapper{ background: var(--color-surface); color: var(--color-text); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.leaflet-popup-tip{ background: var(--color-surface); }
.gpxmt-divicon{ display:flex; align-items:center; justify-content:center; }
.gpxmt-pin{
  width: 30px; height:30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display:flex; align-items:center; justify-content:center; box-shadow: var(--shadow-md); border: 2px solid #fff;
}
.gpxmt-pin svg{ transform: rotate(45deg); width:14px; height:14px; color:#fff; }
.gpxmt-pin.is-hover, .gpxmt-pin.is-selected{ box-shadow: 0 0 0 4px rgba(255,255,255,.3), var(--shadow-md); }

.gpxmt-marker-label{
  background: var(--color-surface) !important; color: var(--color-text) !important;
  border: 1px solid var(--color-border-strong) !important; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); font-weight: 600; font-size: 11.5px;
  padding: 3px 8px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gpxmt-marker-label.leaflet-tooltip-right::before{ border-right-color: var(--color-border-strong); }
.gpxmt-marker-label.leaflet-tooltip-left::before{ border-left-color: var(--color-border-strong); }

/* ---------- onboarding / tutorial ---------- */
.onboarding-modal{ max-width: 480px; }
.onboarding-step{ display:flex; gap:14px; align-items:flex-start; padding: 12px 0; }
.onboarding-step + .onboarding-step{ border-top: 1px solid var(--color-border); }
.onboarding-step__icon{
  width: 40px; height:40px; border-radius: 12px; background: var(--color-primary-soft); color: var(--color-primary);
  display:flex; align-items:center; justify-content:center; flex:none;
}
.onboarding-step__icon svg{ width:20px; height:20px; }
.onboarding-step__title{ font-weight:700; font-size:14px; margin-bottom:3px; }
.onboarding-step__desc{ font-size:12.5px; color: var(--color-text-muted); line-height:1.55; }

/* ---------- meteo ---------- */
.weather-selector{ display:flex; align-items:flex-end; gap:18px; flex-wrap:wrap; }
.weather-selector .field label{ margin-bottom: 2px; }
.weather-results{ display:flex; flex-direction:column; gap:14px; }
.weather-results__head{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.weather-chip-row{ display:flex; gap:10px; overflow-x:auto; padding-bottom:4px; }
.weather-chip{
  flex: none; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding: 10px 14px; border-radius: var(--radius-md); background: var(--color-surface-2);
  border: 1px solid var(--color-border); min-width: 84px;
}
.weather-chip__emoji{ font-size:22px; line-height:1; }
.weather-chip__temp{ font-family: var(--font-display); font-weight:700; font-size:16px; }
.weather-chip__km{ font-size:11px; color: var(--color-text-faint); font-weight:600; }
.weather-chip__precip{ font-size:11px; color: var(--color-accent); font-weight:600; }

.gpxmt-weather-pin{
  display:flex; align-items:center; gap:3px; padding: 3px 7px; border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1px solid var(--color-border-strong); box-shadow: var(--shadow-sm);
  font-size: 11.5px; font-weight:700; color: var(--color-text); white-space:nowrap;
}

/* ---------- cookie banner ---------- */
.cookie-banner{
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300;
  max-width: 640px; margin: 0 auto;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 16px 18px; display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  transform: translateY(140%); transition: transform 260ms cubic-bezier(.4,0,.2,1);
}
.cookie-banner.is-visible{ transform: translateY(0); }
.cookie-banner__text{ flex: 1 1 260px; font-size: 12.5px; line-height: 1.5; color: var(--color-text-muted); }
.cookie-banner__text a{ color: var(--color-primary); font-weight: 600; text-decoration: none; }
.cookie-banner__actions{ display:flex; gap:8px; flex: none; }

/* footer / ad slot */
.ad-slot{
  border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md);
  padding: 16px; text-align:center; color: var(--color-text-faint); font-size:11.5px;
  font-weight:600; letter-spacing:.03em; text-transform:uppercase; margin-top: 24px;
}
footer.site-footer{ padding: 26px 0; text-align:center; color: var(--color-text-faint); font-size:12.5px; border-top:1px solid var(--color-border); margin-top:40px; }

/* loading spinner */
.spinner{ width:18px; height:18px; border-radius:50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color:#fff; animation: spin .7s linear infinite; }
.spinner.dark{ border-color: var(--color-border-strong); border-top-color: var(--color-primary); }
@keyframes spin{ to{ transform: rotate(360deg); } }

/* history version list (dashboard side detail, reused in modal) */
.version-pill{ display:flex; align-items:center; gap:8px; font-size:12px; color: var(--color-text-faint); }
.version-pill .dot{ width:6px; height:6px; border-radius:50%; background: var(--color-success); }

/* responsive helpers */
@media (min-width: 900px){
  .map-elev-grid{ grid-template-columns: 1.4fr 1fr; align-items: start; }
}

/* print */
@media print{
  .topbar, .planner-bar__actions, .marker-toggle-row, .dropzone, .no-print, .toast-stack, .mk-actions-cell, .ad-slot, footer.site-footer{ display:none !important; }
  body{ background:#fff; }
  .card, .panel{ box-shadow:none !important; border-color:#ccc !important; break-inside: avoid; }
  #map{ height: 340px; }
  .stats-row{ grid-template-columns: repeat(6,1fr) !important; }
  .container{ max-width:100%; padding:0; }
}
