[hidden]{display:none!important}a{color:#9bc6ff}nav{display:flex;align-items:center;flex-wrap:wrap;gap:8px;box-sizing:border-box;width:100%;padding:10px 12px;margin:0 0 24px;background:#141e2e;border:1px solid #334155;border-radius:10px}nav a{display:inline-flex;align-items:center;padding:8px 14px;background:#1c2b42;border:1px solid #334155;border-radius:6px;color:#dde5f1;font-size:14px;line-height:1.2;text-decoration:none;white-space:nowrap}nav a:hover{background:#263c5e;border-color:#7596bf}nav a[aria-current=page]{background:#275194;border-color:#7596bf;font-weight:600}nav .identity{margin-left:auto;font-size:13px;color:#a8bbd3;padding:0 4px}nav button{margin:0;padding:8px 14px;background:#334155;font-size:14px}.login{max-width:440px;margin-top:10vh}.wide{max-width:1280px}.toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.toolbar button{margin:0}.toolbar input,.toolbar select{width:auto;flex:1;min-width:140px}.columns{display:grid;grid-template-columns:minmax(250px,1fr) minmax(300px,2fr);gap:20px}.tree{max-height:65vh;overflow:auto}.tree ul{list-style:none;padding-left:22px}.tree>ul{padding-left:0}.tree button{display:block;text-align:left;background:transparent;margin:2px 0;padding:8px;width:100%;border:1px solid transparent}.tree button:hover,.tree button.selected{background:#263c5e;border-color:#7596bf}.tree details summary{cursor:pointer;padding:6px}.tree .drop-over{outline:2px dashed #93c5fd}.muted{color:#a8bbd3;font-size:13px}.danger{background:#862c39}.secondary{background:#334155}.card{background:#141e2e;border:1px solid #334155;padding:16px;border-radius:8px;margin:12px 0}.card h3{margin:0 0 8px}.badge{display:inline-block;padding:2px 7px;background:#334155;border-radius:5px;font-size:12px}.error{color:#ffd088;white-space:pre-wrap}dialog{width:min(650px,90vw);box-sizing:border-box;background:#182235;color:#dde5f1;border:1px solid #637086;border-radius:12px;max-height:90vh;overflow:auto}dialog::backdrop{background:#0009}dialog form{margin:0}button:focus-visible,a:focus-visible{outline:2px solid #93c5fd;outline-offset:3px}table{width:100%;border-collapse:collapse;font-size:13px}th,td{text-align:left;padding:9px;border-bottom:1px solid #334155;overflow-wrap:anywhere}.table-wrap{overflow:auto}.chat-layout{display:grid;grid-template-columns:285px minmax(0,1fr);gap:20px}.chat-list{max-height:70vh;overflow:auto}.chat-list button{width:100%;text-align:left;margin:4px 0;background:#1c2b42}.chat-list button.selected{background:#275194}.chat-list small{display:block;font-size:12px;margin-top:5px}.codex-transcript{min-height:250px;max-height:58vh;overflow:auto;scrollbar-gutter:stable}.codex-transcript pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#0f172a;padding:12px;border-radius:6px}.codex-transcript .message-assistant{color:#86efac}.codex-transcript .message p{white-space:pre-wrap;overflow-wrap:anywhere}.approval{border-color:#fbbf24}.section-tabs{margin:20px 0}.section-tabs button[aria-selected=true]{background:#4674bc}.empty{padding:25px;color:#a8bbd3;text-align:center}.registry-picker{padding:15px;background:#182235;border-radius:8px}.registry-picker select{max-width:600px}@media(max-width:760px){.columns,.chat-layout{grid-template-columns:1fr}.chat-list{max-height:220px}nav .identity{margin-left:0}.codex-transcript{max-height:55vh}}
.codex-transcript .message-user{color:#d9f99d;border-left-color:#bef264}.codex-transcript .message-user p{color:#d9f99d}.codex-transcript .message-assistant{color:#fff;border-left-color:#fff}.codex-transcript pre{background:#000;color:#d1d5db}
.chat-list .codex-chat-row{position:relative;margin:4px 0}.chat-list .codex-chat-open{margin:0;padding-right:42px}.chat-list .codex-chat-more{position:absolute;right:7px;top:8px;display:grid;place-items:center;width:26px;height:26px;margin:0;padding:0;background:#334155;color:#e2e8f0}.chat-list .codex-chat-more:not(:disabled):hover{background:#475569}.chat-list .codex-chat-more svg,.codex-chat-menu svg{display:block;width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.codex-chat-menu{position:absolute;z-index:6;right:7px;top:40px;display:grid;gap:4px;padding:6px;background:#182235;border:1px solid #637086;border-radius:8px;box-shadow:0 8px 24px #0008}.codex-chat-menu button{display:grid;place-items:center;width:34px;height:34px;margin:0;padding:0;background:#334155;color:#e2e8f0}.codex-chat-menu button:not(:disabled):hover{background:#475569}.codex-chat-menu button.codex-chat-delete:not(:disabled):hover{background:#862c39}.codex-chat-row:last-child .codex-chat-menu{top:auto;bottom:40px}.chat-list .codex-chat-model{color:#fde047}
.codex-chat-actions{display:flex;gap:8px;align-items:center}.codex-chat-actions button{margin:0;white-space:nowrap}.codex-chat-actions+#chat-search{margin-top:12px}
.codex-transcript.codex-transcript-expanded{max-height:100vh}
.codex-transcript-wrap{position:relative;min-width:0}
.codex-scroll-controls{position:absolute;right:22px;top:12px;bottom:12px;z-index:2;display:flex;flex-direction:column;justify-content:space-between;pointer-events:none}
.codex-scroll-controls button{display:grid;place-items:center;width:32px;height:32px;margin:0;padding:0;border:1px solid #63708699;border-radius:6px;background:#24364e73;color:#fff;font-size:18px;line-height:1;pointer-events:auto}
.codex-scroll-controls button:not(:disabled):hover{background:#34547baa}
.codex-scroll-controls button:disabled{opacity:.55;cursor:default}
.codex-transcript .message-other pre,#codex-requests pre{line-height:1.4em;max-height:14em;overflow-y:auto}
.codex-transcript .message-other .codex-code-expanded>pre,#codex-requests .codex-code-expanded>pre{max-height:90vh}
.codex-copy-block{position:relative;min-width:0;padding-bottom:33px;margin:1em 0}.codex-copy-block>p,.codex-copy-block>pre{margin:0}.codex-copy-code{background:#000;border-radius:6px}.codex-copy-button,.codex-expand-button{--copy-bg:#334155;position:absolute;bottom:5px;z-index:1;width:26px;height:26px;margin:0;padding:0;background:var(--copy-bg);color:#e2e8f0}.codex-copy-button{left:6px}.codex-expand-button{left:38px;font-size:19px;line-height:26px}.codex-expand-button::before{content:'⤢'}.codex-code-expanded .codex-expand-button::before{content:'⤡'}.codex-copy-button:hover,.codex-expand-button:hover{--copy-bg:#475569}.codex-copy-button.copied{--copy-bg:#166534}.codex-copy-button.copy-error{--copy-bg:#991b1b}.codex-copy-button::before,.codex-copy-button::after{content:'';position:absolute;width:11px;height:13px;border:1.5px solid currentColor;border-radius:2px}.codex-copy-button::before{left:6px;top:7px}.codex-copy-button::after{left:9px;top:4px;background:var(--copy-bg)}.codex-model-name{color:#fde047;font-weight:700}
.varia-entry{margin:-8px 0 24px}.varia-button{display:inline-block;margin:0;padding:11px 16px;border-radius:5px;background:#235cc3;color:#fff;text-decoration:none}.varia-button:hover{background:#3470d7}.varia-button[aria-disabled=true]{opacity:.5;pointer-events:none}.varia-button:focus-visible{outline:3px solid #93c5fd;outline-offset:3px}.varia-body{background:#fff7ef;color:#613f46;color-scheme:light}.varia-page{max-width:1000px;margin:32px auto;padding:0 20px 40px}.varia-back{color:#7b4358;text-decoration:none;font-weight:600}.varia-back:hover{text-decoration:underline}.varia-card{margin-top:18px;padding:clamp(20px,5vw,54px);background:#fffdf9;border:1px solid #f4d8d4;border-radius:24px;box-shadow:0 20px 60px #a15c5030;text-align:center}.varia-card h1{font-size:clamp(32px,5vw,56px);margin:8px 0 12px;color:#9a4d65}.varia-kicker{color:#b56a7c;font-weight:700;letter-spacing:.04em}.varia-wish{max-width:640px;margin:0 auto 30px;font-size:clamp(17px,2vw,21px);line-height:1.6}.varia-card img{display:block;width:100%;height:auto;border-radius:16px}
.limits{padding:12px 14px;border:1px solid #334155;background:#111c2d;border-radius:8px;margin:12px 0;font-size:13px}.limit-row+.limit-row{border-top:1px solid #334155;margin-top:8px;padding-top:8px}.limit-window{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:5px 0}.limit-window meter{width:130px;height:12px}.limits small{font-size:11px}.limits p{margin:4px 0}

.context-menu{position:fixed;z-index:1000;min-width:210px;max-width:95vw;max-height:90vh;overflow:auto;padding:6px;background:#141e2e;border:1px solid #7596bf;border-radius:8px;box-shadow:0 8px 28px #0008}.context-menu button{display:block;width:100%;margin:0;text-align:left;background:transparent}.context-menu button:hover,.context-menu button:focus{background:#263c5e}.breadcrumbs{display:flex;flex-wrap:wrap;align-items:center;gap:4px}.breadcrumbs button{margin:0;padding:4px;background:transparent;color:#9bc6ff;font-size:13px}

.codex-compose-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin:10px 0}.codex-compose-actions button{margin:0}.codex-compose-actions .mode-switch{margin-left:auto}
.codex-thinking-char{white-space:pre}

.model-card{padding:1rem;border:1px solid #ccd4df;border-radius:8px;margin:1rem 0}.model-card h3{margin-top:0}.model-card p{overflow-wrap:anywhere}
.backup-changes{white-space:pre-wrap;min-width:220px;max-width:450px}.backup-actions{display:flex;flex-wrap:wrap;gap:6px}.backup-actions button{margin:0;padding:7px 10px}#backup-settings{max-width:480px}#backup-job p{margin:8px 0}

.attachment-composer{border:1px dashed #637086;border-radius:8px;padding:12px;margin:10px 0}.attachment-composer.attachment-drop{background:#203e60;border-color:#93c5fd}.attachment-drafts,.attachment-history{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.attachment-file{display:flex;flex-direction:column;gap:5px;border:1px solid #334155;padding:10px;border-radius:7px;max-width:220px;overflow-wrap:anywhere}.attachment-file img{width:160px;height:110px;object-fit:contain;background:#0f172a;border-radius:4px}.attachment-file button{margin:0;padding:6px 10px}.attachment-file a{word-break:break-word}
.codex-prompt-wrap{position:relative}.codex-prompt-wrap textarea{display:block;margin:5px 0 0;padding-right:46px;padding-bottom:42px}
/* Пустое сообщение об ошибке не должно оставлять пустую полосу между стенограммой и окном сообщения. */
#portal-error:empty{margin:0}.codex-prompt-wrap.attachment-drop textarea{background:#203e60;border-color:#93c5fd}.codex-prompt-wrap .codex-attachment-add{position:absolute;right:10px;bottom:10px;display:grid;place-items:center;width:28px;height:28px;margin:0;padding:0;background:#334155;color:#e2e8f0}.codex-prompt-wrap .codex-attachment-add:hover{background:#475569}.codex-attachment-add svg,.attachment-remove svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.codex-attachment-drafts:empty{display:none}.attachment-drafts .attachment-file{position:relative;padding-right:36px}.attachment-drafts .attachment-remove{position:absolute;right:6px;top:6px;z-index:1;display:grid;place-items:center;width:26px;height:26px;margin:0;padding:0;background:#334155;color:#e2e8f0;opacity:0;pointer-events:none;transition:opacity .15s}.attachment-drafts .attachment-file:hover .attachment-remove,.attachment-drafts .attachment-file:focus-within .attachment-remove{opacity:1;pointer-events:auto}.attachment-drafts .attachment-remove:not(:disabled):hover{background:#862c39}@media(hover:none){.attachment-drafts .attachment-remove{opacity:1;pointer-events:auto}}

/* Codex dialogue sidebar stays in view; only its dialogue list scrolls. */
.chat-layout{grid-template-columns:minmax(320px,360px) minmax(0,1fr)}
.codex-chat-sidebar{position:sticky;top:16px;align-self:start;display:flex;flex-direction:column;box-sizing:border-box;height:calc(100vh - 32px);height:calc(100dvh - 32px);min-height:0;padding:16px;background:#141e2e;border:1px solid #334155;border-radius:8px;overflow-x:hidden;overflow-y:auto}
.codex-chat-sidebar h1{flex:none;margin:0 0 20px}
.codex-chat-sidebar .codex-chat-actions,.codex-chat-sidebar #chat-search{flex:none}
.codex-chat-sidebar .codex-chat-actions button{padding-inline:12px}
.codex-chat-sidebar .chat-list{flex:1;min-height:80px;max-height:none;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable}
@media(max-width:760px){.chat-layout{grid-template-columns:minmax(0,1fr)}.codex-chat-sidebar{top:0;height:min(45dvh,360px)}.codex-chat-sidebar .chat-list{max-height:none}}

.codex-chat-header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;margin-bottom:20px}
.codex-chat-sidebar .codex-chat-header h1{margin:0}
.codex-chat-header button{flex:none;display:grid;place-items:center;width:32px;height:32px;margin:0;padding:0;font-size:25px;line-height:1}
.codex-chat-sidebar #chat-search{align-self:flex-start;max-width:100%}
.chat-layout.sidebar-collapsed{grid-template-columns:52px minmax(0,1fr)}
.sidebar-collapsed .codex-chat-sidebar{height:auto;padding:8px;overflow:visible}
.sidebar-collapsed .codex-chat-header{margin:0}
.sidebar-collapsed .codex-chat-header h1,.sidebar-collapsed .codex-chat-sidebar>.codex-chat-actions,.sidebar-collapsed .codex-chat-sidebar>#chat-search,.sidebar-collapsed .codex-chat-sidebar>.chat-list{display:none}
@media(max-width:760px){.chat-layout.sidebar-collapsed{grid-template-columns:1fr}.sidebar-collapsed .codex-chat-sidebar{width:52px}}

.codex-copy-block{display:grid;grid-template-columns:26px 26px minmax(0,1fr);column-gap:6px;row-gap:12px;padding-bottom:0;margin-bottom:0}
.codex-copy-block>p,.codex-copy-block>pre{grid-column:1/-1}
.codex-copy-block>.codex-copy-button,.codex-copy-block>.codex-expand-button{position:relative;bottom:auto;left:auto;grid-row:2}
.codex-copy-block>.codex-copy-button{grid-column:1}
.codex-copy-block>.codex-expand-button{grid-column:2}
.codex-transcript .codex-copy-code{grid-template-columns:12px 26px 6px 26px minmax(0,1fr);column-gap:0;padding-bottom:12px}
.codex-transcript .codex-copy-code>pre{padding-bottom:0}
.codex-transcript .codex-copy-code>.codex-copy-button{grid-column:2}
.codex-transcript .codex-copy-code>.codex-expand-button{grid-column:4}
.codex-model-name{cursor:pointer}
.codex-model-name:focus-visible{outline:2px solid #93c5fd;outline-offset:3px;border-radius:2px}
.codex-compose-actions .mode-switch{color:#22c55e}
.codex-compose-actions .mode-switch input{accent-color:#22c55e}
.codex-transcript>.message:first-child{margin-top:0}
.chat-layout>section>header{margin-bottom:16px}
.codex-opening,.backup-opening{position:fixed;z-index:1001;top:50%;left:50%;transform:translate(-50%,-50%);box-sizing:border-box;width:min(340px,calc(100vw - 32px));padding:18px 20px;border:1px solid #637086;border-radius:10px;background:#182235;color:#dde5f1;box-shadow:0 12px 40px #000a;pointer-events:none}
.codex-opening progress,.backup-opening progress{display:block;width:100%;height:12px;margin-top:12px;accent-color:#2563eb}
.codex-thinking:disabled{opacity:1}
.codex-chat-sidebar .chat-list{min-height:0}
.codex-sidebar-status{flex:none;display:grid;gap:5px;margin-top:12px;padding-top:12px;border-top:1px solid #334155;line-height:1.4;overflow-wrap:anywhere}
.codex-sidebar-status meter{display:inline-block;width:3.5rem;height:.65rem;vertical-align:middle;margin-right:.25rem}
.codex-resource-high{color:#ff6b6b}
.sidebar-collapsed .codex-chat-sidebar>.codex-sidebar-status{display:none}
@media(max-width:760px){.codex-chat-sidebar{height:min(65dvh,480px);min-height:340px}}
/* Панель диалога Codex: тот же вид и та же высота, что у панели со списком диалогов. */
.chat-layout>section{position:sticky;top:16px;align-self:start;display:flex;flex-direction:column;box-sizing:border-box;height:calc(100vh - 32px);height:calc(100dvh - 32px);min-height:0;margin:0;padding:16px;background:#141e2e;border:1px solid #334155;border-radius:8px;overflow-x:hidden;overflow-y:auto}
.chat-layout>section>header,.chat-layout>section>form,.chat-layout>section>#codex-requests{flex:none}
.chat-layout>section>.codex-transcript-wrap{flex:1;min-height:0;display:flex;flex-direction:column}
.chat-layout>section .codex-transcript{flex:1;min-height:120px;max-height:none}
@media(max-width:760px){.chat-layout>section{position:static;height:auto;max-height:none;overflow:visible}
.chat-layout>section .codex-transcript{min-height:250px;max-height:55vh}}
/* Пиктограммы кнопок панели ввода заданы в CSS: анимация «Думаю…» перерисовывает текст кнопки и не стирает их. */
.codex-compose-actions button{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
.codex-compose-actions button svg{flex:none;display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* Пиктограммы кнопок панели диалогов: та же рисовка, что у кнопок панели ввода. */
.codex-chat-actions button{display:inline-flex;align-items:center;gap:7px}
.codex-chat-actions button svg,.codex-chat-header button svg{flex:none;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.codex-chat-actions button svg{width:15px;height:15px}
.codex-chat-header button svg{width:18px;height:18px;transition:transform .15s}
.sidebar-collapsed .codex-chat-header button svg{transform:rotate(180deg)}
/* Маркер изменения высоты поля сообщения перенесён в правый верхний угол: собственный уголок
   заменяет системный нижний, который перекрывал кнопку вложений. */
.codex-prompt-wrap textarea{resize:none;min-height:72px}
/* Поле «Сообщение»: белые рамка и текст ввода, светло-жёлтая подпись. */
.codex-prompt-wrap textarea{border-color:#fff}
label[for=codex-prompt]{color:#fde047}
.codex-prompt-wrap .codex-prompt-resize{position:absolute;top:8px;right:10px;z-index:2;display:grid;place-items:center;width:22px;height:22px;margin:0;padding:0;background:transparent;border:0;border-radius:4px;color:#7d8ea6;cursor:ns-resize;touch-action:none}
.codex-prompt-wrap .codex-prompt-resize:hover,.codex-prompt-wrap .codex-prompt-resize:focus-visible{background:#243049;color:#cbd5e1}
.codex-prompt-resize svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
body.codex-prompt-resizing{cursor:ns-resize}
body.codex-prompt-resizing .codex-prompt-wrap textarea{user-select:none}
/* Панель диалога: подросшее поле ввода сжимает стенограмму (у неё своя минимальная высота),
   а не накладывается на соседние блоки; сама панель при нехватке места прокручивается. */
.chat-layout>section>form{flex:0 0 auto}
/* Кнопки панели ввода: привычные роли — красный стоп, нейтральное копирование,
   зелёное сохранение, фиолетовая смена модели; «Отправить» остаётся основной синей. */
.codex-compose-actions #stop-chat{background:#b91c1c}
.codex-compose-actions #stop-chat:not(:disabled):hover{background:#dc2626}
.codex-compose-actions #codex-copy{background:#0e7490}
.codex-compose-actions #codex-copy:not(:disabled):hover{background:#0891b2}
.codex-compose-actions #codex-save{background:#15803d}
.codex-compose-actions #codex-save:not(:disabled):hover{background:#16a34a}
.codex-compose-actions #change-model{background:#6d28d9}
.codex-compose-actions #change-model:not(:disabled):hover{background:#7c3aed}

/* Кнопки запроса подтверждения кода: принятые цвета панели — разрешение зелёное, отказ красный, предупреждение янтарное, отмена серая. */
.card.approval .approval-allow{background:#15803d}
.card.approval .approval-allow:not(:disabled):hover{background:#16a34a}
.card.approval .approval-allow-all{background:#166534}
.card.approval .approval-allow-all:not(:disabled):hover{background:#15803d}
.card.approval .approval-deny{background:#b91c1c}
.card.approval .approval-deny:not(:disabled):hover{background:#dc2626}
.card.approval .approval-warn{background:#b45309}
.card.approval .approval-warn:not(:disabled):hover{background:#d97706}
.card.approval .approval-cancel{background:#334155}
.card.approval .approval-cancel:not(:disabled):hover{background:#475569}

/* Ответы Codex: markdown рендерится настоящими элементами в палитре панели (раньше были видны «##», «**» и палки «|»). */
.codex-copy-block>.codex-md{grid-column:1/-1}
.codex-md>*:first-child{margin-top:0}
.codex-md>*:last-child{margin-bottom:0}
.codex-md p{margin:.5em 0;white-space:pre-wrap;overflow-wrap:anywhere}
.codex-md h3,.codex-md h4,.codex-md h5,.codex-md h6{margin:.9em 0 .4em;line-height:1.3;font-weight:700;color:#fff}
.codex-md h3{font-size:17px}
.codex-md h4{font-size:16px}
.codex-md h5,.codex-md h6{font-size:15px}
.codex-md ul,.codex-md ol{margin:.5em 0;padding-left:1.5em}
.codex-md li{margin:.25em 0}
.codex-md blockquote{margin:.6em 0;padding:.1em .9em;border-left:3px solid #475569;color:#cbd5e1;white-space:pre-wrap}
.codex-md hr{margin:1em 0;border:none;border-top:1px solid #334155}
.codex-md a{color:#9bc6ff}
.codex-md code{background:#0f172a;padding:1px 5px;border-radius:4px;color:#dde5f1}
.codex-md-table{overflow-x:auto;margin:.85em 0}
.codex-md-table table{width:auto;min-width:100%}
.codex-md-table th,.codex-md-table td{white-space:normal;vertical-align:top}
.codex-md-table thead th{background:#1c2b42;color:#dde5f1;font-weight:600;border-bottom:1px solid #334155}
.codex-md-table tbody tr:last-child td{border-bottom:none}
.codex-md-table code{background:#0f172a;padding:1px 5px;border-radius:4px;color:#dde5f1}
