.compact-shell .rs-sync-control { position:relative; display:flex; align-items:center; flex-shrink:0; margin-right:4px; }
.compact-shell .rs-sync-update,.compact-shell .rs-sync-details { height:28px; border:1px solid var(--ui-line,#202b26); color:var(--ui-text,#d7dfdb); background:var(--ui-input,#0e1612); cursor:pointer; line-height:1; }
.compact-shell .rs-sync-update { display:grid; place-items:center; width:28px; border-radius:4px 0 0 4px; padding:0; }
.rs-sync-update svg { width:14px; height:14px; flex-shrink:0; }
.compact-shell .rs-sync-control[data-state="updated"] .rs-sync-update { color:var(--ui-accent,#31c99b); }
.compact-shell .rs-sync-control[data-state="failed"] .rs-sync-update { color:#e08e86; }
.compact-shell .rs-sync-control:is([data-state="partial"],[data-state="connection_required"]) .rs-sync-update { color:#c8ad6c; }
.compact-shell.crm-light .rs-sync-control[data-state="failed"] .rs-sync-update { color:#a24540; }
.compact-shell.crm-light .rs-sync-control:is([data-state="partial"],[data-state="connection_required"]) .rs-sync-update { color:#866a25; }
.rs-sync-control:is([data-state="pending"],[data-state="capturing"]) .rs-sync-update svg { animation:rs-sync-rotate 1s linear infinite; }
.compact-shell .rs-sync-details { border-left:0; border-radius:0 4px 4px 0; padding:2px 5px; font-size:11px; }
.compact-shell .rs-sync-update:hover,.compact-shell .rs-sync-details:hover { background:var(--ui-soft,#0b2219); }
.rs-sync-update:disabled { cursor:wait; opacity:.65; }
.rs-sync-panel { position:absolute; top:35px; right:0; z-index:85; width:340px; max-width:calc(100vw - 20px); max-height:calc(100dvh - 100px); overflow-y:auto; padding:13px; border:1px solid var(--ui-line,#202b26); border-radius:6px; background:var(--ui-panel,#0c1310); color:var(--ui-text,#d7dfdb); box-shadow:0 12px 28px #0005; text-align:left; }
.rs-sync-panel[hidden] { display:none; }
.rs-sync-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
.rs-sync-panel-heading h2 { margin:0; font-size:13px; font-weight:550; color:var(--ui-text,#d7dfdb); }
.compact-shell .rs-sync-panel .rs-sync-close { border:0; padding:0; width:21px; height:21px; border-radius:3px; background:transparent; color:var(--ui-muted,#89978f); font-size:19px; cursor:pointer; }
.rs-sync-state { font-size:11px; font-weight:500; color:var(--ui-muted,#89978f); }
.rs-sync-state-updated { color:var(--ui-accent,#31c99b); }
.rs-sync-state-partial,.rs-sync-state-connection_required { color:#c8ad6c; }
.compact-shell.crm-light .rs-sync-state-partial,.compact-shell.crm-light .rs-sync-state-connection_required { color:#866a25; }
.rs-sync-message,.rs-sync-connection,.rs-sync-error { margin:8px 0; font-size:11px; line-height:1.55; color:var(--ui-muted,#89978f); }
.rs-sync-error,.rs-sync-state-failed { color:#e08e86; }
.compact-shell.crm-light :is(.rs-sync-error,.rs-sync-state-failed) { color:#a24540; }
.rs-sync-facts { margin:10px 0; font-size:10px; line-height:1.5; }
.rs-sync-facts>div { display:grid; grid-template-columns:95px minmax(0,1fr); gap:10px; padding:5px 0; border-bottom:1px solid var(--ui-line,#202b26); }
.rs-sync-facts dt { margin:0; color:var(--ui-muted,#89978f); }
.rs-sync-facts dd { margin:0; color:var(--ui-text,#d7dfdb); overflow-wrap:anywhere; }
.rs-sync-counts { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding:4px 0 7px; color:var(--ui-muted,#89978f); font-size:10px; }
.rs-sync-counts b { display:block; color:var(--ui-text,#d7dfdb); font-size:14px; font-weight:500; margin-bottom:3px; }
.rs-sync-panel-actions { display:flex; gap:6px; margin-top:10px; }
.compact-shell .rs-sync-panel-actions :is(button,a) { padding:5px 7px; border:1px solid var(--ui-line,#202b26); border-radius:4px; background:var(--ui-input,#0e1612); color:var(--ui-text,#d7dfdb); font-size:11px; line-height:1.4; cursor:pointer; text-decoration:none; }
.rs-sync-panel-actions .rs-sync-copy { flex:1; }
.rs-sync-panel-actions .rs-sync-refresh { width:28px; }
.rs-sync-instructions { margin-top:9px; color:var(--ui-muted,#89978f); font-size:10px; }
.rs-sync-instructions>summary { cursor:pointer; }
.compact-shell .rs-sync-instructions textarea { display:block; width:100%; height:115px; margin-top:6px; resize:vertical; border:1px solid var(--ui-line,#202b26); border-radius:4px; background:var(--ui-input,#0e1612); color:var(--ui-text,#d7dfdb); padding:7px; font:inherit; font-size:10px; line-height:1.5; }
.rs-sync-read-only { display:block; margin-top:9px; color:var(--ui-muted,#89978f); font-size:9px; }
@keyframes rs-sync-rotate { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .rs-sync-control:is([data-state="pending"],[data-state="capturing"]) .rs-sync-update svg { animation:none; } }
@media(max-width:600px) { .rs-sync-control { margin-right:1px; }.rs-sync-panel { position:fixed; top:78px; right:10px; width:320px; max-height:calc(100dvh - 95px); } }
