/* Design polish for the two Nov 10 guide pages (proposal only).
   Tokens come from the v4 homepage system in /styles.css. */

.guide {
  max-width: 70ch;
  margin: 0 auto;
  padding: 2.25rem max(1.25rem, env(safe-area-inset-right, 0px)) 4rem max(1.25rem, env(safe-area-inset-left, 0px));
}

.guide h1 {
  font-size: clamp(1.65rem, 3.4vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 1rem;
  color: var(--text-bright);
}

.guide h2 {
  margin: 2.35rem 0 0.75rem;
  font-size: clamp(1.15rem, 2.2vw, 1.3rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-bright);
}

.guide h3 {
  margin: 1.6rem 0 0.45rem;
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--text-bright);
}

.guide p,
.guide li {
  color: var(--text-muted);
}

.guide .lede {
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 65ch;
  margin-bottom: 1.35rem;
}

.guide .crumb {
  font-size: 0.85rem;
  color: var(--text-muted); /* --text-dim is 4.36:1 on --bg-deep; muted clears AA */
  margin-bottom: 0.85rem;
}

.guide .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  padding-bottom: 0.15rem;
}

.guide th,
.guide td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
}

/* —— FAQ accordion —— */
.guide-faq {
  margin-top: 2.5rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--border);
}

.guide-faq > h2 {
  margin-top: 1.6rem;
}

.guide-faq .faq-item {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.faq-item__q {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
}

.faq-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 0.95rem 0.2rem;
  border: 0;
  background: transparent;
  color: var(--text-bright);
  font: 600 1rem/1.35 var(--font-sans);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
}

.faq-trigger:hover,
.faq-trigger[aria-expanded="true"] {
  color: var(--phosphor-bright);
}

.faq-trigger:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.faq-trigger::after {
  content: "";
  flex: 0 0 0.55rem;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: -0.15rem;
  border-right: 2px solid var(--phosphor);
  border-bottom: 2px solid var(--phosphor);
  transform: rotate(45deg);
  transform-origin: 60% 60%;
  transition: transform var(--ease);
}

.faq-trigger[aria-expanded="true"]::after {
  margin-top: 0.2rem;
  transform: rotate(225deg);
}

.faq-panel {
  padding: 0 1.85rem 1.05rem 0.2rem;
}

.faq-panel p {
  margin: 0;
  color: var(--text-muted);
}

/* —— Tavvy CTA —— */
.guide-cta {
  margin-top: 2.75rem;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--phosphor-dim);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: 0 0 24px var(--phosphor-glow);
}

.guide-cta__eyebrow {
  font: 500 0.75rem var(--font-mono);
  color: var(--phosphor);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}

.guide-cta p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

/* —— Sample chat (home-service guide) —— */
.sample-chat {
  margin: 1.35rem 0 1.6rem;
  padding: 1rem 1rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at center, #0d1a12 0%, #050906 85%);
  box-shadow: inset 0 0 18px var(--phosphor-glow);
}

.sample-chat__msg {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  max-width: 92%;
  line-height: 1.45;
  font-size: 0.92rem;
}

.sample-chat__msg--user {
  margin-left: auto;
  color: var(--text-bright);
  background: #16241a;
  border: 1px solid var(--border-strong);
  border-bottom-right-radius: 2px;
}

.sample-chat__msg--bot {
  color: var(--phosphor-bright);
  background: rgba(125, 255, 154, 0.07);
  border: 1px solid var(--phosphor-dim);
  border-bottom-left-radius: 2px;
}

.sample-chat__who {
  display: block;
  margin-bottom: 0.2rem;
  font: 600 0.68rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--phosphor);
}

.sample-chat__msg--user .sample-chat__who {
  color: var(--text-muted);
}

.sample-chat__caption {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .guide th,
  .guide td {
    padding: 0.45rem 0.55rem;
    font-size: 0.85rem;
  }

  .guide-cta .btn {
    width: 100%;
  }

  .sample-chat__msg {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-trigger::after,
  .guide-cta,
  .sample-chat {
    transition: none;
  }
}
