/* kondis – deliberately small, no build step. */

:root {
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --ink: #0b0b0b;
  --ink-2: #5c5c5c;
  --hairline: #e7e7e7;
  --axis: #c2c2c2;
  --line: #2a6fdb;
  --good: #0aac23;
  --warning: #fbb315;
  --critical: #dc3c3d;
  --none: #9a9a9a;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #191919;
    --surface-2: #232323;
    --ink: #f2f2f2;
    --ink-2: #a8a8a8;
    --hairline: #303030;
    --axis: #474747;
    --line: #6ea2f5;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

a { color: inherit; }

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--hairline);
}

h1 { margin: 0; font-size: 20px; }
h1 span { font-weight: 400; color: var(--ink-2); font-size: 15px; margin-left: 6px; }
h2 { font-size: 15px; margin: 16px 0 8px; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

.segmented { display: flex; border: 1px solid var(--axis); border-radius: 6px; overflow: hidden; }
.segmented button {
  border: 0;
  border-right: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
}
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--surface); font-weight: 600; }

select, #locate {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid var(--axis);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
#locate { cursor: pointer; }
.preset { color: var(--ink-2); }

main { flex: 1; display: flex; min-height: 0; }
#map { flex: 1; min-height: 300px; }
aside {
  width: 380px;
  overflow-y: auto;
  padding: 0 16px 16px;
  border-left: 1px solid var(--hairline);
}

@media (max-width: 760px) {
  body { height: auto; }
  main { flex-direction: column; }
  #map { height: 55vh; flex: none; }
  aside { width: auto; border-left: 0; }
}

/* Status chip: colour + icon + label, never colour alone. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 3.2em;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}
.chip.good { background: var(--good); }
.chip.warning { background: var(--warning); color: #0b0b0b; }
.chip.critical { background: var(--critical); }
.chip.none { background: var(--none); }

#list { list-style: none; margin: 0; padding: 0; }
#list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}
#list li:hover, #list li[aria-current="true"] { background: var(--surface-2); }
#list .name { font-weight: 600; }
#list .meta, .muted { color: var(--ink-2); font-size: 13px; }

#detail { padding-top: 8px; }
#detail h2 { font-size: 18px; margin: 8px 0 2px; }
#detail .close { float: right; border: 0; background: none; color: var(--ink-2); font-size: 20px; cursor: pointer; }
.warning-box {
  border-left: 4px solid var(--critical);
  background: var(--surface-2);
  padding: 6px 10px;
  margin: 8px 0;
}
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0; text-align: center; }
.days div { font-size: 13px; color: var(--ink-2); }
.days .day-temp { display: block; color: var(--ink); font-variant-numeric: tabular-nums; }
.days .day-why { display: block; font-size: 11px; min-height: 1.2em; }
#list .temp { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 14px; }
.days .chip { margin-top: 2px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0; font-size: 14px; }
dt { color: var(--ink-2); }
dd { margin: 0; }

/* Hourly chart */
.chart { position: relative; margin: 8px 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--hairline); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .day { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .score { fill: none; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; }
.chart text { fill: var(--ink-2); font-size: 11px; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; }
.chart .dot { fill: var(--line); stroke: var(--surface); stroke-width: 2; }
.tooltip {
  position: absolute;
  top: -6px;
  transform: translate(-50%, -100%);
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

footer {
  padding: 6px 16px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-2);
}
footer p { margin: 2px 0; }

.map-legend {
  background: var(--surface);
  color: var(--ink);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 0 0 1px rgba(11, 11, 11, 0.1);
  display: grid;
  gap: 3px;
}
.map-legend span.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
