:root,
html[data-color-scheme="light"] {
  --color-background-page: 242 246 251;
  --color-background-surface: 255 255 255;
  --color-background-surface-muted: 248 250 252;
  --color-background-surface-elevated: 255 255 255;
  --color-text-primary: 15 23 42;
  --color-text-muted: 96 112 135;
  --color-text-link: 67 56 202;
  --color-border-default: 226 232 240;
  --color-border-strong: 203 213 225;
  --color-accent-subtle: 238 242 255;
  --elevation-medium: 0 10px 15px rgb(0 0 0 / 0.1);
}

html[data-color-scheme="dark"] {
  --color-background-page: 15 23 42;
  --color-background-surface: 30 41 59;
  --color-background-surface-muted: 39 51 70;
  --color-background-surface-elevated: 51 65 85;
  --color-text-primary: 248 250 252;
  --color-text-muted: 148 163 184;
  --color-text-link: 199 210 254;
  --color-border-default: 71 85 105;
  --color-border-strong: 100 116 139;
  --color-accent-subtle: 55 48 107;
  --elevation-medium: 0 8px 24px rgb(0 0 0 / 0.35);
}

body {
  background: rgb(var(--color-background-page)) !important;
  color: rgb(var(--color-text-primary)) !important;
}

main > section,
main > article {
  background: rgb(var(--color-background-surface)) !important;
  border-color: rgb(var(--color-border-default)) !important;
  box-shadow: var(--elevation-medium) !important;
}

.muted {
  color: rgb(var(--color-text-muted)) !important;
}

.box {
  border-color: rgb(var(--color-border-strong)) !important;
  background: rgb(var(--color-accent-subtle)) !important;
}

a {
  color: rgb(var(--color-text-link)) !important;
}

.public-appearance {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgb(var(--color-border-default));
  border-radius: 999px;
  background: rgb(var(--color-background-surface));
  box-shadow: var(--elevation-medium);
  font:
    600 12px/1 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.public-appearance span {
  padding: 0 6px 0 8px;
  color: rgb(var(--color-text-muted));
}

.public-appearance button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 9px;
  background: transparent;
  color: rgb(var(--color-text-primary));
  font: inherit;
  cursor: pointer;
}

.public-appearance button:hover {
  background: rgb(var(--color-background-surface-elevated));
}

.public-appearance button[aria-pressed="true"] {
  background: rgb(var(--color-accent-subtle));
}

.public-appearance button:focus-visible {
  outline: 2px solid rgb(var(--color-text-link));
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .public-appearance {
    position: static;
    width: fit-content;
    margin: 12px 12px 0 auto;
  }

  main {
    padding-top: 20px !important;
  }
}
