:root { font-family: Arial, Helvetica, sans-serif; color: #25324b; background: #fff; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; background: #fafbfe; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 32px 18px; background: #f1f3fb; border-right: 1px solid #e1e5f0; }
.nav-heading { font-size: 10px; color: #8a91aa; letter-spacing: .12em; margin: 42px 12px 14px; }
.sidebar-bottom { margin-top: auto; padding: 24px 10px 0; }
.sidebar-bottom p { color: #939ab0; font-size: 11px; margin-top: 16px; }
.brand { color: #4338ca; text-decoration: none; font-size: 18px; font-weight: 700; letter-spacing: .06em; }
.brand span { display: block; color: #7c849e; font-size: 11px; font-weight: 400; letter-spacing: 0; margin: 8px 0 0; }
.mode { color: #0f766e; background: #ecfdf5; border: 1px solid #cceee1; border-radius: 20px; padding: 6px 10px; font-size: 12px; }
main { min-width: 0; padding: 30px 32px 20px; }
.page-heading { margin-bottom: 26px; }
h1 { color: #1e2c49; margin: 0 0 10px; font-size: 30px; font-weight: 500; letter-spacing: -.7px; }
h2 { font-size: 18px; font-weight: 500; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 24px 0 10px; }
p { font-size: 14px; line-height: 1.65; margin: 8px 0 14px; }
.page-heading p { color: #777; }
.tabs { display: flex; flex-direction: column; gap: 6px; }
.tabs button { text-align: left; border: 1px solid transparent; border-radius: 6px; padding: 12px 14px; background: transparent; color: #727b96; }
.tabs button[aria-selected="true"] { color: #4338ca; background: #e2e5fa; border-color: #d8dcf7; font-weight: 600; }
label { display: block; margin: 22px 0 10px; font-size: 13px; font-weight: 600; }
button, input, textarea { font: inherit; font-size: 13px; }
button { padding: 11px 18px; border: 1px solid #4f46e5; background: #4f46e5; color: #fff; border-radius: 4px; cursor: pointer; }
button:hover:not(:disabled) { background: #4338ca; }
button:disabled { opacity: .4; cursor: not-allowed; }
.secondary, .examples button { background: #fff; color: #4f46a1; border-color: #deddf2; }
.secondary:hover:not(:disabled), .examples button:hover:not(:disabled) { background: #f5f3ff; }
.tabs button:hover { background: transparent; color: #4f46e5; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #818cf8; outline-offset: 4px; }
input[type="file"] { display: block; width: 100%; max-width: none; border: 1px solid #d6d6d6; padding: 10px; border-radius: 4px; color: #666; background: #fff; }
input[type="file"]::file-selector-button { padding: 8px 14px; margin-right: 14px; border: 1px solid #d8d6fa; border-radius: 3px; background: #eef2ff; color: #4338ca; cursor: pointer; }
input[type="file"]:disabled { opacity: .5; }
textarea { width: 100%; max-width: none; resize: vertical; min-height: 120px; border: 1px solid #ccc; border-radius: 4px; padding: 14px; line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 18px; }
.note, .label, .badge { color: #777; font-size: 12px; }
.status { color: #0f766e; font-size: 13px; font-variant-numeric: tabular-nums; }
.status:empty { display: none; }
.error, #error, #batch-error { color: #8a2929; background: #fcf5f5; padding: 12px 14px; border-left: 2px solid #ad6262; }
progress { appearance: none; display: block; width: 100%; height: 4px; margin: 28px 0 16px; border: 0; background: #e5f2ef; accent-color: #0d9488; }
progress::-webkit-progress-bar { background: #e5f2ef; }
progress::-webkit-progress-value { background: #0d9488; }
progress::-moz-progress-bar { background: #0d9488; }
#batch-results, #result { margin-top: 24px; padding: 24px; border: 1px solid #e1e5ef; border-radius: 8px; background: white; }
.result-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.result-title h2 { margin-bottom: 6px; }
.batch-table { overflow: auto; max-height: 65dvh; margin-top: 16px; }
.batch-table table { min-width: 620px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th, td { padding: 14px 12px; border-bottom: 1px solid #e8e8e8; vertical-align: top; overflow-wrap: anywhere; }
th { position: sticky; top: 0; background: #f0f3fc; color: #4c5d87; font-size: 12px; font-weight: 500; }
td:first-child { color: #888; font-variant-numeric: tabular-nums; }
td:nth-child(2) { min-width: 120px; }
td:nth-child(3) { min-width: 230px; white-space: pre-wrap; }
td:nth-child(4) { min-width: 130px; }
.empty { color: #888; margin: 32px 0; }
.empty h2 { display: none; }
.submitted-query { color: #777; white-space: pre-wrap; overflow-wrap: anywhere; }
.category-card { margin-top: 28px; }
.category-card h3 { font-size: 26px; font-weight: 500; margin: 8px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { color: #5b42a4; background: #f4f0ff; border: 1px solid #e6ddfc; padding: 6px 10px; border-radius: 3px; font-size: 12px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 32px 0; }
dt { color: #888; font-size: 12px; }
dd { margin: 8px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.clarification { border-left: 2px solid #d8a343; padding-left: 16px; }
details { border-top: 1px solid #e8e8e8; margin-top: 28px; padding-top: 18px; }
summary { cursor: pointer; color: #5750a2; font-size: 13px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f5f6fc; padding: 16px; font-size: 12px; line-height: 1.6; }
#flow, .reference ul { font-size: 13px; line-height: 1.8; color: #777; padding-left: 20px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.examples button { font-size: 12px; padding: 8px 12px; }
footer { border-top: 1px solid #eee; padding-top: 16px; margin-top: 26px; font-size: 12px; color: #999; line-height: 1.6; }
#batch-download { background: #0f766e; border-color: #0f766e; }
#batch-download:hover:not(:disabled) { background: #115e59; }
.category-card h3 { color: #4338ca; }
tbody tr:hover { background: #fafaff; }
[hidden] { display: none !important; }
.batch-upload { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr); gap: 0 32px; padding: 24px; border: 1px solid #e1e5ef; border-radius: 8px; background: white; }
.upload-source, .upload-options { min-width: 0; }
.upload-options { border-left: 1px solid #eceef5; padding-left: 32px; }
.upload-options h3 { margin: 0 0 18px; color: #7b8299; font-size: 12px; font-weight: 500; }
.batch-settings { margin: 0; display: grid; gap: 12px; }
.batch-settings div { display: flex; justify-content: space-between; gap: 12px; }
.batch-settings dd { margin: 0; color: #4338ca; font-size: 12px; }
.batch-feedback { grid-column: 1 / -1; }
.batch-feedback progress { margin: 14px 0; }
.batch-feedback .status { margin: 12px 0 0; }
.table-empty td { text-align: center; padding: 54px 16px; color: #9098b0; }
#single-panel form { padding: 24px; border: 1px solid #e1e5ef; border-radius: 8px; background: white; }
#single-panel form label { margin-top: 0; }
@media (max-width: 1050px) {
  body { grid-template-columns: 190px minmax(0, 1fr); }
  main { padding: 26px 22px; }
  .batch-upload { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .upload-options { border-left: 0; border-top: 1px solid #eceef5; padding: 18px 0 0; }
  .upload-options .actions { margin-bottom: 0; }
}
@media (max-width: 640px) {
  body { grid-template-columns: 92px minmax(0, 1fr); }
  .sidebar { padding: 24px 8px; }
  .brand { font-size: 15px; padding-left: 6px; }
  .brand span, .nav-heading, .sidebar-bottom p { display: none; }
  .tabs { margin-top: 30px; }
  .tabs button { font-size: 11px; padding: 12px 6px; }
  .sidebar-bottom { padding: 16px 0 0; }
  .mode { display: block; font-size: 9px; padding: 6px; border-radius: 6px; overflow-wrap: anywhere; }
  main { padding: 24px 14px; }
  h1 { font-size: 24px; }
  .batch-upload, #batch-results, #result, #single-panel form { padding: 16px; }
  .batch-settings dt, .batch-settings dd { font-size: 11px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sidebar | input | response. Panels stack when the reading width is narrow. */
.split-workspace { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.split-workspace > * { min-width: 0; }
.split-workspace .batch-upload { display: flex; flex-direction: column; gap: 18px; }
.split-workspace .upload-options { padding: 18px 0 0; border-left: 0; border-top: 1px solid #eceef5; }
.split-workspace #batch-results { margin-top: 0; }
.batch-settings label { margin: 0; font-size: 12px; font-weight: 400; }
.batch-settings div { align-items: center; }
select { font: inherit; font-size: 13px; color: #4338ca; border: 1px solid #d9dded; padding: 6px 10px; border-radius: 4px; background: #fff; }
select:disabled { opacity: .5; }
select:focus-visible { outline: 2px solid #818cf8; outline-offset: 3px; }
.response-pane { border: 1px solid #e1e5ef; border-radius: 8px; background: #fff; padding: 24px; min-height: 320px; }
.response-pane #result { border: 0; padding: 0; margin-top: 0; }
.input-pane .reference { background: white; padding: 20px; border: 1px solid #e1e5ef; border-radius: 8px; }
@media (max-width: 1100px) { .split-workspace { grid-template-columns: minmax(0, 1fr); } }
