.event-log-viewer {
  width: min(1420px, calc(100vw - 28px));
  max-width: none;
  height: min(820px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  color-scheme: dark;
  background: #050505;
  border: 1px solid #353535;
  border-radius: 5px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.78);
}

.event-log-viewer::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(2px);
}

.event-log-shell {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.event-log-header,
.event-log-auth,
.event-log-toolbar,
.event-log-footer {
  display: flex;
  align-items: center;
}

.event-log-header {
  min-height: 52px;
  justify-content: space-between;
  padding: 7px 12px;
  background: #0d0d0d;
  border-bottom: 1px solid var(--line);
}

.event-log-header > div,
.event-log-header-actions {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.event-log-header h2,
.event-log-header span,
.event-log-header strong,
.event-log-viewer p {
  margin: 0;
}

.event-log-header h2 {
  font-size: 18px;
  letter-spacing: 0.03em;
}

.event-log-header span,
.event-log-header strong,
.event-log-auth label,
.event-log-auth small,
.event-log-toolbar label > span,
.event-log-footer {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
}

.event-log-header strong {
  color: var(--ink);
}

.event-log-viewer button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--ink);
  background: #171717;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}

.event-log-viewer button:hover {
  background: #242424;
  border-color: #4a4a4a;
}

.event-log-viewer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.event-log-auth {
  display: grid;
  grid-template-columns: auto minmax(220px, 430px) auto minmax(260px, 1fr);
  gap: 8px;
  padding: 7px 12px;
  background: #090909;
  border-bottom: 1px solid var(--line);
}

.event-log-auth input,
.event-log-toolbar input,
.event-log-toolbar select {
  height: 32px;
  min-width: 0;
  padding: 0 9px;
  color: var(--ink);
  color-scheme: dark;
  background: #111111;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  outline: 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

.event-log-auth input:focus,
.event-log-toolbar input:focus,
.event-log-toolbar select:focus {
  border-color: #666666;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.event-log-toolbar {
  display: grid;
  grid-template-columns: 150px 140px minmax(180px, 230px) minmax(240px, 1fr) auto;
  gap: 8px;
  padding: 7px 12px;
  background: #0d0d0d;
  border-bottom: 1px solid var(--line);
}

.event-log-toolbar label:not(.event-log-auto-refresh) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.event-log-search-field input {
  width: 100%;
}

.event-log-auto-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.event-log-auto-refresh input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}

.event-log-message {
  min-height: 31px;
  padding: 7px 12px;
  color: var(--ink-soft);
  background: #080808;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
}

.event-log-message.is-success {
  color: var(--green);
}

.event-log-message.is-error {
  color: var(--red);
}

.event-log-table-wrap {
  position: relative;
  min-height: 0;
  overflow: auto;
  background: #050505;
}

.event-log-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-mono);
  font-size: 12px;
}

.event-log-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  height: 34px;
  padding: 0 9px;
  color: #8c8c8c;
  background: #0d0d0d;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 500;
  text-align: left;
}

.event-log-table th:nth-child(1) {
  width: 168px;
}

.event-log-table th:nth-child(2) {
  width: 84px;
}

.event-log-table th:nth-child(3) {
  width: 76px;
}

.event-log-table th:nth-child(4) {
  width: 130px;
}

.event-log-table th:nth-child(6) {
  width: 190px;
}

.event-log-table td {
  height: 37px;
  padding: 6px 9px;
  overflow: hidden;
  color: #d8d8d8;
  border-bottom: 1px solid #1c1c1c;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.event-log-table tr:hover td {
  background: #101010;
}

.event-log-time,
.event-log-source,
.event-log-account {
  color: #8f8f8f !important;
}

.event-log-event {
  color: #eeeeee !important;
  line-height: 1.45;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
}

.event-log-level {
  font-weight: 700;
}

.event-log-level.is-warning,
.event-log-level.is-critical,
.event-log-category.is-security {
  color: #f0a44b;
}

.event-log-level.is-error {
  color: var(--red);
}

.event-log-level.is-info,
.event-log-category.is-market {
  color: var(--green);
}

.event-log-level.is-debug {
  color: #929292;
}

.event-log-category.is-account {
  color: #d8d8d8;
}

.event-log-category.is-trade {
  color: #e7c85f;
}

.event-log-loading,
.event-log-empty {
  padding: 42px 14px;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
}

.event-log-footer {
  min-height: 42px;
  gap: 14px;
  padding: 6px 12px;
  background: #0d0d0d;
  border-top: 1px solid var(--line);
}

.event-log-footer span:nth-child(2) {
  color: #6f6f6f;
}

.event-log-footer button:first-of-type {
  margin-left: auto;
}

.event-log-footer button.is-danger {
  color: var(--red);
  border-color: rgba(240, 79, 95, 0.42);
}

.event-log-viewer.is-busy select,
.event-log-viewer.is-busy input {
  pointer-events: none;
  opacity: 0.68;
}

@media (max-width: 900px) {
  .event-log-viewer {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }

  .event-log-auth {
    grid-template-columns: auto minmax(180px, 1fr) auto;
  }

  .event-log-auth small {
    display: none;
  }

  .event-log-toolbar {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .event-log-search-field {
    grid-column: 1 / 3;
  }

  .event-log-footer span:nth-child(2) {
    display: none;
  }
}

@media (max-width: 600px) {
  .event-log-header > div {
    gap: 7px;
  }

  .event-log-header > div > span {
    display: none;
  }

  .event-log-auth {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .event-log-auth label {
    grid-column: 1 / -1;
  }

  .event-log-toolbar {
    grid-template-columns: repeat(2, minmax(128px, 1fr));
  }

  .event-log-search-field {
    grid-column: 1 / -1;
  }

  .event-log-footer {
    gap: 6px;
  }

  .event-log-footer span {
    display: none;
  }

  .event-log-footer button:first-of-type {
    margin-left: auto;
  }
}
