:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --text: #1f252b;
  --muted: #69737d;
  --line: #d8dee4;
  --accent: #0f766e;
  --accent-dark: #0b5751;
  --focus: #c2410c;
  --stripe: #eef6f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

button,
input {
  font: inherit;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand__name {
  font-size: 1.25rem;
  font-weight: 700;
}

.brand__sub {
  color: var(--muted);
  font-size: 0.875rem;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.search-band {
  margin-bottom: 20px;
}

h1 {
  margin: 0 0 16px;
  font-size: 1.6rem;
  line-height: 1.25;
}

.dataset-note {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.search-form {
  display: grid;
  gap: 12px;
}

.mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  width: min(100%, 260px);
  padding: 3px;
  background: #e7ecef;
  border: 1px solid var(--line);
}

.mode-tabs__item {
  display: grid;
  min-height: 40px;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
}

.mode-tabs__item input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.mode-tabs__item.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 2px rgb(31 37 43 / 10%);
}

.query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  max-width: 760px;
}

.combo {
  position: relative;
  min-width: 0;
}

.query-row input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.query-row button {
  min-height: 46px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.suggestions {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 340px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgb(31 37 43 / 16%);
}

.suggestions.is-open {
  display: block;
}

.suggestions__item {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.suggestions__item:last-child {
  border-bottom: 0;
}

.suggestions__item:hover,
.suggestions__item.is-active {
  background: var(--stripe);
}

.suggestions__main {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.query-row input:focus,
.query-row button:focus,
.mode-tabs__item:focus-within,
.suggestions__item:focus,
.pager a:focus {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 55%);
  outline-offset: 2px;
}

.notice,
.result-head {
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-head__label {
  margin-right: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #e9eef1;
  color: #2c333a;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: var(--stripe);
}

td {
  font-size: 0.95rem;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.source-link,
.source-text {
  display: inline-block;
  max-width: 260px;
  overflow-wrap: anywhere;
}

.pager {
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  text-align: center;
}

.pager a,
.pager span {
  min-height: 40px;
  display: grid;
  place-items: center;
}

.pager a {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .topbar__inner,
  .shell {
    padding-inline: 14px;
  }

  .brand {
    display: grid;
    gap: 2px;
  }

  .query-row {
    grid-template-columns: 1fr;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
