:root {
  color-scheme: light;
  --theme-bg: #f6f2ea;
  --theme-surface: #fff;
  --theme-soft: #fffdf8;
  --theme-inset: #f4ece0;
  --theme-text: #18120b;
  --theme-muted: #5f574e;
  --theme-border: #e0d7ca;
  --theme-accent: #007a61;
  --theme-button: #005f4a;
  --theme-on-button: #fff;
  --theme-link: #005f4a;
  --theme-selected: #e8f8f2;
  --theme-selected-text: #105f49;
  --theme-focus: #007a61;
  --theme-error: #8e3123;
  --theme-error-bg: #fff4f4;
  --theme-success: #128552;
  --theme-warning: #925900;
  --theme-warning-bg: #fff2bf;
  --theme-success-bg: #e4f9ea;
  --theme-info: #1f4f86;
  --theme-info-bg: #eef6ff;
  --theme-shadow: 0 14px 35px rgb(36 20 10 / .1);
  --theme-glow-peach: #f1d9bd;
  --theme-glow-teal: #bfdcd3;
}

@media screen {
  :root[data-edt-theme="dark"] {
    color-scheme: dark;
    --theme-bg: #18181b;
    --theme-surface: #26262a;
    --theme-soft: #222226;
    --theme-inset: #303036;
    --theme-text: #f4f4f5;
    --theme-muted: #c1c1c7;
    --theme-border: #54545c;
    --theme-accent: #007a61;
    --theme-button: #00705a;
    --theme-link: #a1e1cc;
    --theme-selected: #21413a;
    --theme-selected-text: #b0eada;
    --theme-focus: #8de0c5;
    --theme-error: #ffad99;
    --theme-error-bg: #442828;
    --theme-success: #7ed6a8;
    --theme-warning: #facd7c;
    --theme-warning-bg: #473820;
    --theme-success-bg: #233e30;
    --theme-info: #aad5ff;
    --theme-info-bg: #233749;
    --theme-shadow: 0 14px 35px rgb(0 0 0 / .24);
    --theme-glow-peach: transparent;
    --theme-glow-teal: transparent;
  }
  :root[data-edt-theme="dark"] body { background-image: none; }
}

.appearance-trigger, .appearance-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  color: var(--theme-link);
  background: var(--theme-surface);
  font: inherit;
  cursor: pointer;
}
.appearance-trigger {
  position: fixed;
  inset-inline-end: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  z-index: 1000;
  box-shadow: var(--theme-shadow);
}
.appearance-trigger:hover, .appearance-close:hover { background-color: var(--theme-selected); }
.appearance-dialog {
  width: min(22rem, 92vw);
  box-sizing: border-box;
  padding: 1.15rem;
  border: 1px solid var(--theme-border);
  border-radius: 16px;
  color: var(--theme-text);
  background: var(--theme-surface);
  font-family: "Space Grotesk", system-ui, sans-serif;
  box-shadow: var(--theme-shadow);
}
.appearance-dialog::backdrop { background: rgb(12 16 18 / .56); }
.appearance-dialog h2 { font-size: 1.25rem; margin: 0 0 1rem; }
.appearance-dialog fieldset { margin: 0 0 1rem; padding: 0; border: 0; }
.appearance-dialog legend { color: var(--theme-muted); font-weight: 650; }
.appearance-dialog label {
  display: flex;
  gap: .65rem;
  align-items: center;
  padding: 0 .55rem;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
}
.appearance-dialog label:has(input:checked) { background: var(--theme-selected); color: var(--theme-selected-text); }
.appearance-dialog input { accent-color: var(--theme-accent); width: 1rem; height: 1rem; margin: 0; }
.appearance-close { padding-inline: 1rem; }
.appearance-trigger:focus-visible, .appearance-dialog :focus-visible { outline: 3px solid var(--theme-focus); outline-offset: 3px; }
.appearance-message { color: var(--theme-error); }
@media print {
  .appearance-trigger, .appearance-dialog { display: none !important; }
}
