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

:root {
  --ink: #082f32;
  --ink-muted: #6a7d7b;
  --ink-soft: rgba(8, 47, 50, 0.45);
  --cream: #f7f5ef;
  --paper: #fffdf8;
  --line: rgba(8, 47, 50, 0.12);
  --focus: #ffc94a;
  --coral: #ff625f;
  --coral-wash: #ffe1dc;
  --mint: #68d9aa;
  --mint-wash: #dff7ee;
  --blue: #4ca7e8;
  --blue-wash: rgba(76, 167, 232, 0.18);
  --lilac: #ad92f4;
  --lilac-wash: rgba(173, 146, 244, 0.18);
  --gold: #ffc94a;
  --gold-wash: rgba(255, 201, 74, 0.28);
  --card-shadow: 0 16px 44px rgba(8, 47, 50, 0.1);
  --fab-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Legacy aliases used by accent class names */
  --teal: var(--ink);
  --teal-muted: var(--ink-muted);
  --teal-soft: var(--ink-soft);
  --white: var(--paper);
  --page: var(--cream);
  --sage: var(--mint);
  --sage-wash: var(--mint-wash);
  --yellow: var(--gold);
  --yellow-wash: var(--gold-wash);
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Lexend", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-shell {
  margin: 0 auto;
  max-width: 430px;
  min-height: 100%;
  padding: 20px 20px calc(var(--fab-height) + 32px + var(--safe-bottom));
}

.app-header {
  margin-bottom: 20px;
}

.app-header-link {
  color: inherit;
  display: block;
  text-decoration: none;
  width: 100%;
}

.app-header-link:active {
  opacity: 0.85;
}

.app-header-logo {
  border-radius: 8px;
  display: block;
  height: 80px;
  object-fit: contain;
  object-position: center;
  width: 100%;
}

.app-header-title {
  flex-shrink: 0;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-sub {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.55;
  margin-bottom: 24px;
}

.back-link {
  appearance: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  gap: 4px;
  margin-bottom: 20px;
  padding: 0;
  text-decoration: none;
}

.back-link:hover {
  opacity: 0.75;
}

.topic-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topic-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  color: inherit;
  cursor: pointer;
  display: block;
  min-height: 140px;
  padding: 22px 20px;
  text-align: left;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  width: 100%;
}

.topic-card:active {
  transform: scale(0.99);
}

.topic-card-inner {
  align-items: flex-start;
  display: flex;
  gap: 16px;
}

.well {
  align-items: center;
  border-radius: 8px;
  display: flex;
  flex-shrink: 0;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.well--coral {
  background: var(--coral-wash);
  color: var(--ink);
}

.well--blue {
  background: var(--blue-wash);
  color: var(--ink);
}

.well--lilac {
  background: var(--lilac-wash);
  color: var(--ink);
}

.well--sage {
  background: var(--mint-wash);
  color: var(--ink);
}

.well svg {
  display: block;
  height: 26px;
  width: 26px;
}

.topic-card-body {
  flex: 1;
  min-width: 0;
}

.topic-card-title {
  align-items: center;
  display: flex;
  font-size: 22px;
  font-weight: 750;
  gap: 8px;
  justify-content: space-between;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.topic-card-title-text {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.topic-badge {
  border-radius: 999px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  padding: 4px 8px;
  text-transform: uppercase;
}

.topic-badge--yellow {
  background: var(--gold-wash);
  color: var(--ink);
}

.topic-badge--coral {
  background: var(--coral-wash);
  color: var(--ink);
}

.topic-badge--blue {
  background: var(--blue-wash);
  color: var(--ink);
}

.topic-badge--lilac {
  background: var(--lilac-wash);
  color: var(--ink);
}

.chevron {
  color: var(--ink-soft);
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.preview-questions {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.4;
}

.preview-sep {
  color: var(--ink-soft);
}

.article-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.article-header .well {
  height: 48px;
  width: 48px;
}

.article-header .well svg {
  height: 22px;
  width: 22px;
}

.article-title {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.article-intro {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.55;
  margin-bottom: 12px;
}

.article-intro:last-of-type {
  margin-bottom: 20px;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.question-link {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  color: inherit;
  display: flex;
  font-size: 16px;
  font-weight: 650;
  gap: 12px;
  line-height: 1.4;
  padding: 18px 16px;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.question-link:active {
  transform: scale(0.99);
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.step-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  padding: 16px 16px 16px 14px;
}

.step-num {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  margin-bottom: 8px;
  width: 28px;
}

.step-num--coral {
  background: var(--coral-wash);
  color: var(--ink);
}

.step-num--blue {
  background: var(--blue-wash);
  color: var(--ink);
}

.step-num--lilac {
  background: var(--lilac-wash);
  color: var(--ink);
}

.step-num--sage {
  background: var(--mint-wash);
  color: var(--ink);
}

.section-title {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.more-entry {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  color: inherit;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 16px 18px;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.more-entry:active {
  transform: scale(0.99);
}

.more-entry-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.more-entry-label {
  font-size: 17px;
  font-weight: 750;
}

.more-entry-hint {
  color: var(--ink-muted);
  font-size: 13px;
}

.step-title {
  font-size: 16px;
  font-weight: 750;
  margin-bottom: 4px;
}

.step-body {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.5;
}

.step-example {
  color: var(--ink);
  font-style: italic;
}

.try-it {
  align-items: center;
  background: var(--paper);
  border: 1px solid rgba(255, 98, 95, 0.34);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  font-size: 14px;
  font-weight: 650;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.try-it:active {
  background: var(--coral-wash);
}

.try-it .lana-chat-icon {
  color: var(--coral);
}

.lana-chat-icon {
  display: block;
  flex-shrink: 0;
  height: 16px;
  width: 16px;
}

.fab .lana-chat-icon {
  height: 18px;
  width: 18px;
}

.install-hint {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 28px;
}

.install-hint strong {
  color: var(--ink-muted);
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 4px;
}

.fab {
  align-items: center;
  background: var(--coral);
  border: none;
  border-radius: 8px;
  bottom: calc(16px + var(--safe-bottom));
  box-shadow: 0 12px 34px rgba(255, 98, 95, 0.26);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 16px;
  font-weight: 750;
  gap: 8px;
  height: var(--fab-height);
  padding: 0 22px;
  position: fixed;
  right: 20px;
  text-decoration: none;
  transition: transform 160ms ease;
  z-index: 100;
}

.fab svg {
  flex-shrink: 0;
  height: 18px;
  width: 18px;
}

.fab:active {
  transform: scale(0.98);
}

@media (min-width: 480px) {
  .fab {
    right: max(20px, calc(50% - 215px));
  }
}

.empty-state {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.5;
}

.empty-state a {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .topic-card,
  .question-link,
  .more-entry,
  .fab,
  .try-it {
    transition-duration: 0.01ms !important;
  }

  .topic-card:active,
  .question-link:active,
  .more-entry:active,
  .fab:active {
    transform: none;
  }
}
