/* Boîte de tri (grooming), backlog, tiroir de ticket, fiche compacte. */

/* ---------- toast avec action ---------- */
.toast { align-items: center; }
.toast-action { margin-left: 6px; border: 0; background: none; color: var(--rc-accent); font: inherit; font-weight: 700; cursor: pointer;
                padding: 2px 4px; border-radius: 5px; }
.toast-action:hover { background: var(--rc-accent-soft); }

/* ---------- fiche compacte ---------- */
.tpanel { display: flex; flex-direction: column; gap: 16px; }
.tpanel.enter { animation: tp-in .22s ease-out; }
@keyframes tp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tp-title { font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; margin: 8px 0 6px; }
.tp-ai { border: 1px solid color-mix(in srgb, var(--rc-accent) 35%, var(--app-border)); background: color-mix(in srgb, var(--rc-accent) 6%, var(--app-surface));
         border-radius: 12px; padding: 14px 16px; }
.tp-ai.none { background: var(--app-sunken); border-color: var(--app-border); }
.tp-ai-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
           color: var(--rc-accent); }
.tp-ai.none .tp-ai-h { color: var(--rc-muted); }
.tp-ai-h .conf { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0;
                 font-size: 12.5px; color: var(--rc-ink2); font-weight: 600; }
.tp-ai-h .conf .bar { width: 64px; }
.tp-ai-h .conf .bar > span { background: var(--rc-accent); }
.tp-ai-action { font-size: 16px; font-weight: 650; margin: 8px 0 4px; color: var(--rc-ink); }
.tp-ai-why { font-size: 13.5px; color: var(--rc-ink2); margin: 0; }
.tp-ai-q { font-size: 13px; color: var(--rc-ink2); margin: 8px 0 0; }
.tp-req { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.decide { display: flex; flex-direction: column; gap: 10px; }
.decide-row { display: flex; flex-wrap: wrap; gap: 8px; }
.decide-row .btn kbd { margin-left: 2px; }
.decide-row .btn.primary kbd { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .35); color: #fff; }
.decide-row .btn.on { border-color: var(--rc-accent); background: var(--rc-accent-soft); }
.decide-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
                background: var(--app-sunken); border: 1px solid var(--app-border); animation: tp-in .16s ease-out; }
.decide-panel[hidden] { display: none; }
.decide-panel select { max-width: 380px; }
.tp-body .desc { font-size: 14.5px; }
.tp-fields form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; }
.tp-fields label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 11.5px; font-weight: 600; color: var(--rc-muted);
                   text-transform: uppercase; letter-spacing: .05em; }
.tp-fields select { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 500; }
.tp-comments .comment { grid-template-columns: 26px minmax(0, 1fr); }
.tp-comments .composer textarea { min-height: 60px; }

/* ---------- boîte de tri ---------- */
.groom-keys { gap: 12px; }
.groom-keys span { display: inline-flex; align-items: center; gap: 3px; }
@media (max-width: 1100px) { .groom-keys { display: none; } }
.triage { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.triage.is-empty { grid-template-columns: minmax(0, 1fr); }
.triage.is-empty .triage-pane { display: none; }
@media (max-width: 900px) { .triage { grid-template-columns: minmax(0, 1fr); } }
.triage-list { position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow: auto; background: var(--app-surface);
               border: 1px solid var(--app-border); border-radius: 12px; box-shadow: var(--app-shadow-sm); }
@media (max-width: 900px) { .triage-list { position: static; max-height: 46vh; } }
.triage-progress { padding: 10px 14px; border-bottom: 1px solid var(--app-border); position: sticky; top: 0; background: var(--app-surface); z-index: 1; }
.gl { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.gi { position: relative; padding: 10px 12px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; overflow: hidden;
      transition: background .12s, border-color .12s, height .25s ease, opacity .25s, padding .25s; }
.gi:hover { background: var(--app-hover); }
.gi.sel { background: var(--rc-accent-soft); border-color: color-mix(in srgb, var(--rc-accent) 40%, transparent); }
.gi.stale::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rc-serious); }
.gi.leaving { opacity: 0; padding-top: 0; padding-bottom: 0; }
.gi.entering { animation: tp-in .3s ease-out; }
.gi-top { display: flex; align-items: center; gap: 6px; }
.gi-age { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font-size: 11.5px; color: var(--rc-muted); white-space: nowrap; }
.gi-title { font-size: 13.5px; font-weight: 600; color: var(--rc-ink); line-height: 1.35; margin: 4px 0 6px;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gi-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rc-ink2); min-width: 0; }
.gi-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-ai { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; flex: none; font-weight: 600; color: var(--rc-accent);
         background: color-mix(in srgb, var(--rc-accent) 10%, transparent); border-radius: 999px; padding: 1px 8px; }
.gi-ai.none { color: var(--rc-muted); background: var(--app-sunken); }
.triage-done { padding: 36px 16px; text-align: center; color: var(--rc-ink2); }
.triage-done b { display: block; color: var(--rc-ink); font-size: 15px; margin: 6px 0 2px; }
.triage-done .ic { color: var(--rc-good); }
.triage-pane { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 12px; box-shadow: var(--app-shadow-sm);
               padding: 20px 24px 24px; min-height: 420px; transition: opacity .15s; }
.triage-pane.loading, .triage-pane.deciding { opacity: .55; }
.g-type { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--rc-s1); display: inline-block; }
.g-type.type-bug { background: var(--rc-crit); }
.g-type.type-incident { background: var(--rc-serious); }

/* ---------- backlog ---------- */
.backlog { display: flex; flex-direction: column; gap: 12px; }
.bsection { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 12px; box-shadow: var(--app-shadow-sm); }
.bsection.sprint { border-color: color-mix(in srgb, var(--rc-accent) 30%, var(--app-border)); }
.bsection.sprint.active { border-color: color-mix(in srgb, var(--rc-good) 40%, var(--app-border)); }
.bsection-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; cursor: pointer; user-select: none; list-style: none; }
.bsection-h::-webkit-details-marker { display: none; }
.bsection-h b { font-size: 14px; }
.bsection-h form { margin: 0; }
.bchev { width: 16px; height: 16px; flex: none; position: relative; }
.bchev::before { content: ""; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; border-right: 1.8px solid var(--rc-ink2);
                 border-bottom: 1.8px solid var(--rc-ink2); transform: rotate(-45deg); transition: transform .18s; }
details[open] > .bsection-h .bchev::before { transform: rotate(45deg); top: 3px; }
.bgoal { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bstats { display: inline-flex; gap: 14px; }
.bstats b { color: var(--rc-ink); font-weight: 650; }
.blist { list-style: none; margin: 0; padding: 0 8px 8px; min-height: 44px; display: flex; flex-direction: column; gap: 2px; }
.bempty { padding: 12px; margin: 2px 4px; text-align: center; font-size: 12.5px; color: var(--rc-muted); border: 1px dashed var(--app-border-strong);
          border-radius: 8px; }
.blist:has(.brow) .bempty { display: none; }
.backlog.dragging .blist .bempty { display: block; border-color: var(--rc-accent); color: var(--rc-accent); }
.backlog.dragging .blist:has(.brow:not(.b-chosen)) .bempty { display: none; }
.brow { display: grid; grid-template-columns: 10px 16px auto minmax(0, 1fr) auto 64px auto 24px; align-items: center; gap: 10px;
        padding: 0 10px; height: 40px; border-radius: 8px; cursor: pointer; background: var(--app-surface); border: 1px solid transparent;
        transition: background .12s, border-color .12s, box-shadow .2s; outline: none; }
.brow:hover { background: var(--app-hover); }
.brow:focus-visible { box-shadow: var(--app-focus); }
.brow.open { background: var(--rc-accent-soft); border-color: color-mix(in srgb, var(--rc-accent) 40%, transparent); }
.brow .grip { width: 10px; height: 16px; opacity: 0; transition: opacity .12s; cursor: grab;
              background-image: radial-gradient(circle, var(--rc-muted) 1.2px, transparent 1.4px); background-size: 5px 5px; }
.brow:hover .grip { opacity: 1; }
.brow-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; color: var(--rc-ink); }
.brow-tags { display: inline-flex; gap: 5px; align-items: center; min-width: 0; overflow: hidden; }
.brow-case { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.brow-due { font-size: 12px; color: var(--rc-muted); text-align: right; white-space: nowrap; }
.brow.saving { opacity: .6; }
.brow.landed { animation: b-landed .9s ease-out; }
@keyframes b-landed { 0% { background: color-mix(in srgb, var(--rc-good) 22%, var(--app-surface)); } 100% { background: var(--app-surface); } }
.brow.bounce { animation: g-shake .4s; }
@keyframes g-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.b-ghost { opacity: .35; background: var(--rc-accent-soft) !important; border: 1px dashed var(--rc-accent) !important; }
.b-drag, .sortable-fallback.brow { box-shadow: var(--app-shadow-lg) !important; background: var(--app-surface) !important; transform: rotate(.8deg);
                                   border-color: var(--app-border) !important; }
@media (max-width: 760px) {
  .brow { grid-template-columns: 16px auto minmax(0, 1fr) 24px; height: auto; padding: 8px 10px; }
  .brow .grip, .brow-tags, .brow-due, .brow .prio { display: none; }
}
.bnew { margin: -4px 0 0; }
.bdivider { display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
            text-transform: uppercase; color: var(--rc-muted); }
.bdivider::before, .bdivider::after { content: ""; flex: 1; height: 1px; background: var(--app-border-strong); }
.date-pop { position: fixed; z-index: 120; width: 330px; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 12px;
            box-shadow: var(--app-shadow-lg); padding: 14px; animation: tp-in .16s ease-out; }

/* ---------- tiroir ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(640px, 100vw); background: var(--app-surface);
          border-left: 1px solid var(--app-border); box-shadow: var(--app-shadow-lg); padding: 20px 24px 32px; overflow: auto;
          transform: translateX(100%); transition: transform .22s cubic-bezier(.2, .9, .25, 1); }
.drawer.in { transform: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 85; background: rgba(13, 13, 30, .18); opacity: 0; transition: opacity .2s; }
.drawer-scrim.in { opacity: 1; }
.drawer-loading { color: var(--rc-muted); padding: 40px 0; text-align: center; }
@media (prefers-reduced-motion: reduce) { .drawer, .gi, .brow, .tpanel { transition: none !important; animation: none !important; } }

/* ---------- espaces ---------- */
.space-badge { --size: 22px; width: var(--size); height: var(--size); flex: none; display: inline-grid; place-items: center; border-radius: 6px;
               background: var(--space, var(--rc-accent)); color: #fff; font-size: calc(var(--size) * .4); font-weight: 750; letter-spacing: .02em;
               line-height: 1; text-transform: uppercase; }
.space-badge.all { background: var(--app-sunken); color: var(--rc-ink2); border: 1px solid var(--app-border-strong); font-size: 14px; }
.spacesw { flex: none; }
.space-current { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 6px; border-radius: 9px; cursor: pointer;
                 border: 1px solid var(--app-border); background: var(--app-surface); list-style: none; max-width: 240px; }
.space-current::-webkit-details-marker { display: none; }
.space-current:hover { background: var(--app-hover); }
.space-name { font-size: 13.5px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-chev { width: 7px; height: 7px; border-right: 1.8px solid var(--rc-muted); border-bottom: 1.8px solid var(--rc-muted); transform: rotate(45deg);
              margin: -3px 2px 0 2px; flex: none; }
.spacesw .menu-panel { left: 0; right: auto; width: 300px; }
.menu-label { padding: 6px 9px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--rc-muted); }
.menu-sep { height: 1px; background: var(--app-border); margin: 6px 0; }
.menu-item.on { background: var(--rc-accent-soft); font-weight: 600; }
@media (max-width: 900px) { .space-name { display: none; } .space-current { padding-right: 8px; } }
.spaces-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.space-card { display: flex; flex-direction: column; gap: 10px; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 12px;
              padding: 16px 18px; box-shadow: var(--app-shadow-sm); text-decoration: none !important; color: var(--rc-ink); transition: box-shadow .15s, border-color .15s; }
.space-card:hover { box-shadow: var(--app-shadow-md); border-color: var(--app-border-strong); }
.space-card .sc-h { display: flex; align-items: center; gap: 10px; }
.space-card .sc-h b { font-size: 15px; }
.space-card p { margin: 0; font-size: 13px; color: var(--rc-ink2); min-height: 20px; }
.space-card .sc-m { display: flex; gap: 14px; font-size: 12.5px; color: var(--rc-ink2); }
.space-card.inactive { opacity: .55; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--rc-ink2); }
.crumb a { color: var(--rc-ink2); }
.crumb a:hover { color: var(--rc-accent); }
.menu.spacesw > summary.space-current { border-radius: 9px; }
.formgrid input[type=color] { width: 48px; }

.gi .why-mini { display: flex; margin: -2px 0 6px; }
