* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  color: #0f172a;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

.dark body,
body.dark {
  color: #e2e8f0;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

.shell {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 14px;
  display: grid;
  gap: 14px;
}

.head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.head-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.dark .card,
body.dark .card {
  background: #111827;
  border-color: #334155;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
}

h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.responsive-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.responsive-switch input {
  margin: 0;
}

.lang-switch select {
  border: 1px solid #94a3b8;
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}

.btn-ghost {
  border: 1px solid #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
}

.dark .btn-ghost,
body.dark .btn-ghost {
  background: #1f2937;
  color: #e2e8f0;
  border-color: #475569;
}

.query-row {
  display: grid;
  grid-template-columns: 120px 1fr 60px 1fr auto;
  gap: 8px;
  align-items: center;
}

label {
  font-weight: 700;
}

input {
  border: 1px solid #94a3b8;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.dark input,
.dark select,
body.dark input,
body.dark select {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #475569;
}

button {
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.status {
  min-height: 1.2rem;
  margin: 10px 0 0;
  font-weight: 600;
}

.status.err {
  color: #b91c1c;
}

.status.ok {
  color: #065f46;
}

.meta {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.dark .badge,
body.dark .badge {
  background: #1f2937;
  border-color: #475569;
  color: #e2e8f0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  padding: 8px;
  font-size: 0.9rem;
}

th {
  background: #f1f5f9;
}

tbody tr.group-a td {
  background: #ffffff;
}

tbody tr.group-b td {
  background: #eef6ff;
}

.dark th,
body.dark th {
  background: #1e293b;
  color: #cbd5e1;
}

.dark th,
.dark td,
body.dark th,
body.dark td {
  border-bottom-color: #334155;
}

.dark tbody tr.group-a td,
body.dark tbody tr.group-a td {
  background: #0f172a;
}

.dark tbody tr.group-b td,
body.dark tbody tr.group-b td {
  background: #132033;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .query-row {
    grid-template-columns: 1fr;
  }
  .head-row {
    flex-direction: column;
    align-items: flex-start;
  }
  #resultCard:not(.disable-responsive) table {
    min-width: 0;
  }
  #resultCard:not(.disable-responsive) thead {
    display: none;
  }
  #resultCard:not(.disable-responsive) table,
  #resultCard:not(.disable-responsive) tbody,
  #resultCard:not(.disable-responsive) tr,
  #resultCard:not(.disable-responsive) td {
    display: block;
    width: 100%;
  }
  #resultCard:not(.disable-responsive) tr {
    border: 1px solid #dbeafe;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
  }
  #resultCard:not(.disable-responsive) td {
    display: grid;
    grid-template-columns: 44% 56%;
    gap: 8px;
    border-bottom: 1px solid #e2e8f0;
  }
  #resultCard:not(.disable-responsive) td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #475569;
  }
  #resultCard:not(.disable-responsive) tr td:last-child {
    border-bottom: none;
  }
  .dark #resultCard:not(.disable-responsive) td::before,
  body.dark #resultCard:not(.disable-responsive) td::before {
    color: #94a3b8;
  }
  .dark #resultCard:not(.disable-responsive) tr,
  body.dark #resultCard:not(.disable-responsive) tr {
    border-color: #334155;
  }
}
