/* Focus Toolbox layout standard: white logo bar, #034ea2 app-name bar. */
:root {
  --foe-blue: #034ea2;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f7fa;
  --pill-bg: #d7f3e3;
  --pill-ink: #0f6b3a;
  --error: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
.logo-bar { height: 80px; background: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.logo { height: 64px; width: auto; }
.env-tag { font-size: 12px; text-transform: uppercase; background: #fff4e5; color: #92400e; border-radius: 999px; padding: 2px 10px; }
.app-bar { background: var(--foe-blue); color: #fff; min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-wrap: wrap; gap: 8px; }
.app-name { text-transform: uppercase; font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.who { font-size: 13px; }
.who .link { color: #fff; margin-left: 8px; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.narrow { max-width: 520px; margin: 32px auto; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--error); }
.inline { display: inline; }
.link { background: none; border: 0; padding: 0; color: var(--foe-blue); cursor: pointer; font: inherit; text-decoration: underline; text-align: left; }
.button { display: inline-block; border: 1px solid var(--foe-blue); color: var(--foe-blue); background: #fff; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.button.primary { background: var(--foe-blue); color: #fff; }
.button:disabled { opacity: .6; cursor: progress; }
.stack { display: grid; gap: 10px; }
.stack label { display: grid; gap: 4px; font-size: 14px; }
input, textarea { font: inherit; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; width: 100%; }
.preview { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.preview summary { cursor: pointer; color: var(--muted); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.topic { text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; cursor: pointer; display: grid; gap: 6px; font: inherit; color: inherit; }
.topic:hover:not(:disabled), .topic:focus-visible { border-color: var(--foe-blue); box-shadow: 0 0 0 3px rgba(3, 78, 162, .12); }
.topic:disabled { cursor: not-allowed; background: #fafafa; color: var(--muted); }
.topic-title { font-weight: 700; }
.topic-blurb { font-size: 14px; color: var(--muted); }
.topic-docs { font-size: 12px; color: var(--pill-ink); background: var(--pill-bg); border-radius: 999px; padding: 2px 8px; justify-self: start; }
.topic-docs.soon { color: var(--muted); background: #f1f5f9; }
.topic-all { border-style: dashed; }

.chat-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: 14px; }
.chat-head span { margin-right: auto; }
/* Change topic / New conversation as gray buttons (#9). */
.chat-head .chip { border: 0; border-radius: 8px; background: #e5e7eb; color: #000; padding: 6px 12px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.chat-head .chip:hover { background: #d1d5db; }
.chat-head .chip:focus-visible { outline: 2px solid var(--foe-blue); outline-offset: 2px; }
.messages { min-height: 320px; max-height: 62vh; overflow-y: auto; padding: 12px 0; display: grid; gap: 12px; align-content: start; }
.msg { max-width: 90%; border-radius: 12px; padding: 10px 14px; line-height: 1.5; }
.msg.user { justify-self: end; background: var(--foe-blue); color: #fff; white-space: pre-wrap; }
.msg.assistant { justify-self: start; background: #f8fafc; border: 1px solid var(--line); }
.msg .body p:first-child { margin-top: 0; }
.msg .body p:last-child { margin-bottom: 0; }
.typing { color: var(--muted); font-style: italic; }
.sources { margin-top: 8px; font-size: 13px; }
.sources summary { cursor: pointer; color: var(--muted); }
.ask { display: flex; gap: 8px; align-items: end; border-top: 1px solid var(--line); padding-top: 12px; }
.ask textarea { resize: vertical; }
.asking ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.asking-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.asking-head h2 { margin: 0; }
.asking-nav { display: flex; gap: 4px; }
.icon-button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.icon-button:hover { background: #f3f4f6; }
.icon-button:focus-visible { outline: 2px solid var(--foe-blue); outline-offset: 2px; }
.asking-set.fade-in { animation: asking-fade .3s ease-in; }
@keyframes asking-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .asking-set.fade-in { animation: none; } }
.asking .link { font-size: 14px; text-decoration: none; }
.asking .link:hover { text-decoration: underline; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cc-dock:not(:empty) { position: fixed; left: 16px; bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, .10); z-index: 50; padding: 10px 14px; }

/* Tabs: Ask | Documents (#6) */
.tabs { background: #fff; border-bottom: 1px solid var(--line); display: flex; gap: 4px; padding: 0 16px; }
.tab { padding: 12px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--foe-blue); border-bottom-color: var(--foe-blue); }

/* The Documents tab */
.tag { display: inline-block; font-size: 12px; border-radius: 999px; padding: 1px 8px; background: #f1f5f9; color: var(--muted); white-space: nowrap; }
.tag.main { background: #e0ecfb; color: var(--foe-blue); }
.tag.supplemental { background: #fff4e5; color: #92400e; }
.tag.ready { background: var(--pill-bg); color: var(--pill-ink); }
.tag.indexing { background: #eef2ff; color: #3730a3; }
.tag.failed { background: #fde8e7; color: var(--error); }
.notice { border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.notice.ok { background: var(--pill-bg); color: var(--pill-ink); }
.notice.bad { background: #fde8e7; color: var(--error); }
.lib-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lib-topic { margin-top: 20px; }
.doc { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.doc-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doc-title { font-weight: 700; margin-right: auto; overflow-wrap: anywhere; }
.doc-meta { font-size: 13px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
select { font: inherit; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; width: 100%; background: #fff; }
.button.danger { border-color: var(--error); color: var(--error); }
.empty { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* Pop-ups, icons, drop areas and dragging (#8) */
.lib-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-topic-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.lib-topic-head h2 { font-size: 16px; margin: 0; }
.lib-topic-head .doc-meta { margin-top: 2px; }
.lib-topic { border-radius: 12px; transition: background-color .15s, box-shadow .15s; }
.lib-topic.drop-target { background: #f0f6fe; box-shadow: 0 0 0 2px var(--foe-blue); }
.doc-list { min-height: 8px; }
.doc { background: #fff; }
.doc[draggable=true] { cursor: grab; }
.doc.dragging { opacity: .5; }
.icons { display: inline-flex; gap: 2px; }
.icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; padding: 0; }
.icon:hover, .icon:focus-visible { background: #eef2f7; color: var(--foe-blue); }
.icon.danger:hover, .icon.danger:focus-visible { background: #fde8e7; color: var(--error); }
.icon[aria-disabled=true] { opacity: .35; cursor: not-allowed; }
.icon[aria-disabled=true]:hover { background: none; color: var(--muted); }
.button.danger-solid { background: var(--error); border-color: var(--error); color: #fff; }
.button:disabled { opacity: .6; cursor: wait; }

.modal { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); color: var(--ink); }
.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal form { display: grid; gap: 14px; padding: 20px; }
.modal label, .modal .field { display: grid; gap: 4px; font-size: 14px; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-head h2 { font-size: 18px; margin: 0; overflow-wrap: anywhere; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-error { margin: 0; border-radius: 8px; padding: 10px 14px; background: #fde8e7; color: var(--error); font-size: 14px; }
.modal input[type=text] { font: inherit; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; width: 100%; box-sizing: border-box; }
.modal input[type=text]:focus, .modal select:focus { outline: 2px solid var(--foe-blue); outline-offset: 1px; }

.dropzone { position: relative; border: 2px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; transition: border-color .15s, background-color .15s; }
.dropzone:focus-within { border-color: var(--foe-blue); box-shadow: 0 0 0 3px rgba(3, 78, 162, .12); }
.dropzone.over { border-color: var(--foe-blue); background: #f0f6fe; }
/* The real file input: hidden from sight (the label is the drop area), still focusable. */
.dz-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dz-empty { display: grid; justify-items: center; gap: 4px; padding: 18px 12px; text-align: center; cursor: pointer; color: var(--muted); font-size: 14px; }
.dz-empty svg { color: var(--foe-blue); }
.dz-browse { color: var(--foe-blue); font-weight: 600; text-decoration: underline; }
.dz-chosen { display: flex; align-items: center; gap: 8px; padding: 12px; font-size: 14px; flex-wrap: wrap; }
.dz-chosen svg { color: var(--foe-blue); flex: none; }
.dz-name { font-weight: 600; overflow-wrap: anywhere; }
.dz-size { color: var(--muted); }
.dz-chosen .dz-clear { margin-left: auto; }
[hidden] { display: none !important; }
