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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--page);
  color: var(--text-primary);
}

html {
  font-family: var(--font-ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
}

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

button {
  border: 0;
}

button,
[role="button"],
[role="menuitem"],
[role="menuitemradio"],
[role="option"],
[role="switch"] {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
[role="menuitem"]:not([aria-disabled="true"]),
[role="menuitemradio"]:not([aria-disabled="true"]),
[role="option"],
[role="switch"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
[contenteditable="true"]:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

::selection {
  background: rgb(44 132 219 / 22%);
}

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

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

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-primary) 20%, transparent);
  background-clip: content-box;
}

[data-auto-scrollbar] {
  position: relative;
  overflow-y: auto;
  scrollbar-gutter: auto;
  scrollbar-color: transparent transparent;
}

[data-auto-scrollbar]::after {
  position: fixed;
  z-index: 1;
  top: var(--auto-scrollbar-thumb-top, -100px);
  left: var(--auto-scrollbar-thumb-left, -100px);
  width: 4px;
  height: var(--auto-scrollbar-thumb-size, 24px);
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-primary) 18%, transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms var(--ease-standard);
}

[data-auto-scrollbar][data-scrollable="true"][data-scrolling="true"]::after,
[data-auto-scrollbar][data-scrollable="true"]:hover::after {
  opacity: .82;
}

[data-auto-scrollbar]::-webkit-scrollbar {
  width: 8px;
}

[data-auto-scrollbar]::-webkit-scrollbar-track {
  background: transparent;
}

[data-auto-scrollbar]::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  background-clip: content-box;
}

[data-auto-scrollbar][data-scrolling="true"],
[data-auto-scrollbar]:hover {
  scrollbar-color: transparent transparent;
}

[data-auto-scrollbar][data-scrolling="true"]::-webkit-scrollbar-thumb,
[data-auto-scrollbar]:hover::-webkit-scrollbar-thumb {
  background-color: transparent;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 50%;
  transform: translate(-50%, -60px);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  box-shadow: var(--shadow-menu);
  transition: transform 120ms var(--ease-standard);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  line-height: 0;
  flex: 0 0 auto;
  color: currentColor;
  font-size: 18px;
  font-variation-settings: "wght" 500, "opsz" 24, "ANIM" 0, "ANM2" 0;
  font-synthesis: none;
  transition: font-variation-settings 80ms var(--ease-standard);
  vertical-align: middle;
}

button:hover .icon,
[role="button"]:hover .icon,
[role="menuitem"]:hover .icon,
[role="menuitemradio"]:hover .icon,
button:focus-visible .icon,
[role="button"]:focus-visible .icon,
[role="menuitem"]:focus-visible .icon,
[role="menuitemradio"]:focus-visible .icon {
  font-variation-settings: "wght" 500, "opsz" 24, "ANIM" 100, "ANM2" 0;
}

button:active .icon,
[role="button"]:active .icon,
[role="menuitem"]:active .icon,
[role="menuitemradio"]:active .icon {
  font-variation-settings: "wght" 500, "opsz" 24, "ANIM" 0, "ANM2" 100;
}

.icon--xs {
  width: 14px;
  height: 14px;
  font-size: 14px;
}

/* 11px 箭头 token：比 icon--xs 小 3px，用于 sidebar/disclosure 折叠箭头 */
.icon--xxs {
  width: 11px;
  height: 11px;
  font-size: 11px;
}

/* 自定义内联 SVG 图标：随 .icon 尺寸类缩放 */
.icon--custom svg {
  width: 100%;
  height: 100%;
  display: block;
}

.icon--unregistered {
  opacity: 0.72;
}

.icon--sm {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.icon--lg {
  width: 20px;
  height: 20px;
  font-size: 20px;
}

.icon--xl {
  width: 24px;
  height: 24px;
  font-size: 24px;
}

.boot-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--text-muted);
  background: var(--page);
  font-size: 13px;
}

.boot-wordmark {
  display: block;
  width: 112px;
  height: 23px;
  background: currentColor;
  -webkit-mask: var(--kalamos-wordmark-mask) center / contain no-repeat;
  mask: var(--kalamos-wordmark-mask) center / contain no-repeat;
  animation: boot-pulse 1.4s ease-in-out infinite;
}

/* Quiet placeholders only while real data is pending; never simulated progress. */
.loading-skeleton { display: grid; gap: 12px; width: 100%; padding: 20px; }
.loading-skeleton > span { display: block; height: 10px; border-radius: 5px; background: var(--surface-hover); animation: skeleton-breathe 1.8s ease-in-out infinite; }
.loading-skeleton > span:nth-child(2) { width: 86%; }
.loading-skeleton > span:nth-child(3) { width: 62%; }
.boot-skeleton { width: min(260px, 65vw); padding-top: 10px; }
@keyframes skeleton-breathe { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loading-skeleton > span { animation: none; } }
html[data-reduce-motion="true"] .loading-skeleton > span { animation: none; }

@keyframes boot-pulse {
  0%,
  100% { opacity: .62; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-wordmark { animation: none; opacity: 1; }
}

.divider {
  height: 1px;
  background: var(--border);
}

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

.faint {
  color: var(--text-faint);
}

.clay {
  color: var(--clay);
}

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

.voice-font {
  font-family: var(--font-voice);
}
