/* The same ink, paper and rule as the dashboard it frames; one writing surface is the only raised thing. */
:root{--fg:#18212c;--bg:#f7f8fa;--muted:#596372;--line:#d8dde4;--acc:#3060c4;--surface:#ffffff;--err:#b03f0c;
 --tint:color-mix(in srgb,var(--fg) 4%,var(--bg));--mine:color-mix(in srgb,var(--acc) 10%,var(--bg));color-scheme:light dark}
@media (prefers-color-scheme:dark){:root{--fg:#e4e8ee;--bg:#13171c;--muted:#9ba5b2;--line:#2f3640;--acc:#86a8f2;
 --surface:#1a2028;--err:#f4a06c;--mine:color-mix(in srgb,var(--acc) 17%,var(--bg))}}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;color:var(--fg);background:var(--bg);-webkit-text-size-adjust:100%;
 font:16px/1.5 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--acc);text-underline-offset:2px}
:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.hide{display:none!important}
.primary{background:var(--fg);color:var(--bg);border:1px solid var(--fg);border-radius:10px;font-weight:650;padding:.55rem 1.1rem}
.primary:disabled{opacity:.4;cursor:default}
.plain{background:transparent;border:1px solid transparent;border-radius:8px;padding:.3rem .6rem;color:var(--muted)}
.plain:hover{color:var(--fg);background:var(--tint)}
.brand{display:flex;align-items:center;gap:.5rem;font-weight:700;letter-spacing:-.01em;margin:0}
.brand .mark{width:1.45em;height:1.45em;flex:none}
.more{margin-top:1rem}.more summary{cursor:pointer;color:var(--muted);font-size:.9rem}

/* signing in */
.login{display:grid;place-items:center;padding:1.5rem}
.login main{width:min(100%,23rem);background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:1.9rem 1.8rem 1.7rem}
.login .brand{font-size:1.35rem;margin-bottom:1.3rem}
.login label{display:block;margin:1rem 0 0;font-size:.9rem;font-weight:600}
.login input{display:block;width:100%;margin-top:.35rem;padding:.6rem .7rem;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.login input:focus{outline:none;border-color:var(--acc);box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 25%,transparent)}
.login .primary{margin-top:1.4rem;width:100%;padding:.7rem}
.hint{color:var(--muted);font-size:.88rem;margin:.5rem 0 0}
.err{color:var(--err);font-weight:600;margin:0 0 .3rem}

/* the frame. The app's own page never scrolls: only what a tab shows does. Under a mouse or trackpad it does not
   bounce either, so a scroll that reaches the end of a tab no longer pulls the top bar along; a touch screen keeps
   its pull to reload, the only reload an installed app has */
html.app,html.app body{overflow:hidden}
@media (pointer:fine){html.app,html.app body{overscroll-behavior-y:none}}
#app{display:flex;flex-direction:column;height:100%}
.top{display:flex;align-items:stretch;gap:1.6rem;padding:0 1.2rem;border-bottom:1px solid var(--line);min-height:3.2rem}
.top .brand{font-size:1.05rem}
.tabs{display:flex;gap:1.3rem;overflow-x:auto}
.tab{background:none;border:0;border-bottom:2px solid transparent;border-top:2px solid transparent;padding:0 .1rem;
 color:var(--muted);font-weight:560;white-space:nowrap}
.tab:hover{color:var(--fg)}
.tab[aria-selected=true]{color:var(--fg);border-bottom-color:var(--fg)}
.who{margin-left:auto;display:flex;align-items:center;gap:.3rem;color:var(--muted);font-size:.92rem;white-space:nowrap}
/* a long name is cut in every layout (its title has it whole), so that it alone never takes the tabs' room */
.who span{min-width:0;max-width:min(14rem,30vw);overflow:hidden;text-overflow:ellipsis}
/* No tab is ever out of sight. When the tabs do not fit beside the rest (app.js measures and puts .stacked on the bar)
   they get a line of their own, as in a phone's width (the rule further down), and wrap onto a further line when even a
   whole line cannot hold them. The page cannot scroll, so nothing in the bar may be wider than the window: a long name
   is cut with an ellipsis, the language menu and "Sign out" stay whole and go onto a further line when one line cannot
   hold them both (a zoomed or very narrow window). A window where all fits on one line is untouched */
.top.stacked{flex-wrap:wrap;gap:.2rem 1rem;padding:.4rem .9rem 0}
.top.stacked .tabs{order:3;width:100%;gap:0 1.1rem;min-height:2.4rem;flex-wrap:wrap;overflow-x:visible}
.top.stacked .tab{min-height:2.4rem}
.top.stacked .brand{flex:none}
.top.stacked .who{min-width:0;max-width:100%;flex-wrap:wrap;justify-content:flex-end}
.top.stacked .who .lang,.top.stacked .who button{flex:none}
.stage{flex:1;min-height:0;position:relative}
/* every tab stays laid out and loaded; switching only changes which one is visible, so nothing repaints. The ones
   that are not open are also put aside, above the window where no page can be scrolled to: Safari's engine sends the
   wheel to a frame lying under the pointer even when that frame is hidden, and the tab that is open then does not
   scroll (seen 2026-11-30 in WebKit 27.2; with the panes left in place 11 of 22 switch-and-scroll checks failed) */
.pane{position:absolute;inset:0;display:flex;flex-direction:column;visibility:hidden;transform:translateY(-200vh)}
.pane.on{visibility:visible;transform:none}
.pane iframe{flex:1;width:100%;border:0;background:var(--bg);color-scheme:light dark;opacity:0;transition:opacity .12s}
.pane iframe.ready{opacity:1}
.pane .noload{margin:1.2rem;text-align:center}
.docs .hint{margin-top:1.2rem}
@media (prefers-reduced-motion:reduce){.pane iframe{transition:none}}
.col{width:min(100%,46rem);margin:0 auto}
@media (max-width:640px){.top{flex-wrap:wrap;gap:.2rem 1rem;padding:.4rem .9rem 0}
 .tabs{order:3;width:100%;gap:0 1.1rem;min-height:2.4rem;flex-wrap:wrap;overflow-x:visible}.tab{min-height:2.4rem}
 .top .brand{flex:none}.who{min-width:0;max-width:100%;flex-wrap:wrap;justify-content:flex-end}.who .lang,.who button{flex:none}
 .who span{display:none}}

/* talking */
.msgs{flex:1;overflow:auto;padding:1.6rem 1.2rem .6rem}
.msgs .col{display:flex;flex-direction:column;gap:1.2rem}
.msg{overflow-wrap:anywhere}
.msg p{margin:0 0 .55rem}.msg p:last-of-type{margin-bottom:0}
.msg ul{margin:.1rem 0 .55rem;padding-left:1.2rem}
.msg.owner{align-self:flex-end;max-width:85%;background:var(--mine);border-radius:14px 14px 4px 14px;padding:.55rem .9rem}
.msg.agent{align-self:flex-start;max-width:min(100%,68ch)}
.msg time{display:block;color:var(--muted);font-size:.76rem;margin-top:.3rem}
.msg.owner time{text-align:right}
.msg img{display:block;width:min(100%,24rem);border-radius:10px;margin-top:.6rem;border:1px solid var(--line)}
.msg .file{display:inline-block;margin-top:.5rem;padding:.3rem .7rem;border:1px solid var(--line);border-radius:8px;
 background:var(--surface);text-decoration:none;color:var(--fg);font-size:.92rem}
.msg .file:hover{border-color:var(--fg)}
/* a reply while it is being written: its text so far, then one line on what the agent is doing */
.msg.live .body:empty{display:none}
.msg.live .body{margin-bottom:.6rem}
.doing{color:var(--muted);display:flex;align-items:center;gap:.55rem;min-height:2rem}
.doing .clock{font-size:.82rem;font-variant-numeric:tabular-nums}
.doing .stop{margin-left:.3rem;border-color:var(--line);color:var(--fg);padding:.15rem .7rem;font-size:.88rem}
.doing .stop:hover{border-color:var(--fg)}
.doing .stop:disabled{opacity:.4;cursor:default}
.msg.note{color:var(--muted);font-size:.88rem}
.msg.note.top{align-self:center}
.dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--muted);animation:breathe 1.4s ease-in-out infinite}
@keyframes breathe{0%,100%{opacity:.25}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){.dot{animation:none}}
.msg.fail{color:var(--err)}
.divider{display:flex;align-items:center;gap:.8rem;color:var(--muted);font-size:.8rem}
.divider::before,.divider::after{content:"";flex:1;border-top:1px solid var(--line)}
.start{margin-top:14vh;text-align:center;color:var(--muted)}
.start p{margin:0 0 .9rem}
.start div{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}
.sug{background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:.4rem .95rem;font-size:.93rem}
.sug:hover{border-color:var(--fg)}

/* the writing surface */
.dock{padding:.4rem 1.2rem 1.1rem}
/* a chat started somewhere else: where it comes from, and a way on, in place of the message box */
.readonly{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem 1rem;
 border:1px solid var(--line);border-radius:14px;background:var(--tint);padding:.7rem .8rem .7rem 1rem}
.readonly p{margin:0;color:var(--muted);font-size:.93rem}
.composer{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.composer:focus-within{border-color:color-mix(in srgb,var(--fg) 45%,var(--line));
 box-shadow:0 2px 14px color-mix(in srgb,var(--fg) 9%,transparent)}
/* never taller than the window leaves room for: the page itself cannot scroll, so the box below must stay in it */
.menu{border-bottom:1px solid var(--line);padding:.3rem;max-height:min(21rem,max(5rem,100vh - 17rem));overflow:auto}
.cmd{display:grid;grid-template-columns:7.4rem 1fr;gap:.8rem;align-items:baseline;width:100%;text-align:left;border:0;
 border-radius:9px;background:transparent;padding:.45rem .6rem}
.cmd.on,.cmd:hover{background:var(--tint)}
.cmd b{font-weight:650}.cmd span{color:var(--muted)}
/* choosing a model: the same list, with a heading for each provider and the model's own id beside its name */
.cmd.pick{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)}
.cmd.pick b{font-weight:560;overflow-wrap:anywhere}
.cmd.pick span{text-align:right;font-size:.82rem;overflow-wrap:anywhere}
.cmd.now b::before{content:"";display:inline-block;width:.4rem;height:.4rem;border-radius:50%;background:var(--acc);
 margin-right:.45rem;vertical-align:.12em}
.menu .grp{padding:.5rem .6rem .15rem;color:var(--muted);font-size:.78rem;font-weight:650;letter-spacing:.02em}
.menu .none{padding:.25rem .6rem .45rem;color:var(--muted);font-size:.88rem}
/* the effort as a meter: "Agent's default" as a quiet pill, then one column for each level, a bar standing on a common
   line with its name under it. The bars up to the mark (the level the keys are on; while the pointer is over a level, up
   to that one) are ink, the others a grey mixed from the ink and the surface, so an empty bar still reads as a bar. The
   marked column is tinted and its name inked and thickened without getting wider, so the place does not rest on colour
   alone and nothing moves when the mark does. The level in use has the list's accent dot, above its column and out of
   the text's way. Heights come from the classes .up0 to .up20: even steps from a third to the full height.
   The meter wraps by its own room, not by the window's: the levels go under the pill when they would get less than 17rem */
.meter{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.2rem .6rem;padding:.3rem .5rem .25rem;
 --mark:color-mix(in srgb,var(--fg) 10%,var(--surface));--empty:color-mix(in srgb,var(--fg) 50%,var(--surface))}
.meter .dflt{flex:none;align-self:center;background:var(--surface);border:1px solid var(--line);border-radius:999px;
 padding:.4rem .95rem;font-size:.93rem}
.meter .dflt:hover{border-color:var(--fg)}
.meter .dflt.on{border-color:var(--fg);background:var(--mark)}
.meter .on .name{color:var(--fg);text-shadow:.03em 0 0 currentColor,-.03em 0 0 currentColor}
/* the levels keep together, so that five slim bars read as one rising meter and not as five blocks across the box */
.levels{flex:1 1 17rem;max-width:24rem;min-width:0;display:flex}
.lvl{position:relative;flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
 gap:.3rem;border:0;border-radius:9px;background:transparent;padding:.65rem .1rem .3rem}
.lvl .stand{display:flex;align-items:flex-end;width:1.15rem;height:3rem}
.lvl .bar{display:block;width:100%;border-radius:3px 3px 0 0;background:var(--empty);transition:background-color .1s}
.lvl.full .bar{background:var(--fg)}
.lvl .name{font-size:.76rem;line-height:1.2;color:var(--muted);text-align:center;hyphens:auto;-webkit-hyphens:auto}
.lvl.on{background:var(--mark)}
.lvl.now::before{content:"";position:absolute;top:.12rem;left:50%;width:.4rem;height:.4rem;margin-left:-.2rem;border-radius:50%;
 background:var(--acc)}
.meter .dflt.now .name::before{content:"";display:inline-block;width:.4rem;height:.4rem;border-radius:50%;background:var(--acc);
 margin-right:.35rem;vertical-align:.12em}
.up0{height:33.3%}.up1{height:36.6%}.up2{height:40%}.up3{height:43.3%}.up4{height:46.6%}.up5{height:50%}.up6{height:53.3%}.up7{height:56.6%}.up8{height:60%}.up9{height:63.3%}.up10{height:66.7%}.up11{height:70%}.up12{height:73.3%}.up13{height:76.7%}.up14{height:80%}.up15{height:83.3%}.up16{height:86.7%}.up17{height:90%}.up18{height:93.3%}.up19{height:96.7%}.up20{height:100%}
/* the same meter, small, before an effort's name in the chat's head and in a row of the list */
.mini{display:inline-flex;align-items:flex-end;gap:1px;width:1rem;height:.8em;margin-right:.35em;vertical-align:-.04em}
.mini i{flex:1;border-radius:1px 1px 0 0;background:color-mix(in srgb,currentColor 35%,transparent)}
.mini i.full{background:currentColor}
@media (prefers-reduced-motion:reduce){.lvl .bar{transition:none}}
/* a short window: lower bars, so the box below stays in the window */
@media (max-height:420px){.meter{padding-top:.1rem;padding-bottom:.1rem}.lvl{gap:.15rem;padding-top:.6rem;padding-bottom:.15rem}
 .lvl .stand{height:1.3rem}.meter .dflt{padding-top:.2rem;padding-bottom:.2rem}}
.chips{padding:.55rem .95rem 0;color:var(--muted);font-size:.88rem}
.chips:empty{display:none}
.compose{display:flex;gap:.35rem;align-items:flex-end;padding:.45rem .5rem .45rem .25rem}
.compose textarea{flex:1;min-width:0;height:2.5rem;min-height:2.5rem;max-height:12rem;resize:none;border:0;outline:0;
 background:transparent;padding:.5rem .7rem;line-height:1.45}
.icon{flex:none;width:2.4rem;height:2.4rem;border-radius:10px;border:0;background:transparent;color:var(--muted);
 display:grid;place-items:center}
.icon:hover{background:var(--tint);color:var(--fg)}
.icon svg{width:1.25rem;height:1.25rem}
.compose .primary{flex:none;height:2.4rem;padding:0 1.05rem}

/* documents */
.docs{overflow:auto;padding:1.2rem 1.2rem 2.5rem}
.docs h2{font-size:1rem;margin:1.5rem 0 .5rem;letter-spacing:-.005em}
.docs h2 small{color:var(--muted);font-weight:400;margin-left:.55rem;font-variant-numeric:tabular-nums}
.docs ul{list-style:none;margin:0;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--surface);overflow:hidden}
.docs li{display:flex;gap:1rem;justify-content:space-between;align-items:baseline;padding:.55rem .9rem;border-top:1px solid var(--line)}
.docs li:first-child{border-top:0}
.docs li a{overflow-wrap:anywhere;text-decoration:none;color:var(--fg);font-weight:560}
.docs li a:hover{text-decoration:underline}
.docs li small{color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}

/* chats beside the open one */
.pane.talk{flex-direction:row}
.side{width:16.5rem;flex:none;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:.6rem;padding:.8rem .6rem;overflow:auto}
.newchat{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.5rem .8rem;font-weight:600;text-align:left}
.sidetop{display:flex;align-items:center;gap:.3rem}
.sidetop .newchat{flex:1;min-width:0}
.sideclose{display:none}
.newchat:hover{border-color:var(--fg)}
.chatlist{display:flex;flex-direction:column;gap:.15rem}
.chatrow{display:flex;flex-wrap:wrap;justify-content:space-between;gap:0 .6rem;align-items:baseline;width:100%;border:0;
 background:transparent;border-radius:8px;padding:.45rem .6rem;text-align:left}
.chatrow:hover,.chatrow.on{background:var(--tint)}
.chatrow.on{font-weight:600}
.chatrow .ct{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chatrow.pin .ct::before{content:"";display:inline-block;width:.4rem;height:.4rem;border-radius:50%;background:var(--acc);
 margin-right:.45rem;vertical-align:.12em}
.chatrow .from{flex-basis:100%;color:var(--muted);font-size:.76rem;font-weight:400}
.chatlist .hint{margin:.2rem .6rem}
.chatrow small{flex:none;color:var(--muted);font-size:.76rem;font-weight:400;font-variant-numeric:tabular-nums}
.thread{flex:1;min-width:0;display:flex;flex-direction:column}
.head{display:flex;align-items:center;gap:.2rem;min-height:2.6rem;padding:.3rem .7rem 0 1.2rem;font-size:.92rem}
.head .ht{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
/* the model this chat runs on; it gives way first when the head is narrow, and inside it the model's name does: the
   small meter and the effort's name keep their size and stay shown */
.head .model{flex:0 1 auto;display:flex;align-items:center;gap:.3em;min-width:0;max-width:min(18rem,46%);overflow:hidden;
 white-space:nowrap;border-color:var(--line);font-size:.86rem;margin-right:.2rem}
.head .model .mname{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.head .model .meffort{flex:none}
/* a narrow head has no room for the effort's word beside longer labels: the small meter says it, the title has the word */
@media (max-width:420px){.head .model .mini + .eword{display:none}}
.head .model:hover{border-color:color-mix(in srgb,var(--fg) 45%,var(--line))}
.sidetoggle{display:none;margin-right:.4rem}
/* a narrow head wraps onto a second line rather than push "Delete" out of a window that cannot scroll: with the
   model's button beside longer words (German, at 320px) one line does not hold them all */
@media (max-width:760px){.head{flex-wrap:wrap;row-gap:.1rem}.head .ht{flex-basis:3rem}}
@media (max-width:760px){.side{display:none;position:absolute;z-index:3;inset:0 auto 0 0;background:var(--bg);box-shadow:4px 0 18px rgba(0,0,0,.25)}
 .side.open{display:flex}.sidetoggle{display:inline-block}.head{padding-left:.5rem}}
/* the list of chats lying over the chat (narrow windows only): everything behind it is dimmed, and a click there
   closes the list and reaches nothing else. In a wide window, where the list stands beside the chat, this is never shown */
.shade{display:none}
@media (max-width:760px){.sideclose{display:inline-block;flex:none}.side.open + .shade{display:block;position:fixed;inset:0;z-index:2;background:rgba(0,0,0,.4);
 -webkit-tap-highlight-color:transparent}}
@media (max-width:760px) and (prefers-color-scheme:dark){.side.open + .shade{background:rgba(0,0,0,.6)}}

/* choosing a language */
.lang{appearance:none;-webkit-appearance:none;border:1px solid transparent;border-radius:8px;font-size:inherit;
 padding:.3rem 1.35rem .3rem .5rem;color:var(--muted);cursor:pointer;background-color:transparent;background-repeat:no-repeat;
 background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
 background-position:calc(100% - .68rem) 55%,calc(100% - .4rem) 55%;background-size:.28rem .28rem}
.lang:hover{color:var(--fg);background-color:var(--tint)}
.langs{display:flex;gap:1.1rem;justify-content:center;margin-top:1.3rem;font-size:.88rem}
.langs a{color:var(--muted);text-decoration:none}
.langs a:hover{color:var(--fg)}
.langs a[aria-current]{color:var(--fg);font-weight:600}
