/* Espace réponses : sombre seul, couleurs et polices de Halfred (DESIGN.md, « Monde Halfred »). */
@font-face { font-family: "General Sans"; src: url(fonts/GeneralSans-Variable.woff2) format("woff2"); font-weight: 200 700; font-display: swap; }
:root {
  --red: #d02232; --glow: #ff3b4e;
  --bg: #050506; --card: #0e0e10; --raise: #141418; --border: #292930; --fg: #f0f4ff;
  --soft: color-mix(in srgb, var(--fg) 82%, transparent);
  --muted: color-mix(in srgb, var(--fg) 66%, transparent);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "General Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; background: var(--bg); color: var(--fg); font: 400 15px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--red) 45%, transparent); color: var(--fg); }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.disp { font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
.dot { color: var(--red); }
.muted { color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; padding: 0 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--raise); color: var(--fg); font-weight: 500; font-size: 0.9375rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease); }
.btn:hover { border-color: color-mix(in srgb, var(--fg) 30%, var(--border)); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.go { background: var(--red); border-color: var(--red); color: #fff; }
.btn.go:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 88%, #fff); }
.btn.ghost { background: none; }
.btn.icon { width: 44px; padding: 0; }
.btn.quiet { border-color: transparent; background: none; color: var(--muted); }
.btn.quiet:hover { color: var(--fg); background: var(--raise); }
.btn.danger:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 22%, transparent); }

/* Coquille */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1rem; height: 64px; padding: 0 max(16px, 2rem); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.wordmark { font-family: var(--display); font-weight: 600; letter-spacing: -0.035em; font-size: 1.25rem; line-height: 1; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.wordmark i { font-style: normal; color: var(--red); }
.crumb { display: flex; align-items: center; gap: 0.5rem; min-width: 0; color: var(--muted); font-size: 0.9375rem; }
.crumb a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.crumb a:hover { color: var(--fg); }
.crumb span:last-child { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .out { margin-left: auto; }
.wrap { max-width: 72rem; margin-inline: auto; padding: clamp(1.5rem, 4vw, 2.75rem) max(16px, 2rem) 4rem; outline: none; }
.head { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.head h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.04; }
.head .btn.go { margin-left: auto; }
.error { border: 1px solid color-mix(in srgb, var(--red) 55%, var(--border)); border-radius: 14px; padding: 0.9rem 1rem; color: var(--fg); white-space: pre-line; background: color-mix(in srgb, var(--red) 10%, var(--card)); }

/* Liste */
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.tabs button { border: 0; background: none; color: var(--muted); padding: 0 0.75rem; min-height: 44px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.tabs .n { font-size: 0.75rem; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--card); overflow: hidden; }
.list:empty { display: none; }
.item a { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 13rem 6rem; align-items: center; gap: 1.25rem; padding: 1rem 1.25rem; text-decoration: none; transition: background 0.2s var(--ease); }
.item + .item { border-top: 1px solid var(--border); }
.item a:hover { background: var(--raise); }
.brand { display: flex; align-items: center; height: 2.5rem; }
.brand img { max-height: 1.9rem; max-width: 8.5rem; width: auto; object-fit: contain; }
.brand img[data-dark] { filter: url(#lift); }
.brand .name { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.02em; }
.what { min-width: 0; }
.what b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.what span { color: var(--muted); font-size: 0.875rem; }
.status { display: grid; gap: 0.4rem; font-size: 0.875rem; }
.status .label { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; color: var(--soft); }
.status .label.new { color: var(--fg); font-weight: 600; }
.status .label.new::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }
.bar { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--fg); border-radius: 4px; }
.when { color: var(--muted); font-size: 0.875rem; text-align: right; white-space: nowrap; }
.item[data-closed] a { opacity: 0.62; }
.empty-list { border: 1px dashed var(--border); border-radius: 18px; padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .item a { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand brand" "what what" "status when"; gap: 0.5rem 1rem; }
  .brand { grid-area: brand; } .what { grid-area: what; } .status { grid-area: status; } .when { grid-area: when; align-self: end; }
  .item:has(.brand .name) a { grid-template-areas: "what what" "status when"; } .brand:has(.name) { display: none; }
}

/* Réponses */
.facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: var(--muted); font-size: 0.9375rem; margin: -0.5rem 0 1.25rem; }
.facts b { color: var(--fg); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 2rem; }
.actions .spacer { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.drop:has(.sr:focus-visible) { outline: 2px solid var(--glow); outline-offset: 3px; }
.link-row { display: flex; gap: 0.5rem; align-items: center; margin: -1rem 0 2rem; flex-wrap: wrap; }
.link-row input { flex: 1 1 22rem; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); padding: 0 0.85rem; color: var(--fg); font-size: 0.875rem; }
.link-row input::placeholder { color: var(--muted); }
.sheet { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.toc { position: sticky; top: 88px; display: grid; gap: 0.25rem; font-size: 0.9375rem; }
.toc a { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0.75rem; border-radius: 10px; color: var(--muted); text-decoration: none; min-height: 44px; align-items: center; }
.toc a:hover { color: var(--fg); background: var(--raise); }
.toc .n { font-size: 0.8125rem; }
.sec { margin-bottom: 2.5rem; scroll-margin-top: 88px; }
.sec h2 { margin: 0 0 1rem; font-size: 1.375rem; }
.qa { border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 1.1rem 1.25rem; display: grid; gap: 0.75rem; }
.qa + .qa { margin-top: 0.75rem; }
.qa[data-new] { border-color: color-mix(in srgb, var(--red) 60%, var(--border)); }
.q { display: flex; gap: 0.75rem; align-items: baseline; }
.q .k { color: var(--muted); font-size: 0.875rem; min-width: 1.5rem; }
.q b { font-weight: 600; line-height: 1.45; }
.q em { margin-left: auto; font-style: normal; font-size: 0.75rem; color: var(--fg); background: color-mix(in srgb, var(--red) 24%, transparent); border-radius: 6px; padding: 0.1rem 0.45rem; white-space: nowrap; }
.a { padding-left: 2.25rem; display: grid; gap: 0.6rem; }
.a p { margin: 0; color: var(--soft); line-height: 1.6; max-width: 68ch; }
.opts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.opts small { width: 100%; color: var(--muted); font-size: 0.8125rem; }
.opt { font-size: 0.875rem; padding: 0.3rem 0.65rem; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); }
.opt[data-on] { color: var(--fg); border-color: var(--fg); }
.opt b { font-weight: 600; }
.line { color: var(--soft); font-size: 0.9375rem; line-height: 1.6; }
.line b { color: var(--fg); font-weight: 600; }
.line .blank { color: var(--muted); }
.note { border-left: 1px solid var(--border); padding-left: 0.85rem; color: var(--soft); font-size: 0.9375rem; white-space: pre-line; }
.note small { display: block; color: var(--muted); font-size: 0.75rem; }
.none { color: var(--muted); font-size: 0.9375rem; }
.file { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; font-size: 0.875rem; width: fit-content; max-width: 100%; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { color: var(--muted); }
.file:hover { border-color: color-mix(in srgb, var(--fg) 30%, var(--border)); }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 1rem; border: 1px solid color-mix(in srgb, var(--red) 55%, var(--border)); border-radius: 14px; margin: -1rem 0 2rem; }
@media (max-width: 760px) {
  .sheet { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; overflow-x: auto; scrollbar-width: none; gap: 0.25rem; margin-inline: -16px; padding-inline: 16px; }
  .toc a { white-space: nowrap; border: 1px solid var(--border); }
  .a { padding-left: 0; }
  .actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
}

/* Nouveau */
.new { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.drop { position: relative; cursor: pointer; border: 1px dashed color-mix(in srgb, var(--fg) 26%, var(--border)); border-radius: 18px; background: var(--card); padding: 2.25rem 1.5rem; display: grid; justify-items: center; text-align: center; gap: 0.75rem; transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.drop[data-over] { border-color: var(--fg); background: var(--raise); }
.drop .ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--raise); border: 1px solid var(--border); }
.drop b { font-weight: 600; font-size: 1.0625rem; }
.drop p { margin: 0; color: var(--muted); font-size: 0.9375rem; max-width: 34ch; }
.files { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.files li { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); font-size: 0.9375rem; min-width: 0; }
.files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li small { margin-left: auto; color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }
.panel { border: 1px solid var(--border); border-radius: 18px; background: var(--card); padding: 1.25rem; display: grid; gap: 1rem; }
.panel h2 { margin: 0; font-size: 1.125rem; }
.panel p { margin: 0; color: var(--soft); }
.copy { display: flex; gap: 0.5rem; }
.copy input { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); padding: 0 0.85rem; color: var(--fg); font-size: 0.875rem; }
@media (max-width: 760px) { .new { grid-template-columns: 1fr; } .head .btn.go { margin-left: 0; } }

.toast { position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 0.7rem 1rem; border-radius: 12px; background: var(--raise); border: 1px solid var(--border); box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.9); font-size: 0.9375rem; z-index: 20; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
