:root {
  --primary: #12355b;
  --primary-deep: #0a2540;
  --accent: #f4b942;
  --surface: #f5f8fc;
  --ink: #122033;
  --muted: #5b6778;
  --line: #d9e2ec;
  --white: #ffffff;
  --focus: #0067c5;
  --shadow: 0 18px 55px rgba(20, 47, 78, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 9% 4%, color-mix(in srgb, var(--accent) 22%, transparent) 0, transparent 24rem),
    linear-gradient(180deg, #fff 0, var(--surface) 32rem);
}

button, textarea { font: inherit; }

a { color: var(--primary); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  color: #fff;
  background: var(--primary-deep);
  transform: translateY(-180%);
}

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

.site-header, main, footer { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }

.site-header {
  min-height: 6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-lockup { display: flex; align-items: center; gap: 0.85rem; }
.brand-lockup img { filter: drop-shadow(0 5px 10px rgba(18, 53, 91, 0.18)); }
.eyebrow, .section-kicker { margin: 0; color: var(--muted); font-weight: 750; font-size: 0.72rem; letter-spacing: 0.11em; text-transform: uppercase; }
.brand-lockup h1 { margin: 0.12rem 0 0; font-size: 1.08rem; line-height: 1.2; }

.contact-link, .secondary-link {
  font-weight: 750;
  text-decoration: none;
}

.contact-link {
  border: 1px solid color-mix(in srgb, var(--primary) 28%, #fff);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.contact-link:hover, .contact-link:focus-visible { background: #fff; box-shadow: 0 8px 22px rgba(18, 53, 91, 0.1); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(17rem, 0.8fr);
  gap: 3rem;
  padding: 4.2rem 0 3rem;
  align-items: end;
}

.pill, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 780;
}

.pill { padding: 0.42rem 0.72rem; color: var(--primary-deep); background: color-mix(in srgb, var(--accent) 26%, #fff); }
.pill span, .status-badge span { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #2f8f63; }
.hero h2 { max-width: 15ch; margin: 1rem 0 1rem; font-size: clamp(2.35rem, 6vw, 4.65rem); line-height: 0.98; letter-spacing: -0.05em; color: var(--primary-deep); }
.hero-copy > p:last-child { max-width: 45rem; margin: 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.7; }

.trust-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(18, 53, 91, 0.12);
  border-radius: 1.4rem;
  padding: 1.45rem;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 40px rgba(18, 53, 91, 0.08);
}

.trust-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 0.32rem; background: var(--accent); }
.trust-title { margin: 0 0 0.7rem; color: var(--primary-deep); font-weight: 800; }
.trust-card ul { margin: 0; padding-left: 1.25rem; color: var(--muted); line-height: 1.6; }
.trust-card li + li { margin-top: 0.45rem; }

.assistant-shell {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(18, 53, 91, 0.14);
  border-radius: 1.6rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.guide-panel {
  padding: 2rem 1.5rem;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.07), transparent 42%),
    var(--primary-deep);
}

.guide-panel .section-kicker { color: color-mix(in srgb, var(--accent) 82%, #fff); }
.guide-panel h2 { margin: 0.4rem 0 1.2rem; font-size: 1.35rem; }
.example-list { display: grid; gap: 0.65rem; }
.example-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.8rem;
  padding: 0.8rem 0.9rem;
  color: #fff;
  text-align: left;
  line-height: 1.35;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
}

.example-button:hover, .example-button:focus-visible { background: rgba(255, 255, 255, 0.16); }
.boundary-note { margin-top: 1.6rem; border-top: 1px solid rgba(255,255,255,0.18); padding-top: 1.35rem; color: rgba(255,255,255,0.77); font-size: 0.84rem; line-height: 1.55; }
.boundary-title { margin: 0 0 0.3rem; color: #fff; font-weight: 780; }
.boundary-note p:last-child { margin: 0; }
.guide-panel .secondary-link { display: inline-block; margin-top: 1.3rem; color: var(--accent); font-size: 0.88rem; }

.conversation-panel { display: flex; min-height: 37rem; flex-direction: column; padding: 2rem; }
.conversation-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding-bottom: 1.35rem; border-bottom: 1px solid var(--line); }
.conversation-heading h2 { margin: 0.35rem 0 0; font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -0.025em; }
.status-badge { flex: 0 0 auto; padding: 0.45rem 0.7rem; color: #286347; background: #edf8f2; }

.conversation { flex: 1; margin: 0; padding: 1.5rem 0; list-style: none; overflow-wrap: anywhere; }
.message { display: flex; gap: 0.8rem; align-items: flex-start; max-width: 46rem; }
.message + .message { margin-top: 1.15rem; }
.user-message { margin-left: auto; flex-direction: row-reverse; }
.avatar { display: grid; place-items: center; flex: 0 0 2.25rem; height: 2.25rem; border-radius: 0.7rem; color: #fff; background: var(--primary); font-size: 0.7rem; font-weight: 850; }
.user-message .avatar { background: #e8eef5; color: var(--primary-deep); }
.message-body { min-width: 0; border-radius: 0.3rem 1rem 1rem 1rem; padding: 0.9rem 1rem; color: #25364b; background: var(--surface); line-height: 1.58; }
.user-message .message-body { border-radius: 1rem 0.3rem 1rem 1rem; color: #fff; background: var(--primary); }
.message-speaker { display: block; margin-bottom: 0.2rem; color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.user-message .message-speaker { color: #fff; }
.message-body p { margin: 0; }
.citations { margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid color-mix(in srgb, var(--primary) 13%, #fff); }
.citations > p { color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.citation-list { display: grid; gap: 0.4rem; margin: 0.45rem 0 0; padding: 0; list-style: none; }
.citation-link { display: flex; gap: 0.5rem; color: var(--primary); font-size: 0.86rem; font-weight: 720; }
.citation-meta { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.escalation { margin-top: 0.75rem; }
.escalation-link { color: var(--primary); font-size: 0.86rem; font-weight: 720; }

.request-status { min-height: 1.4rem; color: var(--muted); font-size: 0.84rem; }
form { border-top: 1px solid var(--line); padding-top: 1rem; }
form > label { display: block; margin-bottom: 0.45rem; font-size: 0.82rem; font-weight: 780; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 0.65rem; align-items: stretch; }
textarea { width: 100%; min-height: 4rem; resize: vertical; border: 1px solid #b7c4d3; border-radius: 0.85rem; padding: 0.8rem 0.9rem; color: var(--ink); background: #fff; line-height: 1.45; }
textarea::placeholder { color: #7a8796; }
#send, .cancel-button { border: 0; border-radius: 0.85rem; padding: 0 1.15rem; font-weight: 800; cursor: pointer; }
#send { display: flex; gap: 0.45rem; align-items: center; justify-content: center; min-width: 6.4rem; color: #fff; background: var(--primary); }
#send svg { width: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#send:hover { filter: brightness(1.08); }
#send:disabled { cursor: wait; opacity: 0.6; }
.cancel-button { color: var(--primary); background: #eaf0f6; }
.form-note { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.77rem; line-height: 1.45; }

.authority { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.2rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 1rem; color: var(--muted); background: rgba(255,255,255,0.68); font-size: 0.86rem; }
.authority p { margin: 0; }
.authority-icon { display: grid; place-items: center; flex: 0 0 1.5rem; height: 1.5rem; border-radius: 50%; color: #fff; background: var(--primary); font-weight: 850; font-family: Georgia, serif; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2.3rem 0 2rem; color: var(--muted); font-size: 0.78rem; }
footer p { margin: 0; }

@media (max-width: 800px) {
  .site-header { min-height: 5rem; }
  .contact-link { display: none; }
  .hero { grid-template-columns: 1fr; gap: 1.4rem; padding-top: 2.8rem; }
  .hero h2 { max-width: 18ch; }
  .assistant-shell { grid-template-columns: 1fr; }
  .guide-panel { padding: 1.5rem; }
  .example-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conversation-panel { min-height: 34rem; padding: 1.4rem; }
}

@media (max-width: 520px) {
  .site-header, main, footer { width: min(100% - 1.1rem, 1180px); }
  .brand-lockup h1 { font-size: 0.95rem; }
  .hero { padding-top: 2rem; }
  .hero h2 { font-size: 2.55rem; }
  .example-list { grid-template-columns: 1fr; }
  .conversation-heading { display: block; }
  .status-badge { margin-top: 0.8rem; }
  .composer { grid-template-columns: 1fr; }
  #send, .cancel-button { min-height: 3rem; }
  footer { display: block; }
  footer p + p { margin-top: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
