body {
  margin: 0;
  padding: 0;
  font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
  background-color: #f5f7fb;
}

a {
  color: #0d6efd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.landing-page {
  min-height: 100vh;
  padding: 4rem 6vw;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.landing-page .hero {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: center;
}

.landing-page .hero-text {
  flex: 1 1 320px;
}

.landing-page .hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #0d6efd;
  font-weight: 700;
}

.landing-page .hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.landing-page .hero-visual {
  flex: 1 1 280px;
  display: flex;
  justify-content: center;
}

.landing-page .visual-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 45px rgba(13, 110, 253, 0.15);
  min-width: 260px;
}

.landing-page .visual-card .qr-login {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.landing-page .visual-label {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

.landing-page .visual-metrics {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.landing-page .visual-metrics li {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.landing-page .visual-metrics strong {
  font-size: 1.3rem;
}

.landing-page .features,
.landing-page .security {
  background: white;
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 1rem 3rem rgba(15, 23, 42, 0.08);
}

.landing-page .section-subtitle {
  color: #6c757d;
  margin-bottom: 1.5rem;
}

.landing-page .feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.landing-page .feature-card {
  padding: 1.25rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid #eef2ff;
}

.landing-page .security-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.landing-page .security-list li {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

.pending-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #eef3fb;
}

.pending-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.15);
}

.dashboard-shell {
  min-height: 100vh;
  display: flex;
}

.dashboard-sidebar {
  width: 260px;
  background: #0b2239;
  color: white;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
}

.dashboard-sidebar .brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
}

.dashboard-sidebar .logo-initials {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1d9bf0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.dashboard-sidebar .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dashboard-sidebar .sidebar-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.65rem 0.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

.dashboard-sidebar .sidebar-link.active,
.dashboard-sidebar .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  text-decoration: none;
}

.dashboard-main {
  flex: 1;
  padding: 2rem;
  background: #eef3fb;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dashboard-topbar h1 {
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.dashboard-content .welcome-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.quick-link-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.quick-link-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wizard-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at top, #dff1ff, #eef3fb 55%);
}

.wizard-card {
  width: 100%;
  max-width: 640px;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 22px 45px rgba(14, 30, 67, 0.15);
  padding: 1.5rem;
}

.wizard-header {
  margin-bottom: 1rem;
}

.wizard-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0d6efd;
  font-weight: 700;
  font-size: 0.72rem;
}

.wizard-title {
  margin: 0.25rem 0 0;
}

.wizard-subtitle {
  color: #6c757d;
  margin-top: 0.25rem;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.wizard-step {
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #dbe5f2;
  color: #4b5d73;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.wizard-step span {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbe5f2;
  color: #233447;
  font-weight: 700;
  font-size: 0.76rem;
}

.wizard-step.active {
  border-color: #0d6efd;
  color: #0b3f99;
  background: #eef5ff;
}

.wizard-step.active span {
  background: #0d6efd;
  color: #ffffff;
}

.wizard-step.done {
  border-color: #198754;
  background: #ebfff4;
}

.wizard-step.done span {
  background: #198754;
  color: #ffffff;
}

.liff-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.liff-header {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
}

.liff-card-list {
  display: grid;
  gap: 0.75rem;
}

.liff-card {
  display: block;
  background: #ffffff;
  border: 1px solid #dbe5f2;
  border-radius: 0.9rem;
  padding: 0.9rem;
  color: #1f2f45;
  text-decoration: none;
}

.liff-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.liff-card p {
  margin: 0;
}

.liff-filter {
  background: #ffffff;
  border: 1px solid #dbe5f2;
  border-radius: 0.9rem;
  padding: 0.9rem;
}

.liff-scanner-card {
  background: #ffffff;
  border: 1px solid #dbe5f2;
  border-radius: 0.9rem;
  padding: 0.9rem;
}

#qr-reader {
  width: 100%;
  border: 0;
}

.quick-link-card a {
  font-weight: 600;
}

.aq-page {
  display: grid;
  gap: 1.5rem;
}

.aq-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.aq-hero-copy,
.aq-hero-metrics,
.aq-map-panel,
.aq-sidebar-card {
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.aq-hero-copy {
  padding: 1.75rem;
  background:
    radial-gradient(circle at top right, rgba(29, 155, 240, 0.16), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f4f9ff 100%);
}

.aq-eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
  color: #1461b8;
}

.aq-hero-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  line-height: 1.02;
  color: #13273d;
}

.aq-hero-text {
  margin: 0.9rem 0 0;
  color: #4f6378;
  max-width: 62ch;
  font-size: 1rem;
}

.aq-hero-metrics {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  background:
    linear-gradient(160deg, #12263f 0%, #0b2239 100%);
}

.aq-stat-card {
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.aq-stat-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.72);
}

.aq-stat-value {
  display: block;
  margin-top: 0.45rem;
  font-size: clamp(1.2rem, 2vw, 2rem);
}

.aq-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) 360px;
  gap: 1rem;
}

.aq-map-panel {
  padding: 1rem;
}

.aq-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.aq-panel-head p {
  color: #65788c;
}

.aq-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.aq-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #eff4fa;
  color: #24384f;
}

.aq-legend span::before {
  content: '';
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #74839a;
}

.aq-legend span[data-band='excellent']::before { background: #0b8f55; }
.aq-legend span[data-band='good']::before { background: #47b76b; }
.aq-legend span[data-band='moderate']::before { background: #f0b429; }
.aq-legend span[data-band='unhealthy']::before { background: #e35d3f; }
.aq-legend span[data-band='hazardous']::before { background: #932f6d; }

.aq-map {
  height: 68vh;
  min-height: 480px;
  border-radius: 1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(13, 110, 253, 0.18), transparent 35%),
    linear-gradient(180deg, #dceeff 0%, #f7fbff 100%);
}

.aq-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 0.85rem;
  align-items: end;
  margin: 0 0 0.9rem;
}

.aq-toolbar-group {
  min-width: 0;
}

.aq-toolbar-group .form-label {
  margin-bottom: 0.35rem;
  color: #41576d;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.aq-toolbar-status {
  align-self: center;
  justify-self: end;
  font-size: 0.85rem;
  color: #617388;
  background: #eff4fa;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
}

.aq-sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.aq-sidebar-card {
  padding: 1rem;
}

.aq-station-list {
  display: grid;
  gap: 0.65rem;
  max-height: calc(68vh - 80px);
  overflow-y: auto;
}

.aq-station-card {
  width: 100%;
  border: 0;
  background: #f5f9fd;
  border-radius: 1rem;
  padding: 0.85rem 0.9rem;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 0.75rem;
  text-align: left;
}

.aq-station-card:hover {
  background: #eaf3fb;
}

.aq-station-band {
  border-radius: 999px;
  min-height: 100%;
}

.aq-station-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.aq-station-head strong {
  font-size: 0.98rem;
  color: #1a2f44;
}

.aq-station-head span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #10263f;
}

.aq-station-copy p,
.aq-station-copy small {
  margin: 0.2rem 0 0;
  color: #607489;
}

.aq-station-sparkline {
  margin-top: 0.45rem;
  min-height: 54px;
}

.aq-empty {
  border: 1px dashed #c8d5e5;
  border-radius: 1rem;
  padding: 1.25rem;
  text-align: center;
  color: #6f7f90;
}

.aq-map-pin-wrap {
  background: transparent;
  border: 0;
}

.aq-map-pin {
  width: var(--pin-size, 44px);
  height: var(--pin-size, 44px);
  border-radius: var(--pin-radius, 18px) var(--pin-radius, 18px) var(--pin-radius, 18px) var(--pin-notch, 4px);
  transform: rotate(-45deg);
  background: var(--pin-color);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
}

.aq-map-pin span {
  transform: rotate(45deg);
  color: #ffffff;
  font-size: var(--pin-font-size, 12px);
  font-weight: 700;
}

.aq-province-pin {
  width: var(--province-size, 76px);
  height: var(--province-size, 76px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.34), transparent 30%),
    var(--pin-color);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
  color: #ffffff;
  display: grid;
  place-items: center;
  text-align: center;
  border: var(--province-border, 4px) solid rgba(255, 255, 255, 0.72);
}

.aq-province-pin strong {
  display: block;
  font-size: var(--province-count-size, 16px);
  line-height: 1;
}

.aq-province-pin span {
  display: block;
  margin-top: 0.2rem;
  max-width: var(--province-name-width, 56px);
  font-size: var(--province-name-size, 9px);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.aq-popup h3 {
  margin: 0;
  font-size: 1rem;
}

.aq-popup p {
  margin: 0.3rem 0 0.7rem;
  color: #617388;
}

.aq-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.aq-popup-grid span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #718395;
}

.aq-popup-grid strong {
  font-size: 1rem;
  color: #14283e;
}

.aq-popup-trend {
  margin: 0 0 0.75rem;
}

.aq-popup-trend span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #718395;
}

.aq-popup-list {
  display: grid;
  gap: 0.35rem;
}

.aq-popup-list div {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  font-size: 0.84rem;
  color: #52677d;
}

.aq-popup-list strong {
  color: #14283e;
  font-weight: 600;
}

.aq-sparkline {
  display: block;
  width: 100%;
  height: 54px;
  background:
    linear-gradient(180deg, rgba(29, 155, 240, 0.08), rgba(29, 155, 240, 0.01));
  border-radius: 0.7rem;
}

@media (max-width: 1100px) {
  .aq-hero,
  .aq-workspace {
    grid-template-columns: 1fr;
  }

  .aq-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aq-toolbar-status {
    justify-self: start;
  }

  .aq-sidebar {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .aq-station-list {
    max-height: 420px;
  }
}

@media (max-width: 900px) {
  .dashboard-shell {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: auto;
    padding: 1rem;
  }

  .dashboard-main {
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .aq-hero-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .aq-panel-head {
    flex-direction: column;
  }

  .aq-toolbar {
    grid-template-columns: 1fr;
  }

  .aq-map {
    height: 54vh;
    min-height: 360px;
  }
}

.report-page h1 {
  font-size: 2rem;
}

.report-page form .form-control[readonly] {
  background-color: #f8f9fa;
  cursor: default;
}

.report-page .chart-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
}

.report-page .chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.report-page .table-responsive {
  max-height: 500px;
  overflow-y: auto;
}

.report-page .card {
  border-radius: 0.75rem;
}

.report-page .trend-arrow {
  font-size: 0.85em;
  margin-left: 4px;
}

.report-page .trend-arrow.trend-up {
  color: #198754;
}

.report-page .trend-arrow.trend-down {
  color: #dc3545;
}

.report-page .nav-tabs .nav-link {
  font-weight: 600;
  color: #495057;
}

.report-page .nav-tabs .nav-link.active {
  color: #0d6efd;
}

.empty-state {
  background: white;
  border: 2px dashed #cbd5f5;
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state h3 {
  font-weight: 600;
}

.html-editor {
  min-height: 320px;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre;
}

.quill-editor {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #dce3f5;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.quill-editor .ql-toolbar {
  border-radius: 0.75rem 0.75rem 0 0;
}

.quill-editor .ql-container {
  min-height: 400px;
  border-radius: 0 0 0.75rem 0.75rem;
  font-size: 1rem;
}

.quill-editor .ql-editor {
  padding-bottom: 3rem;
}

.editor-tab-shell {
  margin-top: 1rem;
}

.editor-tab-nav {
  display: inline-flex;
  gap: 0.5rem;
  border-radius: 999px;
  background: #e9efff;
  padding: 0.25rem;
}

.editor-tab-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  color: #4c5d81;
}

.editor-tab-btn.active {
  background: white;
  color: #0d6efd;
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.2);
}

.editor-tab-content {
  background: white;
  border-radius: 1rem;
  border: 1px solid #dce3f5;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.06);
  padding: 1rem;
  margin-top: 1rem;
}

.editor-pane,
.preview-pane,
.raw-pane {
  display: none;
  min-height: 420px;
}

.editor-pane .quill-editor {
  border: none;
  box-shadow: none;
  min-height: 400px;
}

.preview-pane iframe,
.raw-pane textarea {
  width: 100%;
  min-height: 400px;
  border: none;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.raw-pane textarea {
  border: 1px solid #e2e8f0;
  padding: 1rem;
  resize: vertical;
}

.editor-pane.active,
.preview-pane.active,
.raw-pane.active {
  display: block;
}

.signature-shell {
  min-height: 100vh;
  padding: 1rem;
  background: #f0f4fb;
}

.signature-card {
  width: 100%;
  min-height: calc(100vh - 2rem);
  background: white;
  border-radius: 1.25rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.12);
}

.pad-wrapper {
  margin: 1.5rem 0;
  border: 2px dashed #cbd5f5;
  border-radius: 1rem;
  padding: 0.75rem;
  background: #fefefe;
}

#signature-canvas {
  width: 94%;
  height: 320px;
  display: block;
  margin: 0 auto;
  border-radius: 0.75rem;
  border: 1px solid #dce3f5;
  cursor: crosshair;
}

.signature-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.signature-status {
  margin-top: 1rem;
  min-height: 1.25rem;
}

@media (max-width: 600px) {
  .signature-shell {
    padding: 0;
  }
  .signature-card {
    border-radius: 0;
    min-height: 100vh;
    padding: 1rem;
    box-shadow: none;
  }
  .pad-wrapper {
    margin: 1rem 0;
    border-width: 1px;
  }
  #signature-canvas {
    width: 94%;
    height: 360px;
  }
  .signature-actions {
    flex-direction: column;
  }
  .signature-actions .btn {
    width: 100%;
  }
}

.tmd-page {
  display: grid;
  gap: 1.5rem;
}

.tmd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 1rem;
}

.tmd-hero-copy,
.tmd-hero-metrics,
.tmd-map-panel,
.tmd-sidebar-card {
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.tmd-hero-copy {
  padding: 1.75rem;
  background:
    radial-gradient(circle at top right, rgba(42, 157, 143, 0.15), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f5fbff 100%);
}

.tmd-eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f766e;
}

.tmd-hero-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.02;
  color: #13273d;
}

.tmd-hero-text {
  margin: 0.9rem 0 0;
  color: #4f6378;
  max-width: 62ch;
  font-size: 1rem;
}

.tmd-hero-metrics {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  background: linear-gradient(160deg, #16273f 0%, #11263c 100%);
}

.tmd-stat-card {
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.tmd-stat-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.72);
}

.tmd-stat-value {
  display: block;
  margin-top: 0.45rem;
  font-size: clamp(1.2rem, 2vw, 2rem);
}

.tmd-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) 360px;
  gap: 1rem;
}

.tmd-map-panel {
  padding: 1rem;
}

.tmd-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.tmd-panel-head p {
  color: #65788c;
}

.tmd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tmd-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #eff4fa;
  color: #24384f;
}

.tmd-legend span::before {
  content: '';
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
}

.tmd-legend span[data-type='cool']::before {
  background: #2b6cb0;
}

.tmd-legend span[data-type='mild']::before {
  background: #2f855a;
}

.tmd-legend span[data-type='warm']::before {
  background: #d69e2e;
}

.tmd-legend span[data-type='hot']::before {
  background: #dd6b20;
}

.tmd-legend span[data-type='extreme']::before {
  background: #c53030;
}

.tmd-toolbar {
  display: flex;
  gap: 0.85rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.tmd-toolbar-group .form-label {
  margin-bottom: 0.35rem;
  color: #41576d;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tmd-toolbar-status {
  align-self: center;
  justify-self: end;
  font-size: 0.85rem;
  color: #617388;
  background: #eff4fa;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
}

.tmd-map {
  height: 68vh;
  min-height: 480px;
  border-radius: 1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(28, 126, 214, 0.15), transparent 35%),
    linear-gradient(180deg, #dceeff 0%, #f7fbff 100%);
}

.tmd-sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.tmd-sidebar-card {
  padding: 1rem;
}

.tmd-activity-list {
  display: grid;
  gap: 0.65rem;
  max-height: calc(68vh - 80px);
  overflow-y: auto;
}

.tmd-activity-card {
  width: 100%;
  border: 0;
  background: #f5f9fd;
  border-radius: 1rem;
  padding: 0.9rem;
  text-align: left;
}

.tmd-activity-card:hover {
  background: #eaf3fb;
}

.tmd-activity-card strong {
  display: block;
  color: #1a2f44;
}

.tmd-activity-card p,
.tmd-activity-card small {
  display: block;
  margin: 0.25rem 0 0;
  color: #607489;
}

.tmd-type-badge {
  display: inline-flex;
  margin-bottom: 0.45rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tmd-type-badge[data-kind='cool'] {
  background: rgba(43, 108, 176, 0.12);
  color: #2b6cb0;
}

.tmd-type-badge[data-kind='mild'] {
  background: rgba(47, 133, 90, 0.12);
  color: #2f855a;
}

.tmd-type-badge[data-kind='warm'] {
  background: rgba(214, 158, 46, 0.14);
  color: #975a16;
}

.tmd-type-badge[data-kind='hot'] {
  background: rgba(221, 107, 32, 0.14);
  color: #c05621;
}

.tmd-type-badge[data-kind='extreme'] {
  background: rgba(197, 48, 48, 0.14);
  color: #c53030;
}

.tmd-empty {
  border: 1px dashed #c8d5e5;
  border-radius: 1rem;
  padding: 1.25rem;
  text-align: center;
  color: #6f7f90;
}

.tmd-marker-wrap {
  background: transparent;
  border: 0;
}

.tmd-weather-pin {
  width: var(--marker-size, 28px);
  height: var(--marker-size, 28px);
  border-radius: 40% 40% 40% 12%;
  transform: rotate(-45deg);
  background: var(--pin-color, #2f855a);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tmd-weather-pin span {
  transform: rotate(45deg);
  color: #ffffff;
  font-size: max(10px, calc(var(--marker-size, 28px) * 0.28));
  font-weight: 700;
}

.tmd-popup h3 {
  margin: 0;
  font-size: 1rem;
}

.tmd-popup p {
  margin: 0.3rem 0 0.7rem;
  color: #617388;
}

.tmd-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}

.tmd-popup-grid span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #718395;
}

.tmd-popup-grid strong {
  font-size: 1rem;
  color: #14283e;
}

.tmd-popup-trend {
  margin-bottom: 0.75rem;
}

.tmd-popup-trend span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #718395;
}

.tmd-popup-list {
  display: grid;
  gap: 0.35rem;
}

.tmd-popup-list div {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  color: #52677d;
}

.tmd-sparkline {
  display: block;
  width: 100%;
  height: 54px;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, rgba(28, 126, 214, 0.08), rgba(28, 126, 214, 0.01));
}

@media (max-width: 1100px) {
  .tmd-hero,
  .tmd-workspace {
    grid-template-columns: 1fr;
  }

  .tmd-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tmd-toolbar-status {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .tmd-toolbar {
    flex-direction: column;
  }

  .tmd-map {
    height: 54vh;
    min-height: 360px;
  }
}
