:root {
  --bg: #eef3f8;
  --bg-deep: #dfe7f0;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --ink: #10253d;
  --muted: #60758a;
  --line: rgba(16, 37, 61, 0.12);
  --primary: #12385d;
  --primary-strong: #0a2540;
  --secondary: #4c7ea3;
  --accent-soft: rgba(18, 56, 93, 0.08);
  --success-soft: rgba(76, 126, 163, 0.16);
  --shadow: 0 24px 64px rgba(10, 37, 64, 0.14);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(76, 126, 163, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 42%, #f7fafc 100%);
  min-height: 100vh;
}

.page-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-header,
.search-panel,
.control-panel,
.results-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.page-header {
  display: block;
  padding: 26px 28px;
  border-radius: var(--radius-xl);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
}

.brand-logo {
  width: auto;
  max-width: min(280px, 100%);
  height: 64px;
  object-fit: contain;
  display: block;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.header-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
}

.search-panel__main label,
.filter label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-panel__main input,
.filter select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-panel__main input:focus,
.filter select:focus {
  outline: 2px solid rgba(76, 126, 163, 0.18);
  border-color: rgba(76, 126, 163, 0.48);
  box-shadow: 0 0 0 5px rgba(76, 126, 163, 0.08);
}

.search-panel__actions {
  display: flex;
  gap: 10px;
}

.workspace {
  display: block;
  margin-top: 18px;
}

.control-panel {
  padding: 20px;
  border-radius: var(--radius-xl);
  margin-top: 18px;
}

.control-panel--inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: end;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-kicker {
  margin: 0 0 6px;
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

button {
  border: 0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font: inherit;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(10, 37, 64, 0.18);
}

button.secondary {
  color: var(--ink);
  background: var(--accent-soft);
}

.results-panel {
  padding: 18px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.results-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.results-summary {
  margin: 6px 0 0;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  background: #edf3f8;
  color: var(--primary);
  padding: 15px 14px;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(16, 37, 61, 0.08);
}

tbody td {
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

tbody tr:hover {
  background: rgba(76, 126, 163, 0.08);
}

.code-cell {
  padding-right: 10px;
}

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

.code {
  display: block;
  flex: 1 1 auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.94rem;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--primary);
  font-weight: 500;
}

.copy-btn {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(16, 37, 61, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.copy-btn:hover {
  transform: none;
  box-shadow: none;
  background: rgba(18, 56, 93, 0.08);
}

.copy-btn.copied {
  background: rgba(46, 125, 92, 0.14);
  color: #2e7d5c;
  border-color: rgba(46, 125, 92, 0.18);
}

.description {
  width: 34%;
}

.code {
  width: 26%;
}

.subtopic,
.topic {
  width: 20%;
}

thead th:nth-child(1),
tbody td:nth-child(1) {
  width: 26%;
}

thead th:nth-child(2),
tbody td:nth-child(2) {
  width: 34%;
}

thead th:nth-child(3),
tbody td:nth-child(3),
thead th:nth-child(4),
tbody td:nth-child(4) {
  width: 20%;
}

.subtopic,
.topic {
  color: var(--muted);
}

.empty-state td {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .search-panel {
    grid-template-columns: 1fr;
  }

  .control-panel--inline,
  .filters {
    grid-template-columns: 1fr;
  }

  .search-panel__actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1380px);
    padding-top: 20px;
  }

  .page-header,
  .search-panel,
  .control-panel,
  .results-panel {
    border-radius: 20px;
  }

  .brand-logo {
    height: 54px;
  }

  .results-toolbar {
    flex-direction: column;
  }

  .description {
    width: auto;
  }

  .code-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-btn {
    width: fit-content;
  }
}
