.sidebar { position: relative; }
.refresh-line { flex: 0 0 100%; display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); }
.explorer-head { flex-wrap: wrap; }
.refresh-line button { white-space: nowrap; font-size: 10px; padding: 3px 5px; background: transparent; border: 1px solid var(--line); color: #75beff; }
#gitRefreshStatus { color: #75beff; overflow-wrap: anywhere; }
.commit-row { position: relative; border-left: 1px solid #569cd6; margin-left: 7px; width: calc(100% - 7px); }
.commit-row::before { content: ''; position: absolute; left: -4px; top: 10px; width: 7px; height: 7px; background: #569cd6; border-radius: 50%; }
.commit-refs { grid-column: 1 / -1; justify-self: start; background: #264f78; color: #cce7ff; border-radius: 8px; padding: 2px 6px; font-size: 10px; overflow-wrap: anywhere; }
.git-tab { grid-template-rows: auto auto auto auto minmax(240px, 1fr) minmax(80px, .3fr); }
.git-columns { grid-template-rows: minmax(60px, .35fr) minmax(160px, 1fr); }
@media (max-height: 650px) { .git-tab { overflow-y: auto; } }
.explorer-head { align-items: flex-start; }
.explorer-head #filesPath { flex: 1 1 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; padding: 5px 3px; font-size: 11px; line-height: 1.6; }
#filesPath button { display: inline; border: 0; padding: 0; background: transparent; color: var(--text); font: inherit; text-align: left; overflow-wrap: anywhere; }
#filesPath button:hover { color: #75beff; text-decoration: underline; }
#filesPath .path-root { color: var(--muted); }
.chat-panel { position: relative; }
.sidebar-sash { position: absolute; z-index: 8; top: 0; bottom: 0; right: -3px; width: 6px; cursor: col-resize; touch-action: none; }
.pane-sash { display: none; position: absolute; z-index: 8; top: 0; bottom: 0; left: calc(var(--split-x) - 3px); width: 6px; cursor: col-resize; touch-action: none; }
.sidebar-sash:hover, .pane-sash:hover, .sidebar-sash:focus-visible, .pane-sash:focus-visible { background: #0078d4; }
.resizing-panels { user-select: none; }
.movable-header { cursor: grab; touch-action: none; }
.movable-header button { cursor: pointer; }
.dock-overlay { display: none; position: absolute; inset: 0; z-index: 50; pointer-events: none; }
.layout { position: relative; }
.layout.docking .dock-overlay { display: block; }
.dock-zone { position: absolute; display: grid; place-items: center; border: 2px dashed #777; border-radius: 8px; background: #262626dd; color: #ddd; font-size: 15px; }
.dock-left { left: 60px; top: 12px; width: 28%; height: 64%; }
.dock-right { right: 12px; top: 12px; width: 28%; height: 64%; }
.dock-bottom { bottom: 12px; left: 32%; width: 38%; height: 22%; }
.dock-zone.target { border-color: #75beff; background: #0078d477; }
.panel-button { border: 0; border-radius: 5px; padding: 5px 7px; background: transparent; color: #aaa; }
.panel-button:hover { background: #3a3a3a; color: #eee; }
.chat-head > .panel-button { flex: 0 0 auto; font-size: 17px; }
.chat-head .danger-button { font-size: 0; }
.chat-head .danger-button::after { content: "×"; font-size: 18px; }
.chat-tab { position: relative; }
.legacy-actions, .legacy-controls { display: none !important; }
.codex-toolbar { display: flex; gap: 4px; align-items: center; min-width: 0; }
.codex-toolbar > :first-child { font-size: 23px; padding: 2px 5px; }
.codex-toolbar [popovertarget="accessMenu"] { color: #d7ba7d; font-size: 11px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codex-toolbar [popovertarget="accessMenu"] { display: inline-flex; align-items: center; gap: 5px; }
.codex-toolbar [popovertarget="accessMenu"] .access-icon svg { width: 15px; height: 15px; }
.codex-toolbar [popovertarget="modelMenu"] { margin-left: auto; font-size: 11px; text-align: right; min-width: 0; }
.codex-toolbar .send-button { margin-left: 4px; flex: 0 0 30px; }
.codex-toolbar .voice-button { font-size: 0; }
.codex-toolbar .voice-button::first-letter { font-size: 16px; }
.stop-task { width: 30px; height: 30px; flex: 0 0 30px; border: 0; border-radius: 50%; color: #252526; background: #ccc; }
.stop-task:disabled { opacity: .5; }
.composer textarea { min-height: 52px; }
.composer-box { border-radius: 20px; padding: 12px; }
.composer-box.file-drop { outline: 2px dashed #75beff; }
.codex-popover { margin: 0; position: fixed; inset: var(--anchor-top, auto) auto var(--anchor-bottom, 80px) var(--anchor-left, 20px); width: min(500px, calc(100vw - 24px)); max-height: min(560px, calc(100dvh - 100px)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #2b2b2b; color: #ccc; border: 1px solid #414141; border-radius: 16px; padding: 10px; box-shadow: 0 12px 40px #0007; font-size: 13px; }
.codex-popover h3 { margin: 2px 10px 9px; font-size: 12px; font-weight: 400; color: #999; }
.codex-popover > .panel-button, .add-plugins > .panel-button { width: 100%; display: block; text-align: left; padding: 9px 10px; font-size: 13px; }
.codex-popover .choice-row { display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; width: 100%; text-align: left; background: transparent; color: #ccc; border: 0; border-radius: 10px; padding: 10px; }
.choice-row strong { font-size: 13px; font-weight: 500; }
.choice-row small { grid-column: 2; font-size: 11px; margin-top: 3px; color: #999; line-height: 1.45; }
.access-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.choice-row > .access-icon { grid-row: 1 / 3; align-self: center; }
.access-icon svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.choice-row.selected { color: #e3c900; background: #363636; }
.choice-row.selected strong::after { content: " ✓"; }
.choice-row.unavailable { opacity: .5; cursor: not-allowed; }
.model-choices { display: grid; gap: 2px; }
.model-choice { border: 0; border-radius: 6px; background: transparent; text-align: left; padding: 7px 12px; color: #ccc; }
.model-choice.selected { background: #3c3c3c; color: #75beff; }
.model-choice.selected::after { content: " ✓"; float: right; }
#effortMenu { width: min(320px, calc(100vw - 24px)); padding: 14px 15px 16px; border: 0; border-radius: 24px; background: #303030; }
.effort-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 0 0 16px; }
.effort-summary { display: grid; justify-items: center; min-width: 0; }
.effort-header strong { color: #59a6ff; font-size: 16px; line-height: 22px; }
.effort-header > button { padding: 2px; }
.effort-fast { color: #59a6ff; }
.effort-fast .codex-icon svg { fill: currentColor; stroke: none; }
.effort-model { display: inline-flex; align-items: center; gap: 2px; padding: 1px 0 0; color: #999; font-size: 12px; line-height: 18px; }
.effort-model .codex-icon, .effort-model svg { width: 12px; height: 12px; }
.effort-track { position: relative; height: 30px; background: #444; border-radius: 18px; }
.effort-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; border-radius: 18px; background: #59a6ff; pointer-events: none; }
.effort-bubble { position: absolute; top: var(--bubble-y); width: var(--bubble-size); height: var(--bubble-size); border-radius: 50%; background: #c0e0ff; animation: effort-bubbles 3.2s linear infinite; animation-delay: var(--bubble-delay); animation-play-state: paused; }
#effortMenu:popover-open .effort-bubble { animation-play-state: running; }
@keyframes effort-bubbles { from { left: 100%; opacity: .15; } 25%, 75% { opacity: .65; } to { left: -4px; opacity: .15; } }
@media (prefers-reduced-motion: reduce) { #effortMenu .effort-bubble { animation: none; left: 30%; } }
.effort-slider { position: relative; z-index: 1; appearance: none; width: 100%; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 18px; background: transparent; cursor: pointer; }
.effort-slider::-webkit-slider-thumb { appearance: none; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 0 2px #777; }
.effort-slider::-moz-range-thumb { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #fff; }
.effort-ticks { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.effort-ticks button { position: absolute; top: 0; margin-left: -8px; color: #888; font-size: 20px; padding: 0; width: 16px; height: 30px; border: 0; background: transparent; pointer-events: auto; }
.codex-toolbar [popovertarget="effortMenu"] { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; min-width: 0; gap: 5px; border-radius: 18px; padding: 5px 12px; background: #303030; white-space: nowrap; }
.menu-note { display: block; margin: 5px 12px; line-height: 1.4; color: #999; font-size: 11px; }
.add-plugins { color: #999; padding: 2px 8px; font-size: 12px; }
.attachment-preview { gap: 8px; padding-bottom: 4px; }
.attachment-tile { position: relative; flex: 0 0 90px; width: 90px; height: 88px; border: 1px solid #4b4b4b; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.attachment-tile img { width: 100%; height: 100%; object-fit: cover; }
.attachment-name { position: absolute; bottom: 0; left: 0; right: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #222c; font-size: 9px; padding: 3px 4px; }
.attachment-remove { position: absolute; top: 3px; right: 3px; border: 0; border-radius: 50%; background: #ddd; color: #222; width: 19px; height: 19px; padding: 0; }
.file-type { font-size: 13px; color: #75beff; }
.message.assistant .message-body { white-space: normal; }
.message-body p { margin: 0 0 12px; white-space: pre-wrap; }
.message-body ul { padding-left: 22px; margin: 12px 0; }
.message-body li { margin: 3px 0; }
.message-body h2, .message-body h3, .message-body h4 { font-size: 15px; margin: 14px 0 8px; }
.message-body code { background: #333; border-radius: 3px; padding: 1px 4px; font-family: Consolas, monospace; font-size: .93em; }
.message-code { overflow: auto; max-width: 100%; margin: 12px 0; padding: 12px; border: 1px solid #444; border-radius: 8px; background: #191919; white-space: pre; }
.message-code code { background: transparent; padding: 0; }
@media (min-width: 721px) {
  .layout { grid-template-columns: 48px clamp(180px, var(--sidebar-width, 250px), calc(100vw - 168px)) minmax(0, 1fr); }
  .layout[data-sidebar-side="right"] { grid-template-columns: 48px minmax(0, 1fr) clamp(180px, var(--sidebar-width, 250px), calc(100vw - 168px)); }
  .layout[data-sidebar-side="right"] .activity-bar { grid-row: 1; grid-column: 1; }
  .layout[data-sidebar-side="right"] .chat-panel { grid-row: 1; grid-column: 2; }
  .layout[data-sidebar-side="right"] .sidebar { grid-row: 1; grid-column: 3; border-left: 1px solid var(--line); border-right: 0; }
  .layout[data-sidebar-side="right"] .sidebar-sash { right: auto; left: -3px; }
  .layout.sidebar-collapsed { grid-template-columns: 48px minmax(0, 1fr); }
}
@media (min-width: 1101px) {
  .chat-panel:is([data-view="files"],[data-view="git"]) { grid-template-columns: minmax(240px, var(--editor-fraction, .45fr)) minmax(320px, var(--chat-fraction, .55fr)); }
  .chat-panel:is([data-view="files"],[data-view="git"]) .pane-sash { display: block; }
  .chat-panel:is([data-view="files"],[data-view="git"])[data-dock="left"] { grid-template-columns: minmax(320px, var(--chat-fraction, .55fr)) minmax(240px, var(--editor-fraction, .45fr)); }
  .chat-panel:is([data-view="files"],[data-view="git"])[data-dock="left"] .chat-head { grid-column: 1; }
  .chat-panel:is([data-view="files"],[data-view="git"])[data-dock="left"] #chatTab { grid-column: 1; }
  .chat-panel[data-view="files"][data-dock="left"] #filesTab, .chat-panel[data-view="git"][data-dock="left"] #gitTab { grid-column: 2; }
  .chat-panel:is([data-view="files"],[data-view="git"])[data-dock="bottom"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(100px, var(--editor-height, 48%)) 43px minmax(100px, 1fr); }
  .chat-panel:is([data-view="files"],[data-view="git"])[data-dock="bottom"] .chat-head { grid-column: 1; grid-row: 2; }
  .chat-panel:is([data-view="files"],[data-view="git"])[data-dock="bottom"] #chatTab { grid-column: 1; grid-row: 3; }
  .chat-panel[data-view="files"][data-dock="bottom"] #filesTab, .chat-panel[data-view="git"][data-dock="bottom"] #gitTab { grid-column: 1; grid-row: 1; }
  .chat-panel[data-dock="bottom"] .pane-sash { left: 0; right: 0; width: auto; height: 6px; bottom: auto; top: calc(var(--editor-height) - 3px); cursor: row-resize; }
  .chat-panel[data-maximized="true"] { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: 43px minmax(0, 1fr) !important; }
  .chat-panel[data-maximized="true"] :is(#filesTab,#gitTab,#projectsTab,.pane-sash) { display: none !important; }
  .chat-panel[data-maximized="true"] .chat-head { grid-row: 1 !important; grid-column: 1 !important; }
  .chat-panel[data-maximized="true"] #chatTab { display: grid; grid-row: 2 !important; grid-column: 1 !important; }
}
@media (max-width: 1100px) { .movable-header { touch-action: auto; cursor: default; } }
@media (max-width: 720px) {
  .sidebar-sash, .pane-sash { display: none; }
  .codex-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .codex-toolbar > :first-child { grid-column: 1; grid-row: 2; }
  .codex-toolbar [popovertarget="accessMenu"] { grid-column: 2; grid-row: 2; }
  .codex-toolbar [popovertarget="accessMenu"] { max-width: 150px; font-size: 10px; }
  .codex-toolbar [popovertarget="modelMenu"] { grid-column: 3 / 5; grid-row: 2; justify-self: end; text-align: right; font-size: 11px; }
  .codex-toolbar [popovertarget="effortMenu"] { grid-column: 1 / 3; grid-row: 1; justify-self: end; width: min(210px, 100%); min-width: 0; }
  #effortMenu { right: auto; left: var(--anchor-left, 12px); }
  .codex-toolbar .voice-button { grid-column: 3; grid-row: 1; margin-left: auto; }
  .codex-toolbar .send-button { grid-column: 4; grid-row: 1; }
  .codex-popover { left: 12px; right: 12px; bottom: var(--anchor-bottom, 80px); width: auto; max-height: min(460px, 60dvh); }
  .composer-box { padding: 9px; border-radius: 17px; }
  .chat-head > .panel-button { font-size: 15px; padding: 2px 5px; }
  .chat-head > .panel-button[aria-label="Развернуть панель Codex"] { display: none; }
  .attachment-tile { width: 72px; height: 72px; flex-basis: 72px; }
}

.settings-model-view[hidden], .effort-view[hidden] { display: none !important; }
.settings-back { padding: 4px 0 12px; border: 0; background: transparent; color: #aaa; font: inherit; cursor: pointer; }
.settings-model-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.settings-effort-label { color: #999; }
.codex-toolbar .settings-speed-icon svg { fill: currentColor; stroke: none; }
