:root {
  --bg: #F7F5F0;
  --bg-elev: #FFFFFF;
  --bg-sunk: #EFECE4;
  --text: #1F1E1C;
  --text-2: #6B6862;
  --text-3: #9C988F;
  --line: rgba(31, 30, 28, 0.10);
  --accent: #C96442;
  --accent-soft: rgba(201, 100, 66, 0.12);
  --on-accent: #fff;
  --fab-shadow: rgba(201, 100, 66, 0.35);
  --user-bubble: #E9E4D8;
  --danger: #D1453B;
  --ok: #3E8E5A;
  --code-bg: #F0EDE6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --vvh: 100dvh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1B19;
    --bg-elev: #262522;
    --bg-sunk: #151413;
    --text: #F2EFE8;
    --text-2: #A8A39A;
    --text-3: #77736B;
    --line: rgba(242, 239, 232, 0.10);
    --accent: #E07A55;
    --accent-soft: rgba(224, 122, 85, 0.16);
    --user-bubble: #34322E;
    --code-bg: #121110;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body { position: fixed; inset: 0; overflow: hidden; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

#app { position: absolute; inset: 0; height: var(--vvh); display: flex; flex-direction: column; }

/* ---------- screens ---------- */

.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; animation: fade-in 0.18s ease-out; }

@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.topbar {
  flex: none;
  padding: calc(var(--safe-top) + 6px) 8px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line);
  z-index: 5;
}

.topbar .title { flex: 1; min-width: 0; text-align: center; }
.topbar .title h1 { margin: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.large { flex-direction: column; align-items: stretch; padding-bottom: 10px; }
.topbar.large .row { display: flex; justify-content: space-between; align-items: center; min-height: 36px; }
.topbar.large h1 { margin: 2px 8px 0; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 20px;
  display: inline-grid; place-items: center; flex: none;
  color: var(--accent);
}
.icon-btn:active { background: var(--accent-soft); }
.icon-btn svg { width: 24px; height: 24px; }
.text-btn { color: var(--accent); font-size: 17px; padding: 8px 10px; border-radius: 10px; }
.text-btn:active { background: var(--accent-soft); }

.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; min-height: 0; }

/* ---------- login / profile ---------- */

.center-card {
  margin: auto; width: min(420px, 100% - 32px);
  padding: calc(var(--safe-top) + 24px) 0 calc(var(--safe-bottom) + 24px);
  display: flex; flex-direction: column; gap: 14px;
}
.center-card .logo { width: 72px; height: 72px; border-radius: 18px; align-self: center; box-shadow: var(--shadow); }
.center-card h2 { text-align: center; margin: 6px 0 0; font-size: 26px; }
.center-card p { text-align: center; color: var(--text-2); margin: 0 0 6px; }

.field {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  border: 0.5px solid var(--line); background: var(--bg-elev);
  font-size: 17px; outline: none;
}
.field:focus { border-color: var(--accent); }

.primary-btn {
  width: 100%; padding: 15px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 17px;
}
.primary-btn:disabled { opacity: 0.5; }
.primary-btn:active { filter: brightness(0.92); }
.secondary-btn { width: 100%; padding: 14px; border-radius: 14px; background: var(--bg-elev); border: 0.5px solid var(--line); font-weight: 500; }

.error-text { color: var(--danger); text-align: center; font-size: 15px; min-height: 20px; }

.profile-list { display: flex; flex-direction: column; gap: 10px; }
.profile-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--bg-elev); border-radius: 16px; border: 0.5px solid var(--line); text-align: left;
}
.profile-item:active { background: var(--bg-sunk); }
.avatar {
  width: 44px; height: 44px; border-radius: 22px; flex: none;
  display: grid; place-items: center; font-weight: 600; color: white; font-size: 18px;
}

/* ---------- chat list ---------- */

.search-wrap { padding: 0 8px; margin-top: 8px; }
.search {
  width: 100%; padding: 9px 12px 9px 34px; border-radius: 11px; border: 0;
  background: var(--bg-sunk); font-size: 16px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239C988F' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center; background-size: 16px;
}

.section-label { padding: 18px 20px 6px; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }

.chat-list { list-style: none; margin: 0; padding: 0 0 calc(var(--safe-bottom) + 96px); }
.chat-item { display: flex; gap: 12px; align-items: center; padding: 11px 16px 11px 20px; position: relative; }
.chat-item:active { background: var(--bg-sunk); }
.chat-item + .chat-item::before { content: ""; position: absolute; top: 0; left: 20px; right: 0; border-top: 0.5px solid var(--line); }
.chat-item .body { flex: 1; min-width: 0; }
.chat-item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .meta { font-size: 14px; color: var(--text-2); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.chat-item .time { font-size: 14px; color: var(--text-3); flex: none; align-self: flex-start; padding-top: 2px; }
.chip { font-size: 12px; padding: 1px 7px; border-radius: 8px; background: var(--bg-sunk); color: var(--text-2); }
.live-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.empty { text-align: center; color: var(--text-2); padding: 60px 24px; }
.empty .big { font-size: 44px; margin-bottom: 8px; }

.fab {
  position: absolute; right: 18px; bottom: calc(var(--safe-bottom) + 20px);
  height: 54px; padding: 0 22px 0 18px; border-radius: 27px;
  background: var(--accent); color: var(--on-accent); font-weight: 600;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 20px var(--fab-shadow);
}
.fab svg { width: 22px; height: 22px; }
.fab:active { transform: scale(0.97); }

/* ---------- chat ---------- */

.messages { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 6px; }
.load-older { align-self: center; font-size: 14px; color: var(--accent); padding: 8px 14px; }

.msg { max-width: 100%; animation: fade-in 0.15s ease-out; }
.msg.user { align-self: flex-end; max-width: 84%; }
.msg.user .bubble {
  background: var(--user-bubble); padding: 9px 14px; border-radius: var(--radius); border-bottom-right-radius: 6px;
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.user .attachments { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 4px; }
.msg.user .attachments img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }

.msg.assistant { align-self: stretch; padding: 2px 4px; }
.msg.assistant .md { overflow-wrap: anywhere; }
.msg.error .md { color: var(--danger); }

.md p { margin: 0.35em 0; }
.md p:first-child { margin-top: 0; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0.35em 0; padding-left: 1.3em; }
.md li { margin: 0.15em 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 0.8em 0 0.3em; line-height: 1.25; }
.md h1 { font-size: 1.3em; } .md h2 { font-size: 1.18em; } .md h3, .md h4 { font-size: 1.05em; }
.md a { color: var(--accent); text-decoration: none; }
.md code { font: 0.86em/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; }
.md pre { background: var(--code-bg); padding: 10px 12px; border-radius: 12px; overflow-x: auto; margin: 0.5em 0; }
.md pre code { background: none; padding: 0; font-size: 13px; }
.md blockquote { margin: 0.5em 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--text-2); }
.md table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 15px; margin: 0.5em 0; }
.md th, .md td { border: 0.5px solid var(--line); padding: 5px 9px; text-align: left; }
.md hr { border: 0; border-top: 0.5px solid var(--line); margin: 1em 0; }
.md img { max-width: 100%; border-radius: 10px; }

/* tool pills */
.tools { display: flex; flex-direction: column; gap: 4px; align-self: stretch; }
.tool {
  align-self: flex-start; max-width: 100%;
  border-radius: 12px; background: var(--bg-elev); border: 0.5px solid var(--line);
  font-size: 14px; overflow: hidden;
}
.tool > summary {
  list-style: none; display: flex; align-items: center; gap: 7px; padding: 6px 11px; cursor: pointer;
  color: var(--text-2); white-space: nowrap; overflow: hidden;
}
.tool > summary::-webkit-details-marker { display: none; }
.tool > summary .label { overflow: hidden; text-overflow: ellipsis; }
.tool > summary .label b { color: var(--text); font-weight: 500; }
.tool .status { flex: none; width: 15px; height: 15px; display: grid; place-items: center; }
.tool .status.ok { color: var(--ok); }
.tool .status.err { color: var(--danger); }
.tool .status.run::after {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--text-3); border-top-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tool[open] { align-self: stretch; }
.tool .detail { padding: 0 11px 10px; display: flex; flex-direction: column; gap: 6px; }
.tool .detail .k { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.tool pre {
  margin: 0; background: var(--code-bg); border-radius: 9px; padding: 8px 10px; max-height: 280px; overflow: auto;
  font: 12px/1.45 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; word-break: break-word;
}
.tool .detail .md { font-size: 15px; }

.thinking > summary { font-style: italic; }

.compact-note, .sys-note { align-self: center; font-size: 13px; color: var(--text-3); padding: 4px 10px; text-align: center; }

/* permission / question cards */
.card {
  align-self: stretch; background: var(--bg-elev); border-radius: 18px; border: 1px solid var(--accent);
  padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
}
.card .card-title { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.card .card-desc { color: var(--text-2); font-size: 15px; }
.card pre {
  margin: 0; background: var(--code-bg); border-radius: 10px; padding: 9px 11px; max-height: 220px; overflow: auto;
  font: 12.5px/1.45 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; word-break: break-word;
}
.card .actions { display: flex; gap: 8px; }
.card .actions button { flex: 1; padding: 12px; border-radius: 12px; font-weight: 600; }
.btn-allow { background: var(--accent); color: var(--on-accent); }
.btn-deny { background: var(--bg-sunk); }
.card .question { display: flex; flex-direction: column; gap: 8px; }
.card .question + .question { border-top: 0.5px solid var(--line); padding-top: 10px; }
.card .q-text { font-weight: 500; }
.card .options { display: flex; flex-direction: column; gap: 6px; }
.option {
  text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--bg-sunk);
  border: 1.5px solid transparent; display: flex; flex-direction: column; gap: 2px;
}
.option .od { font-size: 13px; color: var(--text-2); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.card .plan { max-height: 340px; overflow: auto; padding: 4px 2px; }
.card.resolved { border-color: var(--line); opacity: 0.7; box-shadow: none; }

/* typing indicator */
.typing { align-self: flex-start; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; padding: 6px 4px; }
.typing .dots { display: inline-flex; gap: 4px; }
.typing .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite ease-in-out; }
.typing .dots i:nth-child(2) { animation-delay: 0.15s; }
.typing .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* composer */
.composer {
  flex: none; padding: 8px 10px calc(var(--safe-bottom) + 8px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--line);
}
body.keyboard .composer { padding-bottom: 8px; }
.composer .pending-files { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.composer .pf { position: relative; flex: none; }
.composer .pf img, .composer .pf .file {
  width: 60px; height: 60px; border-radius: 12px; object-fit: cover; background: var(--bg-elev);
  border: 0.5px solid var(--line); display: grid; place-items: center; font-size: 11px; text-align: center; padding: 4px; overflow: hidden;
}
.composer .pf .rm {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 11px;
  background: var(--text); color: var(--bg); font-size: 14px; line-height: 22px; text-align: center;
}
.composer .pf.uploading img, .composer .pf.uploading .file { opacity: 0.5; }
.composer .row { display: flex; align-items: flex-end; gap: 6px; }
.composer .input-wrap {
  flex: 1; min-width: 0; background: var(--bg-elev); border: 0.5px solid var(--line); border-radius: 22px;
  display: flex; align-items: flex-end; padding: 0 4px 0 14px;
}
.composer textarea {
  flex: 1; border: 0; outline: none; resize: none; background: transparent;
  padding: 10px 0; max-height: 40vh; font-size: 17px; line-height: 1.35;
}
.composer .send {
  width: 34px; height: 34px; border-radius: 17px; margin: 5px 0; flex: none;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
}
.composer .send:disabled { background: var(--text-3); opacity: 0.45; }
.composer .send svg { width: 18px; height: 18px; }
.composer .send.stop { background: var(--text); color: var(--bg); }
.composer .attach { width: 40px; height: 44px; display: grid; place-items: center; color: var(--text-2); flex: none; }
.composer .attach svg { width: 26px; height: 26px; }
.composer .model-row { display: flex; gap: 6px; padding: 0 4px 6px; overflow-x: auto; }
.composer .pill {
  font-size: 13px; padding: 4px 10px; border-radius: 13px; background: var(--bg-elev);
  border: 0.5px solid var(--line); color: var(--text-2); white-space: nowrap; display: inline-flex; gap: 4px; align-items: center;
}
.composer .pill b { color: var(--text); font-weight: 500; }

/* ---------- sheets ---------- */

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 50; animation: bd-in 0.2s ease-out; }
@keyframes bd-in { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-height: 86vh; overflow-y: auto; background: var(--bg);
  border-radius: 16px 16px 0 0; padding: 8px 16px calc(var(--safe-bottom) + 16px);
  animation: sheet-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: 0.5; margin: 0 auto 10px; }
.sheet h3 { margin: 4px 4px 12px; font-size: 20px; }
.sheet .group { background: var(--bg-elev); border-radius: 14px; overflow: hidden; margin-bottom: 16px; border: 0.5px solid var(--line); }
.sheet .group-label { font-size: 13px; color: var(--text-2); margin: 0 6px 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.sheet .opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; text-align: left; }
.sheet .opt + .opt { border-top: 0.5px solid var(--line); }
.sheet .opt:active { background: var(--bg-sunk); }
.sheet .opt .t { flex: 1; min-width: 0; }
.sheet .opt .d { font-size: 13px; color: var(--text-2); }
.sheet .opt .check { color: var(--accent); width: 22px; flex: none; text-align: center; font-weight: 700; }
.sheet .opt.danger { color: var(--danger); }

/* ---------- misc ---------- */

#toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 90px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 100; max-width: calc(100% - 40px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

.banner { margin: 8px 12px 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.banner button { color: var(--accent); font-weight: 600; margin-left: auto; }

.conn-bar { text-align: center; font-size: 12px; color: var(--text-2); padding: 3px; background: var(--bg-sunk); }

.settings-list { padding: 12px 16px calc(var(--safe-bottom) + 24px); }
.settings-list .group { background: var(--bg-elev); border-radius: 14px; overflow: hidden; margin-bottom: 22px; border: 0.5px solid var(--line); }
.settings-list .group-label { font-size: 13px; color: var(--text-2); margin: 0 6px 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.settings-list .group-foot { font-size: 13px; color: var(--text-2); margin: -16px 6px 22px; }
.settings-list .opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; text-align: left; }
.settings-list .opt + .opt { border-top: 0.5px solid var(--line); }
.settings-list .opt .t { flex: 1; }
.settings-list .opt .v { color: var(--text-2); }
.settings-list .opt.danger { color: var(--danger); }

/* copy actions */
.msg-actions { display: flex; gap: 4px; margin-top: 4px; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 9px;
  font-size: 13px; color: var(--text-3);
}
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn:active { background: var(--bg-sunk); }
.copy-btn.copied { color: var(--ok); }
.code-wrap { position: relative; }
.code-wrap .copy-btn {
  position: absolute; top: 4px; right: 4px; background: var(--bg-elev); border: 0.5px solid var(--line);
  padding: 4px 7px;
}
.code-wrap .copy-btn span { display: none; }
.code-wrap .copy-btn.copied span { display: inline; }

/* лимиты Claude и режим API (js/usage.js) */
.usage-chip { display: block; width: calc(100% - 24px); margin: 8px 12px 0; padding: 9px 14px; border-radius: 12px; text-align: left; font-size: 14px; line-height: 1.35; background: var(--bg-sunk, rgba(127,127,127,.1)); color: var(--text-2); }
.usage-chip.warn { background: rgba(245, 158, 11, .16); color: #b26a00; }
.usage-chip.crit { background: rgba(209, 69, 59, .16); color: var(--danger); font-weight: 600; }
.usage-chip.api { background: rgba(59, 130, 246, .14); color: #2f6fe0; }
@media (prefers-color-scheme: dark) { .usage-chip.warn { color: #f5b13d; } .usage-chip.api { color: #6ea2f8; } }
.usage-sheet { display: grid; gap: 14px; padding: 4px 4px 8px; }
.usage-row { display: grid; gap: 6px; }
.usage-top { display: flex; justify-content: space-between; font-size: 15px; }
.usage-meter { height: 9px; border-radius: 9px; background: var(--bg-sunk, rgba(127,127,127,.15)); overflow: hidden; }
.usage-meter i { display: block; height: 100%; border-radius: 9px; background: #22c55e; }
.usage-meter i.warn { background: #f59e0b; }
.usage-meter i.crit { background: var(--danger); }
.usage-note { font-size: 12.5px; color: var(--text-2); }
.usage-mode { font-size: 15px; padding: 10px 12px; border-radius: 10px; background: var(--bg-sunk, rgba(127,127,127,.1)); }
.usage-mode.api { background: rgba(59, 130, 246, .14); }
.usage-btn { width: 100%; padding: 13px; border-radius: 12px; font-size: 16px; font-weight: 600; background: var(--bg-sunk, rgba(127,127,127,.12)); }
.usage-btn.primary { background: var(--accent); color: #fff; }
.usage-btn:disabled { opacity: .5; }
.usage-auto { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.usage-auto input { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.usage-hint { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.4; }

/* ---------- ChatGPT look (chatgpt.naershov.com) ---------- */

body.brand-chatgpt {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-sunk: #f4f4f4;
  --text: #0d0d0d;
  --text-2: #5d5d5d;
  --text-3: #8f8f8f;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #0d0d0d;
  --accent-soft: rgba(0, 0, 0, 0.06);
  --on-accent: #fff;
  --fab-shadow: rgba(0, 0, 0, 0.18);
  --user-bubble: #f4f4f4;
  --code-bg: #f9f9f9;
  --radius: 22px;
  font-family: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  body.brand-chatgpt {
    --bg: #212121;
    --bg-elev: #2f2f2f;
    --bg-sunk: #303030;
    --text: #ececec;
    --text-2: #b4b4b4;
    --text-3: #8a8a8a;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #ececec;
    --accent-soft: rgba(255, 255, 255, 0.08);
    --on-accent: #0d0d0d;
    --fab-shadow: rgba(0, 0, 0, 0.4);
    --user-bubble: #303030;
    --code-bg: #171717;
  }
}
body.brand-chatgpt .topbar { border-bottom-color: transparent; }
body.brand-chatgpt .msg.user .bubble { border-bottom-right-radius: var(--radius); padding: 10px 16px; }
body.brand-chatgpt .composer { border-top: 0; }
body.brand-chatgpt .composer .input-wrap { border-radius: 28px; background: var(--bg-sunk); border-color: transparent; padding-left: 16px; }
body.brand-chatgpt .composer .send { width: 36px; height: 36px; border-radius: 18px; }
body.brand-chatgpt .tool { background: transparent; border-color: transparent; }
body.brand-chatgpt .tool > summary { padding-left: 2px; }
body.brand-chatgpt .card { border-color: var(--line); }
body.brand-chatgpt .fab { border-radius: 27px; }
body.brand-chatgpt .center-card .logo { border-radius: 16px; }
body.brand-chatgpt .chip { background: var(--bg-sunk); }
.tool.handoff > summary .label b { font-weight: 500; }

.usage-chip[hidden] { display: none !important; }
