:root {
  color-scheme: light;
  --bg: #f4eee5;
  --surface: #fffaf3;
  --surface-strong: #fffdf8;
  --surface-muted: #efe5d8;
  --text: #201813;
  --text-soft: #4a3d34;
  --muted: #75685c;
  --faint: #9b8d7e;
  --line: #dccfbe;
  --line-strong: #cbb8a3;
  --accent: #c97821;
  --accent-dark: #8a4c12;
  --accent-soft: #f4dfbe;
  --success: #217653;
  --success-soft: #dff3e8;
  --danger: #9b3d31;
  --shadow: 0 18px 48px rgba(78, 54, 31, 0.08);
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

a {
  color: inherit;
  text-decoration: none;
}

strong {
  font-weight: 760;
}

.app-shell {
  min-height: 100dvh;
}

.container {
  width: min(1160px, calc(100% - 56px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 760;
  white-space: nowrap;
}

.brand.button {
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
}

.brand-mark {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  min-width: 0;
  white-space: nowrap;
}

.nav button {
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  transition: color 160ms ease, transform 160ms ease;
}

.nav button:hover,
.nav button.active {
  color: var(--text);
}

.nav button:active,
.button:active,
.text-button:active,
.spark-card:active {
  transform: translateY(1px);
}

.nav .nav-cta {
  min-width: 96px;
  padding: 0 18px;
  border-radius: var(--radius-xs);
  background: var(--text);
  color: #fff8ed;
  font-weight: 720;
}

.nav .nav-cta:hover {
  color: #fff8ed;
  background: #120d0a;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface-strong);
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.button.primary {
  border-color: var(--text);
  background: var(--text);
  color: #fff8ed;
  font-weight: 720;
}

.button.primary:hover {
  border-color: #120d0a;
  background: #120d0a;
}

.button.danger {
  color: var(--danger);
}

.button.icon {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.text-button {
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.text-button:hover {
  color: var(--text);
}

.home-hero,
.content-hero {
  width: min(840px, calc(100% - 56px));
  margin: 0 auto;
  padding: 64px 0 44px;
  text-align: center;
}

.home-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  color: var(--accent);
  font-size: 28px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.home-hero h1,
.content-hero h1 {
  max-width: 760px;
  margin: 0 auto;
  color: #130f0b;
  font-size: 48px;
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 780;
}

.home-hero p,
.content-hero p {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.68;
}

.home-hero .button {
  margin-top: 30px;
}

.home-split,
.content-split {
  width: min(860px, calc(100% - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.86fr);
  gap: 64px;
  margin: 22px auto 72px;
  line-height: 1.78;
}

.home-split p,
.content-split p,
.about-copy p,
.case-card p,
.approach-card p {
  color: var(--text-soft);
}

.belief-list {
  display: grid;
  gap: 11px;
  align-content: start;
}

.belief-list p {
  margin: 0;
  padding: 13px 0 13px 16px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  background: rgba(255, 250, 243, 0.42);
}

.process-strip {
  width: min(860px, calc(100% - 56px));
  display: grid;
  gap: 18px;
  margin: 0 auto 72px;
}

.process-card,
.approach-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.72);
}

.process-card span,
.approach-card span,
.onboarding-process span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff9ef;
  font-size: 13px;
  font-weight: 780;
}

.process-card h3,
.approach-card h2 {
  margin: 3px 0 10px;
  font-size: 21px;
  line-height: 1.25;
}

.process-card p,
.approach-card p {
  margin: 0;
  line-height: 1.7;
}

.home-preview {
  width: min(860px, calc(100% - 56px));
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 22px;
  margin: 0 auto 72px;
}

.library-preview,
.thread-preview-card {
  min-height: 280px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.72);
}

.library-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}

.library-preview h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.22;
}

.chat-bubble {
  max-width: 92%;
  padding: 14px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  line-height: 1.58;
}

.chat-bubble.dark {
  margin-left: auto;
  border-color: var(--text);
  background: var(--text);
  color: #fff8ed;
  font-weight: 650;
}

.chat-bubble.light {
  background: var(--surface-strong);
}

.reasoning-mini {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.reasoning-mini span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.reasoning-mini p {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.library-page {
  padding: 32px 0 58px;
}

.library-header {
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(520px, 1.26fr);
  gap: 30px;
  align-items: end;
  margin: 0 0 26px;
}

.library-header h1,
.page-header h1 {
  margin: 0;
  color: #130f0b;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 780;
}

.library-header p,
.page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.library-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 124px auto;
  gap: 12px;
}

.search-box {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--faint);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder,
.field input::placeholder,
.field textarea::placeholder,
.dialogue-form textarea::placeholder,
.onboarding-textarea::placeholder {
  color: #8b7d70;
}

.library-tools select {
  height: 44px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text-soft);
  padding: 0 12px;
  outline: 0;
}

.capture-button {
  height: 44px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8ed;
}

.capture-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field textarea,
.field select,
.onboarding-textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text);
  outline: 0;
  padding: 12px 13px;
  line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-box:focus-within,
.dialogue-form:focus-within,
.onboarding-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 120, 33, 0.16);
}

.create-panel {
  display: grid;
  grid-template-columns: minmax(170px, 0.82fr) minmax(300px, 1.42fr) minmax(140px, 0.7fr) auto;
  align-items: end;
  gap: 14px;
  padding: 18px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.76);
  box-shadow: var(--shadow);
}

.create-panel .field-wide textarea {
  min-height: 88px;
}

.spark-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.spark-card {
  min-height: 216px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.74);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.spark-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-strong);
  box-shadow: 0 16px 36px rgba(78, 54, 31, 0.08);
}

.card-topline,
.spark-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
  font-size: 12px;
}

.status,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 10px;
  border: 1px solid rgba(201, 120, 33, 0.28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 650;
}

.spark-card.is-complete .status,
.settings-row .status {
  border-color: rgba(33, 118, 83, 0.2);
  background: var(--success-soft);
  color: var(--success);
}

.spark-card.is-new .status {
  border-color: rgba(117, 104, 92, 0.22);
  background: #eee5d8;
  color: var(--muted);
}

.card-main {
  margin: 18px 0 16px;
}

.card-main h3 {
  margin: 0;
  color: #120d0a;
  font-size: 20px;
  line-height: 1.32;
  letter-spacing: 0;
}

.card-main p {
  display: -webkit-box;
  min-height: 48px;
  margin: 11px 0 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.spark-card-footer {
  color: var(--accent-dark);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.card-actions .button.primary {
  min-width: 104px;
}

.empty-card {
  display: grid;
  place-items: center;
  min-height: 216px;
  border-style: dashed;
  text-align: center;
  color: var(--muted);
}

.empty-star {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 34px;
}

.empty-card p {
  margin: 0;
  line-height: 1.6;
}

.page {
  padding: 36px 0 62px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
}

.settings-panel {
  width: min(760px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.76);
  box-shadow: var(--shadow);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.thread-page {
  min-height: 100dvh;
  background: var(--bg);
}

.thread-topline {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
}

.thread-title-row,
.thread-settings {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.thread-title-row h1 {
  max-width: 560px;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-settings {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 14px;
}

.dot-separator {
  color: var(--faint);
}

.thinking-workspace {
  height: calc(100dvh - 52px);
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(390px, 0.88fr);
}

.conversation-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 24px 24px 18px 36px;
  border-right: 1px solid var(--line);
}

.dialogue {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.thread-dialogue {
  min-height: 0;
  padding: 0 4px 22px 0;
}

.message {
  width: fit-content;
  max-width: min(620px, 84%);
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  line-height: 1.58;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  margin-left: auto;
  border-color: var(--text);
  background: var(--text);
  color: #fff8ed;
  font-weight: 650;
}

.message.ai {
  align-self: flex-start;
}

.original-message {
  font-weight: 720;
}

.thread-input-shell {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.thread-input-shell p {
  margin: 9px 0 0;
  color: var(--faint);
  text-align: center;
  font-size: 12px;
}

.dialogue-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 12px 12px 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.dialogue-form textarea {
  min-height: 60px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
  resize: none;
  line-height: 1.55;
}

.thread-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.thread-input-actions .button {
  min-height: 34px;
}

.reasoning-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  padding: 26px 24px 22px;
  background: rgba(255, 253, 248, 0.46);
}

.reasoning-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.reasoning-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.reasoning-cards {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 13px;
  padding-right: 2px;
}

.reasoning-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.reasoning-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.reasoning-card span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f7ead9;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 780;
}

.reasoning-card em {
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
}

.reasoning-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.58;
}

.reasoning-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reasoning-footer {
  margin-top: 14px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.insight-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.insight-item.emphasis,
.insight-item.final {
  grid-column: 1 / -1;
  border-color: rgba(201, 120, 33, 0.32);
  background: #fff6e8;
}

.insight-item h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 14px;
}

.insight-item p,
.insight-item ul {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.insight-item ul {
  padding-left: 18px;
}

.content-page {
  padding-bottom: 78px;
}

.content-split {
  margin-top: 8px;
}

.plain-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.9;
}

.content-stack,
.case-list,
.about-copy {
  width: min(860px, calc(100% - 56px));
  margin: 0 auto;
}

.content-stack {
  display: grid;
  gap: 18px;
}

.content-stack > .section-kicker {
  margin-top: 10px;
}

.case-list {
  display: grid;
  gap: 28px;
}

.case-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.72);
}

.case-card div {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.case-card div span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #faead5;
  color: var(--accent-dark);
  font-size: 12px;
}

.case-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.32;
}

.case-card p {
  margin: 0 0 14px;
  line-height: 1.8;
}

.case-card .result {
  margin-bottom: 0;
  color: var(--accent-dark);
}

.case-cta {
  width: min(860px, calc(100% - 56px));
  margin: 54px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.case-cta p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.about-copy {
  line-height: 1.85;
}

.about-copy > p {
  margin: 0 0 20px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 54px;
  margin: 44px 0;
}

.about-grid h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.about-grid p {
  margin: 0;
  line-height: 1.72;
}

.empty {
  padding: 58px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 243, 0.68);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--text);
}

.onboarding-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg);
}

.onboarding-card {
  width: min(760px, 100%);
  min-height: min(520px, calc(100dvh - 64px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 36px 40px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.onboarding-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
}

.progress {
  width: 190px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4d9cb;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.onboarding-body {
  display: grid;
  align-content: center;
  padding: 36px 0;
}

.onboarding-center {
  text-align: center;
}

.onboarding-body h2 {
  margin: 0 0 18px;
  color: #130f0b;
  font-size: 34px;
  line-height: 1.2;
}

.onboarding-body p {
  max-width: 620px;
  margin: 0 0 14px;
  color: var(--text-soft);
  line-height: 1.8;
}

.onboarding-center p {
  margin-left: auto;
  margin-right: auto;
  font-size: 18px;
}

.onboarding-process {
  display: grid;
  gap: 24px;
  margin-top: 18px;
}

.onboarding-process div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 16px;
  align-items: start;
}

.onboarding-process strong {
  align-self: center;
  color: var(--text);
  font-size: 17px;
}

.onboarding-process p {
  grid-column: 2;
  margin: 6px 0 0;
}

.onboarding-textarea {
  min-height: 132px;
  margin: 10px 0 16px;
  resize: vertical;
}

.onboarding-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hidden {
  display: none;
}

@media (max-width: 1040px) {
  .topbar {
    padding: 0 18px;
    gap: 18px;
  }

  .nav {
    gap: 14px;
  }

  .library-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .library-tools {
    grid-template-columns: minmax(220px, 1fr) 124px auto;
  }

  .spark-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .create-panel {
    grid-template-columns: 1fr 1fr;
  }

  .thinking-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  }

  .thread-settings span {
    display: none;
  }
}

@media (max-width: 780px) {
  .container,
  .home-hero,
  .content-hero,
  .home-split,
  .content-split,
  .process-strip,
  .home-preview,
  .content-stack,
  .case-list,
  .about-copy,
  .case-cta {
    width: min(100% - 32px, 680px);
  }

  .topbar {
    height: auto;
    min-height: 54px;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .home-hero,
  .content-hero {
    padding: 46px 0 34px;
  }

  .home-hero h1,
  .content-hero h1 {
    font-size: 36px;
  }

  .home-hero p,
  .content-hero p {
    font-size: 16px;
  }

  .home-split,
  .content-split,
  .home-preview,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .process-card,
  .approach-card {
    padding: 24px;
  }

  .library-page {
    padding-top: 24px;
  }

  .library-header h1,
  .page-header h1 {
    font-size: 34px;
  }

  .library-tools,
  .create-panel {
    grid-template-columns: 1fr;
  }

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

  .thread-topline {
    height: auto;
    min-height: 58px;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .thread-title-row {
    width: 100%;
  }

  .thread-title-row h1 {
    max-width: 100%;
  }

  .thinking-workspace {
    height: auto;
    min-height: calc(100dvh - 58px);
    grid-template-columns: 1fr;
  }

  .conversation-panel {
    min-height: 62dvh;
    padding: 18px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reasoning-panel {
    min-height: 520px;
    padding: 20px 16px;
  }

  .thread-input-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .thread-input-actions .button {
    flex: 1 1 auto;
  }

  .message {
    max-width: 92%;
  }

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

  .page-header,
  .settings-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .onboarding-screen {
    padding: 16px;
  }

  .onboarding-card {
    min-height: calc(100dvh - 32px);
    padding: 28px 24px;
  }

  .onboarding-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .progress {
    width: 100%;
  }

  .onboarding-body h2 {
    font-size: 28px;
  }
}

@media (max-width: 520px) {
  .nav .nav-cta {
    min-width: 88px;
    padding: 0 14px;
  }

  .home-hero h1,
  .content-hero h1 {
    font-size: 31px;
  }

  .button {
    padding: 0 14px;
  }

  .spark-card,
  .case-card,
  .library-preview,
  .thread-preview-card {
    padding: 20px;
  }

  .process-card,
  .approach-card,
  .onboarding-process div {
    grid-template-columns: 1fr;
  }

  .process-card span,
  .approach-card span,
  .onboarding-process span {
    margin-bottom: 8px;
  }

  .onboarding-process p {
    grid-column: auto;
  }
}
