:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --line: #d9dee7;
  --text: #17202a;
  --muted: #667085;
  --accent: #0b6f85;
  --accent-dark: #084b5a;
  --warning-bg: #fff5d6;
  --warning-line: #f0ce74;
  --error-bg: #fff0f0;
  --error-line: #e9a5a5;
}

* {
  box-sizing: border-box;
}

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

.page {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.language-switch {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.language-switch a {
  color: var(--muted);
  text-decoration: none;
}

.language-switch a.active {
  color: var(--accent-dark);
  font-weight: 700;
}

.hero {
  min-height: 72vh;
  display: grid;
  align-content: center;
  gap: 28px;
}

.eyebrow,
.meta-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4rem, 4rem);
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.search {
  display: grid;
  gap: 10px;
  max-width: 780px;
}

label {
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.sample-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: white;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.sample-button:hover {
  background: #eef8fa;
}

.charge-options {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.charge-options legend {
  padding: 0 6px;
  color: var(--text);
  font-weight: 700;
}

.charge-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.charge-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-weight: 700;
}

.charge-option input {
  min-height: auto;
  width: 15px;
  height: 15px;
  padding: 0;
}

.charge-options p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 0 22px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.result-head {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.quick-search {
  display: grid;
  gap: 8px;
  max-width: 780px;
  margin-top: 8px;
}

.back-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.smiles {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.summary-grid > div,
.panel,
.pair {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-grid > div {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.summary-grid strong {
  overflow-wrap: anywhere;
}

.panel {
  margin: 16px 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-head span,
.muted {
  color: var(--muted);
}

.structure {
  margin: 0;
}

.structure img,
.pair-media img {
  display: block;
  width: 100%;
  max-width: 520px;
  min-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.notice {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--warning-line);
  border-radius: 6px;
  background: var(--warning-bg);
  overflow-wrap: anywhere;
}

.notice.error {
  border-color: var(--error-line);
  background: var(--error-bg);
}

.notice.empty {
  margin-top: 16px;
}

.group-list {
  display: grid;
  gap: 8px;
}

.group-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.group-row:first-child {
  border-top: 0;
}

.group-row span,
.group-row small {
  overflow-wrap: anywhere;
}

.group-row small {
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 12px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.legend i {
  width: 14px;
  height: 14px;
  border: 1px solid #9aa4b2;
  border-radius: 3px;
}

.legend-changed {
  background: rgb(60, 180, 75);
}

.legend-group {
  background: rgb(255, 225, 25);
}

.pair {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 20px;
  padding: 18px;
  margin: 16px 0;
}

.pair-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.details {
  display: grid;
  gap: 9px;
  margin: 0;
}

.details div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

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

th,
td {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 760px) {
  .page {
    width: min(100vw - 20px, 1120px);
    padding-top: 20px;
  }

  .search-row,
  .summary-grid,
  .pair,
  .group-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }
}
