:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #646a73;
  --line: #d8dde4;
  --paper: #f7f8fa;
  --surface: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --mark: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(16px, 4vw, 56px) 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar p {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.export-link,
.event-card a,
button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 9px 13px;
  color: #ffffff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.export-link:hover,
.event-card a:hover,
button:hover {
  background: var(--accent-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 180px)) minmax(260px, 1fr) minmax(150px, 180px) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  align-items: center;
}

.check-option {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.check-option input {
  width: 16px;
  min-height: auto;
  height: 16px;
  margin: 0;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 14px;
  color: var(--muted);
}

.status-row strong {
  color: var(--ink);
}

.events {
  display: grid;
  gap: 12px;
}

.event-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.date-box {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 112px;
  padding: 12px;
  border-left: 4px solid var(--mark);
  background: #fbfbfc;
}

.date-box span {
  color: var(--muted);
  line-height: 1.35;
}

.date-box strong {
  font-size: 24px;
}

.card-body {
  min-width: 0;
}

.card-meta,
.details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.card-meta span,
.details span {
  padding: 4px 8px;
  background: #eef2f2;
  border-radius: 999px;
}

h2 {
  margin: 10px 0 8px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.event-card p {
  margin: 0 0 12px;
  color: #3d424a;
  line-height: 1.45;
}

.event-card a {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
}

.empty {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-filter {
    grid-column: 1 / -1;
  }

  .filters button {
    grid-column: 1 / -1;
  }

  .event-card {
    grid-template-columns: 1fr;
  }

  .date-box {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 20px, 1180px);
    margin-top: 14px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .status-row {
    flex-direction: column;
  }
}
