:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-soft: #efe9df;
  --ink: #1d1b16;
  --ink-soft: #3f3a33;
  --accent: #d97757;
  --accent-strong: #b4533c;
  --line: #d6cfc3;
  --card: #ffffff;
  --shadow: 0 18px 40px rgba(29, 27, 22, 0.12);
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

img,
svg {
  display: block;
  max-width: 100%;
}

.ambient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(217, 119, 87, 0.2), transparent 45%),
    radial-gradient(circle at 90% 0%, rgba(127, 179, 157, 0.18), transparent 50%),
    linear-gradient(135deg, rgba(246, 244, 239, 0.92), rgba(255, 255, 255, 0.95));
  z-index: -1;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 24px;
}

.sidebar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffe5d6, #f8bca7);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent-strong);
}

.brand-title {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.sidebar-controls {
  display: grid;
  gap: 12px;
}

.search {
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.search input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav button {
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav button:hover {
  border-color: var(--line);
  background: var(--bg-soft);
}

.nav button.active {
  border-color: var(--accent);
  background: rgba(217, 119, 87, 0.12);
  color: var(--accent-strong);
  font-weight: 600;
}

.nav-label {
  flex: 1;
}

.updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(47, 122, 90, 0.35);
  background: rgba(47, 122, 90, 0.14);
  color: #2f7a5a;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}

.nav-divider {
  margin: 8px 0 2px;
  padding: 6px 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.list-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.list-link:hover {
  text-decoration: underline;
}

.doc-reader {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 16px;
}

.doc-list {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--bg);
  display: grid;
  gap: 10px;
  align-content: start;
}

.doc-list h3 {
  margin: 0;
  font-size: 0.95rem;
}

.doc-item {
  border: 1px solid transparent;
  background: var(--card);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doc-item.active {
  border-color: var(--accent);
  background: rgba(217, 119, 87, 0.12);
  font-weight: 600;
}

.doc-content {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--card);
  min-height: 320px;
  overflow: auto;
}

.doc-content h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.doc-content pre {
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: "Space Grotesk", system-ui, sans-serif;
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.timeline {
  display: grid;
  gap: 16px;
  position: relative;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: start;
}

.timeline-marker {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1;
}

.timeline-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--bg);
}

.timeline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline-header h3 {
  margin: 0;
  font-size: 1rem;
}

.timeline-header span {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.timeline-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.timeline-columns h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
}

.timeline-columns ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.timeline-columns li {
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    display: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .doc-reader {
    grid-template-columns: 1fr;
  }
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  justify-content: center;
}

.footer-logo {
  display: inline-flex;
}

.footer-brand img {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.footer-brand a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}

.footer-brand a:hover {
  color: var(--accent-strong);
}

.footer-date {
  margin: 0;
  text-align: center;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.intro {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
}

.intro-hero h2 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
}

.intro-hero p {
  margin: 0 0 10px;
  color: var(--ink-soft);
}

.intro-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: center;
  text-align: center;
}

.flow-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 12px;
  background: var(--bg);
  display: grid;
  gap: 6px;
  justify-items: center;
}

.flow-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(217, 119, 87, 0.15);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.flow-item h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.flow-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.flow-arrow {
  font-size: 1.4rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.intro-bridge {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.intro-bridge h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.intro-bridge p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.topbar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-banner {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.hero-banner img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 90px;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(6px);
  z-index: 20;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

.chat-toggle {
  position: fixed;
  right: 28px;
  bottom: 28px;
  border: none;
  background: linear-gradient(135deg, #c45a40, #e07b5d);
  color: #fff;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 30;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.chat-toggle img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  animation: chatPulse 2.4s ease-in-out infinite;
}

.chat-panel {
  position: fixed;
  right: 24px;
  top: 24px;
  bottom: 24px;
  width: min(420px, 92vw);
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.25s ease;
  z-index: 30;
}

.chat-panel.open {
  transform: translateX(0);
}

.chat-panel.maximized {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  border-radius: 0;
}

.chat-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chat-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--line);
}

.chat-header h3 {
  margin: 4px 0 0;
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
}

.chat-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
}

.chat-close {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-soft);
}

.chat-maximize {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-soft);
}

.chat-close svg {
  width: 18px;
  height: 18px;
}

.chat-maximize svg {
  width: 18px;
  height: 18px;
}

.chat-messages {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(246, 244, 239, 0.4), transparent 40%);
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(217, 119, 87, 0.18);
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(217, 119, 87, 0.3);
  flex: 0 0 auto;
}

.chat-user-avatar svg {
  width: 20px;
  height: 20px;
}

.chat-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(217, 119, 87, 0.12);
  border-color: rgba(217, 119, 87, 0.35);
  color: var(--ink);
}

.chat-bubble.agent {
  align-self: flex-start;
}

.chat-bubble.chat-bubble-card {
  border: none;
  background: transparent;
  padding: 0;
}

.chat-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.chat-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  line-height: 1.45;
}

.chat-list-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.chat-list-icon svg {
  width: 10px;
  height: 10px;
}

.chat-list-text p {
  margin: 0;
}

.chat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--bg);
  display: grid;
  gap: 8px;
}

.chat-card-response {
  gap: 12px;
}

.chat-card-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 10px;
  align-items: center;
}

.chat-card-header .chat-response-icon {
  grid-row: 1;
}

.chat-card-header .chat-response-title {
  grid-column: 2;
}

.chat-card-header .chat-response-link {
  grid-column: 3;
  justify-self: end;
}

.chat-card h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.chat-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.chat-card-body {
  display: grid;
  gap: 8px;
}

.chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.chat-table th,
.chat-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.chat-table th {
  background: rgba(217, 119, 87, 0.12);
  color: var(--ink);
  font-weight: 600;
}

.chat-response {
  display: grid;
  gap: 10px;
}

.chat-response-header {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 6px;
  align-items: center;
}

.chat-response-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(217, 119, 87, 0.16);
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-row: 1 / span 2;
}

.chat-response-icon svg {
  width: 16px;
  height: 16px;
}

.chat-response-title {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 600;
  grid-column: 2;
}

.chat-response-link {
  grid-column: 2;
  justify-self: end;
  text-decoration: none;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(217, 119, 87, 0.35);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(217, 119, 87, 0.12);
  white-space: nowrap;
}

.chat-response-link:hover {
  border-color: var(--accent);
  background: rgba(217, 119, 87, 0.2);
}

.chat-response-body {
  display: grid;
  gap: 10px;
}

.chat-loading {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
  opacity: 0.7;
  animation: dotPulse 1.1s ease-in-out infinite;
}

.chat-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.chat-form {
  display: grid;
  gap: 12px;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.chat-disclaimer {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: left;
}

.chat-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  width: 100%;
}

.chat-check input {
  margin-top: 2px;
  justify-self: start;
}

.chat-check span {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 6px;
  text-align: left;
  min-width: 0;
}

.chat-check svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--accent-strong);
  flex: 0 0 auto;
}

.chat-form.needs-consent .chat-check {
  animation: consentPulse 2.6s ease-in-out infinite;
}

.chat-form.needs-consent .chat-input-row {
  opacity: 0.7;
}

.chat-input-row {
  display: flex;
  gap: 10px;
}

.chat-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
}

.chat-form button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.chat-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-form input:disabled {
  background: var(--bg);
  cursor: not-allowed;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.tutorial-open {
  overflow: hidden;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.tutorial-overlay.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.tutorial-highlight {
  position: absolute;
  border-radius: 16px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(18, 16, 12, 0.68);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  pointer-events: none;
}

.tutorial-card {
  position: absolute;
  width: min(320px, calc(100vw - 32px));
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 10px;
  pointer-events: auto;
}

.tutorial-step {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.tutorial-card h3 {
  margin: 0;
  font-size: 1rem;
}

.tutorial-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.tutorial-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tutorial-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.tutorial-btn {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.82rem;
  cursor: pointer;
}

.tutorial-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tutorial-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(18, 16, 12, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.welcome-overlay.active {
  opacity: 1;
  visibility: visible;
}

.welcome-card {
  width: min(560px, 92vw);
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 16px;
  text-align: center;
}

.welcome-logo {
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.welcome-logo img {
  width: min(200px, 60vw);
  height: auto;
  object-fit: contain;
}

.welcome-title {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
}

.welcome-subtitle {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.welcome-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

@keyframes chatPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.06);
  }
}

@keyframes consentPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes dotPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.topbar h1 {
  margin: 4px 0 0;
  font-family: "Fraunces", serif;
  font-size: 1.8rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--accent-strong);
}

.status-pill {
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}

.module-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  min-height: 60vh;
}

.module-header h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.module-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.module-header p {
  margin: 0;
  color: var(--ink-soft);
}

.module-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-doc-link {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.module-doc-link:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
}

.module-doc-link svg {
  width: 20px;
  height: 20px;
}

.module-scope {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(217, 119, 87, 0.14);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.module-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--bg);
  display: grid;
  gap: 14px;
}

.module-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.module-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}

.module-card li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.list-icon {
  color: var(--accent-strong);
  font-weight: 600;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  width: 26px;
  line-height: 1;
  flex: 0 0 26px;
}

.list-text {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.list-text-value {
  white-space: pre-line;
}

.module-group {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--bg);
}

.module-group h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.module-group p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.flow-title {
  margin: 8px 0 0;
  font-size: 1rem;
}

.flow-diagram {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.flow-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  padding: 12px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 180px;
}

.flow-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(217, 119, 87, 0.18);
  display: grid;
  place-items: center;
}

.flow-step-text h4 {
  margin: 0 0 4px;
  font-size: 0.85rem;
}

.flow-step-text p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.flow-step-arrow {
  font-size: 1.4rem;
  color: var(--accent-strong);
  font-weight: 600;
}

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

  .menu-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    inset: 24px 24px auto 24px;
    max-height: calc(100vh - 48px);
    transform: translateX(-120%);
    transition: transform 0.25s ease;
    z-index: 10;
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .intro-flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    display: none;
  }

  .flow-step-arrow {
    display: none;
  }

  .chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
  }

  .chat-response-link {
    width: 100%;
    text-align: center;
  }
}
