.sync-toggle { white-space: nowrap; }

.playback-order-toggle {
  white-space: nowrap;
}

.sync-panel {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 28%);
}

.sync-panel[hidden] { display: none; }

.sync-card {
  position: relative;
  width: min(420px, 100%);
  border: 1px solid var(--ink);
  border-radius: 14px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgb(0 0 0 / 20%);
}

.sync-card h2 {
  margin: 0;
  font-size: 20px;
}

.sync-card p {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.sync-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sync-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  outline: none;
}

.sync-card input:focus { border-color: var(--ink); }

.sync-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.sync-actions button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.sync-actions button:first-child {
  background: var(--ink);
  color: #fff;
}

#syncSave,
#syncNow {
  font-size: 0;
}

#syncSave::after,
#syncNow::after {
  font-size: 11px;
}

#syncSave::after { content: "從雲端恢復"; }
#syncNow::after { content: "雙向同步"; }

.sync-status {
  min-height: 17px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.sync-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  padding: 4px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

@media (max-width: 560px) {
  .sync-panel { align-items: end; padding: 10px; }
  .sync-card { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .sync-actions { display: grid; }
  .sync-actions button { width: 100%; }
}
