/* THE AI TEAM (2026-10-31): /team.css, after /site.css. A team chat in the site's look: a list
   of projects, direct messages and AIs down the left, the channel in the middle, the project's
   details (goal, autopilot, tasks, files, members) on the right. One page, no framework. */
html.tm-page,html.tm-page body{height:100%}
body.tm-site{margin:0;overflow:hidden;background:var(--bg)}
.tm-root{display:flex;flex-direction:column;height:100dvh;min-height:100%}
.tm-root>header{flex:none}
.tm-root>header .bar{min-height:58px}
.tm{flex:1;min-height:0;display:grid;grid-template-columns:264px minmax(0,1fr);position:relative}
.tm.has-panel{grid-template-columns:264px minmax(0,1fr) 320px}

/* ---------------------------------------------------------------- the left: projects, DMs, AIs */
.tm-side{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--line);background:var(--soft)}
.tm-side-head{display:flex;align-items:center;gap:10px;padding:14px 16px 10px;font:800 18px var(--display)}
.tm-side-head img{width:30px;height:30px;filter:drop-shadow(0 4px 8px rgba(0,0,0,.3))}
.tm-side-close{display:none;margin-left:auto}
.tm-groups{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;flex:1;min-height:0;overflow:auto;padding:0 8px 16px}
/* The site styles every <section> as a page section (padding, a top border): not these. */
.tm-group{padding:0;border:0;margin:0}
.tm-group h2{display:flex;align-items:center;gap:8px;margin:14px 8px 6px;font:800 12px var(--body);letter-spacing:.09em;text-transform:uppercase;color:var(--faint)}
.tm-plus{margin-left:auto;width:24px;height:24px;border-radius:7px;border:1px solid var(--line2);background:none;color:var(--muted);font:700 16px/1 var(--body);cursor:pointer}
.tm-plus:hover{border-color:var(--gold);color:var(--gold)}
.tm-group ul{list-style:none;margin:0;padding:0}
.tm-group li{margin:0}
.tm-row{display:flex;align-items:center;gap:9px;width:100%;padding:8px 10px;border:0;border-radius:10px;background:none;color:var(--muted);font:600 15px var(--body);text-align:left;cursor:pointer;min-width:0}
.tm-row:hover{background:color-mix(in srgb,var(--ink) 6%,transparent);color:var(--ink)}
.tm-row[aria-current="true"]{background:color-mix(in srgb,var(--gold) 16%,transparent);color:var(--ink)}
.tm-row .hash{color:var(--faint);font-weight:800;width:14px;text-align:center;flex:none}
.tm-row .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-dot{width:8px;height:8px;border-radius:50%;flex:none;background:transparent}
.tm-dot.working{background:var(--gold);animation:tm-pulse 1.2s ease-in-out infinite}
.tm-dot.waiting{background:var(--warn)}
.tm-dot.done{background:var(--ok)}
.tm-dot.auto{box-shadow:0 0 0 2px color-mix(in srgb,var(--gold) 40%,transparent)}
@keyframes tm-pulse{50%{opacity:.35}}
.tm-ava{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;flex:none;font:800 12px var(--display);letter-spacing:.01em;background:hsl(var(--h) 60% 44%);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.14)}
.tm-ava.em{font-size:16px;font-family:var(--body)}
.tm-ava.lg.em{font-size:21px}
.tm-ava.lg{width:38px;height:38px;border-radius:11px;font-size:15px}
.tm-ava.you{background:var(--gold);color:var(--on-gold);font:800 14px var(--display)}
.tm-row small{display:block;font-weight:500;font-size:12px;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-row .tm-gear{margin-left:auto;opacity:0;border:0;background:none;color:var(--muted);cursor:pointer;padding:2px 4px;border-radius:6px;font-size:14px}
.tm-row:hover .tm-gear,.tm-row:focus-within .tm-gear{opacity:1}
.tm-none{padding:4px 10px 6px;font-size:13px;color:var(--faint)}

/* ---------------------------------------------------------------- the channel */
/* A <section> too (the site pads those): not this one. */
.tm-chan{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--bg);padding:0;border-top:0}
/* The site styles every <header> as the page's top bar (sticky): this one is the channel's. */
.tm-chan-head{display:flex;align-items:center;gap:12px;min-height:58px;height:58px;margin:0;padding:0 16px;border-bottom:1px solid var(--line);flex:none;position:static;z-index:auto;background:var(--bg)}
.tm-menu{display:none}
.tm-chan-title{min-width:0;flex:1;display:flex;flex-direction:column}
.tm-chan-title b{font:800 18px var(--display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-chan-title small{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-status{font-size:13px;color:var(--muted);white-space:nowrap;display:inline-flex;align-items:center;gap:7px}
.tm-status .tm-dot{width:9px;height:9px}
.tm-status.waiting{color:var(--warn)}
.tm-status.done{color:var(--ok)}
.tm-msgs{flex:1;min-height:0;overflow:auto;margin:0;padding:18px 20px 8px;list-style:none;scroll-behavior:smooth;overscroll-behavior:contain}
.tm-m{display:grid;grid-template-columns:38px minmax(0,1fr);gap:0 12px;padding:3px 0;position:relative}
.tm-m.head{margin-top:14px}
.tm-m:not(.head) .tm-ava,.tm-m:not(.head) .tm-who{display:none}
.tm-m:not(.head) .tm-body{grid-column:2}
.tm-m .tm-ava{grid-row:span 2;margin-top:2px}
.tm-who{display:flex;align-items:baseline;gap:8px;font-size:15px}
.tm-who b{font-weight:800}
.tm-who .tm-chip{font-size:11px;font-weight:700;color:var(--faint);border:1px solid var(--line);border-radius:6px;padding:1px 6px;white-space:nowrap}
.tm-who time{font-size:12px;color:var(--faint)}
.tm-body{min-width:0;font-size:16px;line-height:1.5;color:var(--ink);overflow-wrap:anywhere}
.tm-body p{margin:0 0 .45em}
.tm-body p:last-child{margin-bottom:0}
.tm-body ul,.tm-body ol{margin:.2em 0 .5em;padding-left:1.4em}
.tm-body li{margin:.12em 0}
.tm-body h1,.tm-body h2,.tm-body h3{font:800 17px var(--body);margin:.6em 0 .3em}
.tm-body code{font:500 .92em ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--soft);border:1px solid var(--line);border-radius:5px;padding:1px 5px}
.tm-body pre{margin:.4em 0 .6em;padding:12px 14px;background:var(--soft);border:1px solid var(--line);border-radius:12px;overflow:auto;font:500 13.5px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;max-height:420px}
.tm-body pre code{background:none;border:0;padding:0;font-size:inherit}
.tm-body a{color:var(--gold)}
.tm-body .mention{color:var(--gold);font-weight:700;background:color-mix(in srgb,var(--gold) 12%,transparent);border-radius:5px;padding:0 3px}
.tm-m.tool .tm-body{font-size:13.5px;color:var(--muted);display:flex;align-items:flex-start;gap:7px}
.tm-m.tool .tm-body .ic{flex:none;margin-top:3px;width:14px;height:14px;color:var(--faint)}
.tm-m.tool .tm-body.bad{color:var(--warn)}
.tm-m.tool details{display:inline;border:0;padding:0;margin:0;background:none}
.tm-m.tool summary{cursor:pointer;list-style:none;display:inline;font:inherit;font-weight:500;padding:0;margin:0;border:0;background:none;color:inherit}
.tm-m.tool summary::-webkit-details-marker{display:none}
.tm-m.tool summary::after,.tm-m.tool summary::before{content:none!important}
.tm-m.tool summary:hover{color:var(--ink)}
.tm-m.tool details[open] summary{color:var(--ink)}
.tm-m.tool pre{margin:6px 0 2px;font-size:12.5px;max-height:220px}
.tm-m.note{display:block;text-align:center;padding:10px 0;font-size:13px;color:var(--faint)}
.tm-m.note .tm-body{display:inline;font-size:13px;color:var(--faint)}
.tm-m.question .tm-body{background:color-mix(in srgb,var(--warn) 12%,var(--surface));border:1px solid color-mix(in srgb,var(--warn) 45%,transparent);border-radius:14px;padding:12px 14px}
.tm-m.question .tm-body::before{content:"Needs you";display:block;font:800 11px var(--body);letter-spacing:.08em;text-transform:uppercase;color:var(--warn);margin-bottom:4px}
.tm-m.you .tm-body{color:var(--ink)}
.tm-typing{flex:none;padding:0 20px 8px 70px;font-size:14px;color:var(--muted);max-height:140px;overflow:hidden;white-space:pre-wrap;mask-image:linear-gradient(to bottom,transparent,#000 24px)}
.tm-typing b{color:var(--ink)}
.tm-typing .dots::after{content:"…";animation:tm-dots 1.4s steps(4,end) infinite;display:inline-block;width:1.2em;text-align:left;overflow:hidden;vertical-align:bottom}
@keyframes tm-dots{0%{width:0}100%{width:1.2em}}

/* the composer */
.tm-compose{flex:none;display:flex;align-items:flex-end;gap:8px;padding:10px 16px 14px;border-top:1px solid var(--line);position:relative;background:var(--bg)}
.tm-compose textarea{flex:1;min-height:46px;max-height:200px;resize:none;padding:12px 14px;border-radius:12px;border:1px solid var(--line2);background:var(--surface);color:var(--ink);font:400 16px/1.4 var(--body)}
.tm-compose textarea:focus{outline:2px solid var(--gold);outline-offset:1px;border-color:transparent}
.tm-send{min-height:46px}
.tm-stop{min-height:46px}
.tm-mention-menu{position:absolute;left:16px;bottom:calc(100% - 4px);z-index:5;min-width:220px;max-width:320px;background:var(--surface);border:1px solid var(--line2);border-radius:12px;box-shadow:0 16px 40px -16px rgba(0,0,0,.6);padding:6px;max-height:260px;overflow:auto}
.tm-mention-menu button{display:flex;align-items:center;gap:9px;width:100%;padding:7px 8px;border:0;border-radius:8px;background:none;color:var(--ink);font:600 14px var(--body);text-align:left;cursor:pointer}
.tm-mention-menu button[aria-selected="true"],.tm-mention-menu button:hover{background:color-mix(in srgb,var(--gold) 16%,transparent)}
.tm-mention-menu small{color:var(--faint);font-weight:500;margin-left:auto}

/* the welcome */
.tm-welcome{flex:1;min-height:0;overflow:auto;padding:28px 20px 60px}
.tm-welcome-in{max-width:760px;margin:0 auto}
.tm-welcome img{width:100%;max-width:560px;height:auto;border-radius:20px;border:1px solid var(--line);display:block;margin:0 auto 28px}
.tm-welcome h1{font-size:clamp(34px,4.6vw,52px);letter-spacing:-.02em}
.tm-welcome .lead{margin-top:14px;font-size:18px;color:var(--muted);max-width:60ch}
.tm-welcome-acts{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}
.tm-templates{margin-top:36px}
.tm-templates h2{font:800 13px var(--body);letter-spacing:.08em;text-transform:uppercase;color:var(--faint);margin-bottom:12px}
.tm-template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.tm-template{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);text-align:left;cursor:pointer;font:inherit}
.tm-template:hover{border-color:var(--gold)}
.tm-template b{display:block;font-size:16px}
.tm-template small{display:block;color:var(--muted);font-size:13px;margin-top:2px;line-height:1.4}
.tm-signin-note{margin-top:20px;font-size:14px;color:var(--muted)}

/* ---------------------------------------------------------------- the right: details */
.tm-panel{display:flex;flex-direction:column;min-height:0;border-left:1px solid var(--line);background:var(--soft)}
.tm-panel-head{display:flex;align-items:center;justify-content:space-between;min-height:58px;padding:0 12px 0 18px;border-bottom:1px solid var(--line);font:800 16px var(--display)}
.tm-panel-body{flex:1;min-height:0;overflow:auto;padding:14px 16px 30px}
.tm-pb{margin-bottom:18px}
.tm-pb h3{display:flex;align-items:center;gap:8px;font:800 12px var(--body);letter-spacing:.09em;text-transform:uppercase;color:var(--faint);margin:0 0 8px}
.tm-pb h3 .tm-plus{margin-left:auto}
.tm-goal{font-size:14.5px;color:var(--ink);line-height:1.45;white-space:pre-wrap}
.tm-goal.none{color:var(--faint);font-style:italic}
.tm-switch{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font:700 15px var(--body);cursor:pointer;text-align:left}
.tm-switch small{display:block;font-weight:500;font-size:12.5px;color:var(--muted);margin-top:2px}
.tm-switch .tog{margin-left:auto;flex:none;width:42px;height:24px;border-radius:12px;background:var(--line2);position:relative;transition:background .16s}
.tm-switch .tog::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:left .16s}
.tm-switch[aria-checked="true"] .tog{background:var(--gold)}
.tm-switch[aria-checked="true"] .tog::after{left:21px}
.tm-switch .lab{flex:1;min-width:0}
.tm-auto-note{font-size:13px;color:var(--muted);margin-top:8px;line-height:1.4}
.tm-chips{display:flex;flex-wrap:wrap;gap:6px}
.tm-chip-m{display:inline-flex;align-items:center;gap:6px;padding:4px 10px 4px 4px;border:1px solid var(--line);border-radius:999px;background:var(--surface);font:600 13.5px var(--body);color:var(--ink)}
.tm-chip-m .tm-ava{width:22px;height:22px;border-radius:7px;font-size:13px}
.tm-chip-m .lead{font-size:11px;color:var(--gold);font-weight:800}
.tm-tasks{list-style:none;margin:0;padding:0}
.tm-task{display:flex;align-items:flex-start;gap:9px;padding:7px 0;border-top:1px solid var(--line);font-size:14px}
.tm-task:first-child{border-top:0}
.tm-task input{margin:3px 0 0;accent-color:var(--gold);width:16px;height:16px;flex:none}
.tm-task .t{flex:1;min-width:0}
.tm-task .t small{display:block;color:var(--faint);font-size:12px}
.tm-task.done .t{color:var(--faint);text-decoration:line-through}
.tm-task.doing .t b{color:var(--gold);font-size:11px;letter-spacing:.06em;text-transform:uppercase;margin-right:6px}
.tm-task .x{border:0;background:none;color:var(--faint);cursor:pointer;font-size:14px;padding:0 4px;opacity:0}
.tm-task:hover .x{opacity:1}
.tm-task-add{display:flex;gap:6px;margin-top:8px}
.tm-task-add input{flex:1;min-width:0;padding:8px 10px;border-radius:9px;border:1px solid var(--line2);background:var(--surface);color:var(--ink);font:400 14px var(--body)}
.tm-files{list-style:none;margin:0;padding:0}
.tm-file{display:flex;align-items:center;gap:8px;padding:7px 0;border-top:1px solid var(--line);font-size:14px;min-width:0}
.tm-file:first-child{border-top:0}
.tm-file .n{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.tm-file small{color:var(--faint);font-size:12px;white-space:nowrap}
.tm-file a{color:var(--gold);font-size:13px;font-weight:700;text-decoration:none}
.tm-file a:hover{text-decoration:underline}
.tm-danger{margin-top:12px;border:0;background:none;color:var(--warn);font:700 13px var(--body);cursor:pointer;padding:0}

/* ---------------------------------------------------------------- sheets (New AI, New project, a file) */
.tm-sheet{position:fixed;inset:0;z-index:60;background:rgba(5,8,18,.6);display:grid;place-items:center;padding:16px;overflow:auto}
.tm-sheet .card{width:min(640px,100%);max-height:calc(100dvh - 32px);overflow:auto;padding:22px 22px 20px;background:var(--surface);box-shadow:0 30px 80px -30px rgba(0,0,0,.8)}
.tm-sheet .top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.tm-sheet .top h2{font-size:24px}
.tm-form{display:grid;gap:14px}
.tm-form label{display:grid;gap:6px;font:700 13px var(--body);color:var(--muted)}
.tm-form label>span{display:flex;align-items:center;gap:8px}
.tm-form label>span small{font-weight:500;color:var(--faint)}
.tm-form input[type="text"],.tm-form textarea,.tm-form select{width:100%;padding:11px 12px;border-radius:11px;border:1px solid var(--line2);background:var(--bg);color:var(--ink);font:400 15.5px var(--body)}
.tm-form textarea{min-height:96px;resize:vertical;line-height:1.45}
.tm-form input:focus,.tm-form textarea:focus,.tm-form select:focus{outline:2px solid var(--gold);outline-offset:1px}
.tm-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tm-emojis{display:flex;flex-wrap:wrap;gap:6px}
.tm-emojis button{width:38px;height:38px;border-radius:10px;border:1px solid var(--line);background:var(--bg);font-size:20px;cursor:pointer;color:var(--ink)}
.tm-emojis button[data-emoji=""]{font:800 14px var(--display)}
.tm-emojis button[aria-pressed="true"]{border-color:var(--gold);box-shadow:0 0 0 2px color-mix(in srgb,var(--gold) 40%,transparent)}
.tm-hues{display:flex;flex-wrap:wrap;gap:6px}
.tm-hues button{width:26px;height:26px;border-radius:50%;border:2px solid transparent;cursor:pointer;background:hsl(var(--h) 60% 44%)}
.tm-hues button[aria-pressed="true"]{border-color:var(--ink)}
.tm-brains{display:grid;gap:10px}
.tm-provider{border:1px solid var(--line);border-radius:14px;padding:10px 12px;background:var(--bg)}
.tm-provider>b{display:flex;align-items:baseline;gap:8px;font-size:14px;margin-bottom:6px}
.tm-provider>b small{font-weight:500;color:var(--faint);font-size:12px}
.tm-provider.off>b{color:var(--faint)}
.tm-brain{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:1px solid transparent;border-radius:10px;background:none;color:var(--ink);text-align:left;cursor:pointer;font:inherit}
.tm-brain:hover{background:var(--soft)}
.tm-brain[aria-checked="true"]{border-color:var(--gold);background:color-mix(in srgb,var(--gold) 10%,transparent)}
.tm-brain[disabled]{opacity:.5;cursor:not-allowed}
.tm-brain .r{width:16px;height:16px;border-radius:50%;border:2px solid var(--line2);flex:none}
.tm-brain[aria-checked="true"] .r{border-color:var(--gold);background:radial-gradient(circle,var(--gold) 45%,transparent 50%)}
.tm-brain .w{flex:1;min-width:0}
.tm-brain .w b{display:block;font-size:14.5px}
.tm-brain .w small{display:block;font-size:12.5px;color:var(--muted);line-height:1.35}
.tm-brain .sc{flex:none;font:800 12px var(--body);color:var(--gold);white-space:nowrap}
.tm-brain .un{flex:none;font:700 12px var(--body);color:var(--faint)}
.tm-older{margin-top:4px}
.tm-older summary{cursor:pointer;font:700 13px var(--body);color:var(--muted);padding:4px 10px}
.tm-pills{display:flex;flex-wrap:wrap;gap:6px}
.tm-pills button{padding:7px 12px;border-radius:999px;border:1px solid var(--line2);background:var(--bg);color:var(--muted);font:700 13px var(--body);cursor:pointer}
.tm-pills button[aria-pressed="true"]{background:var(--gold);border-color:var(--gold);color:var(--on-gold)}
.tm-checks{display:grid;gap:6px}
.tm-check{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--bg);cursor:pointer;font:inherit;color:var(--ink)}
.tm-check input{margin:3px 0 0;accent-color:var(--gold);width:16px;height:16px;flex:none}
.tm-check b{display:block;font-size:14.5px}
.tm-check small{display:block;font-size:12.5px;color:var(--muted);line-height:1.35}
.tm-check .tm-ava{width:26px;height:26px;border-radius:8px;font-size:15px}
.tm-check:has(input:checked){border-color:color-mix(in srgb,var(--gold) 60%,transparent)}
.tm-acts{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:6px}
.tm-acts .tm-danger{margin:0 0 0 auto}
.tm-err{color:var(--warn);font-size:14px;font-weight:600}
.tm-toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:70;background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font:600 14px var(--body);box-shadow:0 12px 30px -10px rgba(0,0,0,.6);max-width:min(90vw,520px)}
.tm-toast.bad{background:var(--warn);color:#1a0d04}

/* ---------------------------------------------------------------- phones and small screens */
@media(max-width:980px){
  .tm,.tm.has-panel{grid-template-columns:minmax(0,1fr)}
  .tm-side{position:absolute;inset:0 auto 0 0;z-index:40;width:min(300px,86vw);transform:translateX(-102%);transition:transform .18s ease;box-shadow:0 0 60px rgba(0,0,0,.5)}
  .tm-side.open{transform:none}
  .tm-side-close{display:grid}
  .tm-menu{display:grid}
  .tm-scrim{position:absolute;inset:0;z-index:35;background:rgba(5,8,18,.5)}
  .tm-panel{position:absolute;inset:0;z-index:40}
  .tm-msgs{padding:14px 12px 8px}
  .tm-m{grid-template-columns:34px minmax(0,1fr);gap:0 10px}
  .tm-typing{padding-left:56px}
  .tm-compose{padding:8px 10px 12px}
  .tm-sheet .card{padding:18px 16px 16px}
  .tm-two{grid-template-columns:1fr}
  .tm-welcome{padding:20px 14px 60px}
}
@media(prefers-reduced-motion:reduce){.tm-side{transition:none}.tm-dot.working{animation:none}}
