@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─────────────────────────────────────────────────────────────────────────
   Design tokens
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --accent:        #4f46e5;
  --accent-light:  #eef2ff;
  --bg-primary:    #f7f6f2;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #ffffff;
  --bg-quaternary: #f2f1ed;
  --text-primary:  #1c1c28;
  --text-secondary:#44445a;
  --text-muted:    #888898;
  --border-color:  rgba(0, 0, 0, 0.07);
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:     0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-color:  rgba(0, 0, 0, 0.07);
  --chart-grid:    rgba(0, 0, 0, 0.07);
  --chart-text:    #1c1c28;
  --radius:        12px;
  --radius-sm:     7px;
}

/* ── Mermug — warm dark brown inspired by the vessel logo ── */
[data-theme="mermug"] {
  --accent:        #e0692a;
  --accent-light:  rgba(224, 105, 42, 0.16);
  --bg-primary:    #1a0d06;
  --bg-secondary:  #241208;
  --bg-tertiary:   #241208;
  --bg-quaternary: #301a0a;
  --text-primary:  #f0dfc0;
  --text-secondary:#c09868;
  --text-muted:    #7a5030;
  --border-color:  rgba(255, 255, 255, 0.07);
  --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:     0 4px 20px rgba(0, 0, 0, 0.55);
  --shadow-color:  rgba(0, 0, 0, 0.55);
  --chart-grid:    rgba(255, 255, 255, 0.07);
  --chart-text:    #f0dfc0;
}

/* ── Marine — deep navy + burned orange + teal (classic vessel colors) ── */
[data-theme="marine"] {
  --accent:        #e0752a;
  --accent-light:  rgba(224, 117, 42, 0.16);
  --bg-primary:    #0c1520;
  --bg-secondary:  #121e2c;
  --bg-tertiary:   #121e2c;
  --bg-quaternary: #192638;
  --text-primary:  #f0e8d8;
  --text-secondary:#b8a888;
  --text-muted:    #607080;
  --border-color:  rgba(255, 255, 255, 0.07);
  --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:     0 4px 20px rgba(0, 0, 0, 0.55);
  --shadow-color:  rgba(0, 0, 0, 0.55);
  --chart-grid:    rgba(255, 255, 255, 0.07);
  --chart-text:    #f0e8d8;
}

/* ── Bright — clean white with vivid ocean-blue accent ── */
[data-theme="bright"] {
  --accent:        #0ea5e9;
  --accent-light:  rgba(14, 165, 233, 0.12);
  --bg-primary:    #f0f9ff;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #ffffff;
  --bg-quaternary: #e0f2fe;
  --text-primary:  #0c1a2e;
  --text-secondary:#1e4060;
  --text-muted:    #5a80a0;
  --border-color:  rgba(0, 0, 0, 0.07);
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:     0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-color:  rgba(0, 0, 0, 0.07);
  --chart-grid:    rgba(0, 0, 0, 0.07);
  --chart-text:    #0c1a2e;
  --radius:        12px;
  --radius-sm:     7px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 20px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─────────────────────────────────────────────────────────────────────────
   Page container
   ───────────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), 0 20px 60px var(--shadow-color);
  overflow: hidden;
  transition: background-color 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────────────────
   Status hero
   ───────────────────────────────────────────────────────────────────────── */
#status-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  background: #b85010;
  color: #ffffff;
}

#status-hero.stale {
  background: #8b2010;
  color: #ffd0c0;
}

.status-hero__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.status-hero__logo {
  height: 96px;
  width: auto;
  object-fit: contain;
  display: block;
}

#status-vessel {
  font-weight: 700;
  font-size: 1.3em;
  color: #ffffff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1.2;
}

.status-hero__right {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#status-sentence {
  font-size: 1.05em;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

#status-age {
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────────────────────────────────────
   Map
   ───────────────────────────────────────────────────────────────────────── */
.map-section {
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────
   Passage banner
   ───────────────────────────────────────────────────────────────────────── */
.passage-banner {
  padding: 9px 28px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8em;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.015em;
}

/* ─────────────────────────────────────────────────────────────────────────
   Links section
   ───────────────────────────────────────────────────────────────────────── */
.links-section {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-color);
}

/* ─────────────────────────────────────────────────────────────────────────
   Info panels
   ───────────────────────────────────────────────────────────────────────── */
.info-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-tertiary);
  padding: 22px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  margin: 0 28px 20px;
  transition: background-color 0.3s ease;
}

/* All panels are wrapped in .content-panels, which adds the top gap */
.content-panels {
  padding-top: 20px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Data grid
   ───────────────────────────────────────────────────────────────────────── */
.data-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.info-item {
  text-align: center;
  padding: 10px 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-quaternary);
  transition: background-color 0.15s ease;
}

@media (hover: hover) {
  .info-item:hover {
    background-color: var(--accent-light);
  }
}

.info-item[data-unit-group] {
  cursor: pointer;
  user-select: none;
}

.info-item[data-unit-group]:active {
  transform: scale(0.96);
}

.label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.65em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
}

.value {
  font-size: 1.15em;
  color: var(--text-primary);
  margin-top: 5px;
  font-weight: 600;
  font-family: 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
  transition: color 0.3s ease;
  line-height: 1.3;
}

/* ─────────────────────────────────────────────────────────────────────────
   Panel title
   ───────────────────────────────────────────────────────────────────────── */
.panel-title {
  font-weight: 600;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────
   Semantic value colors
   ───────────────────────────────────────────────────────────────────────── */
.value-sub {
  display: block;
  font-size: 0.78em;
  opacity: 0.65;
  margin-top: 1px;
  font-family: 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.value-ok    { color: #1e8f58; }
.value-warn  { color: #b66b00; }
.value-alert { color: #b62323; }
.value-na    { color: var(--text-muted); font-weight: 400; }
.value-text  { font-family: inherit; }

[data-theme="dark"] .value-ok    { color: #6dbb8a; }
[data-theme="dark"] .value-warn  { color: #c9a060; }
[data-theme="dark"] .value-alert { color: #d47878; }

/* ─────────────────────────────────────────────────────────────────────────
   Track legend
   ───────────────────────────────────────────────────────────────────────── */
.track-legend {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.75em;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.7;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
}

.track-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.track-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   Sparklines
   ───────────────────────────────────────────────────────────────────────── */
.sparkline-inline {
  display: block;
  width: 100%;
  margin-top: 8px;
  border-radius: 3px;
  opacity: 0.9;
}

.sparkline-toggle-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.72em;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.sparkline-toggle-btn:hover {
  background: var(--bg-quaternary);
  color: var(--text-primary);
}

.sparkline-tooltip {
  position: absolute;
  z-index: 1000;
  background: rgba(10, 14, 20, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  pointer-events: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  font-family: 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
}

.sparkline-tooltip__label {
  font-weight: 600;
  margin-bottom: 4px;
}

.sparkline-tooltip__canvas { display: block; }

.sparkline-tooltip__status {
  margin-top: 4px;
  opacity: 0.7;
}

/* ─────────────────────────────────────────────────────────────────────────
   Action buttons
   ───────────────────────────────────────────────────────────────────────── */
.button-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: auto;
  justify-content: flex-end;
}

.action-btn {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.82em;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.action-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.action-btn:active {
  transform: translateY(0);
  opacity: 1;
  box-shadow: none;
}

.ais-btn { background-color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────────
   Map + charts
   ───────────────────────────────────────────────────────────────────────── */
#map {
  height: 550px;
  width: 100%;
}

#tideChart {
  width: 100%;
  height: 250px !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Polar performance
   ───────────────────────────────────────────────────────────────────────── */
.polar-performance-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
}

/* Engine-on badge overlaid on the polar chart */
.polar-engine-indicator {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.88);
  color: #fff;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.40);
}

/* ─────────────────────────────────────────────────────────────────────────
   Forecast header + model selector
   ───────────────────────────────────────────────────────────────────────── */
.forecast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.forecast-header .panel-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
  flex: 1;
}

.forecast-model-select {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-quaternary);
  color: var(--text-secondary);
  font-size: 0.75em;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.forecast-model-select:hover,
.forecast-model-select:focus {
  border-color: var(--accent);
}


/* ─────────────────────────────────────────────────────────────────────────
   Polar sub-cards
   ───────────────────────────────────────────────────────────────────────── */
.polar-data-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.polar-sub-card {
  background: var(--bg-quaternary);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.polar-sub-title {
  font-weight: 600;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.polar-sub-body {
  font-size: 0.88em;
  color: var(--text-secondary);
}

.polar-chart-container {
  position: relative;
  height: 600px;
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────
   Forecast grids
   ───────────────────────────────────────────────────────────────────────── */
.wind-forecast-grid,
.wave-forecast-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.wind-forecast-item {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  color: white;
  box-shadow: 0 2px 8px rgba(116, 185, 255, 0.25);
}

.wind-time, .wave-time {
  font-size: 0.78em;
  font-weight: 600;
  margin-bottom: 7px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wind-speed, .wave-height {
  font-size: 1.2em;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: 'Courier New', monospace;
}

.wind-direction, .wave-direction {
  font-size: 0.88em;
  opacity: 0.85;
}

.wave-forecast-item {
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ─────────────────────────────────────────────────────────────────────────
   Alert summary
   ───────────────────────────────────────────────────────────────────────── */
#alert-summary {
  border-left-color: var(--border-color);
}

/* Per-panel accent colors on the left border */
#navigation-panel  { border-left-color: #4a90d9; }
#wind-panel        { border-left-color: #00b4d8; }
#power-panel       { border-left-color: #f59e0b; }
#vessel-panel      { border-left-color: #8b5cf6; }
#environment-panel { border-left-color: #10b981; }
#internet-panel    { border-left-color: #f97316; }
#propulsion-panel  { border-left-color: #ef4444; }
#tanks-panel       { border-left-color: #a78bfa; }

.alert-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  min-width: 80px;
}

.alert-chip--alert {
  color: #b62323;
  border-color: rgba(182, 35, 35, 0.35);
  background: rgba(182, 35, 35, 0.05);
}

.alert-chip--warn {
  color: #b66b00;
  border-color: rgba(182, 107, 0, 0.35);
  background: rgba(182, 107, 0, 0.05);
}

[data-theme="dark"] .alert-chip--alert {
  color: #d47878;
  border-color: rgba(212, 120, 120, 0.35);
  background: rgba(212, 120, 120, 0.07);
}

[data-theme="dark"] .alert-chip--warn {
  color: #c9a060;
  border-color: rgba(201, 160, 96, 0.35);
  background: rgba(201, 160, 96, 0.07);
}

.alert-chip__label {
  font-size: 0.65em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  opacity: 0.7;
}

.alert-chip__value {
  font-weight: 700;
  font-size: 0.95em;
  margin-top: 2px;
  font-family: 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
}

/* ─────────────────────────────────────────────────────────────────────────
   Skeleton / empty states
   ───────────────────────────────────────────────────────────────────────── */
.skeleton-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  min-height: 70px;
}

.skeleton-bar {
  height: 11px;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg,
    var(--bg-quaternary) 25%,
    var(--bg-secondary)  50%,
    var(--bg-quaternary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-label { width: 60%; margin: 0 auto 10px; height: 10px; }
.skeleton-value { width: 80%; margin: 0 auto; height: 16px; }

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  padding: 30px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  background: var(--bg-quaternary);
}

.empty-state strong {
  display: block;
  font-size: 1em;
  margin-bottom: 6px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Dark mode toggle (floating tab)
   ───────────────────────────────────────────────────────────────────────── */
.floating-dark-mode-btn {
  position: fixed;
  left: 0;
  top: 100px;
  z-index: 1000;
  padding: 14px 7px;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--text-secondary);
  color: var(--bg-primary);
  cursor: pointer;
  font-size: 0.7em;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  transition: opacity 0.2s ease, background 0.3s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
}

.floating-dark-mode-btn:hover { opacity: 1; }
.floating-dark-mode-btn:active { opacity: 0.7; }

[data-theme="dark"] .floating-dark-mode-btn {
  background: #f59e0b;
  color: #0e1118;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
}

/* ─────────────────────────────────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 32px 16px 20px;
  font-size: 0.75em;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  transition: color 0.3s ease;
}

.footer-logo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 12px;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.footer-logo:hover {
  opacity: 0.85;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────────────
   Tide Panel
   ───────────────────────────────────────────────────────────────────────── */

#tide-panel {
  padding: 0;
  overflow: hidden;
}

#tide-panel .panel-title {
  padding: 7px 14px;
  margin-bottom: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border-color);
}

/* ─────────────────────────────────────────────────────────────────────────
   Conditions Forecast Panel
   ───────────────────────────────────────────────────────────────────────── */

.conditions-forecast-panel {
  padding: 0;
  overflow: hidden;       /* clip chart stack to panel border-radius */
  border-left-color: #0ea5e9;
}

/* Compact header strip — tight padding, single divider into the chart grid */
.conditions-forecast-panel .conditions-header {
  padding: 7px 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color);
}

/* Panel-title inside the header needs no extra bottom space or border */
.conditions-forecast-panel .panel-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Chart stack fills edge-to-edge inside the panel frame */
.conditions-forecast-panel .conditions-chart-stack {
  border: none;
  border-radius: 0;
  padding-right: 8px;
}

.conditions-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.conditions-date-range {
  margin-left: auto;
  font-size: 0.75em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.conditions-loading {
  font-size: 0.85em;
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
}

/* Outer border that wraps all rows */
.conditions-chart-stack {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Each metric row */
.conditions-row {
  display: flex;
  align-items: stretch;
  height: 78px;
  border-bottom: 1px solid var(--border-color);
}

.conditions-row--last {
  border-bottom: none;
  height: 120px; /* extra room for rotated x-axis tick labels */
}

/* Sidebar: label + current value */
.conditions-row-label {
  flex: 0 0 82px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 0 8px 0 10px;
  gap: 2px;
  background: var(--bg-quaternary);
  border-right: 1px solid var(--border-color);
}

.cr-name {
  font-size: 0.60em;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cr-value {
  font-size: 1.05em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.1;
  font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
}

.cr-unit {
  font-size: 0.60em;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1;
}

/* Canvas area */
.conditions-canvas-wrap {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.conditions-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Mobile: shrink sidebar */
@media (max-width: 600px) {
  .conditions-row-label {
    flex: 0 0 68px;
    padding: 0 6px 0 6px;
  }
  .cr-value { font-size: 0.9em; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .data-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .data-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  body { padding: 0; }

  .container {
    border-radius: 0;
    box-shadow: none;
  }

  .info-panel { margin: 0 16px 16px; }

  .data-grid { grid-template-columns: repeat(2, 1fr); }

  .button-row {
    flex-direction: column;
    gap: 8px;
  }

  .action-btn { text-align: center; }

  .wind-forecast-grid,
  .wave-forecast-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .polar-performance-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }

  #polar-performance-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }

  .polar-chart-container { height: 360px !important; }

  .links-section { padding: 16px; }
}

@media (max-width: 600px) {
  #status-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
  }

  .status-hero__logo { height: 76px; }

  #status-sentence { white-space: normal; }

  #map { height: 320px; }

  .polar-chart-container { height: 320px !important; }


  #track-info { text-align: center !important; }

  .floating-dark-mode-btn {
    padding: 10px 5px;
    min-height: 90px;
  }
}
