    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --primary-50: #f0fdfa; --primary-100: #ccfbf1; --primary-200: #99f6e4;
      --primary-300: #5eead4; --primary-400: #2dd4bf; --primary-500: #14b8a6;
      --primary-600: #0d9488; --primary-700: #0f766e;
      --accent-400: #fbbf24; --accent-500: #f59e0b;
      --surface-50: #fafaf9; --surface-100: #f5f5f4; --surface-200: #e7e5e4;
      --surface-300: #d6d3d1; --surface-400: #a8a29e; --surface-500: #78716c;
      --surface-600: #57534e; --surface-700: #44403c; --surface-800: #292524;
      --shadow-soft: 0 2px 8px rgba(0,0,0,.06);
      --shadow-lg: 0 4px 16px rgba(0,0,0,.08);
      --radius: 0.875rem; --radius-lg: 1.25rem;
    }

    body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: var(--surface-50); color: var(--surface-800); height: 100vh; overflow: hidden; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; }
    body.header-hidden .app-header { display: none; }
    body.header-hidden .app-main { flex: 1; }

    /* ---- Header ---- */
    .app-header {
      background: #fff; border-bottom: 1px solid var(--surface-200);
      box-shadow: var(--shadow-soft); padding: 0 24px; height: 64px;
      display: flex; align-items: center; justify-content: flex-start; gap: 32px; flex-shrink: 0;
    }
    .logo { display: flex; align-items: center; gap: 12px; }
    .logo-icon {
      width: 40px; height: 40px; border-radius: var(--radius-lg);
      background: var(--primary-500); display: flex; align-items: center; justify-content: center;
      box-shadow: var(--shadow-soft);
    }
    .logo-icon svg { width: 24px; height: 24px; color: #fff; }
    .logo h1 { font-size: 1.25rem; font-weight: 700; color: var(--surface-800); letter-spacing: -0.02em; }

    .tabs { display: flex; gap: 4px; background: var(--surface-100); border-radius: var(--radius-lg); padding: 4px; }
    .tab-btn {
      display: flex; align-items: center; gap: 8px; padding: 8px 16px; border: none;
      border-radius: 0.75rem; font-size: 0.875rem; font-weight: 500; cursor: pointer;
      transition: all .2s; background: transparent; color: var(--surface-500);
    }
    .tab-btn svg { width: 16px; height: 16px; }
    .tab-btn.active { background: #fff; color: var(--primary-700); box-shadow: var(--shadow-soft); }
    .tab-btn:hover:not(.active) { color: var(--surface-700); }

    /* ---- Layout ---- */
    .app-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
    .view { flex: 1; overflow: hidden; display: none; min-height: 0; }
    .view.active { display: flex; }

    /* ---- Landing / Home ---- */
    .view-home { overflow-y: auto; }
    .view-home.active { flex: 1; flex-direction: column; }
    .hero {
      position: relative; width: 100%; overflow: hidden;
      background: linear-gradient(150deg, #0a1628 0%, #0d3b4e 28%, #0d6e6e 58%, #1a6b50 82%, #b45309 100%);
      display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
      flex: none; min-height: 100vh; max-height: 100vh;
      padding: 64px 48px 48px;
      animation: heroGradientShift 18s ease-in-out infinite;
    }
    @keyframes heroGradientShift {
      0%, 100% { background: linear-gradient(150deg, #0a1628 0%, #0d3b4e 28%, #0d6e6e 58%, #1a6b50 82%, #b45309 100%); }
      25% { background: linear-gradient(150deg, #0a1929 0%, #0e4f5c 28%, #0d7d7e 58%, #1a7b5d 82%, #c2410c 100%); }
      50% { background: linear-gradient(150deg, #0c1e3d 0%, #0d5d6c 28%, #0d8a7e 58%, #1a8b5d 82%, #9a3412 100%); }
      75% { background: linear-gradient(150deg, #0a1628 0%, #0d4f5c 28%, #0d7d6e 58%, #1a6b5d 82%, #b45309 100%); }
    }

    /* Route lines background SVG */
    .hero-routes-bg {
      position: absolute; inset: 0; width: 100%; height: 100%;
      pointer-events: none; z-index: 0; opacity: 0.35;
    }
    .hero-routes-bg .route-path {
      fill: none; stroke-linecap: round;
      stroke-dasharray: 5 12;
      animation: routeDashMove 3s linear infinite;
    }
    .hero-routes-bg .route-path.car {
      stroke: #5eead4; stroke-width: 0.9; animation-duration: 3.5s;
    }
    .hero-routes-bg .route-path.walk {
      stroke: #fbbf24; stroke-width: 0.8; animation-duration: 5s;
      stroke-dasharray: 3 7;
    }
    .hero-routes-bg .route-path.yacht {
      stroke: #38bdf8; stroke-width: 0.8; animation-duration: 7s;
      stroke-dasharray: 2 8;
    }
    .hero-routes-bg .route-glow {
      fill: none; stroke-linecap: round;
      stroke-width: 2.5; opacity: 0.03;
    }
    @keyframes routeDashMove { to { stroke-dashoffset: -34; } }

    /* Glowing orbs */
    .hero-orb {
      position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
      filter: blur(50px); animation: orbFloat 14s ease-in-out infinite;
    }
    .hero-orb.o1 { top: -4%; right: 8%; width: 300px; height: 300px; background: radial-gradient(circle, rgba(20,184,166,.28), transparent 70%); animation-delay: 0s; }
    .hero-orb.o2 { bottom: -6%; left: 6%; width: 260px; height: 260px; background: radial-gradient(circle, rgba(180,83,9,.16), transparent 70%); animation-delay: -5s; }
    .hero-orb.o3 { top: 40%; left: 48%; width: 200px; height: 200px; background: radial-gradient(circle, rgba(56,189,248,.1), transparent 70%); animation-delay: -9s; }
    @keyframes orbFloat {
      0%, 100% { transform: translate(0,0) scale(1); }
      25% { transform: translate(15px,-12px) scale(1.06); }
      50% { transform: translate(-8px,8px) scale(0.96); }
      75% { transform: translate(10px,4px) scale(1.03); }
    }

    /* Main travel icons (near route lines, gently swaying) */
    .hero-travel {
      position: absolute; z-index: 0; pointer-events: auto;
      width: 62px; height: 62px;
    }
    .hero-travel.car {
      top: 52%; right: 14%;
      color: #5eead4; opacity: 0.6;
      animation: swayX 9s ease-in-out infinite;
    }
    .hero-travel.walk {
      top: 34%; left: 17%;
      color: #fbbf24; opacity: 0.65;
      animation: swayBob 7s ease-in-out infinite;
    }
    .hero-travel.yacht {
      top: 7%; left: 44%;
      color: #38bdf8; opacity: 0.6;
      animation: swayX 11s ease-in-out infinite;
    }
    .hero-travel:hover { opacity: 0.9; filter: drop-shadow(0 0 10px currentColor); transition: opacity .3s, filter .3s; }
    @keyframes swayX {
      0%, 100% { transform: translateX(0) rotate(-1.5deg); }
      50% { transform: translateX(20px) rotate(1.5deg); }
    }
    @keyframes swayBob {
      0%, 100% { transform: translateY(0) rotate(-1deg); }
      50% { transform: translateY(-10px) rotate(1.5deg); }
    }

    /* Scattered travel symbols — bright, individual colors */
    .hero-sym {
      position: absolute; z-index: 0; pointer-events: auto;
      opacity: 0.32;
      transition: opacity .3s, filter .3s;
    }
    .hero-sym:hover { opacity: 0.7; filter: drop-shadow(0 0 6px currentColor); }
    .hero-sym svg { width: 100%; height: 100%; }
    .hero-sym.tree     { top: 6%;  left: 7%;   width: 36px; height: 44px; color: #4ade80; animation: symFloat 8s ease-in-out infinite; }
    .hero-sym.plane    { top: 12%; right: 9%; width: 50px; height: 38px; color: #fbbf24; animation: symFloat 6s ease-in-out infinite; }
    .hero-sym.train    { bottom: 14%; left: 9%; width: 56px; height: 40px; color: #c084fc; animation: symFloat 9s ease-in-out infinite; }
    .hero-sym.fish     { bottom: 18%; right: 13%; width: 48px; height: 32px; color: #22d3ee; animation: symFloat 7s ease-in-out infinite; }
    .hero-sym.beer     { top: 28%; left: 5%; width: 32px; height: 40px; color: #fcd34d; animation: symFloat 10s ease-in-out infinite; }
    .hero-sym.sunset   { top: 5%; right: 26%; width: 48px; height: 48px; color: #fb923c; opacity: 0.4; animation: symFloat 12s ease-in-out infinite; }
    .hero-sym.mountain { bottom: 8%; right: 26%; width: 58px; height: 42px; color: #93c5fd; animation: symFloat 8s ease-in-out infinite; }
    .hero-sym.ski      { bottom: 24%; left: 27%; width: 38px; height: 46px; color: #a5f3fc; animation: symFloat 9s ease-in-out infinite; }
    @keyframes symFloat {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      50% { transform: translateY(-10px) rotate(4deg); }
    }

    /* All content above background */
    .hero-content {
      position: relative; z-index: 1;
      display: flex; flex-direction: column; align-items: center;
      max-width: 720px; width: 100%;
    }

    .hero-badge {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 5px 14px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
      background: rgba(255,255,255,.12); color: #fde68a; backdrop-filter: blur(6px);
      margin-bottom: 14px; letter-spacing: 0.03em;
      animation: badgePulse 3s ease-in-out infinite;
    }
    @keyframes badgePulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(253,230,138,0); }
      50% { box-shadow: 0 0 0 6px rgba(253,230,138,.08); }
    }
    .hero-badge svg { width: 12px; height: 12px; }

    .hero h2 {
      font-size: 2.25rem; font-weight: 800; color: #fff;
      letter-spacing: -0.03em; line-height: 1.15; max-width: 680px;
      background: linear-gradient(90deg, #fff 0%, #fde68a 50%, #fff 100%);
      background-size: 200% auto;
      -webkit-background-clip: text; background-clip: text;
      -webkit-text-fill-color: transparent;
      animation: heroShimmer 6s linear infinite;
    }
    @keyframes heroShimmer { to { background-position: 200% center; } }

    .hero p { font-size: 1.0625rem; color: rgba(255,255,255,.72); margin-top: 10px; max-width: 560px; line-height: 1.55; }

    .hero-stats { display: flex; gap: 28px; margin-top: 22px; }
    .hero-stat { color: rgba(255,255,255,.5); font-size: 0.75rem; font-weight: 500; transition: transform .3s; }
    .hero-stat:hover { transform: translateY(-3px); }
    .hero-stat strong { display: block; font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: 2px; }

    .nav-cards { display: flex; gap: 12px; margin-top: 22px; max-width: 680px; width: 100%; }
    .nav-card {
      background: rgba(255,255,255,.1); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14);
      border-radius: 0.75rem; padding: 14px 16px; cursor: pointer; transition: all .3s cubic-bezier(.4,0,.2,1);
      display: flex; align-items: center; gap: 10px; flex: 1; text-decoration: none; color: #fff;
      position: relative; overflow: hidden;
    }
    .nav-card::before {
      content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
      transition: left .5s;
    }
    .nav-card:hover::before { left: 100%; }
    .nav-card:hover {
      background: rgba(255,255,255,.18); transform: translateY(-3px);
      box-shadow: 0 8px 24px rgba(0,0,0,.15); border-color: rgba(255,255,255,.22);
    }
    .nav-card-icon {
      width: 32px; height: 32px; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
      transition: transform .3s;
    }
    .nav-card:hover .nav-card-icon { transform: scale(1.15) rotate(-5deg); }
    .nav-card-icon svg { width: 16px; height: 16px; }
    .nav-card-icon.primary { background: rgba(20,184,166,.25); color: #5eead4; }
    .nav-card-icon.accent { background: rgba(251,191,36,.2); color: #fbbf24; }
    .nav-card-icon.indigo { background: rgba(99,102,241,.25); color: #a5b4fc; }
    .nav-card-body { flex: 1; min-width: 0; }
    .nav-card h3 { font-size: 0.8125rem; font-weight: 700; color: #fff; }
    .nav-card p { font-size: 0.6875rem; color: rgba(255,255,255,.55); margin-top: 1px; }
    .nav-card-arrow svg { width: 14px; height: 14px; color: rgba(255,255,255,.4); flex-shrink: 0; transition: transform .2s; }
    .nav-card:hover .nav-card-arrow svg { transform: translateX(4px); color: rgba(255,255,255,.8); }

    .nav-card-cta {
      background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.2);
    }
    .nav-card-cta .nav-card-icon { background: rgba(255,255,255,.15); color: #fff; }

    /* Scroll-down indicator */
    .hero-scroll {
      position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
      z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
      color: rgba(255,255,255,.4); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.05em;
      text-transform: uppercase; cursor: pointer; pointer-events: auto;
      transition: color .25s; background: none; border: none; font-family: inherit;
      animation: scrollFade 4s ease-in-out infinite;
    }
    .hero-scroll:hover { color: rgba(255,255,255,.85); }
    .hero-scroll:hover svg { animation-play-state: paused; transform: translateY(4px); }
    .hero-scroll svg { width: 20px; height: 20px; animation: scrollBounce 2s ease-in-out infinite; transition: transform .2s; }
    @keyframes scrollBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
    @keyframes scrollFade { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }

    @media (max-width: 900px) {
      .hero { padding: 40px 24px 40px; min-height: 100vh; max-height: 100vh; }
      .hero h2 { font-size: 1.5rem; -webkit-text-fill-color: #fff; }
      .hero p { font-size: 0.9375rem; }
      .hero-stats { gap: 18px; margin-top: 16px; }
      .hero-stat strong { font-size: 1.25rem; }
      .nav-cards { flex-direction: column; gap: 8px; }
      .hero-routes-bg { opacity: 0.25; }
      .hero-orb { width: 180px !important; height: 180px !important; }
      .hero-travel { opacity: 0.25; }
      .hero-travel { width: 46px; height: 46px; }
      .hero-sym { opacity: 0.12; }
    }
    @media (max-width: 600px) {
      .hero { padding: 32px 20px 32px; }
      .hero h2 { font-size: 1.25rem; }
      .hero p { font-size: 0.875rem; margin-top: 8px; }
      .hero-badge { margin-bottom: 10px; font-size: 0.6875rem; }
      .hero-stats { gap: 14px; margin-top: 14px; }
      .hero-stat { font-size: 0.6875rem; }
      .hero-stat strong { font-size: 1.1rem; }
      .nav-cards { margin-top: 16px; }
      .hero-scroll { font-size: 0.625rem; bottom: 12px; }
      .hero-sym.ski, .hero-sym.beer, .hero-sym.fish { display: none; }
    }
    @media (max-height: 600px) {
      .hero { padding: 20px 24px; }
      .hero-badge { margin-bottom: 8px; }
      .hero h2 { font-size: 1.25rem; }
      .hero p { display: none; }
      .hero-stats { margin-top: 12px; gap: 16px; }
      .nav-cards { margin-top: 14px; }
      .hero-scroll { display: none; }
      .hero-sym { display: none; }
    }

    /* ---- Route Planner ---- */
    .route-planner { flex: 1; display: flex; gap: 16px; padding: 16px; width: 100%; min-height: 0; }
    .route-sidebar { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; }

    .map-wrap { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; position: relative; }

    /* ---- Map Search ---- */
    .map-search { position: relative; flex-shrink: 0; }
    .map-search-input { width: 100%; padding: 10px 12px 10px 40px; border: 1px solid var(--surface-200); border-radius: var(--radius); background: #fff; font-size: 0.875rem; font-family: inherit; box-shadow: var(--shadow-soft); transition: all .2s; }
    .map-search-input:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--primary-300), var(--shadow-soft); }
    .map-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--surface-400); pointer-events: none; }
    .map-search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--surface-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; z-index: 500; }
    .map-search-results::-webkit-scrollbar { width: 6px; }
    .map-search-results::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 3px; }
    .search-result-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--surface-100); transition: background .15s; }
    .search-result-item:last-child { border-bottom: none; }
    .search-result-item:hover { background: var(--primary-50); }
    .search-result-name { font-size: 0.875rem; font-weight: 500; color: var(--surface-800); }
    .search-result-addr { font-size: 0.75rem; color: var(--surface-400); margin-top: 2px; }
    .search-result-empty { padding: 16px; text-align: center; font-size: 0.875rem; color: var(--surface-400); }
    .search-cross-marker { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; cursor: pointer; }
    .search-cross-marker svg { width: 24px; height: 24px; stroke: var(--primary-600); stroke-width: 2.5; fill: none; }
    .route-sidebar::-webkit-scrollbar { width: 6px; }
    .route-sidebar::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 3px; }

    .route-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--surface-100); }
    .route-summary-item { display: flex; align-items: center; gap: 5px; font-size: 0.8125rem; color: var(--surface-600); font-weight: 600; }
    .route-summary-item svg { width: 15px; height: 15px; color: var(--primary-400); flex-shrink: 0; }

    .route-map-container { flex: 1; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--surface-100); box-shadow: var(--shadow-soft); min-height: 500px; position: relative; }

    /* ---- Map Layer Switcher ---- */
    .map-layer-switcher { position: absolute; top: 12px; right: 12px; z-index: 800; }
    .map-layer-btn { width: 38px; height: 38px; border-radius: 0.5rem; background: #fff; border: 1px solid var(--surface-200); box-shadow: var(--shadow-soft); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--surface-600); transition: all .2s; }
    .map-layer-btn:hover { background: var(--surface-50); color: var(--primary-600); border-color: var(--primary-200); }
    .map-layer-btn.active { background: var(--primary-500); color: #fff; border-color: var(--primary-500); }
    .map-layer-btn svg { width: 18px; height: 18px; }
    .map-layer-panel { position: absolute; top: 44px; right: 0; z-index: 800; background: #fff; border: 1px solid var(--surface-100); border-radius: 0.75rem; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; animation: ctxFadeIn .12s ease-out; }
    .map-layer-panel::-webkit-scrollbar { width: 0; }
    .map-layer-panel::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 3px; }
    .ml-group-label { font-size: 0.625rem; font-weight: 700; color: var(--surface-400); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px 4px; }
    .ml-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 0.5rem; font-size: 0.8125rem; cursor: pointer; transition: background .15s; color: var(--surface-700); }
    .ml-option:hover { background: var(--primary-50); }
    .ml-option.selected { background: var(--primary-50); font-weight: 600; color: var(--primary-700); }
    .ml-option-thumb { width: 28px; height: 28px; border-radius: 0.375rem; flex-shrink: 0; border: 1px solid var(--surface-200); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; }
    .ml-option-thumb svg { width: 18px; height: 18px; }
    .ml-option-name { flex: 1; line-height: 1.3; }
    .ml-option-check { width: 16px; height: 16px; flex-shrink: 0; color: var(--primary-500); opacity: 0; }
    .ml-option.selected .ml-option-check { opacity: 1; }

    /* ---- Custom Zoom Slider ---- */
    .map-zoom-control {
      position: absolute; bottom: 62px; right: 12px; z-index: 800;
      display: flex; flex-direction: column; align-items: center;
      background: #fff; border: 1px solid var(--surface-200); border-radius: 0.75rem;
      box-shadow: var(--shadow-soft); padding: 4px; gap: 0;
      width: 38px;
    }
    .map-zoom-btn {
      width: 30px; height: 30px; border: none; border-radius: 0.5rem;
      background: #fff; color: var(--surface-600); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all .15s; flex-shrink: 0;
    }
    .map-zoom-btn:hover { background: var(--primary-50); color: var(--primary-600); }
    .map-zoom-btn:active { background: var(--primary-100); transform: scale(.92); }
    .map-zoom-btn svg { width: 16px; height: 16px; stroke-width: 2.5; }
    .map-zoom-slider-wrap {
      height: 100px; display: flex; align-items: center; justify-content: center;
      padding: 2px 0; position: relative; width: 30px;
    }
    .map-zoom-slider {
      -webkit-appearance: none; appearance: none;
      width: 96px; height: 6px; margin: 0; padding: 0;
      background: var(--surface-200); border-radius: 3px;
      cursor: pointer; outline: none;
      transform: rotate(-90deg);
      transform-origin: center;
    }
    .map-zoom-slider::-webkit-slider-runnable-track {
      height: 6px; background: var(--surface-200); border-radius: 3px;
    }
    .map-zoom-slider::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none;
      width: 16px; height: 16px; border-radius: 50%;
      background: var(--primary-500); border: 2px solid #fff;
      box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
      margin-top: -5px;
    }
    .map-zoom-slider::-moz-range-track {
      height: 6px; background: var(--surface-200); border-radius: 3px;
    }
    .map-zoom-slider::-moz-range-thumb {
      width: 16px; height: 16px; border-radius: 50%;
      background: var(--primary-500); border: 2px solid #fff;
      box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer; border: 2px solid #fff;
    }

    /* ---- Map Download Control ---- */
    .map-download-control {
      position: absolute; bottom: 24px; right: 12px; z-index: 800;
      width: 38px;
    }
    .map-download-btn {
      width: 38px; height: 34px; border: 1px solid var(--surface-200); border-radius: 0.75rem;
      background: #fff; color: var(--surface-600); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all .15s; box-shadow: var(--shadow-soft);
    }
    .map-download-btn:hover { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-200); }
    .map-download-btn:active { transform: scale(.92); }
    .map-download-btn svg { width: 18px; height: 18px; stroke-width: 2; }
    .map-download-btn:disabled { opacity: .4; cursor: not-allowed; }
    .map-download-btn:disabled:hover { background: #fff; color: var(--surface-600); border-color: var(--surface-200); }
    .map-download-popup {
      position: absolute; bottom: 40px; right: 0; z-index: 810;
      background: #fff; border: 1px solid var(--surface-100); border-radius: 0.75rem;
      box-shadow: var(--shadow-lg); padding: 4px; min-width: 180px;
      animation: ctxFadeIn .12s ease-out;
    }
    .map-download-popup-title { font-size: 0.625rem; font-weight: 700; color: var(--surface-400); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px 4px; }
    .map-download-option {
      display: flex; align-items: center; gap: 8px; padding: 8px 10px;
      border-radius: 0.5rem; cursor: pointer; transition: background .15s; color: var(--surface-700);
    }
    .map-download-option:hover { background: var(--primary-50); }
    .map-download-option svg { width: 16px; height: 16px; color: var(--primary-500); flex-shrink: 0; }
    .map-download-option-text { flex: 1; }
    .map-download-option-name { font-size: 0.8125rem; font-weight: 600; }
    .map-download-option-desc { font-size: 0.6875rem; color: var(--surface-400); font-weight: 400; margin-top: 1px; }

    /* ---- Map Import Control ---- */
    .map-import-control {
      position: absolute; bottom: 236px; right: 12px; z-index: 800;
      width: 38px;
    }
    .map-import-btn {
      width: 38px; height: 34px; border: 1px solid var(--surface-200); border-radius: 0.75rem;
      background: #fff; color: var(--surface-600); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all .15s; box-shadow: var(--shadow-soft);
    }
    .map-import-btn:hover { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-200); }
    .map-import-btn:active { transform: scale(.92); }
    .map-import-btn svg { width: 18px; height: 18px; stroke-width: 2; }

    /* ---- Map Reroute Control ---- */
    .map-reroute-control {
      position: absolute; bottom: 274px; right: 12px; z-index: 800;
      width: 38px;
    }
    .map-reroute-btn {
      width: 38px; height: 34px; border: 1px solid var(--surface-200); border-radius: 0.75rem;
      background: #fff; color: var(--surface-600); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all .15s; box-shadow: var(--shadow-soft);
    }
    .map-reroute-btn:hover { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-200); }
    .map-reroute-btn:active { transform: scale(.92); }
    .map-reroute-btn svg { width: 18px; height: 18px; stroke-width: 2; }
    .map-reroute-btn.spinning svg { animation: spin 0.8s linear infinite; }

    /* ---- Import Modal ---- */
    .import-drop-zone {
      border: 2px dashed var(--surface-300); border-radius: var(--radius-lg);
      padding: 36px 24px; text-align: center; cursor: pointer;
      transition: all .2s; background: var(--surface-50);
    }
    .import-drop-zone:hover { border-color: var(--primary-400); background: var(--primary-50); }
    .import-drop-zone.dragover {
      border-color: var(--primary-500); background: var(--primary-100);
      transform: scale(1.01);
    }
    .import-drop-zone-icon {
      width: 56px; height: 56px; border-radius: 50%; background: var(--primary-100);
      display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
      color: var(--primary-600); transition: all .2s;
    }
    .import-drop-zone.dragover .import-drop-zone-icon { background: var(--primary-200); transform: scale(1.1); }
    .import-drop-zone-icon svg { width: 28px; height: 28px; }
    .import-drop-zone-title { font-size: 0.9375rem; font-weight: 600; color: var(--surface-700); margin-bottom: 6px; }
    .import-drop-zone-text { font-size: 0.8125rem; color: var(--surface-400); line-height: 1.5; }
    .import-drop-zone-formats { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
    .import-drop-zone-fmt { padding: 3px 10px; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 600; background: var(--surface-200); color: var(--surface-500); }

    .import-sidebar-zone {
      margin: 8px 4px; padding: 16px 20px;
      border: 2px dashed var(--surface-300); border-radius: var(--radius);
      text-align: center; cursor: pointer; transition: all .2s;
      display: flex; flex-direction: column; align-items: center; gap: 8px;
    }
    .import-sidebar-zone:hover { border-color: var(--primary-400); background: var(--primary-50); }
    .import-sidebar-zone.dragover { border-color: var(--primary-500); background: var(--primary-100); }
    .import-sidebar-zone svg { width: 24px; height: 24px; color: var(--surface-400); }
    .import-sidebar-zone:hover svg { color: var(--primary-500); }
    .import-sidebar-zone-title { font-size: 0.8125rem; font-weight: 600; color: var(--surface-600); }
    .import-sidebar-zone-text { font-size: 0.6875rem; color: var(--surface-400); line-height: 1.4; }

    /* ---- Import Loader Overlay ---- */
    .import-loader-overlay {
      position: fixed; inset: 0; z-index: 10001;
      display: flex; align-items: center; justify-content: center;
      background: rgba(0,0,0,.25); backdrop-filter: blur(4px);
      animation: ctxFadeIn .2s ease-out;
    }
    .import-loader-card {
      background: #fff; border-radius: var(--radius-lg);
      box-shadow: 0 12px 40px rgba(0,0,0,.15);
      padding: 28px 32px 24px; width: 320px; text-align: center;
      animation: ctxFadeIn .25s ease-out;
    }
    .import-loader-icon {
      width: 52px; height: 52px; border-radius: 50%;
      background: var(--primary-50); display: flex; align-items: center; justify-content: center;
      margin: 0 auto 16px; color: var(--primary-600); position: relative;
    }
    .import-loader-icon svg { width: 26px; height: 26px; }
    .import-loader-icon::after {
      content: ''; position: absolute; inset: -3px; border-radius: 50%;
      border: 2px solid var(--primary-200); border-top-color: var(--primary-500);
      animation: importSpin .8s linear infinite;
    }
    @keyframes importSpin { to { transform: rotate(360deg); } }
    .import-loader-title { font-size: 0.9375rem; font-weight: 700; color: var(--surface-800); margin-bottom: 4px; }
    .import-loader-text { font-size: 0.8125rem; color: var(--surface-400); margin-bottom: 16px; line-height: 1.4; }
    .import-loader-bar {
      width: 100%; height: 6px; background: var(--surface-200); border-radius: 3px;
      overflow: hidden; position: relative;
    }
    .import-loader-fill {
      height: 100%; width: 0%; border-radius: 3px;
      background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
      transition: width .2s ease-out;
    }
    .import-loader-percent { font-size: 0.75rem; font-weight: 600; color: var(--primary-600); margin-top: 8px; }

    /* ---- Cards ---- */
    .card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); border: 1px solid var(--surface-100); padding: 16px; }

    /* ---- Inputs ---- */
    .input {
      width: 100%; padding: 8px 12px; border: 1px solid var(--surface-200); border-radius: 0.75rem;
      background: #fff; color: var(--surface-800); font-size: 0.875rem; font-family: inherit;
      transition: all .2s;
    }
    .input:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--primary-300); }
    .input::placeholder { color: var(--surface-400); }
    textarea.input { resize: none; }

    /* ---- Buttons ---- */
    .btn {
      display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: none;
      border-radius: 0.75rem; font-size: 0.875rem; font-weight: 500; cursor: pointer;
      transition: all .2s; font-family: inherit;
    }
    .btn-primary { background: var(--primary-500); color: #fff; box-shadow: var(--shadow-soft); }
    .btn-primary:hover { background: var(--primary-600); }
    .btn-primary:disabled { opacity: .5; cursor: not-allowed; }
    .btn-secondary { background: var(--surface-100); color: var(--surface-700); }
    .btn-secondary:hover { background: var(--surface-200); }
    .btn-ghost { background: transparent; color: var(--surface-600); padding: 6px 12px; }
    .btn-ghost:hover { background: var(--surface-100); }
    .btn svg { width: 16px; height: 16px; }

    /* ---- Sortable Points ---- */
    .points-list { display: flex; flex-direction: column; gap: 10px; }
    .points-list::-webkit-scrollbar { width: 6px; }
    .points-list::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 3px; }

    /* ---- Segment Blocks ---- */
    .seg-block { border-radius: var(--radius); border: 1px solid var(--surface-200); overflow: hidden; background: #fff; }
    .seg-block.dragging { opacity: .4; }
    .seg-block.drag-over-top { border-top: 3px solid var(--primary-500); }
    .seg-block.drag-over-bottom { border-bottom: 3px solid var(--primary-500); }
    .seg-block-header {
      display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; cursor: pointer;
      background: var(--surface-50); border-bottom: 1px solid var(--surface-100);
      transition: background .15s;
    }
    .seg-block-header:hover { background: var(--surface-100); }
    .seg-block-header-top { display: flex; align-items: center; gap: 8px; }
    .seg-block-header-bottom { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-left: 22px; }
    .seg-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; cursor: pointer; border: 2px solid rgba(255,255,255,.6); box-shadow: 0 0 0 1px var(--surface-300); transition: box-shadow .15s; }
    .seg-color-dot:hover { box-shadow: 0 0 0 2px var(--primary-400); }
    .seg-block-title {
      flex: 1; min-width: 0; border: none; background: transparent; font-size: 0.85rem; font-weight: 600;
      color: var(--surface-800); font-family: inherit; padding: 2px 4px; border-radius: 4px;
    }
    .seg-block-title:focus { outline: none; background: #fff; box-shadow: 0 0 0 1px var(--surface-200); }
    .seg-block-count { font-size: 0.8125rem; color: var(--surface-400); flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
    .seg-leg-summary { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--surface-600); font-weight: 600; }
    .seg-leg-summary svg { width: 16px; height: 16px; color: var(--primary-400); flex-shrink: 0; }
    .seg-block-toggle { background: none; border: none; cursor: pointer; color: var(--surface-400); padding: 2px; transition: color .15s; }
    .seg-block-toggle:hover { color: var(--surface-600); }
    .seg-block-toggle svg { width: 16px; height: 16px; transition: transform .2s; }
    .seg-block.collapsed .seg-block-toggle svg { transform: rotate(-90deg); }
    .seg-block-body { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
    .seg-block.collapsed .seg-block-body { display: none; }
    .seg-block-add-pt {
      display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; margin: 4px 8px 8px;
      border: 1px dashed var(--surface-300); border-radius: 0.5rem; background: none; cursor: pointer;
      font-size: 0.75rem; color: var(--surface-400); transition: all .15s; font-family: inherit;
    }
    .seg-block-add-pt:hover { border-color: var(--primary-400); color: var(--primary-600); background: var(--primary-50); }
    .seg-block-add-pt svg { width: 14px; height: 14px; }
    .seg-remove-btn { background: none; border: none; color: var(--surface-400); cursor: pointer; padding: 2px; border-radius: 4px; transition: all .15s; flex-shrink: 0; }
    .seg-remove-btn:hover { color: #ef4444; background: #fef2f2; }
    .seg-remove-btn svg { width: 14px; height: 14px; }

    .seg-start-card {
      display: flex; align-items: center; gap: 8px; padding: 7px 10px;
      background: var(--surface-50); border: 1px dashed var(--surface-300);
      border-radius: 0.75rem; cursor: pointer; transition: all .15s; user-select: none;
    }
    .seg-start-card:hover { border-color: var(--primary-400); background: var(--primary-50); }
    .seg-start-num {
      width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: 0.8125rem;
    }
    .seg-start-info { min-width: 0; flex: 1; }
    .seg-start-title { font-size: 0.8125rem; font-weight: 600; color: var(--surface-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .seg-start-sub { display: flex; align-items: center; gap: 4px; font-size: 0.6875rem; color: var(--surface-400); margin-top: 1px; }
    .seg-start-sub svg { width: 11px; height: 11px; flex-shrink: 0; }

    .color-picker { position: absolute; z-index: 1000; background: #fff; border: 1px solid var(--surface-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 180px; }
    .color-swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--surface-200); transition: transform .15s; }
    .color-swatch:hover { transform: scale(1.2); }
    .color-swatch.selected { box-shadow: 0 0 0 2px var(--primary-500); }

    .point-item {
      display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 12px; background: #fff;
      border-radius: 0.75rem; border: 1px solid var(--surface-200); box-shadow: var(--shadow-soft);
      transition: opacity .15s, box-shadow .2s, transform .15s ease;
      position: relative;
    }
    .point-item.dragging { display: none; }
    .point-item { user-select: none; }

    .point-ghost {
      position: fixed; z-index: 9999; pointer-events: none; opacity: 0;
      display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px;
      background: linear-gradient(135deg, #fff 60%, #f8f7f5 100%);
      border-radius: 8px 8px 10px 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
      transform: rotate(-2deg) scale(1.03); transition: opacity .1s;
      max-width: 320px;
    }
    .point-ghost.visible { opacity: .92; }
    .point-ghost-num {
      width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      color: #fff; font-weight: 700; font-size: 0.875rem;
    }
    .point-ghost-title { font-size: 0.875rem; font-weight: 500; color: var(--surface-800); padding-top: 4px; }
    .point-ghost::after {
      content: ''; position: absolute; bottom: 0; right: 0; width: 18px; height: 18px;
      background: linear-gradient(225deg, transparent 50%, rgba(0,0,0,.06) 50%, rgba(0,0,0,.1) 100%);
      border-bottom-right-radius: 10px;
    }
    .point-ghost::before {
      content: ''; position: absolute; bottom: 0; left: 0; width: 14px; height: 14px;
      background: linear-gradient(315deg, transparent 50%, rgba(0,0,0,.04) 50%);
      border-bottom-left-radius: 8px;
    }

    .point-placeholder {
      border-radius: 0.75rem; border: 2px dashed var(--primary-400);
      background: var(--primary-50); box-sizing: border-box;
    }

    .point-number { cursor: grab; transition: transform .1s; }
    .point-number:active { cursor: grabbing; transform: scale(1.1); }

    .drag-handle { cursor: grab; color: var(--surface-400); padding-top: 6px; }
    .drag-handle:active { cursor: grabbing; }
    .drag-handle svg { width: 20px; height: 20px; }

    .point-number {
      display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
      border-radius: 50%; background: var(--primary-100); color: var(--primary-700);
      font-weight: 700; font-size: 0.875rem; flex-shrink: 0;
    }
    .point-content { flex: 1; min-width: 0; }
    .point-title-input {
      width: 100%; padding: 4px 8px; font-size: 0.875rem; font-weight: 500; color: var(--surface-800);
      background: transparent; border: 1px solid transparent; border-radius: 0.5rem; font-family: inherit;
    }
    .point-title-input:hover { border-color: var(--surface-200); }
    .point-title-input:focus { outline: none; border-color: var(--primary-300); box-shadow: 0 0 0 1px var(--primary-200); }

    .segment-toggle { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
    .seg-btn {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 3px 10px; border: none; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 500;
      cursor: pointer; transition: all .2s; font-family: inherit;
    }
    .seg-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
    .seg-btn.active { background: var(--primary-500); color: #fff; }
    .seg-btn.seg-btn-foot.active { background: #059669; }
    .seg-btn.seg-btn-direct.active { background: #d97706; }
    .seg-btn:not(.active) { background: var(--surface-100); color: var(--surface-500); }
    .seg-btn:not(.active):hover { background: var(--surface-200); color: var(--surface-700); }

    .point-coords { font-size: 0.75rem; color: var(--surface-400); margin-top: 0; display: flex; align-items: center; gap: 6px; flex-basis: 100%; width: 100%; }
    .pt-coords-left { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
    .pt-coords-copy {
      display: flex; align-items: center; gap: 5px; padding: 2px 6px 2px 8px;
      border: 1px solid var(--surface-200); border-radius: 0.375rem; cursor: pointer;
      transition: all .15s; color: var(--surface-500); background: var(--surface-50);
      flex-shrink: 0; white-space: nowrap;
    }
    .pt-coords-copy:hover { border-color: var(--primary-300); color: var(--primary-600); background: var(--primary-50); }
    .pt-coords-copy svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .5; }
    .pt-coords-copy:hover svg { opacity: .8; }
    .pt-coords-copy.copied { border-color: var(--primary-500); color: var(--primary-600); background: var(--primary-50); }
    .pt-locate-btn {
      display: flex; align-items: center; gap: 5px; padding: 2px 8px;
      border: 1px solid var(--surface-200); border-radius: 0.375rem; cursor: pointer;
      transition: all .15s; color: var(--surface-500); background: var(--surface-50);
      flex-shrink: 0; font-size: 0.75rem; font-weight: 500; white-space: nowrap;
    }
    .pt-locate-btn:hover { border-color: var(--primary-300); color: var(--primary-600); background: var(--primary-50); }
    .pt-locate-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

    .toast {
      position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
      background: var(--surface-800); color: #fff; font-size: 0.8125rem; font-weight: 500;
      padding: 10px 18px; border-radius: 0.625rem; box-shadow: 0 6px 20px rgba(0,0,0,.2);
      z-index: 10001; pointer-events: none; opacity: 0; transition: opacity .2s, transform .25s;
    }
    .toast.visible { opacity: 1; transform: translateX(-50%) translateY(-4px); }
    .point-remove {
      background: none; border: none; padding: 6px; color: var(--surface-400); cursor: pointer;
      border-radius: 0.5rem; transition: all .2s; flex-shrink: 0;
    }
    .point-remove:hover { color: #ef4444; background: #fef2f2; }
    .point-remove svg { width: 16px; height: 16px; }

    .point-badges { display: flex; gap: 3px; margin-top: 4px; padding-left: 2px; }
    .pt-badge { display: flex; align-items: center; gap: 2px; padding: 2px 5px; border-radius: 0.375rem; font-size: 0.6875rem; color: var(--surface-500); background: var(--surface-100); }
    .pt-badge svg { width: 11px; height: 11px; }
    .pt-badge-count { font-weight: 600; line-height: 1; }

    .pt-date-btn {
      background: none; border: none; padding: 3px 6px; color: var(--surface-400);
      cursor: pointer; border-radius: 0.375rem; transition: all .15s; display: flex;
      align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 500;
      flex-direction: row-reverse; flex-shrink: 0; white-space: nowrap; margin-left: auto;
    }
    .pt-date-btn svg { width: 16px; height: 16px; }
    .pt-date-btn.has-date { color: var(--primary-600); background: var(--primary-50); }
    .pt-date-btn.has-date:hover { background: var(--primary-100); }

    /* ---- Sidebar Tabs ---- */
    .sidebar-tabs {
      display: flex; gap: 4px; padding: 3px;
      background: var(--surface-100); border-radius: 0.625rem;
    }
    .sidebar-tab {
      flex: 1; padding: 7px 10px; border: none; border-radius: 0.5rem;
      font-size: 0.8125rem; font-weight: 500; cursor: pointer;
      transition: all .2s; font-family: inherit;
      background: transparent; color: var(--surface-500);
    }
    .sidebar-tab.active {
      background: #fff; color: var(--surface-800);
      box-shadow: var(--shadow-soft); font-weight: 600;
    }
    .sidebar-tab:not(.active):hover { color: var(--surface-700); }

    /* ---- Schedule View ---- */
    .schedule-view { display: flex; flex-direction: column; gap: 12px; }
    .sched-date-group {
      border: 1px solid var(--surface-200);
      border-radius: 0.75rem; overflow: hidden;
    }
    .sched-date-header {
      padding: 9px 12px; background: var(--surface-50);
      font-size: 0.8125rem; font-weight: 600; color: var(--surface-700);
      display: flex; align-items: center; gap: 8px;
      border-bottom: 1px solid var(--surface-100);
    }
    .sched-date-header svg { width: 14px; height: 14px; color: var(--primary-500); flex-shrink: 0; }
    .sched-date-stats {
      margin-left: auto; font-size: 0.6875rem; font-weight: 500;
      color: var(--surface-400); white-space: nowrap;
    }
    .sched-body { padding: 4px; }
    .sched-row {
      display: flex; align-items: flex-start; gap: 8px;
      padding: 8px 10px; border-radius: 0.5rem;
      transition: background .15s; cursor: pointer; position: relative;
    }
    .sched-row:hover { background: var(--surface-50); }
    .sched-num {
      width: 26px; height: 26px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: 0.75rem; flex-shrink: 0;
    }
    .sched-content { flex: 1; min-width: 0; }
    .sched-title {
      font-size: 0.8125rem; font-weight: 500; color: var(--surface-800);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .sched-meta {
      display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap;
    }
    .sched-seg-badge {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 1px 6px; border-radius: 0.25rem;
      font-size: 0.6875rem; font-weight: 500; color: var(--surface-600);
      background: var(--surface-100);
    }
    .sched-seg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .sched-coords { font-size: 0.6875rem; color: var(--surface-400); }
    .sched-leg {
      display: flex; align-items: center; gap: 6px;
      padding: 3px 10px 3px 44px;
      font-size: 0.6875rem; color: var(--surface-400);
    }
    .sched-leg svg { width: 12px; height: 12px; flex-shrink: 0; }
    .sched-leg-line { flex: 1; height: 1px; background: var(--surface-200); margin: 0 4px; min-width: 12px; }
    .sched-empty {
      padding: 32px 16px; text-align: center;
      color: var(--surface-400); font-size: 0.8125rem; line-height: 1.5;
    }
    .sched-day-footer {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      padding: 8px 12px; border-top: 1px solid var(--surface-100);
      background: var(--surface-50); border-radius: 0 0 0.625rem 0.625rem;
    }
    .sched-day-footer-label {
      font-size: 0.6875rem; font-weight: 600; color: var(--surface-400);
      text-transform: uppercase; letter-spacing: 0.04em;
    }
    .sched-stat-pill {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 2px 8px; border-radius: 0.25rem;
      font-size: 0.6875rem; font-weight: 600;
      background: var(--surface-100); color: var(--surface-600);
    }
    .sched-stat-pill svg { width: 11px; height: 11px; flex-shrink: 0; }
    .sched-stat-pill.foot { color: var(--primary-600); background: var(--primary-50); }
    .sched-stat-pill.overnight { color: #6366f1; background: rgba(99,102,241,0.08); }
    .sched-stat-pill.total { background: var(--primary-100); color: var(--primary-700); }
    .sched-overnight {
      display: flex; align-items: center; gap: 6px;
      padding: 6px 10px 6px 44px;
      font-size: 0.6875rem; color: var(--surface-500);
      background: linear-gradient(90deg, rgba(99,102,241,0.06), transparent 80%);
      border-radius: 0.375rem; margin: 2px 4px;
    }
    .sched-overnight svg { width: 13px; height: 13px; flex-shrink: 0; color: #6366f1; }
    .sched-overnight-text { font-weight: 500; }
    .sched-overnight-text strong { font-weight: 600; color: var(--surface-600); }
    .sched-overnight-leg {
      display: flex; align-items: center; gap: 6px; margin-left: auto;
      font-size: 0.6875rem; color: var(--surface-400); white-space: nowrap;
    }
    .sched-overnight-leg svg { width: 12px; height: 12px; flex-shrink: 0; }
    .sched-overnight-leg .sched-leg-line { flex: 1; height: 1px; background: var(--surface-200); margin: 0 4px; min-width: 12px; }
    .sched-connector {
      margin-left: 44px; width: 2px; height: 10px;
      background: var(--surface-200); border-radius: 1px;
    }
    .sched-grand-total {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      padding: 12px 14px; margin-top: 4px;
      background: linear-gradient(135deg, var(--primary-50) 0%, var(--surface-50) 100%);
      border: 1px solid var(--primary-100); border-radius: 0.75rem;
    }
    .sched-grand-total-label {
      font-size: 0.75rem; font-weight: 700; color: var(--primary-700);
      text-transform: uppercase; letter-spacing: 0.04em;
    }
    .sched-grand-total .sched-stat-pill { background: #fff; border: 1px solid var(--primary-100); }

    .dp-overlay {
      position: fixed; z-index: 9999; background: rgba(0,0,0,.15);
      animation: ctxFadeIn .1s ease-out;
    }
    .dp-popup {
      position: absolute; z-index: 10000; background: #fff; border: 1px solid var(--surface-100);
      border-radius: 0.75rem; box-shadow: var(--shadow-lg); padding: 12px; width: 260px;
      animation: ctxFadeIn .12s ease-out;
    }
    .dp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
    .dp-nav-btn {
      background: none; border: none; padding: 4px; color: var(--surface-500); cursor: pointer;
      border-radius: 0.375rem; transition: all .15s; display: flex; align-items: center; justify-content: center;
    }
    .dp-nav-btn:hover { background: var(--surface-100); color: var(--surface-700); }
    .dp-nav-btn svg { width: 16px; height: 16px; }
    .dp-title { font-size: 0.8125rem; font-weight: 600; color: var(--surface-700); }
    .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
    .dp-dow { display: flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 600; color: var(--surface-400); text-transform: uppercase; padding: 4px 0; }
    .dp-day {
      display: flex; align-items: center; justify-content: center; font-size: 0.75rem; cursor: pointer;
      border-radius: 0.375rem; aspect-ratio: 1; transition: all .1s; color: var(--surface-700);
    }
    .dp-day:hover { background: var(--primary-50); color: var(--primary-600); }
    .dp-day.other-month { color: var(--surface-300); }
    .dp-day.today { font-weight: 600; color: var(--primary-500); border: 1.5px solid var(--primary-300); }
    .dp-day.selected { background: var(--primary-500); color: #fff; font-weight: 600; border: none; }
    .dp-day.selected:hover { background: var(--primary-600); color: #fff; }
    .dp-day.today.selected { background: var(--primary-500); color: #fff; border: 1.5px solid var(--primary-300); box-shadow: inset 0 0 0 1.5px #fff; }
    .dp-footer { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--surface-100); }
    .dp-clear, .dp-today {
      flex: 1; padding: 6px 10px; border: none; border-radius: 0.375rem; font-size: 0.75rem;
      font-weight: 500; cursor: pointer; transition: all .15s;
    }
    .dp-clear { background: var(--surface-100); color: var(--surface-500); }
    .dp-clear:hover { background: var(--surface-200); color: var(--surface-700); }
    .dp-today { background: var(--primary-50); color: var(--primary-600); }
    .dp-today:hover { background: var(--primary-100); }

    /* ---- Route Leg Info (sidebar connector) ---- */
    .leg-info { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 3px 12px; font-size: 0.8125rem; color: var(--surface-500); }
    .leg-info svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--primary-400); }
    .leg-info-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--surface-300); flex-shrink: 0; }
    .leg-info-text { white-space: nowrap; font-weight: 500; }
    .leg-info-foot svg { color: var(--surface-400) !important; }

    /* ---- Route Leg Tooltip (map) ---- */
    .route-leg-tooltip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.82); backdrop-filter: blur(4px); font-size: 0.8125rem; font-weight: 500; color: var(--surface-700); box-shadow: 0 1px 4px rgba(0,0,0,.08); pointer-events: none; white-space: nowrap; line-height: 1.4; }
    .route-leg-tooltip svg { width: 14px; height: 14px; color: var(--primary-500); flex-shrink: 0; }
    .route-leg-tooltip .leg-sep { color: var(--surface-300); flex-shrink: 0; }
    .route-leg-tooltip-wrap { width: auto !important; height: auto !important; }

    /* ---- Map ---- */
    .leaflet-container { height: 100%; width: 100%; z-index: 0; background: var(--surface-100); }
    .leaflet-top, .leaflet-bottom { z-index: 0; }

    .custom-marker-number {
      display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
      border-radius: 50%; background: var(--primary-500); color: #fff; font-weight: 700; font-size: 14px;
      border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25);
    }
    .custom-marker-label {
      position: absolute; left: 38px; top: 50%; transform: translateY(-50%);
      white-space: nowrap; padding: 3px 8px; border-radius: 6px;
      background: rgba(255,255,255,.82); backdrop-filter: blur(4px);
      font-size: 0.75rem; font-weight: 500; color: var(--surface-700);
      box-shadow: 0 1px 4px rgba(0,0,0,.08); pointer-events: none;
      max-width: 160px; overflow: hidden; text-overflow: ellipsis;
    }
    .custom-marker-place {
      display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
      border-radius: 50%; background: var(--accent-500); color: #fff; font-size: 14px;
      border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25);
    }
    .via-marker-wrap { pointer-events: auto; cursor: grab; }
    .via-marker-wrap:active { cursor: grabbing; }
    .via-marker {
      width: 14px; height: 14px; border-radius: 50%;
      border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
      opacity: 0.85; transition: transform .1s;
    }
    .via-marker:hover { transform: scale(1.25); opacity: 1; }
    .via-popup .leaflet-popup-content-wrapper { padding: 4px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
    .via-popup .leaflet-popup-content { margin: 0; }
    .via-delete-btn {
      display: flex; align-items: center; gap: 6px; padding: 8px 14px;
      border: none; border-radius: 8px; background: #fef2f2; color: #dc2626;
      font-size: 0.8125rem; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap;
    }
    .via-delete-btn svg { width: 14px; height: 14px; }
    .via-delete-btn:hover { background: #fee2e2; }

    /* ---- Catalog ---- */
    .catalog-view { flex: 1; overflow-y: auto; padding: 24px; width: 100%; }

    /* ---- Route Catalog Cards ---- */
    .route-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--surface-100); box-shadow: var(--shadow-soft); overflow: hidden; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; }
    .route-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-200); transform: translateY(-2px); }
    .route-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
    .route-card-title { font-size: 1rem; font-weight: 600; color: var(--surface-800); }
    .route-card-desc { font-size: 0.8125rem; color: var(--surface-500); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .route-card-stats { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
    .route-card-stat { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--surface-400); }
    .route-card-stat svg { width: 13px; height: 13px; color: var(--primary-400); }
    .route-card-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
    .route-card-actions .btn { flex: 1; justify-content: center; font-size: 0.8125rem; }
    .route-card-date { font-size: 0.6875rem; color: var(--surface-400); }
    .catalog-view::-webkit-scrollbar { width: 8px; }
    .catalog-view::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 4px; }

    .catalog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
    .catalog-title { display: flex; align-items: center; gap: 8px; }
    .catalog-title h2 { font-size: 1.5rem; font-weight: 700; color: var(--surface-800); }
    .catalog-title span { color: var(--surface-400); font-size: 0.875rem; }
    .catalog-title svg { width: 24px; height: 24px; color: var(--primary-600); }

    .catalog-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
    .catalog-filter { display: flex; gap: 4px; padding: 3px; background: var(--surface-100); border-radius: 0.625rem; }
    .catalog-filter-btn { padding: 6px 14px; border: none; background: none; border-radius: 0.5rem; font-size: 0.8125rem; font-family: inherit; color: var(--surface-500); cursor: pointer; transition: all .2s; font-weight: 500; }
    .catalog-filter-btn:hover { color: var(--surface-700); }
    .catalog-filter-btn.active { background: #fff; color: var(--primary-600); box-shadow: var(--shadow-soft); }
    .search-wrapper { position: relative; flex: 1; max-width: 400px; }
    .search-wrapper svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--surface-400); }
    .search-wrapper input { padding-left: 36px; }

    .places-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

    .place-card {
      background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); border: 1px solid var(--surface-100);
      overflow: hidden; cursor: pointer; transition: box-shadow .2s; text-align: left; border: 1px solid var(--surface-100);
    }
    .place-card:hover { box-shadow: var(--shadow-lg); }
    .place-card-img { height: 192px; background: var(--surface-100); overflow: hidden; }
    .place-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
    .place-card:hover .place-card-img img { transform: scale(1.05); }
    .place-card-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
    .place-card-img-placeholder svg { width: 48px; height: 48px; color: var(--surface-300); }
    .place-card-body { padding: 16px; }
    .place-card-body h3 { font-size: 1rem; font-weight: 600; color: var(--surface-800); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .place-card-author { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--surface-500); margin-bottom: 8px; }
    .place-card-author svg { width: 14px; height: 14px; }
    .place-card-desc { font-size: 0.875rem; color: var(--surface-500); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

    /* ---- Stars ---- */
    .stars { display: flex; align-items: center; gap: 2px; }
    .stars .star { cursor: default; }
    .stars.interactive .star { cursor: pointer; }
    .star svg { width: 20px; height: 20px; }
    .star.sm svg { width: 14px; height: 14px; }
    .star.lg svg { width: 24px; height: 24px; }
    .star.filled svg { color: var(--accent-400); fill: var(--accent-400); }
    .star.empty svg { color: var(--surface-300); fill: var(--surface-200); }
    .stars-count { font-size: 0.875rem; color: var(--surface-400); margin-left: 4px; }

    /* ---- Place Detail ---- */
    .place-detail { flex: 1; overflow-y: auto; padding: 24px; width: 100%; }
    .place-detail::-webkit-scrollbar { width: 8px; }
    .place-detail::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 4px; }
    .detail-back { margin-bottom: 16px; }
    .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
    .detail-gallery { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid var(--surface-100); margin-bottom: 16px; position: relative; }
    .detail-gallery-main { height: 320px; background: var(--surface-100); position: relative; }
    .detail-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
    .detail-gallery-main .placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
    .detail-gallery-main .placeholder svg { width: 64px; height: 64px; color: var(--surface-300); }
    .gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.8); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-soft); transition: background .2s; }
    .gallery-nav:hover { background: #fff; }
    .gallery-nav svg { width: 20px; height: 20px; color: var(--surface-700); }
    .gallery-nav.prev { left: 8px; }
    .gallery-nav.next { right: 8px; }
    .gallery-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
    .gallery-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.6); transition: background .2s; }
    .gallery-dot.active { background: var(--primary-500); }
    .gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
    .gallery-thumbs::-webkit-scrollbar { height: 6px; }
    .gallery-thumbs::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 3px; }
    .gallery-thumb { flex-shrink: 0; width: 80px; height: 80px; border-radius: 0.75rem; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: none; padding: 0; }
    .gallery-thumb.active { border-color: var(--primary-500); }
    .gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

    .detail-info h1 { font-size: 1.5rem; font-weight: 700; color: var(--surface-800); margin-bottom: 8px; }
    .detail-author { display: flex; align-items: center; gap: 8px; color: var(--surface-500); margin-bottom: 12px; font-size: 0.875rem; }
    .detail-author svg { width: 16px; height: 16px; }
    .detail-rating-row { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
    .detail-description { color: var(--surface-600); line-height: 1.6; margin-bottom: 16px; }
    .detail-coords { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--surface-400); margin-bottom: 16px; }
    .detail-coords svg { width: 16px; height: 16px; }
    .detail-map { height: 192px; border-radius: 0.75rem; overflow: hidden; }

    .detail-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
    .detail-section-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--surface-800); margin-bottom: 16px; }
    .detail-section-title svg { width: 20px; height: 20px; }
    .detail-section-title.accent svg { color: var(--accent-400); }
    .detail-section-title.primary svg { color: var(--primary-500); }

    .comment-item { padding: 12px; background: var(--surface-50); border-radius: 0.75rem; }
    .comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
    .comment-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-100); display: flex; align-items: center; justify-content: center; }
    .comment-avatar svg { width: 14px; height: 14px; color: var(--primary-600); }
    .comment-author { font-size: 0.875rem; font-weight: 500; color: var(--surface-700); }
    .comment-date { font-size: 0.75rem; color: var(--surface-400); }
    .comment-text { font-size: 0.875rem; color: var(--surface-600); padding-left: 32px; }

    .comment-form { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
    .comment-form-row { display: flex; gap: 8px; }

    .rating-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--surface-100); font-size: 0.875rem; color: var(--surface-600); }
    .rating-row:last-child { border: none; }

    .empty-state { text-align: center; padding: 80px 20px; color: var(--surface-400); }
    .empty-state svg { width: 64px; height: 64px; color: var(--surface-200); margin-bottom: 16px; }

    /* ---- Modal ---- */
    .modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.3); backdrop-filter: blur(4px); padding: 16px; }
    .modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; }
    .modal::-webkit-scrollbar { width: 6px; }
    .modal::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 3px; }
    .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--surface-100); position: sticky; top: 0; background: #fff; border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 10; }
    .modal-header h2 { font-size: 1.125rem; font-weight: 600; color: var(--surface-800); }
    .modal-close { background: none; border: none; padding: 8px; color: var(--surface-400); cursor: pointer; border-radius: 0.5rem; transition: all .2s; }
    .modal-close:hover { color: var(--surface-600); background: var(--surface-100); }
    .modal-close svg { width: 20px; height: 20px; }
    .modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
    .modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 20px; border-top: 1px solid var(--surface-100); position: sticky; bottom: 0; background: #fff; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

    /* ---- Point Detail Modal ---- */
    .pt-modal { max-width: 720px; }
    .pt-section-label { font-size: 0.6875rem; font-weight: 600; color: var(--surface-400); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
    .pt-photo-upload { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
    .pt-photo-thumb { position: relative; width: 80px; height: 80px; border-radius: 0.75rem; overflow: hidden; border: 1px solid var(--surface-200); }
    .pt-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .pt-photo-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.5); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1; }
    .pt-photo-remove:hover { background: rgba(0,0,0,.7); }
    .pt-photo-add { width: 80px; height: 80px; border-radius: 0.75rem; border: 2px dashed var(--surface-200); background: var(--surface-50); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--surface-400); transition: all .2s; }
    .pt-photo-add:hover { border-color: var(--primary-300); color: var(--primary-500); background: var(--primary-50); }
    .pt-photo-add svg { width: 24px; height: 24px; }
    .pt-desc { width: 100%; padding: 10px 12px; border: 1px solid var(--surface-200); border-radius: 0.75rem; font-size: 0.875rem; font-family: inherit; resize: vertical; min-height: 80px; background: #fff; transition: all .2s; }
    .pt-desc:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--primary-300); }
    .pt-comment-item { padding: 12px; background: var(--surface-50); border-radius: 0.75rem; }
    .pt-comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
    .pt-comment-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-100); color: var(--primary-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .pt-comment-avatar svg { width: 16px; height: 16px; }
    .pt-comment-author { font-size: 0.8125rem; font-weight: 600; color: var(--surface-700); }
    .pt-comment-date { font-size: 0.75rem; color: var(--surface-400); }
    .pt-comment-text { font-size: 0.875rem; color: var(--surface-700); margin: 0; line-height: 1.5; }
    .pt-comment-form { display: flex; flex-direction: column; gap: 8px; }
    .pt-comment-row { display: flex; gap: 8px; }

    /* ---- Confirm Dialog ---- */
    .confirm-icon { width: 48px; height: 48px; border-radius: 50%; background: #fef2f2; color: #ef4444; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
    .confirm-icon svg { width: 24px; height: 24px; }
    .confirm-title { font-size: 1.125rem; font-weight: 600; color: var(--surface-800); text-align: center; margin-bottom: 8px; }
    .confirm-text { font-size: 0.875rem; color: var(--surface-500); text-align: center; margin-bottom: 4px; }
    .btn-danger { background: #ef4444; color: #fff; border: none; }
    .btn-danger:hover { background: #dc2626; }
    .pt-catalog-wrap { position: relative; }
    .pt-catalog-panel {
      position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 2100;
      background: #fff; border: 1px solid var(--surface-100); border-radius: 0.75rem;
      box-shadow: var(--shadow-lg); padding: 4px; min-width: 200px;
      animation: ctxFadeIn .12s ease-out;
    }
    .pt-catalog-option {
      display: flex; align-items: center; gap: 8px; padding: 8px 10px;
      border-radius: 0.5rem; font-size: 0.8125rem; cursor: pointer; transition: background .15s; color: var(--surface-700);
    }
    .pt-catalog-option:hover { background: var(--primary-50); }
    .pt-catalog-option svg { width: 16px; height: 16px; color: var(--primary-500); flex-shrink: 0; }
    .pt-catalog-option-title { font-weight: 600; }
    .pt-catalog-option-desc { font-size: 0.6875rem; color: var(--surface-400); font-weight: 400; }
    .form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--surface-600); margin-bottom: 4px; }
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .photo-thumb { position: relative; width: 80px; height: 80px; border-radius: 0.75rem; overflow: hidden; }
    .photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .photo-thumb-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
    .photo-thumb:hover .photo-thumb-remove { opacity: 1; }
    .photo-thumb-remove svg { width: 14px; height: 14px; }
    .photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
    .mini-map { height: 224px; border-radius: 0.75rem; overflow: hidden; border: 1px solid var(--surface-200); }

    .hidden { display: none !important; }
    .text-center { text-align: center; }
    .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mt-4 { margin-top: 16px; }

    /* ---- Map Context Menu ---- */
    .map-context-menu {
      position: absolute; z-index: 2000; min-width: 260px;
      background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
      border: 1px solid var(--surface-100); padding: 16px;
      animation: ctxFadeIn .15s ease-out;
    }
    @keyframes ctxFadeIn {
      from { opacity: 0; transform: scale(.95) translateY(-4px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    .ctx-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
    .ctx-header svg { width: 16px; height: 16px; color: var(--primary-600); }
    .ctx-header span { font-size: 0.8125rem; font-weight: 600; color: var(--surface-700); }
    .ctx-input { width: 100%; padding: 8px 12px; border: 1px solid var(--surface-200); border-radius: 0.75rem; font-size: 0.875rem; font-family: inherit; margin-bottom: 8px; transition: all .2s; background: #fff; }
    .ctx-input:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--primary-300); }
    .ctx-seg-row { margin-bottom: 12px; }
    .ctx-seg-label { font-size: 0.6875rem; font-weight: 600; color: var(--surface-400); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
    .ctx-seg-trigger {
      width: 100%; padding: 9px 36px 9px 34px; border: 1px solid var(--surface-200);
      border-radius: 0.75rem; font-size: 0.875rem; font-family: inherit; background: #fff;
      cursor: pointer; transition: all .2s; position: relative; text-align: left;
      display: flex; align-items: center; gap: 8px;
    }
    .ctx-seg-trigger:hover { border-color: var(--surface-300); }
    .ctx-seg-trigger.open { border-color: transparent; box-shadow: 0 0 0 2px var(--primary-300); }
    .ctx-seg-trigger .ctx-seg-dot {
      position: static; transform: none; flex-shrink: 0;
      width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0,0,0,.04);
    }
    .ctx-seg-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--surface-400); }
    .ctx-seg-arrow svg { width: 14px; height: 14px; }
    .ctx-seg-panel {
      position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 2100;
      background: #fff; border: 1px solid var(--surface-100); border-radius: 0.75rem;
      box-shadow: var(--shadow-lg); padding: 4px; max-height: 220px; overflow-y: auto;
      animation: ctxFadeIn .12s ease-out;
    }
    .ctx-seg-option {
      display: flex; align-items: center; gap: 8px; padding: 8px 10px;
      border-radius: 0.5rem; font-size: 0.875rem; cursor: pointer; transition: background .15s;
    }
    .ctx-seg-option:hover { background: var(--primary-50); }
    .ctx-seg-option.selected { background: var(--primary-50); font-weight: 600; }
    .ctx-seg-option .ctx-seg-dot { position: static; transform: none; flex-shrink: 0; }
    .ctx-seg-option-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ctx-actions { display: flex; gap: 8px; }
    .ctx-actions .btn { flex: 1; justify-content: center; font-size: 0.8125rem; padding: 7px 12px; }
    .ctx-coords { font-size: 0.75rem; color: var(--surface-400); text-align: center; margin-bottom: 10px; }

    @media (max-width: 1024px) {
      .detail-grid, .detail-bottom-grid { grid-template-columns: 1fr; }
    }
    .route-picker-popup {
      position: fixed; z-index: 3000; min-width: 280px; max-width: 360px;
      background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
      border: 1px solid var(--surface-100); padding: 12px;
      animation: ctxFadeIn .15s ease-out;
    }
    .route-picker-title { font-size: 0.8125rem; font-weight: 600; color: var(--surface-700); padding: 0 4px 8px; border-bottom: 1px solid var(--surface-100); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
    .route-picker-title svg { width: 14px; height: 14px; color: var(--primary-600); }
    .route-picker-item {
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      padding: 9px 10px; border-radius: 0.5rem; font-size: 0.875rem; cursor: pointer;
      transition: background .15s; color: var(--surface-700);
    }
    .route-picker-item:hover { background: var(--primary-50); color: var(--primary-700); }
    .route-picker-item.active { background: var(--primary-100); color: var(--primary-700); font-weight: 600; }
    .route-picker-item-meta { font-size: 0.75rem; color: var(--surface-400); white-space: nowrap; }
    .route-picker-sep { height: 1px; background: var(--surface-100); margin: 6px 0; }
    .route-picker-new {
      display: flex; align-items: center; gap: 6px;
      padding: 6px 10px; border-radius: 0.5rem; font-size: 0.75rem; font-weight: 600;
      cursor: pointer; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6);
      box-shadow: 0 2px 8px rgba(99,102,241,.3); transition: all .2s;
      position: relative; overflow: hidden;
    }
    .route-picker-new svg { width: 13px; height: 13px; }
    .route-picker-new:hover {
      background: linear-gradient(135deg, #4f46e5, #7c3aed);
      box-shadow: 0 4px 14px rgba(99,102,241,.45);
      transform: translateY(-1px);
    }
    .route-picker-new::before {
      content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
      animation: pickerShimmer 2.5s ease-in-out infinite;
    }
    @keyframes pickerShimmer {
      0% { left: -100%; }
      60%, 100% { left: 100%; }
    }
    .route-picker-empty { padding: 16px 10px; text-align: center; font-size: 0.8125rem; color: var(--surface-400); }
    .route-picker-list { max-height: 260px; overflow-y: auto; }
    .route-picker-list::-webkit-scrollbar { width: 5px; }
    .route-picker-list::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: 3px; }
    .route-picker-seg-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
    @media (max-width: 768px) {
      .route-planner { flex-direction: column; }
      .route-sidebar { width: 100%; max-height: 300px; }
      .form-row { grid-template-columns: 1fr; }
    }

    /* ---- Tutorial Section ---- */
    .tutorial-section {
      padding: 56px 48px 40px;
      background: var(--surface-50);
      flex-shrink: 0;
    }
    .tutorial-header {
      text-align: center;
      max-width: 560px;
      margin: 0 auto 36px;
    }
    .tutorial-header h2 {
      font-size: 1.75rem; font-weight: 800; color: var(--surface-800);
      letter-spacing: -0.02em;
    }
    .tutorial-header p {
      font-size: 0.9375rem; color: var(--surface-500); margin-top: 8px; line-height: 1.6;
    }

    .tutorial-mockup {
      max-width: 960px; margin: 0 auto;
      background: #fff; border-radius: var(--radius-lg);
      box-shadow: 0 4px 28px rgba(0,0,0,.07); border: 1px solid var(--surface-200);
      overflow: visible; position: relative; display: flex; height: 420px;
    }

    .tut-sidebar {
      width: 280px; flex-shrink: 0;
      border-right: 1px solid var(--surface-200);
      padding: 14px; display: flex; flex-direction: column; gap: 10px;
      background: var(--surface-50); overflow: hidden;
    }
    .tut-sidebar-card {
      background: #fff; border-radius: var(--radius); border: 1px solid var(--surface-100);
      padding: 10px; box-shadow: var(--shadow-soft);
    }
    .tut-route-title-mock {
      height: 32px; border-radius: 0.5rem; background: var(--primary-50);
      margin-bottom: 6px; display: flex; align-items: center; padding: 0 10px;
      font-size: 0.8125rem; font-weight: 600; color: var(--primary-700);
    }
    .tut-route-desc-mock { height: 22px; border-radius: 0.5rem; background: var(--surface-100); }

    .tut-seg { border-radius: var(--radius); border: 1px solid var(--surface-200); overflow: hidden; background: #fff; }
    .tut-seg-header {
      display: flex; align-items: center; gap: 8px; padding: 7px 10px;
      background: var(--surface-50); border-bottom: 1px solid var(--surface-100);
    }
    .tut-seg-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(255,255,255,.6); box-shadow: 0 0 0 1px var(--surface-300); }
    .tut-seg-title { font-size: 0.8125rem; font-weight: 600; color: var(--surface-700); }
    .tut-seg-points { padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
    .tut-pt {
      display: flex; align-items: center; gap: 8px; padding: 6px 8px;
      background: #fff; border-radius: 0.5rem; border: 1px solid var(--surface-200);
      box-shadow: var(--shadow-soft); transition: transform .2s;
    }
    .tut-pt-num {
      width: 22px; height: 22px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.6875rem; font-weight: 700; color: #fff; flex-shrink: 0;
    }
    .tut-pt-title { font-size: 0.75rem; color: var(--surface-600); font-weight: 500; }
    .tut-pt-toggle {
      margin-left: auto; display: flex; gap: 3px;
    }
    .tut-pt-toggle span {
      padding: 1px 6px; border-radius: 0.25rem; font-size: 0.625rem; font-weight: 600;
    }
    .tut-pt-toggle .on { background: var(--primary-500); color: #fff; }
    .tut-pt-toggle .off { background: var(--surface-100); color: var(--surface-400); }

    .tut-map {
      flex: 1; position: relative; overflow: hidden;
      background: #eef2ed;
    }
    .tut-map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
    .tut-map-search {
      position: absolute; top: 12px; left: 12px; right: 12px; height: 36px;
      background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-soft);
      display: flex; align-items: center; padding: 0 12px; gap: 8px; z-index: 5;
    }
    .tut-map-search svg { width: 16px; height: 16px; color: var(--surface-400); }
    .tut-map-search-text { font-size: 0.8125rem; color: var(--surface-400); }
    .tut-marker {
      position: absolute; z-index: 3;
      display: flex; align-items: center; justify-content: center;
      width: 26px; height: 26px; border-radius: 50%;
      color: #fff; font-weight: 700; font-size: 0.6875rem;
      border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25);
      transition: all .3s ease;
    }
    .tut-marker-label {
      position: absolute; left: 32px; top: 50%; transform: translateY(-50%);
      white-space: nowrap; padding: 2px 8px; border-radius: 6px;
      background: rgba(255,255,255,.82); backdrop-filter: blur(4px);
      font-size: 0.6875rem; font-weight: 500; color: var(--surface-700);
      box-shadow: 0 1px 4px rgba(0,0,0,.08); pointer-events: none;
    }
    .tut-leg-tooltip {
      position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
      padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.82);
      backdrop-filter: blur(4px); font-size: 0.6875rem; font-weight: 500;
      color: var(--surface-700); box-shadow: 0 1px 4px rgba(0,0,0,.08);
      pointer-events: none; white-space: nowrap;
    }
    .tut-leg-tooltip svg { width: 12px; height: 12px; color: var(--primary-500); }

    .tut-highlight {
      position: absolute; border-radius: var(--radius);
      border: 2px solid var(--primary-400);
      box-shadow: 0 0 0 4px rgba(20,184,166,.12), 0 0 20px rgba(20,184,166,.18);
      pointer-events: none; z-index: 10;
      transition: all .4s cubic-bezier(.4,0,.2,1);
      animation: tutPulse 2s ease-in-out infinite;
    }
    @keyframes tutPulse {
      0%, 100% { box-shadow: 0 0 0 4px rgba(20,184,166,.12), 0 0 20px rgba(20,184,166,.18); }
      50% { box-shadow: 0 0 0 7px rgba(20,184,166,.18), 0 0 30px rgba(20,184,166,.28); }
    }

    .tut-tooltip {
      position: absolute; z-index: 20; max-width: 250px;
      background: var(--surface-800); color: #fff;
      padding: 12px 16px; border-radius: 0.75rem;
      box-shadow: 0 8px 24px rgba(0,0,0,.25);
      font-size: 0.8125rem; line-height: 1.5;
      opacity: 0; transform: translateY(8px);
      transition: opacity .3s, transform .3s;
      pointer-events: none;
    }
    .tut-tooltip.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .tut-tooltip-title {
      font-weight: 700; font-size: 0.875rem; margin-bottom: 4px;
      display: flex; align-items: center; gap: 6px;
    }
    .tut-tooltip-title svg { width: 16px; height: 16px; color: var(--primary-300); flex-shrink: 0; }
    .tut-tooltip-arrow { position: absolute; width: 12px; height: 12px; background: var(--surface-800); transform: rotate(45deg); }
    .tut-tooltip-arrow.bottom { bottom: -6px; left: 24px; }
    .tut-tooltip-arrow.top { top: -6px; left: 24px; }
    .tut-tooltip-arrow.left { left: -6px; top: 16px; }
    .tut-tooltip-arrow.right { right: -6px; top: 16px; }

    .tut-controls {
      display: flex; align-items: center; justify-content: center;
      gap: 16px; margin-top: 24px;
    }
    .tut-dots { display: flex; gap: 6px; align-items: center; }
    .tut-dot {
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--surface-300); cursor: pointer; transition: all .25s;
    }
    .tut-dot.active { background: var(--primary-500); width: 24px; border-radius: 4px; }
    .tut-btn {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 8px 16px; border: none; border-radius: 0.75rem;
      font-size: 0.8125rem; font-weight: 600; cursor: pointer;
      transition: all .2s; font-family: inherit;
    }
    .tut-btn svg { width: 14px; height: 14px; }
    .tut-btn-prev { background: var(--surface-100); color: var(--surface-600); }
    .tut-btn-prev:hover { background: var(--surface-200); }
    .tut-btn-prev:disabled { opacity: .4; cursor: default; }
    .tut-btn-next { background: var(--primary-500); color: #fff; box-shadow: var(--shadow-soft); }
    .tut-btn-next:hover { background: var(--primary-600); }

    /* ---- Footer ---- */
    .app-footer {
      background: var(--surface-800); color: var(--surface-300);
      padding: 40px 48px 24px; flex-shrink: 0;
    }
    .footer-top {
      display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
      max-width: 1200px; margin: 0 auto;
      padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,.08);
    }
    .footer-brand { display: flex; flex-direction: column; gap: 12px; }
    .footer-brand-row { display: flex; align-items: center; gap: 10px; }
    .footer-logo-icon {
      width: 36px; height: 36px; border-radius: 0.625rem;
      background: var(--primary-500);
      display: flex; align-items: center; justify-content: center;
    }
    .footer-logo-icon svg { width: 20px; height: 20px; color: #fff; }
    .footer-brand h3 { font-size: 1.125rem; font-weight: 700; color: #fff; }
    .footer-brand p { font-size: 0.8125rem; line-height: 1.6; max-width: 300px; }
    .footer-col h4 {
      font-size: 0.6875rem; font-weight: 700; color: #fff;
      text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px;
    }
    .footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
    .footer-col a {
      font-size: 0.8125rem; color: var(--surface-400); text-decoration: none;
      transition: color .2s; cursor: pointer;
    }
    .footer-col a:hover { color: var(--primary-300); }
    .footer-bottom {
      display: flex; align-items: center; justify-content: space-between;
      max-width: 1200px; margin: 0 auto; padding-top: 18px;
      font-size: 0.75rem; color: var(--surface-500);
    }
    .footer-bottom-links { display: flex; gap: 16px; }
    .footer-bottom-links a {
      font-size: 0.75rem; color: var(--surface-500); text-decoration: none;
      transition: color .2s; cursor: pointer;
    }
    .footer-bottom-links a:hover { color: var(--primary-300); }

    @media (max-width: 900px) {
      .tutorial-section { padding: 40px 20px; }
      .tutorial-mockup { flex-direction: column; height: auto; }
      .tut-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--surface-200); max-height: 220px; }
      .tut-map { height: 260px; }
      .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; }
      .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
    }
    @media (max-width: 600px) {
      .footer-top { grid-template-columns: 1fr; }
    }

    /* ===== AI-генерация маршрута ===== */
    .modal-header h2 svg { width: 20px; height: 20px; color: var(--primary-500); vertical-align: -4px; }
    .ai-examples-wrap { display: flex; flex-direction: column; gap: 8px; }
    .ai-examples-label { font-size: 0.75rem; color: var(--surface-400); }
    .ai-examples { display: flex; flex-wrap: wrap; gap: 8px; }
    .ai-example-chip {
      font-size: 0.75rem; color: var(--surface-600);
      background: var(--surface-100); border: 1px solid var(--surface-200);
      border-radius: 999px; padding: 5px 12px; cursor: pointer;
      transition: all .2s; font-family: inherit; text-align: left;
    }
    .ai-example-chip:hover:not(:disabled) {
      background: var(--primary-50, #f0fdfa); border-color: var(--primary-300, #5eead4); color: var(--primary-600);
    }
    .ai-example-chip:disabled { opacity: .5; cursor: not-allowed; }
    .ai-status {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 14px; border-radius: 0.625rem;
      background: var(--primary-50, #f0fdfa); border: 1px solid var(--primary-100, #ccfbf1);
      font-size: 0.8125rem; color: var(--primary-700, #0f766e);
    }
    .ai-status.hidden { display: none; }
    #ai-prompt { resize: vertical; min-height: 90px; }
    .btn-ai-generate { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.8125rem; }
    .btn-ai-generate svg { width: 16px; height: 16px; }

    /* ===== Страница настроек (AI-провайдер) ===== */
    .settings-wrap { max-width: 760px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 20px; }
    .settings-head h2 { font-size: 1.375rem; font-weight: 700; color: var(--surface-800); letter-spacing: -0.02em; margin: 0 0 4px; }
    .settings-head p { margin: 0; font-size: 0.875rem; color: var(--surface-500); }
    .settings-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
    .settings-card-head { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 600; color: var(--surface-800); }
    .settings-card-head svg { width: 20px; height: 20px; color: var(--primary-500); }
    .settings-card-sub { font-size: 0.8125rem; color: var(--surface-500); line-height: 1.55; margin-top: -6px; }
    .ai-set-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
    .ai-set-meta { font-size: 0.78rem; color: var(--surface-500); background: var(--surface-100); border-radius: 999px; padding: 3px 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ai-set-meta b { color: var(--surface-700); font-weight: 600; }
    .ai-set-badge { font-size: 0.75rem; font-weight: 600; border-radius: 999px; padding: 3px 10px; }
    .ai-set-badge.ok { background: #ecfdf5; color: #059669; }
    .ai-set-badge.bad { background: #fef2f2; color: #dc2626; }
    .ai-set-badge.neutral { background: var(--surface-100); color: var(--surface-600); }
    .ai-set-hint { font-size: 0.75rem; color: var(--surface-400); margin-top: 4px; line-height: 1.45; }
    .ai-set-hint a { color: var(--primary-600); text-decoration: none; }
    .ai-set-hint a:hover { text-decoration: underline; }
    .ai-set-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
    .ai-set-result { font-size: 0.8125rem; line-height: 1.5; min-height: 0; }
    .ai-set-result.ok { color: #059669; }
    .ai-set-result.err { color: #dc2626; }
    .ai-set-loading { text-align: center; color: var(--surface-400); font-size: 0.875rem; padding: 40px 0; }
    select.input { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
    @media (max-width: 600px) {
      .ai-set-actions { flex-direction: column-reverse; }
      .ai-set-actions .btn { width: 100%; }
    }
    .ai-set-refresh { padding: 8px 10px; display: flex; align-items: center; flex-shrink: 0; }
    .ai-set-refresh svg { width: 15px; height: 15px; }
    @keyframes aiSpin { to { transform: rotate(360deg); } }
    .ai-set-refresh.spinning svg { animation: aiSpin 1s linear infinite; }

    /* ===== Настройки AI: карточки провайдеров и стек приоритетов ===== */
    .ai-btn-sm { padding: 6px 10px; font-size: 0.78rem; }
    .ai-icon-btn { padding: 6px 8px; display: inline-flex; align-items: center; }
    .ai-icon-btn svg { width: 14px; height: 14px; }

    /* Статусные иконки (aiStatusIcon) */
    .ai-status-icon { display: inline-block; vertical-align: -3px; }
    .ai-status-ok { color: #059669; }
    .ai-status-no_tokens { color: #d97706; }
    .ai-status-error { color: #dc2626; }
    .ai-status-none { color: var(--surface-300); }

    /* Короткая строка результата проверки */
    .ai-test-line { font-size: 0.78rem; color: var(--surface-500); display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ai-test-line.ok { color: #059669; }
    .ai-test-line.warn { color: #d97706; }
    .ai-test-line.err { color: #dc2626; }

    /* Список провайдеров */
    .ai-prov-list { display: flex; flex-direction: column; gap: 10px; }
    .ai-prov-row {
      display: flex; align-items: center; gap: 12px;
      border: 1px solid var(--surface-200); border-radius: var(--radius);
      padding: 12px 14px; background: #fff;
      transition: border-color .15s, background .15s;
    }
    .ai-prov-row:hover { border-color: var(--surface-300); background: var(--surface-50, #fafaf9); }
    .ai-prov-status { flex-shrink: 0; display: flex; align-items: center; }
    .ai-prov-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
    .ai-prov-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .ai-prov-name { font-size: 0.9rem; font-weight: 600; color: var(--surface-800); }
    .ai-prov-url { font-size: 0.78rem; color: var(--surface-400); word-break: break-all; }
    .ai-prov-result { min-height: 0; }
    .ai-prov-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

    /* Форма провайдера (добавление/изменение) */
    .ai-prov-form {
      border: 1.5px solid var(--primary-200, #99f6e4); border-radius: var(--radius);
      background: var(--primary-50, #f0fdfa);
      padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-top: 2px;
    }
    .ai-prov-form-title { font-size: 0.9rem; font-weight: 600; color: var(--surface-800); }
    .ai-prov-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .ai-f { min-width: 0; }
    .ai-f-full { grid-column: 1 / -1; }
    .ai-prov-model-controls { display: flex; gap: 8px; align-items: stretch; }
    .ai-prov-model-controls select, .ai-prov-model-controls input { flex: 1; min-width: 0; }
    .ai-prov-form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

    /* Чипы-пресеты провайдеров */
    .ai-preset-groups { display: flex; flex-direction: column; gap: 10px; }
    .ai-preset-group-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--surface-400); }
    .ai-preset-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .ai-preset-chip {
      font-size: 0.75rem; font-family: inherit; color: var(--surface-600);
      background: #fff; border: 1px solid var(--surface-200);
      border-radius: 999px; padding: 4px 12px; cursor: pointer;
      transition: border-color .15s, color .15s, background .15s;
    }
    .ai-preset-chip:hover { border-color: var(--primary-400); color: var(--primary-600); background: var(--primary-50, #f0fdfa); }
    .ai-preset-chip.active { border-color: var(--primary-500); color: var(--primary-700, #0f766e); background: var(--primary-100, #ccfbf1); }

    /* Стек приоритетов (failover) */
    .ai-stack-list { display: flex; flex-direction: column; gap: 8px; }
    .ai-stack-row {
      display: flex; align-items: center; gap: 10px;
      border: 1px solid var(--surface-200); border-radius: var(--radius);
      background: #fff; padding: 9px 12px;
      transition: border-color .15s, background .15s;
    }
    .ai-stack-row:hover { border-color: var(--surface-300); background: var(--surface-50, #fafaf9); }
    .ai-stack-row.dragging { opacity: .4; }
    .ai-stack-row.drag-over-top { border-top: 3px solid var(--primary-500); }
    .ai-stack-row.drag-over-bottom { border-bottom: 3px solid var(--primary-500); }
    .ai-stack-grip { color: var(--surface-300); cursor: grab; display: flex; align-items: center; flex-shrink: 0; }
    .ai-stack-grip:hover { color: var(--surface-500); }
    .ai-stack-grip svg { width: 16px; height: 16px; }
    .ai-stack-num { font-size: 0.78rem; font-weight: 600; color: var(--surface-400); min-width: 18px; text-align: center; flex-shrink: 0; }
    .ai-stack-model { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; color: var(--surface-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ai-stack-status { display: flex; align-items: center; flex-shrink: 0; }
    .ai-stack-result { flex: 1; min-width: 0; text-align: right; overflow: hidden; }
    .ai-stack-empty {
      font-size: 0.8125rem; color: var(--surface-500); line-height: 1.5;
      border: 1px dashed var(--surface-300); border-radius: var(--radius);
      padding: 14px 16px; background: var(--surface-50, #fafaf9);
    }

    /* Добавление модели в стек */
    .ai-stack-add { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
    .ai-stack-add-title { font-size: 0.85rem; font-weight: 600; color: var(--surface-700); }
    .ai-stack-add-row { display: flex; gap: 8px; align-items: stretch; }
    .ai-stack-add-row select, .ai-stack-add-row input { flex: 1; min-width: 0; }

    @media (max-width: 760px) {
      .tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
      .tabs::-webkit-scrollbar { display: none; }
      .ai-prov-form-grid { grid-template-columns: 1fr; }
      .ai-prov-form-actions { flex-direction: column-reverse; }
      .ai-prov-form-actions .btn { width: 100%; }
      .ai-prov-row { flex-wrap: wrap; }
      .ai-prov-main { flex-basis: calc(100% - 30px); }
      .ai-prov-actions { width: 100%; justify-content: flex-start; }
      .ai-stack-add-row { flex-direction: column; }
      .ai-stack-add-row .btn { width: 100%; }
      .ai-stack-row { flex-wrap: wrap; }
      .ai-stack-result { flex-basis: 100%; text-align: left; }
    }

    /* ===== Журнал ошибок AI (страница настроек) ===== */
    .ai-log-actions { display: flex; justify-content: flex-end; gap: 10px; }
    .ai-log-list { display: flex; flex-direction: column; gap: 10px; }
    .ai-log-empty { font-size: 0.8125rem; color: var(--surface-400); padding: 4px 0; }
    .ai-log-item {
      border: 1px solid var(--surface-200); border-radius: var(--radius);
      padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
    }
    .ai-log-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .ai-log-kind { font-size: 0.72rem; font-weight: 600; color: #b45309; background: #fffbeb; border-radius: 999px; padding: 2px 10px; }
    .ai-log-time { font-size: 0.72rem; color: var(--surface-400); white-space: nowrap; }
    .ai-log-msg { font-size: 0.8125rem; color: var(--surface-800); line-height: 1.45; word-break: break-word; }
    .ai-log-meta { display: flex; flex-wrap: wrap; gap: 6px; }
    .ai-log-meta span { font-size: 0.72rem; color: var(--surface-500); background: var(--surface-100); border-radius: 999px; padding: 2px 8px; }
    .ai-log-detail summary { font-size: 0.75rem; color: var(--primary-600); cursor: pointer; user-select: none; }
    .ai-log-detail pre {
      margin: 6px 0 0; font-size: 0.72rem; line-height: 1.45; color: var(--surface-700);
      background: var(--surface-100); border-radius: 8px; padding: 8px 10px;
      white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
    }

    /* ===== Расход токенов (страница настроек AI) ===== */
    .ai-usage-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
    .ai-usage-fgroup { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
    .ai-usage-flabel { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--surface-400); }
    .ai-usage-fgroup select.input { min-width: 0; }
    .ai-usage-dates { display: flex; align-items: center; gap: 6px; }
    .ai-usage-date { width: 140px; }
    .ai-usage-dates-sep { color: var(--surface-300); }

    .ai-usage-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
    .ai-usage-chart-title { font-size: 0.85rem; font-weight: 600; color: var(--surface-700); }
    .ai-usage-chart { border: 1px solid var(--surface-200); border-radius: var(--radius); background: #fff; padding: 10px 10px 4px; }
    .ai-usage-chart svg { display: block; width: 100%; height: auto; }
    .ai-usage-bar { fill: var(--primary-500); transition: fill .15s; }
    .ai-usage-bar:hover { fill: var(--primary-700); }
    .ai-usage-bar.zero { fill: var(--surface-200); }
    .ai-usage-chart.cost-mode .ai-usage-bar { fill: #d97706; }
    .ai-usage-chart.cost-mode .ai-usage-bar:hover { fill: #b45309; }
    .ai-usage-gridline { stroke: var(--surface-100); stroke-width: 1; }
    .ai-usage-axis { stroke: var(--surface-200); stroke-width: 1; }
    .ai-usage-tick { fill: var(--surface-400); font-size: 10px; font-family: inherit; }
    .ai-usage-chart-empty {
      font-size: 0.8125rem; color: var(--surface-500); text-align: center; padding: 52px 16px;
      border: 1px dashed var(--surface-300); border-radius: var(--radius); background: var(--surface-50, #fafaf9);
    }

    .ai-usage-table-wrap { overflow-x: auto; }
    .ai-usage-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
    .ai-usage-table th {
      text-align: left; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
      color: var(--surface-400); padding: 8px 10px; border-bottom: 1px solid var(--surface-200); white-space: nowrap;
    }
    .ai-usage-table td { padding: 9px 10px; border-bottom: 1px solid var(--surface-100); white-space: nowrap; }
    .ai-usage-table tr:last-child td { border-bottom: none; }
    .ai-usage-table tbody tr { transition: background .12s; }
    .ai-usage-table tbody tr:hover td { background: var(--primary-50); }
    .ai-usage-table .num { text-align: right; font-variant-numeric: tabular-nums; }
    .ai-usage-table td b { font-weight: 600; color: var(--primary-700); }
    .ai-usage-name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
    .ai-usage-model {
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.72rem;
      color: var(--surface-600); background: var(--surface-100); border-radius: 6px; padding: 2px 6px;
    }
    .ai-usage-share { width: 90px; height: 6px; border-radius: 999px; background: var(--surface-100); overflow: hidden; }
    .ai-usage-share i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary-400), var(--primary-600)); }

    .ai-usage-prices { border: 1px solid var(--surface-200); border-radius: var(--radius); background: #fff; }
    .ai-usage-prices > summary { cursor: pointer; user-select: none; font-size: 0.85rem; font-weight: 600; color: var(--surface-700); padding: 12px 14px; }
    .ai-usage-prices > summary:hover { color: var(--primary-600); }
    .ai-usage-prices-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
    .ai-usage-price-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .ai-usage-price-name {
      flex: 1 1 160px; min-width: 0; font-size: 0.8125rem; color: var(--surface-800);
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .ai-usage-price-row.is-new .ai-usage-price-name-input {
      flex: 1 1 160px; min-width: 0;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }
    .ai-usage-price-f { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--surface-400); }
    .ai-usage-price-f input { width: 104px; }
    .ai-usage-prices-note {
      font-size: 0.75rem; color: var(--surface-500); line-height: 1.5;
      background: var(--primary-50); border: 1px solid var(--primary-100);
      border-radius: var(--radius); padding: 8px 12px;
    }
    .ai-usage-prices-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

    @media (max-width: 760px) {
      .ai-usage-filters { flex-direction: column; align-items: stretch; }
      .ai-usage-fgroup select.input { width: 100%; }
      .ai-usage-dates { flex: 1; }
      .ai-usage-date { flex: 1; width: auto; }
      .ai-usage-chart-head { flex-direction: column; align-items: flex-start; }
      .ai-usage-table { min-width: 680px; }
      .ai-usage-name { max-width: 160px; }
      .ai-usage-prices-actions .btn { flex: 1; }
    }

    /* ===== Ошибка в модалке AI-генерации ===== */
    .ai-error {
      border: 1px solid #fecaca; background: #fef2f2; border-radius: var(--radius);
      padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
    }
    .ai-error.hidden { display: none; }
    .ai-error-msg { font-size: 0.8125rem; color: #dc2626; font-weight: 600; line-height: 1.45; }
    .ai-error-detail {
      margin: 0; font-size: 0.72rem; line-height: 1.45; color: #7f1d1d;
      background: #fee2e2; border-radius: 8px; padding: 8px 10px;
      white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto;
    }

    /* ===== AI-чат (итеративное улучшение маршрута) ===== */
    /* Плавает над картой в левом нижнем углу .map-wrap; свёрнут — компактная кнопка-пилюля */
    .ai-chat-card {
      position: absolute; left: 12px; bottom: 12px; z-index: 1100;
      width: 340px; max-width: calc(100% - 24px);
      padding: 0; overflow: hidden;
      border-radius: 14px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    }
    .ai-chat-card.collapsed { width: auto; border-radius: 999px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16); }
    .ai-chat-card.collapsed .ai-chat-head { padding: 10px 16px; gap: 8px; }
    .ai-chat-card.collapsed .ai-chat-head-text small { display: none; }
    .ai-chat-head {
      display: flex; align-items: center; gap: 10px; width: 100%;
      padding: 14px 16px; background: none; border: none; cursor: pointer; text-align: left;
    }
    .ai-chat-head:hover { background: var(--surface-50, #fafaf9); }
    .ai-chat-card.collapsed .ai-chat-head:hover { background: var(--surface-50, #fafaf9); }
    .ai-chat-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
    .ai-chat-head-text strong { font-size: 0.9rem; font-weight: 600; color: var(--surface-800); }
    .ai-chat-head-text small { font-size: 0.75rem; color: var(--surface-400); }
    .ai-chat-chevron { width: 16px; height: 16px; color: var(--surface-400); flex-shrink: 0; transition: transform .2s; }
    .ai-chat-card.collapsed .ai-chat-chevron { transform: rotate(-90deg); }
    .ai-chat-body { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 14px; }
    .ai-chat-card.collapsed .ai-chat-body { display: none; }
    .ai-chat-msgs {
      display: flex; flex-direction: column; gap: 8px; max-height: 230px; overflow-y: auto;
      padding: 2px; scroll-behavior: smooth;
    }
    .ai-chat-msg { max-width: 88%; font-size: 0.8125rem; line-height: 1.5; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
    .ai-chat-msg.user { align-self: flex-end; background: var(--primary-500); color: #fff; border-bottom-right-radius: 4px; }
    .ai-chat-msg.assistant { align-self: flex-start; background: var(--surface-100); color: var(--surface-800); border-bottom-left-radius: 4px; }
    .ai-chat-msg.assistant.ok { background: #ecfdf5; color: #065f46; }
    .ai-chat-msg.assistant.err { background: #fef2f2; color: #b91c1c; }
    .ai-chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .ai-chat-chip {
      font-size: 0.75rem; color: var(--primary-700, #0f766e); background: var(--primary-50, #f0fdfa);
      border: 1px solid var(--primary-100, #ccfbf1); border-radius: 999px; padding: 4px 10px; cursor: pointer;
      transition: background .15s;
    }
    .ai-chat-chip:hover { background: var(--primary-100, #ccfbf1); }
    .ai-chat-status { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--surface-500); }
    .ai-chat-status.hidden { display: none; }
    .ai-chat-inputrow { display: flex; gap: 8px; align-items: stretch; }
    .ai-chat-input {
      flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--surface-200);
      border-radius: 999px; font-size: 0.8125rem; outline: none; background: #fff;
      font-family: inherit; color: var(--surface-800);
    }
    .ai-chat-input:focus { border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1); }
    .ai-chat-send { width: 38px; height: 38px; padding: 0; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .ai-chat-send:disabled { opacity: 0.5; cursor: default; }

    /* ============================================================
       МНОГОПОЛЬЗОВАТЕЛЬСКИЙ РЕЖИМ: чип пользователя, бейджи видимости,
       кабинет, суперадминка, модалка доступа
       ============================================================ */

    /* ---- User-чип в хедере ---- */
    .user-chip {
      margin-left: auto; display: flex; align-items: center; gap: 10px;
      padding: 6px 12px 6px 6px; border-radius: 999px; cursor: pointer;
      border: 1px solid var(--surface-200); background: var(--surface-50, #fafaf9);
      transition: all .15s; flex-shrink: 0;
    }
    .user-chip:hover { border-color: var(--primary-200, #99f6e4); background: var(--primary-50, #f0fdfa); }
    .user-chip-avatar {
      width: 30px; height: 30px; border-radius: 50%; background: var(--primary-500);
      color: #fff; font-weight: 700; font-size: 0.8125rem;
      display: flex; align-items: center; justify-content: center;
    }
    .user-chip-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
    .user-chip-info b { font-size: 0.78rem; font-weight: 600; color: var(--surface-800); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .user-chip-info small { font-size: 0.66rem; color: var(--surface-400); }

    /* ---- Бейджи зоны видимости / роли ---- */
    .place-card-meta, .route-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
    .vis-badge {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 0.66rem; font-weight: 600; line-height: 1;
      padding: 4px 8px; border-radius: 999px; white-space: nowrap;
    }
    .vis-badge svg { width: 11px; height: 11px; }
    .vis-badge.shared { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
    .vis-badge.mine { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
    .vis-badge.owner { background: var(--surface-100); color: var(--surface-600); border: 1px solid var(--surface-200); }
    .vis-badge.member-edit { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
    .vis-badge.member-view { background: var(--surface-100); color: var(--surface-500); border: 1px solid var(--surface-200); }
    .role-badge {
      display: inline-block; font-size: 0.66rem; font-weight: 600; line-height: 1;
      padding: 4px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 1px;
    }
    .role-badge.admin { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
    .role-badge.user { background: var(--surface-100); color: var(--surface-500); border: 1px solid var(--surface-200); }

    /* ---- Баннер «только просмотр» ---- */
    .view-only-banner {
      display: flex; align-items: center; gap: 8px;
      background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
      font-size: 0.78rem; font-weight: 600; line-height: 1.4;
      border-radius: 10px; padding: 9px 12px; margin-bottom: 10px;
    }

    /* ---- Кабинет ---- */
    .cabinet-wrap { max-width: 860px; margin: 0 auto; }
    .cabinet-profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
    .cabinet-avatar {
      width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
      background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
      color: #fff; font-size: 1.4rem; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
    }
    .cabinet-profile-info { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
    .cabinet-name-row { display: flex; align-items: center; gap: 8px; }
    .cabinet-login { font-size: 0.85rem; color: var(--surface-600); }
    .cabinet-since { font-size: 0.75rem; color: var(--surface-400); }
    .cabinet-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
    .cabinet-stat { padding: 16px; text-align: center; }
    .cabinet-stat-num { font-size: 1.6rem; font-weight: 700; color: var(--primary-600); }
    .cabinet-stat-label { font-size: 0.72rem; color: var(--surface-400); margin-top: 2px; }
    .cabinet-pwd-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; }
    .cabinet-pwd-actions { grid-column: 1 / -1; }
    .admin-hint-card { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--surface-600); }
    .admin-hint-card svg { width: 18px; height: 18px; color: var(--primary-600); flex-shrink: 0; }
    .admin-hint-card a { color: var(--primary-600); font-weight: 600; }

    /* ---- Суперадминка: пользователи ---- */
    .adm-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin-top: 8px; }
    .adm-table th {
      text-align: left; font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.04em; color: var(--surface-400); padding: 8px 10px; border-bottom: 1px solid var(--surface-200);
    }
    .adm-table td { padding: 10px; border-bottom: 1px solid var(--surface-100); vertical-align: middle; }
    .adm-table tr:last-child td { border-bottom: none; }
    .adm-login { font-weight: 600; color: var(--surface-800); }
    .adm-counts { color: var(--surface-500); white-space: nowrap; }
    .adm-actions-cell { display: flex; gap: 6px; justify-content: flex-end; }
    .adm-actions-cell .btn { padding: 6px 10px; font-size: 0.75rem; }
    .adm-role { padding: 6px 8px !important; font-size: 0.75rem !important; width: auto !important; }
    .adm-create { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--surface-200); }
    .adm-create-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
    .adm-create-row .input { flex: 1; min-width: 150px; }

    /* ---- Суперадминка: layout с левой навигацией ---- */
    .admin-layout { display: flex; gap: 20px; align-items: flex-start; width: 100%; max-width: 1240px; margin: 0 auto; }
    .admin-nav {
      width: 210px; flex-shrink: 0; position: sticky; top: 20px;
      display: flex; flex-direction: column; gap: 4px;
      background: #fff; border: 1px solid var(--surface-200); border-radius: 14px; padding: 10px;
      box-shadow: var(--shadow-soft);
    }
    .admin-nav-head {
      display: flex; align-items: center; gap: 8px; padding: 8px 12px 10px;
      font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
      color: var(--surface-400); border-bottom: 1px solid var(--surface-100); margin-bottom: 6px;
    }
    .admin-nav-head svg { width: 14px; height: 14px; }
    .admin-nav-item {
      display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: none; background: none;
      border-radius: 9px; font-size: 0.8125rem; font-weight: 500; color: var(--surface-600);
      cursor: pointer; text-align: left; width: 100%; transition: all .15s; font-family: inherit;
    }
    .admin-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
    .admin-nav-item:hover { background: var(--surface-100); color: var(--surface-800); }
    .admin-nav-item.active { background: var(--primary-50); color: var(--primary-700); font-weight: 600; }
    .admin-nav-count {
      margin-left: auto; min-width: 22px; text-align: center; padding: 1px 7px;
      background: var(--surface-100); border-radius: 999px; font-size: 0.7rem; font-weight: 600; color: var(--surface-500);
    }
    .admin-nav-item.active .admin-nav-count { background: var(--primary-100); color: var(--primary-700); }
    .admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
    .adm-loading { padding: 48px 0; text-align: center; color: var(--surface-400); font-size: 0.875rem; width: 100%; }

    /* KPI-плитки сводки */
    .adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
    .adm-kpi { background: #fff; border: 1px solid var(--surface-200); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-soft); }
    .adm-kpi-value { font-size: 1.25rem; font-weight: 700; color: var(--primary-600); white-space: nowrap; }
    .adm-kpi-label { font-size: 0.68rem; color: var(--surface-400); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em; }

    /* Таблицы маршрутов/мест */
    .adm-table-card { padding: 16px 18px; }
    .adm-table-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
    .adm-table-toolbar .search-wrapper { flex: 1; }
    .adm-table-wrap { overflow-x: auto; }
    .adm-table-click tbody tr { cursor: pointer; transition: background .12s; }
    .adm-table-click tbody tr:hover td { background: var(--primary-50); }
    .adm-pill {
      display: inline-flex; align-items: center; justify-content: center; min-width: 26px;
      padding: 2px 9px; border-radius: 999px; background: var(--surface-100);
      font-size: 0.75rem; font-weight: 600; color: var(--surface-600); white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    .adm-pill.hl { background: #fef3c7; color: #b45309; }
    .adm-pill.dim { background: transparent; color: var(--surface-300); }
    .adm-km { white-space: nowrap; }
    .adm-nowrap { white-space: nowrap; }
    .adm-muted { color: var(--surface-400); }
    .adm-entity-title { font-weight: 600; color: var(--surface-800); }
    .adm-entity-sub { font-size: 0.72rem; color: var(--surface-400); margin-top: 2px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .adm-entity-cell { display: flex; align-items: center; gap: 10px; }
    .adm-thumb { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
    .adm-thumb-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-100); color: var(--surface-300); }
    .adm-thumb-empty svg { width: 16px; height: 16px; }
    .adm-rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--surface-700); }
    .adm-rating svg { width: 14px; height: 14px; color: #f59e0b; }
    .adm-rating small { color: var(--surface-400); font-weight: 500; }

    /* Карточки маршрута/места */
    .adm-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
    .adm-detail-head h2 { margin: 0 0 8px; }
    .adm-detail-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .adm-detail-actions { display: flex; gap: 8px; flex-shrink: 0; }
    .adm-meta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 0.8rem; color: var(--surface-500); }
    .adm-meta-row svg { width: 13px; height: 13px; vertical-align: -2px; }
    .adm-meta-id code { font-size: 0.72rem; background: var(--surface-100); padding: 2px 6px; border-radius: 5px; color: var(--surface-500); }

    /* Сегменты и точки в карточке маршрута */
    .adm-seg-list { display: flex; flex-direction: column; gap: 12px; }
    .adm-seg-card { padding: 14px 16px; }
    .adm-seg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
    .adm-seg-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
    .adm-seg-title { font-weight: 600; font-size: 0.875rem; color: var(--surface-800); }
    .adm-seg-stats { margin-left: auto; display: flex; gap: 6px; }
    .adm-point-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
    .adm-point { display: flex; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--surface-100); }
    .adm-point:first-child { border-top: none; }
    .adm-point-idx {
      width: 22px; height: 22px; border-radius: 50%; background: var(--primary-100); color: var(--primary-700);
      font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
    }
    .adm-point-body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
    .adm-point-title { font-size: 0.8125rem; font-weight: 600; color: var(--surface-700); }
    .adm-point-meta { display: flex; align-items: center; gap: 10px; font-size: 0.72rem; color: var(--surface-400); }
    .adm-point-meta span { display: inline-flex; align-items: center; gap: 3px; }
    .adm-point-meta svg { width: 12px; height: 12px; }
    .adm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
    .adm-chip {
      display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
      background: var(--primary-50); color: var(--primary-700); border: 1px solid var(--primary-100);
      border-radius: 999px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all .15s; font-family: inherit;
    }
    .adm-chip svg { width: 13px; height: 13px; }
    .adm-chip:hover { background: var(--primary-100); }

    /* Карточка места: фото и две колонки */
    .adm-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
    .adm-photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--surface-200); }
    .adm-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

    @media (max-width: 960px) {
      .admin-layout { flex-direction: column; align-items: stretch; }
      .admin-nav { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; }
      .admin-nav-head { display: none; }
      .admin-nav-item { width: auto; flex: 1 1 auto; justify-content: center; }
      .admin-nav-count { margin-left: 6px; }
      .adm-two-col { grid-template-columns: 1fr; }
      .adm-table-click .col-opt { display: none; }
      .adm-detail-actions { width: 100%; }
    }

    /* ---- Суперадминка: маршрутизация (провайдеры + API-ключи) ---- */
    .rt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
    .rt-head > div { min-width: 0; }
    .rt-note {
      display: flex; align-items: flex-start; gap: 10px;
      background: var(--primary-50, #f0fdfa); border: 1px solid var(--primary-100, #ccfbf1);
      border-radius: 12px; padding: 12px 14px;
      font-size: 0.8125rem; line-height: 1.5; color: var(--primary-700, #0f766e);
    }
    .rt-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
    .rt-note-env { background: #fffbeb; border-color: #fde68a; color: #92400e; }
    .rt-prov-list, .rt-key-rows { display: flex; flex-direction: column; gap: 8px; }
    .rt-prov-row, .rt-key-row {
      display: flex; align-items: center; gap: 10px;
      border: 1px solid var(--surface-200); border-radius: var(--radius);
      background: #fff; padding: 9px 12px;
      transition: border-color .15s, background .15s;
    }
    .rt-prov-row:hover, .rt-key-row:hover { border-color: var(--surface-300); background: var(--surface-50, #fafaf9); }
    .rt-prov-row.dragging, .rt-key-row.dragging { opacity: .4; }
    .rt-prov-row.drag-over-top, .rt-key-row.drag-over-top { border-top: 3px solid var(--primary-500); }
    .rt-prov-row.drag-over-bottom, .rt-key-row.drag-over-bottom { border-bottom: 3px solid var(--primary-500); }
    .rt-prov-row.rt-no-keys { opacity: .6; }
    .rt-grip { color: var(--surface-300); cursor: grab; display: flex; align-items: center; flex-shrink: 0; }
    .rt-grip:hover { color: var(--surface-500); }
    .rt-grip svg { width: 16px; height: 16px; }
    .rt-prov-num { font-size: 0.78rem; font-weight: 600; color: var(--surface-400); min-width: 18px; text-align: center; flex-shrink: 0; }
    .rt-prov-name { font-weight: 600; font-size: 0.875rem; color: var(--surface-800); white-space: nowrap; }
    .rt-prov-docs { font-size: 0.75rem; color: var(--primary-600); text-decoration: none; white-space: nowrap; }
    .rt-prov-docs:hover { text-decoration: underline; }
    .rt-prov-count {
      margin-left: auto; flex-shrink: 0;
      font-size: 0.72rem; font-weight: 600; border-radius: 999px; padding: 2px 9px;
      background: var(--surface-100); color: var(--surface-500); white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    .rt-skip-badge {
      flex-shrink: 0; font-size: 0.72rem; font-weight: 600; border-radius: 999px; padding: 2px 9px;
      background: #fff7ed; color: #c2410c; white-space: nowrap;
    }
    .rt-osrm-pinned {
      display: flex; align-items: center; gap: 10px; margin-top: 2px;
      border: 1px dashed var(--surface-300); border-radius: var(--radius);
      background: var(--surface-50, #fafaf9); padding: 9px 12px;
      font-size: 0.8125rem; font-weight: 500; color: var(--surface-500);
    }
    .rt-osrm-pinned svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--surface-400); }
    .rt-keys-list { display: flex; flex-direction: column; gap: 12px; }
    .rt-keys-block {
      border: 1px solid var(--surface-200); border-radius: 12px;
      padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
    }
    .rt-keys-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .rt-keys-title { font-weight: 600; font-size: 0.875rem; color: var(--surface-800); }
    .rt-keys-pill {
      font-size: 0.72rem; font-weight: 600; border-radius: 999px; padding: 2px 9px;
      background: var(--primary-50, #f0fdfa); color: var(--primary-700, #0f766e); white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    .rt-keys-pill.zero { background: var(--surface-100); color: var(--surface-400); }
    .rt-key-add-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
    .rt-key-add-btn svg { width: 13px; height: 13px; }
    .rt-key-label { font-size: 0.8125rem; font-weight: 500; color: var(--surface-700); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rt-key-masked {
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 0.8rem; color: var(--surface-500); letter-spacing: .03em;
      min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .rt-key-status {
      margin-left: auto; flex-shrink: 0;
      font-size: 0.72rem; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap;
    }
    .rt-cooling { background: #fef3c7; color: #b45309; }
    .rt-active { background: var(--surface-100); color: var(--surface-500); }
    .rt-add-form {
      border: 1px dashed var(--surface-300); border-radius: 10px;
      background: var(--surface-50, #fafaf9); padding: 12px;
      display: flex; flex-direction: column; gap: 8px;
    }
    .rt-add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
    .rt-add-row .input { flex: 1; min-width: 180px; }
    .rt-add-err { color: #dc2626; font-size: 0.78rem; line-height: 1.4; min-height: 0; }
    .rt-add-err:empty { display: none; }
    .rt-empty {
      font-size: 0.8125rem; color: var(--surface-500); line-height: 1.5;
      border: 1px dashed var(--surface-300); border-radius: var(--radius);
      padding: 14px 16px; background: var(--surface-50, #fafaf9);
    }

    @media (max-width: 760px) {
      .rt-add-row { flex-direction: column; }
      .rt-add-row .btn { width: 100%; }
      .rt-prov-row, .rt-key-row { flex-wrap: wrap; }
      .rt-prov-count, .rt-key-status { margin-left: 0; }
      .rt-prov-name { white-space: normal; }
      .rt-key-label, .rt-key-masked { max-width: 100%; }
      .rt-key-add-btn { margin-left: 0; width: 100%; justify-content: center; }
    }

    /* ---- Модалка «Доступ к маршруту» ---- */
    .access-modal { max-width: 520px; }
    .acc-route-name { font-size: 0.95rem; font-weight: 700; color: var(--surface-800); margin-bottom: 14px; }
    .acc-members { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
    .acc-empty { font-size: 0.8rem; color: var(--surface-400); padding: 10px 0; }
    .acc-member-row { display: flex; align-items: center; gap: 8px; background: var(--surface-50, #fafaf9); border: 1px solid var(--surface-200); border-radius: 10px; padding: 8px 10px; }
    .acc-member-name { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--surface-700, #44403c); min-width: 0; overflow: hidden; }
    .acc-member-name svg { width: 14px; height: 14px; color: var(--surface-400); flex-shrink: 0; }
    .acc-member-access { width: 160px !important; padding: 6px 8px !important; font-size: 0.75rem !important; }
    .acc-member-remove { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .acc-member-remove svg { width: 13px; height: 13px; }
    .acc-add-row { display: flex; gap: 8px; align-items: center; }

    @media (max-width: 760px) {
      .cabinet-stats { grid-template-columns: repeat(2, 1fr); }
      .cabinet-pwd-form { grid-template-columns: 1fr; }
      .acc-add-row { flex-wrap: wrap; }
      .adm-table th:nth-child(4), .adm-table td:nth-child(4) { display: none; }
      .user-chip-info { display: none; }
    }

    /* ---- Публичная лента на главной (общие маршруты и места) ---- */
    .home-feed-section { padding: 56px 48px 24px; background: var(--surface-50); flex-shrink: 0; }
    .home-feed-head { text-align: center; margin-bottom: 28px; }
    .home-feed-head h2 { font-size: 1.5rem; font-weight: 700; color: var(--surface-800); margin: 0 0 6px; }
    .home-feed-head p { font-size: 0.875rem; color: var(--surface-500); margin: 0; }
    .home-feed-block { max-width: 1120px; margin: 0 auto 36px; }
    .home-feed-block:last-child { margin-bottom: 0; }
    .home-feed-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; color: var(--surface-800); margin-bottom: 14px; }
    .home-feed-title svg { width: 20px; height: 20px; color: var(--primary-600); flex-shrink: 0; }
    .home-feed-all { margin-left: auto; }
    .home-feed-empty {
      border: 1px dashed var(--surface-200); border-radius: var(--radius-lg, 0.75rem);
      padding: 22px 20px; text-align: center; font-size: 0.8125rem; line-height: 1.5; color: var(--surface-400);
    }
    .home-feed-section .place-card h3 { font-size: 0.95rem; font-weight: 600; margin: 0 0 4px; color: var(--surface-800); }

    /* ---- Вход по требованию: hero-кнопка и кнопка в шапке ---- */
    .hero-auth { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; }
    .hero-auth-btn { padding: 12px 28px; font-size: 0.95rem; }
    .hero-auth-hint { font-size: 0.78rem; color: rgba(255, 255, 255, 0.72); }
    .wl-login-btn { padding: 8px 20px; font-size: 0.85rem; white-space: nowrap; }

    @media (max-width: 760px) {
      .home-feed-section { padding: 40px 20px 16px; }
      .hero-auth-hint { display: none; }
    }
