/* Warm paper, green ink, and an unhurried conversational rhythm. */
:root {
  --accent: #285a43;
  --accent-soft: #e7eddf;
  --bg: #faf5ec;
  --surface: #fffaf3;
  --surface-2: #f0eadd;
  --ink: #243f32;
  --ink-2: #727869;
  --radius: 18px;
  --font-display: Georgia, 'Times New Roman', serif;
  --max: 768px;
  --tab-height: calc(72px + var(--safe-bottom));
  color-scheme: light;
}
/* A viewport-sized shell keeps the composer above an iPad keyboard. */
body {
  position: fixed;
  top: var(--viewport-top, 0px);
  width: 100%;
  height: var(--viewport-height, 100dvh);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.app-header {
  flex-shrink: 0;
  padding: calc(14px + var(--safe-top)) 24px 14px;
  background: var(--bg);
}
.app-header .brand {
  font-size: 1.25rem;
  font-weight: 400;
}
.app-header .badge {
  margin-left: auto;
  font-size: 11px;
}
.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 24px calc(28px + var(--tab-height));
  scrollbar-width: thin;
}
body[data-view='Solve'] .app-main {
  padding-bottom: calc(126px + var(--tab-height));
}
.conversation {
  min-height: 100%;
}
.thread-tools {
  display: flex;
  justify-content: flex-end;
}
.thread-tools .btn {
  font-size: 12px;
  font-weight: 400;
}
.date-separator {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 0 28px;
  color: var(--ink-2);
  font-size: 12px;
}
.date-separator::before,
.date-separator::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--line);
}
/* Questions sit to the right; answers read like a personal note. */
.answer {
  margin-bottom: 36px;
}
.question {
  width: fit-content;
  max-width: 85%;
  margin: 0 0 28px auto;
  padding: 13px 18px;
  border-radius: 18px 18px 4px 18px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
.answer-body {
  max-width: 640px;
}
.result {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.receipt {
  margin: 22px 0 12px;
  padding: 18px 0;
  border-top: 1px dashed #c6ccbd;
  border-bottom: 1px dashed #c6ccbd;
  font: 17px/1.7 var(--font-display);
}
.receipt h3 {
  font: 11px/1.5 var(--font);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-2);
}
.receipt ol {
  padding-left: 24px;
  margin: 12px 0 0;
}
.receipt li {
  padding-left: 5px;
  overflow-wrap: anywhere;
}
.actions {
  gap: 2px;
  margin: 8px 0 14px;
}
.actions .icon-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
}
.actions [aria-pressed='true'] {
  color: var(--accent);
  background: var(--accent-soft);
}
.answer-tag {
  margin-left: 10px;
  color: var(--ink-2);
  font-size: 11px;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Quiet suggestions and a bottom-docked question composer. */
.starter {
  padding-top: clamp(28px, 12vh, 110px);
}
.starter > p {
  margin-bottom: 24px;
  font: 22px/1.5 var(--font-display);
}
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.chip {
  min-height: 44px;
  padding: 10px 14px;
  white-space: normal;
  text-align: left;
  background: transparent;
}
.composer {
  position: absolute;
  bottom: var(--tab-height);
  left: 0;
  right: 0;
  width: min(100%, 768px);
  margin: auto;
  padding: 12px 24px 10px;
  background: var(--bg);
}
.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid #d7dccd;
  border-radius: 32px;
  background: var(--surface);
}
.input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  padding-left: 16px;
}
.input-row .icon-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}
.composer > p {
  margin: 7px 0 0;
  text-align: center;
  color: var(--ink-2);
  font-size: 11px;
}
.tabbar {
  position: absolute;
  height: var(--tab-height);
  background: var(--bg);
  padding-top: 8px;
}
.tabbar button {
  flex-direction: column;
  gap: 3px;
  max-width: 180px;
  font-size: 11px;
}
/* Saved answers and settings retain compact, familiar controls. */
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.history-item span,
.history-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.history-item strong {
  max-width: 50%;
  font-family: var(--font-display);
  font-weight: 400;
}
.rate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 10px;
}
#rate-form {
  max-width: 640px;
}
.eyebrow {
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 1.5px;
}
.offline-pill {
  top: calc(65px + var(--safe-top));
}
@media (max-width: 520px) {
  .app-header {
    padding-right: 16px;
    padding-left: 16px;
  }
  .app-main {
    padding-right: 20px;
    padding-left: 20px;
  }
  .composer {
    padding-right: calc(12px + var(--safe-right));
    padding-left: calc(12px + var(--safe-left));
  }
  .rate-grid {
    grid-template-columns: 1fr 1fr;
  }
  .rate-grid label:last-child {
    grid-column: 1 / -1;
  }
  .history-item {
    flex-direction: column;
    gap: 6px;
  }
  .history-item strong {
    max-width: 100%;
  }
}
