/* ATLAS Phase 2D — Smart Auto Sync */
.atlas-sync-float {
  position: fixed;
  left: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 260;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 9px 11px;
  border: 1px solid var(--line, rgba(148,163,184,.22));
  border-radius: 999px;
  background: rgba(2,6,23,.82);
  color: var(--text, #f8fafc);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
}
.atlas-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted2, #64748b);
  box-shadow: 0 0 12px rgba(148,163,184,.45);
  flex: 0 0 auto;
}
.atlas-sync-float[data-state="synced"] .atlas-sync-dot,
.atlas-sync-float[data-state="saved"] .atlas-sync-dot { background: var(--green, #22c55e); box-shadow: 0 0 14px rgba(34,197,94,.55); }
.atlas-sync-float[data-state="dirty"] .atlas-sync-dot,
.atlas-sync-float[data-state="checking"] .atlas-sync-dot,
.atlas-sync-float[data-state="saving"] .atlas-sync-dot { background: var(--amber, #f59e0b); box-shadow: 0 0 14px rgba(245,158,11,.55); }
.atlas-sync-float[data-state="conflict"] .atlas-sync-dot,
.atlas-sync-float[data-state="failed"] .atlas-sync-dot { background: var(--red, #ef4444); box-shadow: 0 0 14px rgba(239,68,68,.55); }
.atlas-sync-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-sync-float button {
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(148,163,184,.08);
  color: inherit;
  border-radius: 999px;
  padding: 4px 8px;
  font: inherit;
  cursor: pointer;
}
.atlas-sync-float button:hover { border-color: rgba(0,229,255,.45); }
.atlas-autosync-settings {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line, rgba(148,163,184,.22));
  border-radius: 16px;
  background: rgba(2,6,23,.22);
}
.atlas-autosync-settings h4 { margin: 0 0 6px; }
.atlas-autosync-settings p { margin: 0 0 10px; }
.atlas-sync-conflict-panel {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 300;
  max-width: 560px;
  padding: 14px;
  border: 1px solid rgba(239,68,68,.35);
  border-radius: 18px;
  background: rgba(15,23,42,.95);
  color: var(--text, #f8fafc);
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
  backdrop-filter: blur(18px);
}
.atlas-sync-conflict-panel h4 { margin: 0 0 6px; }
.atlas-sync-conflict-panel p { margin: 0 0 10px; color: var(--muted, #aab6c8); font-size: 13px; line-height: 1.45; }
.atlas-sync-conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
  .atlas-sync-float {
    left: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
  .atlas-sync-text { max-width: 190px; }
  .atlas-sync-conflict-panel { bottom: calc(140px + env(safe-area-inset-bottom)); }
}

/* Phase 2D v6: quick sync control
   Desktop uses the floating sync pill with buttons.
   Mobile uses ONE compact top Pull/Sync control, while the bottom pill becomes status-only.
*/
.atlas-top-sync-control {
  display: none;
}

@media (max-width: 760px) {
  .atlas-sync-float {
    left: 12px;
    right: auto;
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: min(280px, calc(100vw - 24px));
    padding: 8px 10px;
  }
  .atlas-sync-float button {
    display: none !important;
  }
  .atlas-sync-text {
    max-width: 220px;
  }

  .atlas-top-sync-control {
    position: fixed;
    top: calc(62px + env(safe-area-inset-top));
    right: 10px;
    z-index: 460;
    display: flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(9,8,14,.78);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
  }
  .atlas-top-sync-control button {
    border: 1px solid rgba(129,140,248,.26);
    background: rgba(129,140,248,.08);
    color: var(--text);
    border-radius: 999px;
    padding: 7px 9px;
    font-size: 10px;
    font-family: var(--mono);
    cursor: pointer;
    min-height: 32px;
  }
  .atlas-top-sync-control button:hover {
    border-color: rgba(129,140,248,.55);
  }
  .atlas-sync-conflict-panel {
    bottom: calc(140px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .atlas-top-sync-control {
    top: calc(58px + env(safe-area-inset-top));
    right: 8px;
  }
  .atlas-top-sync-control button {
    padding: 6px 8px;
    font-size: 9.5px;
  }
  .atlas-sync-float {
    max-width: min(250px, calc(100vw - 24px));
  }
}
