:root { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; color: #202622; background: #f5f7f6; font-size: 15px; }
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; background: transparent; border: 1px solid #ccd3cf; padding: 8px 13px; border-radius: 5px; color: #27332d; min-height: 38px; }
button:hover { background: #e8efeb; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #188369; outline-offset: 3px; }
.primary { background: #186a50; border-color: #186a50; color: white; }
.primary:hover { background: #12563f; }
header { min-height: 76px; background: white; border-bottom: 1px solid #dce2de; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 32px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
h1 { margin: 0; font-size: 21px; font-weight: 650; }
h2 { font-size: 19px; margin: 0 0 20px; }
nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
nav span { color: #67756c; font-size: 14px; overflow-wrap: anywhere; }
nav button { font-size: 13px; padding: 6px 10px; min-height: 34px; }
main { max-width: 1040px; margin: 0 auto; padding: 0 28px 22px; height: calc(100dvh - 77px); min-height: 480px; display: flex; flex-direction: column; }
.workspace-top { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid #dce2de; padding-top: 10px; flex: none; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; min-width: 68px; padding: 14px 13px 12px; }
.tabs [aria-selected="true"] { border-bottom-color: #186a50; color: #155b44; font-weight: 650; }
.tabs [data-domain="reimbursement"][aria-selected="true"] { color: #976116; border-bottom-color: #b37d2c; }
.tabs [data-domain="simulation"][aria-selected="true"] { color: #365fa2; border-bottom-color: #4c76b8; }
.tabs [data-domain="experiment"][aria-selected="true"] { color: #a14946; border-bottom-color: #b86661; }
#history-clear { border: 0; color: #6d756e; font-size: 13px; white-space: nowrap; padding: 8px; }
#conversation { flex: 1; overflow-y: auto; padding: 24px 0 16px; min-height: 100px; }
#empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #68766c; }
#empty h2 { font-size: 21px; font-weight: 500; }
.exchange { padding: 8px 0 24px; border-bottom: 1px solid #e2e7e3; margin-bottom: 22px; }
.question-text { font-size: 17px; line-height: 1.6; font-weight: 600; margin: 0 0 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-text { font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.answer-text p { margin: 0 0 13px; }
.answer-text p:last-child { margin-bottom: 0; }
.answer-text ul, .answer-text ol { margin: 8px 0 15px; padding-left: 25px; white-space: normal; }
.answer-text li { padding: 3px 0 3px 2px; }
.answer-text h4 { font-size: 15px; margin: 16px 0 8px; line-height: 1.7; }
.answer-text code { font-size: 13px; background: #e9eeec; padding: 1px 4px; border-radius: 3px; }
.citation { color: #27765d; font-size: 11px; margin-left: 3px; }
.legacy-excerpts { margin-top: 0; }
.legacy-excerpts > .answer-text { margin-top: 10px; }
.answer-label { display: inline-block; font-size: 12px; color: #52675b; background: #e7eeea; padding: 3px 7px; margin-bottom: 10px; border-radius: 3px; }
details { margin-top: 16px; font-size: 13px; color: #667368; }
summary { cursor: pointer; padding: 5px 0; }
.source { padding: 7px 0; overflow-wrap: anywhere; line-height: 1.6; }
#question-form { border: 1px solid #c8d1cb; background: white; border-radius: 7px; padding: 13px 14px 10px; flex: none; }
textarea { border: 0; resize: vertical; width: 100%; min-height: 72px; max-height: 200px; line-height: 1.7; padding: 0; background: transparent; color: #202622; }
textarea:focus-visible { outline-offset: 5px; }
.composer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.composer-bottom > div { display: flex; gap: 8px; flex: none; }
#job-status { font-size: 13px; color: #596c60; }
#job-status.active::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: #32866b; border-radius: 50%; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { #job-status.active::before { animation: none; } }
#login-view { display: flex; justify-content: center; padding: 72px 20px; }
.login-box { background: white; border: 1px solid #dce2de; border-radius: 7px; padding: 30px; width: 360px; max-width: 100%; }
label { display: block; font-size: 14px; margin-bottom: 7px; }
input, select { background: white; color: #202622; border: 1px solid #c8d1cb; border-radius: 4px; padding: 10px; min-height: 40px; min-width: 0; }
.login-box input, dialog input { width: 100%; margin-bottom: 17px; }
.login-box .primary { width: 100%; }
.error { color: #a13936; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.error:empty { display: none; }
dialog { border: 1px solid #c8d1cb; border-radius: 7px; padding: 26px; width: 390px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 28px); overflow-y: auto; color: #202622; }
dialog::backdrop { background: rgb(23 35 28 / .34); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 0; }
.dialog-heading button { font-size: 13px; }
#admin-dialog { width: 960px; }
.admin-tabs { border-bottom: 1px solid #dce2de; margin-bottom: 24px; }
.create-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 24px; }
.create-form label { margin: 0; }
.create-form input { margin: 7px 0 0; }
.create-form button { margin-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; color: #68766c; font-weight: 500; }
th, td { border-bottom: 1px solid #e2e7e3; padding: 12px 10px; vertical-align: top; }
td { overflow-wrap: anywhere; }
td button { font-size: 12px; min-height: 32px; padding: 5px 9px; margin: 0 7px 5px 0; }
td input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; margin: 2px 0; accent-color: #186a50; }
.document-filters { display: grid; grid-template-columns: 135px 1fr; gap: 12px; margin-bottom: 12px; }
.document-filters input { margin: 0; }
#documents-list td:nth-child(1) { width: 100px; }
#documents-list td:nth-child(3) { width: 65px; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
  header { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
  h1 { font-size: 19px; }
  nav { width: 100%; gap: 7px; justify-content: flex-end; }
  nav span { margin-right: auto; }
  main { height: calc(100dvh - 125px); padding: 0 14px 14px; min-height: 420px; }
  .tabs { gap: 0; }
  .tabs button { min-width: 52px; padding: 13px 9px 11px; }
  #conversation { padding-top: 18px; }
  .question-text { font-size: 16px; }
  .create-form { grid-template-columns: 1fr; }
  .create-form button { justify-self: start; }
  #login-view { padding-top: 44px; }
  dialog { padding: 20px; }
}
