:root {
  --ink: #17342b;
  --muted: #657a72;
  --green: #174f3c;
  --green-2: #225e4c;
  --green-soft: #edf4ef;
  --gold: #a57a34;
  --gold-soft: #f7f0e3;
  --line: #d9e2dd;
  --paper: #fcfcf9;
  --canvas: #eef2ef;
  --white: #ffffff;
  --shadow: 0 18px 54px rgba(23, 52, 43, 0.09);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Tahoma, Arial, sans-serif;
}
button,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
}
.preview-ribbon {
  position: fixed;
  z-index: 99;
  left: 16px;
  bottom: 16px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(23, 79, 60, 0.94);
  color: #fff;
  font:
    700 11px/1 Arial,
    sans-serif;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.ask-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 10px 28px;
  background: rgba(252, 252, 249, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
}
.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.brand-copy {
  display: grid;
  line-height: 1.05;
}
.brand-copy strong {
  font-size: 18px;
}
.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font:
    700 10px/1 Arial,
    sans-serif;
  letter-spacing: 0.08em;
}
.top-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.top-nav a {
  padding: 9px 12px;
  border-radius: 9px;
  color: #486159;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.top-nav a:hover,
.top-nav a:focus-visible,
.top-nav a.active {
  background: var(--green-soft);
  color: var(--green);
  outline: none;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.environment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font:
    700 11px/1 Arial,
    sans-serif;
  background: #fff;
}
.environment-pill .dot {
  width: 7px;
  height: 7px;
  background: #d79d3b;
  border-radius: 50%;
}
.current-engine {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.ask-layout {
  width: min(1500px, calc(100% - 32px));
  margin: 20px auto;
  display: grid;
  grid-template-columns: 275px minmax(0, 1fr) 315px;
  gap: 16px;
  align-items: start;
}
.mode-panel,
.chat-column,
.instructions-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 38px rgba(23, 52, 43, 0.05);
}
.mode-panel,
.instructions-panel {
  position: sticky;
  top: 92px;
}
.mode-panel {
  padding: 22px;
}
.panel-heading {
  padding: 2px 2px 18px;
  border-bottom: 1px solid #e5ebe7;
}
.eyebrow {
  color: var(--gold);
  font:
    800 10px/1.4 Arial,
    sans-serif;
  letter-spacing: 0.09em;
}
.panel-heading h1,
.chat-topbar h2,
.instructions-head h2 {
  margin: 6px 0 0;
}
.panel-heading h1 {
  font-size: 28px;
}
.panel-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.mode-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.mode-card {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  text-align: right;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  padding: 11px;
  color: var(--ink);
  cursor: pointer;
}
.mode-card:hover {
  background: #f7f9f7;
}
.mode-card.active {
  border-color: #cbd9d1;
  background: var(--green-soft);
}
.mode-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f0f3f1;
  color: var(--green);
  font-weight: 900;
}
.mode-card.active .mode-icon {
  background: var(--green);
  color: #fff;
}
.mode-card strong,
.mode-card small {
  display: block;
}
.mode-card strong {
  font-size: 13px;
  line-height: 1.5;
}
.mode-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.system-card {
  margin-top: 18px;
  padding: 14px;
  border-radius: 13px;
  background: #f8faf8;
  border: 1px solid #e2e8e4;
}
.system-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.system-card h2 {
  margin: 0;
  font-size: 13px;
}
.status-preview {
  font-size: 10px;
  font-weight: 800;
  color: #8a6529;
  background: var(--gold-soft);
  padding: 5px 7px;
  border-radius: 999px;
}
.status-row {
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 9px;
  margin-top: 12px;
  align-items: start;
}
.status-row > span {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #92a79e;
}
.status-row.ready > span {
  background: #2c8a62;
}
.status-row.pending > span {
  background: #d39b3f;
}
.status-row strong,
.status-row small {
  display: block;
}
.status-row strong {
  font-size: 11px;
}
.status-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.chat-column {
  min-height: calc(100vh - 116px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.chat-topbar {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.chat-topbar h2 {
  font-size: 21px;
}
.chat-topbar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.instruction-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green);
  border-radius: 9px;
  padding: 9px 11px;
  font-weight: 800;
  cursor: pointer;
}
.chat-stream {
  padding: 26px 24px 18px;
  min-height: 430px;
}
.message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.message.user {
  grid-template-columns: minmax(0, 1fr);
  margin-right: 48px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  border: 1px solid #d7e4dc;
}
.avatar img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}
.message-body {
  max-width: 880px;
  padding: 14px 16px;
  border-radius: 4px 14px 14px 14px;
  background: #f7f9f7;
  border: 1px solid #e2e8e4;
}
.message.user .message-body {
  justify-self: end;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  border-radius: 14px 4px 14px 14px;
}
.message-body p {
  margin: 0 0 9px;
  font-size: 14px;
  line-height: 1.85;
}
.message-body p:last-child {
  margin-bottom: 0;
}
.message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
}
.message-meta span {
  color: var(--muted);
}
.message.user .message-meta {
  color: rgba(255, 255, 255, 0.75);
}
.message.user .message-meta span {
  color: inherit;
}
.suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 48px 0 0;
}
.suggestions button,
.example {
  border: 1px solid #d8e2dc;
  background: #fff;
  color: var(--green);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.suggestions button:hover,
.example:hover {
  background: var(--green-soft);
}
.source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.source-card {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #dfe7e2;
  background: #fff;
  text-decoration: none;
}
.source-card:hover {
  border-color: #b9cec1;
  background: #fbfdfb;
}
.source-card strong {
  display: block;
  font-size: 12px;
  color: var(--green);
}
.source-card span {
  display: block;
  margin-top: 5px;
  color: #5d716a;
  font-size: 11px;
  line-height: 1.65;
}
.loading-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8ca097;
  animation: pulse 1s infinite alternate;
}
.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes pulse {
  to {
    opacity: 0.25;
    transform: translateY(-2px);
  }
}
.composer {
  margin: 0 18px 18px;
  border: 1px solid #cfdad4;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(23, 52, 43, 0.06);
  overflow: hidden;
}
.composer-tools {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 9px 12px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.tool-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px;
}
.tool-button span {
  background: #f0f2f0;
  border-radius: 999px;
  padding: 2px 5px;
  margin-right: 3px;
}
.composer textarea {
  width: 100%;
  border: 0;
  resize: none;
  padding: 12px 15px 8px;
  outline: none;
  color: var(--ink);
  background: transparent;
  line-height: 1.8;
  font-size: 14px;
}
.composer-footer {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px 12px;
}
.composer-footer p {
  margin: 0;
  color: #7a8b84;
  font-size: 9px;
  line-height: 1.5;
}
.send-button {
  flex: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.send-button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.instructions-panel {
  padding: 21px;
}
.instructions-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.instructions-head h2 {
  font-size: 18px;
}
.instructions-head button {
  display: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 22px 0;
  display: grid;
  gap: 14px;
}
.steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
}
.steps li > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
  font-size: 11px;
}
.steps strong {
  font-size: 12px;
}
.steps p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.instruction-block {
  padding-top: 15px;
  border-top: 1px solid #e5ebe7;
  margin-top: 15px;
}
.instruction-block h3 {
  margin: 0 0 10px;
  font-size: 12px;
}
.instruction-block p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.instruction-block .example {
  width: 100%;
  margin: 0 0 7px;
  border-radius: 9px;
  text-align: right;
  line-height: 1.55;
}
.instruction-block.caution {
  background: var(--gold-soft);
  border: 1px solid #eadbbd;
  border-radius: 11px;
  padding: 13px;
}
.ask-footer {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto 26px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #75877f;
  font-size: 10px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .ask-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .instructions-panel {
    display: none;
    position: fixed;
    z-index: 80;
    top: 82px;
    left: 18px;
    bottom: 18px;
    width: min(360px, calc(100vw - 36px));
    overflow: auto;
    box-shadow: var(--shadow);
  }
  .instructions-panel.open {
    display: block;
  }
  .instructions-head button,
  .instruction-toggle {
    display: block;
  }
}
@media (max-width: 860px) {
  .ask-header {
    grid-template-columns: 1fr auto;
    padding: 10px 16px;
  }
  .top-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .top-nav a {
    white-space: nowrap;
  }
  .current-engine {
    display: none;
  }
  .ask-layout {
    grid-template-columns: 1fr;
    width: min(100% - 20px, 820px);
    margin-top: 10px;
  }
  .mode-panel {
    position: static;
    padding: 14px;
  }
  .panel-heading {
    display: none;
  }
  .mode-list {
    margin: 0;
    display: flex;
    overflow-x: auto;
  }
  .mode-card {
    min-width: 195px;
  }
  .system-card {
    display: none;
  }
  .chat-column {
    min-height: calc(100vh - 170px);
  }
}
@media (max-width: 560px) {
  .brand-copy small,
  .environment-pill {
    display: none;
  }
  .ask-header {
    min-height: 60px;
    gap: 10px;
  }
  .brand img {
    width: 36px;
    height: 36px;
  }
  .top-nav a {
    font-size: 11px;
    padding: 8px 9px;
  }
  .chat-topbar {
    padding: 16px;
    align-items: flex-start;
  }
  .chat-topbar h2 {
    font-size: 18px;
  }
  .chat-stream {
    padding: 18px 14px 12px;
  }
  .message {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .message.user {
    margin-right: 0;
  }
  .avatar {
    width: 30px;
    height: 30px;
  }
  .avatar img {
    width: 23px;
    height: 23px;
  }
  .message-body {
    padding: 12px;
  }
  .message-body p {
    font-size: 13px;
  }
  .suggestions {
    margin-right: 0;
  }
  .composer {
    margin: 0 10px 10px;
  }
  .composer-footer {
    align-items: flex-end;
  }
  .composer-footer p {
    max-width: 70%;
  }
  .ask-footer {
    width: calc(100% - 24px);
    flex-direction: column;
    gap: 5px;
  }
  .preview-ribbon {
    left: 10px;
    bottom: 10px;
  }
}
