:root {
  color-scheme: light;
  --ink: #17251f;
  --muted: #617069;
  --paper: #f3f0e8;
  --white: #fffef9;
  --sage: #dce5d8;
  --forest: #183f31;
  --forest-soft: #255a46;
  --gold: #d8a94c;
  --alert: #a83f32;
  --line: rgba(23, 37, 31, 0.14);
  --shadow: 0 30px 80px rgba(28, 49, 39, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 1rem;
  left: 1rem;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.brand {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  text-decoration: none;
  letter-spacing: 0.14em;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-style: italic;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.88rem;
}

.brand small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.privacy-button {
  border: 0;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.privacy-button span {
  margin-right: 0.35rem;
  color: var(--gold);
}

main {
  overflow: hidden;
}

.emergency-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.2rem 0.85rem 1.5rem;
  border: 1px solid rgba(168, 63, 50, 0.22);
  border-radius: 12px;
  background: #f7e8e2;
  color: #6c261e;
}

.emergency-bar > div {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}

.emergency-bar > div span {
  font-size: 0.84rem;
}

.emergency-bar nav {
  display: flex;
  gap: 0.45rem;
}

.emergency-bar nav a {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 0.74rem;
}

.emergency-bar nav strong {
  font-size: 0.92rem;
}

.hero {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 7rem 2rem 5.5rem;
  text-align: center;
}

.hero::before,
.hero::after {
  position: absolute;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(24, 63, 49, 0.11);
  border-radius: 50%;
  content: "";
}

.hero::before {
  top: 4rem;
  left: -10rem;
}

.hero::after {
  right: -12rem;
  bottom: -2rem;
  width: 320px;
  height: 320px;
}

.eyebrow,
.kicker {
  color: var(--forest-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-block;
  width: 34px;
  height: 1px;
  margin: 0 0.7rem 0.2rem 0;
  background: var(--gold);
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 0.98;
}

h1 {
  margin-top: 1.5rem;
  font-size: clamp(3.4rem, 7.2vw, 6.6rem);
  letter-spacing: -0.055em;
}

h1 em {
  color: var(--forest-soft);
  font-weight: 400;
}

.hero > p {
  max-width: 670px;
  margin: 2rem auto 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.trust-points {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.2rem;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 700;
}

.trust-points span::before {
  margin-right: 0.55rem;
  color: var(--gold);
  content: "◆";
  font-size: 0.55rem;
}

.assistant-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(430px, 1.18fr);
  max-width: 1180px;
  min-height: 700px;
  margin: 0 auto 8rem;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.guide-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3.2rem;
  background: var(--forest);
  color: var(--white);
}

.section-number {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.66rem;
}

.guide-panel .section-number {
  color: #9fb6a9;
}

.guide-panel .kicker {
  margin: 1.5rem 0 0.7rem;
  color: #a8bdae;
}

.guide-panel h2,
.resources h2,
dialog h2 {
  font-size: clamp(2.5rem, 4vw, 4.2rem);
  letter-spacing: -0.04em;
}

.guide-copy {
  max-width: 350px;
  color: #bed0c6;
  font-size: 0.9rem;
}

.quick-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 2rem;
}

.quick-actions button {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.quick-actions button:hover,
.quick-actions button:focus-visible {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.09);
  transform: translateX(4px);
}

.action-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #d3b56d;
}

.action-icon.urgent {
  border-color: rgba(255, 187, 174, 0.42);
  color: #ffb3a5;
}

.quick-actions strong,
.quick-actions small {
  display: block;
}

.quick-actions strong {
  font-size: 0.83rem;
}

.quick-actions small {
  margin-top: 0.08rem;
  color: #9fb6a9;
  font-size: 0.7rem;
}

.chat-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 2rem 2.3rem 1.5rem;
  background: var(--white);
}

.chat-heading {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.assistant-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage);
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-style: italic;
}

.chat-heading strong,
.chat-heading span {
  display: block;
}

.chat-heading span {
  color: var(--muted);
  font-size: 0.72rem;
}

.chat-heading i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: #4b966e;
}

.messages {
  display: flex;
  min-height: 340px;
  max-height: 470px;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding: 1.7rem 0.3rem;
  scrollbar-color: #bdc9c1 transparent;
}

.message {
  width: fit-content;
  max-width: 88%;
  padding: 1.1rem 1.25rem;
  border-radius: 4px 16px 16px 16px;
  background: #eef1ea;
  color: #34463d;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.message p {
  margin: 0 0 0.7rem;
}

.message p:last-child {
  margin-bottom: 0;
}

.message-label {
  margin-bottom: 0.4rem;
  color: var(--forest-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-message {
  align-self: flex-end;
  border-radius: 16px 4px 16px 16px;
  background: var(--forest);
  color: white;
}

.user-message .message-label {
  color: #bbcec3;
}

.typing-message {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.typing-message span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest-soft);
  animation: pulse 1s infinite alternate;
}

.typing-message span:nth-child(2) {
  animation-delay: 180ms;
}

.typing-message span:nth-child(3) {
  animation-delay: 360ms;
}

@keyframes pulse {
  to {
    opacity: 0.25;
    transform: translateY(-3px);
  }
}

.composer {
  padding: 1rem;
  border: 1px solid #cbd5cd;
  border-radius: 12px;
  background: white;
  transition: 160ms ease;
}

.composer:focus-within {
  border-color: var(--forest-soft);
  box-shadow: 0 0 0 3px rgba(37, 90, 70, 0.09);
}

.composer label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.composer textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.88rem;
}

.composer textarea::placeholder {
  color: #8c9992;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
}

.composer-footer button,
.dialog-confirm {
  padding: 0.72rem 1.1rem;
  border: 0;
  border-radius: 7px;
  background: var(--forest);
  color: white;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.composer-footer button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.legal-note {
  margin: 0.8rem 0 0;
  color: #78857e;
  font-size: 0.67rem;
  text-align: center;
}

.resources {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem 8rem;
}

.resources .kicker {
  margin: 1.5rem 0 0.7rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.resource-grid a {
  min-height: 170px;
  padding: 1.5rem;
  background: var(--paper);
  text-decoration: none;
  transition: 160ms ease;
}

.resource-grid a:hover,
.resource-grid a:focus-visible {
  z-index: 1;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(28, 49, 39, 0.08);
  transform: translateY(-3px);
}

.resource-grid span,
.resource-grid strong,
.resource-grid small {
  display: block;
}

.resource-grid span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-grid strong {
  margin: 1rem 0 0.45rem;
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 1.65rem;
  font-weight: 400;
}

.resource-grid small {
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem max(2rem, calc((100vw - 1180px) / 2));
  background: #dfddd4;
  color: var(--muted);
  font-size: 0.76rem;
}

footer button {
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
}

dialog {
  width: min(560px, calc(100vw - 2rem));
  padding: 2.4rem;
  border: 0;
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(12, 26, 20, 0.72);
  backdrop-filter: blur(4px);
}

dialog p:not(.kicker) {
  color: var(--muted);
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.6rem;
}

.dialog-confirm {
  margin-top: 0.8rem;
}

@media (max-width: 900px) {
  .emergency-bar {
    margin-inline: 1rem;
  }

  .emergency-bar > div span,
  .emergency-bar nav span {
    display: none;
  }

  .assistant-shell {
    grid-template-columns: 1fr;
    margin-inline: 1rem;
  }

  .guide-panel {
    padding: 2.3rem;
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .resources {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 1.1rem;
  }

  .privacy-button {
    font-size: 0;
  }

  .privacy-button span {
    font-size: 1.1rem;
  }

  .emergency-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .emergency-bar nav {
    width: 100%;
  }

  .emergency-bar nav a {
    flex: 1;
    justify-content: center;
  }

  .hero {
    padding: 5rem 1.2rem 4rem;
  }

  h1 {
    font-size: clamp(3.1rem, 15vw, 4.5rem);
  }

  .hero > p {
    font-size: 0.95rem;
  }

  .trust-points {
    align-items: center;
    flex-direction: column;
    gap: 0.6rem;
  }

  .assistant-shell {
    border-radius: 12px;
  }

  .guide-panel,
  .chat-panel {
    padding: 1.4rem;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .messages {
    max-height: 520px;
  }

  .message {
    max-width: 96%;
  }

  .resources {
    padding-inline: 1rem;
  }

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

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
