/*
  2025 Feedback App – Auto‑switching CSS Theme
  -------------------------------------------------
  • Modern soft-neo-glass aesthetic with subtle depth
  • Auto light/dark via prefers-color-scheme, with optional manual override using [data-theme]
  • Variable fonts, fluid spacing, rounded geometry, micro-interactions
  • Accessible focus states, reduced motion support, high-contrast tweaks

  HOW TO OVERRIDE THEME MANUALLY (optional):
    <html data-theme="light"> or <html data-theme="dark">

  TIP: Include <meta name="color-scheme" content="light dark"> in <head> for form controls.
*/

/* -------------------------------
   0) CSS Reset + Base
---------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; }
img, picture { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; }

:root {
  /* Let UA know we support both schemes for builtin widgets */
  color-scheme: light dark;

  /* Type scale */
  --font-sans: "InterVariable", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-weight-normal: 450;
  --font-weight-strong: 700;
  --font-size-0: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --font-size-1: clamp(1.0rem, 0.98rem + 0.2vw, 1.125rem);
  --font-size-2: clamp(1.25rem, 1.15rem + 0.6vw, 1.5rem);
  --font-size-3: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);

  /* Radius + Elevation */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-1: 0 6px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-2: 0 10px 30px rgba(0,0,0,0.14), 0 3px 10px rgba(0,0,0,0.1);

  /* Spacing (fluid) */
  --space-1: clamp(6px, 0.4vw, 10px);
  --space-2: clamp(10px, 0.7vw, 14px);
  --space-3: clamp(14px, 1vw, 20px);
  --space-4: clamp(18px, 1.2vw, 26px);
  --space-5: clamp(24px, 1.6vw, 34px);

  /* Brand – luminous gradient */
  --brand-1: #00e0ff;
  --brand-2: #ff4ecd;
  --brand-3: #ffaa00;
  --brand-gradient: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3));

  /* Semantic color tokens will be defined in schemes below */
}

/* -------------------------------
   1) Color Schemes (auto)
   Default: follow user's prefers-color-scheme
---------------------------------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0e0f12;            /* canvas */
    --bg-elev-1: rgba(255,255,255,0.04);
    --bg-elev-2: rgba(255,255,255,0.06);
    --surface: #14161b;        /* solid surfaces */

    --text-1: #e8e9ef;         /* primary text */
    --text-2: #b7bbc7;         /* secondary */
    --text-3: #8d93a3;         /* tertiary */

    --stroke-1: rgba(255,255,255,0.08);
    --focus-ring: rgba(0, 224, 255, 0.35);

    --accent: #5ae1ff;         /* default accent */
    --accent-contrast: #082027;

    --success: #4ade80;        /* green 400 */
    --warning: #fbbf24;        /* amber 400 */
    --danger:  #fb7185;        /* rose 400 */

    --glass: rgba(255,255,255,0.07);
    --glass-border: rgba(255,255,255,0.10);
    --glass-sheen: rgba(255,255,255,0.06);
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f6f7fb;
    --bg-elev-1: rgba(0,0,0,0.02);
    --bg-elev-2: rgba(0,0,0,0.04);
    --surface: #ffffff;

    --text-1: #1c1f26;
    --text-2: #3b4251;
    --text-3: #6b7280;

    --stroke-1: rgba(0,0,0,0.08);
    --focus-ring: rgba(0, 160, 200, 0.35);

    --accent: #007aff;         /* iOS-ish blue */
    --accent-contrast: #ffffff;

    --success: #16a34a;        /* green 600 */
    --warning: #d97706;        /* amber 700 */
    --danger:  #e11d48;        /* rose 700 */

    --glass: rgba(255,255,255,0.6);
    --glass-border: rgba(0,0,0,0.08);
    --glass-sheen: rgba(255,255,255,0.5);
  }
}

/* Manual override via [data-theme] attribute */
:root[data-theme="dark"] {
  --bg: #0e0f12;
  --bg-elev-1: rgba(255,255,255,0.04);
  --bg-elev-2: rgba(255,255,255,0.06);
  --surface: #14161b;
  --text-1: #e8e9ef; --text-2: #b7bbc7; --text-3: #8d93a3;
  --stroke-1: rgba(255,255,255,0.08);
  --focus-ring: rgba(0, 224, 255, 0.35);
  --accent: #5ae1ff; --accent-contrast: #082027;
  --success: #4ade80; --warning: #fbbf24; --danger: #fb7185;
  --glass: rgba(255,255,255,0.07); --glass-border: rgba(255,255,255,0.10); --glass-sheen: rgba(255,255,255,0.06);
}
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-elev-1: rgba(0,0,0,0.02);
  --bg-elev-2: rgba(0,0,0,0.04);
  --surface: #ffffff;
  --text-1: #1c1f26; --text-2: #3b4251; --text-3: #6b7280;
  --stroke-1: rgba(0,0,0,0.08);
  --focus-ring: rgba(0, 160, 200, 0.35);
  --accent: #007aff; --accent-contrast: #ffffff;
  --success: #16a34a; --warning: #d97706; --danger: #e11d48;
  --glass: rgba(255,255,255,0.6); --glass-border: rgba(0,0,0,0.08); --glass-sheen: rgba(255,255,255,0.5);
}

/* -------------------------------
   2) App Base Styles
---------------------------------- */

html { font-family: var(--font-sans); }
body {
  background: radial-gradient(1200px 800px at 10% -20%, rgba(255,78,205,0.08), transparent 60%),
              radial-gradient(900px 600px at 110% 10%, rgba(0,224,255,0.08), transparent 60%),
              var(--bg);
  color: var(--text-1);
  line-height: 1.45;
  font-weight: var(--font-weight-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: var(--space-4) var(--space-2);
}

h1 { font-size: var(--font-size-3); letter-spacing: -0.02em; }
h2 { font-size: var(--font-size-2); letter-spacing: -0.02em; color: var(--text-2); }
h3 { font-size: 1.15rem; color: var(--text-2); }

p { font-size: var(--font-size-1); color: var(--text-2); }
small, .muted { color: var(--text-3); font-size: var(--font-size-0); }

/* -------------------------------
   3) Utilities
---------------------------------- */

.u-gradient-text { background: var(--brand-gradient); background-size: 300% 300%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradMove 8s ease infinite; }
@keyframes gradMove { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

.u-glass {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
}

.u-ring { box-shadow: 0 0 0 3px var(--focus-ring); }
.u-center { display: grid; place-items: center; }
.u-stack > * + * { margin-top: var(--space-3); }
.u-grid { display: grid; gap: var(--space-3); }

/* -------------------------------
   4) Components
---------------------------------- */

/* Card */
.card {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-elev-2), transparent), var(--surface);
  border: 1px solid var(--stroke-1);
  box-shadow: var(--shadow-1);
}
.card--glass { border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.card__body { padding: var(--space-4); }
.card__footer { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--stroke-1); display: flex; gap: var(--space-2); justify-content: flex-end; }

/* Buttons */
.button {
  --btn-bg: var(--bg-elev-1);
  --btn-fg: var(--text-1);
  --btn-border: var(--stroke-1);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-fg); cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  will-change: transform;
}
.button:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.button:active { transform: translateY(0) scale(.98); }
.button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

.button--primary { --btn-bg: radial-gradient(120% 120% at 30% 10%, rgba(255,255,255,.12), transparent), var(--brand-gradient); --btn-fg: var(--accent-contrast); border: none; }
.button--ghost { background: transparent; border: 1px solid var(--stroke-1); }
.button--danger { --btn-bg: linear-gradient(180deg, rgba(251,113,133,.2), transparent), var(--danger); color: #fff; border: none; }

/* Near me */
.near-me-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-3); }
.near-me-toggle { display: inline-flex; align-items: center; gap: var(--space-2); font-size: .95rem; color: var(--text-2); }
.near-me-toggle input { margin: 0; width: 1.1rem; height: 1.1rem; }
.near-me-status { color: var(--text-2); }
.near-me-error {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent);
  background: color-mix(in oklab, var(--danger) 12%, transparent);
  color: var(--danger);
}
.near-me-results { margin-top: var(--space-4); display: grid; gap: var(--space-3); }
.near-me-card__header { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; justify-content: space-between; }
.near-me-card__title { margin: 0; font-size: 1.05rem; }
.near-me-card__link { color: inherit; text-decoration: none; }
.near-me-card__link:hover,
.near-me-card__link:focus-visible { text-decoration: underline; }
.near-me-card__id { margin: var(--space-1) 0 0; color: var(--text-3); }
.near-me-card__meta { margin-top: var(--space-2); color: var(--text-2); }
.near-me-card__meta--secondary { color: var(--text-3); margin-top: var(--space-1); }
.near-me-card__updated { margin-top: var(--space-2); color: var(--text-3); }
.near-me-distance { font-weight: 600; }
.near-me-port-list { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: grid; gap: var(--space-2); }
.near-me-port { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.near-me-port__id { font-weight: 600; }
.near-me-port__status { display: inline-flex; align-items: center; gap: 6px; }
.near-me-port__updated { color: var(--text-3); }

/* Inputs */
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-1);
  border: 1px solid var(--stroke-1);
  color: var(--text-1);
  transition: box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

/* Toggle (Switch) */
.switch { --w: 46px; --h: 28px; position: relative; width: var(--w); height: var(--h); background: var(--bg-elev-1); border: 1px solid var(--stroke-1); border-radius: 999px; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(var(--h) - 4px); height: calc(var(--h) - 4px); border-radius: 50%; background: linear-gradient(180deg, var(--glass-sheen), var(--surface)); box-shadow: var(--shadow-1); transition: transform .2s ease; }
.switch[aria-checked="true"] { background: var(--accent); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(calc(var(--w) - var(--h))); }

/* Badges / Chips */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: var(--bg-elev-1); border: 1px solid var(--stroke-1); color: var(--text-2); font-size: 0.85rem; }
.chip--accent { background: rgba(0,224,255,.12); color: var(--accent); border-color: transparent; }

/* Toast */
.toast { position: fixed; right: var(--space-4); bottom: var(--space-4); min-width: 260px; max-width: 420px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--stroke-1); box-shadow: var(--shadow-2); display: grid; gap: 6px; }
.toast--success { border-color: color-mix(in oklab, var(--success) 40%, transparent); }
.toast--warning { border-color: color-mix(in oklab, var(--warning) 40%, transparent); }
.toast--danger  { border-color: color-mix(in oklab, var(--danger)  40%, transparent); }

/* Modal */
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: var(--space-5); background: color-mix(in srgb, var(--bg) 40%, transparent); backdrop-filter: blur(6px); }
.modal__panel { width: min(680px, 96vw); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--stroke-1); box-shadow: var(--shadow-2); overflow: clip; }
.modal__header, .modal__footer { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--stroke-1); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.modal__footer { border-top: 1px solid var(--stroke-1); border-bottom: none; justify-content: flex-end; }
.modal__body { padding: var(--space-4); }

/* Nav / Toolbar */
.navbar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); row-gap: var(--space-1); padding: 10px 14px; border-radius: 18px; margin: var(--space-3) auto; width: min(1100px, 100%); max-width: 100%; backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); border: 1px solid var(--glass-border); background: linear-gradient(180deg, var(--bg-elev-2), transparent); box-shadow: var(--shadow-1); }
.navbar__title { font-weight: var(--font-weight-strong); letter-spacing: -0.02em; }
.navbar__spacer { flex: 1; }

/* Progress / Sentiment Bar (feedback-specific) */
.sentiment { height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-elev-1); border: 1px solid var(--stroke-1); }
.sentiment__fill { height: 100%; background: var(--brand-gradient); background-size: 200% 200%; animation: gradMove 6s ease infinite; }

/* Feedback item */
.feedback-item { display: grid; gap: 10px; padding: var(--space-3); border-radius: var(--radius-md); background: linear-gradient(180deg, var(--bg-elev-1), transparent); border: 1px solid var(--stroke-1); }
.feedback-item__meta { display: flex; gap: 12px; align-items: center; color: var(--text-3); font-size: 0.9rem; }
.feedback-item__title { font-weight: 600; color: var(--text-1); }
.feedback-item__tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* -------------------------------
   5) States & Interactions
---------------------------------- */

:where([hidden]) {
  display: none !important;
}

:where(a, button, .button) { -webkit-tap-highlight-color: transparent; }
:where(a, .link) { color: var(--accent); text-decoration: none; }
:where(a, .link):hover { text-decoration: underline; }

/* Tilt + float on hover (use sparingly) */
.floaty { transition: transform .3s ease, box-shadow .3s ease; will-change: transform; }
.floaty:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }

/* Focus visibility */
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-radius: 8px; }

/* -------------------------------
   6) Layout helpers
---------------------------------- */

.grid-cards { display: grid; gap: var(--space-3); grid-template-columns: repeat( auto-fit, minmax(260px, 1fr) ); }
.stack { display: grid; gap: var(--space-3); }
.row { display: flex; gap: var(--space-2); align-items: center; }

/* Container Query example: make cards denser in tight columns */
@container card (max-width: 340px) {
  .card__body { padding: var(--space-3); }
}
.card { container-type: inline-size; container-name: card; }

/* -------------------------------
   7) Reduced Motion
---------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* -------------------------------
   8) High Contrast tweak (optional)
---------------------------------- */

@media (forced-colors: active) {
  .u-glass, .card, .modal__panel, .input, .button { border: 1px solid CanvasText; }
}

/* -------------------------------
   9) Example helper classes for error/success toasts, badges
---------------------------------- */
.badge { display: inline-block; padding: 6px 10px; border-radius: 999px; font-weight: 600; border: 1px solid var(--stroke-1); background: var(--bg-elev-1); color: var(--text-2); }
.badge--success { background: color-mix(in oklab, var(--success) 20%, transparent); color: var(--success); border-color: transparent; }
.badge--warning { background: color-mix(in oklab, var(--warning) 20%, transparent); color: var(--warning); border-color: transparent; }
.badge--danger  { background: color-mix(in oklab, var(--danger)  20%, transparent); color: var(--danger); border-color: transparent; }

/* -------------------------------
   10) Table (lightweight, scrollable)
---------------------------------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--stroke-1); border-radius: var(--radius-md); overflow: hidden; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--stroke-1); text-align: left; }
.table thead th { font-size: 0.9rem; color: var(--text-3); font-weight: 600; }
.table tr:hover { background: var(--bg-elev-1); }

/* -------------------------------
   11) Tiny helpers for forms in feedback app
---------------------------------- */
.form { display: grid; gap: var(--space-3); }
.label { font-size: 0.9rem; color: var(--text-2); }
.help { font-size: 0.85rem; color: var(--text-3); }

/* Emoji-like rating row */
.rate { display: flex; gap: 8px; }
.rate button { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--stroke-1); background: var(--bg-elev-1); transition: transform .12s ease, box-shadow .2s ease; }
.rate button:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.rate button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }

/* -------------------------------
   12) Footer + subtle glow
---------------------------------- */
.footer { margin-top: var(--space-5); padding: var(--space-4) 0; color: var(--text-3); position: relative; }
.footer::before { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: radial-gradient(50% 40% at 50% 100%, rgba(0,224,255,0.12), transparent 70%); pointer-events: none; }

/* -------------------------------
   Endolla Watcher Layout & Overrides
---------------------------------- */

main {
  flex: 1;
}

.page-main {
  padding: var(--space-3) 0 var(--space-5);
}

.page-main > .container {
  display: grid;
  gap: var(--space-4);
}

.page-intro {
  max-width: 60ch;
  font-size: var(--font-size-1);
  color: var(--text-2);
  line-height: 1.55;
}

.site-header {
  padding: var(--space-3) 0 var(--space-1);
}

.site-header .container {
  display: flex;
  justify-content: center;
}

.navbar {
  width: 100%;
  align-items: center;
  gap: var(--space-2);
  row-gap: var(--space-1);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar__title {
  font-size: var(--font-size-2);
}

.navbar__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  row-gap: var(--space-1);
  align-items: center;
  justify-content: flex-end;
}

.navbar__spacer {
  flex: 1;
}

.navbar__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 600;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.navbar__link:hover {
  color: var(--text-1);
  background: var(--bg-elev-1);
}

.navbar__link[aria-current],
.navbar__link.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.section {
  display: grid;
  gap: var(--space-3);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-3);
}

.section-title {
  display: grid;
  gap: var(--space-1);
}

.section-title h2,
.section-title h3 {
  margin: 0;
  color: var(--text-1);
}

.section-title p,
.section-title .muted {
  color: var(--text-3);
}

.chart-subtitle {
  color: var(--text-3);
  font-size: var(--font-size-0);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--text-3);
  font-size: var(--font-size-0);
}

.grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid.location-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  padding: var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.card h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-2);
  font-weight: var(--font-weight-strong);
}

.card p {
  margin: 0;
  color: var(--text-1);
}

.card__eyebrow {
  font-size: var(--font-size-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.metric-value {
  font-size: clamp(1.8rem, 1.4rem + 1vw, 2.5rem);
  font-weight: var(--font-weight-strong);
  color: var(--text-1);
}

.utilization {
  display: grid;
  gap: var(--space-3);
}

.utilization-panel {
  display: grid;
  gap: var(--space-3);
}

.utilization-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.utilization-panel-note {
  color: var(--text-3);
  font-size: var(--font-size-0);
}

.utilization-tabs {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px;
  border-radius: 999px;
  background: var(--bg-elev-1);
  border: 1px solid var(--stroke-1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.utilization-tab {
  border: none;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.utilization-tab.is-active,
.utilization-tab[aria-selected="true"] {
  color: var(--text-1);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.utilization-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  align-items: center;
}

.utilization-limit {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
  font-size: var(--font-size-0);
  color: var(--text-3);
}

.utilization-limit select {
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke-1);
  background: var(--surface);
  color: var(--text-1);
  padding: 6px 12px;
  cursor: pointer;
}

.utilization-limit select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.utilization-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-3);
  font-size: var(--font-size-0);
}

.utilization-footer .button {
  font-size: var(--font-size-0);
}

.range-select {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-3);
  font-size: var(--font-size-0);
}

.range-label {
  font-weight: 600;
  color: var(--text-2);
}

.range-options {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--bg-elev-1);
  border: 1px solid var(--stroke-1);
}

.range-option {
  border: none;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.range-option.is-active,
.range-option[aria-checked="true"] {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.chart-card {
  padding: 0;
}

.chart-card .card__body {
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}

.chart-visual {
  position: relative;
  min-height: 280px;
}

.chart-visual canvas {
  width: 100%;
  height: 100%;
}

.chart-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-2);
  font-size: var(--font-size-1);
}

.rules {
  display: grid;
  gap: var(--space-2);
}

.rule-list {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
}

.rule-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--bg-elev-1), transparent);
  border: 1px solid var(--stroke-1);
}

.rule-list strong {
  font-size: var(--font-size-2);
  color: var(--text-1);
}

.high-charging-list {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
}

.high-charging-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--bg-elev-1), transparent);
  border: 1px solid var(--stroke-1);
}

.high-charging-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.high-charging-details a {
  color: var(--text-1);
  font-weight: 600;
  text-decoration: none;
}

.high-charging-details a:hover,
.high-charging-details a:focus {
  text-decoration: underline;
}

.high-charging-meta {
  font-size: var(--font-size-0);
  color: var(--text-2);
}

.history table,
.problematic table,
.utilization table,
.location-summary table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--stroke-1);
}

.history th,
.history td,
.problematic th,
.problematic td,
.utilization th,
.utilization td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke-1);
  color: var(--text-2);
  font-size: var(--font-size-1);
  text-align: left;
}

.history tbody tr:nth-child(odd),
.problematic tbody tr:nth-child(odd),
.utilization tbody tr:nth-child(odd) {
  background: var(--bg-elev-1);
}

.history tbody tr:hover,
.problematic tbody tr:hover,
.utilization tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-1);
  background: var(--surface);
}

.table-scroll table {
  min-width: 720px;
  border: none;
}

.history .table-scroll table {
  min-width: 0;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  font-weight: 600;
}

.sort-button .sort-indicator {
  color: var(--text-3);
  font-size: var(--font-size-0);
}

.problematic-intro {
  display: grid;
  gap: var(--space-2);
}

.problematic {
  display: grid;
  gap: var(--space-2);
}

.site-footer {
  padding: var(--space-4) 0;
  color: var(--text-3);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb {
  margin-bottom: var(--space-3);
}

.breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.location-header {
  display: grid;
  gap: var(--space-1);
}

.location-summary {
  display: grid;
  gap: var(--space-3);
}

.location-charts {
  display: grid;
  gap: var(--space-3);
}

.location-map-section {
  display: grid;
  gap: var(--space-2);
}

.station-heatmaps {
  display: grid;
  gap: var(--space-3);
}

.station-heatmap-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.station-heatmap-card .card__body {
  display: grid;
  gap: var(--space-3);
}

.station-heatmap-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.station-heatmap-title {
  font-size: 1.05rem;
  color: var(--text-1);
}

.station-heatmap-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.station-heatmap-meta,
.station-heatmap-generated,
.station-heatmap-status,
.station-heatmap-coverage {
  margin: 0;
  color: var(--text-3);
}

.station-heatmap-status:not(:empty) {
  margin-top: -0.25rem;
}

.station-heatmap-visual {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-1);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-elev-1) 80%, transparent), transparent);
  padding: var(--space-3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-inline;
}

.station-heatmap-visual.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.08) 45%, transparent 90%);
  animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.fingerprint-grid {
  position: relative;
  display: grid;
  gap: 1px;
  grid-template-columns: minmax(30px, 0.5fr) repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(18px, 1fr);
  font-size: 0.52rem;
  width: 100%;
  max-width: 100%;
}

.fingerprint-grid__corner,
.fingerprint-grid__hour,
.fingerprint-grid__day {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-3);
}

.fingerprint-grid__corner {
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0 6px 4px 0;
}

.fingerprint-grid__day {
  padding: 0 4px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.56rem;
}

.fingerprint-grid__hour {
  justify-content: flex-start;
  padding: 0 2px 0 0;
  color: var(--text-2);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
}

.fingerprint-grid__cell {
  position: relative;
  border-radius: 4px;
  background: var(--heat-color, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: default;
}

.fingerprint-grid__cell:hover {
  transform: scale(1.12);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  z-index: 2;
}

.fingerprint-grid__cell.is-medium-coverage {
  opacity: 0.75;
}

.fingerprint-grid__cell.is-low-coverage {
  opacity: 0.45;
}

.fingerprint-grid__cell.is-low-coverage::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.28) 0,
    rgba(255, 255, 255, 0.28) 3px,
    transparent 3px,
    transparent 6px
  );
}

.station-heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: var(--text-3);
}

.station-heatmap-legend-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    hsl(210deg 70% 92%) 0%,
    hsl(130deg 80% 64%) 50%,
    hsl(50deg 90% 37%) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.station-heatmap-coverage {
  font-size: 0.75rem;
}

.station-heatmap-generated {
  font-size: 0.75rem;
}

@media (max-width: 600px) {
  .station-heatmap-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.location-map {
  width: 100%;
  height: clamp(280px, 40vh, 420px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  box-shadow: var(--shadow-1);
}

.location-map--debug {
  outline: 3px solid rgba(37, 99, 235, 0.8);
  position: relative;
}

.location-map--debug::after {
  content: 'Map debug';
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: rgba(191, 219, 254, 0.95);
  border: 1px solid rgba(37, 99, 235, 0.4);
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.location-map-marker {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1f2937;
  line-height: 1.1;
}

.location-map-marker--debug {
  outline: 2px dashed rgba(249, 115, 22, 0.7);
  background: rgba(255, 247, 237, 0.9);
  padding: 6px 10px;
  border-radius: 12px;
}

.location-map-marker__dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #dc2626;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(15, 23, 42, 0.25);
}

.location-map-marker__dot--debug {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.6), 0 0 0 1px rgba(15, 23, 42, 0.3);
}

.location-map-marker__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  color: inherit;
  white-space: nowrap;
}

.location-map-marker__label--debug {
  outline: 1px dashed rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
}

@media (prefers-color-scheme: dark) {
  .location-map--debug::after {
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.35);
    border-color: rgba(191, 219, 254, 0.45);
  }
  .location-map-marker {
    color: #e2e8f0;
  }
  .location-map-marker--debug {
    background: rgba(15, 23, 42, 0.85);
    outline-color: rgba(249, 115, 22, 0.65);
  }
  .location-map-marker__dot {
    border-color: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4), 0 4px 10px rgba(15, 23, 42, 0.6);
  }
  .location-map-marker__dot--debug {
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.7), 0 0 0 1px rgba(15, 23, 42, 0.6);
  }
  .location-map-marker__label {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 2px 10px rgba(2, 6, 23, 0.65);
  }
  .location-map-marker__label--debug {
    outline-color: rgba(249, 115, 22, 0.45);
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
  }
}

.heatmap-overview {
  display: grid;
  gap: var(--space-3);
}

.heatmap-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
}

.heatmap-select {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--font-size-0);
  color: var(--text-2);
}

.heatmap-select select {
  min-width: 180px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke-1);
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--shadow-1);
}

.heatmap-select select:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-0);
  color: var(--text-3);
}

.heatmap-gradient {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 0%, #facc15 50%, #dc2626 100%);
  box-shadow: inset 0 0 0 1px var(--stroke-1);
}

.heatmap-map {
  width: 100%;
  height: clamp(320px, 50vh, 520px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--stroke-1);
  box-shadow: var(--shadow-1);
  background: var(--surface);
}

#heatmap-status {
  font-size: var(--font-size-0);
  color: var(--text-3);
}

.heatmap-hotspots {
  display: grid;
  gap: var(--space-3);
}

.heatmap-table-container {
  display: grid;
  gap: var(--space-2);
}

.heatmap-table-container .table-scroll {
  width: 100%;
}

.heatmap-table-container .table-scroll table {
  min-width: 0;
}

.heatmap-table-legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-0);
  color: var(--text-3);
}

.heatmap-table-legend__text {
  white-space: nowrap;
}

.heatmap-table-legend-gradient {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    hsl(120deg 80% 45%) 0%,
    hsl(45deg 95% 55%) 50%,
    hsl(0deg 85% 45%) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.heatmap-table {
  width: 100%;
}

.heatmap-table th:nth-child(2),
.heatmap-table td:nth-child(2),
.heatmap-table th:nth-child(3),
.heatmap-table td:nth-child(3),
.heatmap-table th:last-child,
.heatmap-table td:last-child {
  text-align: right;
}

.heatmap-metric-cell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.heatmap-metric-cell__swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: var(--heatmap-metric-color, rgba(148, 163, 184, 0.35));
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

.heatmap-metric-cell__value {
  text-align: right;
  min-width: 3.5ch;
}

.heatmap-location-cell {
  display: grid;
  gap: 4px;
}

.heatmap-address {
  color: var(--text-3);
  font-size: var(--font-size-0);
}

.content {
  display: grid;
  gap: var(--space-2);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-1);
  box-shadow: var(--shadow-1);
  padding: var(--space-4);
}

.content p {
  color: var(--text-2);
  font-size: var(--font-size-1);
}

.muted {
  font-size: var(--font-size-0);
}

@media (max-width: 900px) {
  .navbar {
    justify-content: center;
  }

  .navbar__spacer {
    display: none;
  }

  .navbar__links {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .table-scroll table {
    min-width: 600px;
  }
}
