/* LitReview Agent — static UI (ui-flow.md §2, docs/assets/litreview_ui_mockups.png) */

:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-muted: #f1f0ea;
  --border: #e4e2da;
  --text: #17171a;
  --text-muted: #5c5c63;
  --accent: #dcf05a;
  --accent-hover: #cfe646;
  --accent-soft: #f2f9cf;
  --warning: #f2c230;
  --danger-bg: #fff4d6;
  --overlay: rgba(23, 23, 26, 0.45);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(23, 23, 26, 0.08);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
}

.brand__mark {
  width: 26px;
  height: 26px;
  flex: none;
}

/* ---------- App shell with sidebar (screens 1–3) ---------- */

.app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-decoration: none;
  color: var(--text-muted);
}

.nav__link:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav__link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.nav__icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.help-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 13px;
}

.help-card strong {
  display: block;
}

.help-card a {
  color: var(--text-muted);
  text-decoration: none;
}

.help-card a:hover {
  text-decoration: underline;
}

.main {
  position: relative;
  padding: 64px clamp(24px, 6vw, 88px);
  overflow: hidden;
}

/* ---------- Top bar shell (screens 4–6) ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--text);
  border-radius: 50%;
}

.avatar svg {
  width: 18px;
  height: 18px;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: calc(100vh - 71px);
  padding: 48px 16px;
  text-align: center;
}

.state__illustration {
  width: 120px;
  height: 120px;
  margin-bottom: 8px;
}

.state__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.state__text {
  max-width: 420px;
  margin: 0;
  color: var(--text-muted);
}

.state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

/* ---------- Hero (screens 1–2) ---------- */

.hero {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.hero__title {
  margin: 0 0 14px;
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__lead {
  margin: 0 0 32px;
  color: var(--text-muted);
  font-size: 16px;
}

.hero__art {
  position: absolute;
  top: 24px;
  right: clamp(-60px, -2vw, 0px);
  width: clamp(180px, 26vw, 320px);
  opacity: 0.95;
  pointer-events: none;
}

/* ---------- Inputs ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
}

.search:focus-within {
  border-color: var(--text);
}

.search__input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--text);
}

.search__input:focus {
  outline: none;
}

.search__input::placeholder {
  color: #9a9aa0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--accent-hover);
}

.icon-button--plain {
  background: transparent;
}

.icon-button--plain:hover {
  background: var(--surface-muted);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.hint {
  margin: 10px 4px 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Chips & topic cards ---------- */

.chips-label {
  margin: 40px 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  text-decoration: none;
}

.chip:hover {
  border-color: var(--text);
}

.section-title {
  margin: 40px 0 14px;
  font-size: 15px;
  font-weight: 600;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

.topic-card:hover {
  border-color: var(--text);
  box-shadow: var(--shadow);
}

.topic-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.topic-card__count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 128px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn--primary {
  background: var(--accent);
  color: var(--text);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: var(--surface);
  border-color: var(--text);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--surface-muted);
}

/* ---------- Processing (screen 4) ---------- */

.progress {
  width: min(240px, 70vw);
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
}

.progress__bar {
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: progress-slide 1.6s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(230%);
  }
}

/* Progress steps inside Processing */

.steps-card {
  width: min(360px, 100%);
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.steps-card__count {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.step__icon {
  position: relative;
  width: 20px;
  height: 20px;
  flex: none;
  border: 2px solid var(--border);
  border-radius: 50%;
}

.step.is-active {
  color: var(--text);
  font-weight: 600;
}

.step.is-active .step__icon {
  border-color: var(--surface-muted);
  border-top-color: var(--text);
  animation: step-spin 0.8s linear infinite;
}

.step.is-done {
  color: var(--text);
}

.step.is-done .step__icon {
  border-color: var(--accent);
  background: var(--accent);
}

.step.is-done .step__icon::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid var(--text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@keyframes step-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress__bar,
  .step.is-active .step__icon {
    animation: none;
  }

  .step.is-active .step__icon {
    border-color: var(--text);
  }
}

/* ---------- Topic kept across states (spec 001 FR-008) ---------- */

.state__topic {
  max-width: 520px;
  margin: -4px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.kept-topic {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 420px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.kept-topic__label {
  font-size: 12px;
  color: var(--text-muted);
}

.kept-topic__text {
  overflow-wrap: anywhere;
}

.state__hint {
  max-width: 420px;
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.demo-link {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Error (screen 5) ---------- */

.error-cause {
  max-width: 420px;
  margin: 0;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  font-size: 13px;
}

/* ---------- Modal (screen 3) ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--overlay);
}

.modal {
  position: relative;
  width: min(420px, 100%);
  padding: 32px 28px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(23, 23, 26, 0.25);
  text-align: center;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.modal__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
}

.modal__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.modal__text {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.modal__list {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  list-style: none;
  text-align: left;
  font-size: 13px;
}

.modal__list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.modal__list span:last-child {
  color: var(--text-muted);
  text-align: right;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal__actions .btn {
  min-width: 0;
}

/* ---------- Choose Role ---------- */

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  width: min(720px, 100%);
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.role-card:hover,
.role-card:focus-visible {
  border-color: var(--text);
  box-shadow: var(--shadow);
}

.role-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.role-card__icon svg,
.role-card__arrow svg {
  width: 22px;
  height: 22px;
}

.role-card__body {
  flex: 1;
}

.role-card__body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.role-card__body small {
  color: var(--text-muted);
  font-size: 13px;
}

.role-card__arrow {
  color: var(--text-muted);
}

/* ---------- View Results ---------- */

.main--results {
  max-width: 920px;
  overflow: visible;
}

.results__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 8px;
}

.results__eyebrow {
  width: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.results__title {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.01em;
}

.results__refine {
  font-size: 14px;
  color: var(--text-muted);
}

.section-title small {
  font-weight: 400;
  color: var(--text-muted);
}

.chip--static {
  background: var(--accent-soft);
  border-color: transparent;
}

.notice {
  margin: 28px 0 16px;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.results {
  counter-reset: kept;
}

.paper-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.paper {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.paper:has(.decision__input--keep:checked) {
  border-color: #b9cf3a;
  box-shadow: inset 4px 0 0 var(--accent);
}

.paper:has(.decision__input--skip:checked) {
  opacity: 0.55;
}

.paper__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.paper__rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.badge--strong {
  background: var(--accent);
}

.badge--possible {
  background: var(--surface-muted);
}

.badge--warn {
  background: var(--danger-bg);
}

.paper__title {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.35;
}

.paper__meta {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.paper__doi {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.paper__doi svg {
  width: 13px;
  height: 13px;
}

.paper__abstract {
  display: -webkit-box;
  margin: 12px 0;
  overflow: hidden;
  font-size: 14px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.paper__abstract--missing {
  font-style: italic;
  color: var(--text-muted);
}

.paper__why {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
}

.decision {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.decision__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.decision__input--keep:checked {
  counter-increment: kept;
}

.decision__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.decision__btn svg {
  width: 15px;
  height: 15px;
}

.decision__btn:hover {
  border-color: var(--text);
}

.decision__input:focus-visible + .decision__btn {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.decision__input--keep:checked + .decision__btn--keep {
  border-color: var(--text);
  background: var(--accent);
}

.decision__input--skip:checked + .decision__btn--skip {
  border-color: var(--text);
  background: var(--surface-muted);
}

.save-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 12px 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.save-bar__count {
  margin: 0;
  font-size: 14px;
}

.save-bar__n::after {
  content: counter(kept);
  font-weight: 700;
}

/* Toast: top-right corner, slides in, hides itself after ~4 s */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 20;
  display: none;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 14px 12px 14px 16px;
  border: 1px solid #b9cf3a;
  border-left: 4px solid var(--accent-hover);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(23, 23, 26, 0.16);
  font-size: 14px;
  font-weight: 600;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.toast__icon svg {
  width: 14px;
  height: 14px;
}

.toast__text {
  flex: 1;
}

.toast__close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  color: var(--text-muted);
}

.toast__close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.toast__close svg {
  width: 14px;
  height: 14px;
}

.toast:target {
  display: flex;
  animation: toast-in 0.3s ease-out, toast-out 0.4s ease-in 4s forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Ends fully off-screen so the invisible toast never blocks clicks. */
@keyframes toast-out {
  99% {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 0;
    visibility: hidden;
    transform: translateX(calc(100% + 48px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast:target {
    animation: toast-out 0.01s linear 4s forwards;
  }
}

@media (max-width: 760px) {
  .toast {
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}

/* ---------- Beginner guide & inline empty state ---------- */

.guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.guide-steps li {
  position: relative;
  padding: 14px 14px 14px 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  counter-increment: step;
}

.guide-steps li::before {
  content: counter(step);
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

.guide-steps strong {
  display: block;
  font-size: 14px;
}

.guide-steps span {
  color: var(--text-muted);
}

.empty-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 28px;
  padding: 12px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.empty-inline strong {
  color: var(--text);
}

/* ---------- Input Guidance ---------- */

.field-error {
  margin: 10px 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: #8a5a00;
}

.search--invalid {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.guidance {
  margin-top: 14px;
  padding: 16px 18px;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  font-size: 14px;
}

.guidance p {
  margin: 0 0 8px;
}

.guidance__title {
  font-weight: 700;
}

.guidance__reason {
  color: var(--text-muted);
}

.guidance__tips-title {
  font-weight: 600;
}

.guidance__tips {
  margin: 0;
  padding-left: 18px;
}

/* ---------- Keyword review (AI Research Guidance) ---------- */

.note-broad {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 14px;
}

.panel {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel p {
  margin: 0 0 10px;
  font-size: 14px;
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
}

.panel__title svg {
  width: 18px;
  height: 18px;
}

.panel__hint {
  color: var(--text-muted);
}

.aspects {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}

.aspects li {
  margin: 4px 0;
}

.kw-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.kw-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.kw {
  position: relative;
}

.kw__check {
  position: absolute;
  top: 16px;
  left: 14px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--text);
}

.kw__label {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  padding: 12px 14px 12px 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.kw__check:checked + .kw__label {
  border-color: #b9cf3a;
  background: var(--accent-soft);
}

.kw__check:not(:checked) + .kw__label .kw__term {
  text-decoration: line-through;
  color: var(--text-muted);
}

.kw__term {
  font-weight: 600;
  font-size: 14px;
}

.kw__why {
  font-size: 13px;
  color: var(--text-muted);
}

.kw-add {
  margin-top: 10px;
}

.kw-add__input,
.notes__input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  color: var(--text);
}

.kw-add__input:focus,
.notes__input:focus {
  outline: none;
  border-color: var(--text);
}

.panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

/* ---------- Notes on Results ---------- */

.notes {
  margin-top: 20px;
}

.notes__label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.notes__label small {
  font-weight: 400;
  color: var(--text-muted);
}

.notes__input {
  resize: vertical;
}

/* ---------- Research History ---------- */

.history__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.history__header .hero__lead {
  margin: 6px 0 0;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.session {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

.session:hover {
  border-color: var(--text);
  box-shadow: var(--shadow);
}

.session__body {
  flex: 1 1 240px;
}

.session__topic {
  display: block;
  font-size: 16px;
}

.session__meta {
  font-size: 13px;
  color: var(--text-muted);
}

.session__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session__stats span {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  font-size: 12px;
}

.session__arrow svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

/* ---------- Index page ---------- */

.index {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 16px;
}

.index h1 {
  margin: 24px 0 6px;
  font-size: 28px;
}

.index p {
  margin: 0 0 28px;
  color: var(--text-muted);
}

.screen-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.screen-list a {
  display: flex;
  gap: 12px;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

.screen-list a:hover {
  border-color: var(--text);
}

.screen-list__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.screen-list strong {
  display: block;
  font-size: 15px;
}

.screen-list small {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .help-card {
    display: none;
  }

  .main {
    padding: 32px 16px;
  }

  .hero__art {
    display: none;
  }
}
