:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07110d;
  color: #f4efe3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #07110d;
}

button, select {
  font: inherit;
}

.app {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h1, h2 {
  margin: 0;
}

h1 {
  color: #42a875;
  font-size: 1.55rem;
}

h2 {
  color: #e7dfcf;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.panel {
  background: #0d1c15;
  border: 1px solid #274235;
  border-radius: 14px;
}

.controls {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.label {
  display: block;
  margin-bottom: 7px;
  color: #b69ad9;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.server-grid button,
.icon-button,
.pager button {
  border: 1px solid #3b6551;
  background: #13281f;
  color: #f4efe3;
  border-radius: 10px;
  min-height: 46px;
  cursor: pointer;
  font-weight: 700;
}

.server-grid button.selected {
  background: #13281f;
  border-color: #b69ad9;
  color: #fff5dc;
  box-shadow: inset 0 0 0 1px #b69ad9;
}

button:disabled {
  opacity: .45;
  cursor: default;
}

select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #466f5c;
  border-radius: 10px;
  background: #091710;
  color: #f4efe3;
}

select:focus,
button:focus-visible {
  outline: 2px solid #b69ad9;
  outline-offset: 2px;
}

.icon-button {
  width: 46px;
  flex: 0 0 46px;
  font-size: 1.45rem;
  color: #c9b5e4;
}

.status {
  min-height: 24px;
  padding: 12px 3px;
  color: #c9b5e4;
  font-size: .9rem;
}

.status.error {
  color: #ff9f92;
}

.results-panel {
  overflow: hidden;
}

.results-heading {
  padding: 13px 14px;
  border-bottom: 1px solid #274235;
}

.order-note {
  margin-top: 4px;
  color: #9c83bd;
  font-size: .78rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  white-space: nowrap;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #1f382c;
  text-align: left;
  vertical-align: top;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  background: #15271f;
  color: #b69ad9;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

td {
  color: #e7dfcf;
}

tbody tr:nth-child(even) {
  background: #0a1710;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.null {
  color: #8a918c;
  font-style: italic;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #274235;
}

.pager button {
  min-height: 42px;
}

.pager button:not(:disabled):hover {
  border-color: #b69ad9;
}

.page-info {
  color: #b69ad9;
  font-size: .86rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 720px) {
  .controls {
    grid-template-columns: 1fr 1.5fr 1.5fr;
    align-items: end;
  }
}

@media (max-width: 480px) {
  .pager {
    grid-template-columns: 1fr 1fr;
  }

  .page-info {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  #previous-page {
    grid-column: 1;
    grid-row: 2;
  }

  #next-page {
    grid-column: 2;
    grid-row: 2;
  }
}
