:root {
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #647083;
  --line: #d1d1d6;
  --border: #e5e5ea;
  --surface-soft: #f2f2f7;
  --surface-soft-alt: #f5f5f7;
  --surface-soft-strong: #ebebf0;
  --accent: #1f5fbf;
  --accent-soft: #f2f2f7;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --page-background: var(--bg);
}

html.force-light {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #647083;
  --line: #d1d1d6;
  --border: #e5e5ea;
  --surface-soft: #f2f2f7;
  --surface-soft-alt: #f5f5f7;
  --surface-soft-strong: #ebebf0;
  --accent: #1f5fbf;
  --accent-soft: #f2f2f7;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  --page-background: var(--bg);
}

html.force-dark {
  --bg: #1c1c1e;
  --panel: #2c2c2e;
  --text: #e8eef8;
  --muted: #a7b4c7;
  --line: #636366;
  --border: #3a3a3c;
  --surface-soft: #2c2c2e;
  --surface-soft-alt: #2a2a2c;
  --surface-soft-strong: #3a3a3c;
  --accent: #7db1ff;
  --accent-soft: #2c2c2e;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  --page-background: var(--bg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  background: var(--page-background);
}

body {
  min-height: 100vh;
  margin: 0;
  font: 16px/1.5 var(--font-base);
  color: var(--text);
  background: var(--page-background);
  overflow-wrap: break-word;
  word-wrap: break-word;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.layout {
  margin-top: var(--page-section-gap, 24px);
}

em {
  color: var(--muted);
}

.asterisk-fn {
  --asterisk-fn-indent: 2.5ex;
  --asterisk-fn-rule: color-mix(in srgb, var(--border) 45%, var(--muted));
  --asterisk-fn-rule-offset: 0.55em;
  --asterisk-fn-rule-gap: 0.275em;
  width: 100%;
  max-width: 60ch;
  justify-self: start;
  color: var(--muted);
  position: relative;
  padding-top: calc(var(--asterisk-fn-rule-offset) + var(--asterisk-fn-rule-gap));
  padding-left: var(--asterisk-fn-indent);
}

.asterisk-fn::before {
  content: "";
  position: absolute;
  top: var(--asterisk-fn-rule-offset);
  left: 0;
  width: 10ex;
  border-top: 1px solid var(--asterisk-fn-rule);
}

.asterisk-fn::after {
  content: "*";
  position: absolute;
  top: calc(var(--asterisk-fn-rule-offset) + var(--asterisk-fn-rule-gap));
  left: 0;
}

button,
.pill {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
}

button:hover {
  cursor: pointer;
}

button.active-filter {
  background: var(--accent-soft);
  border-color: var(--border);
  color: var(--text);
}

.hidden {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --panel: #2c2c2e;
    --text: #e8eef8;
    --muted: #a7b4c7;
    --line: #636366;
    --border: #3a3a3c;
    --surface-soft: #2c2c2e;
    --surface-soft-alt: #2a2a2c;
    --surface-soft-strong: #3a3a3c;
    --accent: #7db1ff;
    --accent-soft: #2c2c2e;
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    --page-background: var(--bg);
  }

  html {
    color-scheme: dark;
  }

  button,
  .pill {
    background: var(--panel);
    border-color: var(--border);
    color: var(--text);
  }

  button.active-filter {
    background: var(--accent-soft);
    border-color: var(--border);
    color: var(--text);
  }
}
