/* ── Colour pickers (Settings note preview) ── */
.calendar-color-picker,
.theme-color-picker {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: none;
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}

/* Calendar picker: smaller circle */
.calendar-color-picker { width: 20px; height: 20px; }

/* Theme picker: slightly larger */
.theme-color-picker { width: 28px; height: 28px; }

.calendar-color-picker::-webkit-color-swatch-wrapper,
.theme-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

.calendar-color-picker::-webkit-color-swatch,
.calendar-color-picker::-moz-color-swatch {
  border: 1px solid var(--border);
  border-radius: 50%;
}

.theme-color-picker::-webkit-color-swatch,
.theme-color-picker::-moz-color-swatch {
  border: 2px solid var(--border);
  border-radius: 50%;
}

.calendar-name-label {
  font-weight: 500;
}

.theme-label {
  font-weight: 500;
  min-width: 100px;
  display: inline-block;
}

.theme-reset-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  margin: 0;
}

.theme-reset-btn:hover {
  color: var(--text);
  background-color: var(--hover-overlay);
}
/* ── Text selection — themed to match accent ── */
::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

/* ── Missing / broken internal links in preview ── */
#preview a.internal-link-new {
  color: var(--link-missing);
  text-decoration-style: dashed;
  text-decoration-color: var(--link-missing);
}

/* ── Checkbox theming — override browser defaults ── */
input[type="checkbox"] {
  accent-color: var(--checkbox-accent);
}

/* ── Custom checkbox base — all interactive contexts.
   Inherit font so em/lh units scale with surrounding text. ── */
#preview input[type="checkbox"],
#todoList input[type="checkbox"],
#schedule-container .schedule-item input[type="checkbox"],
#global-search-panel input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  border: 0.1em solid var(--checkbox-border);
  background: var(--checkbox-bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}

/* Checked state — shared */
#preview input[type="checkbox"]:checked,
#todoList input[type="checkbox"]:checked,
#schedule-container .schedule-item input[type="checkbox"]:checked,
#global-search-panel input[type="checkbox"]:checked {
  background: var(--checkbox-checked-bg);
  border-color: var(--checkbox-checked-bg);
}

/* Checkmark — identical geometry across all contexts */
#preview input[type="checkbox"]:checked::after,
#todoList input[type="checkbox"]:checked::after,
#schedule-container .schedule-item input[type="checkbox"]:checked::after,
#global-search-panel input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 26%;
  top: 7%;
  width: 28%;
  height: 57%;
  border: solid var(--bg);
  border-width: 0 0.14em 0.14em 0;
  transform: rotate(45deg);
}

/* Focus ring — shared */
#preview input[type="checkbox"]:focus-visible,
#todoList input[type="checkbox"]:focus-visible,
#schedule-container .schedule-item input[type="checkbox"]:focus-visible,
#global-search-panel input[type="checkbox"]:focus-visible {
  outline: 0.15em solid var(--checkbox-checked-bg);
  outline-offset: 0.1em;
}

/* Preview & todo: 1em square, rounded, aligned to text baseline */
#preview input[type="checkbox"],
#todoList input[type="checkbox"] {
  width: 1em;
  height: 1em;
  border-radius: 0.2em;
  vertical-align: middle;
  align-self: flex-start;
}

/* Schedule: 1em square, slightly less rounded (matches item row style) */
#schedule-container .schedule-item input[type="checkbox"] {
  width: 1em;
  height: 1em;
  border-radius: 2px;
}

/* Search panel: slightly smaller to sit inline with the compact search row */
#global-search-panel input[type="checkbox"] {
  width: 0.85em;
  height: 0.85em;
  border-radius: 0.2em;
  vertical-align: middle;
}
