:root { --bg:#14161c; --panel:#1d2029; --line:#323746; --text:#e6e8ee; --muted:#8e94a6; --accent:#ffd24a; --ok:#2ecc71; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
header { display: flex; gap: 16px; align-items: center; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); height: 44px; }
.logo { font-weight: 700; font-size: 16px; }
#crumb { color: var(--muted); }
main { height: calc(100% - 44px); }
.list { max-width: 820px; margin: 24px auto; padding: 0 16px; }
.list h1 { font-size: 20px; }
.card { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; margin: 8px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.card:hover { border-color: var(--accent); }
.tag { padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #3a3f52; }
.tag.ouverte { background: #5b4a12; color: var(--accent); }
.tag.répondue { background: #14432a; color: var(--ok); }
.muted { color: var(--muted); }
.q { display: grid; grid-template-columns: 1fr 360px; height: 100%; }
.stage { display: flex; flex-direction: column; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.toolbar label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.toolbar input[type=range] { width: 120px; }
.viewport { flex: 1; overflow: auto; background: #0c0d11; position: relative; }
canvas { display: block; image-rendering: pixelated; cursor: crosshair; }
.side { background: var(--panel); border-left: 1px solid var(--line); overflow: auto; padding: 14px; }
.side h2 { font-size: 16px; margin: 0 0 6px; }
.side h3 { font-size: 13px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.text { white-space: pre-wrap; margin: 6px 0 10px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
button { background: #2a2e3c; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; font: inherit; }
button:hover { border-color: var(--accent); }
button.on { outline: 2px solid var(--accent); }
button.primary { background: #1f6f43; border-color: #2ecc71; }
.chip { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
textarea { width: 100%; min-height: 60px; background: #12141a; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px; font: inherit; }
.px { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.px:hover { background: #262a37; }
.px.sel { background: #3a3414; }
.px .id { width: 26px; color: var(--muted); }
.px .state { margin-left: auto; font-size: 12px; color: var(--muted); }
.status { margin-left: 8px; color: var(--muted); font-size: 12px; }
.addtag { display: flex; gap: 6px; margin-top: 8px; }
.addtag input:not([type=color]) { flex: 1; min-width: 0; background: #12141a; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px; font: inherit; }
.addtag input[type=color] { width: 36px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
/* le bloc « choix + pixel sélectionné » reste collé en haut du panneau : on n'a pas à remonter après avoir touché une ligne de la liste */
.sticky { position: sticky; top: -14px; z-index: 2; background: var(--panel); margin: 0 -14px; padding: 6px 14px 10px; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) {
  .q { grid-template-columns: 1fr; grid-template-rows: 48% 52%; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  button { padding: 10px 12px; }
  .px { padding: 10px 6px; }
  .toolbar { gap: 6px 12px; }
}
