/* Boîte à idées du CESI : style repris de la maquette fournie (Poppins, rail noir, cartes grises arrondies) */

:root {
  --bg: #fdfdfd;
  --side: #f6f6f6;
  --card: #f6f6f6;
  --card-2: #f8f8f8;
  --tile: #ffffff;
  --field: #ffffff;
  --hover: rgba(20, 20, 20, 0.04);
  --ink: #141414;
  --ink-2: #3b3b3b;
  --muted: #7d807f;
  --faint: #a2a5a4;
  --line: #ededed;
  --line-2: #dcdcdc;
  --chip: #efefef;
  --chip-soft: #f6f6f6;
  --rail: #161618;
  --rail-2: #323234;
  --rail-ink: #8d8d92;
  --logo-bg: #ffffff;
  --logo-ink: #141414;
  --dark: #161616;
  --dark-2: #2c2c2c;
  --dark-ink: #ffffff;
  --ask-bg: #232325;
  --ask-ink: #f4f4f4;
  --ask-ph: #9b9b9b;
  --green: #5fae55;
  --green-bg: #dcf5d2;
  --green-ink: #2d6a25;
  --blue-bg: #d3e2fb;
  --blue-ink: #2b4f9e;
  --tint: #e6eef2;
  --red: #d04848;
  --red-bg: #fdeceb;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.05);
  --shadow-up: 0 10px 24px rgba(20, 20, 20, 0.07);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --rail-w: 56px;
  --side-w: 244px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0f10;
  --side: #151617;
  --card: #18191b;
  --card-2: #18191b;
  --tile: #212225;
  --field: #1d1e21;
  --hover: rgba(255, 255, 255, 0.05);
  --ink: #f1f1f1;
  --ink-2: #cfcfcf;
  --muted: #9a9c9f;
  --faint: #6f7276;
  --line: #2a2b2f;
  --line-2: #3a3b40;
  --chip: #2a2b2f;
  --chip-soft: #26272a;
  --rail: #08090a;
  --rail-2: #26272a;
  --logo-bg: #f1f1f1;
  --dark: #f1f1f1;
  --dark-2: #d9d9d9;
  --dark-ink: #111111;
  --ask-bg: #2a2b2e;
  --green-bg: #1d3a1a;
  --green-ink: #9fdc92;
  --blue-bg: #1c2b46;
  --blue-ink: #a9c3f5;
  --tint: #243039;
  --red: #f07a7a;
  --red-bg: #3a1d1d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-up: 0 10px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- structure ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.app.is-compact { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.app.is-compact .side { display: none; }

/* rail noir */
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 14px 0 16px; background: var(--rail); z-index: 40; }
.rail__logo { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: var(--logo-bg); color: var(--logo-ink); cursor: pointer; }
.rail__logo span { font-size: 20px; font-weight: 600; line-height: 1; transform: translateY(1px); }
.rail__nav, .rail__foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail__foot { margin-top: auto; gap: 10px; }
.rail__btn { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--rail-ink); cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.rail__btn .i { width: 20px; height: 20px; stroke-width: 1.5; }
.rail__btn:hover, .rail__btn.is-active { background: var(--rail-2); color: #ffffff; }
.rail__btn:focus-visible, .rail__logo:focus-visible, .rail__avatar:focus-visible { outline-color: #ffffff; }
.avatar .i { width: 16px; height: 16px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 0; background: linear-gradient(160deg, #4a4a4d, #1d1d1f); color: #ffffff; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; }
.rail__avatar { cursor: pointer; box-shadow: 0 0 0 2px var(--rail), 0 0 0 3px #3a3a3d; }

/* menu gris */
.side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; padding: 22px 14px 18px; background: var(--side); border-right: 1px solid var(--line); z-index: 35; }
.side__brand { display: flex; align-items: center; justify-content: space-between; height: 36px; margin-bottom: 22px; padding: 0 2px 0 8px; }
.brand { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-weight: 500; }
.side__nav { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.nav { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 14px; text-align: left; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.nav .i { width: 19px; height: 19px; stroke-width: 1.45; color: var(--muted); }
.nav:hover { background: var(--hover); }
.nav.is-active { background: var(--tile); color: var(--ink); font-weight: 500; box-shadow: var(--shadow); }
.nav.is-active .i { color: var(--ink); }
.nav--muted { color: var(--faint); margin-top: 6px; }
.nav--muted .i { color: var(--faint); }
.nav__end { margin-left: auto; }
.nav__badge { margin-left: auto; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--dark); color: var(--dark-ink); font-size: 11px; font-weight: 500; }
.side__foot { display: grid; gap: 4px; margin-top: auto; padding-top: 20px; }
.side__foot hr { width: 100%; margin: 8px 0; border: 0; border-top: 1px solid var(--line-2); }
.nav--switch { cursor: pointer; }
.switch { appearance: none; position: relative; width: 34px; height: 20px; margin: 0 0 0 auto; border-radius: 999px; background: var(--dark); cursor: pointer; transition: background-color 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--dark-ink); transition: transform 0.25s var(--ease); }
.switch:checked::after { transform: translateX(14px); }
.switch:focus-visible { outline-offset: 3px; }
.scrim { position: fixed; inset: 0; z-index: 34; background: rgba(10, 10, 10, 0.35); }

/* barre du haut */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 28px; background: var(--side); }
.top__menu { display: none !important; }
.search { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; color: var(--muted); }
.search .i { width: 16px; height: 16px; }
.search input { flex: 0 1 auto; width: 9.5em; min-width: 0; height: 34px; transition: width 0.25s var(--ease); padding: 0 4px; border: 0; background: transparent; color: var(--ink); font-size: 13px; outline: none; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search:focus-within { color: var(--ink); }
.search:focus-within input, .search input:not(:placeholder-shown) { width: 16em; }
.search kbd { padding: 2px 6px; border-radius: 5px; background: var(--chip); color: var(--muted); font: 500 10px/1.4 var(--font); white-space: nowrap; }
.top__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--tile); color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow); transition: transform 0.15s var(--ease), background-color 0.15s; }
.icon-btn .i { width: 17px; height: 17px; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn--soft { background: var(--chip); box-shadow: none; }
.icon-btn--ghost { background: transparent; box-shadow: none; color: var(--muted); }
.dot-badge { position: absolute; top: -3px; right: -3px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #ffffff; font-size: 10px; font-weight: 500; box-shadow: 0 0 0 2px var(--side); }
.profile { display: flex; align-items: center; gap: 10px; margin-left: 10px; padding: 4px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.profile:hover { background: var(--hover); }
.profile__txt { display: grid; line-height: 1.25; }
.profile__name { font-size: 14px; font-weight: 500; color: var(--ink); }
.profile__sub { font-size: 11px; color: var(--muted); }
.profile__chev { width: 16px; height: 16px; color: var(--ink-2); margin-left: 8px; }

/* ---------- contenu ---------- */
.main { display: grid; gap: 22px; width: 100%; max-width: 1600px; padding: 28px 28px 30px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px 40px; }
.head h1 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.head__txt p { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.kpis { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; }
.kpis > div { display: flex; flex-direction: column-reverse; gap: 4px; }
.kpis dd { margin: 0; font-size: 21px; font-weight: 500; line-height: 1.2; }
.kpis dt { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 500; }
.pill--green { background: var(--green-bg); color: var(--green-ink); }
.pill--blue { background: var(--blue-bg); color: var(--blue-ink); }

.row { display: grid; gap: 18px; align-items: start; }
.row--1 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
.row--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.card { min-width: 0; padding: 18px; border-radius: 24px; background: var(--card); }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card__head h2 { flex: 1; min-width: 0; font-size: 16px; font-weight: 400; }
.card--post .card__head h2, .card--list .card__head h2 { font-size: 20px; }
.card__ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--tile); color: var(--muted); }
.card__ico .i { width: 14px; height: 14px; }
.card__ico--sq { border-radius: 6px; background: var(--chip); color: var(--ink-2); }
.card__sq { width: 22px; height: 22px; border-radius: 5px; background: var(--chip); }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px; font-size: 14px; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; transition: transform 0.15s var(--ease), background-color 0.15s, color 0.15s, box-shadow 0.15s; }
.btn .i { width: 16px; height: 16px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn--dark { background: var(--dark); color: var(--dark-ink); }
.btn--dark:hover { background: var(--dark-2); }
.btn--line { background: var(--tile); border-color: var(--ink); color: var(--ink); }
.btn--line:hover { box-shadow: var(--shadow-up); }
.btn--tint { background: var(--tint); }
.btn--s { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn--l { height: 46px; padding: 0 26px; font-size: 15.5px; }
.link { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }

/* thèmes */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; align-content: space-between; gap: 12px; min-height: 100px; padding: 12px 12px 11px; border: 1px solid transparent; border-radius: 14px; background: var(--tile); color: var(--ink); text-align: left; cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
.tile.is-on { border-color: var(--ink); }
.tile__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile__ico { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 6px; background: var(--c, #141414); color: #ffffff; }
.tile__ico .i { width: 13px; height: 13px; stroke-width: 2.2; }
.tile__live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.tile__live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.tile__live.is-calm { color: var(--faint); }
.tile__live.is-calm::before { background: var(--line-2); }
.tile__name { display: block; font-size: 15.5px; font-weight: 500; line-height: 1.2; }
.tile__sub { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile--add { align-content: center; justify-items: center; gap: 6px; border: 1.5px dashed var(--line-2); background: transparent; color: var(--ink-2); font-size: 11.5px; text-decoration: none; }
.tile--add .i { width: 18px; height: 18px; }
.tile--add:hover { background: var(--tile); }

/* assistant */
.card--ai { display: flex; flex-direction: column; }
.ai__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai__head h2 { font-size: 15.5px; font-weight: 400; }
.ai__body { display: flex; flex: 1; flex-direction: column; }
.card--ai.is-collapsed .ai__body { display: none; }
.orb { position: relative; width: 80px; height: 80px; margin: 20px auto 14px; border-radius: 50%; background: radial-gradient(circle at 64% 66%, #ffffff 0%, #f4f4f4 16%, #c9c9c9 42%, #7a7a7a 72%, #3d3d3d 100%); box-shadow: 0 14px 28px rgba(20, 20, 20, 0.12); animation: float 6s ease-in-out infinite; }
.orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.35), transparent 40%); animation: spin 9s linear infinite; }
.orb.is-busy { animation: float 6s ease-in-out infinite, breathe 1.1s ease-in-out infinite; }
.ai__status { color: var(--muted); font-size: 13px; text-align: center; }
.ai__out { margin-top: 14px; max-height: 260px; overflow: auto; padding: 12px; border-radius: 14px; background: var(--tile); font-size: 13px; animation: rise 0.4s var(--ease) both; }
.ai__out ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ai__out pre { margin: 0; white-space: pre-wrap; font: inherit; color: var(--ink-2); }
.ai__row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--chip-soft); color: var(--ink); text-align: left; cursor: pointer; }
.ai__row:hover { background: var(--chip); }
.ai__row b { font-weight: 500; }
.ai__row span { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ai__copy { margin-top: 10px; }
.ai__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: auto; padding-top: 22px; }
.ai__actions .btn { height: 38px; padding: 0 14px; font-size: 13.5px; }
.ask { display: flex; align-items: center; gap: 10px; height: 56px; margin-top: 12px; padding: 5px 5px 5px 22px; border-radius: 999px; background: var(--ask-bg); }
.ask input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ask-ink); font-size: 13.5px; outline: none; }
.ask input::placeholder { color: var(--ask-ph); }
.ask:focus-within { box-shadow: 0 0 0 2px var(--line-2); }
.ask__mic { display: grid; place-items: center; width: 70px; height: 46px; border: 0; border-radius: 999px; background: #ffffff; color: #141414; cursor: pointer; transition: transform 0.15s var(--ease); }
.ask__mic:active { transform: scale(0.96); }
.ask__mic.is-on { animation: breathe 1s ease-in-out infinite; }
.ask__mic:focus-visible { outline-color: #ffffff; }

/* nouvelle idée */
.card--post { background: var(--card-2); }
.seg { display: flex; padding: 4px; border-radius: 999px; background: var(--chip); }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.seg button[aria-selected="true"] { background: var(--tile); color: var(--ink); box-shadow: var(--shadow); }
.post { display: grid; gap: 14px; }
.post__pane { display: grid; gap: 14px; }
.fld { display: grid; gap: 8px; }
.fld label { font-size: 15px; font-weight: 500; }
.opt { font-weight: 400; }
.input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); font-size: 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.input::placeholder { color: var(--muted); opacity: 0.85; }
.input:hover { border-color: var(--line-2); }
.input:focus-visible, .input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--hover); }
.input[aria-invalid="true"] { border-color: var(--red); }
textarea.input { height: 128px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.select { position: relative; }
.select select { appearance: none; padding-right: 40px; cursor: pointer; }
.select .i { position: absolute; top: 50%; right: 14px; width: 16px; height: 16px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.help { display: flex; justify-content: space-between; gap: 12px; min-height: 16px; margin: -2px 2px 0; font-size: 11.5px; color: var(--faint); }
.help [data-msg] { color: var(--red); }
.post__hint { color: var(--muted); font-size: 13px; }
.similar { border: 1px solid var(--line); border-radius: 10px; background: var(--tile); }
.similar__btn { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.similar__btn .i { width: 16px; height: 16px; }
.similar__chev { margin-left: auto; transition: transform 0.2s var(--ease); }
.similar__btn[aria-expanded="true"] .similar__chev { transform: rotate(180deg); }
.similar__list { display: grid; gap: 4px; margin: 0; padding: 0 8px 8px; list-style: none; }
.post__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.post__as { color: var(--muted); font-size: 12.5px; }
.post__as strong { color: var(--ink); font-weight: 500; }
.post__status { min-height: 18px; font-size: 13px; }
.post__status.is-ok { color: var(--green-ink); }
.post__status.is-error { color: var(--red); }

/* idées du moment */
.card--list { background: var(--card-2); }
.card__head--list { flex-wrap: wrap; }
.pills { display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--chip); color: var(--ink-2); font-size: 12.5px; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.chip .i { width: 14px; height: 14px; }
.chip[aria-selected="true"] { background: var(--dark); color: var(--dark-ink); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--tile); color: var(--ink); font-size: 12.5px; cursor: pointer; }
.fchip .i { width: 13px; height: 13px; color: var(--muted); }
.fcount { color: var(--muted); font-size: 12.5px; }
.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.item { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px 14px; padding: 14px 16px 14px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--tile); }
.item:target, .item:focus { outline: none; }
.vote { display: flex; flex-direction: column; align-items: center; align-self: start; grid-row: span 3; width: 46px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--tile); }
.vote button { display: grid; place-items: center; width: 100%; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color 0.15s, color 0.15s, transform 0.15s var(--ease); }
.vote button .i { width: 16px; height: 16px; stroke-width: 1.8; }
.vote button:hover { background: var(--chip-soft); }
.vote button:active { transform: scale(0.9); }
.vote button[data-v="1"][aria-pressed="true"] { background: var(--green-bg); color: var(--green-ink); }
.vote button[data-v="-1"][aria-pressed="true"] { background: var(--red-bg); color: var(--red); }
.vote__n { display: block; padding: 1px 0; font-size: 15px; line-height: 1.35; }
.item__main { min-width: 0; }
.item__title { font-size: 15.5px; font-weight: 400; line-height: 1.35; overflow-wrap: break-word; }
.item__body { margin-top: 8px; max-width: 64ch; color: var(--muted); font-size: 12.5px; line-height: 1.65; white-space: pre-line; overflow-wrap: break-word; }
.item.is-clamped .item__body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item__more { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 12px; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--chip-soft); color: var(--ink); font-size: 12.5px; }
.tag .i { width: 14px; height: 14px; }
.tag--etude { color: #9a6a00; }
.tag--retenue { color: var(--blue-ink); background: var(--blue-bg); }
.tag--realisee { color: var(--green-ink); background: var(--green-bg); }
.tag--ecartee { color: var(--muted); }
:root[data-theme="dark"] .tag--etude { color: #f0c35b; }
.cbtn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.cbtn .i { width: 15px; height: 15px; }
.cbtn:hover, .cbtn[aria-expanded="true"] { background: var(--chip-soft); }
.item__who { white-space: nowrap; }
.item__mine { color: var(--ink); font-weight: 500; }
.vote__msg { grid-column: 2; color: var(--red); font-size: 12px; }
.vote__msg:empty { display: none; }

/* commentaires */
.thread { grid-column: 2; display: grid; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); animation: rise 0.35s var(--ease) both; }
.cmts { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cmt { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
.cmt .avatar { width: 28px; height: 28px; font-size: 11px; }
.cmt__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 12.5px; }
.cmt__who { font-weight: 500; color: var(--ink); }
.cmt__when { color: var(--muted); font-size: 11.5px; }
.cmt__body { margin-top: 2px; color: var(--ink-2); font-size: 13px; line-height: 1.55; white-space: pre-line; overflow-wrap: break-word; }
.cmt__hide { margin-left: auto; padding: 0; border: 0; background: none; color: var(--red); font-size: 11.5px; text-decoration: underline; cursor: pointer; }
.thread__empty { color: var(--muted); font-size: 12.5px; }
.reply { display: flex; align-items: center; gap: 8px; height: 46px; padding: 4px 4px 4px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--chip-soft); }
.reply input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font-size: 13px; outline: none; }
.reply input::placeholder { color: var(--muted); }
.reply:focus-within { border-color: var(--ink-2); }
.reply button[type="submit"] { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--dark); color: var(--dark-ink); cursor: pointer; }
.reply button[type="submit"] .i { width: 15px; height: 15px; }
.reply__msg { color: var(--red); font-size: 12px; }
.reply__msg:empty { display: none; }

/* bureau */
.admin-row { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 12.5px; color: var(--muted); }
.admin-row .select { min-width: 170px; }
.admin-row .input { height: 34px; font-size: 13px; }
.admin-row .btn { height: 34px; }
.undo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--dark); color: var(--dark-ink); font-size: 13px; }
.undo .btn { height: 30px; background: var(--dark-ink); color: var(--dark); }

/* états */
.state { display: grid; justify-items: start; gap: 8px; padding: 28px 8px; color: var(--muted); }
.state__t { color: var(--ink); font-size: 15px; font-weight: 500; }
.state .btn { margin-top: 6px; }
.more { display: flex; justify-content: center; padding-top: 14px; }
.item--skel { grid-template-columns: 46px minmax(0, 1fr); }
.skel { display: block; border-radius: 6px; background: var(--chip); animation: shimmer 1.4s ease-in-out infinite; }
.skel--box { width: 46px; height: 76px; border-radius: 11px; }
.skel-lines { display: grid; gap: 10px; align-content: start; padding-top: 4px; }
.skel--t { width: 60%; height: 16px; }
.skel--l { width: 90%; height: 10px; }
.skel--s { width: 30%; height: 26px; border-radius: 999px; }

/* pied */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 4px 4px 0; color: var(--muted); font-size: 12px; }
.foot strong { color: var(--ink); font-weight: 500; }

/* fenêtres */
.modal { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25); }
.modal::backdrop { background: rgba(10, 10, 10, 0.4); }
.modal[open] { animation: pop 0.3s var(--ease) both; }
.modal__in { display: grid; gap: 14px; padding: 22px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal__head h2 { font-size: 18px; font-weight: 500; }
.modal__lead { color: var(--muted); font-size: 13.5px; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.steps { display: grid; gap: 10px; margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.steps strong { color: var(--ink); font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); z-index: 90; padding: 10px 18px; border-radius: 999px; background: var(--dark); color: var(--dark-ink); font-size: 13px; transform: translateX(-50%); box-shadow: var(--shadow-up); animation: toast 0.35s var(--ease) both; }

/* aide de l'IA dans le formulaire */
.aihelp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--tile); }
.aihelp .similar__btn { flex: 1 1 auto; width: auto; min-width: 0; text-align: left; }
.aihelp .similar__btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aihelp .similar__btn[aria-busy="true"] .i { animation: spin 1.2s linear infinite; }
.aihelp__undo { display: inline-flex; align-items: center; gap: 6px; height: 32px; margin-right: 6px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: 12.5px; cursor: pointer; }
.aihelp__undo .i { width: 14px; height: 14px; }
.input.is-filled { animation: filled 1.4s var(--ease); }

/* réponses de l'IA */
.ai__q { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.ai__answer { color: var(--ink-2); font-size: 13.5px; line-height: 1.65; white-space: pre-line; overflow-wrap: break-word; }
.is-streaming::after { content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 3px; vertical-align: -2px; border-radius: 2px; background: var(--ink); animation: caret 0.9s steps(2) infinite; }
.ref { display: inline-flex; align-items: center; height: 20px; margin: 0 2px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: 11.5px; font-weight: 500; vertical-align: 1px; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.ref:hover { background: var(--dark); color: var(--dark-ink); }
.ai__note { margin-top: 10px; color: var(--faint); font-size: 11px; }
.ai__row--theme { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; }
.ai__row--theme small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* suppression */
.confirm { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--red-bg); color: var(--ink); font-size: 13px; animation: rise 0.3s var(--ease) both; }
.confirm__btns { display: flex; gap: 6px; }
.btn--danger { background: var(--red); color: #ffffff; }
.btn--danger-line { border-color: var(--red); color: var(--red); }
.item__del { padding: 0; border: 0; background: none; color: var(--red); font-size: 12px; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.item.is-leaving { animation: leave 0.26s var(--ease) both; }

/* bureau */
.tag--pin { background: var(--dark); color: var(--dark-ink); }
.tag--bureau { border: 0; background: var(--blue-bg); color: var(--blue-ink); cursor: pointer; }
.avatar--bureau { background: var(--dark); color: var(--dark-ink); }
.cmt--official .cmt__body { color: var(--ink); }
.cmt__badge { padding: 1px 8px; border-radius: 999px; background: var(--blue-bg); color: var(--blue-ink); font-size: 10.5px; font-weight: 500; }
.cmt__del, .cmt__no { padding: 0; border: 0; background: none; font-size: 11.5px; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.cmt__del { color: var(--red); }
.cmt__no { color: var(--ink-2); }
.cmt__head > .cmt__del, .cmt__confirm { margin-left: auto; }
.cmt__confirm { display: inline-flex; gap: 8px; color: var(--ink); font-size: 11.5px; }
.reply .reply__as { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--tile); color: var(--muted); font-size: 12px; cursor: pointer; }
.reply .reply__as .i { width: 14px; height: 14px; }
.reply .reply__as[aria-pressed="true"] { border-color: var(--dark); background: var(--dark); color: var(--dark-ink); }
.reply:has(.reply__as:not([hidden])) { padding-left: 6px; }
.admin-row__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.admin-row__label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; }
.admin-row__label .i { width: 15px; height: 15px; }
.admin-row .btn--s { height: 34px; padding: 0 12px; font-size: 12.5px; }
.admin-row .btn .i { width: 14px; height: 14px; }
.admin-row .btn[aria-pressed="true"] { border-color: var(--dark); background: var(--dark); color: var(--dark-ink); }

/* un menu qui mène à une partie déjà visible la fait briller un instant */
.is-flash { animation: ring 0.9s ease-out 1; }

/* comptes */
.modal { max-height: calc(100dvh - 32px); overflow: auto; }
.modal--wide { width: min(640px, calc(100vw - 32px)); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--dark); cursor: pointer; }
.pass { position: relative; }
.pass .input { padding-right: 48px; }
.pass__eye { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); transform: translateY(-50%); cursor: pointer; }
.pass__eye .i { width: 17px; height: 17px; }
.seg--full { display: grid; grid-template-columns: 1fr 1fr; }
.seg--full button { width: 100%; }
.auth { display: grid; gap: 14px; }
.notice { padding: 10px 14px; border-radius: 12px; background: var(--blue-bg); color: var(--blue-ink); font-size: 13px; line-height: 1.5; }
.modal__foot--split { align-items: center; justify-content: space-between; }
.modal__hint { max-width: 34ch; color: var(--muted); font-size: 12px; }
.modal__sep { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--line); }
.modal__sub { font-size: 15px; font-weight: 500; }
.account__who { display: flex; align-items: center; gap: 12px; }
.account__who .avatar { width: 44px; height: 44px; font-size: 15px; }
.account__name { font-size: 16px; font-weight: 500; }
.post__who { display: grid; gap: 6px; min-width: 0; }

/* « j'aime » sur les commentaires */
.cmt__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; }
.clike { display: inline-flex; align-items: center; gap: 5px; height: 26px; margin-left: -8px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.clike .i { width: 14px; height: 14px; }
.clike[aria-pressed="true"] { color: var(--red); }
.clike[aria-pressed="true"] .i { fill: currentColor; }
.clike.is-pop .i { animation: heart 0.35s var(--ease); }
.cmt__block { padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 11.5px; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.reply__need { color: var(--muted); font-size: 12px; }
.reply__need:empty { display: none; }

/* comptes étudiants (bureau) */
.usearch { position: relative; }
.usearch .i { position: absolute; top: 50%; left: 14px; width: 16px; height: 16px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.usearch .input { padding-left: 40px; }
.users { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.urow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--tile); }
.urow .avatar { width: 36px; height: 36px; }
.urow__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.urow__meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.urow__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.urow__btns .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
.urow__btns .btn .i { width: 14px; height: 14px; }
.urow__temp { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--chip-soft); font-size: 12.5px; }
.urow__temp code { padding: 2px 8px; border-radius: 6px; background: var(--tile); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.urow.is-blocked .urow__name > span:first-child { color: var(--muted); text-decoration: line-through; }
.tag--blocked { height: 22px; padding: 0 8px; background: var(--red-bg); color: var(--red); font-size: 11px; }

/* ---------- mouvement ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes shimmer { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes tick { from { opacity: 0; transform: translateY(50%); } }
@keyframes tick-down { from { opacity: 0; transform: translateY(-50%); } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
@keyframes ring { from { box-shadow: 0 0 0 0 rgba(20, 20, 20, 0.22); } to { box-shadow: 0 0 0 14px rgba(20, 20, 20, 0); } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes heart { 50% { transform: scale(1.35); } }
@keyframes leave { to { opacity: 0; transform: scale(0.97); } }
@keyframes filled { from { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-bg); } }

.js .main > * { animation: rise 0.6s var(--ease) both; }
.js .main > :nth-child(2) { animation-delay: 0.06s; }
.js .main > :nth-child(3) { animation-delay: 0.12s; }
.js .main > :nth-child(4) { animation-delay: 0.18s; }
.tile.is-in { animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.item.is-in { animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.item.is-new { animation: rise 0.45s var(--ease) both; }
.item.is-new::after { content: ""; position: absolute; inset: -1px; border: 1.5px solid var(--ink); border-radius: 16px; pointer-events: none; animation: flash 2.4s ease-in 0.8s both; }
.tick { display: inline-block; animation: tick 0.25s var(--ease); }
.tick-down { display: inline-block; animation: tick-down 0.25s var(--ease); }
.is-moving { position: relative; z-index: 2; transition: transform 0.45s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}

/* écrans tactiles : pas d’effet de survol qui reste collé après un appui */
@media (hover: none) {
  .tile:hover, .icon-btn:hover { transform: none; box-shadow: none; }
  .icon-btn:hover { box-shadow: var(--shadow); }
  .btn--line:hover { box-shadow: none; }
  .tile--add:hover { background: transparent; }
  .ref:hover { background: var(--chip); color: var(--ink); }
}
@media (hover: hover) {
  .clike:hover { background: var(--chip-soft); color: var(--ink); }
  .clike[aria-pressed="true"]:hover { color: var(--red); }
  .pass__eye:hover { background: var(--chip-soft); color: var(--ink); }
}

/* sur un écran d’ordinateur assez haut, le formulaire suit la liste quand on la fait défiler */
@media (min-width: 1181px) and (min-height: 760px) {
  .card--post { position: sticky; top: 84px; }
}

/* ---------- écrans plus petits ---------- */
@media (max-width: 1520px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .app, .app.is-compact { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .app .side, .app.is-compact .side { display: flex; position: fixed; top: 0; left: var(--rail-w); width: 260px; transform: translateX(-120%); transition: transform 0.3s var(--ease); box-shadow: var(--shadow-up); }
  .app.is-open .side { transform: none; }
  .top__menu { display: grid !important; }
  .row--1, .row--2 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app, .app.is-compact { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .app .side, .app.is-compact .side { left: 0; width: min(290px, 86vw); padding-top: max(22px, env(safe-area-inset-top, 0px)); }
  .top { gap: 8px; height: 60px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
  .search kbd, .hide-s, .profile__txt, .profile__chev { display: none; }
  .profile { margin-left: 0; }
  .top__tools { gap: 8px; }
  .main { gap: 16px; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px)); }
  .kpis { gap: 12px 26px; }
  .kpis dd { font-size: 19px; }
  .kpis dt { font-size: 12.5px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { min-height: 86px; }
  .ask__mic { width: 56px; }
  .search { flex: 1 1 auto; }
  .search input, .search:focus-within input { width: 100%; }
  .card { padding: 14px; border-radius: 20px; }
  .card__head .btn--s { width: 100%; order: 3; }
  .card__head { flex-wrap: wrap; }
  .card--list .pills { width: 100%; }
  .ai__actions .btn { flex: 1 1 auto; }
  .post__foot .btn { width: 100%; }
  .item { grid-template-columns: 42px minmax(0, 1fr); padding: 12px; gap: 4px 12px; }
  .vote { width: 42px; }
  .admin-row .select { min-width: 0; flex: 1; }
  .urow { grid-template-columns: 36px minmax(0, 1fr); }
  .urow__btns { grid-column: 1 / -1; justify-content: flex-start; }
  .urow__temp { grid-column: 1 / -1; }
  .input { font-size: 16px; }
  .search input, .reply input, .ask input { font-size: 16px; }
}
