/* ===========================================================================
   Reprogrammer un Rali — focused reschedule page (web).
   Built on the Kiclic admin shell. Same visual language as Réglages du Rali:
   Rubik, gradient bleu→violet→rose, rounded 22px panels, mascot, ambient blobs.
   Full light + dark theming driven by [data-theme] on <html>.
   =========================================================================== */

/* Tokens (colors_and_type) + thème + layout : voir reschedule-tokens.css,
   scopé à .rb-root et branché sur le système de thème du site. */

/* =====================================================================
   PAGE FRAME
   ===================================================================== */
.rb-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.rb-bg .blob { position: absolute; border-radius: 50%; }
.rb-bg .b1 { width: 540px; height: 540px; background: radial-gradient(circle, #5B8DEF 0%, transparent 70%); top: -200px; left: 180px; opacity: 0.13; }
.rb-bg .b2 { width: 560px; height: 560px; background: radial-gradient(circle, #E94E8B 0%, transparent 70%); bottom: -260px; right: 60px; opacity: 0.11; }
.rb-bg .b3 { width: 420px; height: 420px; background: radial-gradient(circle, #B968C7 0%, transparent 70%); top: 220px; right: 440px; opacity: 0.09; }
html[data-theme="light"] .rb-bg .b1 { opacity: 0.10; }
html[data-theme="light"] .rb-bg .b2 { opacity: 0.09; }
html[data-theme="light"] .rb-bg .b3 { opacity: 0.07; }

/* =====================================================================
   TOPBAR
   ===================================================================== */
.rb-topbar {
  position: relative; z-index: 4; flex: 0 0 auto;
  height: var(--k-topbar-h, 56px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-soft);
}
.rb-tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rb-status {
  display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 13px 0 11px;
  border-radius: 9999px; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.32);
  font-size: 12.5px; font-weight: 700; color: #10B981; white-space: nowrap;
}
.rb-status .dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #10B981; }
.rb-status .dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(16,185,129,0.55); animation: rbPulse 2s ease-out infinite; }
@keyframes rbPulse { 70% { box-shadow: 0 0 0 9px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.rb-tb-name { font-size: 13px; color: var(--fg-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-tb-name b { color: var(--fg); font-weight: 700; }

.rb-tb-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* segmented control (density) */
.rb-seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bg-elev-2); border: 1px solid var(--border-soft); gap: 2px; }
.rb-seg button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px;
  border: 0; background: transparent; color: var(--fg-muted); font-family: inherit;
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: color var(--t-fast), background var(--t-fast);
}
.rb-seg button svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.rb-seg button.on { background: var(--bg-elev-1); color: var(--fg); box-shadow: var(--shadow-card); }

/* icon button (theme toggle) */
.rb-icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev-1); border: 1px solid var(--border-soft); color: var(--fg-secondary);
  cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.rb-icon-btn:hover { color: var(--fg); border-color: rgba(185,104,199,0.4); transform: translateY(-1px); }
.rb-icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
.rb-icon-btn .moon { display: none; }
[data-theme="dark"] .rb-icon-btn .sun { display: none; }
[data-theme="dark"] .rb-icon-btn .moon { display: block; }

.rb-ghost-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px;
  background: var(--bg-elev-1); border: 1px solid var(--border-soft); color: var(--fg);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.rb-ghost-btn:hover { border-color: rgba(185,104,199,0.4); transform: translateY(-1px); }

/* =====================================================================
   STAGE — editor | recap rail
   ===================================================================== */
.rb-stage {
  position: relative; z-index: 1; flex: 1 1 auto;
  display: grid; grid-template-columns: minmax(0,1fr) 404px; gap: 24px;
  padding: 6px 30px 24px; overflow: hidden; min-height: 0;
}
.rb-editor {
  position: relative; min-width: 0; min-height: 0; overflow-y: auto;
  padding: 4px 16px 48px 4px; margin-right: -10px; scrollbar-width: thin; scroll-behavior: smooth;
}
.rb-editor::-webkit-scrollbar { width: 8px; }
.rb-editor::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9999px; }

@media (prefers-reduced-motion: no-preference) {
  .rb-rise { opacity: 0; transform: translateY(10px); animation: rbRise .55s var(--ease-out) forwards; }
  .rb-rise.d1 { animation-delay: .05s; } .rb-rise.d2 { animation-delay: .11s; }
  .rb-rise.d3 { animation-delay: .17s; } .rb-rise.d4 { animation-delay: .23s; }
  @keyframes rbRise { to { opacity: 1; transform: none; } }
}

/* ---- Mascot greeting ---- */
.rb-greet { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 18px; }
.rb-greet .avatar { width: 48px; height: 48px; border-radius: 15px; overflow: hidden; background: linear-gradient(135deg, #5B8DEF, #B968C7, #E94E8B); box-shadow: 0 8px 22px rgba(185,104,199,0.35); flex: 0 0 auto; position: relative; }
.rb-greet .avatar img { width: 100%; height: 100%; object-fit: cover; transform: translateY(2px) scale(1.1); }
.rb-greet .avatar .ring { position: absolute; inset: 0; border-radius: 15px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.rb-greet .bubble { flex: 1 1 auto; background: var(--bg-elev-1); border: 1px solid var(--border-soft); border-radius: 4px 18px 18px 18px; padding: 12px 17px; position: relative; overflow: hidden; box-shadow: var(--shadow-card); }
.rb-greet .bubble::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: linear-gradient(180deg, #5B8DEF, #B968C7, #E94E8B); opacity: 0.6; }
.rb-greet .bubble .name { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-secondary); margin-bottom: 3px; }
.rb-greet .bubble .name b { color: var(--fg); font-weight: 700; }
.rb-greet .bubble .name .tag { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 9999px; background: rgba(185,104,199,0.18); color: #B968C7; letter-spacing: 0.04em; text-transform: uppercase; }
[data-theme="dark"] .rb-greet .bubble .name .tag { color: #E0BFFF; }
.rb-greet .bubble .msg { margin: 0; font-size: 14px; line-height: 1.45; color: var(--fg); text-wrap: pretty; }
.rb-greet .bubble .msg b { font-weight: 700; }

/* mascot variant inside the right rail (under récapitulatif) */
.rb-greet-rail { margin: 16px 0 0; }
.rb-greet-rail .avatar { width: 42px; height: 42px; border-radius: 13px; }
.rb-greet-rail .bubble { padding: 11px 15px; }
.rb-greet-rail .bubble .msg { font-size: 13px; }

/* ---- Hero ---- */
.rb-hero { margin-bottom: 22px; }
.rb-hero .eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; background: var(--k-gradient-h); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rb-hero h1 { margin: 6px 0 5px; font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: -0.02em; line-height: 1.04; }
.rb-hero h1 .accent { background: linear-gradient(100deg, #5B8DEF, #B968C7, #E94E8B); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rb-hero .sub { color: var(--fg-secondary); font-size: 14px; line-height: 1.45; max-width: 580px; text-wrap: pretty; }

/* =====================================================================
   GENERIC CARD
   ===================================================================== */
.rb-card { border-radius: 22px; background: var(--bg-elev-1); border: 1px solid var(--border-soft); padding: 20px 22px 22px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.rb-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.rb-card-head .ci { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--surface-tint-light); border: 1px solid var(--border-soft); }
.rb-card-head .ci svg { width: 18px; height: 18px; stroke: url(#k-grad-stroke); stroke-width: 2; fill: none; }
.rb-card-head .ct { flex: 1 1 auto; min-width: 0; }
.rb-card-head .ct h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.rb-card-head .ct .cs { font-size: 12.5px; color: var(--fg-muted); margin-top: 2px; }

.rb-eyebrow-lbl { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 11px; }

/* =====================================================================
   RALI INFO CARD (with history)
   ===================================================================== */
.rb-rali { display: flex; align-items: center; gap: 14px; }
.rb-rali .thumb { width: 60px; height: 60px; border-radius: 14px; overflow: hidden; flex: 0 0 auto; background: var(--bg-elev-2); box-shadow: inset 0 0 0 1px var(--border-soft); }
.rb-rali .thumb img { width: 100%; height: 100%; object-fit: cover; }
.rb-rali .meta { flex: 1 1 auto; min-width: 0; }
.rb-rali .meta .nm { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-rali .meta .dt { font-size: 13px; color: var(--fg-secondary); margin-top: 3px; }
.rb-rali .meta .tags { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.rb-chip-mini { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9999px; background: var(--bg-elev-2); border: 1px solid var(--border-soft); font-size: 11.5px; font-weight: 600; color: var(--fg-secondary); }
.rb-chip-mini svg { width: 12px; height: 12px; stroke: var(--fg-muted); stroke-width: 2; fill: none; }
.rb-chip-mini.hist { cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); }
.rb-chip-mini.hist:hover { border-color: rgba(185,104,199,0.4); color: var(--fg); }
.rb-chip-mini.hist svg.chev { transition: transform var(--t-fast); }
.rb-rali.open .rb-chip-mini.hist svg.chev { transform: rotate(180deg); }

/* history timeline */
.rb-hist { overflow: hidden; max-height: 0; transition: max-height var(--t-base) var(--ease-out); }
.rb-rali-wrap.open .rb-hist { max-height: 220px; }
.rb-hist-inner { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.rb-hist-row { display: flex; align-items: center; gap: 11px; padding: 7px 0; font-size: 13px; }
.rb-hist-row .ic { width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--surface-tint-light); }
.rb-hist-row .ic svg { width: 12px; height: 12px; stroke: var(--fg-muted); stroke-width: 2; fill: none; }
.rb-hist-row .from { color: var(--fg-muted); }
.rb-hist-row .arr { color: var(--fg-muted); }
.rb-hist-row .to { color: var(--fg); font-weight: 600; }
.rb-hist-row .when { margin-left: auto; font-size: 11.5px; color: var(--fg-muted); }

/* =====================================================================
   QUICK PICKS
   ===================================================================== */
.rb-picks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.rb-pick {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 16px;
  background: var(--bg-elev-2); border: 1px solid var(--border-soft); cursor: pointer; text-align: left;
  font-family: inherit; color: var(--fg); transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast), background var(--t-fast);
}
.rb-pick:hover { transform: translateY(-2px); border-color: rgba(185,104,199,0.34); }
.rb-pick .pi { width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--bg-elev-1); border: 1px solid var(--border-soft); transition: background var(--t-fast); }
.rb-pick .pi svg { width: 17px; height: 17px; stroke: url(#k-grad-stroke); stroke-width: 2; fill: none; transition: stroke var(--t-fast); }
.rb-pick .pm { min-width: 0; display: flex; flex-direction: column; }
.rb-pick .pl { font-size: 13.5px; font-weight: 600; }
.rb-pick .pd { font-size: 11.5px; color: var(--fg-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.rb-pick.on {
  background: linear-gradient(var(--bg-elev-1), var(--bg-elev-1)) padding-box, linear-gradient(135deg, var(--k-blue), var(--k-violet), var(--k-pink)) border-box;
  border: 1.5px solid transparent; box-shadow: 0 8px 22px rgba(185,104,199,0.18);
}
.rb-pick.on .pi { background: var(--k-gradient-h); border-color: transparent; }
.rb-pick.on .pi svg { stroke: #fff; }

/* =====================================================================
   CALENDAR
   ===================================================================== */
.rb-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rb-cal-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.rb-cal-title .yr { color: var(--k-violet); }
.rb-cal-nav { display: flex; gap: 8px; }
.rb-cal-nav button { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--bg-elev-2); border: 1px solid var(--border-soft); cursor: pointer; color: var(--k-violet); transition: border-color var(--t-fast), transform var(--t-fast); }
.rb-cal-nav button:hover { border-color: rgba(185,104,199,0.4); transform: translateY(-1px); }
.rb-cal-nav button:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.rb-cal-nav button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; }

.rb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.rb-cal-dow { text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--fg-muted); text-transform: uppercase; padding: 4px 0 8px; }
.rb-day {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; position: relative;
  border-radius: 12px; border: 1px solid transparent; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--fg); cursor: pointer; font-family: inherit;
  font-variant-numeric: tabular-nums; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.rb-day:hover:not(.is-disabled):not(.is-selected) { background: var(--surface-tint-light); }
.rb-day.is-empty { cursor: default; }
.rb-day.is-disabled { color: var(--fg-muted); opacity: 0.32; cursor: not-allowed; }
.rb-day.is-original { box-shadow: inset 0 0 0 1.5px rgba(185,104,199,0.5); color: var(--k-violet); }
.rb-day.is-today::before { content: ''; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--fg-muted); }
.rb-day.is-busy::after { content: ''; position: absolute; bottom: 6px; right: 50%; transform: translateX(50%); width: 5px; height: 5px; border-radius: 50%; background: var(--warning); }
.rb-day.is-selected {
  background: linear-gradient(135deg, #5B8DEF, #B968C7, #E94E8B); color: #fff;
  box-shadow: 0 8px 20px rgba(185,104,199,0.4); transform: scale(1.02);
}
.rb-day.is-selected.is-original { box-shadow: 0 8px 20px rgba(185,104,199,0.4); }
.rb-day.is-selected::after { background: #fff; }

/* time row */
.rb-time { display: flex; align-items: center; gap: 11px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.rb-time .clock { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--surface-tint-light); }
.rb-time .clock svg { width: 16px; height: 16px; stroke: var(--k-violet); stroke-width: 2; fill: none; }
.rb-time .lbl { font-size: 14px; color: var(--fg-secondary); font-weight: 500; }
.rb-time .spacer { flex: 1 1 auto; }
.rb-time input[type="time"] {
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums;
  background: var(--bg-elev-2); border: 1px solid var(--border-soft); border-radius: 11px; padding: 8px 13px;
  cursor: pointer; outline: none; transition: border-color var(--t-fast);
}
.rb-time input[type="time"]:focus { border-color: rgba(185,104,199,0.5); box-shadow: 0 0 0 3px rgba(185,104,199,0.12); }
[data-theme="dark"] .rb-time input[type="time"] { color-scheme: dark; }

/* legend */
.rb-legend { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.rb-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--fg-muted); }
.rb-legend .sw { width: 11px; height: 11px; border-radius: 4px; flex: 0 0 auto; }
.rb-legend .sw.sel { background: linear-gradient(135deg, #5B8DEF, #E94E8B); }
.rb-legend .sw.orig { box-shadow: inset 0 0 0 1.5px rgba(185,104,199,0.6); }
.rb-legend .sw.busy { background: transparent; position: relative; }
.rb-legend .sw.busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 5px; height: 5px; border-radius: 50%; background: var(--warning); }

/* =====================================================================
   RECAP RAIL
   ===================================================================== */
.rb-rail { display: flex; flex-direction: column; min-height: 0; }
.rb-rail-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 4px 8px; margin: 0 -4px; scrollbar-width: thin; }
.rb-rail-scroll::-webkit-scrollbar { width: 7px; }
.rb-rail-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9999px; }

.rb-recap { border-radius: 22px; border: 1px solid var(--border-soft); overflow: hidden; box-shadow: var(--shadow-card-dk); }
.rb-recap-top { padding: 18px 20px 16px; background: var(--bg-elev-1); }
.rb-recap-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 16px; }
.rb-recap-eyebrow svg { width: 14px; height: 14px; stroke: var(--k-violet); stroke-width: 2; fill: none; }

/* before -> after */
.rb-ba { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; }
.rb-ba-block { border-radius: 15px; padding: 13px 14px; border: 1px solid var(--border-soft); background: var(--bg-elev-2); min-width: 0; }
.rb-ba-block .k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); }
.rb-ba-block .d { font-size: 16px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; }
.rb-ba-block .t { font-size: 13px; color: var(--fg-secondary); margin-top: 2px; font-variant-numeric: tabular-nums; }
.rb-ba-block.after { background: linear-gradient(var(--bg-elev-1), var(--bg-elev-1)) padding-box, linear-gradient(135deg, var(--k-blue), var(--k-violet), var(--k-pink)) border-box; border: 1.5px solid transparent; }
.rb-ba-block.after .d { background: linear-gradient(100deg, #5B8DEF, #B968C7, #E94E8B); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rb-ba-block.after.empty .d { background: none; -webkit-text-fill-color: var(--fg-muted); color: var(--fg-muted); font-size: 14px; font-weight: 600; }
.rb-ba-arrow { display: flex; align-items: center; justify-content: center; color: var(--fg-muted); }
.rb-ba-arrow svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
.rb-delta { display: flex; justify-content: center; margin-top: 12px; }
.rb-delta span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 9999px; background: rgba(185,104,199,0.12); border: 1px solid rgba(185,104,199,0.28); font-size: 12px; font-weight: 700; color: var(--k-violet); }
[data-theme="dark"] .rb-delta span { color: #D9B6E8; }
.rb-delta.hidden { display: none; }

/* recap body sections */
.rb-recap-body { padding: 4px 20px 18px; background: var(--bg-elev-1); border-top: 1px solid var(--border-soft); }
.rb-sec { padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.rb-sec:last-child { border-bottom: 0; }
.rb-sec-t { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 12px; }

/* impact */
.rb-impact { display: flex; align-items: center; gap: 13px; }
.rb-avatars { display: flex; flex: 0 0 auto; }
.rb-avatars .av { width: 32px; height: 32px; border-radius: 50%; margin-left: -10px; border: 2px solid var(--bg-elev-1); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.rb-avatars .av:first-child { margin-left: 0; }
.rb-avatars .more { background: var(--bg-elev-2); color: var(--fg-secondary); border: 2px solid var(--bg-elev-1); box-shadow: inset 0 0 0 1px var(--border-soft); }
.rb-impact .txt { min-width: 0; }
.rb-impact .txt .big { font-size: 14px; font-weight: 700; }
.rb-impact .txt .big b { color: var(--error); }
.rb-impact .txt .small { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

/* conflict */
.rb-conflict { display: none; align-items: flex-start; gap: 11px; padding: 13px 14px; border-radius: 14px; background: rgba(245,158,11,0.09); border: 1px solid rgba(245,158,11,0.28); }
.rb-conflict.show { display: flex; }
.rb-conflict .wi { width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: rgba(245,158,11,0.15); }
.rb-conflict .wi svg { width: 16px; height: 16px; stroke: var(--warning); stroke-width: 2.2; fill: none; }
.rb-conflict .ct2 { min-width: 0; }
.rb-conflict .ct2 .h { font-size: 13px; font-weight: 700; color: var(--fg); }
.rb-conflict .ct2 .b { font-size: 12px; color: var(--fg-secondary); margin-top: 2px; }
.rb-conflict .ct2 .b b { color: var(--warning); font-weight: 700; }

/* change / keep two-up */
.rb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rb-col h4 { margin: 0 0 9px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.rb-col h4 .ic { width: 16px; height: 16px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.rb-col h4 .ic svg { width: 11px; height: 11px; stroke-width: 2.6; fill: none; }
.rb-col.change h4 .ic { background: rgba(233,78,139,0.14); } .rb-col.change h4 .ic svg { stroke: var(--k-pink); }
.rb-col.keep h4 .ic { background: rgba(16,185,129,0.14); } .rb-col.keep h4 .ic svg { stroke: var(--success); }
.rb-li { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--fg-secondary); padding: 4px 0; line-height: 1.35; }
.rb-li svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 2px; stroke-width: 2.2; fill: none; }
.rb-col.change .rb-li svg { stroke: var(--k-pink); }
.rb-col.keep .rb-li svg { stroke: var(--success); }

/* notify toggle */
.rb-notify { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 14px; background: var(--bg-elev-2); border: 1px solid var(--border-soft); }
.rb-notify .ni { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--surface-tint-light); }
.rb-notify .ni svg { width: 17px; height: 17px; stroke: var(--k-blue); stroke-width: 2; fill: none; }
.rb-notify .nt { flex: 1 1 auto; min-width: 0; }
.rb-notify .nt .h { font-size: 13.5px; font-weight: 600; }
.rb-notify .nt .s { font-size: 11.5px; color: var(--fg-muted); margin-top: 1px; }

.rb-switch { position: relative; width: 46px; height: 27px; border-radius: 9999px; background: var(--border); border: 0; cursor: pointer; flex: 0 0 auto; transition: background var(--t-base); }
.rb-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.25); transition: transform var(--t-base) var(--spring); }
.rb-switch.on { background: var(--k-gradient-h); }
.rb-switch.on::after { transform: translateX(19px); }

/* rail footer CTA */
.rb-rail-foot { flex: 0 0 auto; padding-top: 14px; }
.rb-cta {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 20px; border-radius: 16px; border: 0; cursor: pointer; font-family: inherit;
  font-size: 15.5px; font-weight: 700; color: #fff; background: var(--k-gradient-h);
  box-shadow: var(--shadow-button); transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.rb-cta svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.rb-cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(233,78,139,0.45); }
.rb-cta:active:not(:disabled) { transform: scale(0.99); }
.rb-cta:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; background: var(--bg-elev-2); color: var(--fg-muted); }
.rb-cta .cta-delta { font-weight: 600; opacity: 0.85; }
.rb-foot-note { text-align: center; font-size: 11.5px; color: var(--fg-muted); margin-top: 9px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rb-foot-note svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }

/* =====================================================================
   CONFIRM MODAL
   ===================================================================== */
.rb-overlay { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(8,8,12,0.55); backdrop-filter: blur(6px); }
.rb-overlay.show { display: flex; }
.rb-modal { width: 100%; max-width: 460px; border-radius: 24px; background: var(--bg-elev-1); border: 1px solid var(--border-soft); box-shadow: 0 30px 80px rgba(0,0,0,0.45); overflow: hidden; animation: rbPop .35s var(--spring); }
@keyframes rbPop { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
.rb-modal-head { padding: 24px 24px 0; text-align: center; }
.rb-modal-icon { width: 56px; height: 56px; border-radius: 17px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; background: rgba(245,158,11,0.14); }
.rb-modal-icon svg { width: 28px; height: 28px; stroke: var(--warning); stroke-width: 2; fill: none; }
.rb-modal-head h3 { margin: 0 0 8px; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.rb-modal-head p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--fg-secondary); text-wrap: pretty; }
.rb-modal-body { padding: 20px 24px 24px; }
.rb-modal-recap { border-radius: 16px; background: var(--bg-elev-2); border: 1px solid var(--border-soft); padding: 14px 16px; margin-bottom: 16px; }
.rb-modal-recap .row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 6px 0; font-size: 13.5px; }
.rb-modal-recap .row .l { color: var(--fg-muted); white-space: nowrap; flex: 0 0 auto; }
.rb-modal-recap .row .v { font-weight: 700; white-space: nowrap; text-align: right; }
.rb-modal-recap .row .v.grad { background: linear-gradient(100deg, #5B8DEF, #B968C7, #E94E8B); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rb-ack { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border-radius: 14px; background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.22); cursor: pointer; margin-bottom: 18px; }
.rb-ack .box { width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto; border: 1.5px solid var(--border); background: var(--bg-elev-1); display: flex; align-items: center; justify-content: center; transition: background var(--t-fast), border-color var(--t-fast); }
.rb-ack .box svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; transition: opacity var(--t-fast); }
.rb-ack.checked .box { background: var(--error); border-color: var(--error); }
.rb-ack.checked .box svg { opacity: 1; }
.rb-ack .lbl { font-size: 13px; line-height: 1.4; color: var(--fg); }
.rb-modal-actions { display: flex; gap: 11px; }
.rb-modal-actions button { flex: 1 1 0; padding: 14px; border-radius: 13px; font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; border: 1px solid var(--border-soft); transition: transform var(--t-fast), opacity var(--t-fast), background var(--t-fast); }
.rb-modal-actions .cancel { background: var(--bg-elev-2); color: var(--fg); }
.rb-modal-actions .cancel:hover { background: var(--surface-tint); }
.rb-modal-actions .confirm { flex: 1.4 1 0; border-color: transparent; color: #fff; background: var(--k-gradient-error); box-shadow: 0 8px 20px rgba(239,68,68,0.28); }
.rb-modal-actions .confirm:hover:not(:disabled) { transform: translateY(-1px); }
.rb-modal-actions .confirm:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* success state */
.rb-success { padding: 40px 28px 32px; text-align: center; }
.rb-success .check { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; background: var(--k-gradient-h); box-shadow: 0 14px 34px rgba(185,104,199,0.4); animation: rbPopBig .5s var(--spring); }
.rb-success .check svg { width: 38px; height: 38px; stroke: #fff; stroke-width: 3; fill: none; }
@keyframes rbPopBig { from { transform: scale(0); } 60% { transform: scale(1.12); } }
.rb-success h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.rb-success p { margin: 0 0 22px; font-size: 14px; color: var(--fg-secondary); line-height: 1.5; }
.rb-success p b { color: var(--fg); }
.rb-success .done-btn { padding: 13px 30px; border-radius: 12px; border: 0; background: var(--bg-elev-2); color: var(--fg); font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.rb-success .done-btn:hover { background: var(--surface-tint); }

/* =====================================================================
   DENSITY = compact
   ===================================================================== */
[data-density="compact"] .rb-card { padding: 15px 17px 16px; margin-bottom: 13px; }
[data-density="compact"] .rb-card-head { margin-bottom: 12px; }
[data-density="compact"] .rb-greet { margin-bottom: 13px; }
[data-density="compact"] .rb-hero { margin-bottom: 16px; }
[data-density="compact"] .rb-hero h1 { font-size: 29px; }
[data-density="compact"] .rb-picks { gap: 9px; }
[data-density="compact"] .rb-pick { padding: 10px 13px; }
[data-density="compact"] .rb-stage { padding-top: 2px; }
[data-density="compact"] .rb-recap-top { padding: 15px 17px 13px; }
[data-density="compact"] .rb-recap-body { padding: 2px 17px 14px; }
[data-density="compact"] .rb-sec { padding: 13px 0; }

/* =====================================================================
   RESPONSIVE — collapse rail under editor on narrow shells
   ===================================================================== */
@media (max-width: 1180px) {
  .rb-stage { grid-template-columns: 1fr; overflow-y: auto; }
  .rb-editor { overflow: visible; padding-right: 4px; margin-right: 0; }
  .rb-rail { min-height: auto; }
  .rb-rail-scroll { overflow: visible; }
}
@media (max-width: 920px) {
  .k-app { grid-template-columns: 1fr; }
  .k-side { display: none; }
}
