/* ========================================
   GIS Toolset Hub - Design System
   ======================================== */

:root {
  /* Colors */
  --color-primary: #0891b2;
  --color-primary-dark: #0e7490;
  --color-primary-light: #ecfeff;
  --color-primary-bg: #f0f9ff;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-error: #ef4444;
  --color-error-bg: #fef2f2;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-header-bg: #0f172a;
  --color-header-text: #f8fafc;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;

  /* Spacing */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 10px 25px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition: 200ms ease;
  --transition-slow: 350ms ease;

  /* Layout */
  --container-max: 1100px;
  --container-narrow: 720px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-border: #334155;
    --color-border-light: #1e293b;
    --color-primary-light: #0f2937;
    --color-primary-bg: #082f3d;
    --color-header-bg: #020617;
    --color-header-text: #f1f5f9;
    --color-success-bg: #064e3b;
    --color-error-bg: #450a0a;
    --color-warning-bg: #451a03;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.3), 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 10px 25px rgba(0, 0, 0, 0.5);
  }
}

/* Manual dark mode override */
html[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-border: #334155;
  --color-border-light: #1e293b;
  --color-primary-light: #0f2937;
  --color-primary-bg: #082f3d;
  --color-header-bg: #020617;
  --color-header-text: #f1f5f9;
  --color-success-bg: #064e3b;
  --color-error-bg: #450a0a;
  --color-warning-bg: #451a03;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.3), 0 10px 15px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* ========================================
   Base
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Layout
   ======================================== */
.container {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: var(--container-narrow);
}

/* ========================================
   Header
   ======================================== */
.site-header {
  background: linear-gradient(135deg, var(--color-header-bg) 0%, #1e293b 100%);
  color: var(--color-header-text);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), #06b6d4, var(--color-primary));
}

.site-header .header-inner {
  padding: 32px 0;
  text-align: center;
}

.site-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.site-header h1 .icon {
  font-size: 1.5em;
  line-height: 1;
}

.site-header .subtitle {
  margin: 6px 0 0;
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.site-header .breadcrumb {
  margin-top: 12px;
  font-size: 0.85rem;
}

.site-header .header-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.theme-toggle {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-header-text);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background var(--transition);
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.15);
}

.site-header .breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

.site-header .breadcrumb a:hover {
  text-decoration: underline;
}

.site-header .breadcrumb .sep {
  color: var(--color-text-muted);
  margin: 0 6px;
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 20px 24px 0;
}

.card-body {
  padding: 20px 24px;
}

.card-footer {
  padding: 0 24px 20px;
}

/* ========================================
   Tool Card (for index grid)
   ======================================== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), #06b6d4);
  opacity: 0;
  transition: opacity var(--transition);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card .card-icon {
  font-size: 1.8em;
  margin-bottom: 12px;
  line-height: 1;
}

.tool-card h3 {
  font-size: 1.15em;
  color: var(--color-primary);
  margin: 0 0 8px;
  font-weight: 600;
}

.tool-card p {
  font-size: 0.9em;
  color: var(--color-text-secondary);
  margin: 0 0 12px;
  flex-grow: 1;
  line-height: 1.5;
}

.tool-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-card .tags span {
  font-size: 0.75em;
  padding: 2px 8px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-radius: 999px;
  font-weight: 500;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-icon {
  padding: 8px;
  line-height: 1;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.btn-icon:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

.form-input.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input:disabled,
.form-input[readonly] {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: default;
}

.form-help {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: 4px;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-input-group .form-input {
  flex: 1;
}

/* ========================================
   Radio / Checkbox pills
   ======================================== */
.radio-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pills label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  user-select: none;
}

.radio-pills label:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.radio-pills input[type="radio"] {
  display: none;
}

.radio-pills input[type="radio"]:checked + span {
  color: var(--color-primary);
  font-weight: 600;
}

.radio-pills label:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ========================================
   Tables
   ======================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table th,
table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

table thead th {
  background: var(--color-header-bg);
  color: var(--color-header-text);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

table tbody tr {
  transition: background var(--transition);
}

table tbody tr:nth-child(even) {
  background: var(--color-bg);
}

table tbody tr:hover {
  background: var(--color-primary-light);
}

table tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   Section
   ======================================== */
.section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 6px;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0 0 20px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}

/* ========================================
   Toast notifications
   ======================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: toast-in var(--transition-slow) ease forwards;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
}

.toast.toast-out {
  animation: toast-out var(--transition-slow) ease forwards;
}

.toast-success {
  border-left: 3px solid var(--color-success);
}

.toast-error {
  border-left: 3px solid var(--color-error);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}

/* ========================================
   Back to top
   ======================================== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  transition: all var(--transition);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* ========================================
   Search bar
   ======================================== */
.search-bar {
  position: relative;
  max-width: 400px;
}

.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  text-align: center;
  padding: 24px;
  background: var(--color-header-bg);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 48px;
}

.site-footer p {
  margin: 4px 0;
}

.site-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .site-header h1 {
    font-size: 1.5rem;
  }

  .site-header .header-inner {
    padding: 24px 0;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 16px 18px;
  }

  .radio-pills label {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    width: 100%;
    padding: 0 12px;
  }

  table {
    font-size: 0.8rem;
  }

  table th,
  table td {
    padding: 8px 10px;
  }
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.flex-wrap { flex-wrap: wrap; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2-gap8 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Result cards */
.result-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.result-card-small {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.result-card-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.result-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.result-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
}
.result-value-lg {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
}
.result-muted {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}
.result-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Preset buttons row */
.presets-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Section heading small */
.section-h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
}

/* Visual badge */
.visual-badge {
  display: none;
  margin-top: 10px;
  font-size: 0.85rem;
  background: var(--color-primary-bg);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--color-text-secondary);
}

/* Progress bar */
.progress-bar {
  margin-top: 14px;
  background: var(--color-border-light);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-primary), #06b6d4);
  width: 0;
  transition: width 0.4s ease;
}

/* ========================================
   Map
   ======================================== */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  position: relative;
}

.map-container.map-full {
  height: 520px;
}

.map-container .ol-viewport {
  border-radius: var(--radius);
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.map-toolbar .map-coord-info {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.map-toolbar .map-actions {
  display: flex;
  gap: 6px;
}

.map-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--transition);
}

.map-hint.visible {
  opacity: 1;
}

.map-skeleton {
  position: absolute;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  z-index: 1;
  transition: opacity var(--transition);
  pointer-events: none;
}

.map-skeleton.hidden {
  opacity: 0;
}

.ol-popup {
  position: absolute;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  color: var(--color-text);
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--font-mono);
  z-index: 20;
}

.ol-popup::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--color-surface);
}

.map-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  width: 20px;
  height: 20px;
}

.map-crosshair::before,
.map-crosshair::after {
  content: '';
  position: absolute;
  background: var(--color-primary);
}

.map-crosshair::before {
  width: 20px;
  height: 2px;
  top: 9px;
  left: 0;
}

.map-crosshair::after {
  width: 2px;
  height: 20px;
  top: 0;
  left: 9px;
}

.map-crosshair .dot {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #fff;
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.map-layout .map-panel {
  min-height: 100%;
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-container,
  .map-container.map-full {
    height: 320px;
  }
}

/* ========================================
   Workflow bar
   ======================================== */
.workflow-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 10px 20px;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.workflow-bar.visible {
  display: flex;
}

.workflow-bar .wf-coord {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 600;
}

.workflow-bar .wf-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
}

.tabs button {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.tabs button:hover {
  color: var(--color-text);
}

.tabs button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.format-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.format-toggle button {
  padding: 6px 14px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.format-toggle button.active {
  background: var(--color-primary);
  color: white;
}

.format-toggle button:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.coord-history {
  max-height: 300px;
  overflow-y: auto;
}

.coord-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background var(--transition);
}

.coord-history-item:last-child {
  border-bottom: none;
}

.coord-history-item:hover {
  background: var(--color-primary-light);
}

.coord-history-item .h-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
}
