
:root {
  color-scheme: dark;

  /* Brand */
  --brand-primary: #16A34A;
  --brand-secondary: #087443;
  --brand-accent: #84CC16;
  --brand-charcoal: #17231F;

  /* Default dark theme */
  --bg: #0B1511;
  --surface: #132A20;
  --surface-elevated: #1B3A2B;
  --text-primary: #FFFFFF;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --border: #31513F;
  --brand-soft: #1B3A2B;
  --success-soft: #173B2A;
  --warning-soft: #3B2D16;
  --error-soft: #3C2020;
  --neutral-soft: #1B2B24;

  /* Interactive */
  --button-primary: #087443;
  --button-hover: #065F46;
  --button-active: #064E3B;
  --focus-ring: #4ADE80;

  /* Semantic */
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #0EA5E9;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header, .site-footer {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  height: 82px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-mark { width: 38px; height: 38px; object-fit: contain; }
.brand-name { font: 700 22px/1 "Poppins", sans-serif; letter-spacing: -1px; }
.brand-name strong { color: var(--brand-primary); }

.main-nav { display: flex; align-items: center; gap: 32px; height: 100%; }
.nav-link { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-link:hover, .nav-link.active { color: var(--brand-primary); }
.nav-link.active { position: relative; }
.nav-link.active::after { position: absolute; content: ""; height: 3px; border-radius: 4px 4px 0 0; background: var(--brand-primary); bottom: -30px; left: 0; right: 0; }

main { min-height: calc(100vh - 164px); }
.hero {
  width: min(1120px, calc(100% - 48px));
  margin: 34px auto 0;
  min-height: 340px;
  padding: 46px 62px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 30px;
  align-items: center;
  border-radius: 20px;
  background: linear-gradient(112deg, var(--surface) 0%, #173425 56%, var(--surface-elevated) 100%);
}

.hero-copy { min-width: 0; }
.hero-map { min-width: 0; height: 250px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 12px 30px #00000030; }
.hero-map iframe { width: 100%; height: 100%; display: block; border: 0; }
.eyebrow { margin: 0 0 10px; color: var(--brand-primary); font-size: 11px; font-weight: 700; letter-spacing: 1.35px; }
.eyebrow-dot { width: 7px; height: 7px; margin-right: 7px; display: inline-block; border-radius: 50%; background: var(--success); vertical-align: 1px; }
.hero h1 { margin: 0; font: 700 clamp(38px, 5vw, 56px)/1.08 "Poppins", sans-serif; letter-spacing: -2px; }
.hero h1 span { color: var(--brand-primary); }
.hero-description { max-width: 420px; margin: 14px 0 0; color: var(--text-secondary); font-size: 15px; }
.check-icon::after { width: 8px; height: 5px; content: ""; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); }

.station-section { width: min(1120px, calc(100% - 48px)); margin: 46px auto 62px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 21px; }
.section-heading .eyebrow { margin-bottom: 4px; font-size: 10px; }
h2, h3, p { overflow-wrap: anywhere; }
.section-heading h2 { margin: 0; font: 600 27px/1.3 "Poppins", sans-serif; letter-spacing: -.7px; }
.section-subtitle { margin: 5px 0 0; color: var(--text-secondary); font-size: 13px; }
.station-count { margin: 0 0 4px; color: var(--text-muted); font-size: 12px; }
.data-notice { margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--brand-soft); color: var(--text-primary); font-size: 13px; }
.data-notice strong { font-weight: 700; }
.filters { display: flex; align-items: center; gap: 12px; margin-bottom: 21px; }
.search-field, .filter-field { height: 48px; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.search-field { flex: 1; gap: 10px; padding: 0 14px; }
.search-field svg { width: 18px; height: 18px; fill: none; stroke: var(--text-muted); stroke-width: 1.8; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--text-primary); background: transparent; font-size: 13px; }
.search-field input::placeholder { color: var(--text-muted); }
.filter-field { min-width: 174px; padding: 0 12px; }
.filter-field select { width: 100%; border: 0; outline: 0; color: var(--text-primary); background: transparent; font-size: 13px; }
.recent-toggle { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; color: var(--text-secondary); font-size: 12px; cursor: pointer; white-space: nowrap; }
.recent-toggle input { position: absolute; opacity: 0; }
.toggle-track { width: 35px; height: 20px; position: relative; display: inline-block; border-radius: 99px; background: var(--border); transition: background .2s ease; }
.toggle-track::after { width: 14px; height: 14px; position: absolute; top: 3px; left: 3px; content: ""; border-radius: 50%; background: white; transition: transform .2s ease; }
.recent-toggle input:checked + .toggle-track { background: var(--brand-primary); }
.recent-toggle input:checked + .toggle-track::after { transform: translateX(15px); }
.recent-toggle input:focus-visible + .toggle-track { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

.station-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.station-card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.station-card:hover { border-color: var(--brand-primary); box-shadow: 0 8px 24px #00000030; transform: translateY(-2px); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.station-card h3 { margin: 0; font: 600 16px/1.4 "Poppins", sans-serif; }
.station-address { margin: 6px 0 0; color: var(--text-secondary); font-size: 12px; }
.demo-tag { display: inline-flex; flex: 0 0 auto; align-items: center; padding: 4px 7px; border-radius: 5px; background: var(--neutral-soft); color: var(--text-secondary); font-size: 9px; font-weight: 700; letter-spacing: .45px; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0 14px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status-pill::before { width: 7px; height: 7px; content: ""; border-radius: 50%; background: currentColor; }
.status-available, .status-operational { background: var(--success-soft); color: var(--success); }
.status-unavailable, .status-not-dispensing { background: var(--error-soft); color: var(--error); }
.status-unknown { background: var(--neutral-soft); color: var(--text-secondary); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.station-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.update-time { color: var(--text-muted); font-size: 11px; }
.freshness { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; }
.freshness::before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: currentColor; }
.freshness-fresh { color: var(--success); }
.freshness-outdated { color: var(--warning); }
.freshness-stale { color: var(--error); }
.card-actions { display: flex; justify-content: flex-end; margin-top: 13px; }
.text-link { color: var(--brand-primary); font-size: 12px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.disclaimer { display: flex; align-items: flex-start; gap: 9px; margin: 18px 0 0; color: var(--text-muted); font-size: 11px; }
.info-mark { width: 16px; height: 16px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--text-muted); border-radius: 50%; font-size: 10px; font-weight: 700; }

.state-panel { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 18px; border: 1px dashed var(--border); border-radius: 14px; color: var(--text-secondary); text-align: center; }
.state-panel h3 { margin: 0; color: var(--text-primary); font: 600 17px "Poppins", sans-serif; }
.state-panel p { margin: 5px 0 0; font-size: 13px; }
.error-panel { border-color: var(--error); background: var(--error-soft); color: var(--error); }
.loading-spinner { width: 24px; height: 24px; border: 3px solid var(--success-soft); border-top-color: var(--brand-primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer { min-height: 82px; gap: 18px; border-top: 1px solid var(--border); }
.footer-brand .brand-mark { width: 28px; height: 28px; }
.footer-brand .brand-name { font-size: 17px; }
.site-footer p, .site-footer > a:last-child { color: var(--text-muted); font-size: 11px; }
.site-footer > a:last-child { text-decoration: none; }

.inner-page { width: min(900px, calc(100% - 48px)); margin: 42px auto 70px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--brand-primary); font-size: 13px; font-weight: 600; text-decoration: none; }
.detail-hero { padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.detail-hero h1, .auth-heading h1, .dashboard-heading h1 { margin: 7px 0; font: 600 30px/1.25 "Poppins", sans-serif; letter-spacing: -.8px; }
.detail-location { margin: 0; color: var(--text-secondary); }
.detail-status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 23px; }
.detail-status-box { padding: 16px; border: 1px solid var(--border); border-radius: 12px; }
.detail-status-box h2 { margin: 0 0 8px; color: var(--text-muted); font: 600 11px "Inter", sans-serif; letter-spacing: .6px; text-transform: uppercase; }
.detail-updated { margin-top: 18px; color: var(--text-secondary); font-size: 12px; }
.freshness-banner { margin-top: 15px; padding: 12px 15px; border-radius: 10px; font-size: 12px; }
.freshness-banner.fresh { background: var(--success-soft); color: var(--success); }
.freshness-banner.outdated, .freshness-banner.stale { background: var(--warning-soft); color: var(--warning); }
.detail-info { margin-top: 17px; color: var(--text-muted); font-size: 12px; }
.alternative-section { margin-top: 34px; }
.alternative-section h2 { margin: 0; font: 600 20px "Poppins", sans-serif; }
.alternative-section > p { margin: 5px 0 16px; color: var(--text-secondary); font-size: 12px; }
.alternative-list { display: grid; gap: 10px; }
.alternative-card { padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.alternative-card h3 { margin: 0; font: 600 14px "Poppins", sans-serif; }
.alternative-card p { margin: 4px 0; color: var(--text-secondary); font-size: 11px; }
.alternative-card small { color: var(--text-muted); font-size: 10px; }
.no-alternatives { padding: 18px; border-radius: 12px; background: var(--surface); color: var(--text-secondary); font-size: 12px; }

.auth-layout { min-height: calc(100vh - 164px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { padding: 64px max(35px, calc((100vw - 1120px)/2)); padding-right: 50px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, var(--surface), var(--surface-elevated)); }
.auth-aside h1 { max-width: 440px; margin: 17px 0 12px; font: 600 clamp(32px, 4vw, 48px)/1.15 "Poppins", sans-serif; letter-spacing: -1.5px; }
.auth-aside h1 span { color: var(--brand-primary); }
.auth-aside > p { max-width: 420px; color: var(--text-secondary); font-size: 14px; }
.auth-benefit { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--text-secondary); font-size: 12px; }
.check-icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 40px #00000030; }
.auth-heading h1 { font-size: 25px; }
.auth-heading p { margin: 0 0 24px; color: var(--text-secondary); font-size: 13px; }
.form-field { display: block; margin-top: 17px; color: var(--text-primary); font-size: 12px; font-weight: 600; }
.form-field input, .form-field select { width: 100%; height: 46px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-primary); font-size: 13px; }
.button-primary, .button-secondary, .button-danger { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 0; border-radius: 8px; font-size: 12px; font-weight: 700; text-decoration: none; transition: background .15s ease, transform .15s ease; }
.button-primary { background: var(--button-primary); color: white; }
.button-primary:hover { background: var(--button-hover); }
.button-primary:active { background: var(--button-active); transform: translateY(1px); }
.button-primary:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.button-secondary { border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); }
.button-secondary:hover { border-color: #94a3b8; }
.button-danger { border: 1px solid var(--error); background: var(--error-soft); color: var(--error); }
.button-full { width: 100%; margin-top: 23px; }
.form-message { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 12px; }
.form-message.error { background: var(--error-soft); color: var(--error); }
.form-message.success { background: var(--success-soft); color: var(--success); }
.setup-notice { margin-bottom: 18px; padding: 11px 12px; border: 1px solid var(--warning); border-radius: 8px; background: var(--warning-soft); color: var(--warning); font-size: 11px; }
.auth-help { margin: 18px 0 0; color: var(--text-muted); font-size: 11px; text-align: center; }
.auth-help a { color: var(--brand-primary); font-weight: 600; }

.dashboard { width: min(1050px, calc(100% - 48px)); margin: 35px auto 70px; }
.dashboard-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 27px; }
.dashboard-heading .eyebrow { margin: 0; }
.dashboard-heading h1 { margin: 5px 0 0; font-size: 27px; }
.operator-info { display: flex; align-items: center; gap: 13px; }
.operator-email { color: var(--text-secondary); font-size: 11px; }
.registration-card { margin-bottom: 17px; }
.registration-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.registration-heading .eyebrow { margin-bottom: 3px; }
.registration-heading h2 { margin: 0; }
.registration-heading > p { margin: 0 0 3px; color: var(--text-muted); font-size: 11px; }
.registration-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: end; }
.registration-form > .form-field { min-width: 0; }
.registration-form .form-field span { color: var(--text-muted); font-weight: 400; }
.coordinate-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.registration-actions { display: flex; align-items: center; gap: 12px; padding-top: 17px; }
.registration-actions .button-primary { flex: 0 0 auto; }
.registration-actions .form-message { margin: 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .75fr); gap: 17px; align-items: start; }
.dashboard-card { padding: 22px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.dashboard-card h2 { margin: 0 0 16px; font: 600 17px "Poppins", sans-serif; }
.current-report { margin-bottom: 20px; padding: 15px; border-radius: 10px; background: var(--bg); }
.current-report .station-address { margin: 0 0 9px; }
.current-report .status-row { margin: 0; }
.dashboard-card .form-field:first-of-type { margin-top: 1; }
.select-station { margin-bottom: 19px; }
.select-station label { display: block; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.select-station select { width: 100%; height: 44px; margin-top: 7px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-primary); }
.history-list { display: grid; gap: 12px; }
.history-item { padding: 0 0 12px; border-bottom: 1px solid var(--border); }
.history-item:last-child { padding-bottom: 0; border-bottom: 0; }
.history-item p { margin: 0 0 3px; color: var(--text-primary); font-size: 11px; }
.history-item small { color: var(--text-muted); font-size: 10px; }
.history-empty { color: var(--text-muted); font-size: 12px; }
.dashboard-note { margin: 17px 0 0; color: var(--text-muted); font-size: 10px; }
.operator-empty { margin: 0 auto; max-width: 580px; padding: 40px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-align: center; }
.operator-empty h2 { font: 600 20px "Poppins", sans-serif; }
.operator-empty p { color: var(--text-secondary); font-size: 13px; }
.no-station-diagnostics { max-width: 100%; margin: 18px 0; padding: 12px 15px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); text-align: left; }
.no-station-diagnostics p { margin: 5px 0; overflow-wrap: anywhere; font-size: 12px; }
.no-station-diagnostics code { color: var(--text-primary); }
.operator-empty .button-secondary { margin-top: 8px; }

@media (max-width: 760px) {
  .site-header, .site-footer, .hero, .station-section { width: min(100% - 32px, 560px); }
  .site-header { height: 68px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 19px; }
  .main-nav { gap: 17px; }
  .nav-link { font-size: 11px; }
  .nav-link.active::after { bottom: -25px; }
  .hero { min-height: 0; margin-top: 17px; padding: 29px 25px; grid-template-columns: 1fr; gap: 20px; }
  .hero h1 { font-size: 43px; }
  .hero-description { max-width: 340px; font-size: 13px; }
  .hero-map { height: 230px; }
  .station-section { margin-top: 34px; }
  .section-heading h2 { font-size: 23px; }
  .section-subtitle { max-width: 300px; font-size: 11px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .search-field { grid-column: 1 / -1; height: 45px; }
  .filter-field { min-width: 0; height: 43px; }
  .recent-toggle { justify-content: center; font-size: 10px; }
  .station-grid { grid-template-columns: 1fr; gap: 11px; }
  .station-card { padding: 17px; }
  .site-footer { min-height: 75px; flex-wrap: wrap; justify-content: space-between; padding: 12px 0; gap: 6px; }
  .site-footer p { width: 100%; order: 2; margin: 0; }
  .inner-page, .dashboard { width: min(100% - 32px, 560px); margin-top: 26px; }
  .detail-hero { padding: 21px; }
  .detail-hero h1 { font-size: 24px; }
  .detail-status-grid { gap: 9px; }
  .detail-status-box { padding: 12px; }
  .auth-layout { display: block; }
  .auth-aside { display: none; }
  .auth-main { min-height: calc(100vh - 143px); align-items: flex-start; padding: 32px 16px; background: var(--bg); }
  .auth-card { padding: 26px 22px; }
  .dashboard-topbar { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .dashboard-heading h1 { font-size: 23px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .registration-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .registration-form { grid-template-columns: 1fr; }
  .registration-actions { align-items: stretch; flex-direction: column; }
  .registration-actions .button-primary { width: 100%; }
  .operator-info { width: 100%; justify-content: space-between; }
  .operator-empty { padding: 28px 20px; }
}

@media (max-width: 390px) {
  .site-header, .site-footer, .hero, .station-section, .inner-page, .dashboard { width: calc(100% - 24px); }
  .main-nav { gap: 10px; }
  .nav-link { font-size: 10px; }
  .hero { padding-inline: 19px; }
  .hero h1 { font-size: 39px; }
  .hero-map { height: 210px; }
  .detail-status-grid { grid-template-columns: 1fr; }
  .station-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
}

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