/* =========================================================
   Cloud sync UI — matches the neo-brutalist desktop
   ========================================================= */

body.cloud-lock {
  overflow: hidden;
}

.cloud-chip {
  position: fixed;
  left: 20px;
  bottom: calc(var(--dock-space, 92px) + 14px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.cloud-chip:hover {
  background: var(--butter);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.cloud-chip__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--rose);
}

.cloud-chip[data-state="local"] .cloud-chip__dot {
  background: var(--lilac);
}

.cloud-chip[data-state="empty"] .cloud-chip__dot {
  background: var(--butter);
}

.cloud-chip[data-state="cloud"] .cloud-chip__dot {
  background: var(--sage);
}

.cloud-chip[data-state="error"] .cloud-chip__dot {
  background: var(--rose);
}

.cloud-chip[data-state="offline"] .cloud-chip__dot {
  background: var(--peach);
}

.cloud-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-space, 92px) + 68px);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  padding: 9px 11px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--butter);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  transform: translateX(-50%);
}

.cloud-banner[hidden] {
  display: none;
}

.cloud-banner__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--rose);
}

.cloud-banner__text {
  min-width: 0;
  line-height: 1.45;
}

.cloud-banner__action {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}

.cloud-banner__action:hover {
  background: var(--rose-soft);
}

.cloud-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  padding: 20px;
}

.cloud-modal[hidden] {
  display: none;
}

.cloud-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 23, 32, 0.38);
  backdrop-filter: blur(2px);
}

.cloud-modal__panel {
  position: relative;
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 9px 9px 0 var(--ink);
}

.cloud-modal__bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 2px solid var(--ink);
  background: var(--rose-soft);
}

.cloud-modal__dots {
  display: flex;
  gap: 3px;
}

.cloud-modal__dots i {
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
}

.cloud-modal__title {
  flex: 1;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.cloud-modal__title span {
  margin-left: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.cloud-modal__close {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}

.cloud-modal__close:hover {
  background: var(--rose-soft);
}

.cloud-modal__close svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.cloud-modal__body {
  padding: 15px 16px 18px;
}

.cloud-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--paper);
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.55;
  font-weight: 600;
}

.cloud-status__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 3px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--rose);
}

.cloud-status[data-state="cloud"] .cloud-status__dot {
  background: var(--sage);
}

.cloud-status[data-state="empty"] .cloud-status__dot {
  background: var(--butter);
}

.cloud-status[data-state="local"] .cloud-status__dot {
  background: var(--lilac);
}

.cloud-status[data-state="error"] .cloud-status__dot,
.cloud-status[data-state="offline"] .cloud-status__dot {
  background: var(--rose);
}

.cloud-field {
  margin-top: 13px;
}

.cloud-field label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.cloud-field__row {
  display: flex;
  gap: 7px;
}

.cloud-field__row .input {
  flex: 1;
  min-width: 0;
}

.cloud-btn {
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}

.cloud-btn:hover {
  background: var(--butter);
}

.cloud-btn--primary {
  background: var(--rose);
  color: #fffaf4;
}

.cloud-btn--primary:hover {
  background: var(--ink);
}

.cloud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.cloud-actions .cloud-btn {
  width: 100%;
  min-height: 34px;
}

.cloud-actions .cloud-btn--wide {
  grid-column: 1 / -1;
}

.cloud-hint {
  margin: 11px 0 0;
  font-family: var(--font-ui);
  font-size: 9px;
  line-height: 1.65;
  color: var(--ink-3);
}

.cloud-note {
  margin: 10px 0 0;
  padding: 7px 8px;
  border-left: 3px solid var(--rose);
  background: var(--rose-soft);
  font-family: var(--font-ui);
  font-size: 9px;
  line-height: 1.6;
  color: var(--ink-2);
}

.cloud-notice {
  margin-top: 9px;
  min-height: 14px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.cloud-notice[data-kind="error"] {
  color: var(--rose);
}

.cloud-file {
  display: none;
}

@media (max-width: 860px) {
  .cloud-chip,
  .cloud-banner {
    display: none !important;
  }

  .cloud-modal {
    padding: 10px;
    align-items: end;
  }

  .cloud-modal__panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 12px;
  }

  .cloud-modal__body {
    padding: 12px 12px 16px;
  }

  .cloud-actions {
    gap: 7px;
  }
}
