/* NeginAi Agent: a neutral workspace with independent RTL conversation text. */
#codexChatView {
  --chat-ink: #242424; --chat-muted: #696969; --chat-accent: #171717;
  --chat-line: #e8e8e8; --chat-sidebar: #f7f7f7; --chat-hover: #ededed;
  --chat-width: 1060px; --chat-gutter: clamp(20px, 4vw, 64px); --chat-header-width: 370px;
  width: 100%; max-width: none; padding: 0; color: var(--chat-ink);
  background: var(--chat-sidebar); font-size: 15px; box-sizing: border-box;
  border: 0; box-shadow: none;
}
#codexChatView *, #codexChatView *::before, #codexChatView *::after { box-sizing: border-box; }
#codexChatView [hidden] { display: none !important; }
#codexChatView :focus-visible { outline: 2px solid #656565; outline-offset: 3px; }
#codexChatView button {
  min-height: 38px; padding: 8px 12px; border: 1px solid var(--chat-line);
  border-radius: 9px; background: white; color: var(--chat-ink); font: inherit;
  font-size: 13px; line-height: 1.5; box-shadow: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
#codexChatView button:hover:not(:disabled) { background: var(--chat-hover); border-color: #d4d4d4; }
#codexChatView button:disabled { opacity: .45; cursor: default; }
#codexChatView button svg { width: 18px; height: 18px; flex-shrink: 0; }
#codexChatView table { min-width: 0; width: 100%; table-layout: auto; border-collapse: collapse; }
#codexChatView th, #codexChatView td { position: static; color: inherit; font-size: inherit; text-align: start; }
#codexChatView thead { position: static; }
#codexChatView tbody tr, #codexChatView tbody tr:nth-child(even), #codexChatView tbody tr:nth-child(odd) { background: transparent; }
#codexChatView th { background: #fafafa; }
#codexChatView tbody tr:hover { background: #f7f7f7; }
#codexChatView input, #codexChatView select {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; font: inherit;
  font-size: 13px; color: var(--chat-ink); background: white;
  border: 1px solid #d7d7d7; border-radius: 9px;
}
/* Sidebar stays physically on the left inside the RTL warehouse app. */
.codex-chat-shell {
  direction: ltr; display: grid; grid-template-columns: 270px minmax(0, 1fr);
  height: max(560px, calc(100dvh - 218px)); min-height: 0;
  border: 1px solid var(--chat-line); border-radius: 16px; overflow: hidden; background: white;
}
.codex-chat-shell > aside, .codex-chat-shell > section { direction: rtl; min-height: 0; min-width: 0; }
.codex-chat-sidebar {
  display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  padding: 20px 12px 12px; background: var(--chat-sidebar); border-right: 1px solid var(--chat-line);
}
.codex-chat-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; direction: ltr; padding: 0 8px 8px; }
.codex-chat-sidebar-heading h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.4px; direction: ltr; }
#codexChatView .codex-chat-sidebar-heading button { min-width: 36px; min-height: 36px; padding: 6px; border: 0; background: transparent; }
#codexChatView .codex-chat-new { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: #333; font-size: 15px; font-weight: 500; text-align: start; }
#codexChatView [data-archive-view] { width: fit-content; min-height: 30px; padding: 4px 9px; border: 0; background: transparent; color: var(--chat-muted); font-size: 12px; }
#codexChatView [data-archive-view][aria-pressed="true"] { background: #e9e9e9; color: var(--chat-ink); }
.codex-chat-search, .codex-chat-title-form label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--chat-muted); }
.codex-chat-search { padding: 0 4px; }
#codexChatView .codex-chat-search input { background: transparent; min-height: 38px; font-size: 12px; }
.codex-chat-title-form { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: white; border: 1px solid var(--chat-line); border-radius: 12px; }
.codex-chat-title-form small { color: var(--chat-muted); font-size: 12px; line-height: 1.8; }
.codex-chat-title-form > div { display: flex; gap: 8px; flex-wrap: wrap; }
#codexChatView [data-title-save] { background: var(--chat-accent); border-color: var(--chat-accent); color: white; }
.codex-chat-tasks { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 70px; overflow-y: auto; overscroll-behavior: contain; padding: 3px; scrollbar-width: thin; }
.codex-chat-task-group { margin: 12px 9px 6px; color: var(--chat-muted); font-size: 12px; font-weight: 500; }
.codex-chat-task-row { display: flex; align-items: center; gap: 2px; min-width: 0; border-radius: 10px; flex-shrink: 0; }
.codex-chat-task-row:hover, .codex-chat-task-row:focus-within { background: var(--chat-hover); }
#codexChatView .codex-chat-task {
  display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0;
  min-height: 42px; padding: 9px 12px; flex: 1; flex-shrink: 0;
  border: 0; border-radius: 10px; background: transparent; text-align: start; font-size: 14px;
}
#codexChatView .codex-chat-task[aria-current="page"] { background: #e9e9e9; color: #191919; font-weight: 600; box-shadow: none; }
.codex-chat-task-row:has([aria-current="page"]) { background: #e9e9e9; }
.codex-chat-task-title { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.65; }
.codex-chat-task small { color: var(--chat-muted); font-size: 11px; font-weight: 400; }
.codex-chat-task-actions { display: flex; align-items: center; flex-shrink: 0; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.codex-chat-task-row:hover .codex-chat-task-actions, .codex-chat-task-row:focus-within .codex-chat-task-actions { opacity: 1; }
#codexChatView .codex-chat-task-actions button { min-width: 30px; min-height: 32px; padding: 4px; border: 0; background: transparent; font-size: 15px; }
.codex-chat-sidebar-empty { margin: 10px 6px; font-size: 13px; line-height: 1.9; color: var(--chat-muted); }
.codex-chat-private { margin: 0 4px; padding-top: 4px; font-size: 11px; line-height: 1.7; color: var(--chat-muted); }
.codex-chat-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 2px; border-top: 1px solid var(--chat-line); direction: ltr; font-size: 14px; overflow-wrap: anywhere; }
.codex-chat-avatar { display: grid; place-items: center; width: 29px; height: 29px; flex-shrink: 0; border-radius: 50%; background: #278ecb; color: white; font-size: 13px; }
/* Tab strip and header use the full pane; the reading column is centered below. */
.codex-chat-main { display: flex; flex-direction: column; position: relative; min-width: 0; padding: 0 0 18px; overflow: hidden; background: white; }
.codex-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 4px; position: absolute; top: 0; right: 0; z-index: 2; width: var(--chat-header-width); height: 51px; min-height: 0; padding: 7px 10px; border: 0; background: #fcfcfc; flex-shrink: 0; }
.codex-chat-header > div:not(.codex-chat-header-actions) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.codex-chat-header h2 { margin: 0; font-size: 15px; line-height: 1.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.codex-chat-status { margin: 2px 0 0; min-height: 0; color: var(--chat-muted); font-size: 11px; line-height: 1.7; }
.codex-chat-status:empty { display: none; }
.codex-chat-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
#codexChatView .codex-chat-header button { min-height: 36px; padding: 5px 8px; border: 0; background: transparent; color: #656565; font-size: 12px; }
.codex-chat-tabs { display: flex; align-items: center; direction: ltr; gap: 6px; width: calc(100% - var(--chat-header-width)); margin-right: var(--chat-header-width); min-width: 0; min-height: 51px; padding: 8px 14px; border-bottom: 1px solid #efefef; background: #fcfcfc; overflow-x: auto; scrollbar-width: thin; flex-shrink: 0; }
#codexChatView .codex-chat-tab { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 110px; max-width: 280px; min-height: 35px; padding: 3px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #686868; font-size: 13px; }
.codex-chat-tab > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; }
#codexChatView .codex-chat-tab > [role="tab"] { min-width: 0; min-height: 26px; flex: 1; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; direction: rtl; }
#codexChatView .codex-chat-tabs > button { min-width: 32px; min-height: 32px; padding: 2px 6px; border: 0; background: transparent; color: var(--chat-muted); font-size: 21px; }
#codexChatView .codex-chat-tab[aria-selected="true"], #codexChatView .codex-chat-tab.is-active, #codexChatView .codex-chat-tab[aria-current="page"] { border-color: #ececec; background: white; color: #252525; font-weight: 600; box-shadow: 0 2px 7px #00000007; }
#codexChatView .codex-chat-tab-close { min-width: 25px; min-height: 25px; padding: 2px; border: 0; border-radius: 6px; color: #777; background: transparent; flex-shrink: 0; }
.codex-chat-error { width: calc(100% - 2 * var(--chat-gutter)); max-width: var(--chat-width); max-height: 150px; overflow-y: auto; margin: 10px auto 0; padding: 12px 16px; background: #fff1ee; border: 1px solid #f3c9c2; color: #98372c; border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; flex-shrink: 0; }
.codex-chat-messages { display: flex; flex-direction: column; gap: 30px; flex: 1; min-height: 80px; width: calc(100% - 2 * var(--chat-gutter)); max-width: var(--chat-width); margin: 0 auto; padding: 28px 5px 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; }
.codex-chat-message { flex-shrink: 0; max-width: 78%; padding: 12px 20px; border-radius: 24px; color: var(--chat-ink); }
.codex-chat-message.from-user { align-self: flex-start; background: #050505; color: white; border: 0; }
.codex-chat-message.from-codex { align-self: stretch; width: 100%; max-width: 100%; margin: 0; padding: 3px 4px; background: transparent; }
.codex-chat-message > strong { display: none; }
.codex-chat-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.95; }
.codex-chat-text:has(> p), .codex-chat-text:has(> table), .codex-chat-text:has(> ul), .codex-chat-text:has(> ol), .codex-chat-text:has(> pre) { white-space: normal; }
.codex-chat-text p { margin: 0 0 16px; white-space: pre-wrap; }
.codex-chat-text > :last-child { margin-bottom: 0; }
.codex-chat-text h1, .codex-chat-text h2, .codex-chat-text h3, .codex-chat-text h4 { margin: 22px 0 10px; font-weight: 650; line-height: 1.7; }
.codex-chat-text h1 { font-size: 23px; }.codex-chat-text h2 { font-size: 20px; }.codex-chat-text h3 { font-size: 18px; }.codex-chat-text h4 { font-size: 16px; }
.codex-chat-text ul, .codex-chat-text ol { margin: 8px 0 18px; padding-inline-start: 26px; }
.codex-chat-text li { margin-block: 6px; }
.codex-chat-text blockquote { margin: 14px 0; padding: 8px 16px; border-inline-start: 3px solid #d2d2d2; color: #626262; background: #fafafa; }
.codex-chat-text a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.codex-chat-text code { padding: 2px 5px; background: #f2f2f2; border-radius: 5px; font: .9em/1.7 Consolas, "Courier New", monospace; color: #333; }
.codex-chat-text pre { max-width: 100%; margin: 16px 0; padding: 15px 18px; overflow: auto; border: 1px solid var(--chat-line); border-radius: 12px; background: #f7f7f7; direction: ltr; text-align: left; white-space: pre; font: 13px/1.75 Consolas, "Courier New", monospace; }
.codex-chat-text pre code { display: block; padding: 0; border: 0; background: transparent; color: #292929; font: inherit; white-space: inherit; }
#codexChatView .codex-chat-table-wrap { width: 100%; max-width: 100%; margin-block: 16px; overflow-x: auto; }
#codexChatView .codex-chat-text table { display: table; margin: 0; font-size: 14px; }
#codexChatView .codex-chat-text th, #codexChatView .codex-chat-text td { min-width: 85px; padding: 10px 14px; border-bottom: 1px solid var(--chat-line); vertical-align: top; line-height: 1.8; }
#codexChatView .codex-chat-text th { font-weight: 650; }
.codex-chat-text hr { border: 0; border-top: 1px solid var(--chat-line); margin-block: 22px; }
#codexChatView .codex-chat-followup { display: inline-flex; align-items: center; margin: 4px 0 4px 8px; padding: 8px 13px; max-width: 100%; border-radius: 18px; background: #fafafa; white-space: normal; text-align: start; }
.from-user .codex-chat-text code { color: white; background: #303030; }
#codexChatView .codex-chat-copy { min-height: 30px; padding: 3px 7px; margin-top: 8px; border: 0; background: transparent; color: var(--chat-muted); font-size: 11px; }
#codexChatView .from-user .codex-chat-copy { color: #cacaca; }
#codexChatView .from-user .codex-chat-copy:hover:not(:disabled) { color: white; background: #303030; }
.codex-chat-empty { max-width: 500px; margin: auto; padding: 32px 12px; text-align: center; color: var(--chat-muted); }
.codex-chat-empty h3 { margin: 0 0 12px; font-size: 27px; font-weight: 600; color: var(--chat-ink); line-height: 1.7; }
.codex-chat-empty p { margin: 0; font-size: 14px; line-height: 2; }
/* Compact composer, anchored outside the scrollable transcript. */
.codex-chat-compose { display: flex; flex-direction: column; gap: 8px; width: calc(100% - 2 * var(--chat-gutter)); max-width: var(--chat-width); margin: auto auto 0; padding: 16px 18px 11px; border: 1px solid #e8e8e8; border-radius: 27px; background: white; box-shadow: 0 4px 24px #00000005; flex-shrink: 0; }
.codex-chat-compose-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#codexChatView .codex-chat-compose textarea { display: block; width: 100%; min-height: 56px; height: 62px; max-height: min(180px, 25dvh); resize: none; padding: 2px; border: 0; border-radius: 4px; color: var(--chat-ink); background: transparent; box-shadow: none; font: inherit; font-size: 15px; line-height: 1.9; }
#codexChatView .codex-chat-compose textarea::placeholder { color: #838383; opacity: 1; }
.codex-chat-options { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 4px; min-width: 0; }
.codex-chat-options > label { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--chat-muted); font-size: 11px; }
#codexChatView .codex-chat-options select { width: auto; min-width: 0; max-width: 200px; min-height: 34px; padding: 4px 6px; border: 0; border-radius: 7px; background-color: transparent; color: #313131; font-size: 13px; cursor: pointer; }
#codexChatView .codex-chat-options select:hover:not(:disabled) { background-color: #f2f2f2; }
.codex-chat-compose-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.codex-chat-compose-actions small { margin-inline-end: auto; color: var(--chat-muted); font-size: 11px; line-height: 1.7; }
.codex-chat-bottom-bar { display: flex; align-items: center; direction: ltr; gap: 6px; flex-wrap: wrap; }
.codex-chat-bottom-bar .codex-chat-options { margin-left: auto; direction: ltr; }
.codex-chat-bottom-bar .codex-chat-options > label { direction: rtl; }
.codex-chat-bottom-bar .codex-chat-compose-actions { display: contents; }
.codex-chat-send-control { position: relative; display: flex; align-items: center; gap: 2px; order: 2; flex-shrink: 0; direction: ltr; }
#codexChatView [data-send-menu-toggle] { padding: 4px; min-width: 28px; min-height: 36px; border: 0; border-radius: 18px; font-size: 18px; background: transparent; }
#codexChatView .codex-chat-send-menu { position: absolute; z-index: 12; bottom: calc(100% + 10px); right: 0; width: min(285px,75vw); padding: 6px; border: 1px solid var(--chat-line); border-radius: 14px; background: white; box-shadow: 0 6px 24px #00000018; direction: rtl; }
#codexChatView .codex-chat-send-menu button { display: flex; flex-direction: column; width: 100%; align-items: start; padding: 10px; gap: 4px; text-align: start; border: 0; border-radius: 9px; white-space: normal; }
#codexChatView .codex-chat-send-menu button[aria-checked="true"] { background: #ededed; }
#codexChatView .codex-chat-send-menu strong { font-size: 13px; font-weight: 600; }
#codexChatView .codex-chat-send-menu small { font-size: 11px; color: var(--chat-muted); }
.codex-chat-bottom-bar [data-attach] { order: -3; }
.codex-chat-bottom-bar [data-compose-hint] { order: -2; margin-inline-end: 0; direction: rtl; font-size: 10px; color: var(--chat-muted); }
.codex-chat-bottom-bar [data-send], .codex-chat-bottom-bar [data-stop], .codex-chat-bottom-bar [data-queue-send], .codex-chat-bottom-bar [data-steer], .codex-chat-bottom-bar [data-voice] { order: 2; }
#codexChatView [data-attach] { min-width: 36px; min-height: 36px; padding: 2px 6px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; }
#codexChatView [data-send], #codexChatView [data-stop] { min-height: 38px; min-width: 38px; padding: 8px 13px; border: 1px solid #080808; border-radius: 999px; background: #080808; color: white; font-weight: 600; }
#codexChatView [data-send]:hover:not(:disabled), #codexChatView [data-stop]:hover:not(:disabled), #codexChatView [data-title-save]:hover:not(:disabled) { background: #333; border-color: #333; }
#codexChatView [data-steer], #codexChatView [data-queue-send], #codexChatView [data-voice] { min-height: 34px; padding: 6px 9px; border: 0; border-radius: 999px; background: transparent; font-size: 11px; }
.codex-chat-speed-note { font-size: 11px; color: #755222; line-height: 1.7; }
#codexChatView .codex-chat-scroll-bottom { position: absolute; align-self: center; z-index: 2; min-width: 36px; min-height: 36px; padding: 6px 10px; border: 1px solid #e2e2e2; border-radius: 50%; background: white; box-shadow: 0 2px 8px #00000010; }
.codex-chat-attachments { display: flex; gap: 8px; flex-wrap: wrap; }
.codex-chat-attachments > span, .codex-chat-attachment { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 8px; border: 1px solid #dedede; border-radius: 12px; background: #fcfcfc; font-size: 12px; overflow-wrap: anywhere; }
.codex-chat-attachments img, .codex-chat-attachment-thumbnail { display: block; width: 48px; height: 48px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
#codexChatView .codex-chat-attachments button { min-width: 28px; min-height: 30px; padding: 2px 6px; border: 0; border-radius: 7px; background: transparent; font-size: 18px; }
#codexChatView .codex-chat-compose.is-dragging, #codexChatView .codex-chat-compose.drag-over { border-color: #6b6b6b; background: #fafafa; box-shadow: 0 0 0 3px #00000008; }
/* Live work, queued messages and approvals remain visible and keyboard accessible. */
.codex-chat-thinking, .codex-chat-queue, .codex-chat-requests, .codex-chat-activities { width: calc(100% - 2 * var(--chat-gutter)); max-width: var(--chat-width); margin-inline: auto; flex-shrink: 0; }
.codex-chat-thinking { padding: 9px 4px; color: var(--chat-muted); font-size: 13px; line-height: 1.8; }
.codex-chat-thinking::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-inline-end: 8px; border-radius: 50%; background: currentColor; animation: codex-thinking-pulse 1.3s ease-in-out infinite; }
.codex-chat-thinking span { margin-inline-start: 5px; font-size: 11px; }
.codex-chat-activities { padding: 8px 4px; color: var(--chat-muted); font-size: 12px; }
.codex-chat-activities summary { width: fit-content; cursor: pointer; padding: 4px 0; }
.codex-chat-activities > div { max-height: 120px; overflow: auto; }
.codex-chat-activities p { margin: 5px 0; line-height: 1.7; }
.codex-chat-queue { width: calc(100% - 2 * var(--chat-gutter) - 32px); max-width: calc(var(--chat-width) - 32px); max-height: 180px; overflow-y: auto; margin-bottom: -12px; padding: 5px 12px 16px; border: 1px solid var(--chat-line); border-radius: 18px 18px 0 0; background: #fafafa; font-size: 13px; }
.codex-chat-queue > .codex-chat-queue-row { display: flex; align-items: center; gap: 10px; min-height: 36px; padding-block: 3px; direction: ltr; }
.codex-chat-queue-row + .codex-chat-queue-row { border-top: 1px solid var(--chat-line); }
.codex-chat-queue-icon { color: #a0a0a0; flex: 0 0 auto; }
.codex-chat-queue-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: start; }
.codex-chat-queue-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
#codexChatView .codex-chat-queue-actions button, .codex-chat-queue-menu summary { min-height: 28px; padding: 5px 7px; border: 0; background: transparent; color: #777; font: inherit; cursor: pointer; white-space: nowrap; }
#codexChatView .codex-chat-queue-actions button:hover, .codex-chat-queue-menu summary:hover { color: #111; background: #eee; border-radius: 7px; }
#codexChatView .codex-chat-queue-actions button:disabled { opacity: .45; cursor: default; }
.codex-chat-queue-menu { position: relative; }
.codex-chat-queue-menu summary { list-style: none; }
#codexChatView .codex-chat-queue-menu[open] > button { display: block; background: white; border: 1px solid #ddd; border-radius: 8px; }
.codex-chat-queue-editor { flex: 1; direction: rtl; }
.codex-chat-queue-editor textarea { width: 100%; min-height: 60px; max-height: 100px; resize: vertical; font: inherit; }
.codex-chat-queue-actions small { max-width: 220px; direction: rtl; }
.codex-chat-compose { position: relative; }
.codex-chat-queue button { flex-shrink: 0; }
.codex-chat-requests { max-height: min(420px, 55dvh); overflow: auto; overscroll-behavior: contain; }
#codexChatView.has-question .codex-chat-compose textarea { min-height: 32px; height: 34px; max-height: 70px; font-size: 13px; }
.codex-chat-approval { margin: 12px 0; padding: 16px; border: 1px solid #dbc38d; border-radius: 14px; background: #fff8e8; }
.codex-chat-approval h3 { margin: 0 0 12px; font-size: 15px; }
.codex-chat-approval pre { max-height: 220px; overflow: auto; padding: 12px; border-radius: 8px; direction: ltr; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 Consolas, monospace; background: #fffdf8; }
.codex-chat-approval label { display: block; margin-block: 12px; line-height: 1.8; }
.codex-chat-approval label p { color: #685438; font-size: 13px; }
.codex-chat-approval input { display: block; margin-top: 8px; }
.codex-chat-approval button { margin-inline-end: 8px; margin-block-start: 8px; }
#codexChatView .codex-chat-question { margin: 8px 0; padding: 16px; border: 1px solid #e6e6e6; border-radius: 22px; background: white; color: #333; direction: rtl; }
.codex-chat-question header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.codex-chat-question h3 { margin: 0; font-size: 13px; font-weight: 500; color: #777; }
.codex-chat-question-clock { color: #777; font-size: 11px; flex: 1; }
#codexChatView .codex-chat-question-close { margin-inline-start: auto; padding: 0; min-width: 30px; min-height: 30px; border: 0; background: transparent; color: #888; font-size: 20px; }
#codexChatView .codex-chat-question fieldset { min-width: 0; margin: 0 0 10px; padding: 0; border: 0; }
.codex-chat-question legend { width: 100%; margin-bottom: 12px; padding: 0; font-size: 14px; font-weight: 600; line-height: 1.8; }
#codexChatView .codex-chat-question-choice { display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; text-align: start; white-space: normal; }
#codexChatView .codex-chat-question-choice:hover, #codexChatView .codex-chat-question-choice[aria-pressed="true"] { background: #f2f2f2; }
.codex-chat-choice-number { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border: 1px solid #ddd; border-radius: 50%; color: #888; background: #f8f8f8; }
.codex-chat-question-choice strong { font-size: 13px; font-weight: 500; }
.codex-chat-question-choice small { display: block; color: #777; font-size: 11px; line-height: 1.7; }
#codexChatView .codex-chat-question input { width: 100%; min-height: 38px; margin-top: 7px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: 13px; }
#codexChatView .codex-chat-question input:focus { border-color: #bbb; outline: 2px solid #e9e9e9; }
.codex-chat-question footer { display: flex; justify-content: flex-end; gap: 8px; }
#codexChatView .codex-chat-question footer button { padding: 6px 12px; min-height: 32px; border: 1px solid #e6e6e6; border-radius: 999px; background: white; font-size: 12px; }
#codexChatView .codex-chat-question footer .codex-chat-question-send { background: #111; color: white; border-color: #111; }
#codexChatView .codex-chat-question footer .codex-chat-question-send:disabled { background: #aaa; border-color: #aaa; opacity: 1; }
/* Compact task file cards: original uploads and generated files share preview/download. */
#codexChatView .codex-chat-output { display: grid; grid-template-columns: minmax(0,1fr) 36px; gap: 0 3px; direction: ltr; width: 310px; max-width: 100%; margin: 4px 0; padding: 5px 7px; border: 1px solid var(--chat-line); border-radius: 15px; background: white; flex-shrink: 0; align-self: flex-end; }
#codexChatView .codex-chat-output[data-source="upload"] { align-self: flex-start; }
#codexChatView .codex-chat-file-source { grid-column: 1/-1; padding: 0 8px; color: var(--chat-muted); font-size: 10px; text-align: start; direction: rtl; }
#codexChatView .codex-chat-file-open { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 54px; padding: 6px; border: 0; background: transparent; text-align: left; direction: ltr; }
.codex-chat-file-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
#codexChatView .codex-chat-file-info strong { display: block; width: 100%; font-size: 13px; font-weight: 600; line-height: 1.7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#codexChatView .codex-chat-file-info small { color: var(--chat-muted); font-size: 11px; font-weight: 400; direction: ltr; }
#codexChatView .codex-chat-file-icon { display: grid; place-items: center; width: 40px; height: 44px; flex: 0 0 40px; border-radius: 9px; color: #636363; background: #f6f6f6; overflow: hidden; }
#codexChatView .codex-chat-file-icon svg { width: 27px; height: 31px; }
#codexChatView .codex-chat-file-icon img { width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0; object-fit: cover; }
#codexChatView .codex-chat-file-icon[data-kind="sheet"] { color: #248347; }
#codexChatView .codex-chat-file-icon[data-kind="pdf"] { color: #bb3b37; }
#codexChatView .codex-chat-file-icon[data-kind="document"] { color: #396ac6; }
#codexChatView .codex-chat-file-icon[data-kind="slides"] { color: #c56932; }
#codexChatView .codex-chat-file-icon[data-kind="code"] { color: #6764a5; }
#codexChatView .codex-chat-file-download { display: grid; place-items: center; align-self: center; width: 34px; min-height: 40px; padding: 0; border-radius: 8px; color: #555; font-size: 22px; text-decoration: none; }
#codexChatView .codex-chat-file-download:hover { background: var(--chat-hover); }
#codexChatView .codex-chat-attachment { padding: 3px 5px; gap: 3px; max-width: 310px; }
#codexChatView .codex-chat-attachment .codex-chat-file-open { font-size: 13px; }
.codex-chat-file-preview { max-width: 100%; margin: 0; border-top: 1px solid var(--chat-line); }
.codex-chat-file-preview > div { max-height: 420px; overflow: auto; background: white; border-radius: 8px; }
.codex-chat-file-preview summary { padding: 10px 0; cursor: pointer; font-size: 13px; font-weight: 500; }
.codex-chat-file-preview pre { margin: 0; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; text-align: start; font: 13px/1.7 Consolas, monospace; }
.codex-chat-file-preview table { width: 100%; border-collapse: collapse; font-size: 13px; }
.codex-chat-file-preview td { min-width: 90px; max-width: 320px; padding: 7px 10px; border-bottom: 1px solid var(--chat-line); white-space: pre-wrap; overflow-wrap: anywhere; }
/* A file opens beside the conversation without navigating away from its task. */
.codex-chat-file-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; direction: rtl; overflow: hidden; background: #fbfbfb; border-left: 1px solid var(--chat-line); }
.codex-chat-file-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; padding: 12px 16px; border-bottom: 1px solid var(--chat-line); background: white; flex-shrink: 0; }
.codex-chat-file-panel-header h2, .codex-chat-file-panel-header h3, .codex-chat-file-panel-header strong { min-width: 0; margin: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#codexChatView .codex-chat-file-panel-header button { flex-shrink: 0; min-width: 32px; min-height: 32px; padding: 4px 7px; border: 0; background: transparent; }
.codex-chat-file-panel-body { flex: 1; min-height: 0; min-width: 0; padding: 16px; overflow: auto; overscroll-behavior: contain; }
.codex-chat-file-panel-body > img, .codex-chat-file-image { display: block; max-width: 100%; max-height: 100%; height: auto; object-fit: contain; margin: auto; border-radius: 8px; }
.codex-chat-file-panel-body iframe, .codex-chat-file-pdf { width: 100%; height: 100%; min-height: 400px; border: 0; background: white; }
.codex-chat-file-panel-body pre { margin: 0; padding: 14px; background: white; border: 1px solid var(--chat-line); border-radius: 9px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.8 Consolas, "Courier New", monospace; }
.codex-chat-file-panel-body table { width: 100%; border-collapse: collapse; background: white; font-size: 13px; }
#codexChatView .codex-chat-file-panel-body td, #codexChatView .codex-chat-file-panel-body th { min-width: 85px; padding: 9px 12px; border: 1px solid var(--chat-line); line-height: 1.8; }
.codex-chat-file-panel-body > p { color: var(--chat-muted); font-size: 13px; line-height: 1.9; }
.codex-chat-file-panel-body > label { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--chat-muted); font-size: 12px; }
.codex-chat-file-panel-body > label select { flex: 1; }
.codex-chat-file-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--chat-line); background: white; flex-shrink: 0; }
.codex-chat-file-toolbar:empty { display: none; }
.codex-chat-file-toolbar strong { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.codex-chat-file-toolbar a { padding: 6px 10px; border: 1px solid var(--chat-line); border-radius: 7px; color: #333; font-size: 13px; text-decoration: none; }
.codex-chat-file-toolbar a:hover { background: var(--chat-hover); }
.codex-chat-file-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-height: 28%; padding: 10px 12px; overflow-y: auto; flex-shrink: 0; border-bottom: 1px solid var(--chat-line); }
.codex-chat-file-list:empty { display: none; }
.codex-chat-file-list h3 { margin: 6px 4px 2px; color: var(--chat-muted); font-size: 11px; font-weight: 500; }
.codex-chat-file-list > p { margin: 4px; color: var(--chat-muted); font-size: 12px; line-height: 1.8; }
#codexChatView .codex-chat-file-list button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; text-align: left; direction: ltr; overflow-wrap: anywhere; background: white; }
#codexChatView .codex-chat-file-list button[aria-current="true"], #codexChatView .codex-chat-file-list button[aria-selected="true"] { background: #ededed; font-weight: 600; }
#codexChatView.codex-chat-file-panel-open .codex-chat-shell { grid-template-columns: 235px minmax(320px, 1fr) minmax(300px, 34%); }
#codexChatView.codex-chat-file-panel-open { --chat-gutter: 20px; }
#codexChatView.codex-chat-file-panel-open .codex-chat-header { position: static; width: 100%; height: 39px; padding-block: 2px; border-bottom: 1px solid #efefef; }
#codexChatView.codex-chat-file-panel-open .codex-chat-tabs { width: 100%; margin-right: 0; padding-right: 14px; }
#codexChatView.codex-chat-expanded { position: fixed; inset: 8px; z-index: 1000; width: auto; padding: 0; box-shadow: 0 0 0 16px #f4f4f4; }
.codex-chat-expanded .codex-chat-shell { height: 100%; grid-template-columns: clamp(270px, 26vw, 350px) minmax(0, 1fr); }
#codexChatView.codex-chat-sidebar-collapsed .codex-chat-shell { grid-template-columns: minmax(0, 1fr); }
#codexChatView.codex-chat-sidebar-collapsed .codex-chat-sidebar { display: none; }
#codexChatView.codex-chat-sidebar-collapsed.codex-chat-file-panel-open .codex-chat-shell { grid-template-columns: minmax(320px, 1fr) minmax(300px, 38%); }
@keyframes codex-thinking-pulse { 50% { opacity: .3; } }
@media (max-width: 1100px) {
  #codexChatView { --chat-gutter: 22px; }
  .codex-chat-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .codex-chat-expanded .codex-chat-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .codex-chat-header { position: static; width: 100%; height: 39px; min-height: 39px; padding: 2px 12px; border-bottom: 1px solid #efefef; }
  .codex-chat-tabs { width: 100%; margin-right: 0; }
  .codex-chat-bottom-bar [data-compose-hint] { display: none; }
  .codex-chat-options > label { gap: 1px; font-size: 10px; }
  #codexChatView .codex-chat-options select { max-width: 145px; font-size: 12px; }
  #codexChatView.codex-chat-file-panel-open .codex-chat-shell { grid-template-columns: 230px minmax(0, 1fr); }
  #codexChatView.codex-chat-sidebar-collapsed.codex-chat-file-panel-open .codex-chat-shell { grid-template-columns: minmax(0, 1fr); }
  #codexChatView.codex-chat-file-panel-open .codex-chat-file-panel { position: absolute; inset: 0 0 0 auto; width: min(600px, 90%); z-index: 5; box-shadow: -12px 0 32px #00000018; }
  .codex-chat-shell { position: relative; }
}
@media (max-width: 760px) {
  #codexChatView { --chat-gutter: 14px; }
  .codex-chat-shell, .codex-chat-expanded .codex-chat-shell, #codexChatView.codex-chat-file-panel-open .codex-chat-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: max(700px, calc(100dvh - 160px)); }
  .codex-chat-sidebar { max-height: 235px; gap: 8px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--chat-line); }
  .codex-chat-sidebar-heading { padding: 0; }.codex-chat-sidebar-heading h2 { font-size: 18px; }
  .codex-chat-search { flex-direction: row; align-items: center; flex-shrink: 0; }.codex-chat-search input { flex: 1; }
  .codex-chat-tasks { min-height: 42px; max-height: 80px; }
  .codex-chat-user, .codex-chat-private { display: none; }
  .codex-chat-task-actions { opacity: 1; }
  .codex-chat-main { padding-bottom: 12px; }
  .codex-chat-header { position: static; width: 100%; height: 39px; min-height: 39px; padding: 2px 12px; border-bottom: 1px solid #efefef; }
  .codex-chat-header-actions { gap: 1px; }
  #codexChatView .codex-chat-header button { padding: 5px; font-size: 11px; }
  .codex-chat-tabs { width: 100%; margin-right: 0; min-height: 46px; padding: 5px 10px; }
  .codex-chat-messages { gap: 22px; padding-block: 20px; min-height: 120px; }
  #codexChatView.has-question .codex-chat-messages { min-height: 0; padding-block: 4px; }
  #codexChatView.has-question .codex-chat-requests { max-height: min(350px, 40dvh); }
  .codex-chat-message { max-width: 92%; padding: 10px 15px; }
  .codex-chat-text { font-size: 14px; line-height: 1.9; }
  .codex-chat-compose { padding: 12px 12px 9px; border-radius: 21px; }
  #codexChatView .codex-chat-compose textarea { min-height: 50px; height: 56px; font-size: 14px; }
  .codex-chat-options { gap: 2px; flex-wrap: wrap; }
  .codex-chat-bottom-bar { gap: 3px; }
  .codex-chat-bottom-bar .codex-chat-options { flex: 1; justify-content: flex-end; }
  .codex-chat-options > label { font-size: 0; }
  #codexChatView .codex-chat-options select { max-width: 130px; padding-inline: 2px; min-height: 36px; font-size: 11px; }
  .codex-chat-compose-actions small { flex-basis: 100%; font-size: 10px; }
  #codexChatView [data-steer], #codexChatView [data-queue-send] { padding-inline: 6px; font-size: 10px; }
  #codexChatView.codex-chat-expanded { inset: 0; box-shadow: none; }
  .codex-chat-expanded .codex-chat-shell, #codexChatView.codex-chat-expanded.codex-chat-file-panel-open .codex-chat-shell { height: 100dvh; border-radius: 0; }
  #codexChatView.codex-chat-sidebar-collapsed .codex-chat-shell { grid-template-rows: minmax(0, 1fr); }
  #codexChatView.codex-chat-file-panel-open .codex-chat-file-panel { width: 100%; }
  .codex-chat-file-panel-body { padding: 12px; }
}
@media (pointer: coarse) {
  #codexChatView button, #codexChatView .codex-chat-header button, #codexChatView .codex-chat-task-actions button, #codexChatView [data-attach], #codexChatView [data-send], #codexChatView [data-stop], #codexChatView .codex-chat-copy { min-height: 44px; }
  #codexChatView .codex-chat-task-actions button, #codexChatView [data-attach], #codexChatView [data-send], #codexChatView [data-stop] { min-width: 44px; }
  .codex-chat-task-actions { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #codexChatView button, .codex-chat-task-actions { transition: none; }
  .codex-chat-thinking::before { animation: none; }
}

/* Explicit application > project > task navigation. */
.codex-chat-project-context{margin:.5rem 0;line-height:1.6;font-weight:600;overflow-wrap:anywhere}
#codexChatView.codex-chat-project-home .codex-chat-main{display:none}
#codexChatView.codex-chat-project-home .codex-chat-shell{grid-template-columns:1fr}
#codexChatView.codex-chat-project-home .codex-chat-sidebar{display:flex!important;width:100%;max-width:none;position:static;transform:none}
#codexChatView.codex-chat-project-home .codex-chat-tasks{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:12px;align-content:start}
.codex-chat-project-card{min-height:80px;padding:20px;text-align:right;border:1px solid var(--chat-line);border-radius:12px;background:#fff;color:inherit;cursor:pointer;font:inherit;line-height:1.8}
.codex-chat-project-card:focus-visible,[data-project-back]:focus-visible{outline:3px solid #2563eb;outline-offset:3px}
[data-project-back]{min-height:44px;margin-block:8px;text-align:right}
[data-project-assignment]{padding:12px;border:1px solid var(--chat-line);border-radius:10px}
[data-project-assignment] select{display:block;width:100%;min-width:0;min-height:44px;margin-block:8px;font:inherit}
[data-project-assignment] p,[data-project-assignment-result]{font-size:13px;line-height:1.8;overflow-wrap:anywhere}
