:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #18202a;
  --muted: #657080;
  --line: #dce1e7;
  --accent: #12675f;
  --accent-soft: #e6f3f1;
  --figure: #fff8e6;
  --shadow: 0 18px 45px rgba(21, 28, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #eef2f5;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.35rem;
}

h2 {
  font-size: 1.45rem;
  line-height: 1.25;
}

h3 {
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: uppercase;
}

.count,
.eyebrow {
  color: var(--muted);
  font-size: 0.86rem;
}

.search-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.search-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
}

.search-input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(18, 103, 95, 0.15);
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
}

.question-item {
  width: 100%;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  line-height: 1.25;
  background: transparent;
  min-height: 42px;
}

.question-item.active {
  background: var(--accent-soft);
  border-color: rgba(18, 103, 95, 0.45);
  color: var(--accent);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.toolbar {
  max-width: 980px;
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

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

.toolbar-actions button {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  font-size: 1.6rem;
  line-height: 1;
}

.content-panel {
  max-width: 980px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.question-section,
.answer-section,
.solution-section {
  padding: 24px;
}

.answer-section,
.solution-section {
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.section-heading button {
  min-width: 82px;
  height: 36px;
  border-radius: 6px;
}

.rich-text {
  font-size: 1.04rem;
  line-height: 1.7;
}

.rich-text p {
  margin: 0 0 1rem;
}

.rich-text p:last-child {
  margin-bottom: 0;
}

.rich-text ul,
.rich-text ol {
  padding-left: 1.4rem;
}

.figure-alt {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #eedca8;
  border-radius: 8px;
  background: var(--figure);
}

.figure-alt strong {
  display: block;
  margin-bottom: 6px;
  color: #705300;
}

.hidden {
  display: none;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 42vh;
  }

  .workspace {
    padding: 18px;
  }

  .toolbar {
    align-items: flex-start;
  }

  .content-panel {
    border-radius: 6px;
  }

  .question-section,
  .answer-section,
  .solution-section {
    padding: 18px;
  }
}
