/* Chat: sidebar card 288 | conversation card. Thread column 720. Composer = one recessed well at the card's foot. */
.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 288px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 16px; padding: 0 16px 16px; }
.app.collapsed { grid-template-columns: minmax(0, 1fr); }
.app.collapsed .side { display: none; }
#openSide { display: none; }
.app.collapsed #openSide { display: grid; }

/* sidebar */
.side { padding: 12px; gap: 12px; }
.sh { gap: 8px; }
.newc { flex: 1; height: 36px; justify-content: flex-start; padding: 0 12px; }
.chats { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px 24px; }
.grp { padding: 12px 12px 4px; font-size: 11px; font-weight: 700; }
.grp:first-child { padding-top: 0; }
.ci { position: relative; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.ci:hover { background: rgba(255, 255, 255, .045); }
.ci[aria-current="true"] { background: var(--plate); box-shadow: var(--plate-sh); }
.ci[aria-current="true"] .t { font-weight: 700; }
.ci .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ci .acts { display: none; gap: 0; }
.ci:hover .acts, .ci:focus-within .acts { display: flex; }
.ci:hover .dot, .ci:focus-within .dot { display: none; }
.ci .acts .ib { width: 28px; height: 28px; border-radius: 8px; }
.ci .acts .i { width: 14px; height: 14px; }
.ci input { flex: 1; min-width: 0; height: 28px; padding: 0 8px; margin-left: -8px; border-radius: 8px; background: var(--well); box-shadow: var(--well-sh); outline: none; font-weight: 600; }
.sfoot { flex: none; padding: 2px 0; }
.sfoot .r { height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.sfoot .r + .r { box-shadow: var(--row-line); }
.sfoot .r span { font-weight: 500; }
.sfoot .r b { margin-left: auto; font-weight: 700; white-space: nowrap; }
.sfoot .r.m { height: auto; padding: 10px 12px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
.sfoot .r.m > div { display: flex; align-items: center; }
.scrim { display: none; }

/* conversation card */
.main { overflow: hidden; }
.mh { margin: 12px 12px 0 16px; }
.mh .ib { margin-left: -8px; }
.mstate { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.col { width: 100%; max-width: 752px; margin: 0 auto; padding: 0 16px; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-mask-image: linear-gradient(180deg, transparent, #000 24px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(180deg, transparent, #000 24px, #000 calc(100% - 32px), transparent); }
.thread { padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 24px; }

.mu { align-self: flex-end; max-width: 78%; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--plate); box-shadow: var(--plate-sh); font-size: 15px; font-weight: 500; line-height: 1.55; white-space: pre-wrap; }
.ma { display: flex; flex-direction: column; gap: 12px; }
.ma .body { font-size: 15px; font-weight: 500; line-height: 1.65; }
.ma .body > * + * { margin-top: 12px; }
.ma .body h3 { font-size: 15px; font-weight: 800; margin-top: 20px; }
.ma .body ul { margin: 0; padding-left: 20px; }
.ma .body li + li { margin-top: 4px; }
.ma .body strong { font-weight: 800; }
.ma .body code { -webkit-box-decoration-break: clone; box-decoration-break: clone; font: 500 13px/1 'JetBrains Mono', monospace; padding: 2px 5px; border-radius: 6px; background: var(--plate); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.code { border-radius: 12px; background: var(--well); box-shadow: var(--well-sh); overflow: hidden; }
.code-h { height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 14px; box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .035); font-size: 13px; font-weight: 700; }
.code-h button { height: 28px; padding: 0 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.code-h button:hover { background: rgba(255, 255, 255, .07); }
.code-h .i { width: 14px; height: 14px; }
.code pre { margin: 0; padding: 12px 14px 14px; overflow-x: auto; font: 400 13px/1.6 'JetBrains Mono', monospace; color: #fff; }
.code pre .k { color: #8cc8ff; }
.code pre .c { color: #b9f6ca; }
.caret::after { content: ''; display: inline-block; width: 8px; height: 16px; margin-left: 3px; vertical-align: -2px; border-radius: 2px; background: var(--acc); animation: blink 1s steps(2) infinite; }
.body.caret > :last-child::after { content: ''; display: inline-block; width: 8px; height: 16px; margin-left: 3px; vertical-align: -2px; border-radius: 2px; background: var(--acc); animation: blink 1s steps(2) infinite; }
.body.caret::after { display: none; }
.body.caret:empty::after { display: inline-block; }
@keyframes blink { 50% { opacity: 0; } }

.mf { display: flex; align-items: center; gap: 2px; margin-left: -8px; min-height: 32px; }
.mf .ib .i { width: 15px; height: 15px; }
.mf .ib.ok { color: var(--ok); }
.stat { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: 8px; font-size: 11px; font-weight: 600; }
.stat b { font-weight: 800; }
.stat .acc { color: var(--acc-hi); }

/* thinking */
.thk { border-radius: 12px; background: var(--well); box-shadow: var(--well-sh); }
.thk summary { list-style: none; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; cursor: pointer; font-weight: 700; }
.thk summary::-webkit-details-marker { display: none; }
.thk summary .i:last-child { margin-left: auto; transition: transform .2s var(--ease); }
.thk[open] summary .i:last-child { transform: rotate(180deg); }
.thk p { padding: 0 14px 12px 36px; font-weight: 500; line-height: 1.6; }
.thk.live summary .i:first-child { color: var(--acc-hi); }

/* waiting for the model */
.waitc { border-radius: 12px; background: var(--well); box-shadow: var(--well-sh); padding: 14px; display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.wait-h { display: flex; align-items: center; gap: 10px; }
.wait-h b { font-size: 15px; font-weight: 700; }
.wait-h span:last-child { margin-left: auto; font-weight: 600; }
.waitc .why { font-weight: 500; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.steps span { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 600; }
.steps span::before { content: ''; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); }
.steps span.done::before { background: #fff; }
.steps span.on::before { background: linear-gradient(90deg, var(--acc) var(--p, 30%), rgba(255, 255, 255, .1) var(--p, 30%)); }
.steps span.on { font-weight: 800; }

/* composer */
.cwrap { flex: none; padding-bottom: 12px; position: relative; }
.composer { position: relative; display: flex; flex-direction: column; padding: 4px; border-radius: 16px; }
.composer textarea { display: block; width: 100%; resize: none; outline: none; min-height: 48px; max-height: 200px; padding: 12px 12px 4px; font-size: 15px; font-weight: 500; line-height: 1.55; }
.composer textarea::placeholder { color: rgba(255, 255, 255, .5); }
.crow { display: flex; align-items: center; gap: 8px; padding: 4px; }
.mbtn { height: 32px; padding: 0 8px 0 10px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; background: var(--plate); box-shadow: var(--plate-sh); white-space: nowrap; max-width: 100%; transition: background .15s; }
.mbtn:hover:not(:disabled) { background: var(--plate-hi); }
.mbtn:disabled { opacity: .45; }
.mbtn .st { font-weight: 500; }
.mbtn .nm { overflow: hidden; text-overflow: ellipsis; }
.think { height: 32px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.think:hover { background: rgba(255, 255, 255, .05); }
.think.off { opacity: .45; pointer-events: none; }
.left { font-weight: 600; white-space: nowrap; }
.send { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff;
  background: radial-gradient(80% 100% at 50% 0%, rgba(255, 255, 255, .25), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 10, 40, .3)), var(--acc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 20, 60, .4), 0 0 0 1px rgba(0, 0, 0, .5), 0 8px 20px -8px rgba(61, 155, 255, .9); transition: box-shadow .2s, filter .2s; }
.send:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(0, 20, 60, .4), 0 0 0 1px rgba(0, 0, 0, .5), 0 10px 26px -6px rgba(61, 155, 255, 1); }
.send:disabled { background: var(--plate); box-shadow: var(--plate-sh); opacity: .55; }
.send.stop { background: #fff; color: var(--on-light); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 6px 16px -8px rgba(255, 255, 255, .5); }
.send .i { width: 16px; height: 16px; }

/* model picker */
.picker { position: absolute; z-index: 30; left: 0; bottom: calc(100% + 8px); width: 400px; max-width: calc(100vw - 32px); padding: 6px; border-radius: 16px; background: #1b1b21; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 0 0 1px rgba(0, 0, 0, .6), 0 30px 60px -20px rgba(0, 0, 0, .95); }
.pk-g { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; }
.opt { width: 100%; min-height: 52px; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: left; }
.opt:hover:not(:disabled), .opt:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.opt[aria-selected="true"] { background: var(--well); box-shadow: var(--well-sh); }
.opt .mk2 { display: grid; place-items: center; }
.opt .mk2 .i { color: var(--acc-hi); }
.opt .n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt .s { grid-column: 2; font-size: 11px; font-weight: 500; }
.opt .r { grid-row: 1 / span 2; grid-column: 3; font-size: 11px; font-weight: 700; text-align: right; }
.opt:disabled { opacity: .4; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 0 8px 8px; gap: 0; }
  .side { position: fixed; z-index: 70; top: 8px; bottom: 8px; left: 8px; width: min(300px, calc(100vw - 48px)); transform: translateX(calc(-100% - 16px)); transition: transform .3s var(--ease); }
  .app.open .side { transform: none; }
  .app.open .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .55); }
  #openSide { display: grid; }
  #closeSide { display: none; }
  .mh { margin: 8px 8px 0 12px; }
  .col { padding: 0 8px; }
  .thread { padding: 16px 8px 32px; }
  .mu { max-width: 88%; }
  .cwrap { padding-bottom: 8px; }
  .mstate .st { display: none; }
  .think > span:last-child { display: none; }
  .think { padding: 0 6px; }
  .picker { width: calc(100vw - 32px); }
}
