:root {
  --mta-blue: #0039a6;
  --mta-blue-dark: #062a6f;
  --ink: #172033;
  --muted: #647087;
  --line: #d9e2f1;
  --soft: #f3f7fc;
  --white: #ffffff;
  --green: #29a36a;
  --warning: #f2b84b;
  --shadow: 0 18px 50px rgba(10, 31, 68, 0.13);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #eaf2ff, #f7f9fc 34%, #ffffff 100%);
  color: var(--ink);
}

.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px;
}

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

.eyebrow {
  color: var(--mta-blue);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 4px 0 4px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 780px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 14px 16px;
  min-width: 210px;
}
.status-card strong { display: block; }
.status-card span { color: var(--muted); font-size: 13px; }
.status-dot {
  width: 12px;
  height: 12px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(41, 163, 106, 0.14);
}

.notice {
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  border-radius: 16px;
  padding: 12px 16px;
  color: #6d4b0b;
  margin-bottom: 18px;
  font-size: 14px;
}

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

.chat-card,
.side-panel {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.chat-card { overflow: hidden; }
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #eaf0fa;
  border-bottom: 1px solid var(--line);
}
.tab {
  border: 0;
  background: transparent;
  padding: 14px 8px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}
.tab span { font-size: 11px; font-weight: 600; }
.tab.active {
  background: var(--white);
  color: var(--mta-blue);
  box-shadow: inset 0 -3px 0 var(--mta-blue);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.chat-header h2 { margin: 0; font-size: 20px; }
.chat-header p { margin: 3px 0 0; color: var(--muted); }
.ghost {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  cursor: pointer;
}

.chat-log {
  height: min(56vh, 560px);
  min-height: 360px;
  overflow-y: auto;
  padding: 20px;
  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.42;
  white-space: pre-wrap;
  font-size: 15px;
}
.user .bubble {
  color: white;
  background: var(--mta-blue);
  border-bottom-right-radius: 6px;
}
.assistant .bubble {
  background: white;
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.system .bubble {
  max-width: 100%;
  background: #edf4ff;
  border: 1px solid #cfe1ff;
  color: #23416f;
}

.typing {
  color: var(--muted);
  font-style: italic;
}

.chat-form {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: white;
}
.chat-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 16px;
  font-size: 15px;
  outline: none;
}
.chat-form input:focus {
  border-color: var(--mta-blue);
  box-shadow: 0 0 0 4px rgba(0,57,166,0.1);
}
.chat-form button {
  border: 0;
  border-radius: 999px;
  background: var(--mta-blue);
  color: white;
  padding: 0 20px;
  font-weight: 800;
  cursor: pointer;
}

.side-panel {
  padding: 18px;
  align-self: start;
}
.panel-block + .panel-block { margin-top: 20px; }
.panel-block h3 { margin: 0 0 10px; }
.panel-block ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}
.context-summary {
  display: grid;
  gap: 8px;
}
.context-item {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}
.context-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.context-item strong { font-size: 14px; }
.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: 8px 11px;
  cursor: pointer;
  font-size: 13px;
}
.chip:hover { border-color: var(--mta-blue); }

@media (max-width: 920px) {
  .hero { flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .side-panel { order: -1; }
}

@media (max-width: 620px) {
  .page-shell { padding: 16px; }
  .tabs { grid-template-columns: repeat(2, 1fr); }
  .chat-log { height: 56vh; }
  .bubble { max-width: 94%; }
}
