@font-face { font-family: 'GC Epic Pro'; src: url('/fonts/GCEpicProDemo-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'GC Epic Pro'; src: url('/fonts/GCEpicProDemo-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'GC Epic Pro'; src: url('/fonts/GCEpicProDemo-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'GC Epic Pro'; src: url('/fonts/GCEpicProDemo-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

/* Base stays one palette; each agent only tints its own avatar, bubble and accents via --agent. */
:root {
  --bg: #0D1117; --surface: #111722; --raise: #1A1F2E; --line: #252B37; --line-2: #3A4250;
  --fg: #E8E4DE; --muted: #8B8B80; --faint: #555D6B;
  --accent: #C4956A; --warm: #E8A94D; --good: #6FA77F; --bad: #C8775F;
  --agent: #C8A46B;
  /* Display face: GC Epic Pro. The demo has letters only; digits, accents and punctuation fall back to DM Sans.
     With the licensed full version, set --body to the same stack to use it everywhere. */
  --display: 'GC Epic Pro', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 300 15px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--fg); color: var(--bg); border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 500; }
button.ghost, .nav-btn, .icon-btn, .link { background: transparent; color: var(--muted); }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible, .nav-btn:focus-visible, .desk-icon:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.label { font: 500 10px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 6px; }
.row { display: flex; gap: 8px; align-items: center; } .row.end { justify-content: flex-end; }
.wordmark { font: 600 30px/1 var(--display); letter-spacing: .32em; text-transform: uppercase; }
.wordmark.sm { font-size: 15px; letter-spacing: .3em; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left)); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 10px; }
.logo-mark { width: 220px; max-width: 70%; margin-bottom: 10px; }

/* layout */
/* The page never scrolls; only the thread does. Without a bounded row the grid grows with the chat. */
.app { height: 100%; height: 100dvh; display: grid; grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
.side-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 14px; }
.brand { display: flex; flex-direction: column; gap: 8px; }
.brand img { width: 150px; }
.side-section { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side-section select { flex: 1; }
.group-label { font: 500 9px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); padding: 12px 8px 4px; }
.nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 8px; border-radius: 8px; font-weight: 400; }
.nav-btn:hover { background: var(--raise); color: var(--fg); }
.nav-btn.active { background: var(--raise); color: var(--fg); font-weight: 500; }
.nav-ico { width: 18px; text-align: center; color: var(--faint); }
.badge { margin-left: auto; font: 11px var(--mono); background: var(--accent); color: var(--bg); border-radius: 9px; padding: 0 7px; }
.side-tools { margin-top: auto; }
.cad-status { font: 500 10px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 8px; padding: 2px 8px; }
.cad-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.cad-status.on { color: var(--good); }
.cad-status.on::before { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.link { padding: 0; font-size: 12px; text-decoration: underline; }
.icon-btn { padding: 4px 10px; font-size: 18px; line-height: 1; border-radius: 8px; display: inline-flex; align-items: center; }
.icon-btn:hover { background: var(--raise); color: var(--fg); }
.only-mobile { display: none; }

.avatar { --c: var(--agent); width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--c) 22%, var(--bg)); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  font: 600 10px var(--display); letter-spacing: 0; text-transform: uppercase; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; position: relative; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); padding-top: max(12px, env(safe-area-inset-top)); }
.head-text { flex: 1; min-width: 0; }
.agent-name { font: 600 19px/1.1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--agent); }
.deep { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ── chat bubbles ── */
.messages { flex: 1; overflow-y: auto; padding: 20px 0 28px; overscroll-behavior: contain; }
.thread { max-width: 820px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.msg.user { flex-direction: row-reverse; }
.msg .bubble-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: min(78%, 640px); }
.msg.user .bubble-wrap { align-items: flex-end; }
.msg-meta { font: 500 9px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; padding: 0 4px; }
.msg-meta .who { color: var(--c, var(--muted)); }
.msg-meta .num { font-family: var(--mono); letter-spacing: 0; }
.bubble { padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; line-height: 1.6; }
.msg.user .bubble { background: var(--raise); border-bottom-right-radius: 6px; }
.msg.assistant .bubble { background: color-mix(in srgb, var(--c, var(--agent)) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--agent)) 20%, var(--line)); border-bottom-left-radius: 6px; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin: 0; }
.bubble ul { margin: 0 0 8px; padding-left: 20px; }
.bubble h4 { margin: 12px 0 4px; font-weight: 500; }
.bubble code { font: 13px var(--mono); background: rgba(0,0,0,.25); padding: 1px 5px; border-radius: 4px; }
.bubble pre { background: var(--bg); border: 1px solid var(--line); padding: 12px; overflow-x: auto; border-radius: 10px; margin: 6px 0; }
.bubble pre code { background: none; padding: 0; }
.bubble img.capture { display: block; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 8px 0 2px; }
.bubble .handoff { display: block; margin: 12px -14px 8px; padding: 6px 14px 0; border-top: 1px dashed var(--line-2); font: 500 9px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.msg-actions { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 2px; opacity: .55; transition: opacity .15s; }
.msg:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-actions button { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 2px 9px; font-size: 11px; font-weight: 400; border-radius: 12px; }
.msg-actions button:hover { color: var(--fg); border-color: var(--line-2); }
.msg-actions .done { color: var(--good); border-color: var(--good); }
.tool-note { font: 11px var(--mono); color: var(--faint); padding-left: 32px; }
.cursor::after { content: '▍'; color: var(--c, var(--agent)); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.empty { max-width: 520px; margin: 14vh auto 0; padding: 0 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .avatar { width: 56px; height: 56px; font-size: 20px; }
.empty .agent-name { font-size: 28px; }
.to-bottom { position: absolute; right: 24px; bottom: 96px; width: 38px; height: 38px; border-radius: 50%; padding: 0; background: var(--raise); color: var(--fg); border: 1px solid var(--line-2); box-shadow: 0 6px 18px rgba(0,0,0,.4); font-size: 16px; z-index: 5; }

/* composer */
.composer { padding: 10px 20px max(14px, env(safe-area-inset-bottom)); }
.composer-box { display: flex; gap: 6px; align-items: flex-end; max-width: 780px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 6px 6px 6px 8px; transition: border-color .15s; }
.composer-box:focus-within { border-color: color-mix(in srgb, var(--agent) 60%, var(--line)); }
.composer textarea { flex: 1; resize: none; max-height: 200px; line-height: 1.5; background: transparent; border: 0; padding: 7px 4px; outline: none; }
.composer button[type=submit] { width: 36px; height: 36px; padding: 0; font-size: 17px; border-radius: 50%; background: var(--agent); color: var(--bg); }
.composer button[type=submit]:disabled { opacity: .4; }
.attachments { display: flex; gap: 8px; flex-wrap: wrap; max-width: 780px; margin: 0 auto 8px; }
.attachments:empty { display: none; }
.att { font: 12px var(--mono); background: var(--raise); border-radius: 12px; padding: 3px 10px; display: flex; gap: 6px; align-items: center; }
.att button { background: none; color: var(--muted); padding: 0; }

/* voice */
.mic-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.mic-btn:hover { color: var(--fg); background: var(--raise); }
.mic-btn.on { background: #B84A3A; color: #fff; animation: pulse 1.4s ease-in-out infinite; }
.mic-btn.busy { color: var(--warm); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(184,74,58,.55); } 50% { box-shadow: 0 0 0 8px rgba(184,74,58,0); } }
.lang-btn { background: transparent; color: var(--faint); padding: 0 4px; height: 36px; font: 600 10px var(--display); letter-spacing: .12em; flex-shrink: 0; }
.lang-btn:hover { color: var(--fg); }
.mic-hint { max-width: 780px; width: fit-content; margin: 0 auto 8px; font-size: 12px; color: var(--fg); text-align: center; background: var(--raise); border: 1px solid var(--line-2); border-radius: 14px; padding: 5px 12px; font-variant-numeric: tabular-nums; }

/* project room */
.status-line { align-self: center; max-width: 90%; text-align: center; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 5px 12px; }
.plan-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px; }
.plan-actions button { font-size: 12px; padding: 5px 12px; border-radius: 14px; }
.plan-actions .state { font: 11px var(--mono); color: var(--muted); align-self: center; }
.typing-bar { max-width: 780px; width: 100%; margin: 0 auto; padding: 4px 20px 0; font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.typing-bar .who { display: inline-flex; align-items: center; gap: 6px; }
.typing-bar .dots::after { content: '…'; animation: blink 1s steps(2) infinite; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-left: auto; animation: pulse-green 1.6s infinite; }
@keyframes pulse-green { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.room-stack { display: inline-flex; }
.room-stack .avatar { margin-left: -6px; border: 2px solid var(--bg); }
.room-stack .avatar:first-child { margin-left: 0; }

/* ── Aujourd'hui dashboard ── */
.main.dash-mode #mode, .main.dash-mode .deep { display: none; }
.dash { gap: 18px; max-width: 1100px; }
.dstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dstat { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--u); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; min-width: 0; }
.dstat b { font: 600 26px/1.1 var(--display); color: var(--fg); font-variant-numeric: tabular-nums; }
.dstat span { font-size: 12px; color: var(--muted); }
.dbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dtabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.dtab { background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 7px; font-weight: 500; }
.dtab.on { background: var(--raise); color: var(--fg); }
.dnav { display: inline-flex; gap: 2px; }
.dnav button { padding: 6px 10px; font-size: 14px; }
.dtoend { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.dbrief { margin-left: auto; font-size: 13px; border: 1px solid var(--line); }
.dtitle { font-size: 18px !important; letter-spacing: .1em !important; text-transform: capitalize; }
.dsec { display: flex; flex-direction: column; gap: 6px; }
.dsec h3 { margin: 6px 0 2px; font: 600 11px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dsec h3 .n { font: 11px var(--mono); color: var(--faint); letter-spacing: 0; }
.tcard { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--u) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--u) 28%, var(--line)); border-left: 4px solid var(--u); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.tcard.done { opacity: .5; } .tcard.done .ttitle { text-decoration: line-through; }
.tcard.compact { padding: 5px 7px; gap: 6px; border-left-width: 3px; border-radius: 7px; }
.tcheck { width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--u); background: transparent; color: var(--fg); padding: 0; font-size: 12px; line-height: 1; display: grid; place-items: center; margin-top: 1px; }
.tcard.compact .tcheck { width: 16px; height: 16px; font-size: 10px; }
.tcheck:hover { background: color-mix(in srgb, var(--u) 30%, transparent); }
.tbody { min-width: 0; flex: 1; }
.ttitle { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.tcard.compact .ttitle { font-size: 12px; }
.tmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.tproj { font: 600 10px var(--display); letter-spacing: .12em; color: var(--u); }
.tprio { font-family: var(--mono); font-size: 11px; }
.tdep { font-size: 12px; color: var(--faint); margin-top: 2px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wday { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; display: flex; flex-direction: column; gap: 5px; min-height: 160px; min-width: 0; }
.wday.today { border-color: var(--warm); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warm) 40%, transparent); }
.wday.weekend { background: color-mix(in srgb, var(--surface) 60%, var(--bg)); }
.wday-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: var(--muted); text-transform: capitalize; padding: 0 2px 4px; border-bottom: 1px solid var(--line); }
.wday-h b { font: 600 16px var(--display); color: var(--fg); }
.wday.today .wday-h b { color: var(--warm); }
.wnone { color: var(--faint); font-size: 12px; text-align: center; padding-top: 6px; }
.dlate { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border: 1px dashed color-mix(in srgb, #D0583F 50%, var(--line)); border-radius: 10px; }
.dlate strong { font: 600 10px var(--display); letter-spacing: .14em; text-transform: uppercase; color: #D0583F; margin-right: 4px; }
.dlate .tcard { flex: 1 1 220px; }
.dline { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.dline.today .dline-day { color: var(--warm); }
.dline-day { font-size: 12px; color: var(--muted); text-transform: capitalize; padding-top: 8px; }
.dline-tasks { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.month .mhead, .month .mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .mhead span { font: 600 10px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); text-align: center; padding: 4px 0; }
.mday { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 92px; padding: 4px; display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left; color: var(--fg); font-weight: 400; min-width: 0; overflow: hidden; }
.mday:hover { border-color: var(--line-2); }
.mday.out { opacity: .4; }
.mday.today { border-color: var(--warm); }
.mnum { font: 600 12px var(--display); color: var(--muted); }
.mday.today .mnum { color: var(--warm); }
.mchip { font-size: 10.5px; line-height: 1.3; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--u) 22%, transparent); border-left: 2px solid var(--u); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmore { font: 10px var(--mono); color: var(--muted); }
.dgap { margin: 0; font-size: 12px; color: var(--faint); padding: 6px 10px; border-left: 2px dotted var(--line-2); }
.dlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12px; color: var(--muted); padding-top: 4px; border-top: 1px solid var(--line); }
.dlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 820px) {
  .dstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: minmax(0, 1fr); }
  .wday { min-height: 0; }
  .dbrief { margin-left: 0; }
  .dline { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dline-day { padding-top: 0; }
  .mday { min-height: 54px; }
  .mchip { font-size: 0; padding: 0; height: 5px; border-left-width: 0; background: var(--u); }
}

/* panels */
.panel { overflow-y: auto; padding: 20px max(16px, env(safe-area-inset-left)) 40px; }
.panel-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.panel h2, .win-title, .desk-title { font-family: var(--display); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.panel h2 { font-size: 26px; margin: 0; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.card .row { flex-wrap: wrap; }
.chip { font: 11px var(--mono); border: 1px solid var(--line-2); border-radius: 10px; padding: 1px 8px; color: var(--muted); }
.chip.proposed, .chip.awaiting_approval { color: var(--warm); border-color: var(--warm); }
.chip.adopted, .chip.done { color: var(--good); border-color: var(--good); }
.chip.failed { color: var(--bad); border-color: var(--bad); }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data td, table.data th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { font: 500 10px var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.num { text-align: right !important; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--raise); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--good); }
.bar.warn > span { background: var(--warm); } .bar.over > span { background: var(--bad); }
.tablewrap { overflow-x: auto; }

/* ── Poste: Conductor's computer ── */
.poste { position: relative; overflow: hidden; background:
  radial-gradient(ellipse at 70% 30%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
  linear-gradient(var(--bg), #0A0E14); }
.poste::before { content: ''; position: absolute; inset: 0; background: url('/brand/logo-light.png') no-repeat center 42% / min(60%, 620px); opacity: .035; pointer-events: none; }
.desktop { position: absolute; inset: 0 0 46px 0; padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, 104px); grid-auto-rows: 112px; gap: 10px; align-content: start; overflow-y: auto; }
.desk-icon { background: transparent; color: var(--fg); border: 1px solid transparent; border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 400; text-align: center; }
.desk-icon:hover { background: rgba(255,255,255,.04); border-color: var(--line); }
.desk-icon.selected { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.desk-icon svg { width: 48px; height: 40px; }
.desk-icon .name { font-size: 11px; line-height: 1.25; max-width: 96px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 1px 2px #000; }
.desk-icon .code { font: 600 10px var(--display); letter-spacing: .12em; color: var(--accent); }
.desk-icon .pip { font: 10px var(--mono); color: var(--warm); }

.window { position: absolute; width: min(760px, calc(100% - 40px)); height: min(520px, calc(100% - 100px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.55); display: flex; flex-direction: column; overflow: hidden; }
.window.maximized { left: 8px !important; top: 8px !important; width: calc(100% - 16px); height: calc(100% - 62px); }
.win-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--raise); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.win-bar:active { cursor: grabbing; }
.win-title { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btn { background: transparent; color: var(--muted); padding: 2px 10px; border-radius: 6px; font-size: 14px; }
.win-btn:hover { background: var(--line); color: var(--fg); }
.win-btn.close:hover { background: #8a3b2e; color: #fff; }
.win-body { flex: 1; display: grid; grid-template-columns: 170px 1fr; min-height: 0; }
.win-nav { border-right: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.win-nav button { background: transparent; color: var(--muted); text-align: left; padding: 6px 8px; font-weight: 400; display: flex; justify-content: space-between; gap: 6px; }
.win-nav button:hover { background: var(--raise); color: var(--fg); }
.win-nav button.on { background: var(--raise); color: var(--fg); }
.win-nav .n { font: 11px var(--mono); color: var(--faint); }
.win-main { overflow: auto; padding: 6px 0; }
.win-path { font: 11px var(--mono); color: var(--faint); padding: 6px 14px 8px; border-bottom: 1px solid var(--line); }
.file { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 7px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); width: 100%; background: transparent; color: var(--fg); text-align: left; border-radius: 0; font-weight: 400; }
button.file:hover { background: var(--raise); }
.file .ico { width: 22px; height: 22px; display: grid; place-items: center; }
.file .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .s { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .m { font: 11px var(--mono); color: var(--faint); white-space: nowrap; }
.win-empty { padding: 24px 14px; color: var(--muted); font-size: 13px; }
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: rgba(17,23,34,.92); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 6px; padding: 0 8px; padding-bottom: env(safe-area-inset-bottom); }
.start { display: flex; align-items: center; gap: 8px; background: transparent; padding: 4px 10px; border-radius: 8px; }
.start:hover { background: var(--raise); }
.start img { height: 16px; }
.task { background: var(--raise); color: var(--fg); padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 400; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 2px solid var(--accent); }
.task.min { border-bottom-color: transparent; color: var(--muted); }
.clock { margin-left: auto; font: 12px var(--mono); color: var(--muted); padding-right: 6px; }

.dialog { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; z-index: 50; }
.dialog-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 20px; width: min(520px, 100%); display: flex; flex-direction: column; gap: 12px; }
.dialog-card h3 { margin: 0; font-weight: 500; }
.dialog-card textarea, .dialog-card input { width: 100%; }

@media (min-width: 821px) { .main.poste-mode .chat-head { display: none; } }
.main.poste-mode #mode, .main.poste-mode .deep { display: none; }
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .2s; padding-top: env(safe-area-inset-top); }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); }
  .only-mobile { display: inline-flex; }
  .chat-head { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); gap: 8px; }
  .thread { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .msg .bubble-wrap { max-width: 86%; }
  .composer { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  #agentRole, .deep { display: none; }
  .window, .window.maximized { left: 0 !important; top: 0 !important; width: 100%; height: calc(100% - 46px); border-radius: 0; }
  .win-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .win-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .win-nav button { white-space: nowrap; }
  .desktop { grid-template-columns: repeat(auto-fill, 92px); }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } .cursor::after, .mic-btn.on, .live-dot, .typing-bar .dots::after { animation: none; } }
.main.room-mode #mode, .main.room-mode .deep { display: none; }
