.codex-icon { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; }
.codex-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.codex-toolbar { gap:5px; }
.codex-toolbar .panel-button { display:inline-flex; align-items:center; gap:3px; height:32px; padding:4px 6px; border-radius:16px; }
.codex-toolbar [popovertarget="accessMenu"] { color:#e8ce05; font-size:13px; }
.codex-toolbar [popovertarget="modelMenu"] { font-size:13px; }
.codex-toolbar [popovertarget="effortMenu"] { font-size:13px; }
.codex-toolbar [popovertarget="effortMenu"] svg { width:14px; }
.codex-toolbar .voice-button { width:30px; height:32px; padding:4px; border:0; background:transparent; color:#ccc; display:flex; justify-content:center; }
.codex-toolbar .send-button { width:35px; height:35px; flex-basis:35px; border:0; border-radius:50%; background:#dedede; color:#292929; display:grid; place-items:center; padding:0; }
.stop-task { width:35px; height:35px; flex-basis:35px; font-size:13px; }
.composer-box { background:#222; border:1px solid #383838; border-radius:24px; padding:12px 12px 10px; }
.composer textarea { display:block; font-size:var(--chat-font-size); line-height:var(--chat-line-height); min-height:52px; margin-bottom:8px; }
.composer-box > .attachment-preview:empty { display:none; }
#modelMenu { width:auto; }
.model-default { padding:6px 12px 0; }
.model-choice.selected { color:#eee; background:#353535; }
.effort-header .active { color:#62aaff; }
.codex-popover > .panel-button { display:flex; align-items:center; gap:10px; border-radius:8px; }
#mediaMenu { width:240px; }
.queued-messages { margin:0 10px -1px; position:relative; z-index:0; }
.queued-messages[hidden] { display:none; }
.queued-message { display:flex; gap:6px; align-items:center; min-height:42px; background:#2d2d2d; border:1px solid #3b3b3b; border-bottom:0; border-radius:16px 16px 0 0; padding:5px 12px 5px 25px; position:relative; color:#a7a7a7; }
.queued-message + .queued-message { border-radius:0; }
/* Continue the final queue frame underneath the composer's rounded corners. */
.queued-message:last-child::after { content:''; position:absolute; top:100%; left:-1px; right:-1px; height:24px; background:inherit; border-left:inherit; border-right:inherit; pointer-events:none; }
.composer-box { position:relative; z-index:1; }
.queued-message-label { border:0; background:transparent; color:#d4d4d4; min-width:0; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:left; font-size:13px; line-height:20px; padding:0; }
.chat-action { display:inline-flex; align-items:center; gap:5px; border:0; border-radius:12px; background:transparent; color:#aaa; padding:4px; }
.chat-action:hover,.queue-menu-item:hover { background:#383838; color:#eee; }
.chat-action .codex-icon svg { width:17px; height:17px; }
.queue-steer { font-size:13px; line-height:20px; white-space:nowrap; padding:3px 6px; background:transparent; }
.queue-menu { position:fixed; inset:auto; margin:0; background:#303030; color:#ddd; border:1px solid #444; border-radius:14px; padding:8px; min-width:245px; box-shadow:0 12px 40px #0006; }
.queue-menu-item { display:flex; align-items:center; gap:8px; width:100%; background:transparent; border:0; color:inherit; padding:9px; text-align:left; }
.chat-dialog { border:1px solid #414141; border-radius:18px; padding:18px; background:#222; color:#ddd; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); }
.chat-dialog::backdrop { background:#000b; }
.dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:12px; }
.message-attachments { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.message-attachment { display:flex; flex-direction:column; gap:5px; justify-content:center; align-items:center; width:100px; height:100px; padding:0; border:1px solid #353535; border-radius:14px; overflow:hidden; background:#202020; color:#aaa; font-size:11px; }
.message-attachment img { width:100%; height:100%; object-fit:cover; }
.message-attachment span:not(.codex-icon) { max-width:95%; overflow:hidden; text-overflow:ellipsis; }
.message.user:has(.message-attachments) { background:transparent; padding:0; }
.message.user:has(.message-attachments) .message-body { background:#2a2a2a; border-radius:20px; padding:14px 18px; }
.message.user:has(.message-attachments) .message-body:empty { display:none; }
.attachment-dialog { width:min(1000px,calc(100vw - 24px)); }
.attachment-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:14px; }
.attachment-full { display:block; width:100%; max-height:75dvh; object-fit:contain; }
iframe.attachment-full { height:75dvh; border:0; }
.attachment-text { max-height:70dvh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; padding:12px; }
.attachment-download { display:inline-block; margin-top:12px; color:#bbb; }
.turn-changes { margin-top:18px; border:1px solid #383838; border-radius:16px; overflow:hidden; background:#252525; font-size:14px; }
.turn-changes-head { display:flex; align-items:center; gap:12px; padding:16px; }
.turn-changes-head > .codex-icon { width:44px; height:44px; background:#1d1d1d; border-radius:12px; }
.changes-title { flex:1; }
.diff-stats { display:flex; gap:5px; font-size:13px; margin-top:4px; }
.diff-added { color:#79be8c; }
.diff-deleted { color:#dc765d; }
.task-diff-viewer { min-width:0; min-height:0; overflow:auto; background:var(--bg); position:relative; }
.task-diff-viewer[hidden] { display:none; }
.task-diff-file { min-width:100%; width:max-content; margin:0 0 16px; }
.task-diff-heading { display:flex; align-items:center; gap:8px; padding:12px; background:var(--panel); border-bottom:1px solid var(--line); cursor:pointer; font-size:13px; }
.task-diff-heading::before { content:'›'; }
.task-diff-file[open] > .task-diff-heading::before { transform:rotate(90deg); }
.task-diff-heading::-webkit-details-marker { display:none; }
.task-diff-path { flex:1; }
.task-diff-file.selected > .task-diff-heading { box-shadow:inset 3px 0 #69aaff; }
.task-diff-lines { width:100%; border-collapse:collapse; font:12px/1.65 ui-monospace,Consolas,monospace; tab-size:4; }
.task-diff-lines td { padding:0 8px; border:0; white-space:pre; }
.task-diff-number { width:1%; min-width:38px; text-align:right; color:#858585; user-select:none; }
.task-diff-code { color:#ccc; }
.task-diff-line.added { background:#203b2a; }
.task-diff-line.deleted { background:#482728; }
.task-diff-line.added .task-diff-code { color:#a3d6ad; }
.task-diff-line.deleted .task-diff-code { color:#efb0a6; }
.task-diff-line.note, .task-diff-hunk { background:#292929; color:#929292; }
.task-diff-lines .task-diff-hunk td { padding:6px 8px; }
.changes-view { border:1px solid #3d3d3d; border-radius:12px; background:#282828; color:#ccc; padding:8px 12px; }
.changes-undo { display:flex; align-items:center; gap:6px; font-size:13px; }
.turn-changes-list { background:#2c2c2c; }
.turn-changed-file { display:flex; gap:7px; width:100%; padding:12px 16px; border:0; background:transparent; font:inherit; text-align:left; color:#aaa; }
.turn-changed-file > :first-child { flex:1; overflow-wrap:anywhere; }
.changes-more { display:flex; gap:6px; align-items:center; width:100%; padding:12px 16px; border:0; border-top:1px solid #353535; background:#252525; color:#ccc; }
.changes-dialog { width:min(1000px,calc(100vw - 24px)); }
.file-diff { margin-bottom:12px; }
.file-diff summary { padding:10px; background:#303030; }
.file-diff pre { overflow:auto; max-height:60dvh; padding:12px; font-size:12px; }
@media(max-width:720px) {
  .window-chat { --chat-font-size:16px; }
  /* Keep mobile browsers from zooming the page when focusing the composer. */
  .composer textarea { font-size:16px; }
  .codex-toolbar { display:grid; grid-template-columns:22px auto minmax(0,1fr) 24px 30px; gap:1px; }
  .codex-toolbar::after { content:none; }
  .codex-toolbar [popovertarget="effortMenu"] { grid-column:3; grid-row:1; width:100%; margin-left:0; min-width:0; gap:2px; padding-inline:2px; }
  .codex-toolbar > :first-child { grid-column:1; grid-row:1; }
  .codex-toolbar [popovertarget="accessMenu"] { grid-column:2; grid-row:1; min-width:0; justify-self:start; }
  .codex-toolbar .voice-button { grid-column:4; grid-row:1; margin-left:0; }
  .codex-toolbar .send-button,.codex-toolbar .stop-task { grid-column:5; grid-row:1; margin-left:0; }
  .codex-toolbar [popovertarget="modelMenu"],.codex-toolbar [popovertarget="effortMenu"],.codex-toolbar [popovertarget="accessMenu"] { font-size:11px; }
  .codex-toolbar [popovertarget="accessMenu"] { max-width:125px; }
  .codex-toolbar .panel-button { padding:3px 4px; }
  .composer-box { padding:6px; }
  .queued-messages { margin:0 6px -1px; }
  .queue-steer { font-size:0; padding:5px; }
  .turn-changes-head { gap:8px; padding:12px; flex-wrap:wrap; }
  .turn-changes-head > .codex-icon { width:34px; height:34px; }
  .changes-view { margin-left:auto; font-size:11px; padding:7px; }
}

.queue-drag-handle { position:absolute; left:7px; top:50%; transform:translateY(-50%); display:grid; grid-template-columns:repeat(2,2px); gap:2px; align-content:center; justify-content:center; width:12px; height:24px; padding:0; border:0; background:transparent; color:#aaa; opacity:0; cursor:grab; touch-action:none; }
.queue-drag-handle span { width:2px; height:2px; border-radius:50%; background:currentColor; }
.queued-message:hover .queue-drag-handle,.queue-drag-handle:focus-visible { opacity:1; }
.queue-drag-handle:disabled { cursor:default; opacity:0; }
.queued-message.queue-dragging { opacity:.6; outline:1px solid #6caaff; }
.queue-drag-handle:active { cursor:grabbing; }
.pending-message-actions { display:flex; gap:6px; margin-top:6px; }
.queued-send-error { color:#e6a77e; font-size:12px; overflow:hidden; text-overflow:ellipsis; }
