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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.5;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, ol, ul {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

input, textarea, select {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(var(--accent-rgb), 0.3);
  color: var(--white);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-4) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border: 3px solid transparent;
  border-radius: 10px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--surface-4);
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.display em {
  font-style: italic;
  color: var(--accent);
}

.flag {
  flex: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.lang-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
  transition: background-color var(--dur-2), color var(--dur-2);
}

.lang-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: normal;
}

.muted {
  color: var(--text-2);
}

.subtle {
  color: var(--text-3);
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

kbd, .kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 var(--line-2), 0 0 0 1px var(--line);
  color: var(--text-2);
  font: 500 11px/1 var(--font-sans);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}

.enter {
  animation: rise-in var(--dur-4) var(--ease-out) both;
}

.stagger > * {
  animation: rise-in var(--dur-4) var(--ease-out) both;
}

.stagger > :nth-child(1) { animation-delay: 0ms; }
.stagger > :nth-child(2) { animation-delay: 40ms; }
.stagger > :nth-child(3) { animation-delay: 80ms; }
.stagger > :nth-child(4) { animation-delay: 120ms; }
.stagger > :nth-child(5) { animation-delay: 160ms; }
.stagger > :nth-child(6) { animation-delay: 200ms; }
.stagger > :nth-child(7) { animation-delay: 240ms; }
.stagger > :nth-child(8) { animation-delay: 280ms; }
.stagger > :nth-child(n + 9) { animation-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}

.is-reduced-motion *, .is-reduced-motion *::before, .is-reduced-motion *::after {
  animation-duration: 1ms !important;
  animation-delay: 0ms !important;
  transition-duration: 1ms !important;
  scroll-behavior: auto !important;
}

[data-density='compact'] .nav-item {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
}

[data-density='compact'] .page {
  padding-top: 20px;
}

[data-density='compact'] .page-head {
  margin-bottom: 18px;
}

[data-density='compact'] .settings-row {
  padding-top: 11px;
  padding-bottom: 11px;
}

[data-density='compact'] .row {
  min-height: 38px;
  padding-top: 6px;
  padding-bottom: 6px;
}

[data-density='compact'] .section-title {
  margin-top: 22px;
  margin-bottom: 10px;
}
