/* The chat, third round: a side panel with sections and searchable chats, a big field that holds
   files, the model and the price, plain answers and soft bubbles for your messages, menus that open
   where there is room. Loaded after app.css; the phone layout (body.mobile-app) keeps its bars. */

/* ---------- side panel ---------- */
body:not(.mobile-app) .app { grid-template-columns: 17.5rem minmax(0, 1fr); transition: grid-template-columns .25s cubic-bezier(.2, .8, .3, 1); }
body:not(.mobile-app).rail-folded .app { grid-template-columns: 4.1rem minmax(0, 1fr); }
body:not(.mobile-app) .rail { padding: .75rem .65rem .7rem; gap: .2rem; overflow: hidden; }
.rail-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .1rem .55rem .3rem; min-height: 2.6rem; }
body:not(.mobile-app) .rail .logo { height: 2.2rem; margin: 0; }
.rail-fold { width: 2.2rem; height: 2.2rem; border-radius: 9px; border: 0; background: none; color: var(--soft); display: grid; place-items: center; flex: none; }
.rail-fold:hover { background: var(--panel-2); color: var(--text); }
.rail-fold .i { width: 1.2rem; height: 1.2rem; }

.rail-new, .rail-link { display: flex; align-items: center; gap: .65rem; width: 100%; border: 0; background: none; border-radius: 10px; padding: .48rem .55rem; color: var(--text); font-weight: 600; font-size: .95rem; text-align: left; white-space: nowrap; transition: background-color .15s ease, color .15s ease; position: relative; }
.rail-new { font-weight: 700; margin-bottom: .35rem; }
.rail-new-ico { width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent-fill); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: transform .2s ease; }
.rail-new-ico .i { width: 1.05rem; height: 1.05rem; stroke-width: 2.5; }
.rail-new:hover { background: var(--panel-2); }
.rail-new:hover .rail-new-ico { transform: rotate(90deg); }
.rail-link { color: var(--soft); }
.rail-link > .i { width: 1.15rem; height: 1.15rem; margin: 0 .3rem 0 .28rem; }
.rail-link:hover { background: var(--panel-2); color: var(--text); }
.rail-link.on { background: var(--hover); color: var(--text); }
.rail-nav { display: flex; flex-direction: column; gap: 1px; }
.rail-label { overflow: hidden; text-overflow: ellipsis; }

.rail-search { display: flex; align-items: center; gap: .45rem; margin: .8rem 0 .2rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--soft); cursor: text; transition: border-color .15s ease; }
.rail-search:focus-within { border-color: var(--accent); }
.rail-search > .i { width: 1rem; height: 1rem; flex: none; }
.rail-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 0; font-size: .9rem; color: var(--text); }
.rail-search input::-webkit-search-cancel-button { display: none; }
kbd { font-family: inherit; font-weight: 700; font-size: .68rem; line-height: 1; color: var(--soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: .18rem .3rem; white-space: nowrap; background: var(--panel); }
.rail-search:focus-within kbd { display: none; }

body:not(.mobile-app) .convs { margin: 0 -.15rem; padding: 0 .15rem; gap: 1px; scrollbar-width: thin; }
.conv-group { margin: .85rem .55rem .25rem; font-size: .76rem; font-weight: 700; color: var(--soft); letter-spacing: .01em; }
.conv-group:first-child { margin-top: .4rem; }
.conv { padding: .42rem .4rem .42rem .55rem; font-weight: 500; font-size: .92rem; color: var(--text); position: relative; }
.conv .conv-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.on { background: var(--hover); font-weight: 600; }
.conv-pin { width: .85rem; height: .85rem; color: var(--accent-text); flex: none; }
.conv-more { flex: none; width: 1.7rem; height: 1.7rem; border: 0; border-radius: 7px; background: none; color: var(--soft); display: grid; place-items: center; opacity: 0; transition: opacity .12s ease; }
.conv:hover .conv-more, .conv.on .conv-more, .conv:focus-within .conv-more, .conv-more:focus-visible { opacity: 1; }
.conv-more:hover { background: var(--panel); color: var(--text); }
.conv-more .i { width: 1.1rem; height: 1.1rem; stroke-width: 3; }
.convs-empty { margin: 1rem .55rem; color: var(--soft); font-size: .88rem; }
input.rename { flex: 1; min-width: 0; font: inherit; font-weight: 600; border: 1px solid var(--accent); border-radius: 7px; padding: .15rem .4rem; background: var(--bg); color: var(--text); outline: none; }

/* Balance: one compact block; the account line under it. */
body:not(.mobile-app) .wallet { margin-top: .4rem; padding: .7rem .55rem .6rem; gap: .45rem; border-top: 1px solid var(--line); }
body:not(.mobile-app) .wallet-row strong { font-size: 1.15rem; }
body:not(.mobile-app) .wallet-row span { color: var(--soft); font-weight: 600; font-size: .9rem; }
body:not(.mobile-app) .wallet-usd { margin-top: -.5rem; font-size: .8rem; }
body:not(.mobile-app) #pay-btn { padding: .5rem; font-size: .92rem; }
.me { position: relative; }
.me-btn { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: none; border-radius: 11px; padding: .45rem .45rem; color: var(--text); text-align: left; transition: background-color .15s ease; }
.me-btn:hover, .me-btn.open { background: var(--panel-2); }
.me-ava { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-weight: 800; font-size: .9rem; flex: none; }
.me-name { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chev { display: grid; color: var(--soft); transition: transform .2s ease; }
.me-chev .i { width: 1rem; height: 1rem; }
.me-btn.open .me-chev { transform: rotate(180deg); }
.me-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + .4rem); z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: .65rem; display: flex; flex-direction: column; gap: .5rem; animation: drop .18s ease both; }
.me-menu #account-btn { text-align: left; padding: .35rem .2rem; }

/* Folded: a strip of icons; names show as hints on the right. */
body.rail-folded:not(.mobile-app) .rail { align-items: center; padding-left: .45rem; padding-right: .45rem; }
body.rail-folded:not(.mobile-app) .rail-top { padding: 0 0 .55rem; justify-content: center; }
body.rail-folded:not(.mobile-app) .rail .brand,
body.rail-folded:not(.mobile-app) .rail-label,
body.rail-folded:not(.mobile-app) .rail-search,
body.rail-folded:not(.mobile-app) .convs,
body.rail-folded:not(.mobile-app) .wallet,
body.rail-folded:not(.mobile-app) .me-name,
body.rail-folded:not(.mobile-app) .me-chev { display: none; }
body.rail-folded:not(.mobile-app) .rail-new, body.rail-folded:not(.mobile-app) .rail-link { width: 2.6rem; height: 2.6rem; justify-content: center; padding: 0; }
body.rail-folded:not(.mobile-app) .rail-link > .i { margin: 0; }
body.rail-folded:not(.mobile-app) .me { margin-top: auto; }
body.rail-folded:not(.mobile-app) .me-btn { padding: .3rem; }
body.rail-folded:not(.mobile-app) .me-menu { right: auto; width: 16rem; }
body.rail-folded:not(.mobile-app) [data-rail-tip]:hover::after { content: attr(data-rail-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: var(--text); color: var(--bg); font-size: .82rem; font-weight: 700; padding: .4rem .6rem; border-radius: 8px; white-space: nowrap; z-index: 70; pointer-events: none; }
body.rail-folded:not(.mobile-app) .rail { overflow: visible; }

/* On a computer the sections live in the side panel, so the top tabs go. */
body:not(.mobile-app) .tabs { display: none; }
.mobile-app .rail-nav, .mobile-app .rail-search, .mobile-app .rail-fold, .mobile-app .me-btn, .mobile-app .rail-new { display: none !important; }

/* ---------- the chat pane ---------- */
body:not(.mobile-app) .pane[data-pane="chat"] { padding: 0 clamp(1rem, 3vw, 2.5rem) .55rem; }
.chat-head { display: flex; align-items: center; gap: .5rem; min-height: 3.4rem; max-width: 100%; }
.chat-head .tool-chips { display: none; }
.chat-title { display: inline-flex; align-items: center; gap: .4rem; max-width: min(40rem, 70%); border: 0; background: none; border-radius: 10px; padding: .4rem .6rem; font-weight: 700; font-size: .98rem; color: var(--text); }
.chat-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title .chev { color: var(--soft); width: 1rem; height: 1rem; }
.chat-title:hover { background: var(--panel-2); }
.chat-head input.rename { max-width: 28rem; font-size: .98rem; padding: .35rem .6rem; }

body:not(.mobile-app) .thread { max-width: 48rem; gap: 1.7rem; padding: .6rem .2rem 2.2rem; }
.composer, .below { max-width: 48rem; }

/* The empty chat: the greeting and the field in the middle, ideas under it. */
.pane.is-empty { justify-content: center; padding-bottom: 11vh !important; }
.pane.is-empty .chat-head { position: absolute; top: 0; left: 0; right: 0; padding: 0 clamp(1rem, 3vw, 2.5rem); }
.pane.is-empty .thread { flex: none; overflow: visible; padding: 0 0 1.6rem; }
.hello { display: flex; align-items: center; justify-content: center; gap: 1rem; animation: rise .45s ease both; }
.hello h1 { margin: 0; font-size: clamp(1.9rem, 2.7vw, 2.6rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; text-align: center; }
.hello-texu { width: clamp(3.6rem, 4.6vw, 4.8rem); flex: none; }
.below { width: 100%; margin: 1rem auto 0; display: flex; flex-direction: column; gap: .7rem; }
.below:empty { display: none; }
/* The block under the field keeps its height, so opening ideas never moves the field. */
.pane.is-empty .below { min-height: 16rem; }
.below.cat-open .quick { display: none; }
.cats { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.cat { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: .48rem .85rem; font-weight: 600; font-size: .92rem; color: var(--soft); animation: rise .35s ease both; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.cat .i { width: 1.05rem; height: 1.05rem; }
.cat:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cat.on { color: var(--text); background: var(--panel-2); border-color: var(--accent); }
.sugs { display: flex; flex-direction: column; }
.sugs:empty { display: none; }
.sug { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: .78rem .7rem; color: var(--text); font-weight: 500; animation: rise .3s ease both; border-radius: 0; transition: background-color .15s ease; }
.sug:last-child { border-bottom: 0; }
.sug .i { color: var(--soft); width: 1.05rem; height: 1.05rem; }
.sug:hover { background: var(--panel); border-radius: 10px; }
.below .quick { justify-content: center; margin-top: .5rem; }
.below .quick-chip { font-size: .88rem; }

/* ---------- the field ---------- */
.composer { flex-direction: column; align-items: stretch; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: .8rem .7rem .6rem 1rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(60, 40, 20, .07); transition: border-color .2s ease, box-shadow .2s ease; view-transition-name: composer; cursor: text; }
:root[data-theme="dark"] .composer { box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.composer > textarea { width: 100%; background: none; border: 0; resize: none; outline: none; font-size: 1.02rem; line-height: 1.5; min-height: 2.4rem; max-height: 20rem; padding: .2rem .1rem .3rem; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .3rem; cursor: default; }
.cf-left, .cf-right { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.cf-left { flex-wrap: wrap; }
.cf-on { display: flex; gap: .3rem; flex-wrap: wrap; }
.cf-btn { width: 2.2rem; height: 2.2rem; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--soft); display: grid; place-items: center; flex: none; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.cf-btn:hover { color: var(--text); background: var(--panel-2); }
.cf-btn .i { width: 1.2rem; height: 1.2rem; }
.cf-chip { display: inline-flex; align-items: center; gap: .35rem; height: 2.2rem; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); color: var(--text); border-radius: 10px; padding: 0 .65rem; font-weight: 700; font-size: .84rem; white-space: nowrap; animation: drop .2s ease both; }
.cf-chip .i { width: 1rem; height: 1rem; color: var(--accent-text); }
.composer .model-pick { position: static; }
.composer .model-btn { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: none; border-radius: 10px; padding: .35rem .5rem; font-weight: 700; font-size: .92rem; max-width: 15rem; }
.composer .model-btn:hover { background: var(--panel-2); }
.composer .model-btn .mb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer .model-btn .chev { width: 1rem; height: 1rem; }
#model-menu { position: fixed; z-index: 80; display: block; padding: 0; }
.price-hint { color: var(--soft); font-weight: 700; font-size: .82rem; white-space: nowrap; cursor: help; padding: 0 .15rem; }
.price-hint:empty { display: none; }
.price-hint[data-tip]:hover::after { left: auto; right: 0; transform: none; max-width: 22rem; animation: none; }
.send-btn { width: 2.25rem; height: 2.25rem; border-radius: 11px; border: 0; background: var(--accent-fill); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: opacity .15s ease, transform .15s ease, background-color .15s ease; }
.send-btn .i { width: 1.2rem; height: 1.2rem; stroke-width: 2.5; }
.send-btn:hover:not(:disabled) { background: var(--accent-hover); }
.send-btn:active:not(:disabled) { transform: scale(.92); }
.send-btn:disabled { opacity: .35; cursor: default; }
.send-btn.stop { background: var(--text); color: var(--bg); }
.send-btn.stop .i { fill: currentColor; width: .95rem; height: .95rem; }
.send-btn[data-tip]:hover::after { left: auto; right: 0; transform: none; animation: none; }
.composer-hint { max-width: 48rem; width: 100%; margin: .45rem auto 0; text-align: center; font-size: .76rem; color: var(--soft); padding: 0; }
.pane.is-empty .composer-hint { display: none; }

/* Files in the field: pictures as squares, the rest as cards with their kind and size. */
.attach-row { display: flex; flex-wrap: wrap; gap: .55rem; padding: .15rem 0 .65rem; }
.att-card { position: relative; height: 4rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; gap: .6rem; animation: drop .25s cubic-bezier(.2, .9, .3, 1.3) both; }
.att-card.img { width: 4rem; padding: 0; cursor: zoom-in; }
.att-card.img img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
.att-card:not(.img) { width: 14rem; padding: .5rem .65rem .5rem .5rem; }
.att-card.can-open { cursor: pointer; }
.att-card.can-open:hover, .att-card.img:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.att-ico { width: 2.7rem; height: 2.7rem; border-radius: 9px; background: var(--panel-2); color: var(--soft); display: grid; place-items: center; flex: none; }
.att-ico .i { width: 1.3rem; height: 1.3rem; }
.att-card.pdf .att-ico { background: #d64a2c; color: #fff; }
.att-card.pdf .att-ico b { font-size: .7rem; letter-spacing: .04em; }
.att-card.txt .att-ico { background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); color: var(--accent-text); }
.att-text { display: flex; flex-direction: column; min-width: 0; gap: .05rem; }
.att-name { font-size: .86rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-snip { font-style: normal; font-size: .76rem; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sub { font-size: .74rem; color: var(--soft); font-weight: 600; white-space: nowrap; }
.att-x { position: absolute; top: -.5rem; right: -.5rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--panel); background: var(--text); color: var(--bg); display: grid; place-items: center; padding: 0; opacity: 0; transition: opacity .12s ease, transform .12s ease; }
.att-x .i { width: .75rem; height: .75rem; stroke-width: 3; }
.att-card:hover .att-x, .att-x:focus-visible { opacity: 1; }
.att-x:hover { transform: scale(1.1); }
.att-card.up { opacity: .85; }
.att-bar { position: absolute; left: .5rem; right: .5rem; bottom: .32rem; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--line) 80%, transparent); overflow: hidden; }
.att-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .2s ease; }
.att-card.img .att-bar { left: .35rem; right: .35rem; bottom: .35rem; }

/* ---------- messages ---------- */
.msg { gap: .4rem; }
.msg.user { align-items: flex-end; }
.msg .bubble { background: var(--hover); color: var(--text); border-radius: 18px; padding: .72rem 1.05rem; max-width: min(85%, 40rem); white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; font-weight: 500; }
:root[data-theme="dark"] .msg .bubble { background: #262a33; }
.msg-acts { display: flex; gap: .1rem; justify-content: flex-end; opacity: 0; transition: opacity .15s ease; }
.msg.user:hover .msg-acts, .msg-acts:focus-within { opacity: 1; }
.msg-acts .act { opacity: 1; }
.msg-att { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; max-width: 85%; }
.msg-att .att-card.img { width: 7.5rem; height: 7.5rem; border-radius: 14px; }
.msg-att .att-card.img img { border-radius: 13px; }
.msg-att .att-card:not(.img) { width: 13rem; height: 3.6rem; background: var(--panel); }
.msg-att .att-ico { width: 2.3rem; height: 2.3rem; }
.edit-box { width: min(100%, 42rem); background: var(--panel); border: 1px solid var(--accent); border-radius: 18px; padding: .7rem .8rem .6rem 1rem; display: flex; flex-direction: column; gap: .45rem; animation: drop .2s ease both; }
.edit-ta { width: 100%; border: 0; background: none; outline: none; resize: none; font-size: 1rem; line-height: 1.55; padding: 0; }
.edit-foot { display: flex; align-items: center; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.edit-foot small { margin-right: auto; color: var(--soft); font-size: .78rem; }

.msg.assistant .body.md, .msg.assistant .body { background: none; border: 0; padding: .1rem 0 0; max-width: 100%; border-radius: 0; font-size: 1rem; line-height: 1.7; }
.msg.assistant.error .body { color: var(--minus); }
.msg-who { font-weight: 700; font-size: .86rem; }
.msg .meta { gap: .15rem; padding: 0; margin-left: -.3rem; min-height: 2rem; }
.msg .meta .act { opacity: 0; }
.msg.assistant:hover .meta .act, .msg.assistant:last-child .meta .act, .meta .act:focus-visible { opacity: 1; }
.msg .meta .cost { margin-left: .5rem; font-weight: 700; font-size: .84rem; cursor: help; }
.msg .meta .tok { font-size: .82rem; font-weight: 600; margin-left: .4rem; }
.live { display: flex; align-items: center; gap: .5rem; color: var(--soft); font-size: .84rem; font-weight: 600; }
.live-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.msg.waiting .live { margin-top: -.2rem; }

.to-bottom { position: absolute; left: 50%; bottom: calc(var(--comp-h, 8rem) + 1.6rem); transform: translateX(-50%); width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); box-shadow: var(--shadow); display: grid; place-items: center; z-index: 8; animation: drop .2s ease both; }
.to-bottom .i { width: 1.15rem; height: 1.15rem; }
.to-bottom:hover { border-color: var(--accent); }

/* ---------- menus ---------- */
.pop.fixed { position: fixed; top: auto; z-index: 80; width: auto; min-width: 13rem; max-width: min(24rem, calc(100vw - 16px)); padding: .35rem; border-radius: 14px; animation: popin .16s ease both; }
.pop.fixed.up { animation-name: popup; }
@keyframes popin { from { opacity: 0; transform: translateY(-4px); } }
@keyframes popup { from { opacity: 0; transform: translateY(4px); } }
.pop-item { display: flex; align-items: center; gap: .65rem; width: 100%; border: 0; background: none; border-radius: 9px; padding: .55rem .6rem; text-align: left; color: var(--text); font-weight: 600; font-size: .92rem; }
.pop-item:hover { background: var(--panel-2); }
.pop-item > .i { width: 1.1rem; height: 1.1rem; color: var(--soft); flex: none; }
.pop-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.pop-label small { color: var(--soft); font-weight: 500; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-item .pop-next { transform: rotate(-90deg); width: 1rem; height: 1rem; color: var(--soft); }
.pop-item.danger, .pop-item.danger > .i { color: var(--minus); }
.pop-sp { width: 1.1rem; flex: none; }
.pop-hr { border: 0; border-top: 1px solid var(--line); margin: .3rem .2rem; }
.pop-back { display: flex; align-items: center; gap: .35rem; border: 0; background: none; color: var(--soft); font-weight: 700; font-size: .86rem; padding: .4rem .5rem .5rem; }
.pop-back:hover { color: var(--text); }
.back-chev { transform: rotate(90deg); width: 1rem; height: 1rem; }
.pop .mem-explain { margin: 0 .55rem .4rem; color: var(--soft); font-size: .84rem; line-height: 1.45; }
.pop .mem-now { margin: .4rem .55rem .2rem; color: var(--soft); font-size: .8rem; font-weight: 600; }

/* ---------- pictures, dropping files, long texts ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(8, 8, 10, .86); display: grid; place-items: center; padding: 2rem; cursor: zoom-out; animation: fade .2s ease both; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lb-x { position: absolute; top: 1rem; right: 1rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; }
.lb-x:hover { background: rgba(255, 255, 255, .22); }
@keyframes fade { from { opacity: 0; } }
.drop-veil { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(3px); border: 0; border-radius: 0; font-size: 1rem; animation: fade .15s ease both; pointer-events: none; }
.drop-card { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 2.4rem 3.4rem; border: 2px dashed var(--accent); border-radius: 26px; background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.drop-card b { font-size: 1.35rem; }
.drop-card span:not(.drop-ico) { color: var(--soft); font-weight: 600; font-size: .92rem; }
.drop-ico { width: 3.4rem; height: 3.4rem; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent-text); display: grid; place-items: center; margin-bottom: .3rem; animation: bob 1.2s ease-in-out infinite; }
.drop-ico .i { width: 1.6rem; height: 1.6rem; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.text-preview { margin: 0; font-family: inherit; white-space: pre-wrap; word-break: break-word; font-size: .86rem; line-height: 1.55; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }

/* The field glides between the middle and the bottom. */
::view-transition-old(composer), ::view-transition-new(composer) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
::view-transition-group(composer) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2, .8, .3, 1); }

/* ---------- phone layout ---------- */
body.mobile-app .composer { border-radius: 18px; padding: .6rem .55rem .5rem .8rem; }
body.mobile-app .composer .model-btn { max-width: 9.5rem; }
body.mobile-app .att-x, body.mobile-app .conv-more { opacity: 1; }
body.mobile-app .msg-acts, body.mobile-app .msg .meta .act { opacity: 1; }
body.mobile-app .hello { flex-direction: column; gap: .5rem; }
body.mobile-app .hello h1 { font-size: 1.55rem; }
body.mobile-app .pane.is-empty { padding-bottom: 4vh !important; }
body.mobile-app .chat-head { min-height: 0; }
body.mobile-app .chat-title { max-width: 100%; padding: .25rem .4rem; font-size: .92rem; }
body.mobile-app .cat { padding: .4rem .65rem; font-size: .86rem; }
body.mobile-app .msg .bubble { max-width: 88%; }
@media (max-width: 1100px) { body:not(.mobile-app) .app { grid-template-columns: 15.5rem minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .rail-new:hover .rail-new-ico { transform: none; } .drop-ico { animation: none; } }

/* Hints never cover an open menu. */
body:has(.pop.fixed) [data-tip]:hover::after, body:has(#model-menu:not([hidden])) [data-tip]:hover::after { display: none; }
/* Only the field moves in that transition; the rest of the page changes at once. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Code files keep a code font in the preview; pasted prose reads in the site's own font. */
.text-preview.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; }

/* Without the top tabs, the other sections get their own breathing room at the top. */
body:not(.mobile-app) .pane:not([data-pane="chat"]) { padding-top: 1.8rem; }

/* site.css paints every small button grey; a small primary button keeps its accent. */
.btn.small.primary { background: var(--accent-fill); color: var(--accent-ink); border-color: transparent; }
.btn.small.primary:hover { background: var(--accent-hover); }

/* Centred only while it fits: taller content starts at the top and scrolls, never hides above it. */
.pane.is-empty { justify-content: safe center; overflow-y: auto; }
/* The right side of the field never pushes Send out: the price shrinks first, then the model name. */
.cf-right { flex: 0 1 auto; min-width: 0; }
.cf-left { flex: 0 0 auto; }
.price-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.composer .model-pick { min-width: 0; flex: 0 1 auto; }
.composer .model-btn { min-width: 0; max-width: 100%; }
body.mobile-app .price-hint small.usd { display: none; }
@media (max-width: 420px) { .composer .model-btn .face { display: none; } }

/* The dollars beside a price take the colour of the text around them, a little paler, so they read
   on light cards, dark bands and accent blocks alike. */
small.usd { color: inherit; opacity: .7; }
.btn small.usd, .why-btn small.usd, .tile-tag small.usd, .tg-b small.usd { opacity: .78; }

/* Fingers need room: on a phone the small actions are at least 34 px and a file's cross 28 px. */
body.mobile-app .act { min-width: 2.15rem; min-height: 2.15rem; }
body.mobile-app .att-x { width: 1.75rem; height: 1.75rem; top: -.6rem; right: -.6rem; }

/* ---------- the tools' fields: the same box as the chat, with files above the text ---------- */
.gen-box { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: .75rem .75rem .55rem 1rem; transition: border-color .2s ease; cursor: text; }
.gen-box:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pic-form .gen-box textarea { background: none; border: 0; border-radius: 0; padding: .15rem .1rem .3rem; outline: none; resize: vertical; min-height: 3.2rem; }
.gen-foot { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; cursor: default; min-width: 0; }
.gen-hint { color: var(--soft); font-size: .84rem; font-weight: 600; min-width: 0; }
.gen-warn { color: var(--minus); font-size: .84rem; font-weight: 700; min-width: 0; }
.gen-box .attach-row { padding: 0 0 .6rem; }
.att-badge { position: absolute; left: .25rem; right: .25rem; bottom: .25rem; text-align: center; overflow: hidden; text-overflow: ellipsis; background: rgba(13, 14, 17, .72); color: #fff; font-size: .66rem; font-weight: 800; padding: .08rem .35rem; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.att-card:not(.img) .att-badge { position: static; margin-left: auto; align-self: flex-start; background: var(--panel-2); color: var(--soft); }
body.mobile-app .gen-hint { font-size: .78rem; }

/* On a phone the picture shapes and the button share the width instead of running off the screen. */
@media (max-width: 700px) {
  .pic-row { flex-wrap: wrap; }
  .pic-row #ratios { flex: 1 1 100%; display: flex; }
  .pic-row #ratios button { flex: 1 1 0; min-width: 0; padding-left: .3rem; padding-right: .3rem; overflow: hidden; text-overflow: ellipsis; }
  .pic-row #draw { flex: 1 1 100%; }
}

/* Touch screens wider than a phone (tablets) get finger-sized actions and search too. */
@media (pointer: coarse) {
  .act { min-width: 2.15rem; min-height: 2.15rem; }
  .rail-search input { min-height: 1.9rem; }
  .att-x { opacity: 1; }
}

/* A button whose text carries a small "($…)" flows as one line of text that wraps as a whole,
   instead of breaking into separate pieces side by side. */
.btn:has(> small.usd) { display: inline-block; text-align: center; text-wrap: balance; }

/* ---------- long code and documents: a card in the answer, a panel beside the chat ---------- */
.art-card { display: flex; align-items: center; gap: .8rem; width: min(100%, 30rem); margin: .2rem 0 .9rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); text-align: left; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.art-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(60, 40, 20, .08); }
.art-card.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.art-ico { width: 2.6rem; height: 2.6rem; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); color: var(--accent-text); flex: none; }
.art-ico .i { width: 1.25rem; height: 1.25rem; }
.art-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: .1rem; }
.art-text b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-text small { color: var(--soft); font-weight: 600; font-size: .8rem; }
.art-card.writing .art-text small::before { content: ''; display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); margin-right: .4rem; animation: pulse 1s ease-in-out infinite; }
.art-open { flex: none; font-size: .82rem; font-weight: 700; color: var(--soft); border: 1px solid var(--line); border-radius: 9px; padding: .3rem .6rem; white-space: nowrap; }
.art-card:hover .art-open { color: var(--text); }

body:not(.mobile-app) .pane[data-pane="chat"].with-art { padding-right: calc(min(48%, 52rem) + 1.2rem); }
.art-panel { position: absolute; top: .6rem; right: .6rem; bottom: .6rem; width: min(48%, 52rem); z-index: 9; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; animation: artin .25s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes artin { from { opacity: 0; transform: translateX(16px); } }
.art-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .6rem .6rem 1rem; border-bottom: 1px solid var(--line); }
.art-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.art-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-title small { color: var(--soft); font-weight: 600; font-size: .78rem; }
.art-tabs button { padding: .35rem .75rem; font-size: .86rem; }
.art-acts { display: flex; gap: .1rem; }
.art-acts .act { opacity: 1; }
.art-body { flex: 1; min-height: 0; display: flex; background: var(--bg); }
.art-code { margin: 0; flex: 1; overflow: auto; padding: 1rem 1.1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; line-height: 1.6; white-space: pre; background: #15171c; color: #f2f0ea; }
.art-frame { flex: 1; border: 0; width: 100%; height: 100%; background: #fff; }
.art-md { flex: 1; overflow: auto; padding: 1.2rem 1.4rem; background: var(--panel); }
body.mobile-app .art-panel { position: fixed; inset: 0; width: auto; border-radius: 0; z-index: 70; top: 0; right: 0; bottom: 0; }

.continue-btn { display: inline-flex; align-items: center; gap: .35rem; margin-right: .4rem; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); color: var(--text); border-radius: 10px; padding: .3rem .7rem; font-weight: 700; font-size: .84rem; }
.continue-btn .i { width: 1rem; height: 1rem; color: var(--accent-text); }
.continue-btn:hover { border-color: var(--accent); }

/* While the panel is open, the corner helper and the walking mascot stay out of its way. */
body.art-on .helper, body.art-on .buddy { display: none !important; }
.art-fallback { margin: auto; max-width: 26rem; padding: 2rem 1.5rem; text-align: center; display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.art-fallback p { margin: 0; color: var(--soft); line-height: 1.5; }
.art-fallback-acts { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }

/* "‹ 2 / 3 ›" under an edited message: always visible, unlike the other actions. */
.ver { display: inline-flex; align-items: center; gap: .1rem; margin-right: .3rem; color: var(--soft); font-weight: 700; font-size: .82rem; }
.ver-b { width: 1.7rem; height: 1.7rem; border: 0; background: none; border-radius: 7px; color: var(--soft); font-size: 1.15rem; line-height: 1; display: grid; place-items: center; }
.ver-b:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.ver-b:disabled { opacity: .35; cursor: default; }
.ver-n { min-width: 2.6rem; text-align: center; font-variant-numeric: normal; }
.msg.user:has(.ver) .msg-acts { opacity: 1; }
.msg.user:has(.ver) .msg-acts .act { opacity: 0; transition: opacity .15s ease; }
.msg.user:has(.ver):hover .msg-acts .act { opacity: 1; }

/* ---------- shared chats ---------- */
.conv-shared { display: grid; color: var(--soft); flex: none; }
.conv-shared .i { width: .9rem; height: .9rem; }
body.share-page { background: var(--bg); min-height: 100vh; }
.share-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.share-top .logo { height: 2.2rem; }
.share-main { max-width: 50rem; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 1.5rem) 4rem; }
.share-head h1 { margin: 0 0 .3rem; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.02em; line-height: 1.2; }
.share-head p { margin: 0 0 1.5rem; color: var(--soft); font-weight: 600; }
.share-thread { overflow: visible; max-width: none; padding: 0 0 2rem; gap: 1.6rem; display: flex; flex-direction: column; }
.share-file { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: .3rem .6rem; font-size: .84rem; font-weight: 600; color: var(--soft); }
.share-file .i { width: .95rem; height: .95rem; }
.share-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.2rem 1.3rem; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.share-cta b { font-size: 1.1rem; }
.share-cta p { margin: .2rem 0 0; color: var(--soft); }
.share-gone { text-align: center; padding: 4rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.share-gone h1 { margin: 0; }
.share-gone p { margin: 0; color: var(--soft); }
.share-page a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.share-page .md-pre pre { max-height: 24rem; overflow: auto; }
@media (pointer: coarse) { .att-x { width: 1.75rem; height: 1.75rem; top: -.6rem; right: -.6rem; } }

/* ---------- the owner's protection panel (Margins tab) ---------- */
.guard { display: flex; flex-direction: column; gap: 1rem; max-width: 70rem; margin-bottom: 1.6rem; }
.g-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; }
.g-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; min-width: 0; }
.g-card h3 { margin: 0 0 .8rem; font-size: 1.05rem; display: flex; align-items: center; gap: .45rem; }
.g-card h3 .i { width: 1.1rem; height: 1.1rem; }
.g-big { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.g-big b { font-size: 2.1rem; letter-spacing: -0.02em; line-height: 1.1; }
.g-big span { color: var(--soft); font-weight: 700; }
.g-bar { height: .55rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; margin: .7rem 0 1rem; }
.g-bar i { display: block; height: 100%; background: var(--accent-fill, var(--accent)); border-radius: inherit; transition: width .5s ease; }
.g-bar.hot i { background: var(--minus); }
.g-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .6rem; }
.g-stat { background: var(--panel-2); border-radius: 12px; padding: .6rem .75rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.g-stat span { font-size: .82rem; font-weight: 700; color: var(--soft); }
.g-stat b { font-size: 1.15rem; }
.g-limits { display: flex; flex-direction: column; gap: .7rem; }
.g-limits h3 { margin-bottom: .1rem; }
.g-limits .field-hint { margin: 0; }
.g-paused { margin: 0; padding: .55rem .75rem; border-radius: 10px; background: color-mix(in srgb, var(--minus) 14%, transparent); color: var(--minus); font-weight: 800; }
.g-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: auto; }
.g-users-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .6rem; }
.g-users-head h3 { margin: 0 auto 0 0; }
.g-users-head .inp { width: min(18rem, 100%); }
.g-scroll { overflow-x: auto; overflow-y: hidden; margin: 0 -1.2rem; padding: 0 1.2rem; }
.g-table { min-width: 52rem; max-width: none; }
.g-table td { vertical-align: middle; }
.g-table th, .g-table td { padding-left: .5rem; padding-right: .5rem; }
.g-table th:first-child, .g-table td:first-child { padding-left: 0; }
.g-table th:last-child, .g-table td:last-child { padding-right: 0; }
.g-table th { white-space: nowrap; }
.g-who { min-width: 12rem; max-width: 18rem; }
.g-who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-who small { color: var(--soft); font-weight: 600; }
.g-limit { width: 6.5rem; padding: .4rem .55rem; }
.g-flags { display: flex; flex-wrap: wrap; gap: .3rem; }
.g-table td.g-flags { display: table-cell; }
.g-table td.g-flags .g-flag { margin: .12rem .3rem .12rem 0; }
.g-flag { display: inline-block; font-size: .78rem; font-weight: 800; padding: .2rem .5rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.g-flag.bad { color: var(--minus); border-color: color-mix(in srgb, var(--minus) 40%, transparent); background: color-mix(in srgb, var(--minus) 10%, transparent); }
.g-blocked td { opacity: .78; }
.btn.danger { background: transparent; color: var(--minus); border: 1px solid color-mix(in srgb, var(--minus) 45%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--minus) 10%, transparent); }
.g-events ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.g-events li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.g-events li:last-child { border-bottom: 0; }
.g-events time { color: var(--soft); font-weight: 700; font-size: .85rem; min-width: 7.5rem; }
.g-events b { overflow-wrap: anywhere; }
.g-detail { color: var(--soft); overflow-wrap: anywhere; flex: 1 1 14rem; min-width: 0; }
@media (max-width: 900px) { .g-top { grid-template-columns: 1fr; } }

/* ---------- a note about the account above the work area ---------- */
.acct-note { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .6rem clamp(.8rem, 2vw, 1.4rem) 0; padding: .75rem 1rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; }
.acct-note > .i { width: 1.2rem; height: 1.2rem; flex: none; color: var(--accent-text, var(--accent)); }
.acct-note p { margin: 0; flex: 1 1 18rem; min-width: 0; }
.acct-note.bad { border-color: color-mix(in srgb, var(--minus) 45%, transparent); background: color-mix(in srgb, var(--minus) 8%, var(--panel)); }
.acct-note.bad > .i { color: var(--minus); }
.acct-note .note-x { border: 0; background: none; color: var(--soft); padding: .3rem; border-radius: 8px; display: grid; }
.acct-note .note-x:hover { color: var(--text); background: var(--panel-2); }
.acct-note .note-x .i { width: 1rem; height: 1rem; }
.g-today { display: flex; flex-direction: column; }
.g-week { margin-top: 1rem; flex: 1; display: flex; flex-direction: column; min-height: 9rem; }
.g-week-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: .5rem; font-size: .9rem; }
.g-week-head b { margin-right: auto; }
.g-key { display: inline-flex; align-items: center; gap: .35rem; color: var(--soft); font-weight: 700; font-size: .82rem; }
.g-key::before { content: ''; width: .7rem; height: .7rem; border-radius: 3px; background: currentColor; }
.g-key.cost::before { background: var(--soft); opacity: .55; }
.g-key.rev::before { background: var(--accent-fill, var(--accent)); }
.g-week-bars { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; align-items: end; min-height: 6rem; }
.g-day { display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; min-width: 0; }
.g-day-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.g-day-bars i { width: min(1.1rem, 40%); border-radius: 4px 4px 0 0; transition: height .5s ease; }
.g-day-bars i.cost { background: var(--soft); opacity: .55; }
.g-day-bars i.rev { background: var(--accent-fill, var(--accent)); }
.g-day small { color: var(--soft); font-weight: 700; font-size: .78rem; }

/* ---------- legal pages ---------- */
.legal { max-width: 46rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 1.5rem) 4rem; }
.legal-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.6rem; }
.legal-nav a { padding: .45rem .9rem; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 700; font-size: .92rem; }
.legal-nav a.on { background: var(--text); color: var(--bg); border-color: transparent; }
.legal-draft { margin: 0 0 1.2rem; padding: .7rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 700; }
.legal-body { line-height: 1.65; font-size: 1.02rem; }
/* The Markdown renderer writes # as h3, ## as h4, ### as h5 (sized for chat answers). */
.legal-body h3.md-h { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5rem; }
.legal-body h4.md-h { font-size: 1.35rem; letter-spacing: -0.01em; margin: 2.1rem 0 .6rem; }
.legal-body h5.md-h { font-size: 1.1rem; margin: 1.4rem 0 .4rem; }
.legal-body > p:nth-child(2) em { color: var(--soft); font-style: normal; font-weight: 700; }
.legal-body p, .legal-body li { overflow-wrap: anywhere; }
.legal-body a { color: var(--accent-text, var(--accent)); }
.signin-accept { margin: .2rem 0 0; font-size: .86rem; color: var(--soft); font-weight: 600; line-height: 1.45; }
.signin-accept a { color: inherit; text-decoration: underline; }

/* ---------- deleting the account ---------- */
.danger-link { color: var(--minus) !important; }
.acc-delete { display: flex; flex-direction: column; gap: .7rem; padding: .9rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--minus) 40%, transparent); background: color-mix(in srgb, var(--minus) 6%, var(--panel)); }
.acc-delete p { margin: 0; font-weight: 600; font-size: .92rem; line-height: 1.45; }
.btn.danger.wide:not(:disabled) { background: var(--minus); color: #fff; border-color: transparent; }
.btn.danger:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- the microphone ---------- */
.mic-btn { position: relative; gap: .35rem; }
.mic-btn.rec { display: inline-flex; align-items: center; width: auto; padding: 0 .65rem; color: var(--minus); background: color-mix(in srgb, var(--minus) 12%, transparent); border-radius: 11px; }
.mic-btn.rec::after { content: ''; position: absolute; inset: -3px; border-radius: 14px; border: 2px solid var(--minus); opacity: calc(.25 + var(--lvl, 0) * .75); transform: scale(calc(1 + var(--lvl, 0) * .08)); transition: transform .08s linear, opacity .08s linear; pointer-events: none; }
.mic-time { font-weight: 800; font-size: .85rem; font-variant-numeric: normal; min-width: 2.2rem; text-align: left; }
.mic-spin { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: mic-spin .8s linear infinite; }
@keyframes mic-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mic-spin { animation-duration: 2.4s; } .mic-btn.rec::after { transition: none; } }

/* ---------- projects ---------- */
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.proj-add { border: 0; background: none; color: var(--soft); width: 1.6rem; height: 1.6rem; border-radius: 7px; display: grid; place-items: center; }
.proj-add:hover { color: var(--text); background: var(--panel-2); }
.proj-add .i { width: .95rem; height: .95rem; }
.proj-row .proj-n { margin-left: auto; color: var(--soft); font-weight: 700; font-size: .78rem; flex: none; }
.proj-empty { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; border: 1px dashed var(--line); background: none; color: var(--soft); font: inherit; font-size: .86rem; font-weight: 600; padding: .55rem .65rem; border-radius: 10px; margin: .1rem 0 .4rem; line-height: 1.3; }
.proj-empty:hover { color: var(--text); border-color: var(--soft); }
.proj-empty .i { width: 1rem; height: 1rem; flex: none; }
.chat-crumb { display: inline-flex; align-items: center; gap: .35rem; border: 0; background: none; color: var(--soft); font: inherit; font-weight: 700; padding: .35rem .5rem; border-radius: 9px; max-width: 16rem; min-width: 0; }
.chat-crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-crumb:hover { color: var(--text); background: var(--panel-2); }
.chat-crumb .i { width: 1rem; height: 1rem; flex: none; }
.crumb-sep { font-style: normal; opacity: .5; margin-left: .15rem; }
.hello.proj-hello { flex-direction: column; align-items: center; text-align: center; gap: .45rem; }
.hello.proj-hello h1 { overflow-wrap: anywhere; }
.proj-big { width: 3.4rem; height: 3.4rem; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent-text, var(--accent)); }
.proj-big .i { width: 1.8rem; height: 1.8rem; }
.proj-sub { margin: .2rem auto 0; max-width: 38rem; color: var(--soft); font-weight: 600; line-height: 1.5; white-space: pre-line; }
.proj-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem .9rem; margin-top: .8rem; color: var(--soft); font-weight: 700; font-size: .9rem; }
.proj-meta > span { display: inline-flex; align-items: center; gap: .35rem; }
.proj-meta .i { width: 1rem; height: 1rem; }
.proj-chats { width: 100%; max-width: 46rem; margin: 0 auto; display: flex; flex-direction: column; gap: .2rem; }
.proj-chat { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-weight: 600; text-align: left; padding: .65rem .8rem; border-radius: 12px; }
.proj-chat:hover { border-color: var(--soft); }
.proj-chat span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-chat small { color: var(--soft); font-weight: 700; flex: none; }
.proj-chat .i { width: 1rem; height: 1rem; color: var(--soft); flex: none; }
.proj-modal { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, #000 40%, transparent); display: grid; place-items: center; padding: 1rem; animation: fade .2s ease; }
.proj-card { width: min(36rem, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .9rem; animation: drop .25s cubic-bezier(.2,.9,.3,1.2); }
.proj-card-head { display: flex; align-items: center; gap: .6rem; }
.proj-card-head h3 { margin: 0; font-size: 1.25rem; flex: 1; }
.proj-ico { width: 2.1rem; height: 2.1rem; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent-text, var(--accent)); }
.proj-ico .i { width: 1.15rem; height: 1.15rem; }
.proj-lead { margin: 0; color: var(--soft); font-weight: 600; line-height: 1.45; }
.proj-instr { resize: vertical; min-height: 8rem; line-height: 1.5; font: inherit; }
.proj-files { display: flex; flex-wrap: wrap; gap: .4rem; }
.proj-files .field-hint { margin: 0; }
.proj-file { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; padding: .3rem .4rem .3rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; font-size: .88rem; }
.proj-file .i { width: .95rem; height: .95rem; flex: none; }
.proj-file-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.proj-file-x { border: 0; background: none; color: var(--soft); padding: .15rem; border-radius: 6px; display: grid; }
.proj-file-x:hover { color: var(--text); background: var(--panel); }
.proj-file.wait { color: var(--soft); padding-right: .6rem; }
.proj-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.proj-gap { flex: 1; }
@keyframes fade { from { opacity: 0; } }
/* On a phone the price beside Send stays whole; the model's name gives way first. */
body.mobile-app .composer .price-hint { flex: none; overflow: visible; }
body.mobile-app .composer .model-pick { min-width: 0; flex: 1 1 auto; }
body.mobile-app .composer .model-btn { max-width: 100%; }
@media (max-width: 420px) { body.mobile-app .composer .mic-btn:not(.rec) { width: 2rem; height: 2rem; } }
.share-invited { margin: .3rem 0 0; font-weight: 700; color: var(--plus); }
/* Until the document's text arrives, its room is kept, so the footer does not jump down under it. */
.legal-body:empty { min-height: 150vh; }
