:root {
  --bg: #0f1115; --card: #181b22; --card2: #20242d; --line: #2a2f3a;
  --text: #eef0f4; --muted: #8b93a3; --accent: #c6f432; --accent-ink: #141a00;
  --upper: #5aa9ff; --legs: #ff8a4c; --other: #b48cff; --danger: #ff5c6c; --ok: #3ddc84;
  --safe-top: env(safe-area-inset-top); --safe-bot: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  padding: calc(var(--safe-top) + 8px) 0 calc(var(--safe-bot) + 76px);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
main { max-width: 640px; margin: 0 auto; padding: 0 14px; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 28px; margin: 8px 0 4px; letter-spacing: -.5px; }
h2 { font-size: 17px; margin: 22px 0 8px; }
h3 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }

/* cartes */
.card { background: var(--card); border-radius: 16px; padding: 14px; margin: 10px 0; border: 1px solid var(--line); }
.card.done { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.card.link:active { background: var(--card2); }
.bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--upper); }
.bar.legs { background: var(--legs); } .bar.other { background: var(--other); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--card2); color: var(--muted); }
.badge.upper { color: var(--upper); } .badge.legs { color: var(--legs); } .badge.other { color: var(--other); }
.badge.ok { color: var(--ok); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; letter-spacing: -.3px; }
.stat span { font-size: 12px; color: var(--muted); }
.delta { font-size: 12px; } .delta.up { color: var(--ok); } .delta.down { color: var(--danger); }

/* boutons */
button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 11px 16px;
  background: var(--card2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:active, .btn:active { transform: scale(.97); }
.primary { background: var(--accent); color: var(--accent-ink); }
.danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent); }
.ghost { background: transparent; color: var(--muted); padding: 8px 10px; }
.icon { padding: 8px 11px; border-radius: 10px; font-size: 15px; }
.block { width: 100%; }
.sticky-save { position: sticky; bottom: calc(var(--safe-bot) + 72px); margin-top: 16px; z-index: 5; box-shadow: 0 6px 24px #000a; }

/* formulaires */
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--card2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; outline: none; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* séance */
.ex { padding: 12px; }
.ex-head { display: flex; gap: 8px; align-items: flex-start; }
.target { font-size: 13px; color: var(--muted); margin-top: 2px; }
.last { font-size: 13px; color: var(--accent); margin-top: 4px; }
.mnote { font-size: 12px; color: var(--muted); margin-top: 4px; font-style: italic; }
.sets { margin-top: 10px; }
.set { display: grid; grid-template-columns: 28px 1fr 1fr 46px; gap: 8px; align-items: center; margin: 6px 0; }
.set .n { color: var(--muted); font-weight: 600; text-align: center; }
.set input { text-align: center; padding: 10px 6px; }
.set .chk { height: 42px; padding: 0; border-radius: 10px; background: var(--card2); color: var(--muted); font-size: 18px; }
.set.ok input { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.set.ok .chk { background: var(--ok); color: #04210f; }
.set-head { display: grid; grid-template-columns: 28px 1fr 1fr 46px; gap: 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; text-align: center; }
.ex-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ex-actions button { padding: 7px 10px; font-size: 13px; font-weight: 500; }
.timer { font-variant-numeric: tabular-nums; }

/* minuteur de repos */
.rest {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top) + 8px); z-index: 50;
  background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 8px 8px 8px 16px;
  font-weight: 700; display: flex; gap: 10px; align-items: center; box-shadow: 0 6px 24px #000a; font-variant-numeric: tabular-nums;
}
.rest button { padding: 5px 10px; border-radius: 99px; background: #0002; color: inherit; font-size: 13px; }
.rest.go { background: var(--ok); animation: pulse .8s infinite alternate; }
@keyframes pulse { to { transform: translateX(-50%) scale(1.06); } }

/* navigation */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding: 6px 0 calc(var(--safe-bot) + 6px);
}
.tabs a { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); padding: 4px 12px; gap: 1px; }
.tabs a span { font-size: 20px; filter: grayscale(1) opacity(.7); }
.tabs a.on { color: var(--text); } .tabs a.on span { filter: none; }
.seg { display: flex; background: var(--card); border-radius: 12px; padding: 3px; gap: 3px; margin: 10px 0; border: 1px solid var(--line); }
.seg a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg a.on { background: var(--card2); color: var(--text); }
.weeknav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0; }
.back { color: var(--accent); font-weight: 600; display: inline-block; padding: 6px 0; }

/* listes */
.list-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.chev { color: var(--muted); }
.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 18px 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; }
.banner { background: color-mix(in srgb, var(--accent) 14%, var(--card)); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* login */
.login { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; max-width: 340px; margin: 0 auto; text-align: center; }
.login .logo { font-size: 56px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bot) + 86px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 60; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); color: #fff; }

/* types de séance */
.bar.lower { background: var(--legs); } .bar.full { background: var(--ok); }
.seg a { font-size: 13px; padding: 8px 4px; }

/* sélecteur d'exercice */
.modal { position: fixed; inset: 0; z-index: 40; background: #000a; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--bg); width: 100%; max-width: 640px; height: calc(100% - var(--safe-top) - 24px);
  border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 14px 14px 0; display: flex; flex-direction: column; gap: 10px; animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.chips { display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; padding: 6px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.pk-list { overflow-y: auto; flex: 1; padding-bottom: calc(var(--safe-bot) + 20px); -webkit-overflow-scrolling: touch; }
.pk-list .list-item { cursor: pointer; }
.pk-list .chev { color: var(--accent); font-size: 18px; }

/* marque */
.login .logo-img { width: min(78vw, 300px); height: auto; margin: 0 auto 18px; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand { font-size: 32px; font-weight: 800; letter-spacing: -.8px; margin: 6px 0 2px; }

/* cases à cocher (la règle générale input{appearance:none} les rendait invisibles sur iPhone) */
.check { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; color: var(--text); font-size: 15px; cursor: pointer; }
.check input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: 0 0 24px; width: 24px; height: 24px; padding: 0; margin: 0;
  border: 2px solid var(--muted); border-radius: 7px; background: var(--card2); display: grid; place-content: center; cursor: pointer;
}
.check input[type=checkbox]::after { content: '✓'; font-size: 16px; font-weight: 800; color: var(--accent-ink); opacity: 0; }
.check input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.check input[type=checkbox]:checked::after { opacity: 1; }
.check input[type=checkbox]:disabled { opacity: .45; }
.check small { font-size: 12px; }
label small { font-weight: 400; }

/* barre du haut avec le logo */
.topbar { max-width: 640px; margin: 0 auto; padding: 2px 14px 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brandbar { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brandbar img { height: 46px; width: auto; display: block; }
.brandbar span { font-size: 18px; font-weight: 600; letter-spacing: -.3px; white-space: nowrap; }
.brandbar b { font-weight: 800; color: var(--accent); }
.who { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px 3px 3px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* sélecteur − n + */
.stepper { display: flex; align-items: center; gap: 4px; background: var(--card2); border-radius: 12px; padding: 3px; }
.stepper button { width: 38px; height: 38px; padding: 0; font-size: 20px; background: var(--card); border-radius: 9px; }
.stepper b { min-width: 26px; text-align: center; font-size: 18px; }

/* onglets : 5 entrées */
.tabs a { padding: 4px 6px; flex: 1; }

/* conseil de charge */
.advice { margin-top: 6px; font-size: 13px; background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 10px; padding: 7px 9px; }
.advice b { color: var(--accent); }
.advice button { padding: 4px 10px; font-size: 12px; margin-left: 4px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; }

/* record */
.set.pr input { border-color: #f5c542; }
.set.pr .n { font-size: 18px; }
.celebrate {
  position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 80; text-align: center;
  background: linear-gradient(135deg, #f5c542, #ff9f1c); color: #2a1a00; padding: 18px 24px; border-radius: 20px;
  font-size: 17px; line-height: 1.45; box-shadow: 0 12px 40px #000c; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); min-width: 240px;
}
.celebrate b { font-size: 22px; }
.celebrate small { opacity: .8; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } }

/* fin du repos : écran qui clignote */
.flash { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; text-align: center;
  font-size: 34px; font-weight: 800; color: var(--accent-ink); animation: flash .45s steps(1) 8 alternate; background: var(--accent); }
.flash div { font-size: 34px; line-height: 1.3; }
@keyframes flash { 50% { background: var(--bg); color: var(--accent); } }

/* calendrier */
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; margin: 10px 0 6px; }
.cal i { aspect-ratio: 1; border-radius: 3px; background: var(--card2); }
.cal i.on { background: var(--accent); }
.cal i.today { outline: 2px solid var(--text); outline-offset: -1px; }
.cal i.future { opacity: .3; }

/* barres (séries par muscle, défis) */
.mrow, .crow { display: grid; grid-template-columns: 92px 1fr 34px; gap: 8px; align-items: center; margin: 7px 0; font-size: 14px; }
.mrow b, .crow b { text-align: right; }
.mbar { position: relative; height: 12px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.mbar > div { height: 100%; border-radius: 99px; }
.mbar em { position: absolute; top: 0; bottom: 0; width: 1px; background: #ffffff30; }
.mbar .low { background: var(--legs); } .mbar .good { background: var(--ok); } .mbar .high { background: var(--upper); } .mbar .zero { width: 0; }
.crow { grid-template-columns: 80px 1fr 60px; }
.crow.me span, .list-item.me b { color: var(--accent); }
.rank { width: 26px; text-align: center; font-size: 18px; }
.feed .prtxt { color: #f5c542; font-weight: 600; }
.ghost.small { font-size: 13px; padding: 4px 0; }

/* tutoriel d'installation */
.install summary { cursor: pointer; list-style: none; }
.install summary::-webkit-details-marker { display: none; }
.install summary::after { content: '›'; float: right; color: var(--muted); transition: transform .2s; }
.install[open] summary::after { transform: rotate(90deg); }
.install ol { margin: 10px 0 0; padding-left: 22px; }
.install li { margin: 6px 0; }
.install.mine { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.ico { display: inline-block; background: var(--card2); border-radius: 6px; padding: 0 6px; }
.seg a { cursor: pointer; }

/* musique */
.music .cover { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: 0 0 64px; }
.music .cover.ph { display: grid; place-items: center; font-size: 28px; color: #fff; }
.music .embed { width: 100%; border: 0; border-radius: 12px; margin-top: 10px; display: block; }
.music .yt { position: relative; padding-top: 56.25%; margin-top: 10px; border-radius: 12px; overflow: hidden; }
.music .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.music .ex-actions .btn { padding: 7px 10px; font-size: 13px; font-weight: 500; }
.like.on { background: color-mix(in srgb, var(--danger) 20%, var(--card2)); }

/* notifications */
.check .time { width: auto; margin-left: auto; padding: 6px 8px; font-size: 15px; }
#nBanner .icon { padding: 8px 12px; }

/* avatars */
.av { border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: inline-grid; place-items: center; color: #fff; font-weight: 700; background: var(--card2); }
.who span { overflow: hidden; text-overflow: ellipsis; }
.list-item .av { margin-right: 2px; }

/* mur */
.composer textarea { min-height: 64px; }
.ppreview { position: relative; margin-top: 10px; }
.ppreview img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 12px; display: block; }
.ppreview button { position: absolute; top: 6px; right: 6px; background: #000a; color: #fff; border-radius: 99px; padding: 4px 10px; }
.post .ptext { margin: 10px 0 2px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.post .pphoto { width: calc(100% + 28px); margin: 10px -14px 0; display: block; max-height: 560px; object-fit: cover; background: var(--card2); cursor: zoom-in; }
.post .ex-actions { margin-top: 10px; }
.comment { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 14px; }
.comment .ghost { padding: 0 4px; font-size: 12px; }
.cinput { margin-top: 8px; }
.cinput input { padding: 8px 12px; border-radius: 99px; }
.cinput button { padding: 8px 12px; border-radius: 99px; }
.lightbox { position: fixed; inset: 0; z-index: 95; background: #000e; display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox button { position: absolute; top: calc(var(--safe-top) + 10px); right: 10px; color: #fff; font-size: 20px; }

/* mur en direct */
.live { font-size: 12px; font-weight: 600; color: var(--ok); }
.live.off { color: var(--muted); }
.live:not(.off) { animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.post.fresh { animation: freshIn .6s ease-out; }
@keyframes freshIn { from { opacity: 0; transform: translateY(-12px); background: color-mix(in srgb, var(--accent) 12%, var(--card)); } }
.post.gone { opacity: 0; transform: scale(.97); transition: .3s; }
.newpill { position: fixed; top: calc(var(--safe-top) + 12px); left: 50%; transform: translateX(-50%); z-index: 45;
  background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 9px 16px; font-size: 14px; box-shadow: 0 6px 20px #000a; }

/* ---------- nutrition ---------- */
:root { --prot: #5aa9ff; --carb: #f5c542; --fat: #ff8a4c; --water: #4cc9f0; }
.tabs a { font-size: 10px; padding: 4px 2px; }
.tabs a span { font-size: 19px; }
.nsum { display: flex; gap: 14px; align-items: center; }
.ring { width: 132px; height: 132px; flex: 0 0 132px; }
.ring-bg { fill: none; stroke: var(--card2); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ring-fg.over { stroke: var(--danger); }
.ring-big { fill: var(--text); font-size: 26px; font-weight: 800; }
.ring-small { fill: var(--muted); font-size: 11px; }
.mac { margin: 7px 0; }
.mac .mbar { height: 8px; margin-top: 3px; }
.mbar .p { background: var(--prot); } .mbar .c { background: var(--carb); } .mbar .f { background: var(--fat); } .mbar .w { background: var(--water); }
.water .icon { padding: 8px 12px; }
.meal .fitem { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.meal .fitem:first-of-type { margin-top: 6px; }
.frow img, .frow .fico { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: 0 0 40px; background: #fff; display: grid; place-items: center; font-size: 20px; }
.frow .fico { background: var(--card2); }
.fimg { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: #fff; flex: 0 0 72px; }
.ftot { margin: 16px 0 12px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.ftot b { font-size: 20px; color: var(--accent); }
.scanbox { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-top: 6px; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanframe { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border: 3px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 999px #0007; }
.scanframe::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: var(--danger); animation: scanline 1.6s ease-in-out infinite alternate; }
@keyframes scanline { from { transform: translateY(-30px); } to { transform: translateY(30px); } }
.sugg { margin-top: 14px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--card2)); }
.seg small { font-weight: 400; opacity: .8; }
.kb.ok { fill: var(--ok); } .kb.under { fill: var(--upper); } .kb.over { fill: var(--danger); } .kb.upper { fill: var(--upper); }
.goalline { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; }
.chart .goaltxt { fill: var(--accent); font-size: 11px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.dot.ok { background: var(--ok); } .dot.under { background: var(--upper); } .dot.over { background: var(--danger); }

/* ---------- coach IA ---------- */
.coachfab { position: fixed; right: 14px; bottom: calc(var(--safe-bot) + 76px); z-index: 30; display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 10px 14px 10px 12px; border-radius: 99px; box-shadow: 0 6px 22px #000b; font-size: 18px; }
.coachfab span { font-size: 14px; }
body.coaching { padding-bottom: calc(var(--safe-bot) + 140px); }
.coachhead h1 { margin: 4px 0; }
.cconv { max-width: 170px; padding: 8px 28px 8px 10px; font-size: 14px; }
.cthread { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.cmsg { display: flex; flex-direction: column; max-width: 88%; }
.cmsg.me { align-self: flex-end; align-items: flex-end; }
.cmsg.bot { align-self: flex-start; }
.cb { padding: 10px 13px; border-radius: 18px; line-height: 1.45; word-wrap: break-word; }
.cmsg.me .cb { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.cmsg.bot .cb { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.cb p { margin: 0 0 8px; } .cb p:last-child { margin-bottom: 0; }
.cb ul, .cb ol { margin: 4px 0 8px; padding-left: 20px; } .cb li { margin: 3px 0; }
.cb .mdh { font-weight: 800; margin-top: 6px; }
.cb code { background: var(--card2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.caction { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: color-mix(in srgb, var(--ok) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.caction span { color: var(--muted); }
.typing { color: var(--muted); font-size: 14px; }
.typing span { display: inline-block; width: 7px; height: 7px; margin-right: 2px; border-radius: 50%; background: var(--muted); animation: tdot 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes tdot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.cempty p { margin: 6px 2px 12px; }
.csugg { display: flex; flex-direction: column; gap: 8px; }
.csugg button { text-align: left; font-weight: 500; font-size: 14px; background: var(--card); border: 1px solid var(--line); justify-content: flex-start; }
.cnote { margin-top: 14px; }
.cinputbar { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-bot) + 62px); z-index: 25; display: flex; gap: 8px; align-items: flex-end;
  max-width: 640px; margin: 0 auto; padding: 8px 14px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.cinputbar textarea { min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 11px 16px; }
.cinputbar button { width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 18px; flex: 0 0 46px; }
