/* ─────────────────────────────────────────────────────────────
   Sun Path Map  (/sunmap)  ·  E23BMY
   ───────────────────────────────────────────────────────────── */

:root {
  --sm-bg0: #030b14;
  --sm-bg1: #061827;
  --sm-bg2: #0a2233;
  --sm-ink: #eaf7ff;
  --sm-muted: #8db2c7;
  --sm-dim: #5f8298;
  --sm-cyan: #3ee8ff;
  --sm-teal: #1ad1b0;
  --sm-amber: #ffcf5c;
  --sm-sun: #ffd166;
  --sm-coral: #ff7a59;
  --sm-violet: #b39dff;
  --sm-green: #7ef0b2;
  --sm-glass: rgba(5, 20, 33, 0.66);
  --sm-glass-2: rgba(9, 31, 48, 0.46);
  --sm-stroke: rgba(120, 220, 255, 0.16);
  --sm-stroke-strong: rgba(120, 220, 255, 0.38);
  --sm-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
  --sm-sans: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --sm-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body.sm-body {
  margin: 0;
  min-height: 100%;
  color: var(--sm-ink);
  font-family: var(--sm-sans);
  background:
    radial-gradient(1100px 700px at 50% -10%, #0b2c42 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 100%, #071c2b 0%, transparent 58%),
    linear-gradient(160deg, var(--sm-bg0) 0%, var(--sm-bg1) 48%, #020810 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }

/* ── Background ─────────────────────────────────────────────── */
.sm-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.sm-bg-sun {
  position: absolute;
  top: -260px;
  right: -160px;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 207, 92, 0.16), rgba(255, 138, 61, 0.05) 45%, transparent 70%);
  filter: blur(4px);
}
.sm-bg-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(62, 232, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 232, 255, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(900px) rotateX(58deg) translateY(-6%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 72%);
  opacity: 0.5;
}
.sm-bg-glow {
  position: absolute;
  left: -180px;
  bottom: -220px;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 232, 255, 0.12), transparent 68%);
  filter: blur(20px);
}

/* ── Header ─────────────────────────────────────────────────── */
.sm-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(14px, 3vw, 42px);
  border-bottom: 1px solid rgba(120, 220, 255, 0.1);
  background: linear-gradient(180deg, rgba(3, 11, 20, 0.9), rgba(3, 11, 20, 0.45));
  backdrop-filter: blur(14px);
}
.sm-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.sm-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--sm-sun);
  background: radial-gradient(circle at 50% 40%, rgba(255, 209, 102, 0.16), rgba(62, 232, 255, 0.05));
  border: 1px solid rgba(255, 209, 102, 0.28);
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.14);
}
.sm-brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.sm-kicker-top {
  font-family: var(--sm-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--sm-dim);
}
.sm-brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--sm-ink);
}
.sm-header-mid { display: flex; align-items: center; gap: 18px; }
.sm-coords {
  font-family: var(--sm-mono);
  font-size: 12px;
  color: var(--sm-muted);
  padding: 6px 12px;
  border: 1px solid var(--sm-stroke);
  border-radius: 999px;
  background: rgba(6, 24, 39, 0.7);
  white-space: nowrap;
}
.sm-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.sm-clock b { font-family: var(--sm-mono); font-size: 18px; font-weight: 500; letter-spacing: 0.04em; }
.sm-clock small { font-size: 10px; color: var(--sm-dim); letter-spacing: 0.08em; }
.sm-nav { display: flex; align-items: center; gap: 14px; }
.sm-lang { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--sm-stroke); border-radius: 999px; }
.sm-lang a {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  color: var(--sm-dim);
}
.sm-lang a.is-on { color: #041019; background: var(--sm-cyan); }
.sm-ghost-btn {
  font-size: 12px;
  text-decoration: none;
  color: var(--sm-muted);
  padding: 8px 14px;
  border: 1px solid var(--sm-stroke);
  border-radius: 10px;
  transition: 0.18s ease;
  white-space: nowrap;
}
.sm-ghost-btn:hover { color: var(--sm-ink); border-color: var(--sm-stroke-strong); background: rgba(62, 232, 255, 0.06); }

/* ── Main ───────────────────────────────────────────────────── */
.sm-main {
  position: relative;
  z-index: 2;
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 40px) clamp(14px, 3vw, 42px) 60px;
}

.sm-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 10px 0 26px;
}
.sm-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-family: var(--sm-mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--sm-cyan);
  text-transform: uppercase;
}
.sm-eyebrow span { width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--sm-cyan)); }
.sm-title {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.sm-title em {
  font-style: normal;
  color: var(--sm-sun);
  text-shadow: 0 0 42px rgba(255, 209, 102, 0.22);
}
.sm-subtitle {
  max-width: 720px;
  margin: 14px 0 0;
  font-size: clamp(13px, 1.15vw, 15px);
  line-height: 1.75;
  color: var(--sm-muted);
}
.sm-hero-badge {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 16px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  background: radial-gradient(circle at 50% 0%, rgba(255, 209, 102, 0.12), rgba(6, 24, 39, 0.7));
  box-shadow: var(--sm-shadow);
}
.sm-badge-label { font-family: var(--sm-mono); font-size: 9px; letter-spacing: 0.3em; color: var(--sm-dim); }
.sm-hero-badge b { font-family: var(--sm-mono); font-size: 34px; font-weight: 500; color: var(--sm-sun); line-height: 1.05; }
.sm-badge-unit { font-size: 10px; color: var(--sm-dim); letter-spacing: 0.1em; }
.sm-hero-badge i { font-family: var(--sm-mono); font-style: normal; font-size: 11px; color: var(--sm-muted); margin-top: 4px; }

/* ── Toolbar ────────────────────────────────────────────────── */
.sm-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(190px, 0.8fr) minmax(190px, 0.8fr) minmax(130px, 0.55fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--sm-stroke);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 31, 48, 0.78), rgba(4, 16, 27, 0.72));
  box-shadow: var(--sm-shadow);
}
.sm-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.sm-field label {
  font-family: var(--sm-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sm-dim);
}
.sm-search-row { display: flex; gap: 7px; }
.sm-coord-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.sm-field input[type="search"],
.sm-field input[type="number"],
.sm-field input[type="date"],
.sm-field select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  color: var(--sm-ink);
  font-family: var(--sm-sans);
  font-size: 13px;
  background: rgba(2, 12, 21, 0.85);
  border: 1px solid var(--sm-stroke);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.sm-field input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.75) sepia(0.2) hue-rotate(150deg); cursor: pointer; }
.sm-field input:focus,
.sm-field select:focus { border-color: rgba(62, 232, 255, 0.55); box-shadow: 0 0 0 3px rgba(62, 232, 255, 0.1); }
.sm-field input::placeholder { color: #4c6b7f; }

.sm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  color: var(--sm-ink);
  font-family: var(--sm-sans);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--sm-stroke);
  border-radius: 10px;
  background: rgba(10, 34, 51, 0.9);
  transition: 0.16s ease;
}
.sm-btn:hover { border-color: var(--sm-stroke-strong); background: rgba(16, 48, 70, 0.95); }
.sm-btn-primary {
  color: #031018;
  font-weight: 600;
  border-color: transparent;
  background: linear-gradient(135deg, var(--sm-cyan), #7ff0ff);
  box-shadow: 0 6px 22px rgba(62, 232, 255, 0.22);
}
.sm-btn-primary:hover { background: linear-gradient(135deg, #7ff0ff, var(--sm-cyan)); }
.sm-btn-icon { padding: 8px 10px; }
.sm-btn-small { padding: 6px 11px; font-size: 11px; }
.sm-btn.is-on { color: #031018; background: var(--sm-sun); border-color: transparent; }

.sm-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.sm-presets > span { font-size: 10px; color: var(--sm-dim); margin-right: 2px; }
.sm-chip {
  padding: 4px 9px;
  font-family: var(--sm-sans);
  font-size: 10.5px;
  color: var(--sm-muted);
  cursor: pointer;
  border: 1px solid var(--sm-stroke);
  border-radius: 999px;
  background: transparent;
  transition: 0.16s ease;
}
.sm-chip:hover { color: var(--sm-cyan); border-color: rgba(62, 232, 255, 0.5); }

/* ── Grid + cards ───────────────────────────────────────────── */
.sm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.sm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--sm-stroke);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 31, 48, 0.72), rgba(4, 15, 26, 0.8));
  box-shadow: var(--sm-shadow);
  overflow: hidden;
}
.sm-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.sm-card-head h2,
.sm-section-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.sm-card-head p,
.sm-section-head p { margin: 4px 0 0; font-size: 11px; line-height: 1.55; color: var(--sm-dim); }
.sm-card-tag {
  flex: 0 0 auto;
  font-family: var(--sm-mono);
  font-size: 10px;
  color: var(--sm-cyan);
  padding: 4px 9px;
  border: 1px solid rgba(62, 232, 255, 0.24);
  border-radius: 999px;
  background: rgba(62, 232, 255, 0.06);
}

/* ── Map ────────────────────────────────────────────────────── */
.sm-map-wrap {
  position: relative;
  flex: 1;
  min-height: 430px;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(120, 220, 255, 0.12);
  background: #04101b;
}
.sm-map { position: absolute; inset: 0; z-index: 1; background: #04101b; }

.sm-map-legend {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 400;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  max-width: calc(100% - 20px);
  margin: 0;
  padding: 8px 11px;
  list-style: none;
  font-size: 10px;
  color: var(--sm-muted);
  background: rgba(3, 13, 22, 0.82);
  border: 1px solid var(--sm-stroke);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}
.sm-map-legend li { display: flex; align-items: center; gap: 5px; }
.sm-map-legend i { width: 14px; height: 2px; border-radius: 2px; }
.sm-map-legend .lg-arc { background: var(--sm-cyan); opacity: 0.75; }
.sm-map-legend .lg-rise { background: var(--sm-amber); }
.sm-map-legend .lg-noon { background: #ffffff; }
.sm-map-legend .lg-set { background: var(--sm-coral); }
.sm-map-legend .lg-sun { background: var(--sm-sun); box-shadow: 0 0 8px var(--sm-sun); }

/* Leaflet dark polish */
.leaflet-container { background: #04101b; font-family: var(--sm-sans); }
.leaflet-control-attribution {
  background: rgba(3, 13, 22, 0.78) !important;
  color: #6f92a6 !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: #8db2c7 !important; }
.leaflet-bar a,
.leaflet-bar a:hover {
  color: var(--sm-ink) !important;
  background: rgba(6, 24, 39, 0.92) !important;
  border-bottom-color: var(--sm-stroke) !important;
}
.leaflet-bar { border: 1px solid var(--sm-stroke) !important; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important; }
.leaflet-control-layers {
  color: var(--sm-ink);
  background: rgba(6, 24, 39, 0.92) !important;
  border: 1px solid var(--sm-stroke) !important;
  border-radius: 10px !important;
}
.leaflet-control-layers-separator { border-top-color: var(--sm-stroke) !important; }

.sm-pin {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--sm-sun);
  background: rgba(4, 16, 27, 0.9);
  border: 1.5px solid var(--sm-sun);
  box-shadow: 0 0 0 6px rgba(255, 209, 102, 0.14), 0 6px 18px rgba(0, 0, 0, 0.55);
  cursor: grab;
}
.sm-pin::before {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 209, 102, 0.35);
  animation: sm-ping 2.6s ease-out infinite;
}
@keyframes sm-ping {
  0% { transform: scale(0.55); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.sm-map-label {
  font-family: var(--sm-mono);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  color: var(--sm-ink);
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--sm-stroke);
  background: rgba(3, 13, 22, 0.88);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.sm-map-label b { color: var(--sm-sun); font-weight: 600; }
.sm-map-label.is-rise b { color: var(--sm-amber); }
.sm-map-label.is-set b { color: var(--sm-coral); }
.sm-map-label.is-noon b { color: #fff; }

/* ── Chart ──────────────────────────────────────────────────── */
.sm-chart-card { min-height: 0; }
.sm-view { display: none; }
.sm-view.is-on { display: block; }
.sm-chart { width: 100%; }
.sm-chart svg { display: block; width: 100%; height: auto; overflow: visible; }

.sm-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--sm-stroke); border-radius: 10px; background: rgba(2, 12, 21, 0.6); }
.sm-tab {
  padding: 5px 10px;
  font-family: var(--sm-sans);
  font-size: 10.5px;
  color: var(--sm-dim);
  cursor: pointer;
  border: 0;
  border-radius: 7px;
  background: transparent;
  transition: 0.16s ease;
}
.sm-tab.is-on { color: #031018; background: var(--sm-cyan); font-weight: 600; }

.sm-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  font-size: 9.5px;
  color: var(--sm-dim);
}
.sm-chart-legend li { display: flex; align-items: center; gap: 5px; }
.sm-chart-legend i { width: 13px; height: 0; border-top: 2px solid var(--sm-cyan); }
.sm-chart-legend .cl-summer { border-top-color: #ffcf5c; }
.sm-chart-legend .cl-winter { border-top-color: #7fb3ff; border-top-style: dashed; }
.sm-chart-legend .cl-equinox { border-top-color: #9be9c1; border-top-style: dashed; }
.sm-chart-legend .cl-band { border: 0; height: 9px; background: rgba(255, 207, 92, 0.16); border-radius: 2px; }
.sm-chart-legend .cl-panel { border-top-color: var(--sm-violet); border-top-style: dotted; }

.sm-chart-card.is-3d .sm-toggle-row { display: none; }
.sm-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(120, 220, 255, 0.09);
}
.sm-check { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--sm-muted); cursor: pointer; }
.sm-check input { appearance: none; width: 13px; height: 13px; border: 1px solid var(--sm-stroke-strong); border-radius: 4px; background: rgba(2, 12, 21, 0.8); position: relative; cursor: pointer; }
.sm-check input:checked { background: var(--sm-cyan); border-color: var(--sm-cyan); }
.sm-check input:checked::after {
  content: "";
  position: absolute;
  left: 3.5px; top: 1px;
  width: 3px; height: 7px;
  border: solid #031018;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}

.sm-timeline { margin-top: 12px; }
.sm-timeline-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 11px; color: var(--sm-muted); }
.sm-timeline-top b { font-family: var(--sm-mono); font-size: 13px; color: var(--sm-ink); }
.sm-timeline-actions { display: flex; gap: 6px; }

input.sm-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 6px 0;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(62, 232, 255, 0.35), rgba(255, 209, 102, 0.5));
  outline: none;
  cursor: pointer;
}
input.sm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sm-sun);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.5);
  cursor: grab;
}
input.sm-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sm-sun);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.5);
  cursor: grab;
}

/* ── 3-D dome ───────────────────────────────────────────────── */
.sm-dome { position: relative; width: 100%; height: clamp(380px, 44vw, 540px); border-radius: 13px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #071e2e, #02090f 75%); border: 1px solid rgba(120, 220, 255, 0.1); }
.sm-dome canvas { display: block; }
.sm-dome-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--sm-dim);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sm-dome.is-ready .sm-dome-hint { opacity: 0; }

/* ── Stats ──────────────────────────────────────────────────── */
.sm-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.sm-stat {
  position: relative;
  padding: 13px 14px;
  border: 1px solid var(--sm-stroke);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(9, 31, 48, 0.6), rgba(4, 15, 26, 0.75));
  overflow: hidden;
}
.sm-stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sm-cyan), transparent);
  opacity: 0.5;
}
.sm-stat-rise::before { background: linear-gradient(90deg, transparent, var(--sm-amber), transparent); }
.sm-stat-set::before { background: linear-gradient(90deg, transparent, var(--sm-coral), transparent); }
.sm-stat-now::before { background: linear-gradient(90deg, transparent, var(--sm-sun), transparent); }
.sm-stat h3 {
  margin: 0 0 8px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sm-dim);
}
.sm-stat-main { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.sm-stat-main b { font-family: var(--sm-mono); font-size: 21px; font-weight: 500; line-height: 1.1; }
.sm-stat-main span { font-family: var(--sm-mono); font-size: 11px; color: var(--sm-sun); white-space: nowrap; }
.sm-stat p { margin: 5px 0 0; font-size: 10px; line-height: 1.5; color: var(--sm-dim); }

/* ── Panel section ──────────────────────────────────────────── */
.sm-panel { margin-top: 30px; }
.sm-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.sm-section-head h2 { font-size: 18px; }
.sm-section-head p { margin: 0; font-size: 11.5px; color: var(--sm-dim); max-width: 640px; }

.sm-panel-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 18px; }

.sm-rec-card { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; }
.sm-rec-main { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 6px; }
.sm-rec-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sm-dim); }
.sm-rec-value { display: flex; align-items: baseline; gap: 2px; color: var(--sm-sun); }
.sm-rec-value b { font-family: var(--sm-mono); font-size: clamp(42px, 5vw, 62px); font-weight: 500; line-height: 1; }
.sm-rec-value small { font-size: 20px; color: var(--sm-amber); }
.sm-rec-face { font-size: 12px; color: var(--sm-muted); margin-bottom: 8px; }
.sm-rec-card .sm-btn { margin-top: auto; }

.sm-season-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.sm-season-table th {
  padding: 6px 8px;
  text-align: left;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sm-dim);
  border-bottom: 1px solid var(--sm-stroke);
}
.sm-season-table td { padding: 8px; border-bottom: 1px solid rgba(120, 220, 255, 0.07); color: var(--sm-muted); }
.sm-season-table td:nth-child(2) { font-family: var(--sm-mono); color: var(--sm-ink); }
.sm-season-table td:last-child { font-family: var(--sm-mono); color: var(--sm-teal); }
.sm-season-table tr:last-child td { border-bottom: 0; }

.sm-try-card h3 { margin: 0 0 14px; font-size: 12px; font-weight: 600; color: var(--sm-muted); }
.sm-slider-field { margin-bottom: 14px; }
.sm-slider-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 2px; font-size: 11px; color: var(--sm-dim); }
.sm-slider-label b { font-family: var(--sm-mono); font-size: 13px; color: var(--sm-sun); }
.sm-inc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.sm-inc-grid > div { padding: 9px 10px; border: 1px solid var(--sm-stroke); border-radius: 10px; background: rgba(2, 12, 21, 0.55); }
.sm-inc-grid span { display: block; font-size: 9px; line-height: 1.4; color: var(--sm-dim); min-height: 25px; }
.sm-inc-grid b { font-family: var(--sm-mono); font-size: 15px; font-weight: 500; color: var(--sm-ink); }
.sm-model-note { margin: 12px 0 0; font-size: 9.5px; line-height: 1.6; color: #4c6b7f; }

.sm-diag-card { margin-top: 18px; }
.sm-charts2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.sm-charts2 .sm-diag-card { margin-top: 0; }
.sm-diag { width: 100%; }
.sm-diag svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ── Explanation ────────────────────────────────────────────── */
.sm-note {
  margin-top: 30px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 209, 102, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 209, 102, 0.07), transparent 55%),
    rgba(5, 20, 33, 0.55);
}
.sm-note h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--sm-sun); }
.sm-note-body { font-size: 12px; line-height: 1.85; color: var(--sm-muted); }
.sm-note-body p { margin: 0 0 8px; }
.sm-note-body p:last-child { margin-bottom: 0; }
.sm-note-body b { color: var(--sm-ink); font-weight: 600; }
.sm-note-body code { font-family: var(--sm-mono); font-size: 11px; color: var(--sm-cyan); background: rgba(62, 232, 255, 0.08); padding: 1px 5px; border-radius: 4px; }
.sm-note-body a { color: var(--sm-cyan); }

.sm-footer { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 22px; font-size: 10px; color: #4c6b7f; }

/* ── SVG chart helpers (generated) ──────────────────────────── */
.sm-axis-num { font-family: var(--sm-mono); font-size: 10px; fill: #5f8298; }
.sm-axis-card { font-family: var(--sm-mono); font-size: 13px; font-weight: 600; fill: #cfeaff; letter-spacing: 0.04em; paint-order: stroke; stroke: #04121d; stroke-width: 3px; stroke-linejoin: round; }
.sm-ring-label { font-family: var(--sm-mono); font-size: 8px; fill: #41637a; }
.sm-hour-label { font-family: var(--sm-mono); font-size: 9px; fill: #9dc0d3; paint-order: stroke; stroke: #04121d; stroke-width: 2.5px; stroke-linejoin: round; }
.sm-path-label { font-family: var(--sm-sans); font-size: 9px; fill: #8db2c7; }
.sm-angle-label { font-family: var(--sm-mono); font-size: 9px; fill: #ffcf5c; }
.sm-rise-label { font-family: var(--sm-mono); font-size: 12px; font-weight: 600; fill: #ffcf5c; paint-order: stroke; stroke: #04121d; stroke-width: 3px; stroke-linejoin: round; }
.sm-set-label { font-family: var(--sm-mono); font-size: 12px; font-weight: 600; fill: #ff7a59; paint-order: stroke; stroke: #04121d; stroke-width: 3px; stroke-linejoin: round; }
.sm-center-label { font-family: var(--sm-sans); font-size: 8px; fill: #7fa2b8; }

/* ── Diag chart ─────────────────────────────────────────────── */
.sm-diag-grid { stroke: rgba(120, 220, 255, 0.1); stroke-width: 1; }
.sm-diag-axis { font-family: var(--sm-mono); font-size: 9px; fill: #6f92a6; }
.sm-diag-summer { fill: none; stroke: #ffcf5c; stroke-width: 2; }
.sm-diag-winter { fill: none; stroke: #7fb3ff; stroke-width: 2; stroke-dasharray: 5 4; }
.sm-diag-today { fill: none; stroke: #3ee8ff; stroke-width: 2.6; }
.sm-diag-legend { font-family: var(--sm-sans); font-size: 9.5px; fill: #8db2c7; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1160px) {
  .sm-toolbar { grid-template-columns: 1fr 1fr; }
  .sm-field-grow { grid-column: 1 / -1; }
  .sm-grid { grid-template-columns: 1fr; }
  .sm-map-wrap { min-height: 400px; }
  .sm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm-panel-grid { grid-template-columns: 1fr; }
  .sm-charts2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sm-header { flex-wrap: wrap; }
  .sm-header-mid { order: 3; width: 100%; justify-content: space-between; }
  .sm-hero { flex-direction: column; align-items: flex-start; gap: 18px; }
  .sm-hero-badge { align-self: stretch; grid-auto-flow: column; justify-content: center; align-items: baseline; gap: 8px; padding: 10px 16px; }
  .sm-hero-badge b { font-size: 24px; }
  .sm-rec-card { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .sm-toolbar { grid-template-columns: 1fr; }
  .sm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-inc-grid { grid-template-columns: 1fr; }
  .sm-inc-grid span { min-height: 0; }
  .sm-nav .sm-ghost-btn { display: none; }
  .sm-coords { font-size: 10px; }
  .sm-map-wrap { min-height: 330px; }
  .sm-map-legend { font-size: 9px; gap: 3px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── geolocation status chip ────────────────────────────────── */
.sm-geo-status {
  display: none;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
  font-size: 10px;
  color: var(--sm-dim);
}
.sm-geo-status.is-on { display: inline-flex; }
.sm-geo-status.is-on::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sm-cyan);
  box-shadow: 0 0 8px var(--sm-cyan);
  flex: 0 0 auto;
}

/* ── chart as a share link ──────────────────────────────────── */
.sm-chart-shell { position: relative; display: block; border-radius: 12px; }
.sm-chart-link { color: inherit; text-decoration: none; cursor: pointer; transition: box-shadow 0.16s ease, transform 0.16s ease; }
.sm-chart-link:hover { box-shadow: 0 0 0 1px rgba(62, 232, 255, 0.28), 0 16px 44px rgba(0, 0, 0, 0.4); }
.sm-chart-link:focus-visible { outline: 2px solid var(--sm-cyan); outline-offset: 3px; }
.sm-chart-share-hint {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 4px 9px;
  font-size: 9px;
  color: var(--sm-muted);
  background: rgba(3, 13, 22, 0.82);
  border: 1px solid var(--sm-stroke);
  border-radius: 999px;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

/* ── share page ─────────────────────────────────────────────── */
.sm-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid var(--sm-stroke);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(9, 31, 48, 0.78), rgba(4, 16, 27, 0.72));
  box-shadow: var(--sm-shadow);
}
.sm-share-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--sm-ink); }
.sm-share-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 16px;
  color: var(--sm-sun);
  border: 1px solid rgba(255, 209, 102, 0.3);
  background: radial-gradient(circle at 50% 40%, rgba(255, 209, 102, 0.16), rgba(62, 232, 255, 0.05));
}
.sm-share-brand b { display: block; font-size: 13px; letter-spacing: 0.14em; }
.sm-share-brand small { display: block; font-family: var(--sm-mono); font-size: 8.5px; letter-spacing: 0.2em; color: var(--sm-dim); }
.sm-share-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sm-share-meta b { font-family: var(--sm-mono); font-size: 12px; font-weight: 500; color: var(--sm-ink); }
.sm-share-meta span { font-size: 9.5px; color: var(--sm-dim); }
.sm-share-actions { display: flex; gap: 8px; flex: 0 0 auto; }

body.is-share .sm-header,
body.is-share .sm-hero,
body.is-share .sm-map-card,
body.is-share .sm-stats,
body.is-share .sm-panel,
body.is-share .sm-note,
body.is-share .sm-footer { display: none !important; }
body.is-share .sm-main { padding-top: clamp(12px, 2vw, 24px); }
body.is-share .sm-share-bar { max-width: 900px; margin: 0 auto 14px; }
body.is-share .sm-toolbar {
  max-width: 960px;
  margin: 0 auto 14px;
  grid-template-columns: minmax(240px, 1.45fr) minmax(230px, 0.95fr) minmax(180px, 0.7fr) minmax(155px, 0.55fr);
}
body.is-share .sm-grid { grid-template-columns: minmax(0, 900px); justify-content: center; margin-top: 0; }
body.is-share .sm-chart-card { padding: 18px; }
body.is-share .sm-chart { max-width: 820px; margin: 0 auto; }

@media (max-width: 1160px) {
  /* On phones/tablets the sky chart is the hero: place it right after the toolbar. */
  .sm-chart-card { order: 1; }
  .sm-map-card { order: 2; }
}
@media (max-width: 700px) {
  body.is-share .sm-main { padding-left: 8px; padding-right: 8px; }
  body.is-share .sm-chart-card { padding: 10px; }
  .sm-share-bar { gap: 10px; padding: 10px 12px; }
  .sm-share-meta { order: 3; width: 100%; }
  .sm-share-actions { margin-left: auto; }
  .sm-chart-share-hint { font-size: 8px; top: 4px; right: 6px; }
}

/* Share mode must follow the same responsive toolbar as the main page —
   the 4-column rule above has higher specificity, so re-declare it here. */
@media (max-width: 1160px) {
  body.is-share .sm-toolbar { grid-template-columns: 1fr 1fr; }
  body.is-share .sm-toolbar .sm-field-grow { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body.is-share .sm-toolbar { grid-template-columns: 1fr; }
}
