/* Интерфейс myclaude. Размеры и цвета сняты с отрисованного claude.ai (getComputedStyle), шрифты и токены — из его CSS. */
:root {
  --mc-sidebar-w: 288px;
  --mc-bg: #fff;
  --mc-side-bg: #fafafa;
  --mc-input-bg: #fff;
  --mc-text: rgba(0, 0, 0, .9);
  --mc-text-2: rgba(0, 0, 0, .6);
  --mc-text-3: rgba(0, 0, 0, .45);
  --mc-hover: rgba(0, 0, 0, .05);
  --mc-select: rgba(0, 0, 0, .1);
  --mc-line: rgba(0, 0, 0, .1);
  --mc-line-soft: rgba(0, 0, 0, .08);
  --mc-bubble: rgba(11, 11, 11, .05);
  --mc-card: #fff;
  --mc-ring: rgba(0, 0, 0, .15);
  --mc-code-text: #14181f;
  --mc-inline-code-bg: rgba(0, 0, 0, .05);
  --mc-accent: #d97757;
  --mc-brand: #c6613f;
  --mc-danger: #b3261e;
  --mc-link: #1a5fb4;
  --mc-serif: var(--font-anthropic-serif, ui-serif), Georgia, serif;
  --mc-sans: var(--font-anthropic-sans, system-ui), system-ui, sans-serif;
  --mc-mono: "anthropic-mono", ui-monospace, monospace, "SF Mono", Menlo, Consolas, monospace;
  --mc-radius-composer: 14px;
}
[data-mode=dark] {
  --mc-bg: var(--cds-surface-1, #262624);
  --mc-side-bg: var(--cds-surface-2, #1f1e1d);
  --mc-input-bg: var(--cds-surface-3, #30302e);
  --mc-text: rgba(255, 255, 255, .93);
  --mc-text-2: rgba(255, 255, 255, .57);
  --mc-text-3: rgba(255, 255, 255, .4);
  --mc-hover: rgba(255, 255, 255, .06);
  --mc-select: rgba(255, 255, 255, .1);
  --mc-line: rgba(255, 255, 255, .12);
  --mc-line-soft: rgba(255, 255, 255, .09);
  --mc-bubble: rgba(255, 255, 255, .07);
  --mc-card: var(--cds-surface-3, #30302e);
  --mc-ring: rgba(255, 255, 255, .18);
  --mc-code-text: #e8e6e3;
  --mc-inline-code-bg: rgba(255, 255, 255, .08);
  --mc-link: #7fb2ff;
  --mc-danger: #ff8a80;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--mc-bg); color: var(--mc-text); font-family: var(--mc-sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ibtn { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--mc-text-2); flex: none; }
.ibtn:hover { background: var(--mc-hover); color: var(--mc-text); }
.ibtn[disabled] { opacity: .4; pointer-events: none; }
.sbtn { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--mc-text-2); flex: none; }
.sbtn:hover { background: var(--mc-hover); color: var(--mc-text); }
.sbtn svg.i { width: 16px; height: 16px; }

/* ---------- каркас ---------- */
#app { display: flex; height: 100%; }
.sidebar { width: var(--mc-sidebar-w); flex: none; background: var(--mc-side-bg); display: flex; flex-direction: column; height: 100%; border-inline-end: 1px solid var(--mc-line); transition: margin .2s ease; z-index: 30; font-size: 14px; }
.sidebar.collapsed { margin-inline-start: calc(-1 * var(--mc-sidebar-w)); }
.side-top { height: 44px; display: flex; align-items: center; padding: 0 8px; gap: 8px; flex: none; }
.wordmark { font-family: var(--cds-font-voice, var(--mc-serif)); font-size: 20px; font-weight: 500; line-height: 1; color: var(--mc-text); text-decoration: none; }
.side-nav { padding: 4px 8px 0; display: flex; flex-direction: column; gap: 2px; flex: none; }
.row { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 8px; border-radius: 8px; width: 100%; color: var(--mc-text); font-size: 14px; font-weight: 435; text-align: start; text-decoration: none; position: relative; min-width: 0; }
.row svg.i { color: var(--mc-text-2); }
.row:hover, .row.menu-open { background: var(--mc-hover); }
.row.active { background: var(--mc-select); }
.row span.t { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
.side-label { padding: 22px 16px 6px; font-size: 13px; color: var(--mc-text-2); flex: none; display: flex; align-items: center; gap: 6px; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.chat-list > * { flex-shrink: 0; }
.chat-list .row { padding-inline-start: 10px; }
.chat-list .more { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; opacity: 0; border-radius: 6px; }
.row:hover .more, .row.menu-open .more { opacity: 1; }
.row:hover span.t, .row.menu-open span.t { mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.side-empty { padding: 8px 12px; color: var(--mc-text-3); font-size: 13px; }
.side-search { margin: 6px 8px 0; height: 32px; padding: 0 10px; border-radius: 8px; border: 0; outline: 0; background: var(--mc-input-bg); box-shadow: inset 0 0 0 1px var(--mc-line); font-size: 14px; width: calc(100% - 16px); }
.side-bottom { flex: none; padding: 8px; display: flex; align-items: center; gap: 4px; min-height: 56px; }
.login-btn { flex: 1; height: 36px; border-radius: 8px; background: var(--mc-text); color: var(--mc-bg); font-size: 14px; font-weight: 500; }
.login-btn:hover { opacity: .88; }
.account-pill { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; cursor: default; user-select: none; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--mc-select); color: var(--mc-text); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; flex: none; text-transform: uppercase; }
.account-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; position: relative; background: var(--mc-bg); }
.topbar { height: 48px; display: flex; align-items: center; padding: 0 12px; gap: 4px; flex: none; border-bottom: 1px solid transparent; transition: border-color .15s; }
.topbar.scrolled { border-bottom-color: var(--mc-line-soft); }
.topbar .spacer { flex: 1; }
.title-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; font-size: 14px; font-weight: 435; max-width: min(60vw, 520px); }
.title-btn:hover { background: var(--mc-hover); }
.title-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-btn svg.i { width: 16px; height: 16px; color: var(--mc-text-2); }
.title-input { font-size: 14px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--mc-line); background: var(--mc-input-bg); width: min(60vw, 420px); outline: none; }
.sidebar-open-btn { display: none; }
.sidebar.collapsed ~ .main .sidebar-open-btn { display: inline-flex; }
.sidebar-scrim { display: none; }

/* ---------- главная (/new) ---------- */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 16px 14vh; min-height: 0; overflow-y: auto; }
.greeting { display: flex; align-items: center; gap: 14px; font-family: var(--cds-font-voice, var(--mc-serif)); font-size: 2.375rem; font-weight: 330; line-height: 1.2; text-align: center; margin-bottom: 28px; }
.greeting svg { width: 1.05em; height: 1.05em; flex: none; }
.greeting svg path, .dialog .logo svg path { fill: var(--mc-accent) !important; }
.home .composer-wrap { width: 100%; max-width: 40rem; }

/* ---------- чат ---------- */
.scroller { flex: 1; min-height: 0; overflow-y: auto; }
.thread { max-width: 48rem; margin: 0 auto; padding: 8px 16px 28px; display: flex; flex-direction: column; gap: 24px; }
.dock { flex: none; padding: 0 16px 8px; }
.dock .composer-wrap { max-width: 48rem; margin: 0 auto; }

.msg-user { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 100%; position: relative; margin-top: 8px; }
.user-bubble { background: var(--mc-bubble); border-radius: 12px; padding: 12px 16px; max-width: min(100%, 85%); font-size: 16px; line-height: 22px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .15s; color: var(--mc-text-3); }
.msg-user .msg-actions { justify-content: flex-end; margin-top: -2px; }
.msg-time { font-size: 12px; color: var(--mc-text-3); margin-inline-end: 4px; white-space: nowrap; }
.msg-user:hover .msg-actions, .msg-assistant:hover .msg-actions, .msg-actions.always { opacity: 1; }
@media (hover: none) { .msg-actions { opacity: 1; } }
.edit-box { width: 100%; background: var(--mc-input-bg); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--mc-ring); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.edit-box textarea { width: 100%; resize: none; border: 0; outline: 0; background: transparent; font-size: 16px; line-height: 22px; min-height: 48px; max-height: 40vh; }
.edit-box .btns { display: flex; justify-content: flex-end; gap: 8px; }
.btn { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 14px; box-shadow: inset 0 0 0 1px var(--mc-line); }
.btn:hover { background: var(--mc-hover); }
.btn.primary { background: var(--mc-text); color: var(--mc-bg); box-shadow: none; }
.btn.primary:hover { opacity: .88; }
.btn.danger { background: #c0392b; color: #fff; box-shadow: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.msg-assistant { display: flex; flex-direction: column; gap: 12px; font-family: var(--mc-serif); font-size: 16px; line-height: 22px; min-width: 0; }
.msg-assistant > .msg-actions { font-family: var(--mc-sans); margin-top: -2px; }

/* ---------- markdown ---------- */
.md { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.md p, .md li { overflow-wrap: anywhere; }
.md h1, .md h2, .md h3, .md h4 { font-weight: 600; line-height: 26.4px; margin: 12px 0 -4px; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; } .md h3, .md h4 { font-size: 16px; }
.md ul, .md ol { padding-inline-start: 30px; margin: 0; display: grid; gap: 0; }
.md ul { list-style: disc; } .md ul ul { list-style: circle; } .md ul ul ul { list-style: square; }
.md ol { list-style: decimal; } .md ol ol { list-style: lower-alpha; }
.md li { padding-inline-start: 7.5px; }
.md li > ul, .md li > ol { margin-top: 0; }
.md li::marker { color: var(--mc-text-2); }
.md li input[type=checkbox] { margin-inline-end: .5em; }
.md a { color: var(--mc-link); text-decoration: underline; text-underline-offset: 2px; }
.md strong { font-weight: 600; }
.md blockquote { margin: 0 0 0 8px; padding-inline-start: 16px; border-inline-start: 4px solid var(--mc-line); color: var(--mc-text-2); }
.md hr { border: 0; border-top: 1px solid var(--mc-line); width: 100%; margin: 8px 0; }
.md code:not(pre code) { font-family: var(--mc-mono); font-size: 13.5px; padding: 1px 4px; border-radius: 4px; background: var(--mc-inline-code-bg); color: var(--mc-text); line-height: inherit; }
.md table { border-collapse: collapse; width: 100%; font-family: var(--mc-sans); font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { padding: 8px 16px 8px 0; text-align: start; border-bottom: 1px solid color-mix(in srgb, var(--mc-text) 30%, transparent); vertical-align: top; }
.md th { font-weight: 600; border-bottom-color: color-mix(in srgb, var(--mc-text) 60%, transparent); }
.md img { max-width: 100%; border-radius: 10px; }
.codeblock { position: relative; border-radius: 12px; background: var(--mc-card); box-shadow: inset 0 0 0 1px var(--mc-line-soft); font-family: var(--mc-sans); }
.codeblock .cb-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0 16px; font-size: 12px; color: var(--mc-text-3); }
.codeblock .cb-copy { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; color: var(--mc-text-2); opacity: 0; transition: opacity .15s; }
.codeblock:hover .cb-copy, .codeblock .cb-copy:focus-visible { opacity: 1; }
@media (hover: none) { .codeblock .cb-copy { opacity: 1; } }
.codeblock .cb-copy:hover { background: var(--mc-hover); color: var(--mc-text); }
.codeblock.nolang .cb-head { position: absolute; top: 6px; right: 6px; padding: 0; }
.codeblock.nolang .cb-head span { display: none; }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 22.75px; color: var(--mc-code-text); }
.codeblock .cb-head + pre { padding-top: 4px; }
.codeblock code { font-family: var(--mc-mono); background: none !important; color: inherit; padding: 0 !important; font-size: inherit; display: block; }
/* подсветка: свой префикс tok-, чтобы не пересекаться с темой hljs из CSS claude.ai */
.tok-comment, .tok-quote { color: #7a8394; font-style: italic; }
.tok-keyword, .tok-selector-tag, .tok-literal, .tok-doctag, .tok-name { color: #a626a4; }
.tok-string, .tok-regexp, .tok-addition { color: #1a7f37; }
.tok-number, .tok-built_in, .tok-type, .tok-attr, .tok-symbol, .tok-bullet, .tok-variable, .tok-template-variable { color: #b35900; }
.tok-title, .tok-section, .tok-function .tok-title { color: #1f5fbf; }
.tok-meta, .tok-params { color: inherit; }
.tok-deletion { color: var(--mc-danger); }
[data-mode=dark] .tok-comment, [data-mode=dark] .tok-quote { color: #8b93a3; }
[data-mode=dark] .tok-keyword, [data-mode=dark] .tok-selector-tag, [data-mode=dark] .tok-literal, [data-mode=dark] .tok-name { color: #e58ad9; }
[data-mode=dark] .tok-string, [data-mode=dark] .tok-regexp, [data-mode=dark] .tok-addition { color: #7bd69b; }
[data-mode=dark] .tok-number, [data-mode=dark] .tok-built_in, [data-mode=dark] .tok-type, [data-mode=dark] .tok-attr, [data-mode=dark] .tok-symbol, [data-mode=dark] .tok-variable { color: #ffb067; }
[data-mode=dark] .tok-title, [data-mode=dark] .tok-section { color: #7fb2ff; }

/* ---------- шаги (команды, размышления) ---------- */
.stepgroup { font-family: var(--mc-sans); font-size: 15px; line-height: 22px; }
.stepgroup > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--mc-text-2); padding: 2px 0; }
.stepgroup > summary::-webkit-details-marker { display: none; }
.stepgroup > summary:hover { color: var(--mc-text); }
.stepgroup .car { width: 10px; height: 10px; flex: none; transition: transform .15s; }
.stepgroup[open] > summary .car { transform: rotate(90deg); }
.steps { margin-top: 8px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--mc-line-soft); overflow: hidden; font-size: 14px; line-height: 20px; }
.step + .step { border-top: 1px solid var(--mc-line-soft); }
.step > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--mc-text-2); min-width: 0; }
.step > summary::-webkit-details-marker { display: none; }
.step > summary:hover { color: var(--mc-text); }
.step .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.step .car { width: 9px; height: 9px; flex: none; transition: transform .15s; color: var(--mc-text-3); }
.step[open] > summary .car { transform: rotate(90deg); }
.step.err > summary .v { color: var(--mc-danger); }
.step .body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.io { background: var(--mc-bubble); border-radius: 8px; padding: 8px 12px 10px; }
.io .lbl { font-size: 13px; color: var(--mc-text-2); margin-bottom: 2px; }
.io pre { margin: 0; font-family: var(--mc-mono); font-size: 13px; line-height: 19px; white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow: auto; color: var(--mc-code-text); }
.step .spin, .stepgroup .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--mc-line); border-top-color: var(--mc-text-2); animation: spin .8s linear infinite; flex: none; }
.thinking-text { white-space: pre-wrap; color: var(--mc-text-2); font-family: var(--mc-serif); font-size: 15px; line-height: 22px; }
.msg-error { font-family: var(--mc-sans); font-size: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--mc-danger) 10%, transparent); color: var(--mc-danger); }
.msg-stopped { font-family: var(--mc-sans); font-size: 13px; color: var(--mc-text-3); }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--mc-text-3); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- композер ---------- */
.composer-wrap { position: relative; }
.composer { background: var(--mc-input-bg); border-radius: var(--mc-radius-composer); padding: 8px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 4px 20px rgba(0, 0, 0, .035), inset 0 0 0 1px var(--mc-ring); transition: box-shadow .15s; cursor: text; }
.composer:focus-within { box-shadow: 0 4px 20px rgba(0, 0, 0, .06), inset 0 0 0 1px color-mix(in srgb, var(--mc-text) 35%, transparent); }
.composer textarea { width: 100%; resize: none; border: 0; outline: 0; background: transparent; padding: 3.5px 6px; font-size: 16px; line-height: 21px; max-height: 40vh; min-height: 28px; overflow-y: hidden; }
.composer textarea::placeholder { color: rgb(135, 135, 135); }
.comp-row { display: flex; align-items: flex-end; gap: 4px; }
.comp-row .grow { flex: 1; min-width: 0; }
.comp-bar { display: flex; align-items: center; justify-content: space-between; }
.send-btn { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--mc-text-3); }
.send-btn.ready { background: var(--mc-brand); color: #fff; }
.send-btn.ready:hover { filter: brightness(1.06); }
.send-btn[disabled] { pointer-events: none; }
.send-btn.stop { background: var(--mc-text); color: var(--mc-bg); }
.pending { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 4px; }
.comp-below { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 0; min-height: 36px; font-size: 13px; color: var(--mc-text-2); }
.comp-below .disclaimer { flex: 1; text-align: center; color: var(--mc-text-3); font-size: 13px; }
.comp-below.on-home { justify-content: flex-end; }
.comp-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.model-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 8px; font-size: 13px; color: var(--mc-text-2); white-space: nowrap; }
.model-btn:hover { background: var(--mc-hover); color: var(--mc-text); }
.model-btn b { font-weight: 500; color: var(--mc-text); }
.model-btn svg.i { width: 14px; height: 14px; }
.drop-hint { position: absolute; inset: 8px; border: 2px dashed var(--mc-accent); border-radius: 20px; background: color-mix(in srgb, var(--mc-bg) 85%, transparent); display: none; align-items: center; justify-content: center; z-index: 50; font-size: 18px; pointer-events: none; }
.main.dragging .drop-hint { display: flex; }

/* ---------- вложения ---------- */
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.att-img { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; display: block; box-shadow: inset 0 0 0 1px var(--mc-line); cursor: zoom-in; transition: filter .15s; }
.att-img:hover { filter: brightness(.94); }
.file-tile { width: 120px; height: 120px; border-radius: 12px; background: var(--mc-card); box-shadow: inset 0 0 0 1px var(--mc-line); padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between; text-align: start; cursor: pointer; overflow: hidden; }
.file-tile:hover { background: var(--mc-hover); }
.ft-name { font-size: 13px; line-height: 17px; color: var(--mc-text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-all; }
.ft-badge { align-self: flex-start; font-size: 11px; font-weight: 500; letter-spacing: .02em; padding: 2px 6px; border-radius: 6px; background: var(--mc-bubble); color: var(--mc-text-2); text-transform: uppercase; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 28px 6px 10px; border-radius: 10px; background: var(--mc-bubble); font-size: 13px; cursor: pointer; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.img { padding: 0; width: 64px; height: 64px; overflow: hidden; }
.chip.img img { width: 100%; height: 100%; object-fit: cover; }
.chip .x { position: absolute; top: 4px; inset-inline-end: 4px; width: 18px; height: 18px; border-radius: 50%; background: #000a; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.chip .x svg.i { width: 12px; height: 12px; }
.chip.img .x { top: 3px; inset-inline-end: 3px; }
.chip .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--mc-line); border-top-color: var(--mc-text-2); animation: spin .8s linear infinite; }
.chip .broken { font-size: 11px; padding: 4px; word-break: break-all; color: var(--mc-text-2); }
.rot-90 { transform: rotate(90deg); } .rot-270 { transform: rotate(-90deg); }
.ibtn.on { background: var(--mc-select); color: var(--mc-text); }

.preview { width: 0; flex: none; overflow: hidden; background: var(--mc-bg); border-inline-start: 0 solid var(--mc-line); display: flex; flex-direction: column; height: 100%; transition: width .2s ease; }
.preview.open { width: min(46vw, 680px); border-inline-start-width: 1px; }
.preview-scrim { display: none; }
.pv-head { height: 48px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--mc-line-soft); min-width: 0; }
.pv-tabs { display: flex; gap: 2px; flex: none; }
.pv-title { flex: 1; min-width: 0; display: flex; gap: 6px; font-size: 14px; padding-inline: 4px; }
.pv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-ext { color: var(--mc-text-3); flex: none; }
.pv-btn { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; box-shadow: inset 0 0 0 1px var(--mc-line); }
.pv-btn:hover { background: var(--mc-hover); }
.pv-body { flex: 1; min-height: 0; overflow: auto; }
.pv-doc { padding: 28px 32px 48px; font-family: var(--mc-serif); font-size: 16px; line-height: 22px; }
.pv-code { margin: 0; padding: 18px 20px 32px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; font-family: var(--mc-mono); color: var(--mc-code-text); }
.pv-code code { background: none; color: inherit; }
.pv-note { padding: 40px 28px; text-align: center; color: var(--mc-text-2); font-size: 14.5px; }
.pv-frame { width: 100%; height: 100%; border: 0; background: #fff; }
@media (max-width: 1100px) {
  .preview { position: fixed; inset: 0 0 0 auto; z-index: 60; width: 0; }
  .preview.open { width: min(100vw, 560px); box-shadow: -10px 0 40px #00000040; }
  .preview-scrim.open { display: block; position: fixed; inset: 0; z-index: 55; background: #0005; }
}
.lightbox { position: fixed; inset: 0; z-index: 95; background: #000d; display: flex; flex-direction: column; animation: fade .12s ease-out; }
.lb-bar { height: 52px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px; color: #fff; }
.lb-bar .ibtn { color: #fffc; } .lb-bar .ibtn:hover { background: #ffffff22; color: #fff; }
.lb-title { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 56px 24px; }
.lb-stage img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; box-shadow: 0 10px 50px #0008; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #ffffff1f; }
.lb-nav:hover { background: #ffffff38; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }

/* ---------- меню и попапы ---------- */
.popover { position: fixed; z-index: 80; min-width: 200px; max-width: 320px; background: var(--mc-bg); border-radius: 12px; padding: 6px; box-shadow: 0 8px 30px #00000026, inset 0 0 0 1px var(--mc-line); }
.popover .item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 14px; text-align: start; }
.popover .item:hover { background: var(--mc-hover); }
.popover .item.danger { color: var(--mc-danger); }
.popover .item .d { color: var(--mc-text-3); font-size: 12.5px; }
.popover .item .tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.popover .item .check { margin-inline-start: auto; color: var(--mc-accent); }
.popover .p-label { padding: 6px 10px 4px; font-size: 12px; color: var(--mc-text-3); }
.popover .p-sep { height: 1px; margin: 6px 4px; background: var(--mc-line); }
.popover .item[aria-checked=true] { background: var(--mc-hover); }
.overlay { position: fixed; inset: 0; z-index: 90; background: #00000066; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .12s ease-out; }
.dialog { width: 100%; max-width: 380px; background: var(--mc-bg); border-radius: 18px; padding: 28px 24px 22px; box-shadow: 0 20px 60px #0000004d, inset 0 0 0 1px var(--mc-line); }
.dialog h2 { margin: 0 0 4px; font-family: var(--cds-font-voice, var(--mc-serif)); font-weight: 400; font-size: 1.6rem; text-align: center; }
.dialog .sub { margin: 0 0 20px; text-align: center; color: var(--mc-text-2); font-size: 14px; }
.dialog .logo { display: flex; justify-content: center; margin-bottom: 10px; }
.dialog .logo svg { width: 34px; height: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--mc-text-2); }
.field input { height: 40px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--mc-input-bg); box-shadow: inset 0 0 0 1px var(--mc-ring); outline: none; font-size: 15px; }
.field input:focus { box-shadow: inset 0 0 0 2px var(--mc-accent); }
.form-error { color: var(--mc-danger); font-size: 13.5px; margin: -4px 0 12px; }
.dialog .btn.primary { width: 100%; height: 40px; font-size: 15px; font-weight: 500; }
.dialog .row-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.dialog p.msg { margin: 0; font-size: 15px; line-height: 1.5; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 120; max-width: min(92vw, 520px); padding: 10px 16px; border-radius: 12px; background: var(--mc-text); color: var(--mc-bg); font-size: 14px; box-shadow: 0 8px 30px #0003; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }

/* ---------- мобильная версия ---------- */
@media (max-width: 767px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); box-shadow: 0 0 40px #0000004d; transform: translateX(0); transition: transform .2s ease; margin: 0 !important; }
  .sidebar.collapsed { transform: translateX(-105%); box-shadow: none; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; background: #0006; z-index: 25; }
  .sidebar.collapsed ~ .sidebar-scrim { display: none; }
  .sidebar-open-btn { display: inline-flex !important; }
  .greeting { font-size: 1.9rem; }
  .home { justify-content: flex-start; padding-top: 22vh; }
  .thread { padding-inline: 14px; }
  .lb-stage { padding: 0 8px 16px; } .lb-nav { display: none; }
  .comp-below .disclaimer { display: none; }
  .comp-below { justify-content: space-between; }
}

/* ---------- файлы, выданные Claude ---------- */
.out-files { display: flex; flex-direction: column; gap: 8px; font-family: var(--mc-sans); }
.attach-row.start { justify-content: flex-start; }
.out-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--mc-bubble); cursor: pointer; max-width: 100%; }
.out-card:hover { background: var(--mc-select); }
.fc-ic { width: 40px; height: 40px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, #2a78d6 14%, transparent); color: #2a78d6; }
.fc-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fc-name { font-size: 15px; font-weight: 500; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-sub { font-size: 13px; line-height: 18px; color: var(--mc-text-2); }
.dl-all { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 14px; background: var(--mc-bubble); }
.dl-all:hover { background: var(--mc-select); }
.dl-all svg.i { width: 16px; height: 16px; }

/* ---------- уточнения по замерам ---------- */
.comp-row .send-btn { width: 28px; height: 28px; }
.home .composer-wrap { max-width: 41.125rem; }
.home .composer textarea { min-height: 52px; }
.home .composer { padding-bottom: 8px; }

/* ---------- иконки оригинала (шрифт Anthropicons) ---------- */
#app [data-cds=Icon], .popover [data-cds=Icon], .lightbox [data-cds=Icon], .dialog [data-cds=Icon], .toast [data-cds=Icon] { color: inherit; }
.sbtn [data-cds=Icon], .cb-copy [data-cds=Icon], .dl-all [data-cds=Icon] { font-size: calc(1rem * var(--cds-rem-scale, 1)) !important; }
.title-btn [data-cds=Icon], .model-btn [data-cds=Icon] { font-size: calc(.875rem * var(--cds-rem-scale, 1)) !important; }
.row [data-cds=Icon] { color: var(--mc-text-2); }
.row .more [data-cds=Icon] { color: var(--mc-text-2); }
.stepgroup .car, .step .car { font-size: calc(.75rem * var(--cds-rem-scale, 1)) !important; color: var(--mc-text-3); transition: transform .15s; }
.send-btn [data-cds=Icon] { font-size: calc(1.25rem * var(--cds-rem-scale, 1)) !important; }
.chip .x [data-cds=Icon] { font-size: calc(.75rem * var(--cds-rem-scale, 1)) !important; }
.side-label [data-cds=Icon] { transform: rotate(90deg); }

/* подпись статуса: многоточие у длинной мысли (overflow-x: clip его не рисует) */
.msg-assistant [data-cds=ShimmerText] { overflow: hidden !important; text-overflow: ellipsis; }

/* ---------- плоские шаги и итог хода ---------- */
.stepgroup.flat > summary { color: var(--mc-text-2); }
.stepgroup.flat.err > summary { color: var(--mc-danger); }
.flat-body { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 20px; }
.stepgroup > summary .car { margin-inline-start: 2px; }
.live-steps { margin-top: 0; }
.live-steps .step > summary .running { font-size: 14px; }
.turn-stats { display: flex; align-items: center; gap: 8px; font-family: var(--mc-sans); font-size: 14px; line-height: 20px; color: var(--mc-text-3); padding-inline-start: 4px; }
.turn-stats .rest { width: 20px; height: 20px; flex: none; overflow: hidden; position: relative; color: var(--cds-clay); }
.turn-stats .rest span { display: block; position: absolute; left: 0; width: 20px; background-size: 100% 100%; background-repeat: no-repeat; }
.status-time { color: var(--mc-text-3); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }

/* ---------- заголовок: название + стрелка меню ---------- */
.title-split { display: inline-flex; align-items: center; min-width: 0; max-width: min(60vw, 520px); }
.title-split .title-btn { cursor: text; }
.title-more { width: 24px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--mc-text-2); flex: none; }
.title-more:hover { background: var(--mc-hover); color: var(--mc-text); }
.ft-badge { background: none; box-shadow: inset 0 0 0 1px var(--mc-line); border-radius: 999px; padding: 1px 8px; font-weight: 400; }

/* заголовок мысли/шага в строке — в одну строку с многоточием */
.stepgroup > summary > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepgroup > summary { max-width: 100%; }

/* ---------- вопрос Claude с вариантами ответа ---------- */
.ask-card { font-family: var(--mc-sans); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--mc-line); background: var(--mc-card); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 16px; }
.ask-card.done { background: transparent; padding: 12px 16px; gap: 10px; }
.ask-q { display: flex; flex-direction: column; gap: 8px; }
.ask-h { font-size: 12px; color: var(--mc-text-3); text-transform: uppercase; letter-spacing: .03em; }
.ask-text { font-size: 15px; line-height: 21px; color: var(--mc-text); }
.ask-card.done .ask-text { color: var(--mc-text-2); font-size: 14px; }
.ask-answer { font-size: 15px; color: var(--mc-text); }
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-opt { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; padding: 8px 14px; border-radius: 8px; background: var(--mc-bubble); font-size: 14px; line-height: 20px; max-width: 100%; }
.ask-opt:hover { background: var(--mc-select); }
.ask-opt.on { background: var(--mc-text); color: var(--mc-bg); }
.ask-opt .ask-d { font-size: 12.5px; opacity: .65; }
.ask-opt[disabled] { opacity: .5; pointer-events: none; }
.ask-other { height: 36px; padding: 0 12px; border-radius: 8px; border: 0; outline: 0; background: var(--mc-input-bg); box-shadow: inset 0 0 0 1px var(--mc-line); font-size: 14px; max-width: 420px; }
.ask-other:focus { box-shadow: inset 0 0 0 1px var(--mc-text-3); }
.ask-actions { display: flex; gap: 8px; }
.ask-actions .btn { width: auto; }

.step-meta { font-family: var(--cds-font-mono, ui-monospace, monospace); font-size: .875em; background: none; padding: 0; color: inherit; opacity: .85; }
.web-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.web-links li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.web-links a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.web-links a:hover { text-decoration: underline; }
.web-links .host { flex: none; font-size: .8125rem; opacity: .6; }
