@font-face {
  font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter/inter-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono Variable"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/fonts/jetbrains-mono/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --surface-3: #e4e7f0;
  --border: #e2e5ee;
  --border-strong: #cfd4e2;
  --text: #161923;
  --muted: #687089;
  --accent: #dc2147;
  --accent-2: #ff7a45;
  --accent-soft: rgba(220, 33, 71, .09);
  --shadow: 0 1px 2px rgba(22, 25, 35, .05), 0 8px 24px -12px rgba(22, 25, 35, .12);
  --shadow-lift: 0 2px 4px rgba(22, 25, 35, .06), 0 18px 36px -16px rgba(22, 25, 35, .22);
  --tile-l: 38%;
  --c-files: #2f6fed;
  --c-code: #7c4dff;
  --c-texts: #0f9d6c;
  --c-links: #d98200;
  --code-bg: #0f1219;
  --code-bar: #171b26;
  --code-text: #e4e8f3;
  --radius: 14px;
  --font: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono Variable", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e14;
    --surface: #141720;
    --surface-2: #1b1f2b;
    --surface-3: #242938;
    --border: #232838;
    --border-strong: #343b50;
    --text: #eceef5;
    --muted: #8a92a9;
    --accent: #ff4f6e;
    --accent-2: #ff9a5a;
    --accent-soft: rgba(255, 79, 110, .13);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 22px 40px -18px rgba(0, 0, 0, .8);
    --tile-l: 74%;
    --c-files: #6ea0ff;
    --c-code: #b08cff;
    --c-texts: #3dd6a0;
    --c-links: #ffb84d;
    --code-bg: #090b10;
    --code-bar: #11141c;
  }
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--border-strong) transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.02em; }
::selection { background: var(--accent-soft); }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.error { color: var(--accent); font-size: 14px; }
.error:empty, .ok:empty { display: none; }
.ok { color: var(--c-texts); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); font-weight: 550; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  border: 0; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -8px var(--accent);
}
.btn.discord { border: 0; color: #fff; background: #5865f2; box-shadow: 0 6px 18px -8px #5865f2; }
.btn.primary:hover, .btn.discord:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.small .icon { width: 15px; height: 15px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.large { padding: 12px 18px; font-size: 15.5px; }

input[type="text"], input[type="password"], input[type="search"] {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.logo {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px var(--accent);
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- connexion ---------- */
.login {
  position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden;
}
.login::before, .login::after {
  content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  filter: blur(90px); opacity: .28; pointer-events: none;
}
.login::before { background: var(--accent); top: -260px; left: -180px; }
.login::after { background: #5865f2; bottom: -300px; right: -200px; }
.login-inner {
  position: relative; z-index: 1; width: 100%; max-width: 920px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; font-weight: 800; margin: 18px 0 14px; }
.hero > p { font-size: 17px; color: var(--muted); max-width: 40ch; }
.hero .brand { font-size: 20px; }
.features { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; padding: 0; list-style: none; }
.features li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.type-dot {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
}
.t-files { --c: var(--c-files); }
.t-code { --c: var(--c-code); }
.t-texts { --c: var(--c-texts); }
.t-links { --c: var(--c-links); }
.login-card {
  padding: 30px; display: flex; flex-direction: column; gap: 16px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lift);
}
.login-card h2 { font-size: 21px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- structure ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; height: 62px; display: flex; align-items: center; gap: 16px;
  padding: 0 20px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 750; letter-spacing: -.02em; text-decoration: none; }
.search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; padding-right: 40px; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.search input:focus { background: var(--surface); }
.search kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 1px 7px;
  border: 1px solid var(--border-strong); border-radius: 6px; font: 12px var(--mono); color: var(--muted); pointer-events: none;
}
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
.user { display: flex; align-items: center; gap: 4px; }
.user .who { display: flex; align-items: center; gap: 9px; margin-right: 6px; font-weight: 550; }
.user .name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700;
}

.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); align-items: start; }
.sidebar {
  position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; padding: 16px 12px 32px;
  border-right: 1px solid var(--border);
}
.sidebar h3 {
  margin: 20px 10px 6px; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin-bottom: 1px; border-radius: 9px;
  color: var(--muted); font-weight: 500; text-decoration: none; transition: background .12s, color .12s;
}
.sidebar a .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.sidebar a.active > .icon { color: var(--accent); }
.dot { width: 9px; height: 9px; margin: 0 4.5px; border-radius: 50%; flex: none; background: hsl(var(--h) 75% 58%); }
.count {
  min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--surface-2);
  font-size: 11.5px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted);
}
.sidebar a.active .count { background: var(--surface); }

.main { padding: 30px 32px 80px; max-width: 1020px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.page-head h2 { font-size: 26px; font-weight: 750; overflow-wrap: anywhere; }
.page-head p { color: var(--muted); }

/* ---------- vue d'ensemble ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--c); }
.stat b { display: block; font-size: 22px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span span { font-size: 13px; color: var(--muted); }

.section-title {
  display: flex; align-items: center; gap: 10px; margin: 30px 0 12px;
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.course {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 16px; overflow: hidden;
  text-decoration: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.course::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 70px; pointer-events: none;
  background: linear-gradient(hsl(var(--h) 80% 60% / .13), transparent);
}
.course:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: hsl(var(--h) 60% 55% / .6); }
.course-top { position: relative; display: flex; align-items: center; gap: 12px; }
.course h3 { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; line-height: 1.25; }
.tile {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none;
  font-size: 14px; font-weight: 750; letter-spacing: 0;
  color: hsl(var(--h) 80% var(--tile-l)); background: hsl(var(--h) 75% 55% / .16);
}
.tile.big { width: 52px; height: 52px; border-radius: 15px; font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mini {
  display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 0; border-radius: 9px;
  background: var(--surface-2); color: var(--c); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.mini .icon { width: 14px; height: 14px; }
.mini.zero { color: var(--muted); opacity: .55; }

/* ---------- flux ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--muted); font-weight: 550; font-size: 14px;
  transition: all .15s;
}
.chip .icon { width: 15px; height: 15px; color: var(--c, currentColor); }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.active .icon { color: inherit; }

.item {
  margin-bottom: 14px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: rise .25s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 12px; }
.item-head .author { font-weight: 650; }
.item-head time { color: var(--muted); font-size: 13px; }
.item-head .spacer { flex: 1; }
.kinds { display: flex; gap: 4px; }
.kinds .type-dot { width: 24px; height: 24px; border-radius: 7px; }
.kinds .icon { width: 13px; height: 13px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 550; text-decoration: none;
}
.tag .icon { width: 12px; height: 12px; }
a.tag { color: hsl(var(--h) 80% var(--tile-l)); background: hsl(var(--h) 75% 55% / .14); }
a.tag:hover { background: hsl(var(--h) 75% 55% / .24); }

.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.text + .text, .code + .text { margin-top: 10px; }
.text a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.text a:hover { text-decoration-color: currentColor; }
.body.collapsed {
  max-height: 320px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent);
}
.more { margin-top: 8px; }

.code { margin: 10px 0; border-radius: 12px; overflow: hidden; background: var(--code-bg); border: 1px solid var(--border); }
.code-bar {
  display: flex; justify-content: space-between; align-items: center; padding: 5px 6px 5px 14px;
  background: var(--code-bar); color: #8f97ad; font: 500 12px var(--mono);
}
.code-bar .btn { color: #aab1c6; }
.code-bar .btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; color: var(--code-text); background: var(--code-bg);
  font: 13px/1.6 var(--mono); tab-size: 4; scrollbar-color: #343b50 transparent;
}

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumbs button { padding: 0; border: 0; background: none; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.thumbs img {
  display: block; max-width: 280px; max-height: 210px; border-radius: 12px; border: 1px solid var(--border);
  transition: transform .2s;
}
.thumbs button:hover img { transform: scale(1.03); }

.file {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  transition: border-color .15s;
}
.file:hover { border-color: var(--border-strong); }
.ext {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; flex: none;
  color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 16%, transparent);
  font: 750 11px var(--mono); text-transform: uppercase;
}
.x-pdf { --c: #ef4444; }
.x-doc { --c: var(--c-files); }
.x-slides { --c: #f97316; }
.x-sheet { --c: var(--c-texts); }
.x-archive { --c: var(--c-links); }
.x-code { --c: var(--c-code); }
.x-media { --c: #14b8a6; }
.file-info { flex: 1; min-width: 140px; display: flex; flex-direction: column; line-height: 1.3; }
.fname { font-weight: 600; overflow-wrap: anywhere; }
.file-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.preview { margin-top: 8px; max-height: 440px; overflow: auto; border-radius: 12px; border: 1px solid var(--border); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 0; text-align: center; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; opacity: .5; stroke-width: 1.3; }
.center { display: flex; justify-content: center; margin-top: 20px; }

.skeleton { height: 130px; margin-bottom: 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- fenêtres ---------- */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(6, 8, 12, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog.account {
  width: min(420px, calc(100vw - 32px)); padding: 26px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow-lift);
}
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog h3 { font-size: 20px; }
dialog label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; color: var(--muted); }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
dialog.lightbox { padding: 0; border: 0; background: none; max-width: 94vw; max-height: 94vh; cursor: zoom-out; }
dialog.lightbox img { display: block; max-width: 94vw; max-height: 94vh; border-radius: 12px; }

@media (max-width: 860px) {
  .login-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 440px; }
  .features { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static; height: auto; display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .sidebar h3 { display: none; }
  .sidebar a { flex: none; margin: 0; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
  .sidebar a .label { overflow: visible; }
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search kbd, .user .name, .brand-name { display: none; }
  .user { margin-left: auto; }
  .main { padding: 20px 16px 60px; }
  .page-head h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- assistant IA ---------- */
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
select, textarea {
  font: inherit; color: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); max-width: 100%;
}
select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.page-head { flex-wrap: wrap; }
.assistant { display: flex; flex-direction: column; min-height: calc(100vh - 62px); }
.ai-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.ai-bar .chips { margin: 0; }
.scope { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--muted); }
.scope select { color: var(--text); font-weight: 500; }
.pins { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.unpin { display: grid; place-items: center; padding: 0; border: 0; background: none; color: inherit; }
.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--accent-soft);
}
.notice p { flex: 1; min-width: 220px; }

.chat { flex: 1; display: flex; flex-direction: column; }
.thread { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.bubble { max-width: 100%; padding: 14px 18px; border-radius: var(--radius); animation: rise .2s ease-out both; }
.bubble.user {
  align-self: flex-end; max-width: 80%; color: #fff; white-space: pre-wrap; overflow-wrap: anywhere;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-bottom-right-radius: 4px;
}
.bubble.assistant { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-bottom-left-radius: 4px; }
.typing { color: var(--muted); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.md { overflow-wrap: anywhere; }
.md > * + * { margin-top: 10px; }
.md h3 { font-size: 18px; margin-top: 18px; }
.md h4 { font-size: 15.5px; margin-top: 14px; }
.md > :first-child { margin-top: 0; }
.md ul, .md ol { margin-bottom: 0; padding-left: 24px; }
.md li + li { margin-top: 4px; }
.md code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font: 13px var(--mono); }
.md blockquote { margin-left: 0; margin-right: 0; padding: 4px 14px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--border); }
.md a { color: var(--accent); text-underline-offset: 3px; }
.md .cite, .cite {
  display: inline-block; min-width: 20px; margin: 0 1px; padding: 0 5px; border-radius: 6px; vertical-align: 1px;
  background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; text-align: center; text-decoration: none;
}
.md .cite:hover { background: var(--accent); color: #fff; }
.sources { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; }
.sources summary { cursor: pointer; color: var(--muted); font-weight: 550; }
.sources ol { margin: 8px 0 0; padding-left: 26px; }
.sources a { color: inherit; }

.starters { margin: auto 0; padding: 24px 0; text-align: center; }
.starter-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.starter {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); font-weight: 550; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.starter:hover { transform: translateY(-2px); border-color: var(--accent); }
.starter .icon { color: var(--accent); }

.composer {
  position: sticky; bottom: 16px; display: flex; align-items: flex-end; gap: 8px; padding: 8px;
  border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lift);
}
.composer textarea { flex: 1; resize: none; border: 0; background: none; padding: 8px 10px; max-height: 200px; }
.composer textarea:focus { box-shadow: none; }
.composer .btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; }

.quiz-setup { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.quiz { display: flex; flex-direction: column; gap: 16px; }
.quiz > h3 { font-size: 20px; }
.score {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding: 16px 20px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.score b { font-size: 30px; font-weight: 800; }
.question {
  display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 18px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.question legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; display: flex; gap: 10px; font-weight: 650; }
.qnum {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--accent-soft); color: var(--accent); font-size: 13px;
}
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; color: inherit;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: border-color .12s, background .12s;
}
.choice:not(:disabled):hover { border-color: var(--border-strong); background: var(--surface-2); }
.choice:disabled { cursor: default; }
.letter {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--surface-2); font-size: 12.5px; font-weight: 700;
}
.choice.picked { border-color: var(--accent); background: var(--accent-soft); }
.choice.picked .letter { background: var(--accent); color: #fff; }
.choice.right { border-color: var(--c-texts); background: color-mix(in srgb, var(--c-texts) 13%, transparent); }
.choice.right .letter { background: var(--c-texts); color: #fff; }
.choice.wrong { border-color: #ef4444; background: color-mix(in srgb, #ef4444 12%, transparent); }
.choice.wrong .letter { background: #ef4444; color: #fff; }
.explain { margin-top: 6px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14.5px; }

/* ---------- assistant IA : tours de parole, actions, historique ---------- */
.turn { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.turn.user { align-items: flex-end; }
.turn.user .bubble { max-width: 80%; }
.turn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-height: 30px; }
.turn.user .turn-actions { opacity: 0; transition: opacity .15s; }
.turn.user:hover .turn-actions, .turn.user:focus-within .turn-actions { opacity: 1; }
@media (hover: none) { .turn.user .turn-actions { opacity: 1; } }
.follow-ups { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.chip.small { padding: 4px 11px; font-size: 13px; }
.edit-box {
  width: min(100%, 640px); display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface);
}
.edit-box textarea { width: 100%; resize: vertical; }

.table-wrap { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 14.5px; }
.md th, .md td { padding: 7px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 650; }

.history { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; margin: 12px 0; }
.history-row { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.history-row:hover, .history-row.current { background: var(--surface-2); }
.history-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 8px 10px; border: 0; background: none;
  text-align: left; color: inherit;
}
.history-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog.account > h3 + p { margin-top: 6px; }

/* ---------- connexion MCP ---------- */
dialog.account.wide { width: min(560px, calc(100vw - 32px)); }
dialog.account > * + * { margin-top: 12px; }
.steps { margin: 12px 0; padding-left: 22px; }
.steps li + li { margin-top: 6px; }
.steps code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font: 12.5px var(--mono); overflow-wrap: anywhere; }
