:root {
    color-scheme: light;
    --bg: #f3f5f8;
    --surface: #ffffff;
    --text: #172033;
    --muted: #687386;
    --border: #dce1e9;
    --accent: #3156d3;
    --accent-dark: #2342ae;
    --danger: #d94242;
    --code-bg: #111827;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); overflow-wrap: anywhere; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #172033; color: #fff; padding: 22px 0; box-shadow: 0 2px 10px rgb(23 32 51 / 18%); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { color: #fff; text-decoration: none; font-size: 21px; font-weight: 750; }
.subtitle { margin: 2px 0 0; color: #aeb8cc; font-size: 14px; }
.api-link, button, .secondary-button { border-radius: 8px; padding: 9px 14px; text-decoration: none; font: inherit; font-weight: 650; cursor: pointer; }
.api-link { color: #fff; border: 1px solid #536077; }
.api-link:hover { border-color: #8d9ab1; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 28px; padding: 28px 0 18px; }
.filter-form { flex: 1; max-width: 740px; }
.filter-form label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filter-controls { display: flex; gap: 9px; }
input { width: 100%; min-width: 0; border: 1px solid #cbd2dd; border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--text); font: inherit; }
input:focus { outline: 3px solid rgb(49 86 211 / 16%); border-color: var(--accent); }
button { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
button:hover { background: var(--accent-dark); }
.secondary-button { color: #38445a; background: #fff; border: 1px solid #cbd2dd; white-space: nowrap; }
.summary { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; color: var(--muted); }
.summary strong { font-size: 25px; color: var(--text); }
.active-filter { margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.event-list { display: grid; gap: 15px; padding-bottom: 24px; }
.event-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 10px rgb(33 45 70 / 5%); overflow: hidden; }
.event-main { display: grid; grid-template-columns: 5px 1fr auto; align-items: stretch; border-bottom: 1px solid var(--border); }
.status-mark { background: var(--danger); }
.event-title { padding: 16px 18px; min-width: 0; }
.event-name { font-size: 17px; font-weight: 750; overflow-wrap: anywhere; }
.event-message { margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.event-code { align-self: center; margin-right: 18px; padding: 4px 9px; border-radius: 999px; background: #fff0f0; color: #a52929; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.event-grid, .details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 24px; margin: 0; padding: 18px 23px; }
.event-grid div, .details-grid div { min-width: 0; }
.event-grid .wide, .details-grid .wide { grid-column: 1 / -1; }
dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
dd { margin: 3px 0 0; overflow-wrap: anywhere; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
details { border-top: 1px solid var(--border); }
summary { padding: 12px 23px; color: #45526a; cursor: pointer; font-weight: 650; }
details[open] summary { background: #f8f9fb; border-bottom: 1px solid var(--border); }
details h3 { margin: 0 23px 8px; font-size: 14px; }
pre { max-height: 430px; overflow: auto; margin: 0 23px 23px; padding: 16px; border-radius: 8px; background: var(--code-bg); color: #dce6f7; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state { margin: 24px 0; padding: 60px 25px; text-align: center; border: 1px dashed #bdc5d2; border-radius: 12px; background: #fff; }
.empty-state h1 { margin: 0 0 8px; font-size: 23px; }
.empty-state p { margin: 0; color: var(--muted); }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 38px; padding: 12px 0; color: var(--muted); text-align: center; }
.pagination a:last-child { justify-self: end; }

@media (max-width: 760px) {
    .container { width: min(100% - 20px, 1180px); }
    .header-inner, .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar { gap: 14px; }
    .filter-controls { flex-wrap: wrap; }
    .filter-controls input { flex-basis: 100%; }
    .event-main { grid-template-columns: 5px 1fr; }
    .event-code { grid-column: 2; justify-self: start; margin: 0 18px 14px; }
    .event-grid, .details-grid { grid-template-columns: 1fr; }
    .pagination { grid-template-columns: 1fr; }
    .pagination a:last-child { justify-self: auto; }
}

