/* SaveMoneyusingAI — design system */
:root {
  --bg: #f7f5f1;
  --bg-elev: #ffffff;
  --bg-tint: #eef4f0;
  --bg-dark: #12141a;
  --border: #e2ddd4;
  --border-strong: #cfc8bc;
  --text: #12141a;
  --text-dim: #5c616b;
  --text-faint: #8a9099;
  --green: #1f6b4a;
  --green-dark: #155338;
  --green-soft: #e6f2ec;
  --green-mint: #d4eddf;
  --teal: #2a6f7a;
  --teal-soft: #e6f1f3;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --danger: #b91c1c;
  --shadow: 0 1px 2px rgba(18, 20, 26, 0.04), 0 8px 24px rgba(18, 20, 26, 0.06);
  --shadow-lg: 0 4px 12px rgba(18, 20, 26, 0.06), 0 20px 48px rgba(18, 20, 26, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --max: 1120px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-display: Georgia, "Times New Roman", "Palatino Linotype", serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.15rem);
  font-weight: 600;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}

h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; color: var(--text-dim); }
p.lead { font-size: 1.125rem; color: var(--text-dim); max-width: 40rem; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.section {
  padding: 4rem 0;
}

.section-sm { padding: 2.5rem 0; }

.section-tint { background: var(--bg-tint); }
.section-dark {
  background: var(--bg-dark);
  color: #e8e9ec;
}
.section-dark p,
.section-dark .text-dim { color: #a8adb8; }
.section-dark h2,
.section-dark h3 { color: #fff; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 241, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.logo span { color: var(--green); font-weight: 600; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.25rem;
}

.nav a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--text); }

.nav-cta {
  margin-left: 0.5rem;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem 1rem;
    box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav a {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-cta { margin: 0.75rem 0 0; }
  .nav-cta .btn { width: 100%; justify-content: center; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover {
  background: var(--green-dark);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--text-faint);
}

.btn-ghost {
  background: transparent;
  color: var(--green);
  border-color: transparent;
  padding-inline: 0.75rem;
}
.btn-ghost:hover { color: var(--green-dark); background: var(--green-soft); }

.btn-lg {
  padding: 0.9rem 1.4rem;
  font-size: 1rem;
}

.btn-block { width: 100%; }

/* Badges / chips */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--green-soft);
  color: var(--green-dark);
}

.chip-muted {
  background: #eeebe5;
  color: var(--text-dim);
}

.chip-teal {
  background: var(--teal-soft);
  color: var(--teal);
}

/* Cards */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.card:hover { border-color: var(--border-strong); }

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.card-link:hover {
  box-shadow: var(--shadow-lg);
  border-color: #b8d4c6;
  transform: translateY(-2px);
  color: inherit;
}

.card h3 { margin-bottom: 0.4rem; color: var(--text); }
.card p:last-child { margin-bottom: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Hero */
.hero {
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 85% 10%, rgba(31, 107, 74, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(42, 111, 122, 0.08), transparent 50%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}

/* Chat column: never clip the assistant panel */
.hero-grid > .chat-shell {
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-faint);
  font-weight: 500;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.trust-row span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.7;
}

/* Tool panel */
.tool-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.tool-panel h2,
.tool-panel .tool-title {
  font-family: var(--font);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.tool-panel .tool-sub {
  font-size: 0.9rem;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.field .hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 0.25rem;
}

.field input[type="number"],
.field input[type="email"],
.field input[type="text"],
.field input[type="search"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--text);
  min-height: 44px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(31, 107, 74, 0.35);
  border-color: var(--green);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.range-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.range-value {
  font-family: var(--font-mono);
  font-weight: 650;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

.result-box {
  margin-top: 1.25rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--green-soft), var(--bg-tint));
  border: 1px solid #c5dfd0;
}

.result-label {
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-dark);
  margin-bottom: 0.35rem;
}

.result-amount {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.result-amount span {
  font-size: 0.55em;
  color: var(--text-dim);
  font-family: var(--font);
  font-weight: 500;
}

.result-note {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Method steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  counter-reset: step;
}

@media (max-width: 700px) {
  .steps { grid-template-columns: 1fr; }
}

.step {
  position: relative;
  padding: 1.35rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

/* Leak cards */
.leak-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
}

.outcome {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--green-dark);
  margin-top: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Proof bar */
.proof-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: center;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.proof-item strong {
  display: block;
  font-size: 1.15rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.proof-item span {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* FAQ / objections */
.accordion details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.65rem;
}

.accordion summary {
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  color: var(--text);
}

.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  float: right;
  color: var(--text-faint);
  font-weight: 400;
}
.accordion details[open] summary::after { content: "–"; }
.accordion details p {
  margin: 0.75rem 0 0.15rem;
  font-size: 0.95rem;
}

/* Newsletter */
.newsletter-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 560px;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.newsletter-form input[type="email"] {
  flex: 1 1 200px;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font: inherit;
  min-height: 48px;
}

.newsletter-form input:focus {
  outline: 2px solid rgba(31, 107, 74, 0.35);
  border-color: var(--green);
}

.form-note {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 0.75rem;
}

/* Page hero (inner pages) */
.page-hero {
  padding: 2.75rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(31, 107, 74, 0.08), transparent 50%);
}

.page-hero p { max-width: 40rem; }

/* Article / guide */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.article h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article h3 { margin-top: 1.5rem; }

.article ul, .article ol {
  color: var(--text-dim);
  padding-left: 1.25rem;
  margin: 0 0 1.25rem;
}

.article li { margin-bottom: 0.4rem; }

.article .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.callout {
  background: var(--green-soft);
  border-left: 3px solid var(--green);
  padding: 1rem 1.15rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
}

.callout p { margin: 0; color: var(--text); }
.callout strong { color: var(--green-dark); }

.callout-warn {
  background: var(--amber-soft);
  border-left-color: var(--amber);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.checklist li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: #c5c9d1;
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.site-footer .logo { color: #fff; margin-bottom: 0.75rem; }
.site-footer p { color: #8b919c; font-size: 0.9rem; }

.footer-col h4 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
  font-family: var(--font);
  font-weight: 650;
}

.footer-col a {
  display: block;
  color: #a8adb8;
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.25rem 0;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid #2a2e38;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #7d828f;
}

.footer-bottom a { color: #8b919c; text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.section-head {
  max-width: 36rem;
  margin-bottom: 2rem;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head p { margin-bottom: 0; }

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 0;
}

.table-wrap { overflow-x: auto; margin: 1.25rem 0; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

table.data th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 650;
}

table.data td { color: var(--text-dim); }
table.data td:first-child { color: var(--text); font-weight: 500; }

.money {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-weight: 650;
  color: var(--green-dark);
}

/* Tool full page */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding: 2.5rem 0 4rem;
}

@media (max-width: 850px) {
  .tool-layout { grid-template-columns: 1fr; }
}

.assumptions {
  font-size: 0.88rem;
  color: var(--text-faint);
  margin-top: 1rem;
}

.assumptions summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-dim);
}

.breakdown {
  margin-top: 1rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #d5e8dc;
  font-size: 0.92rem;
}

.breakdown-row span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--green-dark);
}

/* ===== Debt chat intake ===== */
.chat-shell {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  min-height: 520px;
  /* Shell grows with the form; only the message log scrolls */
  max-height: none;
  height: auto;
  overflow: visible;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, var(--bg-tint));
}

.chat-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.chat-header h2 {
  font-family: var(--font);
  font-size: 1rem;
  margin: 0;
}

.chat-header p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.chat-log {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: min(300px, 38vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #faf9f6;
  -webkit-overflow-scrolling: touch;
}

.chat-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-end;
  max-width: 100%;
}

.chat-row-user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-bubble {
  max-width: min(92%, 340px);
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  font-size: 0.94rem;
  line-height: 1.45;
}

.chat-bubble-bot {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-bubble-bot strong { color: var(--green-dark); }

.chat-bubble-user {
  background: var(--green);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-typing {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0 1rem 0.35rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.chat-typing[hidden] { display: none !important; }

.chat-typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  margin-right: 3px;
  animation: chat-dot 1.2s infinite ease-in-out;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.chat-input-area {
  flex: 0 0 auto;
  padding: 0.9rem 1rem 1.15rem;
  border-top: 1px solid var(--border);
  background: #fff;
  min-height: 72px;
  overflow: visible;
}

/* Contact / multi-step forms need full height — never clip */
.chat-input-area .chat-form,
.chat-input-area .chat-choices,
.chat-input-area .chat-submit-btn {
  position: relative;
  z-index: 1;
}

.chat-input-area .chat-form {
  display: block;
  width: 100%;
}

.chat-input-area .field input,
.chat-input-area .field textarea {
  font-size: 16px; /* prevents iOS zoom crop quirks */
}

.chat-input-area .field textarea {
  width: 100%;
  min-height: 96px;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--text);
  resize: vertical;
  line-height: 1.45;
}

.chat-input-area .field textarea:focus {
  outline: 2px solid rgba(31, 107, 74, 0.35);
  border-color: var(--green);
}

.chat-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chat-choice {
  appearance: none;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 42px;
  transition: border-color 0.12s, background 0.12s;
}

.chat-choice:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.chat-choice.is-selected {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.chat-choices-multi {
  margin-bottom: 0.75rem;
}

.chat-form .field { margin-bottom: 0.7rem; }
.chat-form .field:last-of-type { margin-bottom: 0.85rem; }

.chat-submit-btn {
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0.15rem;
  flex-shrink: 0;
}

/* Stack choice chips cleanly on narrow chat column */
@media (max-width: 900px) {
  .chat-log {
    max-height: min(260px, 32vh);
  }
}

@media (max-width: 480px) {
  .chat-choice {
    flex: 1 1 calc(50% - 0.45rem);
    text-align: center;
  }
  .chat-log {
    max-height: min(220px, 30vh);
  }
}

.chat-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.chat-done-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-faint);
  text-align: center;
}

.is-shake {
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Consent modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 20, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay[hidden] { display: none !important; }

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-card h2 {
  font-family: var(--font);
  font-size: 1.15rem;
  margin-bottom: 0.65rem;
}

.modal-card p {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.modal-actions .btn { flex: 1 1 auto; min-width: 120px; }

body.modal-open { overflow: hidden; }

.debt-types-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.debt-types-list li {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.honesty-strip {
  background: var(--amber-soft);
  border: 1px solid #f0d78c;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: 0.95rem;
  color: var(--text);
  margin: 1.25rem 0 0;
}

.honesty-strip strong { color: var(--amber); }
