@import url('/ui.css?v=8b4feaf158');

/* The chat, and the workspace beside it once there is a model. */
body{display:flex; flex-direction:column; overflow:hidden}
.bar{flex:none; display:flex; justify-content:center; align-items:center; position:relative;
  padding:14px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); border-bottom:1px solid var(--line2); background:var(--surface)}
.logo{display:block; height:24px; aspect-ratio:1081/251; background:var(--fg);
  -webkit-mask:url(/logo.png) no-repeat center / contain; mask:url(/logo.png) no-repeat center / contain}
#who{position:absolute; right:max(16px, env(safe-area-inset-right, 0px)); display:flex; gap:12px; align-items:center; font-size:14px}
.who-link{font:600 14px var(--mono); text-decoration:none; background:none; border:0; padding:0; color:inherit; cursor:pointer}
.who-out{border:0; background:none; color:var(--fg3); font:14px var(--sans); cursor:pointer; padding:6px 0}
#models-btn{color:var(--fg); font-weight:600; display:none}
.muted{color:var(--fg3)}

.app{flex:1; min-height:0; display:flex}
#chat{flex:1; min-width:0; display:flex; flex-direction:column}
#ws{display:none}
body.has-ws .bar{justify-content:flex-start}
body.has-ws #chat{flex:none; width:440px; border-right:1px solid var(--line)}
body.has-ws #ws{flex:1; min-width:0; display:flex; flex-direction:column; background:var(--surface)}

/* ---------------------------------------------------------------- the chat */
#thread{flex:1; min-height:0; overflow-y:auto; padding:24px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px))}
#thread > *{max-width:var(--col); margin-left:auto; margin-right:auto}
body.has-ws #thread{padding:20px 20px 24px}
#empty{height:100%; display:flex; align-items:center; justify-content:center}
#empty h1{font:700 30px/1.2 var(--sans); letter-spacing:-.01em; margin:0; text-align:center}
.turn{margin-bottom:28px; display:flex; flex-direction:column; gap:10px}
.ask{margin-left:auto; width:fit-content; max-width:85%; background:var(--surface); border:1px solid var(--line);
  border-radius:16px 16px 4px 16px; padding:10px 14px; white-space:pre-wrap}
.ask-on{margin-left:auto; font-size:12px; color:var(--fg3); margin-bottom:-6px}
.reply{display:flex; flex-direction:column; gap:10px}
.say{margin:0; color:var(--fg2)}

.chip{display:flex; align-items:center; gap:12px; width:100%; text-align:left; background:var(--surface); border:1px solid var(--line);
  border-radius:12px; padding:12px 14px; color:var(--fg); font:inherit; cursor:pointer}
.chip:hover{border-color:var(--fg3)}
.chip:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.chip.on{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent)}
.chip-ico{width:34px; height:34px; flex:none; border-radius:9px; background:color-mix(in srgb, var(--accent) 12%, transparent);
  color:var(--accent); display:flex; align-items:center; justify-content:center}
.chip-txt{flex:1; min-width:0; display:flex; flex-direction:column}
.chip-t{font-weight:600; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.chip-s{font-size:13px; color:var(--fg3)}
.chip-open{font-size:13px; font-weight:600; color:var(--accent); opacity:0}
.chip:hover .chip-open,.chip.on .chip-open,.chip:focus-visible .chip-open{opacity:1}

/* a build's progress, in the chat */
.prog{background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px 16px 12px}
.prog-h{display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:6px}
.prog-t{font-weight:600}
.prog-c,.st-c{font:13px var(--mono); color:var(--fg3); white-space:nowrap}
.prog-l{list-style:none; margin:0; padding:0}
.st{display:flex; gap:12px; align-items:flex-start; padding:6px 0}
.st-m{width:20px; height:20px; flex:none; border-radius:50%; border:2px solid var(--line); box-sizing:border-box;
  display:flex; align-items:center; justify-content:center; margin-top:2px}
.st.done .st-m{border:0; background:color-mix(in srgb, var(--accent) 14%, transparent); color:var(--accent)}
.st.now .st-m{border-color:var(--accent)}
.st-dot{width:7px; height:7px; border-radius:50%; background:var(--accent); animation:pulse 1.2s ease-in-out infinite}
.st-b{flex:1; min-width:0; display:flex; flex-direction:column; gap:6px}
.st-line{display:flex; justify-content:space-between; gap:10px; font-size:15px}
.st .st-n{color:var(--fg3)}
.st.done .st-n{color:var(--fg)}
.st.now .st-n{color:var(--fg); font-weight:600}
.st.now .st-c{color:var(--accent)}
.st-d{color:var(--fg3); font-weight:400}
.st-bar{height:4px; border-radius:2px; background:var(--line2); overflow:hidden; position:relative}
.st-bar span{position:absolute; inset:0 auto 0 0; width:40%; border-radius:2px; background:var(--accent); animation:sweep 1.8s ease-in-out infinite}
.st-hint{font-size:13px; color:var(--fg2)}
@keyframes pulse{0%,100%{opacity:.25}50%{opacity:1}}
@keyframes sweep{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
@media (prefers-reduced-motion:reduce){ .st-dot,.st-bar span{animation:none} }

/* the composer */
#composer{flex:none; width:100%; padding:12px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px))}
body.has-ws #composer{padding:10px 20px 18px}
.compose-col{max-width:var(--col); margin:0 auto}
.left{font-size:13px; color:var(--fg3); margin:0 0 6px 4px}
.compose-box{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:6px 6px 6px 4px}
.compose-box:focus-within{border-color:var(--fg3)}
.ctx{display:flex; flex-wrap:wrap; gap:6px; padding:4px 8px 2px}
.ctx[hidden]{display:none}
.ctx-chip{display:inline-flex; align-items:center; gap:2px; font-size:13px; background:var(--bg); border:1px solid var(--line2);
  border-radius:7px; padding:1px 2px 1px 8px; color:var(--fg2); max-width:100%}
.ctx-chip span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ctx-focus{color:var(--accent); border-color:color-mix(in srgb, var(--accent) 35%, transparent)}
.ctx-x{border:0; background:none; color:var(--fg3); font-size:16px; line-height:1; width:26px; height:24px; cursor:pointer; border-radius:5px}
.ctx-x:hover{color:var(--fg)}
.compose-row{display:flex; gap:10px; align-items:flex-end}
#q{flex:1; resize:none; font:16px/1.5 var(--sans); color:var(--fg); background:transparent;
  border:0; padding:8px 10px; outline:none; max-height:200px}
#send{flex:none; width:40px; height:40px; border-radius:10px; border:0; background:var(--fg); color:var(--surface);
  display:flex; align-items:center; justify-content:center; cursor:pointer}
#send:hover{opacity:.85}

/* ---------------------------------------------------------------- the workspace */
.tabs{flex:none; display:flex; align-items:flex-end; gap:4px; padding:10px 20px 0; border-bottom:1px solid var(--line);
  background:var(--bg); overflow-x:auto; scrollbar-width:none}
.tab{display:inline-flex; align-items:center; gap:6px; height:40px; padding:0 12px; border:1px solid transparent; border-bottom:0;
  border-radius:9px 9px 0 0; background:none; color:var(--fg2); font:14px var(--sans); cursor:pointer; flex:none; max-width:240px}
.tab.on{background:var(--surface); border-color:var(--line); color:var(--fg); font-weight:600; margin-bottom:-1px; height:41px}
.tab-n{border:0; background:none; font:inherit; color:inherit; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:8px 0}
.tab-x{border:0; background:none; color:var(--fg3); font-size:17px; line-height:1; width:24px; height:24px; border-radius:5px; cursor:pointer}
.tab-x:hover{color:var(--fg); background:var(--line2)}
.tab-back{display:none}
.wsbody{flex:1; min-height:0; overflow:hidden; display:flex}

.list{flex:1; overflow-y:auto; padding:26px 32px}
.list-h{display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:14px}
.list-h h1{margin:0; font-size:22px}
.list-q{font:15px var(--sans); padding:9px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--fg); width:min(320px, 100%)}
.list-q:focus{outline:2px solid var(--accent); outline-offset:1px}
.row{display:grid; grid-template-columns:minmax(0,1fr) minmax(90px,170px) 100px 100px; gap:16px; align-items:center; width:100%;
  text-align:left; padding:13px 12px; border:0; border-top:1px solid var(--line2); background:none; color:var(--fg); font:inherit; cursor:pointer; border-radius:0}
.row:hover{background:var(--bg)}
.row:focus-visible{outline:2px solid var(--accent); outline-offset:-2px}
.row-a{min-width:0; display:flex; flex-direction:column}
.row-t{font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.row-e,.row-n,.row-d{font-size:14px; color:var(--fg3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.row-v{font:15px var(--mono)}

.mview{flex:1; min-width:0; display:flex}
.mview-main{flex:1; min-width:0; overflow-y:auto; padding:20px 24px 32px}
.mview .mc{border:0; border-radius:0; overflow:visible}
.mview .mc section{padding-left:4px; padding-right:4px}
.vpick{appearance:auto; padding-right:8px}
.mc-btn.on{border-color:var(--fg)}
.old{display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:var(--bg); border:1px solid var(--line2); border-radius:10px;
  padding:10px 14px; margin-bottom:12px; font-size:14px; color:var(--fg2)}
.old span{flex:1; min-width:200px}
.old .ui-btn{padding:6px 12px; font-size:13px}

.hist{width:300px; flex:none; border-left:1px solid var(--line); padding:18px 14px; overflow-y:auto; display:flex; flex-direction:column; gap:4px}
.hist-h{display:flex; justify-content:space-between; align-items:center; padding:0 6px 8px}
.hist-h h2{margin:0; font-size:17px}
.ver{border-radius:10px}
.ver.on{background:color-mix(in srgb, var(--accent) 8%, transparent)}
.ver-open{display:flex; flex-direction:column; gap:3px; width:100%; text-align:left; border:0; background:none; color:var(--fg); font:inherit; padding:12px 12px 6px; cursor:pointer; border-radius:10px}
.ver-open:focus-visible{outline:2px solid var(--accent)}
.ver-top{display:flex; justify-content:space-between; gap:10px}
.ver-n{font-weight:600}
.ver-v{font:14px var(--mono)}
.ver-s{font-size:14px; color:var(--fg2)}
.ver-r{border:0; background:none; color:var(--accent); font:600 13px var(--sans); padding:0 12px 10px; cursor:pointer}
.ver:not(:has(.ver-r)) .ver-open{padding-bottom:12px}

/* ---------------------------------------------------------------- phone */
@media (max-width: 860px){
  body.has-ws .bar{justify-content:center}
  body.has-ws #chat{width:auto; flex:1; border-right:0}
  body.has-ws #models-btn{display:inline-block}
  body.has-ws #ws{display:none}
  body.has-ws.ws-open #ws{display:flex; position:fixed; inset:0; z-index:20}
  .tab-back{display:inline-flex; align-items:center; gap:2px; height:40px; padding:0 8px 0 0; border:0; background:none;
    color:var(--accent); font:600 15px var(--sans); cursor:pointer; flex:none}
  .tabs{padding:6px 12px 0}
  .list{padding:18px 16px}
  .row{grid-template-columns:minmax(0,1fr) auto; gap:4px 12px}
  .row-n,.row-d{display:none}
  .mview-main{padding:12px 8px 24px}
  .hist{position:fixed; inset:auto 0 0 0; width:auto; max-height:70%; background:var(--surface); border-left:0; border-top:1px solid var(--line);
    box-shadow:0 -16px 40px -20px rgba(0,0,0,.35); z-index:30; border-radius:14px 14px 0 0}
}
