:root {
  --bg: #081420;
  --panel-border: #2c4864;
  --text: #f3f7fa;
  --muted: #9eb2c4;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 8% 15%, #164667 0%, transparent 36%),
    radial-gradient(circle at 78% 12%, #3d2c5f 0%, transparent 30%),
    radial-gradient(circle at 26% 92%, #1b4d45 0%, transparent 32%),
    linear-gradient(145deg, #07111b 0%, #0f2235 55%, #091523 100%);
}

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", sans-serif;
}

.topbar {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
}

.brand-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-link {
  border: 1px solid #41729f;
  border-radius: 10px;
  background: #1a3551;
  color: #e9f4ff;
  text-decoration: none;
  padding: 7px 11px;
  font-size: 0.85rem;
  font-weight: 600;
}

.page-link.active {
  background: #285782;
}

.github-icon-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(67 101 131 / 78%);
  border-radius: 10px;
  background: rgb(15 33 49 / 72%);
  color: #b7c8d8;
  text-decoration: none;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease, transform 130ms ease;
}

.github-icon-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.github-icon-link:hover,
.github-icon-link:focus-visible {
  background: rgb(25 50 73 / 82%);
  border-color: rgb(98 132 166 / 88%);
  color: #dbe9f7;
  transform: translateY(-1px);
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 6px 20px 30px;
}

.controls,
.alphabet,
.list-panel,
.details-panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgb(11 24 37 / 92%);
}

.controls {
  padding: 12px;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input {
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  background: #0a1726;
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
}

.result-info {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.alphabet {
  margin-top: 10px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alpha-btn {
  border: 1px solid #3f668f;
  border-radius: 8px;
  background: #183652;
  color: #dbe9f7;
  padding: 5px 8px;
  min-width: 31px;
  text-align: center;
  font: inherit;
  font-size: 0.79rem;
  cursor: pointer;
}

.alpha-btn.active {
  background: #2a567f;
  border-color: #5482ad;
}

.alpha-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.content-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(420px, 1.35fr);
  gap: 12px;
  align-items: start;
}

.list-panel,
.details-panel {
  padding: 12px;
}

.list-panel {
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.details-panel {
  min-height: 320px;
}

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

.letter-group {
  display: grid;
  gap: 7px;
}

.letter-heading {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: #ffd691;
  border-top: 1px solid rgb(44 72 100 / 75%);
  padding-top: 8px;
}

.glossary-item {
  width: 100%;
  border: 1px solid rgb(58 92 124 / 88%);
  border-radius: 10px;
  background: rgb(15 33 49 / 88%);
  color: #e8f4ff;
  text-align: left;
  padding: 8px;
  cursor: pointer;
}

.glossary-item.active {
  border-color: #5b8fbe;
  background: rgb(26 57 84 / 92%);
}

.glossary-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
}

.glossary-item-meta {
  margin-top: 4px;
  color: #adc4d8;
  font-size: 0.78rem;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.detail-head h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.detail-provider {
  margin: 4px 0 0;
  color: #ffd691;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-code {
  border: 1px solid rgb(60 97 132 / 90%);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  color: #c8dbec;
}

.detail-summary {
  margin: 10px 0 0;
  color: #c6d7e6;
  line-height: 1.4;
  font-size: 0.92rem;
}

.detail-actions {
  margin-top: 10px;
}

.detail-link {
  color: #9de5ff;
  text-decoration: none;
  font-weight: 600;
}

.detail-link:hover,
.detail-link:focus {
  text-decoration: underline;
}

.meta-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meta-block {
  border: 1px solid rgb(44 72 100 / 78%);
  border-radius: 10px;
  background: rgb(9 21 34 / 84%);
  padding: 8px;
}

.meta-label {
  margin: 0;
  color: #94abc0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-value {
  margin: 4px 0 0;
  color: #e6f1fc;
  font-size: 0.86rem;
  line-height: 1.3;
}

.tag-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid rgb(66 102 136 / 88%);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.75rem;
  color: #d0e1f1;
}

.tag.ai {
  border-color: #2ec7a4;
  color: #7be8d0;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

  .list-panel {
    max-height: 430px;
  }
}

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