/* ─── Premium Neo-Glass Design System ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Dynamic Gradients & Colors */
  --accent-start:     #8b5cf6; /* Violet */
  --accent-end:       #3b82f6; /* Blue */
  --accent:           #6366f1; /* Indigo */
  --accent-hover:     #4f46e5;
  --accent-glow:      rgba(99, 102, 241, 0.2);
  
  /* Light Theme Colors (Default) */
  --bg-main:          #f8fafc;
  --bg-surface:       rgba(255, 255, 255, 0.65);
  --bg-card:          #ffffff;
  --bg-input:         #f1f5f9;
  --bg-overlay:       rgba(15, 23, 42, 0.4);

  --border:           rgba(226, 232, 240, 0.8);
  --border-glass:     rgba(255, 255, 255, 0.5);
  --border-focus:     #6366f1;
  
  --text-primary:     #0f172a;
  --text-secondary:   #334155;
  --text-muted:       #64748b;

  /* Form & Radius (Sleek, softer styling) */
  --radius-sm:        12px;
  --radius-md:        16px;
  --radius-lg:        24px;
  --radius-xl:        32px;

  /* Shadows (Depth & Elevation) */
  --shadow-sm:        0 2px 10px rgba(0, 0, 0, 0.02);
  --shadow-md:        0 10px 30px rgba(0, 0, 0, 0.05);
  --shadow-lg:        0 20px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow:      0 8px 24px var(--accent-glow);

  --font:             'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --header-h:         72px;
  --sidebar-w:        420px;
  --blur:             blur(24px) saturate(190%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-main:        #0f172a;
    --bg-surface:     rgba(30, 41, 59, 0.65);
    --bg-card:        #1e293b;
    --bg-input:       #334155;
    --bg-overlay:     rgba(0, 0, 0, 0.7);

    --border:         rgba(255, 255, 255, 0.08);
    --border-glass:   rgba(255, 255, 255, 0.05);
    --text-primary:   #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted:     #94a3b8;
    
    --shadow-sm:      0 4px 12px rgba(0,0,0,0.4);
    --shadow-md:      0 12px 32px rgba(0,0,0,0.6);
  }
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-main);
  background-image: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
                    radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── GLASSMOPRHISM ─────────────────────────────────────────────────────── */
.glass {
  background: var(--bg-surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border-glass);
}

/* ─── ANIMATIONS ───────────────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── HEADER ────────────────────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  width: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
}
.logo-text { color: var(--text-primary); }
.logo-text strong { 
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-meta { display: flex; align-items: center; gap: 16px; }

/* ─── LAYOUT ────────────────────────────────────────────────────────────── */
.main-layout {
  display: flex;
  height: calc(100dvh - var(--header-h));
  margin-top: var(--header-h);
  position: relative;
  overflow: hidden;
  width: 100%;
  animation: fadeIn 0.5s ease;
}

#view-planner {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 24px;
  gap: 24px;
}
#view-lookup {
  display: flex;
  flex-direction: column;
  padding: 32px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  gap: 32px;
  height: 100%;
  overflow-y: auto;
}
.hidden { display: none !important; }

/* ─── SIDEBAR ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  background: var(--bg-surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── CARD ──────────────────────────────────────────────────────────────── */
.card {
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.step-badge {
  background: var(--accent-glow);
  color: var(--accent);
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.card-body {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-body:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ─── TAB SWITCH ────────────────────────────────────────────────────────── */
.tab-switch {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}
.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.tab-panel.hidden { display: none; }

/* ─── INPUTS ────────────────────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}
.input-row { display: flex; gap: 16px; }

input[type="text"],
input[type="number"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  padding: 14px 18px;
  outline: none;
  transition: all 0.3s ease;
}
input:focus {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ─── SEARCH BOX ────────────────────────────────────────────────────────── */
.search-box { position: relative; margin-bottom: 20px; }
.search-box input {
  padding-left: 44px;
  height: 52px;
  font-size: 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* ─── BUILDING LIST ─────────────────────────────────────────────────────── */
.building-list {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}

.building-item {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}
.building-item:last-child { border-bottom: none; }
.building-item:hover { background: var(--bg-input); }
.building-item:active { transform: scale(0.98); }
.building-item.selected { 
  background: var(--accent-glow); 
  border-left: 4px solid var(--accent); 
  padding-left: 14px;
}
.building-item.selected .building-name { color: var(--accent); }

.building-item input[type="checkbox"] {
  width: 24px; height: 24px;
  accent-color: var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}
.building-item input[type="checkbox"]:hover { transform: scale(1.1); }

.building-info { flex: 1; min-width: 0; }
.building-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.building-id { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.building-addr { font-size: 0.8rem; color: var(--text-muted); opacity: 0.9; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.coord-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.coord-dot.has-coord { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.coord-dot.no-coord  { background: var(--text-muted); opacity: 0.3; }

/* ─── BUTTONS ───────────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 12px 28px var(--accent-glow);
  filter: brightness(1.1); 
}
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-ghost:hover { 
  background: var(--bg-input); 
  color: var(--accent);
  border-color: var(--accent-glow);
  transform: translateY(-1px);
}
.btn-sm { padding: 6px 14px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-large { width: 100%; height: 56px; font-size: 1.1rem; border-radius: var(--radius-lg); }

.route-action { 
  padding: 24px; 
  background: var(--bg-surface);
  backdrop-filter: var(--blur); 
  border-top: 1px solid var(--border-glass); 
}

/* ─── MAP & CONTENT AREA ────────────────────────────────────────────────── */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  border-radius: var(--radius-lg);
}

.map-container {
  height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-glass);
  position: relative;
  transition: all 0.3s ease;
}
.map-container:hover { box-shadow: var(--shadow-lg); }
#map { width: 100%; height: 100%; z-index: 1; }

.map-placeholder {
  position: absolute; inset: 0;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  z-index: 2; color: var(--text-muted);
  font-size: 1.1rem; font-weight: 500;
  animation: fadeIn 0.5s ease;
}
.map-placeholder-inner { text-align: center; }
.map-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }

/* ─── RESULT SUMMARY ────────────────────────────────────────────────────── */
.result-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 40px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}
.result-summary:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.summary-stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.summary-divider { width: 1px; height: 40px; background: var(--border); }
.text-success { color: #10b981; }
.ml-auto { margin-left: auto; }

/* ─── NAVIGATION TABS ───────────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-right: 16px;
  height: 44px;
}
.nav-tab {
  border: none;
  background: transparent;
  padding: 0 20px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.nav-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.nav-tab:hover:not(.active) { color: var(--text-primary); }

/* Barkod etiketi görünümü */
#view-labels {
  height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: 32px 20px 60px;
  justify-content: center;
  align-items: flex-start;
}
.label-card {
  width: min(100%, 840px);
  margin: 0 auto;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.label-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.label-form .input-group { min-width: 0; }
.label-help { grid-column: 1 / -1; color: var(--text-muted); font-size: .88rem; }
.label-download { grid-column: 1 / -1; min-height: 52px; }
.label-preview { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.label-preview h2 { font-size: 1rem; margin-bottom: 16px; }
.label-preview > p { color: var(--text-muted); font-size: .85rem; margin-top: 12px; }
.preview-sheet {
  width: min(100%, 280px);
  aspect-ratio: 80 / 125;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, 1fr);
  background: white;
  border: 1px solid #cbd5e1;
}
.preview-label {
  min-width: 0;
  border: 1px solid #d5dce3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #27333a;
  font: 700 9px Arial, sans-serif;
  overflow: hidden;
}
.preview-label img { width: 23px; height: 23px; object-fit: contain; }
.preview-bars {
  width: 75%; height: 21px; margin: 2px 0;
  background: repeating-linear-gradient(90deg, #111 0 1px, #fff 1px 2px, #111 2px 4px, #fff 4px 6px);
}

/* ─── LOOKUP VIEW ───────────────────────────────────────────────────────── */
.lookup-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.lookup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.4s ease forwards;
}
.lookup-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-glow);
}
.lookup-card-header {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
}
.lookup-card-title { font-weight: 800; font-size: 1.15rem; color: var(--text-primary); letter-spacing: -0.01em; }
.lookup-card-id { font-size: 0.9rem; color: var(--accent); font-weight: 700; margin-top: 4px; }
.lookup-card-body { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; }
.lookup-card-actions { margin-top: auto; padding-top: 8px; }

/* ─── TABLE ─────────────────────────────────────────────────────────────── */
.route-table-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}
.section-title h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 20px; }
.route-table { width: 100%; border-collapse: collapse; }
.route-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}
.route-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.route-table tr:hover { background: var(--bg-input); }
.score-high { color: #10b981; font-weight: 700; }
.score-low { color: #f59e0b; font-weight: 700; }

/* ─── BADGES ────────────────────────────────────────────────────────────── */
.badge {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ─── TOAST NOTIFICATIONS ──────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 32px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; gap: 12px;
}
.toast {
  background: var(--text-primary);
  color: var(--bg-card);
  padding: 14px 28px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 12px;
  animation: slideTop 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.toast.success { background: #10b981; color: white; }
.toast.error { background: #ef4444; color: white; }
@keyframes slideTop {
  from { transform: translateY(-100%) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ─── LOADING OVERLAY ──────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.loading-overlay.active { opacity: 1; pointer-events: all; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: white; font-weight: 600; font-size: 1.1rem; }

/* ─── LEAFLET OVERRIDES ────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0; border: 1px solid var(--border);
}
.leaflet-popup-content { margin: 16px; font-family: var(--font); }
.popup-title { font-weight: 800; font-size: 1.05rem; color: var(--text-primary); margin-bottom: 8px; }
.popup-row { font-size: 0.9rem; color: var(--text-secondary); margin: 4px 0; }
.popup-sira { 
  display: inline-block; background: var(--accent-glow); color: var(--accent); 
  border-radius: 6px; padding: 4px 10px; font-size: 0.8rem; font-weight: 800; margin-bottom: 8px; 
}

/* Clean field-work layout */
:root {
  color-scheme: light;
  --accent-start: #0f766e;
  --accent-end: #0d9488;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-glow: rgba(15, 118, 110, .14);
  --bg-main: #f4f7f6;
  --bg-surface: #fff;
  --bg-card: #fff;
  --bg-input: #f3f7f6;
  --border: #dce7e3;
  --border-glass: #dce7e3;
  --text-primary: #172b2a;
  --text-secondary: #38514f;
  --text-muted: #647b78;
  --shadow-sm: 0 2px 12px rgba(21, 49, 46, .04);
  --shadow-md: 0 12px 32px rgba(21, 49, 46, .07);
  --shadow-lg: 0 20px 42px rgba(21, 49, 46, .12);
  --radius-lg: 20px;
}
body {
  background: var(--bg-main);
  background-image: none;
}
.header {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.logo-icon {
  background: var(--accent);
  box-shadow: none;
}
.logo-text strong {
  color: var(--accent);
  -webkit-text-fill-color: currentColor;
  background: none;
}
.nav-tabs { background: var(--bg-main); }
.nav-tab.active { color: var(--accent); }
#view-lookup { max-width: 1080px; gap: 20px; }
#view-lookup .card { gap: 14px; }
.page-intro { padding: 8px 4px 12px; }
.eyebrow {
  display: inline-flex;
  color: var(--accent);
  background: #e5f5f1;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .09em;
}
.page-intro h1, .planner-intro h1 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -.045em;
  margin: 14px 0 8px;
}
.page-intro p, .planner-intro p { color: var(--text-muted); max-width: 60ch; }
.planner-intro { display: none; }
.card-body { border-radius: 18px; }
.card-body:hover { transform: none; box-shadow: var(--shadow-sm); }
.lookup-search-box { margin-bottom: 0; }
.lookup-search-box input,
input[type="search"] {
  width: 100%;
  min-height: 52px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  padding: 13px 16px;
  outline: none;
}
.lookup-search-box input { padding-left: 48px; min-height: 60px; font-size: 1.05rem; }
input[type="search"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.lookup-card {
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
  gap: 12px;
}
.lookup-card:hover { transform: translateY(-2px); }
.lookup-card-title { font-size: 1.08rem; }
.lookup-card-id { color: var(--text-muted); font-size: .84rem; }
.lookup-card-body { min-height: 44px; }
.btn-primary {
  background: var(--accent);
  box-shadow: none;
}
.btn-primary:hover { background: var(--accent-hover); filter: none; box-shadow: var(--shadow-sm); }
.btn-ghost { border-color: var(--border); }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .nav-tab:focus-visible,
.tab-btn:focus-visible, .building-item:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.sidebar, .map-container, .result-summary, .route-table-section {
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}
.sidebar-scroll { gap: 22px; }
.result-summary { gap: 20px; padding: 18px 22px; flex-wrap: wrap; }
.result-summary:hover { transform: none; box-shadow: var(--shadow-sm); }
.summary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-value { font-size: 1.2rem; }
.building-item { min-height: 58px; }
.building-addr { white-space: normal; }
.route-table td { vertical-align: top; }
.table-wrapper { overflow-x: auto; }

@media (max-width: 900px) {
  .header { position: sticky; height: auto; top: 0; }
  .header-inner { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .header-meta {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .nav-tabs { width: 100%; margin: 0; height: 46px; order: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-tab { padding: 0 4px; font-size: .78rem; }
  #btn-sync { min-height: 46px; padding: 8px 12px; order: 0; }
  #building-count-badge { display: none !important; }
  #view-labels { margin-top: 0; height: auto; min-height: calc(100dvh - 120px); padding: 18px 16px 40px; overflow: visible; }
  .label-card { padding: 20px; }
  .main-layout,
  #view-lookup,
  #view-planner {
    margin-top: 0;
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 120px);
    overflow: visible;
    animation: none;
  }
  #view-lookup {
    display: block;
    padding: 18px 16px 40px;
    max-width: none;
  }
  #view-planner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 16px 40px;
  }
  .planner-intro { display: block; }
  .sidebar {
    display: flex;
    position: static;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: visible;
    border-radius: 18px;
    z-index: auto;
  }
  .sidebar-scroll { overflow: visible; padding: 16px; gap: 18px; }
  .route-action { position: static; padding: 16px; border-radius: 0 0 18px 18px; }
  .content-area {
    display: flex;
    flex: none;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 0;
    gap: 16px;
    scroll-margin-top: 120px;
  }
  .map-container {
    height: min(58dvh, 430px);
    min-height: 280px;
    margin: 0;
    flex: none;
  }
  .result-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
  }
  .summary-divider { display: none; }
  .summary-stat { min-width: 0; }
  .summary-actions {
    width: 100%;
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    justify-content: flex-start;
  }
  #google-maps-links { flex-wrap: wrap; }
  .route-table-section { padding: 18px; margin: 0; }
  .route-table thead { display: none; }
  .route-table, .route-table tbody { display: block; }
  .route-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
  }
  .route-table td {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    font-size: .92rem;
    overflow-wrap: anywhere;
  }
  .route-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 2px;
  }
  .route-table td:nth-child(3),
  .route-table td:nth-child(4),
  .route-table td:nth-child(7) { grid-column: 1 / -1; }
  .route-table td:nth-child(5),
  .route-table td:nth-child(6) { display: none; }
  .route-table td:nth-child(7) a { min-height: 44px; }
  .lookup-results-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
  .lookup-card { padding: 16px; }
  .card-header { flex-wrap: wrap; }
  .card-header-actions { width: 100%; display: flex; gap: 8px; }
  .card-header-actions button { flex: 1; min-height: 44px; }
  .card-body { padding: 16px; }
  .building-list { max-height: 45dvh; min-height: 150px; }
  .btn-primary, .tab-btn, .btn-ghost { min-height: 44px; }
  .btn-large { min-height: 54px; }
  .toast-container { width: calc(100% - 24px); top: 12px; }
  .toast { border-radius: 14px; width: 100%; }
}
@media (max-width: 390px) {
  .logo { font-size: 1.12rem; }
  .logo-icon { width: 34px; height: 34px; }
  .header-meta { grid-template-columns: minmax(0, 1fr) auto; }
  .sync-label { display: none; }
  #btn-sync { width: 46px; padding: 8px; justify-content: center; }
  .nav-tab { font-size: .72rem; }
  .label-form { grid-template-columns: 1fr; }
  .label-help, .label-download { grid-column: 1; }
  .input-row { flex-direction: column; gap: 10px; }
  .page-intro h1, .planner-intro h1 { font-size: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

