.eso-sync-panel,
.eso-offline-panel {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding: 1.25rem;
}

.eso-sync-panel > h3,
.eso-offline-panel > h3,
.eso-sync-panel > p,
.eso-offline-panel > p {
  margin: 0;
}

.eso-sync-auth-form,
.eso-sync-controls,
.eso-sync-conflict-actions,
.eso-sync-backup-links {
  display: grid;
  gap: 0.75rem;
}

.eso-sync-controls {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), max-content));
  align-items: center;
}

.eso-sync-controls [data-sync-account] {
  grid-column: 1 / -1;
}

.eso-sync-auth-form {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  align-items: end;
}

.eso-sync-auth-form .field,
.eso-offline-panel .field {
  min-width: 0;
}

.eso-sync-remote-info,
.eso-sync-preview,
.eso-sync-backup-list {
  display: grid;
  gap: 0.7rem;
}

.eso-sync-preview,
.eso-sync-backup-list {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.eso-sync-preview h4,
.eso-sync-preview p,
.eso-sync-backup-list h4 {
  margin: 0;
}

.eso-sync-backup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.eso-sync-status,
.eso-offline-status {
  margin: 0;
  overflow-wrap: anywhere;
}

.eso-sync-status:empty,
.eso-offline-status:empty {
  display: none;
}

.eso-sync-download {
  display: inline-flex;
  width: fit-content;
  min-height: 2.5rem;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--control-border);
  border-radius: 0.5rem;
  color: inherit;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.eso-offline-checkbox {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.eso-offline-checkbox input {
  margin-top: 0.25rem;
}

@media (max-width: 38rem) {
  .eso-sync-panel,
  .eso-offline-panel {
    padding: 1rem;
  }

  .eso-sync-controls {
    grid-template-columns: 1fr;
  }

  .eso-sync-controls > button,
  .eso-sync-auth-form > button,
  .eso-offline-panel > button {
    width: 100%;
  }
}

@media (forced-colors: active) {
  .document-card[aria-pressed="true"],
  .lesson-pick.is-selected,
  .micro-lesson-tab.is-selected,
  .answer-option:has(input:checked),
  .exam-question-button.is-current {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  .notice-success,
  .notice-caution,
  .notice-error,
  .learning-notice-error,
  .learning-notice-paused,
  .feedback-correct,
  .feedback-incorrect,
  .feedback-pending,
  .storage-healthy {
    border-color: currentColor;
  }
}
