
/* === Ultimate Law — Design System === */
/* Dark theme derived from the Civilization game palette */

:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #0f1620;
  --bg-panel: rgba(15, 22, 32, 0.95);
  --bg-card: #111820;
  --border: rgba(79, 195, 247, 0.15);
  --border-strong: rgba(79, 195, 247, 0.3);
  --text-primary: #e0e0e0;
  --text-secondary: #90a4ae;
  --text-muted: #546e7a;
  --text-dim: #37474f;
  --accent: #4fc3f7;
  --accent-dark: #1565c0;
  --accent-hover: #42a5f5;
  --warning: #ffd54f;
  --success: #66bb6a;
  --error: #ef5350;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* === HEADER === */

#site-header {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 100;
  height: 48px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 48px;
  gap: 24px;
}

.site-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--accent); }

.header-progress {
  font-size: 11px;
  color: var(--text-dim);
}

/* === MAIN === */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 68px 20px 40px;
  min-height: calc(100vh - 88px);
}

/* === BREADCRUMBS === */

.breadcrumbs {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs span { color: var(--text-secondary); }

/* === FOOTER === */

#site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}

/* === LANDING PAGE === */

.landing {
  text-align: center;
  padding-top: 60px;
}

.landing-hero h1 {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 32px;
  letter-spacing: 0.5px;
}

.landing-quote {
  font-size: 20px;
  font-style: italic;
  color: var(--accent);
  border: none;
  margin: 0 auto 16px;
  max-width: 600px;
  line-height: 1.6;
}

.landing-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 48px;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto 48px;
}

.landing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
  text-decoration: none;
}
.landing-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(79, 195, 247, 0.1);
}

.card-icon {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 300;
}

.landing-card h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.landing-card p {
  font-size: 13px;
  color: var(--text-muted);
}

.start-btn {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--accent-dark), #0d47a1);
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s;
}
.start-btn:hover {
  color: white;
  box-shadow: 0 0 24px rgba(21, 101, 192, 0.4);
  transform: translateY(-1px);
}

/* === DICTIONARY === */

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.alpha-link {
  display: inline-block;
  width: 32px; height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.alpha-link:hover {
  background: rgba(79, 195, 247, 0.1);
  color: var(--accent);
}

.dict-letter {
  font-size: 18px;
  font-weight: 300;
  color: var(--accent);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.dict-entry {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 6px;
  transition: background 0.2s;
}
.dict-entry:hover { background: rgba(255,255,255,0.02); }

.dict-entry h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.dict-entry h3 a { color: var(--text-primary); }
.dict-entry h3 a:hover { color: var(--accent); }

.dict-entry p {
  font-size: 14px;
  color: var(--text-muted);
}

/* === DICTIONARY TERM PAGE === */

.term-page h1 {
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.term-definition p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.term-related {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.term-related h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.related-link {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(79, 195, 247, 0.08);
  color: var(--text-muted);
  transition: all 0.2s;
}
.related-link:hover {
  background: rgba(79, 195, 247, 0.15);
  color: var(--accent);
}

.term-nav {
  margin-top: 32px;
  font-size: 13px;
}

/* === ENCYCLOPEDIA INDEX === */

.volume-card {
  margin-bottom: 32px;
}

.volume-card h2 {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chapter-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.chapter-link:hover {
  border-color: var(--border-strong);
  background: var(--bg-secondary);
}

.ch-title { color: var(--text-primary); font-size: 14px; }
.ch-words { color: var(--text-dim); font-size: 12px; }

/* === ENCYCLOPEDIA CHAPTER === */

.encyclopedia-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: auto;
}

@media (max-width: 768px) {
  .encyclopedia-layout { grid-template-columns: 1fr; }
  .chapter-sidebar { display: none; }

  /* Hamburger menu */
  .hamburger { display: block; }

  .main-nav {
    display: none;
    position: fixed;
    top: 48px;
    left: 0; right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 8px 0;
    z-index: 99;
  }
  .main-nav.open { display: flex; }

  .nav-link {
    padding: 12px 24px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }
  .nav-link:hover { background: rgba(255,255,255,0.05); }

  .header-search-btn { display: none; }

  /* Orbit: slightly smaller on mobile */
  .orbit-container { height: 260px; }
  .orbit-symbol svg { width: 28px; height: 28px; }

  .landing-cards { grid-template-columns: 1fr 1fr; }
  .chapter-nav { flex-direction: column; gap: 8px; text-align: center; }
  .seed-row { flex-direction: column; gap: 4px; }

  .welcome-symbol svg { width: 48px; height: 48px; }
  .lost-hero-symbol svg { width: 48px; height: 48px; }
}

@media (max-width: 400px) {
  .landing-cards { grid-template-columns: 1fr; }
  .lost-row { gap: 16px; }
  .orbit-ring { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

.chapter-sidebar {
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.section-link {
  display: block;
  font-size: 13px;
  padding: 4px 0;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all 0.2s;
}
.section-link:hover { color: var(--text-primary); }
.section-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.sidebar-progress {
  margin-top: 16px;
}

.progress-bar {
  height: 3px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.5s;
}

.chapter-content h1 {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.chapter-section {
  margin-bottom: 40px;
}

.chapter-section h2 {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-top: 16px;
}

.chapter-section p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sources {
  margin-top: 8px;
}

.source {
  font-size: 13px;
  font-style: italic;
  color: var(--text-dim);
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.nav-vol { color: var(--text-dim); font-size: 12px; }

/* === LIBRARY === */

.library-category {
  margin-bottom: 32px;
}

.library-category h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.seed-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 14px;
  color: var(--text-secondary);
  gap: 12px;
}

.seed-title { flex: 1; }

.seed-links {
  font-size: 12px;
  white-space: nowrap;
}
.seed-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.seed-links a:hover { color: var(--accent); }

/* === ARTICLES === */

.article-list {
  display: flex;
  flex-direction: column;
}

.article-row {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  text-decoration: none;
  transition: background 0.2s;
  align-items: baseline;
}
.article-row:hover { background: rgba(255,255,255,0.02); }

.article-date {
  font-size: 12px;
  color: var(--text-dim);
  font-family: monospace;
  white-space: nowrap;
}

.article-title {
  font-size: 14px;
  color: var(--text-primary);
}

.article-body {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-body p { margin-bottom: 16px; }
.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
  color: var(--text-primary);
  margin: 24px 0 12px;
  font-weight: 500;
}
.article-body h2 { font-size: 20px; }
.article-body h3 { font-size: 18px; }
.article-body h4 { font-size: 16px; }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 16px 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-body ul, .article-body ol {
  margin: 12px 0;
  padding-left: 24px;
}
.article-body li { margin-bottom: 6px; }

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.article-body pre, .article-body code {
  font-family: 'Consolas', monospace;
  font-size: 14px;
}

.article-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

.article-body a { color: var(--accent); }

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.article-meta .article-date {
  font-size: 13px;
  color: var(--text-dim);
}

.cat-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(79, 195, 247, 0.1);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}
.cat-badge:hover {
  background: rgba(79, 195, 247, 0.2);
  color: var(--accent);
}

.cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.cat-filter {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}
.cat-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === ORBIT === */

.orbit-section {
  text-align: center;
  padding: 40px 0 20px;
}

.orbit-container {
  position: relative;
  width: 100%;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  width: 0; height: 0;
}

.orbit-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: transform 0.1s linear, opacity 0.1s linear;
  cursor: pointer;
}
.orbit-item:hover .orbit-symbol {
  filter: drop-shadow(0 0 20px var(--color)) drop-shadow(0 0 40px var(--color));
  transform: scale(1.2);
}

.orbit-symbol {
  color: var(--color);
  transition: all 0.3s;
  filter: drop-shadow(0 0 6px var(--color));
}
.orbit-symbol svg {
  width: 36px;
  height: 36px;
  display: block;
}

.orbit-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.orbit-item:hover .orbit-label { opacity: 1; }

.orbit-center {
  text-align: center;
  z-index: 50;
  position: relative;
}

.orbit-logo {
  color: var(--accent);
  filter: drop-shadow(0 0 15px rgba(79, 195, 247, 0.4));
  margin-bottom: 8px;
}
.orbit-logo svg {
  width: 48px;
  height: 48px;
  display: block;
  margin: 0 auto;
}

.orbit-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-primary);
}

.orbit-tagline {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-top: 4px;
}

.orbit-instruction {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* === WELCOME PAGE === */

.welcome-page {
  max-width: 720px;
  margin: 0 auto;
}

.welcome-hero {
  text-align: center;
  padding: 40px 0 32px;
}

.welcome-symbol {
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px currentColor);
}
.welcome-symbol svg {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto;
}

.welcome-hero h1 {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
}

.welcome-body {
  font-size: 16px;
  line-height: 1.8;
}

.welcome-quote {
  border: none;
  text-align: center;
  margin: 0 0 32px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.welcome-quote p {
  font-size: 18px;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-quote cite {
  font-size: 13px;
  color: var(--text-muted);
  font-style: normal;
}

.welcome-bridge {
  margin-bottom: 32px;
  color: var(--text-secondary);
}

.welcome-bridge p { margin-bottom: 16px; }

.welcome-core {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.welcome-core h2 {
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 16px;
}

.welcome-core p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.welcome-next {
  margin-top: 40px;
}

.welcome-next h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 16px;
  text-align: center;
}

/* === LOST / SHIVERING === */

.lost-section-heading {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 48px;
}

.lost-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.lost-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.3s;
}
.lost-item:hover { opacity: 0.7; }

.lost-symbol {
  color: #616161;
  filter: grayscale(0.8) brightness(0.6);
  transition: all 0.3s;
}
.lost-symbol svg {
  width: 24px;
  height: 24px;
  display: block;
}
.lost-item:hover .lost-symbol {
  filter: grayscale(0.3) brightness(0.8);
  color: #b71c1c;
}

.lost-label {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.lost-instruction {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

/* Lost intervention page */

.lost-page {
  max-width: 720px;
  margin: 0 auto;
}

.lost-hero {
  text-align: center;
  padding: 40px 0 32px;
}

.lost-hero-symbol {
  color: #616161;
  filter: grayscale(0.5) brightness(0.5);
  margin-bottom: 16px;
  animation: shiver 0.15s infinite;
}
.lost-hero-symbol svg {
  width: 56px;
  height: 56px;
  display: block;
  margin: 0 auto;
}

@keyframes shiver {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1.5px, 1px); }
  50% { transform: translate(1px, -1.5px); }
  75% { transform: translate(-1px, -0.5px); }
}

.lost-hero h1 {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-secondary);
}

.lost-violation {
  font-size: 14px;
  color: var(--error);
  margin-top: 8px;
  font-style: italic;
}

.lost-body {
  font-size: 16px;
  line-height: 1.8;
}

.lost-body .lost-section {
  margin-bottom: 28px;
}

.lost-body .lost-section h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.lost-body .lost-section p {
  color: var(--text-secondary);
}

.lost-wayback {
  padding: 20px 24px;
  background: rgba(79, 195, 247, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.lost-wayback h2 {
  color: var(--accent) !important;
}

/* Interactive lost page (accordion) */

.lost-page-interactive .lost-hero-subtitle {
  font-size: 22px;
  color: var(--text-secondary);
  margin-top: 12px;
  font-style: italic;
  font-weight: 300;
}

.lost-accordion {
  margin-bottom: 36px;
}

.lost-objection {
  margin-bottom: 2px;
}

.lost-objection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  transition: background 0.2s, border-color 0.2s;
}

.lost-objection-header:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.lost-objection-header[aria-expanded="true"] {
  border-radius: 6px 6px 0 0;
  border-bottom-color: transparent;
  background: rgba(79, 195, 247, 0.04);
}

.lost-objection-claim {
  font-style: italic;
  flex: 1;
  padding-right: 16px;
}

.lost-objection-toggle {
  font-size: 20px;
  font-weight: 300;
  color: var(--accent);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.lost-objection-body {
  padding: 20px 24px;
  background: rgba(79, 195, 247, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: none;
  border-radius: 0 0 6px 6px;
  margin-bottom: 8px;
}

.lost-objection-body p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
}

/* === DICTIONARY POPUP === */

.dict-term {
  border-bottom: 1px dotted var(--accent);
  cursor: help;
  transition: color 0.2s;
}
.dict-term:hover { color: var(--accent); }

.dict-panel {
  position: fixed;
  z-index: 200;
  width: 340px;
  max-height: 300px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  display: none;
  transition: opacity 0.2s;
}
.dict-panel.visible { display: block; }

.dict-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dict-panel-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}

.dict-panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}
.dict-panel-close:hover { color: var(--text-primary); }

.dict-panel-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.dict-panel-related {
  margin-top: 8px;
  font-size: 12px;
}
.dict-panel-related a {
  color: var(--text-muted);
  margin-right: 8px;
}

/* === SEARCH === */

.dict-search {
  margin-bottom: 16px;
}

.dict-search input,
.search-input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.dict-search input:focus,
.search-input:focus {
  border-color: var(--accent);
}
.dict-search input::placeholder,
.search-input::placeholder {
  color: var(--text-dim);
}

.header-search-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}
.header-search-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* Global search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}
.search-overlay.visible { display: flex; }

.search-modal {
  width: 560px;
  max-width: 90vw;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
}

.search-modal .search-input {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 16px 20px;
  font-size: 17px;
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
}

.search-hint {
  padding: 24px 20px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

.search-result {
  display: block;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  text-decoration: none;
  transition: background 0.15s;
}
.search-result:hover { background: rgba(79, 195, 247, 0.05); }

.sr-type {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(79, 195, 247, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 8px;
}

.sr-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.sr-preview {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
