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

html {
  min-height: 100%;
  font-size: 16px;
  background: var(--rm-background);
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--rm-text);
  background-color: var(--rm-background);
  background-image: var(--rm-canvas-glow);
  background-attachment: fixed;
  font-family: var(--rm-font-sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.rm-scroll-locked {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

main,
header,
footer,
nav,
section,
article,
aside {
  min-width: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--rm-text);
  font-family: var(--rm-font-display);
  font-weight: 700;
  letter-spacing: -0.018em;
}

h1 {
  font-size: clamp(1.65rem, 1.25rem + 1vw, 2.35rem);
  line-height: 1.12;
}

h2 {
  font-size: clamp(1.25rem, 1.05rem + 0.5vw, 1.65rem);
  line-height: 1.2;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.3;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--rm-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--rm-accent-strong);
}

:focus-visible {
  outline: var(--rm-focus-width) solid rgba(var(--rm-focus-ring-rgb), 0.48);
  outline-offset: 3px;
}

::selection {
  color: var(--rm-on-accent);
  background: var(--rm-accent);
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

svg {
  flex: 0 0 auto;
}

code,
kbd,
samp,
pre {
  font-family: var(--rm-font-mono);
}

code {
  color: var(--rm-accent-strong);
  overflow-wrap: anywhere;
}

pre {
  color: var(--rm-text);
  background: var(--rm-surface-soft);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  scrollbar-color: var(--rm-border-strong) transparent;
}

hr {
  color: var(--rm-border);
  opacity: 1;
}

::placeholder {
  color: var(--rm-text-muted);
}

* {
  scrollbar-color: var(--rm-border-strong) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 0.7rem;
  height: 0.7rem;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--rm-border-strong);
  border: 0.2rem solid transparent;
  border-radius: var(--rm-radius-pill);
  background-clip: padding-box;
}

:target {
  scroll-margin-top: calc(var(--rm-topbar-height) + var(--rm-space-4));
}

.rm-skip-link {
  position: fixed;
  top: var(--rm-space-3);
  left: var(--rm-space-3);
  z-index: calc(var(--rm-z-dialog) + 1);
  padding: var(--rm-space-3) var(--rm-space-4);
  color: var(--rm-on-accent);
  background: var(--rm-accent);
  border-radius: var(--rm-radius-sm);
  box-shadow: var(--rm-shadow-md);
  transform: translateY(calc(-100% - var(--rm-space-6)));
}

.rm-skip-link:focus {
  color: var(--rm-on-accent);
  transform: translateY(0);
}

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

.rm-text-accent {
  color: var(--rm-accent) !important;
}

.rm-surface {
  color: var(--rm-text);
  background: var(--rm-surface);
}

.rm-surface-soft {
  color: var(--rm-text);
  background: var(--rm-surface-soft);
}

.rm-readable {
  max-width: var(--rm-reading-max);
}

.rm-visually-truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-mono {
  font-family: var(--rm-font-mono);
}

@media print {
  html,
  body {
    color: #000000 !important;
    background: #ffffff !important;
  }

  .rm-no-print,
  .rm-sidebar,
  .rm-topbar,
  .rm-toast-region,
  .rm-sidebar-backdrop {
    display: none !important;
  }
}
