:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #888888;
  --line: #d0cec8;
  --accent: #526ca8;
  --accent-strong: #40598f;
  --green: #2f7d57;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 24px 0 18px;
  background: rgba(245, 244, 240, 0.96);
  border-bottom: 0.5px solid rgba(208, 206, 200, 0.78);
  backdrop-filter: blur(8px);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
}

.summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 112px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.summary span:first-child {
  color: var(--text);
  font-size: 24px;
  font-weight: 500;
}

.filters {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(180px, 260px) max-content;
  gap: 12px;
  align-items: end;
  justify-content: start;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: var(--shadow);
}

.filters button {
  min-width: 120px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
button {
  min-height: 36px;
  border-radius: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 0.5px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 0 11px;
  font-size: 14px;
  font-weight: 400;
}

textarea {
  min-height: 96px;
  padding: 10px 11px;
  resize: vertical;
}

button {
  border: 0;
  background: #1a1a1a;
  color: #ffffff;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

button:hover {
  background: #333333;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.status-message {
  min-height: 28px;
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

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

.event-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: start;
  padding: 18px;
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  transition: border-color 150ms ease;
}

.event-card:hover {
  border-color: #aaaaaa;
}

.event-date {
  color: #3a5f9a;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.event-time {
  margin-top: 5px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.event-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.3;
}

.event-description {
  margin: 0 0 10px;
  white-space: pre-line;
  color: #555555;
  font-size: 15px;
  line-height: 1.55;
}

.details-button {
  min-height: 32px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.details-button:hover {
  background: transparent;
  color: var(--accent);
}

.original-button {
  min-height: 30px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 500;
}

.original-button:hover {
  background: transparent;
  color: var(--accent);
}

.original-text {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--line);
  color: #555555;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 0.5px solid var(--line);
  background: var(--bg);
  color: #555555;
  font-size: 12px;
  line-height: 1;
}

.source-tag {
  font-weight: 500;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 12px;
}

.review-shell {
  width: min(1240px, calc(100% - 32px));
}

.review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.review-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  border: 0.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.tab-button {
  min-height: 30px;
  border-radius: 8px;
  background: transparent;
  color: #555555;
  padding: 0 12px;
}

.tab-button:hover,
.tab-button.is-active {
  background: #1a1a1a;
  color: #ffffff;
}

.review-search {
  min-width: 260px;
  flex: 1;
}

.secondary-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.review-list {
  display: grid;
  gap: 14px;
}

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

.review-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.review-id,
.review-summary {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.full-width {
  grid-column: 1 / -1;
}

.original-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.original-details summary {
  padding: 10px 12px;
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
}

.original-details pre {
  max-height: 320px;
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted);
  font-family: inherit;
  line-height: 1.45;
  overflow: auto;
  white-space: pre-wrap;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.review-card-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.review-card-status[data-type="success"] {
  color: var(--green);
}

.review-card-status[data-type="error"] {
  color: #9f3d42;
}

.danger-button {
  background: #9f3d42;
}

.danger-button:hover {
  background: #823238;
}

.scroll-top-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border: 0.5px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(82, 108, 168, 0.86);
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(82, 108, 168, 0.2);
  cursor: pointer;
}

.scroll-top-button:hover {
  background: rgba(82, 108, 168, 0.96);
}

.scroll-top-button[hidden] {
  display: none;
}

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

  .summary {
    justify-content: flex-start;
  }

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

  .review-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .review-tabs {
    width: 100%;
  }

  .tab-button {
    flex: 1;
  }

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

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
  }

  .sticky-header {
    position: static;
    padding-top: 18px;
    backdrop-filter: none;
  }

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

  .event-card {
    gap: 10px;
  }

  .event-title {
    font-size: 20px;
  }

  .scroll-top-button {
    right: 14px;
    bottom: 74px;
    width: 42px;
    height: 42px;
  }
}
