:root {
  --mta-blue: #0039a6;
  --mta-blue-dark: #052969;
  --maxx-green: #16733d;
  --ink: #111b2f;
  --muted: #657086;
  --line: #d8e1ef;
  --soft: #f4f7fb;
  --white: #ffffff;
  --green: #29a36a;
  --shadow: 0 22px 70px rgba(15, 38, 79, 0.12);
  --shadow-soft: 0 10px 34px rgba(15, 38, 79, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 57, 166, 0.11), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(22, 115, 61, 0.09), transparent 25rem),
    #f8fafc;
  color: var(--ink);
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.page-shell {
  width: min(1120px, 100%);
  max-width: none;
  margin: 0 auto;
  padding: 32px 28px 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 36px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.hero-copy { max-width: 760px; }

.eyebrow,
.section-kicker {
  color: var(--mta-blue);
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
  font-size: 12px;
}

.brand-mark {
  display: block;
  width: clamp(118px, 13vw, 150px);
  height: clamp(118px, 13vw, 150px);
  margin: 6px 0 8px;
  object-fit: cover;
  object-position: center;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.5;
  max-width: 760px;
}

.hero-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
  padding: 9px 15px;
}

.status-card strong,
.status-card small { display: block; }
.status-card strong { font-size: 13px; }
.status-card small { color: var(--muted); font-size: 12px; }

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(41, 163, 106, 0.13);
}

.demo-details { position: relative; }
.demo-details summary {
  list-style: none;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: var(--mta-blue-dark);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-weight: 750;
  font-size: 13px;
  cursor: pointer;
}
.demo-details summary::-webkit-details-marker { display: none; }
.demo-details[open] summary { border-color: #a9c1ea; }

.details-popover {
  position: absolute;
  z-index: 10;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.details-popover h2 { margin: 0 0 12px; font-size: 18px; }
.details-popover p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.capability-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 13px 16px;
  margin-bottom: 18px;
  border: 1px solid #cee0d5;
  border-radius: 16px;
  background: rgba(239, 249, 243, 0.86);
  color: #345346;
  font-size: 13px;
}
.capability-note strong { color: var(--maxx-green); margin-right: 5px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.chat-card,
.prompt-shelf {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.chat-card {
  overflow: hidden;
  border-radius: 26px;
}

.scenario-controls {
  display: grid;
  grid-template-columns: minmax(150px, .78fr) minmax(180px, 1fr) minmax(250px, 1.35fr);
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  background: linear-gradient(135deg, #eaf1fb, #eff5fb);
  border-bottom: 1px solid var(--line);
}

.control-field,
.preference-toggle {
  min-height: 76px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 11px 14px;
}

.control-field { display: grid; gap: 7px; }
.control-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.control-field select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  outline: none;
}
.control-field small { color: var(--muted); font-size: 11px; line-height: 1.25; }

.preference-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
}
.preference-toggle input {
  width: 19px;
  height: 19px;
  accent-color: var(--mta-blue);
  flex: 0 0 auto;
}
.preference-toggle strong { display: block; font-size: 14px; }
.preference-toggle small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.3; }
.preference-toggle:has(input:disabled) { opacity: .55; cursor: not-allowed; }

.conversation-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.ghost {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--mta-blue-dark);
}
.ghost:hover,
.ghost:focus-visible { border-color: var(--mta-blue); }

.chat-log {
  height: min(54vh, 540px);
  min-height: 360px;
  overflow-y: auto;
  padding: 22px;
  background: linear-gradient(180deg, #fbfdff, #f5f8fc);
}

.message { display: flex; margin-bottom: 14px; }
.message.user { justify-content: flex-end; }
.bubble {
  max-width: min(720px, 86%);
  padding: 13px 15px;
  border-radius: 18px;
  line-height: 1.45;
  white-space: pre-wrap;
  font-size: 15px;
}
.user .bubble {
  color: var(--white);
  background: linear-gradient(135deg, var(--mta-blue), #0754c9);
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 57, 166, .16);
}
.assistant .bubble {
  background: var(--white);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  box-shadow: 0 7px 18px rgba(15, 38, 79, .06);
}
.assistant .bubble.formatted-answer { white-space: normal; overflow-wrap: anywhere; }
.formatted-answer p { margin: 0 0 10px; }
.formatted-answer p:last-child { margin-bottom: 0; }
.formatted-answer strong { font-weight: 800; }
.formatted-answer a { color: var(--mta-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.formatted-answer ul,
.formatted-answer ol { margin: 4px 0 10px; padding-left: 22px; }
.formatted-answer li + li { margin-top: 5px; }
.answer-table-wrap { max-width: 100%; margin: 6px 0 10px; overflow-x: auto; border: 1px solid var(--line); }
.formatted-answer table { width: 100%; min-width: 360px; border-collapse: collapse; font-size: 14px; }
.formatted-answer th,
.formatted-answer td { padding: 9px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.formatted-answer th { background: var(--soft); color: var(--ink); font-weight: 800; }
.formatted-answer th:last-child,
.formatted-answer td:last-child { border-right: 0; }
.formatted-answer tbody tr:last-child td { border-bottom: 0; }
.system .bubble {
  max-width: 100%;
  padding: 9px 12px;
  background: #edf4ff;
  border: 1px solid #cfe1ff;
  color: #36557e;
  font-size: 13px;
}
.typing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--muted);
}

.thinking-label { font-weight: 650; }

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 16px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--mta-blue);
  animation: thinking-bounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: .16s; }
.thinking-dots span:nth-child(3) { animation-delay: .32s; }

@keyframes thinking-bounce {
  0%, 60%, 100% { opacity: .32; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.chat-form {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 17px;
  font-size: 15px;
  outline: none;
}
.chat-form input:focus {
  border-color: var(--mta-blue);
  box-shadow: 0 0 0 4px rgba(0, 57, 166, .1);
}
.chat-form button {
  min-width: 82px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mta-blue), #0754c9);
  color: var(--white);
  padding: 0 20px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(0, 57, 166, .18);
}
.chat-form button:hover { filter: brightness(1.06); }

.prompt-shelf {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 17px 20px;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}
.prompt-shelf h2 { margin: 2px 0 0; font-size: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--mta-blue-dark);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
}
.chip:hover,
.chip:focus-visible {
  border-color: var(--mta-blue);
  background: #f2f6fd;
}

.context-summary { display: grid; gap: 7px; }
.context-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.context-item span { color: var(--muted); font-size: 12px; }
.context-item strong { font-size: 12px; text-align: right; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: 3px solid rgba(0, 57, 166, .25); outline-offset: 2px; }

@media (max-width: 840px) {
  .hero { flex-direction: column; gap: 18px; }
  .hero-actions { width: 100%; }
  .scenario-controls { grid-template-columns: 1fr 1fr; }
  .preference-toggle { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .page-shell { padding: 20px 14px 32px; }
  .brand-mark { width: 108px; height: 108px; }
  .lede { font-size: 16px; }
  .hero-actions { align-items: stretch; }
  .status-card { flex: 1; border-radius: 16px; }
  .demo-details summary { height: 100%; border-radius: 16px; }
  .details-popover { position: fixed; top: 82px; right: 14px; left: 14px; width: auto; }
  .capability-note { display: grid; }
  .scenario-controls { grid-template-columns: 1fr; }
  .preference-toggle { grid-column: auto; }
  .conversation-bar { min-height: 54px; }
  .chat-log { height: 52vh; min-height: 330px; padding: 16px; }
  .bubble { max-width: 94%; }
  .chat-form { padding: 11px; }
  .chat-form button { min-width: 68px; padding: 0 15px; }
  .prompt-shelf { grid-template-columns: 1fr; gap: 12px; padding: 17px; }
  .chips { flex-direction: column; align-items: stretch; }
  .chip { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .thinking-dots span { animation: none; opacity: .7; }
}
/* Optional review controls stay secondary to the answer and remain usable at zoom. */
.message.assistant:has(.maxx-feedback), .message.assistant:has(.feedback-unavailable) { flex-direction: column; align-items: flex-start; }
.maxx-feedback { max-width: 100%; font-size: .85rem; color: #43516a; margin-top: .45rem; }
.feedback-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.maxx-feedback button, .maxx-feedback summary, .conversation-feedback > details > summary { min-height: 44px; padding: .6rem .8rem; cursor: pointer; }
.maxx-feedback button { border: 1px solid #8796ae; border-radius: .6rem; background: #fff; color: #193451; }
.maxx-feedback button:focus-visible, .maxx-feedback summary:focus-visible, .conversation-feedback summary:focus-visible { outline: 3px solid #007bc4; outline-offset: 3px; }
.maxx-feedback button:disabled { cursor: default; opacity: .7; }
.maxx-feedback label { display: block; margin: .6rem 0; }
.maxx-feedback input, .maxx-feedback textarea { display: block; box-sizing: border-box; width: 100%; max-width: 28rem; min-height: 44px; padding: .5rem; font: inherit; }
.maxx-feedback p { max-width: 32rem; }
.maxx-feedback [role="status"] { display: block; margin: .35rem 0; }
.feedback-unavailable { color: #526078; margin-top: .4rem; max-width: 32rem; }
.conversation-feedback { padding: 0 1rem; }
.feedback-privacy { margin: .3rem 1rem; color: #526078; font-size: .8rem; }
