.api-sync-button { border-color: #5eead4 !important; color: #5eead4 !important; }
.api-sync-button:hover { background: #5eead4 !important; color: #07110f !important; }
.api-sync-dialog { width: min(960px, calc(100vw - 32px)); max-height: min(860px, calc(100vh - 32px)); overflow: auto; color: #f4f4f5; background: #111114; border: 1px solid #303038; border-radius: 8px; padding: 0; }
.api-sync-dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.api-sync-head,.api-sync-foot { position: sticky; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; background: #111114; }
.api-sync-head { top: 0; border-bottom: 1px solid #29292f; }
.api-sync-foot { bottom: 0; justify-content: flex-end; border-top: 1px solid #29292f; }
.api-sync-head h2 { margin: 0 0 6px; font-size: 20px; }
.api-sync-head p,.api-sync-note,.api-preview-meta { margin: 0; color: #a1a1aa; font-size: 14px; line-height: 1.6; }
.api-sync-body { padding: 24px; }
.api-security-note { margin-bottom: 18px; padding: 14px 16px; color: #99f6e4; background: rgba(20,184,166,.07); border: 1px solid rgba(45,212,191,.28); border-radius: 6px; }
.api-sync-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 14px; }
.api-sync-grid > label { display: grid; grid-template-rows: max-content 44px; align-content: start; gap: 7px; min-width: 0; color: #d4d4d8; font-size: 14px; }
.api-sync-grid > label:has(.api-range-note) { grid-template-rows: max-content 44px max-content; }
.api-sync-grid label.full { grid-column: 1/-1; }
.api-range-note { color: #8b8b95; font-size: 12px; line-height: 1.5; }
.api-sync-grid .api-write-mode.full { grid-column: 1/-1; width: 100%; min-width: 0; }
.api-write-mode { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 2px 0 0; padding: 0; border: 0; }
.api-write-mode legend { margin-bottom: 7px; color: #d4d4d8; font-size: 14px; }
.api-sync-grid .api-write-mode > label { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: start; gap: 10px; width: auto; min-width: 0; min-height: 78px; padding: 13px; background: #0b0b0e; border: 1px solid #303038; border-radius: 6px; cursor: pointer; }
.api-write-mode label:has(input:checked) { border-color: #5eead4; background: rgba(20,184,166,.06); }
.api-sync-grid .api-write-mode > label > input[type="radio"] { appearance: auto; width: 16px; height: 16px; min-width: 16px; min-height: 16px; max-width: 16px; max-height: 16px; margin: 3px 0 0; padding: 0; border: 0; box-shadow: none; accent-color: #2dd4bf; }
.api-write-mode span { display: grid; gap: 5px; min-width: 0; writing-mode: horizontal-tb; word-break: normal; overflow-wrap: break-word; }
.api-write-mode b { color: #f4f4f5; }
.api-write-mode small { color: #8b8b95; font-size: 12px; line-height: 1.5; }
.api-sync-grid input:not([type="radio"]),.api-sync-grid select { width: 100%; height: 44px; min-height: 44px; padding: 0 12px; color: #fafafa; -webkit-text-fill-color: #fafafa; color-scheme: dark; background: #0b0b0e; border: 1px solid #303038; border-radius: 6px; outline: none; }
.api-sync-grid input:not([type="radio"]):focus,.api-sync-grid select:focus { border-color: #5eead4; box-shadow: 0 0 0 2px rgba(94,234,212,.12); }
.api-sync-grid select option { color: #f4f4f5; background: #111114; }
.api-sync-grid > label > .custom-select,
.api-sync-grid > label > select { align-self: start; width: 100%; height: 44px; min-height: 44px; min-width: 0; }
.api-sync-dialog .custom-select,
.api-sync-dialog .select-trigger { width: 100%; min-width: 0; }
.api-sync-dialog .select-trigger { height: 44px !important; min-height: 44px !important; color: #f4f4f5 !important; -webkit-text-fill-color: #f4f4f5 !important; background: #0b0b0e; border-color: #303038; }
.api-sync-dialog .select-trigger-label { color: inherit !important; -webkit-text-fill-color: currentColor !important; }
.api-sync-dialog .select-trigger:hover,
.api-sync-dialog .select-trigger:focus-visible,
.api-sync-dialog .custom-select.open .select-trigger { color: #fff !important; -webkit-text-fill-color: #fff !important; background: #19191e; border-color: #8b8b95; }
.api-sync-dialog .select-menu { color: #e4e4e7; background: #151519; border-color: #36363e; }
.api-sync-dialog .select-option { color: #e4e4e7 !important; -webkit-text-fill-color: #e4e4e7 !important; background: transparent; }
.api-sync-dialog .select-option:hover,
.api-sync-dialog .select-option:focus-visible { color: #fff !important; -webkit-text-fill-color: #fff !important; background: #27272d !important; }
.api-sync-dialog .select-option[aria-selected="true"] { color: #fff !important; -webkit-text-fill-color: #fff !important; background: rgba(45,212,191,.12) !important; }
.api-sync-actions { display: flex; gap: 10px; margin-top: 18px; }
.api-sync-dialog button { min-height: 38px; padding: 0 15px; color: #d5e5fd; background: transparent; border: 1px solid #526174; border-radius: 5px; cursor: pointer; }
.api-sync-dialog button:hover { color: #050507; background: #d5e5fd; }
.api-sync-dialog button.primary { border-color: #5eead4; color: #5eead4; }
.api-sync-dialog button.primary:hover { color: #07110f; background: #5eead4; }
.api-sync-dialog button:disabled { opacity: .4; cursor: not-allowed; }
.api-connection-state { margin-top: 14px; color: #a1a1aa; font-size: 14px; }
.api-connection-state.connected { color: #34d399; }
.api-connection-state.error { color: #fb7185; }
.api-preview { margin-top: 24px; border-top: 1px solid #29292f; padding-top: 20px; }
.api-preview[hidden] { display: none; }
.api-preview-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 14px 0; border: 1px solid #29292f; border-radius: 6px; overflow: hidden; }
.api-preview-kpis div { padding: 14px; border-right: 1px solid #29292f; }
.api-preview-kpis div:last-child { border: 0; }
.api-preview-kpis span { display:block; color:#8b8b95; font-size:13px; }
.api-preview-kpis strong { display:block; margin-top:6px; font-size:18px; }
.api-preview-list { max-height: 300px; overflow: auto; border-top: 1px solid #29292f; }
.api-preview-row { display:grid; grid-template-columns: 1fr .7fr .8fr 1fr; gap:12px; align-items:center; padding:12px 4px; border-bottom:1px solid #24242a; font-size:14px; }
.api-preview-row .positive { color:#34d399; }.api-preview-row .negative { color:#fb7185; }
@media (max-width: 640px) {
  .api-sync-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .api-sync-grid,.api-write-mode { grid-template-columns:1fr; }
  .api-sync-grid label.full { grid-column:auto; }
  .api-sync-grid .api-write-mode.full { grid-column:1; }
  .api-sync-grid > label { grid-template-rows: max-content 46px; }
  .api-sync-grid > label:has(.api-range-note) { grid-template-rows: max-content 46px max-content; }
  .api-sync-dialog .select-trigger,.api-sync-grid input:not([type="radio"]),.api-sync-grid select { height: 46px !important; min-height: 46px !important; font-size: 16px; }
  .api-preview-kpis { grid-template-columns:repeat(2,1fr); }
  .api-preview-kpis div:nth-child(2){border-right:0}
  .api-preview-row{grid-template-columns:1fr 1fr}
  .api-sync-head { align-items: flex-start; }
  .api-sync-actions,.api-sync-foot { flex-wrap: wrap; }
  .api-sync-head,.api-sync-body,.api-sync-foot{padding-left:16px;padding-right:16px}
}
