:root {
  --bg: #eef2f3;
  --panel: #ffffff;
  --ink: #18222b;
  --muted: #5a6873;
  --line: #d7e0e6;
  --accent: #0c5c68;
  --accent-soft: #e5f3f4;
  --warm: #fff7e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(12, 92, 104, 0.11), transparent 28%),
    radial-gradient(circle at top right, rgba(166, 108, 32, 0.08), transparent 22%),
    linear-gradient(180deg, #f7f9fa 0%, #e8eef1 100%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 18px 56px;
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(24, 34, 43, 0.08);
}

.hero {
  padding: 26px;
  margin-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 249, 0.98)),
    linear-gradient(135deg, rgba(12, 92, 104, 0.08), transparent 35%);
}

.eyebrow,
.section-title,
.page-kicker {
  font: 700 12px/1.2 Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent);
  background: var(--accent-soft);
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

.lede,
p,
li {
  line-height: 1.55;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}

.stat {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdff;
  font: 600 13px/1.2 Arial, sans-serif;
}

.toolbar {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  margin-top: 20px;
}

.toolbar label {
  display: grid;
  gap: 6px;
  font: 600 13px/1.3 Arial, sans-serif;
  color: var(--muted);
}

.toolbar input,
.toolbar select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 16px/1.4 Georgia, "Times New Roman", serif;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.sidebar,
.column > .panel,
.detail-panel {
  padding: 18px;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.section-title {
  color: var(--muted);
  margin-bottom: 12px;
}

.section-list {
  display: grid;
  gap: 8px;
}

.section-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  cursor: pointer;
  text-align: left;
}

.section-card.active {
  background: var(--accent-soft);
  border-color: #b5d8da;
}

.section-card-title {
  font: 700 15px/1.3 Georgia, "Times New Roman", serif;
}

.section-card small {
  color: var(--muted);
  font: 12px/1.2 Arial, sans-serif;
}

.section-card .muted {
  color: #6b7b86;
}

.main {
  display: grid;
  gap: 16px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.page-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.page-card.selected {
  border-color: #89b3ba;
  box-shadow: 0 0 0 2px rgba(12, 92, 104, 0.08);
}

.page-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.page-card h3 {
  font-size: 1.08rem;
  margin-top: 4px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fbfdff;
  font: 600 12px/1 Arial, sans-serif;
  white-space: nowrap;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 12px/1 Arial, sans-serif;
}

.pill.soft {
  background: #f8fbfb;
  color: #3f5961;
  border: 1px solid #d8e6e8;
}

.snippet {
  margin: 0;
  color: var(--ink);
}

.meta {
  color: var(--muted);
  font: 600 12px/1.35 Arial, sans-serif;
}

.detail-panel .detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.detail-summary {
  margin: 6px 0 0;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.detail-grid section,
.supporting {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.stack {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.stack li {
  line-height: 1.45;
}

.empty-copy,
.detail-empty {
  color: var(--muted);
}

.detail-copy {
  color: var(--muted);
  font: 12px/1.35 Arial, sans-serif;
}

.chip {
  display: inline-block;
  padding: 3px 7px;
  margin-right: 4px;
  border-radius: 999px;
  background: var(--warm);
  border: 1px solid #eed9a8;
  font: 600 11px/1 Arial, sans-serif;
  color: #7a5c1c;
}

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

  .sidebar {
    position: static;
    max-height: none;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }
}
