:root {
  --accent: #9b1c1c;
  --accent-warm: #b45309;
  --text: #222;
  --muted: #777;
  --faint: #aaa;
  --bg: #f5f3f0;
  --border: #ddd;
}

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

html,
body {
  min-height: 100%;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: Georgia, serif;
  border-top: 3px solid var(--accent);
}

a {
  color: inherit;
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  padding: 28px 14px 28px 12px;
  background: #f1ede7;
}

.brand-title {
  font-size: 1.7em;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-family: monospace;
  font-size: 0.78em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  font-family: monospace;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: #f2efea;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.nav-link:hover {
  color: var(--text);
  border-color: #c6bfb5;
}

.nav-link.active {
  color: var(--accent);
  border-color: var(--accent);
  background: #f8ecec;
}

.main-panel {
  padding: 0 28px 80px;
}

.page-header {
  padding: 36px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.2em;
}

.page-header h1 {
  font-size: 2.4em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.15em;
}

.meta {
  font-size: 0.75em;
  color: var(--faint);
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
}

.status-line {
  margin-top: 10px;
  font-family: monospace;
  font-size: 0.72em;
  color: var(--muted);
}

.content {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.7;
}

.content h2 {
  font-size: 0.78em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-top: 2.4em;
  margin-bottom: 0.8em;
}

.content h3 {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.4em;
  margin-bottom: 0.3em;
  line-height: 1.3;
}

.content p {
  margin-bottom: 1em;
  color: #3a3a3a;
}

.content ul,
.content ol {
  padding-left: 1.3em;
  margin-bottom: 1em;
}

.content li {
  margin-bottom: 0.35em;
}

.content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.2em 0;
}

.content blockquote {
  border-left: 4px solid var(--accent);
  margin: 1.4em 0;
  padding: 0.3em 0 0.3em 1.2em;
  color: #444;
  font-size: 1.05em;
  font-style: italic;
}

code {
  font-family: monospace;
  font-size: 0.82em;
  background: #ece9e4;
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--text);
}

.tag {
  font-family: monospace;
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid currentColor;
}

.tag.urgent {
  color: var(--accent);
}

.tag.watch {
  color: var(--accent-warm);
}

.timestamp {
  font-family: monospace;
  font-size: 0.75em;
  color: var(--faint);
  vertical-align: middle;
}

.placeholder {
  color: #bbb;
  font-style: italic;
}

#analyst-live-body {
  transition: opacity 160ms ease;
}

#analyst-live-body.loading {
  opacity: 0.55;
}

#analyst-live-body.streaming::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

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

  .side-nav {
    position: sticky;
    top: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    z-index: 40;
  }

  .brand-title {
    font-size: 1.3em;
  }

  .brand-subtitle {
    font-size: 0.74em;
    margin-bottom: 10px;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .main-panel {
    padding: 0 24px 80px;
  }

  .content {
    max-width: 680px;
  }
}
