:root {
  --menv-accent: #f59e0b;
  --menv-bg: #ffffff;
  --menv-surface: #f7f9fa;
  --menv-text: #1a202c;
  --menv-text-muted: #8895a7;
  --menv-border: #e5e9ee;
  --menv-arc: #e2e8f0;
}

:root[data-menv-theme="dark"] {
  --menv-bg: #1a1f2b;
  --menv-surface: #232a38;
  --menv-text: #f1f5f9;
  --menv-text-muted: #8895a7;
  --menv-border: #333c4d;
  --menv-arc: #384157;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: transparent;
}

.menv-sun {
  max-width: 420px;
  margin: 0 auto;
  background: var(--menv-bg);
  border: 1px solid var(--menv-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.menv-sun-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.menv-sun-icon {
  font-style: normal;
  font-size: 1.4rem;
}

.menv-sun-location {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--menv-text);
  flex: 1;
}

.menv-sun-search {
  margin-bottom: 14px;
}

.menv-sun-search-row {
  display: flex;
  gap: 8px;
}

.menv-sun-search-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1.5px solid var(--menv-border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--menv-surface);
  color: var(--menv-text);
}

.menv-sun-search-input:focus {
  outline: none;
  border-color: var(--menv-accent);
}

.menv-sun-search-btn {
  appearance: none;
  border: 1.5px solid var(--menv-border);
  background: var(--menv-surface);
  color: var(--menv-text-muted);
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.menv-sun-search-btn:hover { color: var(--menv-accent); border-color: var(--menv-accent); }

.menv-sun-search-results {
  /* Flows in normal document layout (not absolutely positioned) so the
     widget's own auto-resize (ResizeObserver on #menv-sunrise) naturally
     grows the embedding iframe to fit it — an absolutely positioned
     dropdown would get clipped by the iframe's fixed reported height. */
  margin-top: 6px;
  background: var(--menv-bg);
  border: 1px solid var(--menv-border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  max-height: 220px;
  overflow-y: auto;
}

.menv-sun-search-result {
  padding: 9px 12px;
  font-size: 0.85rem;
  color: var(--menv-text);
  cursor: pointer;
  border-bottom: 1px solid var(--menv-border);
}

.menv-sun-search-result:last-child { border-bottom: none; }
.menv-sun-search-result:hover { background: var(--menv-surface); }

.menv-sun-search-result-sub {
  color: var(--menv-text-muted);
  font-size: 0.75rem;
}

.menv-sun-loading,
.menv-sun-error {
  text-align: center;
  padding: 30px 10px;
  color: var(--menv-text-muted);
  font-size: 0.9rem;
}

.menv-sun-error { color: #ef4444; }

.menv-sun-arc {
  margin: 0 auto 14px;
  max-width: 260px;
}

.menv-sun-arc-svg { width: 100%; display: block; }

.menv-sun-arc-path {
  fill: none;
  stroke: var(--menv-arc);
  stroke-width: 3;
  stroke-linecap: round;
}

.menv-sun-dot {
  fill: var(--menv-accent);
}

.menv-sun-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.menv-sun-stat {
  background: var(--menv-surface);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menv-sun-stat-label {
  font-size: 0.72rem;
  color: var(--menv-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menv-sun-stat-value {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--menv-text);
}

.menv-sun-footnote {
  margin-top: 12px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--menv-text-muted);
}

@media (max-width: 380px) {
  .menv-sun-grid { grid-template-columns: 1fr; }
}

/* A long word with no spaces breaks instead of spilling out of its box */
.menv-sun-location { overflow-wrap: anywhere; }
