/* Settings page: grouped sections, the extra theme buttons, and the copy-between-editions dialog. */

/* ------------------------------------------------------------------ groups */
.settings-page.lw-sg {
  display: flex;
  flex-direction: column;
}

.settings-page.lw-sg > .page-heading {
  order: 0;
}

.lw-sg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  margin: 10px 0 0;
  padding: 10px 14px;
  font: inherit;
  text-align: left;
  color: var(--text, inherit);
  background: var(--surface-raised, transparent);
  border: 1px solid var(--border-strong, rgba(127, 127, 127, 0.4));
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lw-sg-head[hidden] {
  display: none;
}

.lw-sg-head:hover {
  background: var(--surface-hover, rgba(127, 127, 127, 0.12));
}

.lw-sg-head > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lw-sg-head strong {
  font-size: 17px;
  color: var(--text-strong, inherit);
}

.lw-sg-head small {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted, inherit);
}

.lw-sg-head svg {
  flex: 0 0 auto;
  transition: transform 0.15s ease;
}

.lw-sg-head[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.lw-sg-head[aria-expanded="true"] {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

/* Sections of an open group read as the body of that group's card. */
.settings-page.lw-sg > section[data-sg] {
  margin: 0 !important;
  padding: 18px 14px !important;
  border: 1px solid var(--border-strong, rgba(127, 127, 127, 0.4)) !important;
  border-top: 0 !important;
}

/* ------------------------------------------------------------------ themes */
/* The app marks its own theme button; while one of the extra themes is on, that mark is muted. */
.appearance-scheme-options.lw-scheme-custom .appearance-scheme-option.active:not(.lw-extra-scheme) {
  background: var(--surface-raised) !important;
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
}

/* --------------------------------------------------- copy between editions */
.lw-ce-overlay {
  position: fixed;
  inset: 0;
  z-index: 100030;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 12, 20, 0.55);
}

.lw-ce-overlay[hidden] {
  display: none;
}

.lw-ce-card {
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  max-height: min(86vh, 760px);
  color: var(--text, #1e2b24);
  background: var(--surface-raised, #ffffff);
  border: 1px solid var(--border, rgba(127, 127, 127, 0.3));
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.lw-ce-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}

.lw-ce-card h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text-strong, inherit);
}

.lw-ce-body {
  padding: 4px 16px 18px;
  overflow-y: auto;
}

.lw-ce-body label {
  display: block;
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.lw-ce-body label small {
  display: block;
  font-weight: 400;
  color: var(--text-muted, inherit);
}

.lw-ce-body select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  font: inherit;
  font-size: 16px;
  color: var(--text, inherit);
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-strong, rgba(127, 127, 127, 0.5));
  border-radius: 10px;
}

.lw-ce-body h3 {
  margin: 18px 0 6px;
  font-size: 15px;
}

.lw-ce-note,
.lw-ce-skipped {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted, inherit);
}

.lw-ce-skipped {
  margin: 0;
  padding-left: 20px;
}

.lw-ce-error {
  font-size: 14px;
  color: var(--danger, #a64542);
}

.lw-ce-done {
  font-size: 15px;
  font-weight: 700;
}

.lw-ce-body label.lw-ce-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  font-weight: 400;
  font-size: 15px;
}

.lw-ce-check input {
  width: 20px;
  height: 20px;
}

.lw-ce-close,
.lw-ce-primary {
  min-height: 44px;
  padding: 0 14px;
  font: inherit;
  font-weight: 650;
  border-radius: 10px;
  cursor: pointer;
}

.lw-ce-close {
  color: var(--text, inherit);
  background: var(--surface-hover, transparent);
  border: 1px solid var(--border, rgba(127, 127, 127, 0.3));
}

.lw-ce-primary {
  width: 100%;
  margin-top: 16px;
  color: var(--surface-raised, #ffffff);
  background: var(--accent, #285c45);
  border: 1px solid var(--accent, #285c45);
}

.lw-ce-primary:disabled {
  opacity: 0.5;
  cursor: default;
}
