:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #dce2ec;
  --surface: #ffffff;
  --wash: #f5f7fb;
  --brand: #2457d6;
  --brand-dark: #183c99;
  --shadow: 0 12px 30px rgb(23 32 51 / 7%);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
}

.header-inner,
main,
footer {
  width: min(1440px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.brand-mark img { display: block; width: 30px; height: 30px; }

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 12px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.weather[hidden] { display: none; }

.weather-icon { font-size: 22px; line-height: 1; }
.weather strong,
.weather small { display: block; }
.weather strong { font-size: 12px; line-height: 1.2; }
.weather small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.2; }

.follow-button {
  padding: 9px 15px;
  border-radius: 9px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.follow-button:hover { background: #000; }

main { padding-block: 38px 56px; }

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.updated-panel {
  flex: 0 0 auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: right;
}

.updated-panel span,
.updated-panel strong { display: block; }
.updated-panel span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.updated-panel strong { margin-top: 2px; font-size: 13px; }

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px 180px auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.controls label span {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

input,
select,
button { font: inherit; }

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid #c8d0de;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding-inline: 11px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible { outline: 3px solid rgb(36 87 214 / 24%); outline-offset: 2px; }

.clear-button {
  height: 42px;
  padding-inline: 16px;
  border: 1px solid #c8d0de;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.clear-button:hover { background: var(--wash); }

.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 2px 12px;
  color: var(--muted);
  font-size: 13px;
}

.results-heading strong { color: var(--ink); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.action-card {
  position: relative;
  display: flex;
  min-height: 260px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgb(23 32 51 / 4%);
}

.action-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--area-color);
}

.card-body { display: flex; flex: 1; flex-direction: column; padding: 17px 17px 15px 20px; }

.card-date-row,
.card-label-row { display: flex; align-items: center; gap: 8px; }
.card-date-row { justify-content: space-between; min-height: 24px; }

.card-date { color: var(--muted); font-size: 12px; }

.updated-badge,
.rating {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.updated-badge { color: #146c43; background: #dcf5e8; }
.rating { margin-left: auto; color: #344054; background: #eef1f6; }

.card-label-row { margin-top: 14px; }

.area-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 8px;
  color: var(--area-color);
  background: color-mix(in srgb, var(--area-color) 12%, white);
  font-size: 15px;
  font-weight: 800;
}

.area-name { color: var(--area-color); font-size: 13px; font-weight: 800; }

.action-card h2 {
  margin: 13px 0 18px;
  font-size: 17px;
  line-height: 1.42;
  letter-spacing: -.01em;
}

.sources { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }

.source-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #344054;
  background: #fafbfc;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
}

.source-link:hover { border-color: var(--area-color); color: var(--area-color); background: #fff; }

.source-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  color: currentColor;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.brand-icon img { display: block; width: 14px; height: 14px; }
.brand-icon span { display: none; font-size: 9px; }
.brand-icon.icon-missing img { display: none; }
.brand-icon.icon-missing span { display: block; }

.empty-state,
.error-state {
  padding: 48px 20px;
  border: 1px dashed #b9c2d1;
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

.error-state { color: #9b2c2c; }

footer {
  padding-block: 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer p { margin: 0; }

@media (max-width: 1000px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .header-inner, main, footer { width: min(100% - 24px, 1440px); }
  .header-inner { min-height: 66px; }
  .brand small { display: none; }
  .weather strong { display: none; }
  .weather { gap: 5px; padding-right: 9px; }
  .follow-button { padding: 8px 11px; font-size: 13px; }
  main { padding-block: 28px 42px; }
  .intro { display: block; }
  .updated-panel { display: inline-block; margin-top: 18px; text-align: left; }
  .controls { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .action-card { min-height: 0; }
  .results-heading span:last-child { display: none; }
}
