:root {
  --ocre-claro: #d4a574;
  --ocre-dourado: #c8963e;
  --ocre-escuro: #b8860b;
  --verde-medio: #697d3b;
  --verde-escuro: #4a5d23;
  --marrom-medio: #8b4513;
  --marrom-escuro: #3e2723;
  --bege-trigo: #f5deb3;
  --bg: #fbf5e8;
  --bg-2: #f5e8d0;
  --bg-paper: #fff9ed;
  --ink: #2a1810;
  --ink-soft: #6b4423;
  --line: rgba(107, 68, 35, 0.15);
  --line-strong: rgba(107, 68, 35, 0.32);

  --display: 'Cinzel', serif;
  --script: 'Pinyon Script', cursive;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* TOPBAR */
.db-topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 245, 232, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.db-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
@media (max-width: 880px) { .db-topbar-inner { grid-template-columns: 1fr; gap: 12px; } }

.db-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.db-brand img {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-paper);
  padding: 3px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.db-brand strong {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--marrom-escuro);
  letter-spacing: 0.05em;
}
.db-brand small {
  font-family: var(--script);
  font-size: 13px;
  color: var(--ocre-dourado);
}

.db-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.db-search:focus-within {
  border-color: var(--ocre-dourado);
  box-shadow: 0 0 0 3px rgba(200, 150, 62, 0.14);
}
.db-search svg {
  width: 18px; height: 18px;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.db-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--body);
  font-size: 14px;
  padding: 12px 0;
  color: var(--ink);
}
.db-search input::placeholder { color: rgba(107, 68, 35, 0.5); }
.db-search kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-soft);
}

.db-actions { display: flex; gap: 10px; }
.db-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--marrom-escuro);
  color: var(--bege-trigo);
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, transform 0.2s ease;
}
.db-btn:hover { background: #5a3320; transform: translateY(-1px); }

/* HERO */
.db-hero {
  background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg) 100%);
  padding: 50px 24px 30px;
  border-bottom: 1px solid var(--line);
}
.db-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
}
.db-eyebrow {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ocre-escuro);
  font-weight: 600;
  margin-bottom: 14px;
}
.db-hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1;
  color: var(--marrom-escuro);
  letter-spacing: 0.005em;
  margin-bottom: 24px;
}
.db-hero h1 em {
  font-family: var(--script);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15em;
  color: var(--ocre-dourado);
  letter-spacing: 0;
}
.db-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 760px) { .db-hero-stats { grid-template-columns: repeat(2, 1fr); } }

.db-hero-stats > div {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.db-hero-stats strong {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  color: var(--marrom-escuro);
  letter-spacing: 0.02em;
  word-break: break-word;
}
.db-hero-stats span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* MAIN */
.db-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 24px 60px;
  display: grid;
  gap: 16px;
}

/* MODULE */
.module {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.3s ease;
}
.module[open] {
  border-color: var(--ocre-dourado);
  box-shadow: 0 16px 32px -16px rgba(184, 134, 11, 0.18);
}

.module-head {
  padding: 22px 28px;
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 20px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.2s ease;
}
.module-head::-webkit-details-marker { display: none; }
.module-head:hover { background: var(--bg-2); }

.module-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--ocre-claro) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.module-title h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--marrom-escuro);
  letter-spacing: 0.02em;
}
.module-title p {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.module-count {
  background: var(--marrom-escuro);
  color: var(--ocre-claro);
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.module-toggle {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg);
  transition: background 0.2s ease, transform 0.2s ease;
}
.module-toggle::before, .module-toggle::after {
  content: '';
  position: absolute;
  background: var(--marrom-escuro);
  transition: transform 0.25s ease;
}
.module-toggle::before { width: 12px; height: 2px; }
.module-toggle::after { width: 2px; height: 12px; }
.module[open] .module-toggle { background: var(--ocre-dourado); }
.module[open] .module-toggle::after { transform: scaleY(0); }

.module-body {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 8px;
  display: grid;
  gap: 6px;
  animation: expand 0.3s ease;
}
@keyframes expand {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ROUTE */
.route {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--bg-paper);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.route:hover {
  background: var(--bg-paper);
  border-color: var(--ocre-dourado);
  transform: translateX(4px);
  box-shadow: 0 8px 20px -8px rgba(184, 134, 11, 0.25);
}
.route--internal {
  background: linear-gradient(135deg, var(--marrom-escuro) 0%, #1a0e08 100%);
  color: var(--bege-trigo);
}
.route--internal .route-num { background: rgba(212, 165, 116, 0.18); color: var(--ocre-claro); }
.route--internal .route-info strong { color: var(--bege-trigo); }
.route--internal .route-info p { color: rgba(245, 222, 179, 0.7); }
.route--internal .route-info code { background: rgba(0,0,0,0.3); color: var(--ocre-claro); }
.route--internal .route-arrow { color: var(--ocre-claro); }

.route-num {
  width: 36px; height: 36px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ocre-escuro);
  letter-spacing: 0.04em;
}
.route-info { min-width: 0; }
.route-info strong {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--marrom-escuro);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.route-info p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 6px;
}
.route-info code {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  color: var(--ink-soft);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
  word-break: break-all;
}
.route-arrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ocre-dourado);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.route:hover .route-arrow { transform: translateX(4px); }

.route.search-hit {
  border-color: var(--verde-medio);
  background: linear-gradient(90deg, rgba(74, 93, 35, 0.06) 0%, var(--bg-paper) 100%);
}
.route[hidden] { display: none; }

/* NO RESULTS */
.no-results {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-paper);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}
.no-results span { font-size: 40px; display: block; margin-bottom: 8px; }
.no-results p {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  color: var(--marrom-escuro);
  margin-bottom: 16px;
}

/* SHORTCUTS */
.db-shortcuts {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(62, 39, 35, 0.92);
  color: var(--bege-trigo);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 11px;
  display: flex;
  gap: 14px;
  z-index: 30;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 165, 116, 0.18);
}
.db-shortcuts kbd {
  font-family: var(--mono);
  background: rgba(212, 165, 116, 0.15);
  border: 1px solid rgba(212, 165, 116, 0.3);
  color: var(--ocre-claro);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
}
@media (max-width: 760px) { .db-shortcuts { display: none; } }

/* FOOTER */
.db-foot {
  background: #1a0e08;
  color: rgba(245, 222, 179, 0.6);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  flex-wrap: wrap;
  gap: 8px;
}
.db-foot span:last-child strong, .db-foot span span { color: var(--ocre-claro); }
