:root {
  --bg: #f7f6f2;
  --panel: #ffffff;
  --ink: #1d232a;
  --muted: #68727d;
  --accent: #1f6f43;
  --accent-ink: #ffffff;
  --line: #e3e0d8;
  --bad: #a33a2c;
  --note: #f2ead4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181c;
    --panel: #1d232a;
    --ink: #e8e6e1;
    --muted: #96a0ab;
    --accent: #3d9b66;
    --line: #2c343d;
    --note: #3a3423;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

header { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
h1 { font-size: 1.6rem; margin: 0; }
.tagline { color: var(--muted); margin: 0; flex: 1; }
h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
}

textarea, input[type="text"], input[type="password"] {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  margin: 0.25rem 0 0.75rem;
  resize: vertical;
}
label { font-size: 0.85rem; color: var(--muted); }

button {
  font: inherit;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: wait; }
button.linkish {
  background: none;
  color: var(--muted);
  padding: 0;
  text-decoration: underline;
  font-size: 0.85rem;
}
h2 button.linkish { font-size: 1.05rem; color: var(--ink); text-decoration: none; }

.row { display: flex; align-items: center; gap: 0.8rem; }
.hint { font-size: 0.8rem; color: var(--muted); min-height: 1.1em; }
.error { color: var(--bad); margin-top: 0.5rem; }
#status { color: var(--muted); font-size: 0.9rem; }

.notes {
  background: var(--note);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.notes ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.infeasible {
  border: 1px solid var(--bad);
  color: var(--bad);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-top: 1rem;
}

.day-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-top: 0.8rem;
}
.day-card .when { color: var(--muted); font-size: 0.85rem; }
.day-card .title { font-weight: 600; font-size: 1.05rem; margin: 0.1rem 0; }
.day-card .wx { font-size: 0.9rem; margin-bottom: 0.4rem; }
.reasons { margin: 0.3rem 0 0; padding-left: 1.2rem; font-size: 0.9rem; }
details { margin-top: 0.5rem; font-size: 0.88rem; }
details summary { cursor: pointer; color: var(--muted); }
.alt { margin: 0.4rem 0 0 0.2rem; padding-left: 0.8rem; border-left: 2px solid var(--line); }

.login { max-width: 320px; padding-top: 15vh; }

.results-bar { display: flex; align-items: baseline; gap: 1rem; margin-top: 1.2rem; }
.results-bar h2 { margin: 0; flex: 1; }
#ics { font-size: 0.9rem; color: var(--accent); text-decoration: none; }
#ics:hover { text-decoration: underline; }

.badge {
  float: right;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
}
.day-card.changed { animation: flash 1.6s ease-out; }
@keyframes flash {
  0% { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
  100% { border-color: var(--line); box-shadow: none; }
}

.strip {
  display: flex;
  gap: 1px;
  margin: 0.45rem 0 0.55rem;
  height: 26px;
}
.strip-cell {
  position: relative;
  flex: 1;
  border-radius: 2px;
  min-width: 0;
}
.strip-cell.night { filter: brightness(0.55) saturate(0.7); }
.strip-cell.blocked {
  background-image: repeating-linear-gradient(
    45deg, rgba(0,0,0,0.35) 0 3px, transparent 3px 6px
  ) !important;
  filter: grayscale(0.8) brightness(0.75);
}
.strip-cell.chosen {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  z-index: 1;
}
.strip-cell.alt-mark { outline: 2px dashed var(--muted); outline-offset: 1px; }
.rain-dot {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  color: #2a6fbb;
  font-size: 0.8rem;
  line-height: 1;
}
.tick {
  position: absolute;
  bottom: -13px;
  left: 0;
  font-size: 0.6rem;
  color: var(--muted);
}
.strip { margin-bottom: 1.1rem; }
