/*
 * Shared design tokens and base styles: colours (Material 3 roles on a white, neutral palette
 * with a teal accent), type, and the basic controls (state layer, icon buttons, buttons).
 * Components live in app.css.
 */

:root {
  color-scheme: light;
  --md-primary: #0f766e;
  --md-on-primary: #ffffff;
  --md-primary-container: #ccfbf1;
  --md-on-primary-container: #134e4a;
  --md-secondary-container: #f1f5f9;
  --md-on-secondary-container: #0f172a;
  --md-error: #dc2626;
  --md-error-container: #fef2f2;
  --md-on-error-container: #7f1d1d;
  --md-surface: #ffffff;
  --md-on-surface: #0f172a;
  --md-on-surface-variant: #64748b;
  --md-surface-container-low: #f8fafc;
  --md-surface-container: #f1f5f9;
  --md-surface-container-high: #e2e8f0;
  --md-outline: #cbd5e1;
  --md-outline-variant: #e2e8f0;
  --md-inverse-surface: #0f172a;
  --md-inverse-on-surface: #f8fafc;

  --map-water: #e6eef4;
  --map-land: #fbfcfd;
  --map-border: #cdd6df;
  --map-alt-route: #94a3b8;

  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .05);
  --shadow-md: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px -4px rgb(15 23 42 / .08);
  --shadow-lg: 0 4px 6px -2px rgb(15 23 42 / .05), 0 16px 40px -8px rgb(15 23 42 / .16);
  --ring: 0 0 0 4px color-mix(in srgb, var(--md-primary) 16%, transparent);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 22px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  background: var(--md-surface);
  color: var(--md-on-surface);
  min-height: 100vh;
}
svg.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* ---- State layer shared by interactive elements ---- */
.state { position: relative; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.state::before {
  content: ""; position: absolute; inset: 0;
  background: currentColor; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.state:hover::before { opacity: .06; }
.state:focus-visible::before, .state:active::before { opacity: .1; }
.state:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }

.icon-button {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%; padding: 0;
  background: transparent; color: var(--md-on-surface-variant);
  text-decoration: none;
}
.icon-button svg.icon { width: 20px; height: 20px; }
.icon-button.outlined { background: var(--md-surface); border: 1px solid var(--md-outline-variant); box-shadow: var(--shadow-sm); color: var(--md-on-surface); }
.icon-button:disabled { opacity: .38; cursor: default; }
.icon-button:disabled::before { opacity: 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px;
  border: 0; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 600;
}
.button.filled { background: var(--md-primary); color: var(--md-on-primary); box-shadow: 0 1px 2px rgb(15 118 110 / .3); }
.button.filled:hover { box-shadow: 0 4px 14px -2px rgb(15 118 110 / .45); }
.button.tonal { background: var(--md-primary-container); color: var(--md-on-primary-container); height: 40px; padding: 0 16px; font-size: 14px; }
.button.text { height: 40px; padding: 0 12px; background: transparent; color: var(--md-primary); font-size: 14px; }
.button:disabled { background: var(--md-surface-container); color: var(--md-on-surface-variant); cursor: default; box-shadow: none; }
.button:disabled::before { opacity: 0; }
.button svg.icon { width: 20px; height: 20px; }
