:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #232735;
  --border: #2d3348;
  --text: #e8eaef;
  --muted: #8b92a8;
  --accent: #F00F8C;
  --white: #FFFFFF;
  --accent-soft: rgba(240, 15, 140, 0.12);
  --radius: 12px;
  --tab-h: 44px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page {
  max-width: 1600px !important;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* --- New Multi-row Header Setup --- */
.site-header {
  display: flex;
  flex-direction: column; /* Forces logo block and controls block into separate rows */
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.logo-wrap {
  width: 100%;
}

.site-logo {
  height: 48px;
  width: auto;
  display: block;
}

/* Handles Row 2: Spreading heading left and search right */
.header-controls {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end; /* Keeps bottom of search input level with paragraph text */
  gap: 2rem;
}

.header-text {
  flex-grow: 1;
}

.header-text h1 {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white) !important;
}

.header-text p {
  color: var(--white) !important;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.search-wrap {
  width: 100%;
  max-width: 360px;
  flex-shrink: 0;
}

.search-wrap input {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* --- Tab Navigation Styles --- */
.tabs-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1.25rem 1.25rem;
  padding: 0 1.25rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  min-width: min-content;
}

.tab {
  flex-shrink: 0;
  height: var(--tab-h);
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab.hidden {
  display: none;
}

/* --- Panel Component Display --- */
.panel {
  display: none;
  animation: fade 0.2s ease;
}

.panel.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section {
  margin-bottom: 1.5rem;
}

.section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.link-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .link-list {
    grid-template-columns: 1fr 1fr;
  }
}

.link-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
  word-break: break-all;
}

.link-list a:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.link-list a::before {
  content: "↗";
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--accent);
}

.empty {
  color: var(--muted);
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .header-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .search-wrap {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .site-logo {
    height: 40px;
  }
}