/* Voice-first stage (Home / Projects) in the spirit of a voice companion: the orb IS the interface.
   No chat bubbles, no message box until you ask for one. Transcript and System are separate views. */

/* ---- floating top-left: connection, state, and the one line she is saying ---- */
#stageInfo{position:fixed;top:22px;left:26px;z-index:6;width:min(430px,calc(100vw - 150px));pointer-events:none;display:none}
body.view-home #stageInfo,body.view-proj #stageInfo{display:block}
#stageInfo #conn{display:inline-flex;margin-bottom:12px}
#stageInfo #stage-caption{position:static;display:block;margin:0 0 6px;text-align:left;pointer-events:none}
#stageInfo #stage-caption b{display:inline;font-size:11px;letter-spacing:5px;color:var(--st);text-shadow:0 0 14px rgba(var(--st-rgb),.6);font-weight:500}
#stageInfo #stage-caption small{display:inline;margin-left:12px;color:var(--muted);font-size:11px;letter-spacing:.5px}
#subtitle{margin:8px 0 0;font-size:15px;line-height:1.55;color:#e8eefb;text-shadow:0 1px 8px #000;overflow-wrap:anywhere;transition:opacity 1.2s}
#subtitle[data-who=you]{color:var(--muted);font-size:13px}
#subtitle.fade{opacity:.32}

/* ---- home and projects: top bar is just the view buttons + status icons, floating top-right ---- */
body.view-home #topbar,body.view-proj #topbar{position:fixed;top:14px;right:18px;left:auto;z-index:7;background:none;padding:0;gap:6px}
body.view-proj .brand,body.view-home #topbar .spacer,body.view-proj #topbar .spacer,body.view-home #menu,body.view-proj #menu{display:none}
body.view-home #views,body.view-proj #views{margin:0}
body.view-home #app,body.view-proj #app{position:absolute;inset:0;z-index:0}
body.view-home main,body.view-proj main{position:relative}
body.view-home #orbWrap,body.view-proj #orbWrap{position:absolute;inset:0;height:auto;z-index:0;pointer-events:auto;cursor:pointer}
body.view-home #orbState,body.view-proj #orbState{display:none}
body.view-proj .hudcol,body.view-chat .hudcol{display:none}
/* HOME carries the system panels (vitals, telemetry, radar, audio, diagnostics) beside the orb on wide screens */
body.view-home .hudcol{display:none}
@media (min-width:1051px){body.view-home .hudcol{display:flex;width:272px;padding:150px 12px 24px;z-index:1}body.view-home #stats{display:none}body.view-home #subtitle{max-height:84px;overflow:hidden}}
#subtitle{max-height:34vh;overflow:hidden}   /* her text can never grow down into the line that shows your words */   /* the vitals panel replaces the stat tiles */
body.view-home #messages,body.view-proj #messages{display:none}
body.view-home #jobs,body.view-proj #jobs{position:fixed;left:26px;bottom:60px;width:min(420px,calc(100vw - 120px));z-index:8}

/* ---- the message line only exists when you want it ---- */
body.view-home #composer,body.view-proj #composer{display:none}
body.view-home.typing #composer,body.view-proj.typing #composer{display:flex;position:fixed;left:50%;bottom:44px;transform:translateX(-50%);width:min(640px,calc(100vw - 150px));z-index:9;margin:0}
#kbBtn{display:none;position:fixed;left:50%;bottom:30px;transform:translateX(-50%);z-index:8;width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:rgba(14,16,42,.6);color:#c9d1f3;cursor:pointer;backdrop-filter:blur(10px)}
#kbBtn .i{width:20px;height:20px;vertical-align:middle}
#kbBtn:hover{border-color:var(--st);color:var(--st)}
body.view-home #kbBtn,body.view-proj #kbBtn{display:block}
body.typing #kbBtn{display:none}

/* ---- XP: a thin line along the bottom instead of a big footer ---- */
body.view-home #foot,body.view-proj #foot{position:fixed;left:0;right:0;bottom:0;padding:0 26px 10px;gap:14px;background:none;z-index:6;pointer-events:none}
body.view-home #foot .obj small,body.view-proj #foot .obj small,body.view-home #foot .pct,body.view-proj #foot .pct{display:none}
body.view-home #foot .obj b,body.view-proj #foot .obj b{font-size:10px;letter-spacing:3px;color:var(--muted);font-weight:500}
body.view-home #foot .bar,body.view-proj #foot .bar{height:3px;max-width:260px;background:rgba(160,170,230,.14)}
body.view-home #foot .bar i,body.view-proj #foot .bar i{background:var(--st);filter:none;box-shadow:0 0 8px rgba(var(--st-rgb),.7)}
#gearBtn{bottom:24px}
body.view-chat #gearBtn,body.view-dash #gearBtn{bottom:70px}
#settingsPanel{bottom:90px}

/* ---- project board: chamfered panels with a coloured top edge, linked to the orb ---- */
#board{display:none}
body.view-proj #board{display:block;position:absolute;inset:0;z-index:2;pointer-events:none}
#boardLinks{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
#boardLinks path{fill:none;stroke-width:1;opacity:.55}
#boardLinks circle{opacity:.95}
#boardHead{position:absolute;top:18px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:14px;pointer-events:auto}
#projSel{appearance:none;border:0;background:none;color:#f1f4ff;font:500 26px "Cormorant Garamond",Georgia,serif;letter-spacing:2px;text-align:center;cursor:pointer;max-width:42vw;text-overflow:ellipsis;padding-right:4px;text-shadow:0 0 18px rgba(var(--st-rgb),.5)}
#projSel option{background:#0b0c26;font:14px "Segoe UI",sans-serif}
#projSaved{color:var(--muted);font-size:11px;letter-spacing:1px;min-width:50px}
#boardHead .set{padding:6px 14px;border-radius:99px;border:1px solid rgba(var(--st-rgb),.5);background:transparent;color:var(--text);font:12px "Segoe UI",sans-serif;letter-spacing:1px;cursor:pointer}
#boardHead .set:hover{background:rgba(var(--st-rgb),.15)}
.bp{--ac:#efbc65;--fill:#1d1b2a;position:absolute;pointer-events:auto;display:flex;flex-direction:column;padding:14px 18px 16px;isolation:isolate;
  --cut:18px;clip-path:polygon(var(--cut) 0,calc(100% - var(--cut)) 0,100% var(--cut),100% calc(100% - var(--cut)),calc(100% - var(--cut)) 100%,var(--cut) 100%,0 calc(100% - var(--cut)),0 var(--cut));
  background:color-mix(in srgb,var(--ac) 60%,transparent)}
.bp::before{content:"";position:absolute;inset:1px;z-index:-1;pointer-events:none;
  clip-path:polygon(var(--cut) 0,calc(100% - var(--cut)) 0,100% var(--cut),100% calc(100% - var(--cut)),calc(100% - var(--cut)) 100%,var(--cut) 100%,0 calc(100% - var(--cut)),0 var(--cut));
  background:linear-gradient(150deg,var(--fill),rgba(6,6,24,.96) 90%)}
.bp::after{content:"";position:absolute;left:var(--cut);right:var(--cut);top:1px;height:2px;background:linear-gradient(90deg,transparent,var(--ac),transparent);opacity:.9;box-shadow:0 0 14px 1px var(--ac)}
.bp h3{margin:0 0 10px;font-size:11px;letter-spacing:4px;color:var(--ac);font-weight:600}
#boardGrid{position:absolute;inset:14% 0 5%;pointer-events:none}
/* same arrangement as the reference project board (percent of the board area) */
.bp-brief{--ac:#efbc65;--fill:#26221c;left:53.8%;top:2.6%;width:18.5%;height:24%}
.bp-parts{--ac:#64ccff;--fill:#0c2338;left:10.7%;top:9.9%;width:15%;height:26.5%}
.bp-memory{--ac:#cb9af4;--fill:#211a33;left:10.1%;top:55.5%;width:15.6%;height:40%}
.bp-plan{--ac:#59ede3;--fill:#0b2a33;left:64.7%;top:21.1%;width:27.5%;height:71.8%}
.bp-tasks{--ac:#f2a63e;--fill:#2a2012;left:37.5%;top:85%;width:14.6%;height:14.5%}
.bp textarea{flex:1;min-height:0;resize:none;border:0;background:transparent;color:#ece9e0;font:14px/1.6 "Segoe UI",sans-serif;outline:none}
.bp ul{flex:1;min-height:0;overflow-y:auto;margin:0;padding:0;list-style:none;font-size:13px;line-height:1.5;color:#dde3f7;scrollbar-width:thin}
.bp li{display:flex;gap:8px;align-items:flex-start;padding:4px 0;border-bottom:1px solid rgba(160,170,230,.1)}
.bp li span{flex:1;overflow-wrap:anywhere}
.bp li button{border:0;background:none;color:var(--muted);cursor:pointer;padding:2px}
.bp li button:hover{color:var(--ac)}
.bp li.empty{color:var(--muted);border:0}
.bp form input{width:100%;margin-top:8px;padding:8px 10px;border-radius:8px;border:1px solid rgba(160,170,230,.22);background:rgba(8,8,30,.7);color:var(--text);font:13px "Segoe UI",sans-serif;outline:none}
.bp form input:focus{border-color:var(--ac)}

@media (max-width:1000px){
  body.view-proj #board{overflow-y:auto;pointer-events:auto}
  .bp{position:relative;left:auto;right:auto;top:auto;width:auto;height:240px;margin:12px 16px}
  #boardHead{position:relative;transform:none;left:auto;top:auto;justify-content:center;margin:70px 0 6px}
  #boardLinks{display:none}
}

/* board polish */
#boardHead{left:36%}
body.view-proj #kbBtn{left:26px;transform:none;bottom:44px}

/* ---- clock, system stats, hover tooltip on the home screen ---- */
#stageClock{position:fixed;top:16px;left:50%;transform:translateX(-50%);z-index:6;text-align:center;pointer-events:none;display:none}
body.view-home #stageClock,body.view-proj #stageClock{display:block}
#stageClock b{display:block;font:300 26px "Segoe UI Variable Display","Segoe UI",sans-serif;letter-spacing:3px;color:#eaf1ff;text-shadow:0 0 18px rgba(var(--st-rgb),.45)}
#stageClock small{display:block;font-size:10px;letter-spacing:3px;color:var(--muted);margin-top:2px}
#stats{position:fixed;left:26px;bottom:34px;z-index:6;display:none;gap:8px;flex-wrap:wrap;max-width:calc(100vw - 180px);pointer-events:none}
body.view-home #stats,body.view-proj #stats{display:flex}
.sc{position:relative;min-width:84px;padding:6px 12px 8px;border:1px solid var(--line);border-radius:10px;background:rgba(8,16,44,.55);backdrop-filter:blur(8px);overflow:hidden}
.sc span{display:block;font-size:9px;letter-spacing:2px;color:var(--muted)}
.sc b{display:block;font:500 14px "Segoe UI",sans-serif;color:#eaf1ff;margin-top:2px;white-space:nowrap}
.sc b small{font-size:10px;font-weight:400;color:var(--muted)}
.sc i{position:absolute;left:0;bottom:0;height:2px;background:var(--st);box-shadow:0 0 8px rgba(var(--st-rgb),.8);transition:width .8s}
#tip{position:fixed;z-index:20;max-width:250px;padding:8px 11px;border:1px solid var(--st);border-radius:8px;background:rgba(6,12,36,.92);color:#eaf1ff;font-size:12px;line-height:1.45;pointer-events:none;backdrop-filter:blur(8px)}
#tip small{display:block;font-size:9px;letter-spacing:2px;color:var(--muted);margin-bottom:3px}
body.view-home #jobs,body.view-proj #jobs{bottom:110px}
body.view-proj #stats{left:26px;bottom:34px;max-width:calc(100vw - 480px)}
@media (max-width:900px){#stageClock{display:none!important}#stats .sc:nth-child(n+4){display:none}}

/* ---- draggable, resizable panels (grab the title; drag the corner; double-click the title to reset) ---- */
.bp h3{cursor:grab;user-select:none;touch-action:none;margin-right:2px;outline:none;display:flex;align-items:center;gap:8px}
.bp h3::before{content:"";width:10px;height:10px;background:radial-gradient(circle,var(--ac) 1.3px,transparent 1.6px) 0 0/5px 5px;opacity:.8}
.bp h3:focus-visible{text-decoration:underline}
.bp.dragging{cursor:grabbing;transition:none}.bp.dragging h3{cursor:grabbing}
.bp.is-focused{z-index:3}.bp.is-focused::after{opacity:1;box-shadow:0 0 18px 2px var(--ac)}
.bp .rs{position:absolute;right:20px;bottom:5px;width:15px;height:15px;cursor:nwse-resize;touch-action:none;opacity:.55;
  background:linear-gradient(135deg,transparent 55%,var(--ac) 55% 62%,transparent 62% 76%,var(--ac) 76% 83%,transparent 83%)}
.bp .rs:hover{opacity:1}
#projReset{padding:6px 12px;border-radius:99px;border:1px solid var(--line);background:transparent;color:var(--muted);font:11px "Segoe UI",sans-serif;letter-spacing:1px;cursor:pointer}
#projReset:hover{color:var(--text);border-color:var(--st)}
@media (max-width:1000px){.bp h3{cursor:default}.bp h3::before,.bp .rs{display:none}}

body.view-proj #stageClock{display:none}

/* ================= UI/UX fixes ================= */
html,body{overflow-x:hidden}
/* talk + keyboard buttons sit together at the bottom centre; stats stay left, settings right */
#talkBtn{display:none;position:fixed;left:50%;bottom:22px;transform:translateX(-62px);z-index:9;width:60px;height:60px;border-radius:50%;border:1px solid rgba(var(--st-rgb),.6);background:rgba(10,18,46,.7);color:var(--st);cursor:pointer;backdrop-filter:blur(10px);box-shadow:0 0 28px rgba(var(--st-rgb),.25);transition:.2s}
#talkBtn .i{width:26px;height:26px;vertical-align:middle}
#talkBtn:hover{background:rgba(var(--st-rgb),.18);box-shadow:0 0 36px rgba(var(--st-rgb),.45)}
#talkBtn.on{background:var(--st);color:#07101f;animation:talkpulse 1.2s infinite}
@keyframes talkpulse{50%{box-shadow:0 0 44px rgba(var(--st-rgb),.9)}}
body.view-home #talkBtn,body.view-proj #talkBtn{display:block}
#kbBtn,body.view-proj #kbBtn{left:50%;right:auto;transform:translateX(14px);bottom:30px;width:44px;height:44px}
body.typing #talkBtn{display:none}
#legend{margin:10px 0 0;font-size:11.5px;line-height:1.5;color:var(--muted);max-width:330px;display:none}
body.view-home #legend{display:block}
.sc.time{display:none}
/* top bar and header: nothing may overlap */
#chipsTop .pill{display:inline-flex;align-items:center;white-space:nowrap;padding:4px 10px;font-size:10px;line-height:1.2;height:auto;width:auto;min-width:0;border-radius:99px}
#objective{max-width:24vw}
@media (max-width:1180px){#objective{display:none!important}#chipsTop{display:none!important}}
@media (max-width:1100px){#stageClock{display:none!important}.sc.time{display:block}}
/* projects: header sits under the top row, stats step aside */
body.view-proj #boardHead{top:64px;left:50%}
body.view-proj #stats{display:none}
body.view-proj #stageInfo{width:min(300px,30vw)}
body.view-proj #legend,body.view-proj #subtitle{display:none}
#projSel{font-size:22px}
/* stats strip: legible and never wider than the space before the buttons */
.sc span{font-size:10px}.sc{min-width:78px}
#stats{max-width:calc(50vw - 90px)}
@media (max-width:900px){#stats .sc:nth-child(n+4):not(.time){display:none}}
/* transcript and system views */
body.view-chat #gearBtn,body.view-dash #gearBtn{bottom:104px}
body.view-chat #orbWrap{height:clamp(110px,18vh,160px)}
body.view-chat #orbState{display:none}
body.view-chat #app,body.view-dash #app{overflow-x:hidden}
body.view-dash #app{overflow-y:auto}
body.view-dash .hudcol{display:flex;width:100%;flex:none;flex-direction:row;flex-wrap:wrap}
body.view-dash .hudcol .panel{flex:1 1 280px}
body.view-dash #orbWrap{height:clamp(150px,24vh,220px)}
body.view-dash #orbState{display:none}
@media (min-width:1051px){body.view-dash .hudcol{width:292px;flex-direction:column}body.view-dash .hudcol .panel{flex:none}body.view-dash .hudcol .panel.grow{flex:1}}
/* bigger, calmer caption text */
#stageInfo #stage-caption b{font-size:12px}#stageInfo #stage-caption small{font-size:12px}
#subtitle{font-size:16px}
/* small screens (phones): stack the corner controls */
@media (max-width:640px){
  body.view-home #topbar,body.view-proj #topbar{right:8px;top:10px}
  #views button{padding:6px 9px;font-size:12px}
  body.view-home #topbar .icon:not(#ttsBtn),body.view-proj #topbar .icon:not(#ttsBtn){display:none}
  #stageInfo{top:56px;left:14px}
  #stats{left:14px;bottom:92px;max-width:calc(100vw - 28px)}
  #gearBtn{right:14px;bottom:24px}
  #talkBtn{transform:translateX(-66px)}
  body.view-proj #boardHead{top:56px}
}
body.view-proj #talkBtn{left:28px;transform:none;bottom:26px}
body.view-proj #kbBtn{left:98px;transform:none;bottom:34px}
#boardHead .set{white-space:nowrap}
body.view-dash #messages,body.view-dash #composer,body.view-dash #chips,body.view-dash #talkBtn,body.view-dash #kbBtn{display:none}

/* what you said, printed as soon as it is recognised */
#heardLine{position:fixed;left:50%;bottom:128px;transform:translateX(-50%);z-index:6;max-width:min(780px,82vw);text-align:center;font-size:21px;line-height:1.4;color:#eaf1ff;text-shadow:0 1px 12px #000,0 0 18px rgba(var(--st-rgb),.35);opacity:0;transition:opacity .35s;pointer-events:none;overflow-wrap:anywhere}
#heardLine.show{opacity:1}
#heardLine[data-who=heard]{font-size:15px;color:var(--muted);font-style:italic}
body.view-chat #heardLine{display:none}

/* TODAY panel */
#todayList{display:flex;flex-direction:column;gap:7px;max-height:178px;overflow-y:auto;font-size:12.5px;line-height:1.35}
#todayList .trow{display:flex;gap:9px;align-items:flex-start;color:var(--text)}
#todayList .tick{flex:none;width:15px;height:15px;margin-top:2px;border:1.5px solid var(--accent);border-radius:50%;background:none;cursor:pointer;padding:0}
#todayList .tick:hover{background:rgba(90,168,255,.35)}
#todayList .tdot{flex:none;width:7px;height:7px;margin:6px 4px 0 4px;border-radius:50%;background:var(--accent);opacity:.7}
#todayList .ttxt small{display:block;color:var(--muted);font-size:10.5px;letter-spacing:.4px}
#todayList .ttxt small b{font-weight:600;letter-spacing:1.5px;color:#6f93d0}
#todayList .trow.done .ttxt{opacity:.5;text-decoration:line-through}
#todayList .trow.done .tick{background:var(--accent)}
#todayList .tempty{color:var(--muted);font-size:12px}
/* the diagram board covers the page: keep the side panels from showing through it */
body.ideas-open .hudcol{visibility:hidden}

/* HOME shows the name */
body.view-home .brand{display:block;position:fixed;top:14px;left:26px;z-index:7;pointer-events:none}
body.view-home .brand b{font-size:24px;letter-spacing:10px;color:#f2f6ff;text-shadow:0 0 22px rgba(var(--st-rgb),.7);font-weight:600}
body.view-home #stageInfo{top:52px}
@media (min-width:1051px){body.view-home .hudcol{padding-top:196px}}
@media (max-width:640px){body.view-home .brand b{font-size:18px;letter-spacing:6px}body.view-home #stageInfo{top:48px}}
body.view-home .brand span{display:none}
/* while the diagram board is open it owns the screen: nothing from Home may paint over it */
body.ideas-open #stageInfo,body.ideas-open #heardLine,body.ideas-open #stageClock,body.ideas-open #stats,body.ideas-open #orbState{visibility:hidden}
