:root {
  color-scheme: light;
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #334155;
  --line: #b5cef9;
  --accent: #066aab;
  --accent-dark: #5e7397;
  --highlight: #b5cef9;
  --soft: #f0f5fa;
  --soft-warm: #f0f5fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.65;
}
.shell { width: min(1664px, calc(100% - 64px)); margin: 0 auto; padding: 28px 0 18px; }
.hero { display: flex; align-items: center; gap: 18px; max-width: 1280px; margin-bottom: 20px; }
.hero-avatar {
  width: 104px;
  height: 104px;
  flex: 0 0 auto;
  border: 4px solid var(--card);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(67, 88, 131, .18);
}
h1 { margin: 0; color: var(--accent-dark); font-size: 2.25rem; font-weight: 600; letter-spacing: 0; line-height: 1.4; }
.intro { max-width: 900px; margin: 14px 0 0; color: var(--muted); font-size: 1em; line-height: 1.65; }
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 8px;
  width: min(560px, 100%);
  margin: 0 auto 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .82);
}
.mode-tabs button {
  min-height: 44px;
  border: 1px solid #b8c8e9;
  border-radius: 4px;
  background: #f8fbff;
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 16px;
}
.mode-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 5px 14px rgba(67, 88, 131, .16);
}
.experience-panel[hidden] {
  display: none;
}
.chat-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 18px 54px rgba(67, 88, 131, .13);
}
.messages { min-height: 280px; max-height: 480px; overflow-y: auto; padding: 20px; }
.message {
  width: fit-content;
  max-width: min(720px, 92%);
  margin: 0 0 14px;
  padding: 13px 15px;
  border-radius: 19px;
  line-height: 1.55;
}
.message p { margin: 0 0 8px; }
.message p:last-child { margin-bottom: 0; }
.message.user { margin-left: auto; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.message.assistant { background: var(--soft); color: var(--ink); border-bottom-left-radius: 4px; }
.message.data-gov { background: #eaf4f1; border-left: 4px solid #207568; }
.message.avatar-message { position: relative; margin-left: 40px; }
.message-avatar {
  position: absolute;
  left: -46px;
  bottom: 0;
  width: 34px;
  height: 34px;
  border: 2px solid var(--card);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(67, 88, 131, .18);
}
.message.error { background: #fff0ef; color: #8c2b22; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px; }
.suggestions button {
  border: 1px solid #b8c8e9;
  border-radius: 4px;
  background: var(--card);
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  padding: 8px 11px;
}
.suggestions button:hover { border-color: var(--highlight); background: var(--soft-warm); }
.composer {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #f8fbff;
  padding: 14px;
}
textarea {
  flex: 1;
  resize: vertical;
  min-height: 48px;
  border: 1px solid #bdcae6;
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  padding: 12px;
}
textarea:focus { border-color: var(--accent); outline: 3px solid rgba(93, 115, 170, .14); }
.composer button {
  align-self: stretch;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 18px;
}
button:hover { filter: brightness(.96); }
button:disabled { cursor: wait; opacity: .65; }
.fine-print { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: .76rem; }
footer { display: flex; gap: 16px; padding: 16px 4px 0; }
footer a { color: var(--accent-dark); font-size: .86rem; font-weight: 700; text-decoration-color: rgba(145, 177, 230, .72); text-underline-offset: 3px; }
footer a:hover { color: var(--highlight); }
.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; }
.explorer-body {
  min-height: 100vh;
  background: var(--bg);
}
.explorer-shell {
  width: min(1664px, calc(100% - 64px));
  margin: 0 auto;
  padding: 28px 0 18px;
}
.explorer-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.explorer-header h1 {
  font-size: 3rem;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--highlight);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.explorer-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.selector-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(67, 88, 131, .09);
  position: sticky;
  top: 12px;
}
.selector-panel label {
  color: var(--accent-dark);
  font-size: 1em;
  font-weight: 800;
}
.selector-panel select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bdcae6;
  border-radius: 4px;
  background: #f8fbff;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}
.selector-panel select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(93, 115, 170, .14);
}
.selector-panel button {
  min-height: 42px;
  margin-top: 6px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.combination-results {
  min-width: 0;
}
.result-summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 1em;
}
.result-summary p {
  margin: 0;
}
.combination-list {
  display: grid;
  gap: 12px;
}
.combination-card {
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
  padding: 16px;
  box-shadow: 0 10px 28px rgba(67, 88, 131, .09);
}
.combination-card h2 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 1.2em;
  line-height: 1.25;
}
.combination-card h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: .9em;
}
.combination-context,
.outcome {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.58;
}
.outcome {
  color: var(--accent-dark);
  font-weight: 700;
}
.combination-tags {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tag-group span {
  min-width: 78px;
  color: var(--accent-dark);
  font-size: .9em;
  font-weight: 800;
}
.tag {
  border: 1px solid #b8c8e9;
  border-radius: 4px;
  background: var(--soft);
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-size: .9em;
  line-height: 1.2;
  padding: 6px 9px;
}
.tag:hover {
  border-color: var(--highlight);
  background: var(--soft-warm);
}
.static-tag {
  cursor: default;
}
.static-tag:hover {
  border-color: #b8c8e9;
  background: var(--soft);
}
.combination-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.combination-detail ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.48;
}
@media (max-width: 560px) {
  .shell { width: 100%; padding: 22px 10px 12px; }
  .hero { gap: 12px; }
  .hero-avatar { width: 76px; height: 76px; }
  h1 { font-size: 2.4rem; }
  .messages { min-height: 250px; padding: 14px; }
  .suggestions { padding: 0 14px 14px; }
  .mode-tabs { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .explorer-shell { width: 100%; padding: 18px 10px; }
  .explorer-header h1 { font-size: 2.2rem; }
  .explorer-layout { grid-template-columns: 1fr; }
  .selector-panel { position: static; }
  .combination-detail { grid-template-columns: 1fr; }
}
