* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1f2733;
}

#layout {
  display: flex;
  height: 100%;
}

#map {
  flex: 1;
  min-width: 0;
}

#panel {
  width: 400px;
  max-width: 45vw;
  overflow-y: auto;
  padding: 16px 18px;
  background: #f7f5f0;
  border-left: 1px solid #ddd6c8;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#panel h1 {
  margin: 0;
  font-size: 22px;
}

.tagline {
  margin: 0;
  font-size: 13.5px;
  color: #4b5563;
  line-height: 1.45;
}

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

.search-row input {
  flex: 1;
  font: inherit;
  padding: 6px 10px;
  border: 1px solid #c8c0b0;
  border-radius: 6px;
  background: #fff;
  min-width: 0;
}

.search-row button {
  font-size: 16px;
  padding: 4px 10px;
  border: 1px solid #c8c0b0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.search-row button:hover { background: #f1ede2; }

#search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
#search-results:empty { display: none; }
#search-results li {
  padding: 7px 10px;
  border: 1px solid #e0dacb;
  border-radius: 6px;
  margin-bottom: 4px;
  background: #fff;
  cursor: pointer;
  line-height: 1.35;
}
#search-results li:hover { background: #fff7e6; }
#search-results li.searching { cursor: default; color: #6b7280; background: transparent; border: none; }

.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.date-row input {
  font: inherit;
  font-weight: 400;
  padding: 5px 8px;
  border: 1px solid #c8c0b0;
  border-radius: 6px;
  background: #fff;
}

.heat-row { display: flex; gap: 8px; }

.heat-row button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 12px;
  border: 1px solid #d9480f;
  border-radius: 7px;
  background: #e8590c;
  color: #fff;
  cursor: pointer;
}
.heat-row button:hover { background: #d9480f; }
.heat-row button:disabled { opacity: 0.55; cursor: default; }
.heat-row button.ghost {
  background: #fff;
  color: #5c6470;
  border-color: #c8c0b0;
  font-weight: 400;
}
.heat-row button.ghost:hover { background: #f1ede2; }

.hint.small { padding: 6px 10px; font-size: 12px; }

.heat-legend {
  background: rgba(255, 255, 255, 0.93);
  border-radius: 8px;
  padding: 8px 11px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
  font: 11.5px/1.4 system-ui, sans-serif;
  color: #1f2733;
  max-width: 230px;
}
.heat-legend-title { font-weight: 700; margin-bottom: 4px; }
.heat-legend-bar { height: 11px; border-radius: 4px; }
.heat-legend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: #4b5563;
}
.heat-legend-note { margin-top: 5px; color: #4b5563; }
.heat-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

#status { font-size: 13.5px; min-height: 1.2em; }
#status .err { color: #c92a2a; }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border: 2px solid #c8c0b0;
  border-top-color: #e8590c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  font-size: 13px;
  color: #6b7280;
  background: #efece4;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.45;
}

.loc-line { font-size: 12.5px; color: #6b7280; }

.big-card {
  background: linear-gradient(135deg, #ffe8cc, #ffd8a8);
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid #f8c47f;
}
.big-card.shade { background: #e3e6ea; border-color: #c9ced6; }
.big-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9a5b00;
  font-weight: 700;
}
.big-card.shade .big-label { color: #5c6470; }
.big-time {
  font-size: 34px;
  font-weight: 750;
  line-height: 1.15;
  color: #432c00;
}
.big-sub { font-size: 12.5px; color: #7a5400; margin-top: 2px; }

table.facts {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.facts td { padding: 4px 0; border-bottom: 1px solid #e7e2d6; }
table.facts td:first-child { color: #6b7280; }
table.facts td:last-child { text-align: right; font-weight: 600; }

.sect-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  font-weight: 700;
}

ul.intervals { margin: 2px 0 0; padding-left: 20px; font-size: 13.5px; }
ul.intervals li { margin: 2px 0; }
.dim { color: #9aa1ab; }

.now-line {
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}
.now-line.sun { background: #fff3bf; color: #735c00; }
.now-line.shade { background: #dbe4ee; color: #3b4a5c; }

.tz-line { font-size: 11.5px; color: #9aa1ab; }

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin: 0 3px 0 8px;
}
.dot.green { background: #2f9e44; }
.dot.red { background: #e03131; }

#chart {
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid #d9d2c2;
  display: block;
}

#chart-wrap .legend,
#season-wrap .legend {
  float: right;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

#scrub-wrap { margin-top: 8px; }

#scrub {
  width: 100%;
  margin: 0;
  accent-color: #e8590c;
  cursor: pointer;
}

#scrub-readout {
  margin-top: 4px;
  font-size: 12.5px;
  color: #4b5563;
  min-height: 1.3em;
}
#scrub-readout .lit-yes { color: #b45309; font-weight: 600; }
#scrub-readout .lit-no { color: #5c6470; font-weight: 600; }

#season-wrap { margin-top: 14px; }

#season {
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid #d9d2c2;
  display: block;
  cursor: crosshair;
}

footer {
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  color: #9aa1ab;
  line-height: 1.5;
}
footer a { color: #7a8aa0; }

@media (max-width: 760px) {
  #layout { flex-direction: column; }
  #map { height: 46vh; flex: none; }
  #panel { width: 100%; max-width: none; flex: 1; border-left: none; border-top: 1px solid #ddd6c8; }
}
