:root {
  /* Palette iOS (systemBackground, secondarySystemBackground, systemGray…) */
  --bg: #ffffff;
  --panel: #f2f2f7;
  --surface: #ffffff;
  --elev: #ffffff;
  --fill: rgba(120,120,128,.12);
  --fill-2: rgba(120,120,128,.08);
  --text: #000000;
  --muted: #8a8a8e;
  --border: rgba(60,60,67,.16);
  --sep: rgba(60,60,67,.2);
  --accent: #007aff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --user-bubble: #007aff;
  --user-text: #ffffff;
  --code-bg: #f5f5f7;
  --danger: #ff3b30;
  --ok: #34c759;
  --warn: #ff9500;
  --shadow: 0 1px 1px rgba(0,0,0,.03), 0 8px 28px rgba(0,0,0,.08);
  --sidebar-w: 300px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--font);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --bar: color-mix(in srgb, var(--bg) 78%, transparent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --panel: #000000; --surface: #1c1c1e; --elev: #2c2c2e;
    --fill: rgba(120,120,128,.24); --fill-2: rgba(120,120,128,.16);
    --text: #ffffff; --muted: #98989f; --border: rgba(84,84,88,.5); --sep: rgba(84,84,88,.6);
    --accent: #0a84ff; --user-bubble: #0a84ff; --code-bg: #1c1c1e;
    --danger: #ff453a; --ok: #30d158; --warn: #ff9f0a;
    --shadow: 0 1px 1px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --panel: #000000; --surface: #1c1c1e; --elev: #2c2c2e;
  --fill: rgba(120,120,128,.24); --fill-2: rgba(120,120,128,.16);
  --text: #ffffff; --muted: #98989f; --border: rgba(84,84,88,.5); --sep: rgba(84,84,88,.6);
  --accent: #0a84ff; --user-bubble: #0a84ff; --code-bg: #1c1c1e;
  --danger: #ff453a; --ok: #30d158; --warn: #ff9f0a;
  --shadow: 0 1px 1px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:active { transform: scale(.96); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.error-text { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }

.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); position: relative; margin: 0 auto 8px; }
.logo::after { content: "✳"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 24px; }
.logo.big { width: 48px; height: 48px; border-radius: 15px; }
.logo.big::after { font-size: 28px; }

/* ---------- Connexion ---------- */
.login { height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px 24px; text-align: center; box-shadow: var(--shadow); }
.login-card h1 { font: 600 24px/1.2 var(--serif); margin: 6px 0 0; }
.login-card p { margin: 4px 0 20px; }
.login-card input[type=password] { width: 100%; padding: 13px 14px; border-radius: 13px; border: 1px solid var(--border); background: var(--bg); font-size: 16px; }
.btn-primary { width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 13px; background: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:disabled { opacity: .6; }
.btn-secondary { padding: 12px; border-radius: 13px; border: 1px solid var(--border); background: none; font-weight: 600; }

/* ---------- Mise en page ---------- */
.app { display: flex; height: 100dvh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
}
.sidebar-head { padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 10px; color: var(--muted); }
.search svg { width: 17px; height: 17px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 9px 0; font-size: 16px; color: var(--text); }
.btn-new {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 15px;
}
.conv-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; -webkit-overflow-scrolling: touch; }
.conv-group { font-size: 12px; color: var(--muted); padding: 14px 10px 4px; font-weight: 600; letter-spacing: .02em; }
.conv-item { display: flex; align-items: center; border-radius: 11px; position: relative; transition: background .15s; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.conv-item:hover, .conv-item.active { background: var(--user-bubble); }
.conv-item .open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 10px 10px; font-size: 14.5px; display: flex; flex-direction: column; gap: 1px; }
.conv-item .open:active { transform: none; }
.conv-item .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .snip { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .pin { color: var(--accent); font-size: 11px; margin-right: 4px; }
.conv-item .more { border: 0; background: none; padding: 8px; color: var(--muted); opacity: 0; border-radius: 8px; }
.conv-item:hover .more, .conv-item.active .more { opacity: 1; }
@media (hover: none) { .conv-item .more { display: none; } }
.sidebar-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.status-line { display: flex; align-items: center; gap: 8px; padding: 0 4px; min-width: 0; }
.status-line .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 2px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.status-dot.ok { background: var(--ok); }
.status-dot.bad { background: var(--danger); }
.status-dot.ok.third-party { background: var(--warn); }
.btn-ghost { border: 0; background: none; color: var(--muted); padding: 5px 7px; border-radius: 8px; }
.btn-ghost:hover { color: var(--text); background: var(--user-bubble); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100dvh; position: relative; }
.topbar {
  display: flex; align-items: center; gap: 4px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  min-height: 50px; z-index: 5; border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.icon-btn { border: 0; background: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text); }
.icon-btn:hover { background: var(--user-bubble); }
.conv-title { flex: 1; min-width: 0; border: 0; background: none; text-align: center; font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 4px; border-radius: 8px; }
@media (min-width: 821px) { .conv-title { text-align: left; padding-left: 12px; } }

.banner { display: flex; align-items: center; gap: 6px; margin: 6px 12px 0; padding: 7px 6px 7px 12px; border-radius: 12px; font-size: 13.5px; border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.banner.bad { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }

.scroller { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; position: relative; }
.messages { max-width: 760px; margin: 0 auto; padding: 12px 16px 28px; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 4px; }
.empty h2 { font: 400 28px/1.25 var(--serif); margin: 6px 0 18px; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(520px, 100%); }
.suggestion { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 11px 13px; font-size: 14px; line-height: 1.35; transition: border-color .15s, background .15s; }
.suggestion b { display: block; font-weight: 600; margin-bottom: 2px; }
.suggestion span { color: var(--muted); font-size: 13px; }
.suggestion:hover { border-color: var(--accent); }

/* ---------- Messages ---------- */
.msg { margin: 14px 0; position: relative; animation: msg-in .28s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .swipe-hint { position: absolute; left: -34px; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--accent); }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .bubble {
  background: var(--user-bubble); border-radius: 20px 20px 6px 20px; padding: 10px 15px; max-width: min(85%, 620px);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.user .bubble.collapsed { max-height: 15.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.quote-block { border-left: 3px solid var(--accent); padding: 2px 0 2px 10px; margin: 0 0 8px; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.expand-btn { border: 0; background: none; color: var(--accent); font-size: 13px; padding: 4px 6px; }
.att-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; max-width: 85%; }
.att-thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); display: block; background: var(--panel); }
.att-file { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 13.5px; max-width: 240px; text-decoration: none; color: var(--text); }
.att-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg.assistant .content { font: 16.5px/1.62 var(--serif); overflow-wrap: anywhere; }
.msg.assistant .content code, .msg.assistant .content pre { font-family: var(--mono); }
.msg.assistant .content table { font-family: var(--font); }
.content > :first-child { margin-top: 0; }
.content > :last-child { margin-bottom: 0; }
.content p, .content ul, .content ol, .content blockquote, .content table, .content pre { margin: 0 0 .8em; }
.content h1, .content h2, .content h3, .content h4 { font-family: var(--font); line-height: 1.3; margin: 1.2em 0 .45em; }
.content h1 { font-size: 1.3em; } .content h2 { font-size: 1.16em; } .content h3 { font-size: 1.05em; }
.content ul, .content ol { padding-left: 1.35em; }
.content li + li { margin-top: .25em; }
.content a { color: var(--accent); }
.content blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--muted); }
.content table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; font-size: 14.5px; }
.content th, .content td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.content :not(pre) > code { font-size: .86em; background: var(--code-bg); padding: .12em .38em; border-radius: 6px; border: 1px solid var(--border); }
.code-block { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 0 0 .85em; background: var(--code-bg); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 3px 4px 3px 12px; font: 12px var(--mono); color: var(--muted); border-bottom: 1px solid var(--border); }
.code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.code-block code { font-size: 13.2px; line-height: 1.5; background: none !important; padding: 0 !important; white-space: pre; }
.copy-btn { border: 0; background: none; color: var(--muted); font: 12.5px var(--font); padding: 5px 8px; border-radius: 8px; display: inline-flex; gap: 5px; align-items: center; }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { color: var(--text); background: var(--user-bubble); }

details.thinking { margin-bottom: 10px; font-size: 14px; color: var(--muted); }
details.thinking summary { cursor: pointer; user-select: none; list-style: none; display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid var(--border); }
details.thinking summary::-webkit-details-marker { display: none; }
details.thinking summary::before { content: "›"; display: inline-block; transition: transform .15s; }
details.thinking[open] summary::before { transform: rotate(90deg); }
details.thinking.live summary span { background: linear-gradient(90deg, var(--muted) 30%, var(--text) 50%, var(--muted) 70%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
details.thinking .thinking-body { white-space: pre-wrap; border-left: 2px solid var(--border); padding: 6px 0 6px 12px; margin-top: 8px; max-height: 40vh; overflow-y: auto; }

.actions { display: flex; align-items: center; gap: 2px; margin-top: 6px; color: var(--muted); flex-wrap: wrap; }
.msg.user .actions { justify-content: flex-end; opacity: 0; transition: opacity .15s; }
.msg.user:hover .actions { opacity: 1; }
@media (hover: none) { .msg.user .actions { display: none; } }
.act-btn { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.act-btn svg { width: 17px; height: 17px; }
.act-btn:hover { color: var(--text); background: var(--user-bubble); }
.act-btn.on { color: var(--accent); }
.meta { font-size: 12px; color: var(--muted); margin-left: 6px; }
.tag { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; margin-left: 4px; }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.bad { color: var(--danger); border-color: var(--danger); }
.err-box { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--danger); border-radius: 14px; color: var(--danger); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.err-box button { border: 1px solid currentColor; background: none; color: inherit; border-radius: 9px; padding: 4px 12px; font-size: 13px; }

.typing { display: inline-flex; gap: 5px; align-items: center; padding: 6px 0; color: var(--muted); font-size: 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.typing span { margin-left: 4px; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }
.cursor > :last-child::after { content: ""; display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: var(--accent); margin-left: 4px; vertical-align: middle; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.8); } }

.to-bottom {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 150px; z-index: 6;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: grid; place-items: center; box-shadow: var(--shadow); animation: pop .2s var(--ease);
}
.to-bottom svg { width: 18px; height: 18px; }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) scale(.8); } }

/* ---------- Zone de saisie ---------- */
.composer { padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 18px); }
.composer-box {
  max-width: 760px; margin: 0 auto; border: 1px solid var(--border); background: var(--surface);
  border-radius: 24px; padding: 8px 8px 6px; box-shadow: var(--shadow); transition: border-color .15s;
}
.composer-box:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
#input {
  display: block; width: 100%; border: 0; outline: 0; background: none; resize: none; padding: 6px 8px 4px;
  font-size: 16px; line-height: 1.45; max-height: 38dvh; overflow-y: auto;
}
.composer-row { display: flex; align-items: center; gap: 6px; }
.pickers { flex: 1; min-width: 0; display: flex; gap: 6px; justify-content: flex-end; overflow: hidden; }
.chip-select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; max-width: 46%; text-overflow: ellipsis; min-width: 0;
}
.tool-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: none; display: grid; place-items: center; color: var(--text); }
.send-btn { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; transition: opacity .15s, transform .1s; }
.send-btn:disabled { opacity: .3; cursor: default; }
.send-btn.stop { background: var(--text); color: var(--bg); }
.send-btn.stop svg { fill: currentColor; stroke: none; }
.attach-wrap { position: relative; }
.attach-menu {
  position: absolute; bottom: 46px; left: 0; z-index: 30; min-width: 250px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); animation: menu-in .16s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.attach-menu button { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 11px 12px; border-radius: 11px; font-size: 15px; }
.attach-menu button:hover { background: var(--user-bubble); }
.context-chip { max-width: 760px; margin: 0 auto 6px; display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 14px; background: var(--accent-soft); font-size: 13.5px; animation: menu-in .16s var(--ease); }
.ctx-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-close { border: 0; background: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.ctx-close svg { width: 15px; height: 15px; }
.chips { max-width: 760px; margin: 0 auto 6px; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { position: relative; flex-shrink: 0; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 6px 30px 6px 6px; max-width: 220px; font-size: 13px; }
.chip img { width: 40px; height: 40px; object-fit: cover; border-radius: 9px; }
.chip .ficon { width: 40px; height: 40px; border-radius: 9px; background: var(--panel); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.chip .cname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.chip .csub { color: var(--muted); font-size: 12px; }
.chip.error { border-color: var(--danger); }
.chip.error .csub { color: var(--danger); white-space: normal; }
.chip .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--user-bubble); display: grid; place-items: center; padding: 0; }
.chip .rm svg { width: 12px; height: 12px; }
.cinfo { min-width: 0; }

/* ---------- Feuille d'actions ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.32); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; margin: 0 auto; width: min(520px, 100%);
  background: var(--surface); border-radius: 22px 22px 0 0; padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); transform: translateY(110%); transition: transform .28s var(--ease); visibility: hidden;
}
.sheet.open { transform: none; visibility: visible; }
@media (min-width: 821px) {
  .sheet { bottom: auto; top: 50%; border-radius: 20px; width: 380px; transform: translateY(-46%) scale(.96); opacity: 0; transition: transform .2s var(--ease), opacity .2s; }
  .sheet.open { transform: translateY(-50%); opacity: 1; }
  .sheet-grip { display: none; }
}
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 8px; }
.sheet-preview { font-size: 13.5px; color: var(--muted); padding: 4px 10px 10px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.sheet-preview:empty { display: none; }
.sheet-items { display: flex; flex-direction: column; background: var(--bg); border-radius: 16px; overflow: hidden; }
.sheet-item { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 14px 16px; font-size: 16px; text-align: left; }
.sheet-item + .sheet-item { border-top: 1px solid var(--border); }
.sheet-item:active { transform: none; background: var(--user-bubble); }
.sheet-item.danger { color: var(--danger); }
.sheet-item svg { color: var(--muted); }
.sheet-item.danger svg { color: var(--danger); }

/* ---------- Dialogues ---------- */
.dialog { border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog form { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.dialog h2 { margin: 0; font-size: 19px; }
.dialog fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 12px; margin: 4px 0; display: flex; flex-direction: column; gap: 6px; }
.dialog legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.dialog label { font-size: 14px; font-weight: 600; margin-top: 6px; }
.dialog .radio { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 0; }
.dialog input[type=password], .dialog input[type=url], .dialog textarea { width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg); font-size: 16px; }
.dialog textarea { resize: vertical; line-height: 1.45; }
.dialog-actions { display: flex; gap: 8px; margin-top: 8px; }
.dialog-actions button { flex: 1; margin-top: 0; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }

.only-mobile { display: none; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 40; animation: fade .2s; }

@media (max-width: 820px) {
  .only-mobile { display: grid; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(86vw, 320px); transform: translateX(-100%); transition: transform .26s var(--ease); box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .sidebar.open { transform: none; }
  .messages { padding: 8px 14px 24px; }
  .conv-item .open { padding: 11px 10px; font-size: 15.5px; }
  .suggestions { grid-template-columns: 1fr; }
  .suggestion:nth-child(n+4) { display: none; }
  /* Appui long = menu d'actions (pas la loupe/sélection d'iOS). Le texte reste copiable via « Copier » ou « Sélectionner ». */
  .msg { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  .msg.selectable { user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Glisser vers la droite pour répondre : le navigateur ne gère que le défilement vertical. */
.msg { touch-action: pan-y; }

/* ---------- Actions de Claude (outils) ---------- */
.tools-line { padding: 0 4px; font-size: 12px; }
details.steps { margin: 4px 0 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font: 13.5px/1.4 var(--font); overflow: hidden; }
details.steps > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--muted); }
details.steps > summary::-webkit-details-marker, details.step > summary::-webkit-details-marker { display: none; }
details.steps > summary::after { content: "›"; margin-left: auto; transition: transform .15s; }
details.steps[open] > summary::after { transform: rotate(90deg); }
.steps-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.steps.live .steps-title { color: var(--text); }
.step-list { border-top: 1px solid var(--border); padding: 4px 6px 6px; display: flex; flex-direction: column; }
details.step > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; min-width: 0; }
details.step > summary:hover { background: var(--bg); }
details.step .ico { width: 18px; text-align: center; color: var(--muted); flex-shrink: 0; }
details.step .lbl { font: 12.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.step-out { margin: 2px 6px 8px 32px; padding: 8px 10px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; font: 12px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; }
.st { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--ok); }
.st.err { background: var(--danger); }
.st.run { background: transparent; border: 2px solid var(--accent); border-right-color: transparent; width: 12px; height: 12px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fichiers livrés ---------- */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; margin: 10px 0 4px; }
.file-card { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); min-width: 0; animation: msg-in .25s var(--ease) both; }
.file-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.file-badge { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font: 700 12px var(--font); color: #fff; background: #6d6a64; flex-shrink: 0; }
.b-pdf { background: #d1453b; } .b-zip { background: #8a6d3b; } .b-web { background: #2f6fd6; } .b-doc { background: #2b579a; } .b-xls { background: #1f7a46; } .b-ppt { background: #c4532c; } .b-svg, .b-png { background: #8b5cf6; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-acts { display: flex; gap: 6px; flex-shrink: 0; }
.file-btn { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 10px; padding: 7px 11px; font: 600 13px var(--font); text-decoration: none; display: inline-flex; align-items: center; }
.file-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Aperçu en direct ---------- */
.preview { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; animation: fade .2s; }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; border-bottom: 1px solid var(--border); }
.preview-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.b-live { background: #1f9d55; font-size: 11px; letter-spacing: .04em; position: relative; }
.b-live::after { content: ""; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: #b8f5cf; animation: pulse 1.4s ease-in-out infinite; }

/* =====================================================================
   v7 — Atelier, activité en direct, finitions « app native »
   ===================================================================== */
:root { --spring: cubic-bezier(.32, .72, 0, 1); --ws-w: min(46vw, 720px); --admin: #d4a017; }
.btn-ghost.danger { color: var(--danger); }

/* ---------- Ligne d'activité (dans le message) ---------- */
.act-row {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; margin: 6px 0 12px;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  font: 14px/1.3 var(--font); color: var(--text); text-align: left; position: relative; overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .15s var(--spring);
}
.act-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }
.act-row:active { transform: scale(.985); }
.act-row.live { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.act-row.live::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--accent) 10%, transparent) 50%, transparent 80%);
  background-size: 220% 100%; animation: sweep 1.8s linear infinite;
}
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.act-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.8px; }
.act-time { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.act-chev { color: var(--muted); font-size: 18px; line-height: 1; transition: transform .2s; }
.act-row:hover .act-chev { transform: translateX(2px); }
.act-orb { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.act-orb.err { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.act-orb.run { background: var(--accent); animation: orb 1.2s ease-in-out infinite; }
@keyframes orb { 0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); } }

/* ---------- Pastille « Claude travaille » ---------- */
.live-pill {
  position: absolute; left: 50%; bottom: calc(118px + env(safe-area-inset-bottom)); z-index: 7;
  display: flex; align-items: center; gap: 8px; max-width: min(560px, calc(100vw - 32px));
  padding: 8px 8px 8px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 10px 30px rgba(0,0,0,.16); font: 13px var(--font); color: var(--text);
  transform: translate(-50%, 20px) scale(.94); opacity: 0; pointer-events: none;
  transition: transform .45s var(--spring), opacity .25s;
}
.live-pill.show { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto; }
.pill-orb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: orb 1.2s ease-in-out infinite; flex-shrink: 0; }
.pill-verb { font-weight: 600; flex-shrink: 0; }
.pill-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pill-time { color: var(--muted); font-size: 12px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.pill-see { background: var(--accent); color: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 600; font-size: 12px; flex-shrink: 0; }

/* ---------- Composer : halo animé pendant que Claude travaille, liseré du mode VPS ---------- */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
body.streaming .composer-box {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--spin), transparent 0 55%, var(--accent) 75%, #f0b38f 85%, transparent 100%) border-box;
  animation: spin 2.4s linear infinite;
}
@keyframes spin { to { --spin: 360deg; } }
.mode-select { color: var(--text); font-weight: 600; max-width: 34%; padding-left: 24px; background-repeat: no-repeat; background-position: 9px 50%; background-size: 8px 8px;
  background-image: radial-gradient(circle, var(--ok) 0 3.5px, transparent 4px); }
body.mode-admin .mode-select { background-image: radial-gradient(circle, var(--admin) 0 3.5px, transparent 4px); border-color: color-mix(in srgb, var(--admin) 55%, var(--border)); }
body.mode-admin .composer-box:not(:focus-within) { border-color: color-mix(in srgb, var(--admin) 35%, var(--border)); }
.ws-btn { position: relative; }
body.streaming .ws-btn::after { content: ""; position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: orb 1.2s infinite; }

/* Changement de conversation : transition douce */
.messages.swap { animation: swap .35s var(--spring); }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Atelier ---------- */
.ws-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.36); opacity: 0; pointer-events: none; transition: opacity .35s; }
.ws-backdrop.open { opacity: 1; pointer-events: auto; }
.ws {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 26px 26px 0 0; box-shadow: 0 -18px 60px rgba(0,0,0,.28);
  transform: translateY(105%); transition: transform .5s var(--spring); padding-bottom: env(safe-area-inset-bottom);
  visibility: hidden; will-change: transform;
}
.ws.open { transform: none; visibility: visible; }
.ws.dragging { transition: none; }
.ws-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--border); margin: 9px auto 2px; flex-shrink: 0; }
.ws-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 10px 4px 18px; flex-shrink: 0; }
.ws-title { display: flex; align-items: center; gap: 8px; }
.ws-name { font: 600 17px var(--font); }
.ws-live { font-size: 11.5px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; opacity: 0; transition: opacity .3s; }
.ws-live.on { opacity: 1; }
.ws-live.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: orb 1.2s infinite; }
.ws-tabs { position: relative; display: flex; gap: 2px; margin: 4px 14px 8px; padding: 3px; border-radius: 12px; background: var(--panel); flex-shrink: 0; }
.ws-tab { flex: 1; position: relative; z-index: 1; border: 0; background: none; padding: 7px 4px; font: 600 13.5px var(--font); color: var(--muted); border-radius: 9px; transition: color .2s; }
.ws-tab.on { color: var(--text); }
.ws-tab:active { transform: none; }
.ws-ink { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 9px; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.12); transition: transform .38s var(--spring), width .38s var(--spring); }
.ws-body { flex: 1; min-height: 0; position: relative; }
.ws-pane { position: absolute; inset: 0; display: none; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 14px 16px; }
.ws-pane.on { display: flex; animation: pane .3s var(--spring); }
@keyframes pane { from { opacity: 0; transform: translateY(6px); } }
.ws-pane.loading { opacity: .55; transition: opacity .2s; }
.ws-empty { margin: auto; text-align: center; color: var(--muted); max-width: 340px; padding: 24px; }
.ws-empty-ico { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 22px; }

@media (min-width: 1100px) {
  .ws { left: auto; top: 0; height: auto; width: var(--ws-w); border-radius: 0; border-left: 1px solid var(--border); box-shadow: -10px 0 40px rgba(0,0,0,.06); transform: translateX(102%); padding-top: env(safe-area-inset-top); }
  .ws.open { transform: none; }
  .ws-grip { display: none; }
  .ws-head { padding-top: 10px; }
  .ws-backdrop { display: none; }
  .main { transition: margin-right .5s var(--spring); }
  body.ws-open .main { margin-right: var(--ws-w); }
  body.ws-open .live-pill { display: none; }
}

/* Activité */
.ws-steps { display: flex; flex-direction: column; gap: 8px; }
.ws-step { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; transition: border-color .25s, box-shadow .25s; }
.ws-step.enter { animation: stepin .4s var(--spring); }
@keyframes stepin { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.ws-step.running { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.ws-step.err { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.ws-step-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; }
.ws-step-ico { color: var(--muted); width: 16px; text-align: center; }
.ws-step-label { flex: 1; min-width: 0; font: 12.8px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-step.collapsed .ws-step-label { white-space: nowrap; }
.ws-step:not(.collapsed) .ws-step-label { white-space: pre-wrap; overflow-wrap: anywhere; }
.ws-step-dur { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ws-console { margin: 0; padding: 10px 12px; max-height: 46vh; overflow: auto; background: #151413; color: #e9e6df; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid var(--border); }
.ws-step.collapsed .ws-console { display: none; }
.ws-step.running .ws-console::after { content: "▍"; color: var(--accent); animation: caret 1s steps(2) infinite; }
.ws-step-act { margin: 0 12px 12px; }
.ws-run-files .files { margin-top: 12px; }

/* Fichiers */
.ws-fbar { display: flex; align-items: center; gap: 8px; position: sticky; top: -4px; background: var(--bg); padding: 4px 0 8px; z-index: 2; }
.ws-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.ws-crumb { border: 0; background: none; padding: 5px 7px; border-radius: 8px; font-size: 13.5px; color: var(--text); }
.ws-crumb:last-child { font-weight: 600; }
.ws-sep { color: var(--muted); }
.ws-ftools { display: flex; gap: 4px; flex-shrink: 0; }
.ws-ftool { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; display: grid; place-items: center; color: var(--text); }
.ws-flist { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ws-frow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; text-align: left; font-size: 15px; }
.ws-frow + .ws-frow { border-top: 1px solid var(--border); }
.ws-frow:active { transform: none; background: var(--user-bubble); }
.ws-fico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font: 700 10px var(--font); color: #fff; background: #6d6a64; flex-shrink: 0; }
.ws-fico.dir { background: color-mix(in srgb, var(--accent) 80%, #fff); position: relative; }
.ws-fico.dir::after { content: ""; width: 16px; height: 12px; border-radius: 2px 3px 3px 3px; border: 2px solid #fff; border-top-width: 3px; }
.ws-fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-fmeta { color: var(--muted); font-size: 12.5px; }
.ws-viewer { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; padding: 4px 14px 14px; animation: slidein .32s var(--spring); z-index: 3; }
.ws-viewer.leave { animation: slideout .22s ease-in forwards; }
@keyframes slidein { from { transform: translateX(30%); opacity: 0; } }
@keyframes slideout { to { transform: translateX(30%); opacity: 0; } }
.ws-vbar { display: flex; align-items: center; gap: 8px; padding: 4px 0 8px; }
.ws-vname { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-vcontent { flex: 1; min-height: 0; overflow: auto; }
.ws-vimg { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.ws-vcode { margin: 0; padding: 12px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px; font: 12.5px/1.5 var(--mono); overflow: auto; }

/* Aperçu */
.ws-frame { flex: 1; width: 100%; border: 1px solid var(--border); border-radius: 14px; background: #fff; min-height: 0; }
.ws-preview.on { padding-bottom: 14px; }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.ws-dot.live { background: #1f9d55; animation: orb 1.6s infinite; }

/* Terminal */
.ws-terminal.on { padding: 0 10px 8px; gap: 6px; }
.ws-tstatus { font-size: 12px; color: var(--muted); padding: 2px 4px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ws-tstatus::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.ws-tstatus.ok::before { background: var(--ok); }
.ws-tstatus.connecting::before { background: var(--warn); animation: orb 1s infinite; }
.ws-tstatus.off::before { background: var(--danger); }
.ws-xterm { flex: 1; min-height: 0; background: #141311; border-radius: 14px; padding: 8px 6px 4px 8px; overflow: hidden; }
.ws-xterm .xterm { height: 100%; }
.ws-keys { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; flex-shrink: 0; }
.ws-key { flex-shrink: 0; min-width: 44px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: 600 13px var(--mono); color: var(--text); }
.ws-key.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.ws-lock { margin: auto; width: min(340px, 100%); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.ws-lock h3 { margin: 0; }
.ws-lock p { margin: 0; }
.ws-lock input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 16px; }

/* ---------- Questions de Claude ---------- */
.ask-card {
  margin: 8px 0 12px; padding: 14px; border-radius: 18px; background: var(--surface); max-width: 560px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 12%, transparent);
  font: 15px/1.45 var(--font); animation: stepin .45s var(--spring); position: relative;
}
.ask-card.flash { animation: askflash .9s ease; }
@keyframes askflash { 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); } }
.ask-card.answered { border-color: var(--border); box-shadow: none; opacity: .92; }
.ask-card.kind-secret { border-color: color-mix(in srgb, var(--admin) 55%, var(--border)); }
.ask-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.ask-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); font-size: 12px; text-transform: none; }
.ask-q { margin: 8px 0 12px; font-weight: 500; white-space: pre-wrap; }
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ask-opt { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 12px; padding: 9px 14px; font: 600 14.5px var(--font); transition: background .15s, border-color .15s, transform .12s; }
.ask-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.ask-form { display: flex; gap: 8px; align-items: flex-end; }
.ask-form textarea, .ask-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); font-size: 16px; resize: none; line-height: 1.4; }
.ask-form input:focus, .ask-form textarea:focus { outline: none; border-color: var(--accent); }
.ask-note { margin: 8px 2px 0; font-size: 12.5px; color: var(--muted); }
.ask-foot { margin-top: 6px; display: flex; justify-content: flex-end; }
.ask-done { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.ask-check { width: 20px; height: 20px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.ask-card.sent:not(.answered) .ask-ctl { opacity: .5; }
.live-pill.ask { border-color: var(--accent); }
.live-pill.ask .pill-orb { background: var(--admin); }
.ask-card.history { padding: 10px 12px; margin: 6px 0 10px; }
.ask-card.history .ask-q { margin: 4px 0 6px; font-size: 14px; }
.ask-check.no { background: var(--muted); }

/* ---------- Équipe d'agents ---------- */
.ws-team { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); animation: stepin .4s var(--spring); }
.ws-team-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 2px 2px; }
.ws-agent { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 11px; background: var(--bg); min-width: 0; transition: background .3s; }
.ws-agent.live { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.ws-agent.live .ws-agent-state::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; animation: orb 1.2s infinite; vertical-align: middle; }
.ws-agent.err .ws-agent-state { color: var(--danger); }
.ws-agent-state { flex: 1; min-width: 0; font: 12px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-agent-n { font-size: 11.5px; color: var(--muted); background: var(--panel); border-radius: 999px; padding: 1px 7px; }
.ws-role { flex-shrink: 0; font: 600 11.5px var(--font); color: #fff; border-radius: 7px; padding: 2px 7px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #6d6a64; }
.ws-role.r1 { background: #2f6fd6; } .ws-role.r2 { background: #8b5cf6; } .ws-role.r3 { background: #1f9d55; } .ws-role.r4 { background: #c4532c; } .ws-role.r5 { background: #b8860b; } .ws-role.r0 { background: #d1453b; }
.ws-step-top .ws-role { max-width: 30%; }
.act-row.team .act-orb.run { background: conic-gradient(var(--accent), #8b5cf6, #2f6fd6, var(--accent)); }
.ws-step:not(.collapsed) .ws-step-label { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }


/* ======================================================================
   v11 — interface façon iOS : barres translucides, bulles iMessage,
   listes groupées, feuilles à ressort, gestes.
   ====================================================================== */
body { font-size: 17px; letter-spacing: -.01em; background: var(--bg); }
button:active { transform: none; }
.icon-btn:active, .tool-btn:active, .send-btn:active, .act-btn:active { transform: scale(.9); transition: transform .08s; }
.icon-btn { border-radius: 50%; color: var(--accent); width: 44px; height: 44px; }
.icon-btn:hover { background: var(--fill-2); }
.icon-btn svg { width: 23px; height: 23px; stroke-width: 2; }
.icon-btn.tint { color: var(--accent); }
.logo { background: linear-gradient(145deg, #0a84ff, #5e5ce6); border-radius: 22%; }

/* Connexion */
.login { background: var(--panel); }
.login-card { border: 0; border-radius: 26px; }
.login-card h1 { font: 700 26px/1.2 var(--font); letter-spacing: -.02em; }
.login-card input[type=password] { border: 0; background: var(--fill); border-radius: 12px; padding: 14px; }
.btn-primary { border-radius: 14px; padding: 14px; font-size: 17px; }
.btn-secondary { border: 0; background: var(--fill); border-radius: 14px; }

/* Barre du haut : translucide, titre centré + sous-titre */
.main { background: var(--bg); }
.topbar { position: absolute; top: 0; left: 0; right: 0; background: var(--bar); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); min-height: 52px; padding: calc(4px + env(safe-area-inset-top)) 6px 4px; border-bottom: .5px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--sep); }
.conv-head { flex: 1; min-width: 0; border: 0; background: none; display: flex; flex-direction: column; align-items: center; padding: 2px 6px; border-radius: 10px; }
.conv-head:active { background: var(--fill-2); }
.conv-title { font-weight: 600; font-size: 17px; letter-spacing: -.02em; max-width: 100%; padding: 0; text-align: center !important; }
.conv-sub-line { display: flex; align-items: center; gap: 1px; color: var(--muted); font-size: 12px; max-width: 100%; }
.conv-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-sub-line .chev { width: 13px; height: 13px; stroke-width: 2.4; }
.scroller { padding-top: calc(56px + env(safe-area-inset-top)); scroll-padding-top: calc(56px + env(safe-area-inset-top)); }
.banner { position: relative; z-index: 4; margin: calc(60px + env(safe-area-inset-top)) 12px -52px; border: 0; border-radius: 14px; }

/* Accueil */
.empty h2 { font: 700 30px/1.15 var(--font); letter-spacing: -.03em; }
.suggestion { border: 0; background: var(--fill-2); border-radius: 16px; padding: 13px 14px; }
.suggestion:hover { background: var(--fill); }
.suggestion:active { transform: scale(.98); transition: transform .1s; }

/* Messages : bulles iMessage pour l'utilisateur, texte libre pour Claude */
.messages { padding-bottom: 12px; }
.msg { margin: 10px 0; animation: msg-in .38s var(--spring) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.msg.user .bubble { background: var(--user-bubble); color: var(--user-text); border-radius: 20px; padding: 8px 14px; font-size: 17px; line-height: 1.38; position: relative; max-width: min(78%, 560px); }
.msg.user .bubble a { color: inherit; }
.quote-block { border-left-color: rgba(255,255,255,.7); color: rgba(255,255,255,.85); }
.msg.user .att-thumb { border: 0; border-radius: 18px; }
.msg.assistant .content { font: 17px/1.55 var(--font); letter-spacing: -.01em; }
.content h1, .content h2, .content h3 { font-family: var(--font); letter-spacing: -.02em; }
.content blockquote { border-left-color: var(--fill); }
.msg .swipe-hint { color: var(--muted); }
.actions { gap: 0; }
.act-btn { width: 34px; height: 34px; }
.act-btn:hover { background: var(--fill-2); }
.meta { font-variant-numeric: tabular-nums; }
.tag { border: 0; background: var(--fill-2); }
.err-box { border: 0; background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* Indicateur « Claude écrit » façon iMessage */
.typing { background: var(--fill); border-radius: 20px; padding: 11px 14px; gap: 4px; }
.typing i { width: 8px; height: 8px; background: var(--muted); animation: imsg 1.3s infinite ease-in-out; }
.typing span { font-size: 14px; }
@keyframes imsg { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.cursor > :last-child::after { background: var(--accent); }

/* Séparateur de compactage */
.compact-sep { display: flex; align-items: center; gap: 10px; margin: 22px 0; color: var(--muted); font-size: 12.5px; }
.compact-sep::before, .compact-sep::after { content: ""; flex: 1; height: .5px; background: var(--sep); }
.compact-live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 6px 0; }
.compact-live .spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--fill); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Zone de saisie : une seule ligne [+][champ][↑] sur fond translucide */
.composer { position: relative; z-index: 6; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--bar); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-top: .5px solid var(--sep); }
.composer-box { border: 0; background: none; box-shadow: none; padding: 0; border-radius: 0; }
.composer-box:focus-within { border-color: transparent; }
.composer-row { align-items: flex-end; gap: 8px; }
.field { flex: 1; min-width: 0; border: 1px solid var(--sep); border-radius: 20px; background: var(--bg); display: flex; align-items: flex-end; transition: border-color .2s; }
.field:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--sep)); }
#input { padding: 7px 14px; font-size: 17px; line-height: 1.32; min-height: 36px; }
.tool-btn { width: 36px; height: 36px; border: 0; background: var(--fill); color: var(--muted); flex-shrink: 0; }
.tool-btn svg { width: 20px; height: 20px; stroke-width: 2.4; }
.tool-btn[aria-expanded="true"] svg { transform: rotate(45deg); }
.tool-btn svg { transition: transform .25s var(--spring); }
.send-btn { width: 34px; height: 34px; margin: 0 1px 1px 0; background: var(--accent); }
.send-btn svg { stroke-width: 2.6; width: 19px; height: 19px; }
.send-btn:disabled { opacity: 1; background: var(--fill); color: var(--muted); }
.send-btn.stop { background: var(--text); }
body.streaming .composer-box { animation: none; }
.attach-menu { bottom: 48px; border: 0; border-radius: 16px; background: var(--elev); box-shadow: 0 10px 40px rgba(0,0,0,.22); padding: 0; overflow: hidden; transform-origin: bottom left; animation: pop-menu .32s var(--spring); }
@keyframes pop-menu { from { opacity: 0; transform: scale(.7); } }
.attach-menu button { border-radius: 0; padding: 13px 16px; font-size: 17px; }
.attach-menu button + button { border-top: .5px solid var(--sep); }
.attach-menu button:hover { background: var(--fill-2); }
.context-chip { background: var(--fill-2); }
.chip { border: 0; background: var(--fill-2); }
.to-bottom { border: 0; background: var(--elev); bottom: calc(76px + env(safe-area-inset-bottom)); }
.live-pill { bottom: calc(66px + env(safe-area-inset-bottom)) !important; }

/* Barre latérale (liste groupée iOS) */
.sidebar { background: var(--panel); border-right: .5px solid var(--sep); }
.sidebar-head { padding: 8px 14px 6px; }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; margin: 0 -6px 0 2px; }
.sidebar-title h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.search { border: 0; background: var(--fill); border-radius: 11px; height: 38px; }
.search input { font-size: 17px; }
.conv-list { padding: 0 12px 12px; }
.conv-group { font-size: 13px; text-transform: none; padding: 16px 6px 6px; color: var(--muted); font-weight: 600; }
.conv-item { border-radius: 12px; overflow: hidden; background: transparent; }
.conv-item .slide { position: relative; z-index: 1; display: flex; align-items: center; width: 100%; background: var(--panel); transition: transform .35s var(--spring); }
.conv-item:hover .slide, .conv-item.active .slide { background: var(--fill); }
.conv-item:hover, .conv-item.active { background: transparent; }
.conv-item .open { font-size: 16px; padding: 11px 12px; }
.conv-item .snip { font-size: 13.5px; }
.conv-item .pin { color: var(--warn); }
.conv-item .swipe-acts { position: absolute; inset: 0 0 0 auto; display: flex; z-index: 0; }
.conv-item .swipe-acts button { border: 0; color: #fff; width: 78px; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.conv-item .swipe-acts svg { width: 20px; height: 20px; }
.conv-item .swipe-acts .sa-pin { background: var(--warn); }
.conv-item .swipe-acts .sa-del { background: var(--danger); }
.sidebar-foot { border-top: 0; padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); }
.settings-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: var(--surface); border-radius: 12px; padding: 11px 12px; font-size: 16px; text-align: left; }
.settings-row:active { background: var(--fill); }
.settings-row .gear { width: 29px; height: 29px; border-radius: 8px; background: #8e8e93; color: #fff; display: grid; place-items: center; }
.settings-row .gear svg { width: 19px; height: 19px; }
.settings-row-t { flex: 1; }
.backdrop { background: rgba(0,0,0,.4); animation: none; opacity: 0; transition: opacity .35s var(--spring); }
.backdrop.show { opacity: 1; }
@media (max-width: 820px) {
  .sidebar { width: min(86vw, 340px); transition: transform .42s var(--spring); box-shadow: none; }
  .sidebar.open { box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .sidebar.dragging, .main.dragging { transition: none !important; }
  .main { transition: transform .42s var(--spring); }
  body.drawer-open .main { transform: translateX(min(22vw, 90px)); }
}

/* Feuilles (actions, options) : ressort iOS, glisser pour fermer */
.sheet-backdrop { background: rgba(0,0,0,.4); }
.sheet { background: transparent; box-shadow: none; padding: 0 8px calc(8px + env(safe-area-inset-bottom)); transition: transform .45s var(--spring); }
.sheet-grip { background: var(--fill); }
.sheet .sheet-grip { display: none; }
.sheet-preview { background: var(--elev); border-radius: 14px 14px 0 0; padding: 12px 16px; margin: 0; text-align: center; font-size: 13px; border-bottom: .5px solid var(--sep); }
.sheet-preview:empty + .sheet-items { border-radius: 14px; }
.sheet-items { background: var(--elev); border-radius: 0 0 14px 14px; }
.sheet-item { justify-content: center; font-size: 19px; color: var(--accent); padding: 16px; position: relative; }
.sheet-item svg { position: absolute; left: 18px; color: var(--accent); opacity: .9; }
.sheet-item + .sheet-item { border-top: .5px solid var(--sep); }
.sheet-item:active { background: var(--fill-2); }
.sheet-cancel { display: block; width: 100%; margin-top: 8px; border: 0; background: var(--elev); border-radius: 14px; padding: 16px; font-size: 19px; font-weight: 600; color: var(--accent); }
.sheet-cancel:active { background: var(--fill); }

.opts { position: fixed; left: 0; right: 0; bottom: 0; z-index: 82; margin: 0 auto; width: min(560px, 100%); max-height: 88dvh; display: flex; flex-direction: column; background: var(--panel); border-radius: 14px 14px 0 0; transform: translateY(105%); visibility: hidden; transition: transform .5s var(--spring), visibility 0s .5s; padding-bottom: env(safe-area-inset-bottom); }
:root:not([data-theme="light"]) .opts { --panel-sheet: #1c1c1e; }
.opts.open { transform: none; visibility: visible; transition: transform .5s var(--spring); }
.opts.dragging { transition: none; }
.opts .sheet-grip { margin: 6px auto 0; }
.opts-head, .nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 14px 8px; }
.opts-head h2, .nav h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.opts-head .link-btn, .nav .link-btn { justify-self: end; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 17px; padding: 8px 4px; }
.link-btn.strong { font-weight: 600; }
.opts-body, .settings-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px 24px; }
.opts-name { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Listes groupées */
.group { background: var(--surface); border-radius: 12px; overflow: hidden; margin: 0 0 8px; }
.group-head { margin: 24px 16px 7px; font-size: 13px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .01em; }
.group-foot { margin: 0 16px 18px; font-size: 13px; line-height: 1.38; color: var(--muted); }
.group-foot.center { text-align: center; margin-top: 18px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 16px; width: 100%; position: relative; border: 0; background: none; text-align: left; font-size: 17px; }
.row + .row, .row + .meter + .row, .meter + .row { box-shadow: inset 16px .5px 0 var(--surface), inset 0 .5px 0 var(--sep); }
.row.action:active { background: var(--fill); }
.row.sub { min-height: 0; padding-top: 0; box-shadow: none !important; }
.row-t { flex: 1; min-width: 0; }
.row-t.tint { color: var(--accent); }
.row-t.danger { color: var(--danger); }
.row-t.muted { color: var(--muted); font-size: 13.5px; }
.row-v { color: var(--muted); font-variant-numeric: tabular-nums; }
.row.chev::after { content: ""; width: 8px; height: 8px; border: solid var(--muted); border-width: 2px 2px 0 0; transform: rotate(45deg); opacity: .6; margin-right: 3px; }
.row-select { appearance: none; -webkit-appearance: none; border: 0; background: none; color: var(--muted); font-size: 17px; text-align: right; text-align-last: right; max-width: 55%; padding: 4px 18px 4px 0; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 6px center, right 1px center; background-size: 5px 5px; background-repeat: no-repeat; }
.meter { height: 6px; border-radius: 3px; background: var(--fill); margin: 0 16px 12px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ok); transition: width .6s var(--spring), background .3s; }
.meter i.mid { background: var(--warn); }
.meter i.high { background: var(--danger); }

/* Interrupteur iOS */
.switch { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; transition: background .25s; margin: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .3s var(--spring); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .45; }

/* Contrôle segmenté */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 0; }
.seg.wide { display: flex; margin: 10px 12px 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 7px; padding: 6px 12px; font-size: 13px; font-weight: 500; transition: background .2s, box-shadow .2s; }
.seg button.on { background: var(--elev); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04); font-weight: 600; }
:root[data-theme="dark"] .seg button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; } }

/* Consommation */
.usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--sep); margin-top: 10px; border-top: .5px solid var(--sep); }
.usage-grid div { background: var(--surface); padding: 10px 16px; }
.usage-grid b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.usage-grid span { font-size: 12.5px; color: var(--muted); }
#usage-balance:empty { display: none; }

/* Écran Réglages : poussé depuis la droite, retour par glissement */
.settings { position: fixed; inset: 0; z-index: 90; background: var(--panel); display: flex; flex-direction: column; transform: translateX(100%); visibility: hidden; transition: transform .5s var(--spring), visibility 0s .5s; padding-top: env(safe-area-inset-top); }
.settings.open { transform: none; visibility: visible; transition: transform .5s var(--spring); }
.settings.dragging { transition: none; }
.settings .nav { background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.settings-body { padding-bottom: calc(30px + env(safe-area-inset-bottom)); width: min(680px, 100%); margin: 0 auto; }
.nav-side { min-width: 1px; }
@media (min-width: 821px) {
  .settings { inset: 0 0 0 auto; width: 460px; box-shadow: -20px 0 60px rgba(0,0,0,.15); }
  .opts { bottom: auto; top: 50%; border-radius: 16px; max-height: 80dvh; transform: translateY(-45%) scale(.96); opacity: 0; transition: transform .3s var(--spring), opacity .2s, visibility 0s .3s; }
  .opts.open { transform: translateY(-50%); opacity: 1; }
  .opts .sheet-grip { display: none; }
}

/* Dialogues (alertes iOS) */
.dialog { border: 0; border-radius: 16px; background: var(--panel); }
.dialog input[type=password], .dialog input[type=url], .dialog textarea { border: 0; background: var(--surface); }
.dialog fieldset { border: 0; background: var(--surface); }
.toast { border-radius: 22px; background: color-mix(in srgb, var(--elev) 92%, transparent); color: var(--text); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 8px 30px rgba(0,0,0,.18); animation: toast-in .4s var(--spring); bottom: calc(80px + env(safe-area-inset-bottom)); font-weight: 500; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px) scale(.95); } }

/* Mode VPS : légère teinte sur le champ */
body.mode-admin .field { border-color: color-mix(in srgb, var(--warn) 45%, var(--sep)); }
body.mode-admin .composer-box:not(:focus-within) { box-shadow: none; }


/* ======================================================================
   v11.1 — en-tête en pastilles de verre, rond de contexte, carte de saisie
   ====================================================================== */
:root { --glass: color-mix(in srgb, var(--elev) 72%, transparent); --glass-line: color-mix(in srgb, var(--text) 9%, transparent); }
.topbar { background: linear-gradient(var(--bg) 35%, color-mix(in srgb, var(--bg) 0%, transparent)); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0 !important; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 12px 14px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.glass { background: var(--glass); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px); border: .5px solid var(--glass-line); box-shadow: 0 6px 20px rgba(0,0,0,.08); color: var(--text); }
.glass.round { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.glass.round svg { width: 22px; height: 22px; stroke-width: 2; }
.glass:active { transform: scale(.94); transition: transform .12s; }
.conv-head.glass { flex: 1; height: 46px; border-radius: 23px; padding: 0 16px; justify-content: center; gap: 0; }
.conv-head .conv-title { font-size: 15.5px; line-height: 1.2; }
.conv-head .conv-sub-line { font-size: 12px; line-height: 1.25; }
.right-pill { height: 46px; border-radius: 23px; display: flex; align-items: center; padding: 0 4px; gap: 0; flex-shrink: 0; }
.pill-btn { border: 0; background: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.pill-btn svg { width: 21px; height: 21px; stroke-width: 1.9; }
.pill-btn:active { background: var(--fill); }
.only-wide { display: none; }
@media (min-width: 821px) { .only-wide { display: grid; } }
body.streaming .ws-btn::after { top: 6px; right: 6px; }

/* Rond de contexte : arc animé, nombre qui défile, couleur selon le remplissage */
.ctx-ring { position: relative; width: 38px; height: 38px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--text); }
.ctx-ring svg { position: absolute; inset: 2px; width: 34px; height: 34px; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--fill); stroke-width: 3; }
.ring-arc { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .9s var(--spring), stroke .4s; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 45%, transparent)); }
.ctx-ring.mid .ring-arc { stroke: var(--warn); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--warn) 45%, transparent)); }
.ctx-ring.high .ring-arc { stroke: var(--danger); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--danger) 45%, transparent)); }
.ring-num { position: relative; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.ctx-ring.busy svg { animation: spin 1s linear infinite; }
.ctx-ring.busy .ring-arc { stroke-dasharray: 28 100 !important; transition: none; }
.ctx-ring.busy .ring-num { opacity: .35; }
.ctx-ring:active { transform: scale(.9); transition: transform .1s; }

.scroller { padding-top: calc(66px + env(safe-area-inset-top)); }
.banner { margin-top: calc(66px + env(safe-area-inset-top)); }

/* Bulles : arrondies, sans queue, comme Claude iOS (en plus fin) */
.msg.user .bubble { border-radius: 22px; padding: 10px 16px; }
:root[data-theme="dark"] .msg.user .bubble { --user-bubble: #2c2c2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.user .bubble { --user-bubble: #2c2c2e; } }

/* Carte de saisie */
.composer { background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 22px); backdrop-filter: none; -webkit-backdrop-filter: none; border-top: 0; padding: 4px 12px calc(10px + env(safe-area-inset-bottom)); }
.composer-box { max-width: 760px; margin: 0 auto; background: var(--surface); border: .5px solid var(--glass-line) !important; border-radius: 28px; padding: 6px 8px 8px; box-shadow: 0 8px 30px rgba(0,0,0,.08); transition: box-shadow .25s; }
:root[data-theme="dark"] .composer-box { background: #1c1c1e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .composer-box { background: #1c1c1e; } }
.composer-box:focus-within { box-shadow: 0 10px 36px rgba(0,0,0,.12); }
#input { padding: 10px 10px 6px; min-height: 0; font-size: 17px; line-height: 1.38; }
.composer-row { align-items: center; gap: 8px; padding-top: 2px; }
.row-spacer { flex: 1; }
.round-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--fill-2); color: var(--text); display: grid; place-items: center; flex-shrink: 0; }
.round-btn svg { width: 20px; height: 20px; stroke-width: 2.1; }
.round-btn:active { transform: scale(.9); transition: transform .1s; background: var(--fill); }
.round-btn.close { background: var(--fill); width: 34px; height: 34px; }
#mic-btn.rec { background: var(--danger); color: #fff; animation: rec 1.3s ease-in-out infinite; }
@keyframes rec { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--danger) 25%, transparent); } }
.model-pill { border: 0; background: var(--fill-2); border-radius: 19px; height: 38px; padding: 0 15px; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; min-width: 0; max-width: 55%; white-space: nowrap; }
.model-pill b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.model-pill span { color: var(--muted); }
.model-pill:active { background: var(--fill); transform: scale(.97); transition: transform .1s; }
.send-btn { width: 38px; height: 38px; margin: 0; background: var(--accent); color: #fff; }
.send-btn:not(:disabled) { animation: send-in .35s var(--spring); }
@keyframes send-in { from { transform: scale(.6); } }
.send-btn:disabled { background: var(--fill); color: var(--muted); }
.send-btn.stop { background: var(--text); color: var(--bg); }
.to-bottom { bottom: calc(130px + env(safe-area-inset-bottom)); }
.live-pill { bottom: calc(126px + env(safe-area-inset-bottom)) !important; }
.toast { bottom: calc(140px + env(safe-area-inset-bottom)); }
body.mode-admin .composer-box { box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent), 0 8px 30px rgba(0,0,0,.08); }
body.mode-admin .field { border-color: transparent; }

/* Feuille « Ajouter du contexte » */
.attach-sheet { z-index: 83; }
.attach-sheet .opts-head { grid-template-columns: 44px 1fr 44px; }
.attach-sheet .opts-head h2 { font-size: 17px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 14px; }
.tile { border: 0; background: var(--surface); border-radius: 18px; padding: 18px 6px 14px; display: flex; flex-direction: column; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--text); }
.tile svg { width: 28px; height: 28px; stroke-width: 1.7; color: var(--accent); }
.tile:active { transform: scale(.95); transition: transform .12s; background: var(--fill); }
.row-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--fill-2); color: var(--text); flex-shrink: 0; }
.row-ico svg { width: 18px; height: 18px; }
.attach-sheet .row + .row { box-shadow: inset 58px .5px 0 var(--surface), inset 0 .5px 0 var(--sep); }

/* Glisser une conversation : actions masquées tant qu'on ne glisse pas */
.conv-item .swipe-acts { opacity: 0; transition: opacity .15s; }
.conv-item.reveal .swipe-acts { opacity: 1; }
.conv-item .slide { background: var(--panel); }
.conv-item.active .slide, .conv-item:hover .slide { background: linear-gradient(var(--fill), var(--fill)), var(--panel); }
@media (min-width: 821px) { .topbar { padding-left: 16px; } }
.banner { margin: calc(66px + env(safe-area-inset-top)) 12px 0; }
.banner:not([hidden]) + .scroller { padding-top: 6px; }
.conv-head .conv-title { padding: 0; margin: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-head.glass { height: 48px; }
.glass.round, .right-pill { height: 48px; }
.glass.round { width: 48px; }
.right-pill { border-radius: 24px; }
.conv-head .conv-title { flex: none; line-height: 1.25; }
.conv-head .conv-sub-line { flex: none; }

/* ======================================================================
   DEETO — identité monochrome : noir profond, blanc pur, un seul point.
   ====================================================================== */
:root { --accent: #0b0b0c; --on-accent: #ffffff; --user-bubble: #0b0b0c; --user-text: #ffffff; --ok: #0b0b0c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --accent: #ffffff; --on-accent: #000000; --ok: #ffffff; }
}
:root[data-theme="dark"] { --accent: #ffffff; --on-accent: #000000; --ok: #ffffff; }
::selection { background: color-mix(in srgb, var(--text) 18%, transparent); }
.content a { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); text-underline-offset: 3px; }

/* Logo : un point blanc sur un carré noir, qui respire doucement */
.logo { width: 44px; height: 44px; border-radius: 13px; background: radial-gradient(circle at 50% 50%, #1c1c1e, #000 72%); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.14), 0 8px 24px rgba(0,0,0,.18); }
.logo::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 10px rgba(255,255,255,.55); font-size: 0; display: block; }
.logo.big { width: 64px; height: 64px; border-radius: 19px; }
.logo.big::after { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translate(-50%, -50%) scale(.82); box-shadow: 0 0 18px rgba(255,255,255,.8); } }
.login-card .logo { width: 72px; height: 72px; border-radius: 21px; margin-bottom: 14px; }
.login-card h1 { font-size: 30px; letter-spacing: -.04em; }
.empty h2 { margin-top: 14px; }

/* « DEETO écrit » : un seul point qui pulse (au lieu des trois points habituels) */
.typing { background: none; padding: 8px 0; gap: 10px; }
.typing i { display: none; }
.typing i:first-child { display: block; width: 11px; height: 11px; border-radius: 50%; background: var(--text); animation: dot-pulse 1.4s ease-in-out infinite; box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 30%, transparent); }
@keyframes dot-pulse { 0%, 100% { transform: scale(.75); opacity: .55; box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 25%, transparent); } 50% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 7px color-mix(in srgb, var(--text) 0%, transparent); } }
.typing span { color: var(--muted); margin-left: 0; }
.cursor > :last-child::after { width: .55em; height: .55em; background: var(--text); }

/* Boutons et commandes en monochrome */
.send-btn { background: var(--accent); color: var(--on-accent); }
.send-btn.stop { background: var(--accent); color: var(--on-accent); }
.switch:checked { background: var(--accent); }
.switch:checked::after { background: var(--on-accent); }
.link-btn, .row-t.tint, .icon-btn.tint, .sheet-item, .sheet-cancel, .tile svg { color: var(--text); }
.sheet-item svg { color: var(--muted); }
.ring-arc { stroke: var(--text); filter: none; }
.ctx-ring.mid .ring-arc { stroke: var(--warn); filter: none; }
.ctx-ring.high .ring-arc { stroke: var(--danger); filter: none; }
.meter i { background: var(--text); }
.compact-live .spin { border-top-color: var(--text); }
.settings-row .gear { background: #000; box-shadow: inset 0 0 0 .5px rgba(255,255,255,.18); }
.conv-item .pin { color: var(--text); }
.conv-item .swipe-acts .sa-pin { background: #636366; }
.msg.user .quote-block { border-left-color: rgba(255,255,255,.6); }
.expand-btn { color: var(--muted); }
body.streaming .ws-btn::after { background: var(--text); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.login { background: var(--bg); }
.login-card { background: transparent; box-shadow: none; }
.login-card input[type=password] { background: var(--fill-2); outline: none; border: .5px solid var(--glass-line); }
.login-card input[type=password]:focus { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.banner { background: var(--fill-2); border: 0; }
.banner.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ======================================================================
   v13 — comportement d'appli (pas de page web), file d'attente, finitions
   ====================================================================== */
/* Appui long : pas de sélection bleue de toute la page, pas de loupe, pas d'aperçu de lien/image. */
html, body, .app, .sheet, .opts, .settings, .ws { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], .selectable, .selectable * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, svg, a { -webkit-user-drag: none; -webkit-touch-callout: none; }
@media (hover: hover) and (pointer: fine) {
  .msg .content, .msg .bubble, .step-out, .ws-console, .xterm { -webkit-user-select: text; user-select: text; }
}
* { -webkit-tap-highlight-color: transparent; }
button, a, .act-row, .conv-item { touch-action: manipulation; }

/* Défilement et rendu plus légers sur les longues conversations */
.scroller { scroll-behavior: auto; -webkit-overflow-scrolling: touch; contain: layout paint; }
.msg:not(:nth-last-child(-n+8)) { content-visibility: auto; contain-intrinsic-size: auto 160px; }
.sidebar, .opts, .settings, .attach-sheet, .sheet { will-change: transform; }

/* Point « en cours » dans la liste des conversations */
.run-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text); margin: 0 7px 1px 0; vertical-align: middle; animation: dot-pulse 1.4s ease-in-out infinite; }

/* File d'attente au-dessus de la zone de saisie */
.queue-box { max-width: 760px; margin: 0 auto 8px; display: flex; flex-direction: column; gap: 6px; animation: menu-in .3s var(--spring); }
.queue-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 0 6px; }
.queue-cancel { border: 0; background: none; color: var(--text); font-size: 13px; font-weight: 600; padding: 4px 6px; }
.queue-item { align-self: flex-end; max-width: 80%; padding: 8px 14px; border-radius: 18px; background: var(--fill-2); color: var(--muted); font-size: 15px; line-height: 1.35; border: 1px dashed color-mix(in srgb, var(--text) 18%, transparent); white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.send-btn.queue { background: var(--fill); color: var(--text); }

/* Message ajouté pendant la tâche */
.user-note { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin: 10px 0 12px auto; max-width: 80%; font-family: var(--font); }
.user-note-k { font-size: 11.5px; color: var(--muted); letter-spacing: .01em; }
.user-note-t { background: var(--user-bubble); color: var(--user-text); border-radius: 18px; padding: 7px 13px; font-size: 15px; line-height: 1.35; white-space: pre-wrap; }
:root[data-theme="dark"] .user-note-t { background: #2c2c2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .user-note-t { background: #2c2c2e; } }

/* Finitions monochromes : réflexion, code, tableaux, cartes, activité */
details.thinking summary { border: 0; padding: 2px 0; color: var(--muted); font-size: 14px; background: none; }
details.thinking summary:active { opacity: .6; }
.code-block { border: .5px solid var(--glass-line); border-radius: 16px; background: var(--code-bg); }
.code-head { border-bottom: .5px solid var(--glass-line); font-size: 11.5px; letter-spacing: .02em; }
.content table { border-radius: 12px; border: .5px solid var(--sep); }
.content th, .content td { border: 0; border-bottom: .5px solid var(--sep); padding: 8px 12px; }
.content th { font-weight: 600; background: var(--fill-2); }
.content tr:last-child td { border-bottom: 0; }
.content hr { border: 0; height: .5px; background: var(--sep); margin: 1.4em 0; }
.content blockquote { border-left: 2px solid var(--text); color: var(--muted); }
.file-card { border: .5px solid var(--glass-line); border-radius: 18px; background: var(--surface); padding: 10px; }
.file-badge { background: var(--text) !important; color: var(--bg) !important; border-radius: 10px; font-weight: 700; letter-spacing: .03em; }
.file-btn { border: 0 !important; background: var(--fill-2) !important; color: var(--text) !important; border-radius: 999px !important; padding: 7px 13px !important; font-size: 13.5px !important; font-weight: 600; text-decoration: none; white-space: nowrap; }
.file-btn.primary { background: var(--accent) !important; color: var(--on-accent) !important; }
.file-btn:active { transform: scale(.95); transition: transform .1s; }
.act-row { border: .5px solid var(--glass-line); border-radius: 16px; background: var(--surface); }
.act-row:hover { border-color: color-mix(in srgb, var(--text) 25%, transparent); box-shadow: none; }
.act-row:active { transform: scale(.985); }
.act-orb.run, .act-orb.ok { background: var(--text); }
.actions .act-btn { opacity: .75; }
.actions .act-btn:active { opacity: 1; }
.msg.assistant + .msg.user { margin-top: 22px; }

/* v13.1 — geste du panneau sans à-coups, pas de zoom */
html, body { touch-action: pan-x pan-y; }
@media (max-width: 820px) {
  body.drawer-open .main { transform: none; }
  .main { transition: none; }
  .sidebar { transform: translate3d(-100%, 0, 0); transition: transform .38s cubic-bezier(.32, .72, 0, 1); backface-visibility: hidden; }
  .sidebar.open { transform: translate3d(0, 0, 0); }
  .sidebar.dragging { transition: none !important; }
  .backdrop { transition: opacity .38s cubic-bezier(.32, .72, 0, 1); will-change: opacity; }
  .sidebar.dragging ~ .backdrop { transition: none; }
}
.row-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.danger-text { color: var(--danger) !important; font-size: 15px; }
#pc-list .row { gap: 10px; }
.pc-form { gap: 10px !important; }
.pc-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.pc-steps a { color: var(--text); font-weight: 600; }
.pc-cmd { margin: 6px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface); font: 12.5px/1.45 var(--mono); white-space: pre-wrap; word-break: break-all; -webkit-user-select: all; user-select: all; }
/* Écran de l'ordinateur contrôlé */
.pc-shot { margin: 2px 0 14px; max-width: 560px; border-radius: 14px; overflow: hidden; border: .5px solid var(--glass-line); background: var(--fill-2); cursor: zoom-in; animation: msg-in .35s var(--spring) both; }
.pc-shot img { display: block; width: 100%; height: auto; }
.pc-shot figcaption { font: 12px var(--font); color: var(--muted); padding: 6px 10px; }
.shot-viewer { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: calc(12px + env(safe-area-inset-top)) 8px calc(12px + env(safe-area-inset-bottom)); animation: fade .2s; cursor: zoom-out; }
.shot-viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* ======================================================================
   Navigateur intégré (onglet de l'Atelier)
   ====================================================================== */
.ws-pane.ws-browser { padding: 0; overflow: hidden; }
.bz-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: .5px solid var(--sep); background: var(--panel); flex-shrink: 0; }
.bz-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--text); display: grid; place-items: center; flex-shrink: 0; }
.bz-btn svg { width: 19px; height: 19px; stroke-width: 2; }
.bz-btn:active { background: var(--fill); transform: scale(.92); transition: transform .1s; }
.bz-btn.hint { background: var(--accent); color: var(--on-accent); animation: dot-pulse 1.4s ease-in-out infinite; }
.bz-url { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--fill); }
.bz-url input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; color: var(--text); text-align: center; }
.bz-url input:focus { text-align: left; }
.bz-url input::placeholder { color: var(--muted); }
.bz-lock { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; opacity: .6; }
.bz-lock.secure { background: var(--ok); opacity: 1; }
.bz-tabs { min-width: 26px; height: 24px; margin: 0 4px; border: 1.6px solid var(--text); border-radius: 7px; background: none; color: var(--text); font: 600 12px var(--font); display: grid; place-items: center; flex-shrink: 0; }
.bz-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #fff; outline: none; touch-action: none; display: flex; align-items: flex-start; justify-content: center; cursor: default; }
.bz-canvas { width: 100%; height: auto; display: block; image-rendering: auto; }
.bz-state { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); background: var(--bg); font-size: 15px; }
.bz-agent { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); opacity: 0; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 20px; background: rgba(0,0,0,.82); color: #fff; font-size: 13.5px; font-weight: 500; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: opacity .3s, transform .4s var(--spring); pointer-events: none; }
.bz-agent.on { opacity: 1; transform: translate(-50%, 0); }
.bz-agent-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: dot-pulse 1.2s ease-in-out infinite; }
.bz-stage:has(.bz-agent.on) { box-shadow: inset 0 0 0 2px rgba(0,0,0,.65); }
.bz-progress { position: absolute; top: 0; left: 0; height: 2px; width: 0; background: var(--text); opacity: 0; }
.bz-progress.on { opacity: 1; animation: bzload 1.6s ease-out forwards; }
@keyframes bzload { from { width: 0; } to { width: 85%; } }
.bz-ripple { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(0,0,0,.18); pointer-events: none; animation: bzrip .45s ease-out forwards; }
@keyframes bzrip { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.bz-ime { position: fixed; left: -9999px; bottom: 0; width: 1px; height: 1px; opacity: 0; font-size: 16px; }
.bz-tabsheet { position: absolute; left: 8px; right: 8px; top: 52px; z-index: 5; max-height: 60%; overflow-y: auto; background: var(--elev); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); padding: 6px; animation: pop-menu .3s var(--spring); transform-origin: top right; }
.bz-tabrow { display: flex; align-items: center; border-radius: 10px; }
.bz-tabrow.on { background: var(--fill-2); }
.bz-tabopen { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 9px 10px; display: flex; flex-direction: column; gap: 1px; }
.bz-tabopen b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bz-tabopen span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bz-tabclose { width: 34px; height: 34px; border: 0; background: none; color: var(--muted); font-size: 20px; }
.bz-newtab { width: 100%; border: 0; background: none; padding: 11px; font-weight: 600; color: var(--text); border-top: .5px solid var(--sep); margin-top: 4px; }
/* PC : bouton « Agrandir » = atelier large pour naviguer confortablement */
@media (min-width: 1100px) { body.bz-wide .ws { width: min(78vw, 1400px) !important; } }
@media (max-width: 1099px) { .bz-btn[aria-label="Agrandir"] { display: none; } }
@media (hover: hover) and (pointer: fine) { .bz-btn[aria-label="Clavier"] { display: none; } }

/* Tâches programmées */
.sched-open { border: 0; background: none; text-align: left; font-size: 17px; color: var(--text); padding: 0; }
.day-picker { display: flex; gap: 6px; margin: 4px 0; }
.day-picker .day { flex: 1; height: 40px; border: 0; border-radius: 12px; background: var(--surface); font-weight: 600; color: var(--muted); }
.day-picker .day.on { background: var(--accent); color: var(--on-accent); }
.sched-row { display: flex; gap: 8px; }
.sched-row input, .field-select, .dialog input[type=text] { flex: 1; width: 100%; padding: 10px 12px; border-radius: 11px; border: 0; background: var(--surface); font-size: 16px; color: var(--text); }
.field-select { appearance: none; -webkit-appearance: none; }
/* Bandeau réseau / nouvelle version */
.net-pill { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 70; padding: 8px 14px; border-radius: 18px; background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 26px rgba(0,0,0,.2); animation: toast-in .4s var(--spring); white-space: nowrap; }
.net-pill.update { cursor: pointer; }

/* Menu des commandes « / » */
.slash-menu { max-width: 760px; margin: 0 auto 8px; background: var(--elev); border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.22); border: .5px solid var(--glass-line); padding: 6px; display: flex; flex-direction: column; animation: pop-menu .28s var(--spring); transform-origin: bottom left; max-height: 46dvh; overflow-y: auto; }
.slash-item { display: flex; align-items: baseline; gap: 10px; border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 12px; color: var(--text); font-size: 15.5px; }
.slash-item b { font-weight: 600; min-width: 96px; font-variant-ligatures: none; }
.slash-item span { color: var(--muted); font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slash-item.on, .slash-item:active { background: var(--fill); }
.slash-mine { font-style: normal; font-size: 11px; color: var(--muted); border: .5px solid var(--sep); border-radius: 6px; padding: 1px 5px; }
.cmd-tag { display: inline-block; margin: 0 8px 2px 0; padding: 1px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.18); vertical-align: 1px; }

/* ---------------------------------------------------------------- v19 : vue des modifications */
.ws-tabs { overflow-x: auto; scrollbar-width: none; }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab { flex: 1 0 auto; padding: 7px 10px; white-space: nowrap; }
.ws-mini { border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 13px var(--font); padding: 7px 12px; border-radius: 10px; flex-shrink: 0; }
.ws-mini.danger { color: var(--danger); }
.ws-mini.armed { background: var(--danger); color: #fff; border-color: var(--danger); }
.df-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px 12px; }
.df-sum { display: flex; gap: 8px; align-items: baseline; font-size: 15px; }
.df-when { font-size: 12px; color: var(--muted); margin-top: 2px; }
.df-plus { color: var(--ok); font: 600 12.5px var(--mono, ui-monospace, monospace); }
.df-minus { color: var(--danger); font: 600 12.5px var(--mono, ui-monospace, monospace); }
.df-list { display: flex; flex-direction: column; gap: 8px; }
.df-file { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; transition: opacity .25s, transform .25s var(--spring); }
.df-file.gone { opacity: 0; transform: scale(.97); }
.df-top { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 0; background: none; color: var(--text); text-align: left; font: 500 13.5px var(--font); }
.df-top:active { transform: none; background: var(--panel); }
.df-badge { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font: 700 11px var(--font); flex-shrink: 0; background: var(--panel); color: var(--muted); }
.df-file.added .df-badge { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.df-file.deleted .df-badge { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.df-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.df-dir { color: var(--muted); }
.df-base { font-weight: 600; }
.df-stat { display: flex; gap: 6px; flex-shrink: 0; }
.df-chev { color: var(--muted); transition: transform .3s var(--spring); font-size: 18px; line-height: 1; }
.df-file.open .df-chev { transform: rotate(90deg); }
.df-body { display: none; border-top: 1px solid var(--line); }
.df-file.open .df-body { display: block; animation: pane .3s var(--spring); }
.df-code { overflow-x: auto; -webkit-overflow-scrolling: touch; font: 12px/1.55 var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); padding: 4px 0; }
.df-row { display: grid; grid-template-columns: 34px 34px 16px max-content; min-width: 100%; white-space: pre; }
.df-row.add { background: color-mix(in srgb, var(--ok) 13%, transparent); }
.df-row.del { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.df-row.add .df-s { color: var(--ok); }
.df-row.del .df-s { color: var(--danger); }
.df-n { color: var(--muted); opacity: .6; text-align: right; padding-right: 6px; user-select: none; -webkit-user-select: none; }
.df-s { text-align: center; user-select: none; -webkit-user-select: none; }
.df-t { padding-right: 14px; }
.df-hunk { padding: 4px 12px; color: var(--muted); background: var(--panel); font-size: 11.5px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.df-note { padding: 12px; color: var(--muted); font-size: 13px; }
.df-acts { display: flex; justify-content: flex-end; padding: 8px 10px 10px; border-top: 1px solid var(--line); }
.step-changes { display: inline-flex; align-items: center; gap: 8px; }
.chg-card { display: block; width: 100%; text-align: left; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; transition: transform .2s var(--spring), background .2s; }
.chg-card:active { transform: scale(.985); background: var(--panel); }
.chg-top { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.chg-n { font-weight: 600; }
.chg-stat { display: flex; gap: 6px; }
.chg-go { margin-left: auto; color: var(--muted); font-size: 13px; }
.chg-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.chg-f { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.chg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.chg-f.added .chg-dot { background: var(--ok); }
.chg-f.deleted .chg-dot { background: var(--danger); }
.chg-name { font-family: var(--mono, ui-monospace, monospace); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.chg-fs { color: var(--muted); flex-shrink: 0; font-size: 12px; }
.chg-more { color: var(--muted); font-size: 12px; padding-left: 14px; }

/* ---------------------------------------------------------------- v19 : mode vocal (immersif) */
.send-btn.talk { background: var(--text); color: var(--bg); }
.send-btn.talk svg { stroke-width: 2.3; }
.voice { --vo-ink: #ffffff; position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; color: #fff; background: #000; padding: calc(env(safe-area-inset-top) + 10px) 18px calc(env(safe-area-inset-bottom) + 18px); opacity: 0; transform: scale(1.03); transition: opacity .35s ease, transform .45s var(--spring); overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.voice.show { opacity: 1; transform: none; }
.voice[hidden] { display: none; }
.voice-bg { position: absolute; inset: -20%; pointer-events: none; background: radial-gradient(40% 32% at 50% 42%, rgba(255,255,255,.10), transparent 70%), radial-gradient(60% 50% at 50% 110%, rgba(120,140,255,.08), transparent 70%); transition: opacity .6s; animation: vo-bg 14s ease-in-out infinite alternate; }
.voice[data-phase="speaking"] .voice-bg { opacity: 1.4; }
.voice[data-phase="paused"] .voice-bg { opacity: .35; }
@keyframes vo-bg { to { transform: translate3d(0, -2%, 0) scale(1.06); } }
.voice-top { position: relative; width: 100%; max-width: 640px; display: flex; align-items: center; justify-content: space-between; }
.voice-meta { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.voice-meta b { font: 650 16px var(--font); letter-spacing: .01em; }
.voice-meta span { font: 500 12.5px var(--font); color: rgba(255,255,255,.5); font-variant-numeric: tabular-nums; }
.vbtn { border: 0; color: #fff; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; transition: transform .25s var(--spring), background .25s, color .25s; }
.vbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vbtn:active { transform: scale(.9); }
.vbtn.ghost { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.08); }
.voice-stage { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.voice-orb { position: relative; width: min(82vw, 360px); aspect-ratio: 1; border: 0; padding: 0; background: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.voice-orb:active { transform: none; }
.voice-orb canvas { width: 100%; height: 100%; display: block; }
.voice-status { margin-top: 4px; min-height: 26px; font: 600 19px var(--font); letter-spacing: -.01em; color: rgba(255,255,255,.92); text-align: center; transition: opacity .3s; }
.voice-chips { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 520px; min-height: 30px; }
.vc-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.75); font: 500 12.5px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: vo-chip .35s var(--spring); }
.vc-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .5; flex-shrink: 0; }
.vc-chip.run::before { opacity: 1; animation: vo-blink 1s ease-in-out infinite; }
.vc-chip.bad::before { background: #ff453a; opacity: 1; }
@keyframes vo-chip { from { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes vo-blink { 50% { opacity: .25; } }
.voice-captions { position: relative; width: 100%; max-width: 600px; min-height: 92px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-align: center; padding: 0 6px 18px; }
.vc-you { margin: 0; font: 500 14.5px/1.4 var(--font); color: rgba(255,255,255,.5); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vc-dot { margin: 0; font: 500 18px/1.42 var(--font); color: #fff; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vc-dot:not(:empty) { animation: vo-cap .4s ease; }
@keyframes vo-cap { from { opacity: 0; transform: translateY(4px); } }
.voice-controls { position: relative; display: flex; gap: 26px; justify-content: center; align-items: flex-start; }
.vbtn.big { width: 66px; display: flex; flex-direction: column; gap: 7px; background: none; font: 500 12px var(--font); color: rgba(255,255,255,.7); }
.vbtn.big svg { box-sizing: content-box; width: 24px; height: 24px; padding: 20px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: background .25s, color .25s, transform .3s var(--spring); }
.vbtn.big:active svg { transform: scale(.9); }
#voice-stop svg rect { fill: currentColor; stroke: none; }
.vbtn.big.end svg { background: rgba(255,69,58,.22); color: #ff6961; }
#voice-mute .i-off { display: none; }
#voice-mute.on .i-on { display: none; }
#voice-mute.on .i-off { display: block; }
#voice-mute.on svg { background: #fff; color: #000; }
.voice:not([data-phase="speaking"]):not([data-phase="working"]):not([data-phase="thinking"]) #voice-stop { opacity: .35; pointer-events: none; }
.voice-engine { position: relative; margin-top: 14px; font: 500 11px var(--font); color: rgba(255,255,255,.32); letter-spacing: .02em; text-align: center; }
.voice-pill { position: fixed; z-index: 85; left: 50%; top: calc(env(safe-area-inset-top) + 8px); transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 10px; border: 0; border-radius: 999px; background: #000; color: #fff; font: 600 13px var(--font); box-shadow: 0 8px 30px rgba(0,0,0,.35); animation: vo-chip .4s var(--spring); }
.voice-pill[hidden] { display: none; }
.vp-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff; animation: vo-pulse 1.6s ease-in-out infinite; }
.voice-pill[data-phase="speaking"] .vp-dot { animation-duration: .5s; }
.vp-time { color: rgba(255,255,255,.55); font-variant-numeric: tabular-nums; font-weight: 500; }
@keyframes vo-pulse { 50% { transform: scale(.7); opacity: .6; } }
@media (min-height: 760px) { .voice-controls { margin-bottom: 6px; } }
@media (prefers-reduced-motion: reduce) { .voice-bg, .vp-dot { animation: none !important; } }

/* ---------------------------------------------------------------- v19 : île de DEETO (en haut, à la place du titre) */
.island { position: relative; flex: 1; min-width: 0; max-width: 460px; margin: 0 auto; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 16px 0 14px; border: 0; border-radius: 24px; background: #000; color: #fff; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.06); -webkit-tap-highlight-color: transparent; text-align: left; }
.island[hidden] { display: none; }
.island.pop { animation: is-pop .55s var(--spring); }
@keyframes is-pop { 0% { transform: scaleX(.55) scaleY(.8); opacity: 0; border-radius: 30px; } 60% { opacity: 1; } }
.island:active { transform: scale(.97); }
body.island-on #conv-head { display: none; }
.is-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; flex-shrink: 0; box-shadow: 0 0 10px rgba(255,255,255,.9), 0 0 22px rgba(190,205,255,.55); animation: is-breathe 1.8s ease-in-out infinite; }
.island[data-kind="speak"] .is-dot { animation: is-talk .38s ease-in-out infinite alternate; }
.island[data-kind="listen"] .is-dot { animation: is-breathe 2.6s ease-in-out infinite; }
.island[data-kind="ask"] .is-dot { background: #ffd60a; box-shadow: 0 0 12px rgba(255,214,10,.8); }
@keyframes is-breathe { 50% { transform: scale(.72); opacity: .7; } }
@keyframes is-talk { from { transform: scale(.8); } to { transform: scale(1.25); } }
.is-txt { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 7px; white-space: nowrap; overflow: hidden; }
.is-txt b { font: 650 14.5px var(--font); flex-shrink: 0; }
.is-txt span { font: 500 13.5px var(--font); color: rgba(255,255,255,.62); overflow: hidden; text-overflow: ellipsis; }
.is-time { font: 500 12.5px var(--font); color: rgba(255,255,255,.5); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.is-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: is-scan 1.6s ease-in-out infinite; opacity: .8; }
.island[data-kind="listen"] .is-bar, .island[data-kind="ask"] .is-bar { display: none; }
@keyframes is-scan { from { background-position: -40% 0; } to { background-position: 140% 0; } }
/* L'île remplace la petite pastille d'activité du bas (sauf pour les questions). */
body.island-on #live-pill:not(.ask) { display: none !important; }
/* Mode vocal : notifications en haut, sur fond sombre. */
body.voice-on .toast { top: calc(env(safe-area-inset-top) + 66px); bottom: auto; background: rgba(40,40,44,.92); color: #fff; z-index: 120; }
@media (prefers-reduced-motion: reduce) { .is-dot, .is-bar { animation: none !important; } }
.row-btn { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
/* Projets */
.proj-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 12px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.proj-strip::-webkit-scrollbar { display: none; }
.proj-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border, rgba(127,127,127,.25)); background: transparent; color: var(--muted, inherit); font: inherit; font-size: 13.5px; cursor: pointer; max-width: 180px; }
.proj-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.proj-chip.add { border-style: dashed; }
.proj-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; flex: none; }
.proj-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-gear { opacity: .7; margin-left: 2px; }
.proj-dialog textarea { width: 100%; resize: vertical; font: inherit; }
.proj-sec { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-weight: 600; font-size: 14px; }
.proj-sec .link-btn { font-size: 15px; cursor: pointer; }
.proj-files { display: grid; gap: 4px; margin: 4px 0; max-height: 180px; overflow-y: auto; }
.proj-file { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(127,127,127,.1); font-size: 14px; }
.proj-fn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-fs { opacity: .6; font-size: 12.5px; }
.proj-x { border: 0; background: none; color: inherit; font-size: 18px; line-height: 1; padding: 2px 6px; cursor: pointer; opacity: .7; }
.proj-note { font-size: 12.5px; opacity: .65; margin: 4px 0 10px; }
.link-btn.danger { color: #d33; font-size: 15px; margin-top: 8px; }
.proj-dialog { max-height: min(88dvh, 760px); overflow-y: auto; overscroll-behavior: contain; }
.proj-dialog .dialog-actions { position: sticky; bottom: 0; margin: 12px -20px -20px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); background: var(--panel, var(--surface)); border-top: 1px solid var(--border); z-index: 1; }
@media (max-width: 600px) { .proj-dialog textarea { min-height: 84px; } #proj-instr, #proj-mem { height: 96px; } }
#vo-status { gap: 12px; }
#vo-status .row-t { flex: none; }
#vo-status .row-v { flex: 1; min-width: 0; text-align: right; font-size: 15px; line-height: 1.3; }
/* Écran vocal : rien ne déborde sur les sous-titres, même sur petit écran. */
.voice-orb { width: min(82vw, 360px, 44dvh); }
.voice-chips { flex-wrap: nowrap; overflow: hidden; max-width: min(92vw, 520px); max-height: 32px; justify-content: center; }
.voice-chips .vc-chip { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-stage { overflow: hidden; }

/* ---------- Écran de démarrage (démarrage à froid uniquement) ---------- */
html.nosplash #splash { display: none; }
.splash { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text);
  background: radial-gradient(120% 70% at 50% 42%, color-mix(in srgb, var(--text) 7%, var(--bg)) 0%, var(--bg) 62%);
  transition: opacity .38s ease, visibility 0s .38s; }
.splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
.sp-stage { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.sp-orb { width: 58px; height: 58px; border-radius: 50%; transform: scale(.2); opacity: 0;
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, currentColor 55%, var(--bg)) 0%, currentColor 46%, color-mix(in srgb, currentColor 78%, var(--bg)) 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent), 0 18px 50px color-mix(in srgb, currentColor 22%, transparent), 0 0 70px color-mix(in srgb, currentColor 16%, transparent);
  animation: sp-orb .7s cubic-bezier(.16,1.2,.3,1) .05s forwards, sp-float 3s ease-in-out .8s infinite; }
.sp-arc { position: absolute; inset: 0; border-radius: 50%; opacity: 0;
  background: conic-gradient(from 0deg, transparent 0 55%, color-mix(in srgb, currentColor 25%, transparent) 75%, currentColor 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: sp-fade .3s ease .25s forwards, sp-spin 1s cubic-bezier(.45,.1,.35,.9) .25s infinite; }
.sp-word { margin-top: 26px; font-size: 30px; font-weight: 600; letter-spacing: -.02em; opacity: 0; transform: translateY(10px); filter: blur(6px);
  animation: sp-word .7s cubic-bezier(.2,.8,.2,1) .3s forwards; }
.splash.out .sp-stage { transform: scale(1.35); opacity: 0; transition: transform .38s cubic-bezier(.4,0,.2,1), opacity .3s ease; }
.splash.out .sp-word { transform: translateY(-6px); opacity: 0; transition: transform .38s ease, opacity .25s ease; }
@keyframes sp-orb { to { transform: scale(1); opacity: 1; } }
@keyframes sp-float { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes sp-spin { to { transform: rotate(360deg); } }
@keyframes sp-fade { to { opacity: 1; } }
@keyframes sp-word { to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .sp-arc { animation: sp-fade .01s forwards; } .sp-orb { animation: sp-orb .01s forwards; } .sp-word { animation: sp-word .01s forwards; } }

/* Atelier : pages d'un document (présentation, PDF…) */
.ws-pages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 24px; -webkit-overflow-scrolling: touch; }
.ws-page { margin: 0; position: relative; }
.ws-page img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); background: #fff; box-shadow: 0 6px 22px rgba(0,0,0,.18); }
.ws-page figcaption { position: absolute; right: 10px; bottom: 8px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 9px; background: rgba(0,0,0,.55); color: #fff; }
