:root {
  --bg: #101313;
  --surface: #171b1b;
  --surface-raised: #1d2321;
  --surface-soft: #252c29;
  --ink: #f5f6ef;
  --muted: #a4ada7;
  --faint: #737d77;
  --line: #2d3733;
  --line-strong: #46524c;
  --accent: #d8f35d;
  --accent-strong: #e3fa72;
  --accent-ink: #10150f;
  --warning: #ff9278;
  --warning-border: rgb(255 146 120 / 24%);
  --warning-surface: rgb(255 146 120 / 7%);
  --danger: #ff8179;
  --danger-border: rgb(240 104 98 / 40%);
  --success: #86dfab;
  --shadow: 0 24px 80px rgb(0 0 0 / 42%);
  --radius: 8px;
  --font-ui: "Space Grotesk", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --leading-tight: 1.3;
  --leading-body: 1.55;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --touch-target: 44px;
  color-scheme: dark;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.scroll-container {
  scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.global-scrollbar {
  position: fixed;
  z-index: 30;
  display: block;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
}

.global-scrollbar-anchor {
  position: relative;
}

.global-scrollbar-local {
  position: absolute;
  z-index: 3;
}

.global-scrollbar::before {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgb(141 152 147 / 13%);
}

.global-scrollbar-x::before {
  inset: 2px 0;
}

.global-scrollbar-y::before {
  inset: 0 2px;
}

.global-scrollbar-thumb {
  display: block;
  position: absolute;
  border-radius: 999px;
  background: rgb(141 152 147 / 58%);
  will-change: transform;
}

.global-scrollbar-x .global-scrollbar-thumb {
  top: 2px;
}

.global-scrollbar-y .global-scrollbar-thumb {
  right: 2px;
}

.global-scrollbar[hidden] {
  display: none;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  touch-action: manipulation;
  overscroll-behavior-x: none;
  color: var(--ink);
  background: var(--bg);
}

body:has(.app-dialog[open]) {
  overflow: hidden;
}

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

button {
  padding: 0;
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea {
  -webkit-appearance: none;
  appearance: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

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

.hidden {
  display: none !important;
}

#app {
  width: min(100%, 580px);
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: rgb(16 19 19 / 94%);
  border-inline: 1px solid rgb(255 255 255 / 6%);
}

.mono-label,
.eyebrow {
  color: var(--accent);
  font: 500 var(--text-xs)/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  50% { opacity: .5; }
}