/* Layout: friendly guided app — 6-question setup → "setting up" sequence → tabbed HQ (Home · Team · Apps · To-do). Mobile: bottom tab bar, sheets for setup wizards. */
:root{
  --bg:#EEF1EF; --surface:#FFFFFF; --surface-2:#E3E9E6; --ink:#12201B; --muted:#56675F; --line:#D2DAD6;
  --accent:#1F4FE0; --accent-ink:#FFFFFF; --accent-soft:#DDE5FD;
  --ok:#1E7A4C; --ok-soft:#D8EFE2; --warn:#8F5400; --warn-soft:#FAEACC; --bad:#B4322A; --bad-soft:#F7DDDA;
  --dot:#B9C6C0; --scrim:rgba(10,20,16,.45);
  --f-display:"Bricolage Grotesque","Avenir Next",system-ui,sans-serif;
  --f-body:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,"SF Mono",Menlo,monospace;
  --nav-h:64px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0C1311; --surface:#141D1A; --surface-2:#1B2622; --ink:#E5EDE9; --muted:#97A9A1; --line:#283632;
  --accent:#829FFF; --accent-ink:#0A1024; --accent-soft:#1D2852;
  --ok:#62D29C; --ok-soft:#14322A; --warn:#F0B655; --warn-soft:#382A10; --bad:#FF8C82; --bad-soft:#3B1A17;
  --dot:#33433D; --scrim:rgba(0,0,0,.6); color-scheme:dark }}
:root[data-theme="dark"]{
  --bg:#0C1311; --surface:#141D1A; --surface-2:#1B2622; --ink:#E5EDE9; --muted:#97A9A1; --line:#283632;
  --accent:#829FFF; --accent-ink:#0A1024; --accent-soft:#1D2852;
  --ok:#62D29C; --ok-soft:#14322A; --warn:#F0B655; --warn-soft:#382A10; --bad:#FF8C82; --bad-soft:#3B1A17;
  --dot:#33433D; --scrim:rgba(0,0,0,.6); color-scheme:dark }

*{box-sizing:border-box}
[hidden]{display:none!important}
#stepLabel{white-space:nowrap}
.card.totalbar{flex-direction:row}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.5;padding-inline:16px;padding-block:0}
h1,h2,h3{font-family:var(--f-display);text-wrap:balance;margin:0;letter-spacing:-.01em}
p{margin:0}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.mono{font-family:var(--f-mono);font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
.small{font-size:13.5px}
.eyebrow{font-family:var(--f-mono);font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.btn{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:10px 18px;font-weight:600;font-size:15px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.btn:hover{border-color:var(--muted)}
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.btn.primary:hover{filter:brightness(1.07)}
.btn.ghost{background:transparent;border-color:transparent}
.btn.sm{padding:6px 13px;font-size:13.5px}
.btn:disabled{opacity:.5;cursor:default}
.wrap{max-width:1100px;margin:0 auto}
.ico{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.help{font-size:14px;color:var(--muted);background:var(--surface-2);border-radius:12px;padding:12px 14px}
.help b{color:var(--ink)}
details.why summary{cursor:pointer;font-size:13.5px;font-weight:600;color:var(--accent);list-style:none;display:inline-flex;gap:6px;align-items:center}
details.why summary::before{content:"?";width:18px;height:18px;border-radius:50%;border:1.5px solid currentColor;display:inline-grid;place-items:center;font-size:11px}
details.why summary::-webkit-details-marker{display:none}
details.why[open] summary{margin-bottom:8px}

/* ---------- Setup ---------- */
#onboard{max-width:620px;margin:0 auto;padding-block:28px 48px;display:flex;flex-direction:column;gap:22px}
.brand{display:flex;align-items:center;gap:10px}
.mark{width:30px;height:30px;border-radius:8px;background:var(--ink);display:grid;place-items:center;flex:none}
.brand b{font-family:var(--f-display);font-size:19px;font-weight:800;letter-spacing:-.02em}
.pitch h1{font-size:clamp(28px,6.5vw,40px);font-weight:800;line-height:1.08}
.pitch p{color:var(--muted);margin-top:10px;max-width:50ch}
.progress{display:flex;gap:4px}
.progress i{flex:1;height:5px;border-radius:5px;background:var(--surface-2)}
.progress i.on{background:var(--accent)}
.qcard{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:22px;display:flex;flex-direction:column;gap:16px}
.qcard h2{font-size:24px;font-weight:700}
.qcard .hint{color:var(--muted);font-size:14.5px;margin-top:-8px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:14px;font-weight:600}
.field input,.field textarea,.field select{width:100%;background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:12px 13px;resize:vertical}
.field textarea{min-height:90px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{border:1px solid var(--line);background:var(--bg);border-radius:999px;padding:8px 14px;font-size:14px}
.chip[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);font-weight:600}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
.pick{border:1.5px solid var(--line);background:var(--bg);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:8px;text-align:left;font-weight:600;font-size:14.5px;position:relative}
.pick .ico{width:24px;height:24px;color:var(--muted)}
.pick[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.pick[aria-pressed="true"] .ico{color:var(--accent)}
.pick[aria-pressed="true"]::after{content:"✓";position:absolute;top:10px;right:12px;color:var(--accent);font-weight:800}
.opt{display:flex;flex-direction:column;gap:8px}
.optrow{display:flex;gap:12px;align-items:flex-start;border:1.5px solid var(--line);border-radius:14px;padding:13px 14px;background:var(--bg);text-align:left;width:100%}
.optrow[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.optrow b{display:block;font-size:15px}
.optrow span{font-size:13.5px;color:var(--muted)}
.radio{width:18px;height:18px;border-radius:50%;border:2px solid var(--muted);flex:none;margin-top:2px}
.optrow[aria-pressed="true"] .radio{border-color:var(--accent);background:radial-gradient(var(--accent) 45%,transparent 50%)}
.qnav{display:flex;justify-content:space-between;align-items:center;gap:10px}
.example{font-size:13px;color:var(--warn);background:var(--warn-soft);border-radius:8px;padding:6px 10px;align-self:flex-start}
.drop{border:1.5px dashed var(--line);border-radius:12px;padding:16px;text-align:center;color:var(--muted);font-size:14px;background:var(--bg);display:block;cursor:pointer}
.drop.over{border-color:var(--accent);color:var(--ink)}
.filelist{display:flex;flex-direction:column;gap:6px;font-size:13.5px}
.filelist div{display:flex;justify-content:space-between;align-items:center;gap:8px;background:var(--bg);border-radius:8px;padding:6px 10px}

/* ---------- Building ---------- */
#building{max-width:620px;margin:0 auto;padding-block:56px;display:flex;flex-direction:column;gap:18px}
#building h2{font-size:30px;font-weight:800}
.steps-live{display:flex;flex-direction:column;gap:10px}
.steps-live div{display:flex;gap:10px;align-items:center;color:var(--muted)}
.steps-live div i{width:20px;height:20px;border-radius:50%;border:2px solid var(--line);flex:none;display:grid;place-items:center;font-size:12px;font-style:normal}
.steps-live div.done{color:var(--ink)}
.steps-live div.done i{background:var(--ok);border-color:var(--ok);color:var(--surface)}
.steps-live div.now{color:var(--ink);font-weight:600}
.steps-live div.now i{border-color:var(--accent);border-top-color:transparent;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- HQ ---------- */
#hq{display:flex;flex-direction:column;min-height:100%}
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;background:var(--bg);margin-inline:-16px;padding:12px 16px;border-bottom:1px solid var(--line)}
.top .wrap{display:flex;align-items:center;gap:14px}
.co{display:flex;flex-direction:column;min-width:0;flex:1}
.co b{font-family:var(--f-display);font-size:19px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.co span{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tabs{display:flex;gap:4px}
.tab{border:0;background:transparent;padding:8px 14px;border-radius:999px;font-weight:600;color:var(--muted);display:flex;gap:7px;align-items:center;position:relative}
.tab[aria-selected="true"]{background:var(--surface);color:var(--ink);box-shadow:0 0 0 1px var(--line)}
.badge{font-family:var(--f-mono);font-size:11px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--bad);color:#fff;display:inline-grid;place-items:center}
.badge[data-n="0"]{display:none}
.demo-note{display:flex;gap:10px;align-items:flex-start;font-size:13.5px;background:var(--warn-soft);color:var(--ink);border-radius:12px;padding:10px 14px}
.demo-note b{color:var(--warn)}
main{flex:1;padding-block:20px 40px}
.panel{display:flex;flex-direction:column;gap:18px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:12px;min-width:0}
.card h3{font-size:18px}
.sec-h{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap}
.sec-h h2{font-size:22px}

/* Home */
.home-grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:18px;align-items:start}
.hello{background:var(--ink);color:var(--bg);border-radius:18px;padding:20px;display:flex;flex-direction:column;gap:12px}
.hello .eyebrow{color:color-mix(in srgb,var(--bg) 65%,transparent)}
.hello p{max-width:62ch}
.ceo-id{display:flex;align-items:center;gap:12px}
.av{width:42px;height:42px;border-radius:50%;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;font-family:var(--f-display);font-weight:800;font-size:18px;flex:none}
.how{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.how div{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:4px}
.how b{font-family:var(--f-display);font-size:16px}
.how span{font-size:13.5px;color:var(--muted)}
.how em{font-style:normal;font-family:var(--f-mono);font-size:12px;color:var(--accent)}
.check{display:flex;flex-direction:column;gap:8px}
.check-item{display:flex;gap:12px;align-items:center;padding:10px 12px;border-radius:12px;background:var(--bg)}
.check-item .tick{width:24px;height:24px;border-radius:50%;border:2px solid var(--line);flex:none;display:grid;place-items:center;font-size:13px;font-weight:800}
.check-item.done .tick{background:var(--ok);border-color:var(--ok);color:var(--surface)}
.check-item.done .lbl{color:var(--muted);text-decoration:line-through}
.check-item .lbl{flex:1;min-width:0;font-weight:600;font-size:14.5px}
.check-item .lbl span{display:block;font-weight:400;font-size:13px;color:var(--muted);text-decoration:none}
.meter{height:6px;background:var(--surface-2);border-radius:6px;overflow:hidden}
.meter i{display:block;height:100%;background:var(--ok);transition:width .5s}
.chat{background:var(--surface);border:1px solid var(--line);border-radius:18px;display:flex;flex-direction:column;min-width:0}
.chat-h{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;align-items:center}
.thread{padding:16px;display:flex;flex-direction:column;gap:12px;min-height:180px}
.msg{max-width:88%;padding:11px 14px;border-radius:16px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px}
.msg.me{align-self:flex-end;background:var(--accent);color:var(--accent-ink);border-bottom-right-radius:4px}
.msg.ceo{align-self:flex-start;background:var(--surface-2);border-bottom-left-radius:4px}
.msg.note{align-self:flex-start;background:transparent;padding:0 4px;font-size:13px;color:var(--muted)}
.msg.err{align-self:center;background:var(--bad-soft);color:var(--bad);font-size:13.5px}
.msg.rec{align-self:flex-start;background:var(--surface);border:1.5px solid var(--accent);display:flex;gap:12px;align-items:center;white-space:normal}
.msg.rec div{flex:1;min-width:0;font-size:14px}
.suggest{display:flex;gap:8px;flex-wrap:wrap;padding:0 16px 14px}
.composer{position:sticky;bottom:0;display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);background:var(--surface);border-radius:0 0 18px 18px}
.composer textarea{flex:1;min-width:0;resize:none;border:1px solid var(--line);background:var(--bg);border-radius:14px;padding:11px 13px;height:46px;max-height:140px}
.kv{display:flex;justify-content:space-between;gap:10px;font-size:14.5px}
.kv span{color:var(--muted)}

/* Team */
.teams{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:14px;align-items:start}
.team{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:12px;min-width:0}
.team-head{display:flex;gap:12px;align-items:center}
.team-ico{width:42px;height:42px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;flex:none}
.team-head h3{font-size:18px}
.team-head span{font-size:13px;color:var(--muted)}
.team ul{margin:0;padding-left:18px;font-size:14px;display:flex;flex-direction:column;gap:3px}
.lbl-sm{font-size:13px;font-weight:600}
.seg{display:grid;grid-template-columns:repeat(3,1fr);background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:3px;gap:3px}
.seg button{border:0;background:transparent;border-radius:9px;padding:8px 4px;font-size:12.5px;font-weight:600;color:var(--muted);line-height:1.25}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.14)}
.seg-desc{font-size:13px;color:var(--muted);margin-top:-4px}
.tools{display:flex;flex-wrap:wrap;gap:6px}
.tool{display:inline-flex;gap:6px;align-items:center;font-size:13px;border-radius:999px;padding:4px 10px 4px 4px;background:var(--bg);border:1px solid var(--line)}
.tool.on{border-color:var(--ok);background:var(--ok-soft)}
.tool .mono-tile{width:20px;height:20px;font-size:10px;border-radius:6px}
.tool button{border:0;background:none;color:var(--accent);font-weight:600;padding:0;font-size:13px}
.helpers{display:flex;flex-wrap:wrap;gap:3px}
.helpers i{width:9px;height:9px;border-radius:3px;background:var(--dot)}
.helpers i.busy{background:var(--accent);animation:pulse 1.6s ease-in-out infinite}
@keyframes pulse{50%{opacity:.45}}
.roles{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.role{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;font-size:14px;border-top:1px solid var(--line);padding-top:8px}
.role span{grid-column:1/-1;color:var(--muted);font-size:13px}
.addteam{display:flex;flex-wrap:wrap;gap:8px}

/* Apps */
.mono-tile{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;font-family:var(--f-display);font-weight:800;font-size:17px;background:var(--surface-2);color:var(--ink);flex:none}
.apps{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.app{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:10px;min-width:0}
.app-top{display:flex;gap:12px;align-items:center}
.app-top b{display:block;font-size:16px}
.app-top span{font-size:12.5px;color:var(--muted)}
.app p{font-size:14px;color:var(--muted);flex:1}
.app.on{border-color:var(--ok)}
.status{font-size:12.5px;font-weight:600;color:var(--ok);display:flex;gap:6px;align-items:center}
.status::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--ok)}
.price{font-family:var(--f-display);font-weight:800;font-size:20px}
.price small{font-family:var(--f-body);font-weight:400;font-size:13px;color:var(--muted)}
.addon{border-style:dashed}
.addon.on{border-style:solid}
.totalbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}

/* To-do */
.todo-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start}
.list{display:flex;flex-direction:column;gap:10px}
.task{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:8px;min-width:0}
.task-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.task b{font-size:15px;font-weight:600}
.task .meta{font-size:12.5px;color:var(--muted)}
.task p{font-size:13.5px;color:var(--muted)}
.pill{font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;white-space:nowrap}
.pill.working{background:var(--accent-soft);color:var(--accent)}
.pill.review,.pill.proposed{background:var(--warn-soft);color:var(--warn)}
.pill.done{background:var(--ok-soft);color:var(--ok)}
.pill.declined{background:var(--bad-soft);color:var(--bad)}
.bar{height:5px;border-radius:5px;background:var(--surface-2);overflow:hidden}
.bar i{display:block;height:100%;background:var(--accent);transition:width .6s}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.empty{color:var(--muted);font-size:14px;padding:20px;text-align:center;border:1.5px dashed var(--line);border-radius:14px}

/* Sheet (wizards) */
.scrim{position:fixed;inset:0;background:var(--scrim);z-index:20;display:grid;place-items:center;padding:16px}
.sheet{background:var(--surface);border-radius:20px;width:min(520px,100%);max-height:calc(100% - 32px);overflow:auto;display:flex;flex-direction:column}
.sheet-h{display:flex;gap:12px;align-items:center;padding:18px 18px 0}
.sheet-h h2{font-size:21px;flex:1;min-width:0}
.sheet-b{padding:16px 18px;display:flex;flex-direction:column;gap:14px}
.sheet-f{display:flex;justify-content:space-between;gap:10px;padding:14px 18px;border-top:1px solid var(--line);position:sticky;bottom:0;background:var(--surface)}
.dots{display:flex;gap:5px;padding:0 18px}
.dots i{width:22px;height:4px;border-radius:4px;background:var(--surface-2)}
.dots i.on{background:var(--accent)}
.x{border:0;background:var(--surface-2);width:34px;height:34px;border-radius:50%;font-size:18px;line-height:1;flex:none}
.toggle{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 0;border-top:1px solid var(--line);font-size:14.5px}
.toggle:first-child{border-top:0}
.sw{width:44px;height:26px;border-radius:13px;border:0;background:var(--surface-2);position:relative;flex:none;box-shadow:inset 0 0 0 1px var(--line)}
.sw::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--surface);box-shadow:0 1px 2px rgba(0,0,0,.3);transition:left .2s}
.sw[aria-checked="true"]{background:var(--ok);box-shadow:none}
.sw[aria-checked="true"]::after{left:21px}
.ticks{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px;font-size:14.5px}
.ticks li{display:flex;gap:10px}
.ticks li::before{content:"✓";color:var(--ok);font-weight:800}
.big-ok{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:10px 0}
.big-ok .circle{width:56px;height:56px;border-radius:50%;background:var(--ok);color:var(--surface);display:grid;place-items:center;font-size:28px;font-weight:800}
.number{font-family:var(--f-mono);font-size:24px;font-weight:500;background:var(--bg);border-radius:12px;padding:10px 16px}

.foot{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;color:var(--muted);font-size:13px;border-top:1px solid var(--line);padding-top:16px;margin-top:28px}

@media (max-width:900px){
  .home-grid,.todo-grid{grid-template-columns:minmax(0,1fr)}
  .how{grid-template-columns:minmax(0,1fr)}
  .top .tabs{position:fixed;left:0;right:0;bottom:0;z-index:6;background:var(--surface);border-top:1px solid var(--line);padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));justify-content:space-around}
  .top .tabs .tab{flex:1;justify-content:center;flex-direction:column;gap:2px;font-size:12px;padding:6px 4px;border-radius:12px}
  .top .tabs .tab[aria-selected="true"]{box-shadow:none;background:var(--accent-soft)}
  .tab .badge{position:absolute;top:2px;right:calc(50% - 26px)}
  main{padding-bottom:calc(var(--nav-h) + 30px + env(safe-area-inset-bottom,0px))}
  .composer{bottom:calc(var(--nav-h) + env(safe-area-inset-bottom,0px))}
  .teams{grid-template-columns:minmax(0,1fr)}
  .scrim{place-items:end center;padding:0}
  .sheet{border-radius:20px 20px 0 0;width:100%;max-height:92%;padding-bottom:env(safe-area-inset-bottom,0px)}
}
@media (min-width:901px){ .tab .ico{display:none} }
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
