:root {
  --bg: #08121f;
  --panel: rgba(13, 26, 44, 0.82);
  --panel-border: rgba(136, 175, 223, 0.28);
  --text: #e7efff;
  --muted: #9fb5d8;
  --accent: #66d5ff;
  --accent-2: #77f0c1;
  --warn: #ffb766;
  --shadow: 0 24px 50px rgba(2, 8, 18, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: radial-gradient(circle at 20% 15%, #173151 0%, #0a1628 45%, #040a13 100%);
  font-family: "Space Grotesk", sans-serif;
}

.bg-orb {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.3;
  z-index: 0;
}

.bg-orb-1 {
  width: 260px;
  height: 260px;
  background: #1e5bb4;
  top: -80px;
  right: 10%;
}

.bg-orb-2 {
  width: 220px;
  height: 220px;
  background: #28b7a5;
  bottom: -80px;
  left: 8%;
}

.topbar,
.layout,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 20px 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  letter-spacing: 0.02em;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  border: 1px solid rgba(125, 175, 230, 0.45);
  color: var(--text);
  background: rgba(26, 49, 78, 0.72);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(31, 62, 99, 0.95);
}

.btn-ghost {
  background: rgba(14, 27, 45, 0.8);
}

.layout {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 20px 24px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 320px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.panel-main {
  min-height: 70vh;
}

.panel-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(140, 182, 236, 0.16);
}

.panel-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.meta {
  margin-top: 6px;
  display: inline-block;
  font-size: 0.82rem;
  color: var(--muted);
}

.report {
  margin: 0;
  padding: 16px 18px 20px;
  white-space: pre-wrap;
  line-height: 1.48;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  color: #e4f1ff;
}

.history-list {
  margin: 0;
  list-style: none;
  padding: 8px 10px 10px;
  max-height: 72vh;
  overflow: auto;
}

.history-tree-wrap {
  margin: 0 0 8px;
}

.history-tree {
  border: 1px solid rgba(130, 186, 247, 0.2);
  border-radius: 12px;
  background: rgba(14, 29, 49, 0.72);
}

.history-tree + .history-tree {
  margin-top: 8px;
}

.history-tree summary {
  cursor: pointer;
  padding: 8px 10px;
  font-size: 0.88rem;
  color: #d8e7ff;
  user-select: none;
}

.month-node {
  margin: 6px 8px 8px;
  border-radius: 10px;
}

.month-node summary {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-day-list {
  list-style: none;
  margin: 0;
  padding: 2px 8px 8px;
}

.history-day-list li {
  margin: 4px 0;
}

.history-leaf {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(10, 22, 38, 0.7);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.history-leaf:hover {
  border-color: rgba(130, 186, 247, 0.35);
  background: rgba(18, 36, 60, 0.8);
}

.history-leaf.active {
  border-color: rgba(102, 213, 255, 0.66);
  background: rgba(16, 46, 75, 0.84);
}

.history-date {
  font-size: 0.85rem;
  font-weight: 600;
}

.history-file {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.footer {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px 28px;
  color: var(--muted);
  font-size: 0.8rem;
}

.disclaimer-card {
  margin-top: 14px;
  padding: 14px 14px 10px;
  border-radius: 12px;
  border: 1px solid rgba(132, 180, 240, 0.22);
  background: rgba(11, 21, 35, 0.72);
}

.disclaimer-card h3 {
  margin: 0 0 8px;
  color: #d2e6ff;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.disclaimer-card p {
  margin: 0 0 7px;
  line-height: 1.45;
}

.glossary-list {
  margin: 6px 0 0;
  padding-left: 18px;
  line-height: 1.45;
}

.glossary-list li {
  margin: 0 0 6px;
}

.disclaimer-card a {
  color: var(--accent);
}

.disclaimer-card a:hover {
  color: var(--accent-2);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .history-list {
    max-height: 36vh;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 18px 14px 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .actions {
    justify-content: flex-end;
  }

  .btn {
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .layout {
    padding: 10px 14px 18px;
    gap: 12px;
  }

  .panel-main {
    min-height: auto;
  }

  .panel-head {
    padding: 12px 12px 10px;
  }

  .panel-head h2 {
    font-size: 0.9rem;
  }

  .report {
    padding: 12px 12px 14px;
    font-size: 0.83rem;
    line-height: 1.4;
  }

  .history-list {
    max-height: 42vh;
    padding: 6px 8px 8px;
  }

  .history-tree summary {
    padding: 7px 9px;
    font-size: 0.84rem;
  }

  .history-day-list {
    padding: 2px 6px 6px;
  }

  .history-leaf {
    padding: 7px 8px;
  }

  .history-date {
    font-size: 0.8rem;
  }

  .history-file {
    font-size: 0.74rem;
  }

  .footer {
    padding: 0 14px 18px;
    font-size: 0.76rem;
  }

  .disclaimer-card {
    margin-top: 10px;
    padding: 12px 10px 8px;
  }
}
