:root {
  color-scheme: light;
  --page: #e5edf4;
  --surface: #ffffff;
  --ink: #10283e;
  --text: #293e54;
  --muted: #4d6077;
  --line: #bdcad8;
  --soft: #dfe9f2;
  --accent: #0e756c;
  --accent-hover: #09564f;
  --accent-soft: #d7eee7;
  --focus: #126eae;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
header {
  min-height: 64px;
  padding: 12px max(28px, calc((100vw - 1216px) / 2));
  display: flex;
  align-items: center;
  gap: 14px;
  background: #112f45;
  border-bottom: 3px solid #15968b;
  color: #fff;
}
.brand { font-size: 18px; font-weight: 750; letter-spacing: 2.2px; }
.badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  color: #d2e5f1;
  background: #234354;
  border: 1px solid #456477;
  border-radius: 4px;
  padding: 2px 6px;
}
#identity { margin-left: auto; font-size: 12px; color: #c5d7e6; overflow-wrap: anywhere; }
main { max-width: 1280px; padding: 24px 32px 0; margin: auto; }
.notice {
  margin: 0 0 18px;
  border: 1px solid #d7b16a;
  border-radius: 6px;
  background: #fff0cd;
  color: #654514;
  padding: 9px 13px;
  font-size: 12px;
  line-height: 1.5;
}
#message { color: #244761; background: #dcecf9; border: 1px solid #9dbbd5; border-radius: 6px; padding: 9px 12px; font-size: 12px; overflow-wrap: anywhere; margin: 0 0 16px; }
#message[data-kind="error"] { color: #9c3d29; background: #fff1ef; border-color: #efc9c2; }
#message:empty { display: none; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 650; }
h1 { font-size: 23px; line-height: 1.3; letter-spacing: -.5px; margin: 0 0 18px; }
h2 { font-size: 17px; line-height: 1.4; margin: 0 0 14px; letter-spacing: -.2px; }
h3 { font-size: 14px; line-height: 1.45; margin: 20px 0 10px; }
h4 { font-size: 13px; margin: 12px 0 8px; }
p { margin: 10px 0; }
article, aside, section#login, section#admin, section#library {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 3px 12px #10283e0b;
}
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .48fr); gap: 20px; align-items: start; }
.split aside { padding: 20px; }
.panel-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.panel-heading h2 { margin: 0; }
.panel-heading button { margin: 0; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink); margin: 14px 0; }
label span, .small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
#documentaryTitle, #reelTitle { color: var(--ink); font-size: 12px; font-weight: 600; }
input, textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #9fb1c4;
  border-radius: 6px;
  padding: 7px 10px;
  margin-top: 6px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:hover, textarea:hover, select:hover { border-color: #97a9bd; }
input:disabled, select:disabled, textarea:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: #586b81; opacity: 1; }
textarea { resize: vertical; }
input[type="file"] { padding: 5px 7px; font-size: 12px; color: var(--muted); background: #fafbfd; }
input::file-selector-button {
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 9px;
  margin-right: 10px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}
input::file-selector-button:hover { color: var(--ink); background: var(--soft); }
.check { display: flex; gap: 8px; align-items: start; font-size: 12px; font-weight: 400; color: var(--text); }
.check input { display: inline; width: 15px; height: 15px; min-height: 0; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--accent); }
button {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  min-height: 34px;
  max-width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid #cdd7e2;
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  margin: 3px 4px 3px 0;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
button:hover { background: #edf2f7; color: var(--ink); border-color: #aebdce; }
button:active { background: #e2eaf2; color: var(--ink); }
button.primary, #submitJob, #saveModelSettings, #loginForm > button {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
button.primary:hover, #submitJob:hover, #saveModelSettings:hover, #loginForm > button:hover {
  color: #fff;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
button.secondary { color: var(--text); background: #f8fafc; border-color: var(--line); }
button.secondary:hover { color: var(--ink); background: #eaf0f6; border-color: #b6c5d5; }
button:disabled { opacity: .55; cursor: not-allowed; }
:where(button, input, textarea, select, a, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; border-color: var(--focus); }
#logout { font-size: 11.5px; min-height: 30px; padding: 5px 10px; margin: 0; background: #244859; color: #fff; border-color: #507082; }
#logout:hover { background: #346275; color: #fff; border-color: #7ea3b5; }
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
nav button, .output-tabs button {
  margin: 0 0 -1px;
  min-height: 39px;
  padding: 9px 13px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 4px 4px 0 0;
}
nav button:hover, .output-tabs button:hover { background: #eaf0f5; color: var(--ink); border-color: transparent; }
nav button.active, .output-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--accent);
  border-bottom-color: var(--accent);
}
nav button.active:hover, .output-tabs button[aria-selected="true"]:hover { background: var(--accent-hover); color: #fff; border-bottom-color: var(--accent-hover); }
nav button { min-height: 34px; border-radius: 5px; margin: 0; padding: 7px 13px; }
.output-tabs button[aria-selected="true"] { background: #193d57; border-bottom-color: #193d57; }
.output-tabs button[aria-selected="true"]:hover { background: #102c40; color: #fff; border-bottom-color: #102c40; }
.route-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 16px; }
.route-cards button { margin: 0; min-height: 43px; padding: 10px 12px; text-align: left; background: #e6f0f6; color: #1e465d; border-color: #a7becf; }
.route-cards button:hover { color: var(--accent-hover); background: #d6e9e3; border-color: #6caa9e; }
.route-cards button.selected { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: inset 3px 0 #46c8b7; }
.route-cards button.selected:hover { color: #fff; background: var(--accent-hover); border-color: var(--accent-hover); }
#mode { font-size: 11.5px; color: var(--muted); margin: 12px 0 10px; }
#taskHelp, #taskConfiguration { font-size: 12px; color: var(--muted); line-height: 1.5; }
#taskConfiguration { padding: 8px 10px; background: #f7f9fb; border-radius: 5px; overflow-wrap: anywhere; }
#taskHelp:empty, #taskConfiguration:empty { display: none; }
#showOutputExamples, #refreshTaskConfiguration { font-size: 11.5px; min-height: 30px; padding: 5px 9px; }
#jobList { display: grid; gap: 8px; }
#jobList:empty { margin: 0; }
#jobList button { display: block; width: 100%; margin: 0; padding: 12px; text-align: left; background: #fafbfd; color: var(--text); border: 1px solid var(--line); }
#jobList button:hover { background: #dbe8f3; color: var(--ink); border-color: #b1c3d2; }
#jobList button[aria-pressed="true"] { background: #dbefe8; color: var(--ink); border-color: #5e9d91; box-shadow: inset 3px 0 var(--accent); }
.job-title { display: block; color: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.5; margin-bottom: 8px; }
.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 10.5px; font-weight: 400; color: var(--muted); }
.job-status { border-radius: 4px; padding: 2px 6px; background: #e9edf3; color: #45566d; font-weight: 600; }
.job-status[data-state="completed"] { background: #c9e8db; color: #20583e; }
.job-status[data-state="failed"] { background: #fae8e5; color: #953f34; }
.job-status[data-state="running"] { background: #e2eefb; color: #2b5c91; }
.actions { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; margin: 12px 0; }
a { color: #15655f; text-underline-offset: 3px; }
a:hover { color: #0b4944; }
#jobTitle { font-size: 18px; margin-bottom: 8px; }
#jobState { font-size: 12px; font-weight: 500; color: var(--muted); }
#jobConfiguration { margin: 6px 0 12px; }
.output-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0; }
#panelResult { min-height: 160px; }
#artifact { margin: 16px 0; overflow-wrap: anywhere; line-height: 1.65; }
#artifact p { white-space: pre-wrap; }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; line-height: 1.6; }
#artifact table { min-width: 600px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--line); white-space: pre-wrap; }
th { background: #193d57; color: #fff; font-size: 11px; font-weight: 650; white-space: nowrap; overflow-wrap: normal; }
.table-scroll th, .table-scroll td { border-width: 0 0 1px; }
.table-scroll th + th, .table-scroll td + td { border-left-width: 1px; }
.table-scroll tr:last-child td { border-bottom: 0; }
#continuation { background: var(--accent-soft); color: var(--accent-hover); border: 1px solid #c9dfd8; border-radius: 6px; padding: 10px 12px; }
#taskActions { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 8px; }
#taskActions form + form { border-top: 1px solid #edf0f4; margin-top: 18px; padding-top: 4px; }
details { margin: 16px 0; }
summary { cursor: pointer; color: var(--text); font-weight: 600; font-size: 12px; }
summary:hover { color: var(--accent-hover); }
details[open] > summary { margin-bottom: 12px; }
pre:empty { display: none; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f7f9fc; border: 1px solid var(--line); border-radius: 6px; padding: 14px; font-size: 12px; max-height: 600px; overflow: auto; }
.event { border-left: 2px solid #a7c8bf; padding: 7px 12px; margin: 10px 0; font-size: 12px; }
.event .small { display: block; }
progress { display: block; width: 100%; margin: 12px 0; accent-color: var(--accent); }
footer { font-size: 11px; text-align: center; color: var(--muted); padding: 24px; }
#libraryFiles { display: grid; gap: 5px; margin: 16px 0 24px; max-height: 360px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fc; }
#libraryFiles button { margin: 0; font-weight: 400; font-size: 12px; text-align: left; color: var(--text); background: #fafbfd; border-color: var(--line); overflow-wrap: anywhere; }
#libraryFiles button:hover { color: var(--ink); background: #edf3f7; border-color: #b1c3d2; }
.user-row { background: #fafbfd; border: 1px solid var(--line); border-radius: 7px; padding: 16px; margin: 12px 0; }
.user-row form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.user-row label { min-width: 160px; max-width: 100%; }
.user-row button { height: fit-content; }
.source-citation { display: inline; min-height: 0; background: transparent; color: #15655f; padding: 0; border: 0; border-radius: 2px; text-decoration: underline; text-underline-offset: 2px; text-align: left; font-weight: 400; font-size: inherit; overflow-wrap: anywhere; }
.source-citation:hover { background: #e2f0ea; color: #0b4944; border: 0; }
.source-passage { padding: 12px 14px; margin: 10px 0; }
.source-passage p { white-space: pre-wrap; overflow-wrap: anywhere; }
.source-passage h4 { margin: 4px 0; }
.source-passage.selected-passage { border-left: 3px solid var(--accent); background: #f0f8f4; }
.version-row { border-bottom: 1px solid var(--line); padding: 12px 0; }
#sourceIdentity, #contextView, #comparisonContext { overflow-wrap: anywhere; }
#exampleControls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
#compareForm { border-top: 1px solid var(--line); padding-top: 12px; }
.comparison-block { border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin: 12px 0; }
.comparison-block h4 { margin: 4px 0 12px; }
.comparison-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; border-top: 1px solid var(--line); padding-top: 10px; }
.comparison-pair p { white-space: pre-wrap; overflow-wrap: anywhere; }
.comparison-pair ins { background: #dbf1dc; color: #174e24; }
.comparison-pair del { background: #fae0df; color: #772825; }
#taskOverridesSection { margin: 24px 0; border-top: 1px solid var(--line); padding-top: 8px; }
#taskOverrideGroups > details { margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.task-override { padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-override h4 { margin: 8px 0; }
.override-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
#jobConfiguration { overflow-wrap: anywhere; }
#settings > article { max-width: 960px; }
#modelSettingsForm, #providerProbeForm, #inviteForm { max-width: 800px; }
#settings > article > p, #admin > p, #library > p { max-width: 85ch; }
#account > article { max-width: 760px; }
#changePasswordForm { max-width: 480px; }
#libraryAdmin { border-top: 1px solid var(--line); padding-top: 20px; }
section#login { max-width: 460px; margin: 36px auto 28px; padding: 28px; }
#login h1 { font-size: 22px; }
#loginForm > button { width: 100%; margin: 6px 0 12px; min-height: 38px; }
#login > details { padding-top: 14px; border-top: 1px solid var(--line); }
main:has(#workspace[hidden]) { max-width: 650px; padding-top: 36px; }
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(240px, .55fr); gap: 16px; }
  main { padding: 20px; }
  article, aside { padding: 20px; }
  header { padding: 12px 20px; }
}
@media (max-width: 720px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  header { flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; }
  .brand { font-size: 16px; }
  #identity { margin-left: auto; max-width: 100%; font-size: 11px; }
  main { padding: 16px 12px 0; }
  article, aside, section#login, section#admin, section#library { padding: 18px; margin-bottom: 16px; }
  h1 { font-size: 21px; }
  nav { gap: 0; margin-bottom: 16px; }
  nav button { padding: 9px 10px; font-size: 11.5px; }
  button { min-height: 38px; }
  input, select, textarea { font-size: 16px; }
  .notice { font-size: 11.5px; padding: 9px 11px; }
  section#login { margin-top: 24px; }
  main:has(#workspace[hidden]) { padding-top: 22px; }
}
@media (max-width: 640px) {
  .comparison-pair, .override-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .output-tabs { gap: 0; }
  .output-tabs button { padding: 9px 10px; }
}
@media (max-width: 420px) {
  #identity { order: 4; flex-basis: 100%; }
  #logout { margin-left: auto; }
  .route-cards { gap: 6px; }
  .route-cards button { font-size: 11.5px; padding: 9px 10px; min-height: 43px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
/* A single conversation surface, with history alongside it. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.chat-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 18px; align-items: start; }
.chat-history { padding: 18px 14px; background: #f5f8fc; max-height: 820px; overflow-y: auto; }
.chat-history .panel-heading { gap: 6px; }
.chat-history h2 { font-size: 14px; white-space: nowrap; }
.chat-history #newChat { font-size: 11px; padding: 6px 8px; }
.chat-history #jobList { gap: 5px; }
.chat-history #jobList button { padding: 10px; background: transparent; border-color: transparent; }
.chat-history #jobList button:hover { background: #dce8f1; border-color: #abc0d0; color: var(--ink); }
.chat-history #jobList button[aria-pressed="true"] { background: #d4e9e2; color: var(--ink); border-color: #81b2a5; }
.chat-history .job-title { font-size: 12px; margin-bottom: 4px; overflow-wrap: anywhere; }
.chat-history .job-meta { font-size: 10px; }
.chat-panel { padding: 0; overflow: hidden; }
.chat-heading { padding: 22px 24px 14px; background: #173d57; color: #dceaf4; }
.chat-heading h1 { color: #fff; font-size: 21px; margin: 0 0 4px; }
.chat-heading p { margin: 0; font-size: 12px; }
.chat-panel .route-cards { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.chat-panel .route-cards button { min-height: 39px; font-size: 11.5px; padding: 8px; text-align: center; line-height: 1.4; }
.chat-messages { height: min(56vh, 600px); min-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 24px; scrollbar-gutter: stable; }
.chat-welcome { max-width: 400px; margin: 70px auto; text-align: center; }
.chat-welcome h2 { font-size: 19px; line-height: 1.5; margin-bottom: 10px; }
.chat-welcome p { color: var(--muted); font-size: 13px; }
.chat-turn { margin: 0 0 24px; border: 0; padding: 0; background: transparent; min-width: 0; overflow-wrap: anywhere; }
.chat-turn > h2 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; color: #3b596e; }
.user-turn { margin-left: 12%; background: #e5f0ec; border: 1px solid #c4ded4; border-radius: 10px 10px 2px 10px; padding: 14px 16px; }
.user-turn > p { white-space: pre-wrap; margin: 0; font-size: 13px; }
.assistant-turn { padding: 0 0 18px; border-bottom: 1px solid #dfe7ee; }
.assistant-turn:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.rich-result { font-size: 13px; line-height: 1.75; }
.rich-result > :first-child { margin-top: 0; }
.rich-result h2, .rich-result h3 { margin: 20px 0 8px; font-size: 16px; }
.rich-result h4, .rich-result h5 { font-size: 14px; }
.rich-result p { white-space: pre-wrap; }
.rich-result .table-scroll { margin: 14px 0; }
.rich-result table { min-width: 500px; font-size: 12px; }
.rich-result code { font-size: 12px; background: #edf2f6; padding: 1px 4px; border-radius: 3px; }
.rich-result ul, .rich-result ol { padding-left: 22px; }
.rich-result li { margin: 5px 0; }
.editorial-note { margin-top: 16px; border-left: 3px solid #b5822d; padding: 8px 12px; background: #fff6e3; color: #604718; font-size: 11.5px; }
.editorial-note ul { margin: 6px 0 0; padding-left: 18px; }
.chat-progress { color: #155d57; font-size: 12px; border-left: 3px solid var(--accent); padding: 8px 12px; background: #e4f3ec; }
.chat-composer { border-top: 1px solid var(--line); background: #f5f8fb; padding: 16px 20px; }
.chat-composer textarea { border-color: #a2b7c7; background: #fff; margin: 0; min-height: 85px; max-height: 240px; font-size: 13px; }
.composer-bottom { display: flex; align-items: center; gap: 8px; padding-top: 10px; }
.composer-bottom button { margin: 0; }
.composer-hint { font-size: 10.5px; color: var(--muted); }
#sendMessage { margin-left: auto; min-width: 75px; }
#chatStatus:empty, #knowledgeStatus:empty { display: none; }
#chatStatus { margin: 8px 0 0; }
.attachment-list, .message-files { display: flex; flex-wrap: wrap; gap: 6px; }
.attachment-chip, .message-files span { display: inline-flex; align-items: center; overflow-wrap: anywhere; min-width: 0; max-width: 100%; padding: 3px 8px; border: 1px solid #aec9be; background: #e3f0e9; border-radius: 5px; font-size: 11px; }
.attachment-chip { margin-top: 8px; }
.attachment-chip button { padding: 0 5px; min-height: 24px; margin: 0 0 0 6px; background: transparent; border: 0; color: #234c40; }
.message-files { margin-top: 10px; }
#library .panel-heading { align-items: start; }
#library h1 { margin-bottom: 4px; }
#library .panel-heading p { font-size: 12px; color: var(--muted); margin: 0; }
#addKnowledge { flex-shrink: 0; }
.folder-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 22px 0 12px; padding: 10px 12px; background: #edf3f8; border-radius: 6px; }
.folder-breadcrumb button { border: 0; background: transparent; margin: 0; padding: 3px 5px; min-height: 28px; color: #1f5266; }
.folder-breadcrumb button:hover { background: #d5e5ee; color: #173d57; }
.folder-files { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.folder-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 14px 16px; border-bottom: 1px solid #dfe7ee; }
.folder-row:last-child { border-bottom: 0; }
.folder-row:hover { background: #f3f7fa; }
.folder-row > span, .file-info > span { display: block; font-size: 10.5px; color: var(--muted); }
.file-info { min-width: 0; }
.file-name { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; text-decoration: none; }
.file-name:hover { text-decoration: underline; }
.folder-name { padding: 2px 0; margin: 0; color: #173d57; background: transparent; border: 0; font-size: 13px; }
.folder-name:hover { color: #0b4944; background: transparent; text-decoration: underline; }
.file-actions { display: flex; flex-shrink: 0; gap: 5px; }
.file-actions button { margin: 0; font-size: 11px; padding: 5px 9px; min-height: 30px; }
@media(max-width:1000px){ .chat-layout { grid-template-columns: 205px minmax(0,1fr); gap: 12px; } .chat-panel .route-cards { grid-template-columns: 1fr 1fr; } .composer-hint { display: none; } }
@media(max-width:720px){
  .chat-layout { grid-template-columns: minmax(0,1fr); }
  .chat-history { padding: 12px; margin-bottom: 0; max-height: 210px; }
  .chat-history #jobList { display: flex; overflow-x: auto; padding-bottom: 3px; }
  .chat-history #jobList button { min-width: 175px; max-width: 220px; }
  .chat-history .job-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .chat-panel { padding: 0; }
  .chat-heading { padding: 18px 16px 14px; }
  .chat-panel .route-cards { padding: 12px; }
  .chat-messages { padding: 18px 14px; height: 56vh; min-height: 300px; }
  .chat-welcome { margin: 50px auto; }
  .chat-welcome h2 { font-size: 17px; }
  .chat-composer { padding: 12px; }
  .chat-composer textarea { font-size: 16px; }
  .user-turn { margin-left: 5%; padding: 12px; }
  .folder-row { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .file-actions { margin-left: auto; }
  #library .panel-heading { flex-wrap: wrap; }
}
.history-entry { position: relative; display: block; min-width: 0; }
.chat-history #jobList .history-open { width: 100%; }
.chat-history .history-open .job-meta { padding-right: 28px; }
.history-actions { position: absolute; right: 6px; bottom: 6px; margin: 0; }
.history-actions > summary { display: flex; align-items: center; justify-content: center; list-style: none; width: 28px; height: 28px; margin: 0; border-radius: 5px; font-size: 21px; line-height: 1; color: var(--muted); }
.history-actions > summary::-webkit-details-marker { display: none; }
.history-actions > summary:hover, .history-actions[open] > summary { color: var(--ink); background: #d6e4ed; }
.history-menu { position: absolute; right: 0; bottom: calc(100% + 4px); width: 134px; padding: 4px; z-index: 3; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 5px 18px #10283e26; }
.chat-history #jobList .history-delete { width: 100%; min-width: 0; max-width: none; margin: 0; padding: 7px 10px; min-height: 34px; font-size: 12px; color: #873727; border: 0; background: #fff; }
.chat-history #jobList .history-delete:hover { color: #702617; background: #f8e5df; }
@media(hover:hover) and (pointer:fine){
  .history-actions > summary { opacity: 0; }
  .history-entry:hover .history-actions > summary, .history-entry:focus-within .history-actions > summary, .history-actions[open] > summary { opacity: 1; }
}
.knowledge-toolbar { display: flex; gap: 8px; flex-shrink: 0; }
.knowledge-toolbar button { margin: 0; }
dialog { width: min(460px,calc(100vw - 32px)); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 24px; box-shadow: 0 18px 70px #10283e44; }
dialog::backdrop { background: #10283e77; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 22px; }
.dialog-actions button { margin: 0; }
@media(max-width:720px){
  .chat-history #jobList .history-entry { min-width: 220px; max-width: 260px; }
  .chat-history #jobList .history-open { min-width: 0; max-width: none; }
  .chat-history #jobList .history-delete { min-width: 0; max-width: none; }
  .file-actions { flex-wrap: wrap; }
  .knowledge-toolbar { flex-wrap: wrap; }
}
.folder-name, .folder-breadcrumb button { min-width: 0; overflow-wrap: anywhere; }

.history-actions.menu-below .history-menu { top: calc(100% + 4px); bottom: auto; }
.history-actions[open] > summary { margin: 0; }
