:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #68736d;
  --line: #dce2da;
  --accent: #0f766e;
  --accent-2: #a16207;
  --danger: #b42318;
  --shadow: 0 18px 40px rgba(23, 32, 27, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  min-height: 116px;
  padding: 24px clamp(18px, 4vw, 48px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1; letter-spacing: 0; }
.meta { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 14px; }
.layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 48px) 48px;
}
.filters {
  align-self: start;
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, button {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}
button {
  cursor: pointer;
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  font-weight: 700;
}
.stats {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.stats h2 { font-size: 16px; margin-bottom: 12px; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; padding: 5px 0; }
.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.feed-head h2 { margin: 0; font-size: 24px; }
#resultCount { color: var(--muted); }
.day {
  margin-bottom: 28px;
}
.day-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.day-title h3 { margin: 0; font-size: 22px; }
.window-label {
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.cards { display: grid; gap: 12px; }
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}
.rating {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
}
.rating.S { background: var(--danger); }
.rating.A { background: var(--accent-2); }
.rating.B { background: var(--accent); }
.title { margin: 0 0 8px; font-size: 18px; line-height: 1.35; }
.title-time {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(161, 98, 7, 0.1);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.summary, .impact, .reason {
  color: #35413b;
  line-height: 1.65;
  margin-bottom: 10px;
}
.summary {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.impact { color: var(--muted); }
.reason {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  background: #fafbf7;
}
.chip.score {
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--accent);
  font-weight: 800;
}
.chip.time {
  border-color: rgba(161, 98, 7, 0.32);
  color: var(--accent-2);
  font-weight: 800;
}
.sources { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.55);
}
@media (max-width: 820px) {
  .topbar { align-items: start; flex-direction: column; }
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; }
}
