/* =========================================================
   modelmesh.top — base system
   ========================================================= */

:root {
  --bg: #08090c;
  --bg-soft: #0b0d12;
  --panel: #111319;
  --panel-2: #151821;
  --panel-3: #1a1e28;
  --code-bg: #0c0e14;
  --border: #232734;
  --border-soft: #1b1e28;
  --border-strong: #30364a;
  --text: #e6e9f2;
  --text-soft: #c1c7d6;
  --muted: #8a93a6;
  --muted-2: #646d80;
  --purple: #7c6bff;
  --purple-soft: rgba(124, 107, 255, 0.12);
  --purple-line: rgba(124, 107, 255, 0.32);
  --teal: #23d5ab;
  --teal-soft: rgba(35, 213, 171, 0.09);
  --teal-line: rgba(35, 213, 171, 0.28);
  --amber: #e4b15c;
  --amber-soft: rgba(228, 177, 92, 0.1);
  --red: #f0747a;
  --red-soft: rgba(240, 116, 122, 0.1);
  --blue: #5c96ff;
  --blue-soft: rgba(92, 150, 255, 0.1);
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 13px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --wire: 1240px;
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.24);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 82% -6%, rgba(124, 107, 255, 0.08), transparent 66%),
    radial-gradient(760px 460px at 5% 24%, rgba(35, 213, 171, 0.035), transparent 70%),
    linear-gradient(180deg, #08090c 0%, #08090c 58%, #090b0f 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  background-image: radial-gradient(rgba(230, 233, 242, 0.3) 0.55px, transparent 0.55px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 40%, transparent 78%, rgba(0, 0, 0, 0.35));
}

::selection {
  color: #fff;
  background: rgba(124, 107, 255, 0.48);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #0b0d12;
}
::-webkit-scrollbar-thumb {
  background: #2b3040;
  border: 2px solid #0b0d12;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a4155;
}

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

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

button {
  color: inherit;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
}

p {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--bg);
  background: var(--teal);
  font-weight: 650;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: none;
}

/* ---------- Layout ---------- */

.wrap {
  width: min(var(--wire), calc(100% - 48px));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(960px, calc(100% - 48px));
  margin-inline: auto;
}

.wrap--docs {
  width: min(1360px, calc(100% - 48px));
}

main {
  min-height: 68vh;
}

.section {
  padding: 88px 0;
  position: relative;
}

.section--tight {
  padding: 60px 0;
}

.section--border {
  border-top: 1px solid var(--border-soft);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 38px;
}

.section-head__copy {
  max-width: 680px;
}

.section-head h2 {
  margin-top: 13px;
  font-size: clamp(30px, 3.4vw, 46px);
  letter-spacing: -0.045em;
}

.section-head p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 620px;
}

.section-head__side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, var(--purple), var(--teal));
}

.eyebrow--plain::before {
  display: none;
}

.eyebrow .eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(35, 213, 171, 0.08);
}

.section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.gradient-text {
  color: transparent;
  background: linear-gradient(105deg, #a89dff 0%, #8f82ff 40%, #54e1c1 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

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

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

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

.small {
  font-size: 12.5px;
}

.tiny {
  font-size: 11px;
}

.nowrap {
  white-space: nowrap;
}

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

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--btn-bd);
  border-radius: 9px;
  color: var(--btn-fg);
  background: var(--btn-bg);
  font-size: 13.5px;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.btn svg {
  flex: 0 0 auto;
}

.btn:hover {
  border-color: #455069;
  background: rgba(255, 255, 255, 0.035);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.46;
  pointer-events: none;
}

.btn-primary {
  --btn-fg: #fff;
  --btn-bd: transparent;
  background: linear-gradient(135deg, #7c6bff 0%, #6959f5 100%);
  box-shadow: 0 8px 24px rgba(124, 107, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #8b7cff 0%, #7565ff 100%);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(124, 107, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-teal {
  --btn-fg: #041612;
  --btn-bd: transparent;
  background: #23d5ab;
  box-shadow: 0 8px 28px rgba(35, 213, 171, 0.15);
}
.btn-teal:hover {
  background: #35e2b9;
  border-color: transparent;
}

.btn-outline {
  --btn-bd: #2c3243;
  background: rgba(17, 19, 25, 0.6);
}
.btn-outline:hover {
  --btn-bd: #414a61;
  background: #171a23;
}

.btn-ghost {
  --btn-bd: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border-color: transparent;
}

.btn-sm {
  min-height: 33px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 7px;
  gap: 6px;
}

.btn-lg {
  min-height: 48px;
  padding: 0 21px;
  font-size: 14.5px;
  border-radius: 10px;
}

.btn-icon {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
}

.btn .btn-arrow {
  transition: transform 0.18s var(--ease);
}
.btn:hover .btn-arrow {
  transform: translateX(2px);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 540;
  transition: color 0.18s;
}
.link-arrow svg {
  transition: transform 0.18s var(--ease);
}
.link-arrow:hover {
  color: var(--text);
}
.link-arrow:hover svg {
  transform: translateX(3px);
}

.link-teal {
  color: var(--teal);
}
.link-teal:hover {
  color: #61e8c6;
}

/* ---------- Badges, chips, dots ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--success {
  color: #6ee7c5;
  border-color: rgba(35, 213, 171, 0.2);
  background: var(--teal-soft);
}
.badge--purple {
  color: #b0a8ff;
  border-color: rgba(124, 107, 255, 0.25);
  background: var(--purple-soft);
}
.badge--amber {
  color: #f0c67a;
  border-color: rgba(228, 177, 92, 0.22);
  background: var(--amber-soft);
}
.badge--red {
  color: #ff9da2;
  border-color: rgba(240, 116, 122, 0.22);
  background: var(--red-soft);
}
.badge--blue {
  color: #91b8ff;
  border-color: rgba(92, 150, 255, 0.22);
  background: var(--blue-soft);
}
.badge--muted {
  color: var(--muted-2);
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.02);
}
.badge--outline {
  background: transparent;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
  flex: 0 0 auto;
}

.dot--pulse {
  animation: dot-pulse 2.2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 10%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 3%, transparent); }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11.5px;
  line-height: 1;
  white-space: nowrap;
}
.chip--accent {
  color: #c3bdff;
  border-color: rgba(124, 107, 255, 0.2);
  background: rgba(124, 107, 255, 0.08);
}
.chip--teal {
  color: #76e9cc;
  border-color: rgba(35, 213, 171, 0.2);
  background: rgba(35, 213, 171, 0.06);
}
.chip--button {
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.chip--button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}
.chip__x {
  display: inline-flex;
  color: var(--muted-2);
}
.chip__x:hover {
  color: var(--red);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.provider-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--provider-color, var(--muted)) 22%, var(--border));
  border-radius: 7px;
  color: var(--provider-color, var(--muted));
  background: color-mix(in srgb, var(--provider-color, var(--muted)) 8%, transparent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.provider-mark--sm {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 7.5px;
}
.provider-mark--lg {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 12px;
}

/* ---------- Panels, forms ---------- */

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel--raised {
  box-shadow: var(--shadow-md);
  background: linear-gradient(160deg, rgba(21, 24, 33, 0.95), rgba(15, 17, 23, 0.98));
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 51px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-head h3 {
  font-size: 14px;
  font-weight: 580;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field + .field {
  margin-top: 18px;
}

.field label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 540;
}

.field-hint {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.field-error {
  color: #ff969b;
  font-size: 12px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #0d0f15;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.input::placeholder,
.textarea::placeholder {
  color: #565f72;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #30364a;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--purple-line);
  box-shadow: 0 0 0 3px rgba(124, 107, 255, 0.08);
  background: #0f1118;
}

.input--mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A93A6' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

.textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.55;
}

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input {
  border-radius: 8px 0 0 8px;
}
.input-group .btn {
  border-radius: 0 8px 8px 0;
  border-left: 0;
}

.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}
.check input,
.radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.check__box {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #0d0f15;
  transition: all 0.16s;
  position: relative;
}
.check input:checked + .check__box {
  border-color: var(--purple);
  background: var(--purple);
}
.check input:checked + .check__box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}
.check input:focus-visible + .check__box {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}
.check a {
  color: var(--text-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.range {
  width: 100%;
  height: 4px;
  margin: 12px 0;
  appearance: none;
  border-radius: 99px;
  background: linear-gradient(to right, var(--purple) var(--fill, 40%), #252a38 var(--fill, 40%));
  outline: none;
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #0d0f15;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(124, 107, 255, 0.7);
}
.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #0d0f15;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(124, 107, 255, 0.7);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch__track {
  position: relative;
  width: 33px;
  height: 19px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: #191d27;
  transition: all 0.18s;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.18s var(--ease);
}
.switch input:checked + .switch__track {
  border-color: rgba(35, 213, 171, 0.5);
  background: rgba(35, 213, 171, 0.14);
}
.switch input:checked + .switch__track::after {
  left: 16px;
  background: var(--teal);
}
.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8, 9, 12, 0.78);
  backdrop-filter: blur(18px) saturate(130%);
  transition: background 0.2s, border-color 0.2s;
}

.site-header.is-compact {
  background: rgba(8, 9, 12, 0.92);
  border-color: var(--border);
}

.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
  transition: height 0.22s var(--ease);
}

.site-header.is-compact .header-inner {
  height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 640;
  letter-spacing: -0.04em;
}
.brand__mark {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 107, 255, 0.28);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(124, 107, 255, 0.16), rgba(35, 213, 171, 0.06));
}
.brand__mark svg {
  width: 17px;
  height: 17px;
}
.brand__domain {
  color: var(--muted-2);
  font-weight: 480;
  letter-spacing: -0.03em;
}
.brand:hover .brand__domain {
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.16s, background 0.16s;
}
.site-nav__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.site-nav__link.is-active {
  color: var(--text);
}
.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  bottom: -19px;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--teal);
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(35, 213, 171, 0.8);
}
.site-header.is-compact .site-nav__link.is-active::after {
  bottom: -13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
}
.lang-toggle button {
  min-width: 28px;
  height: 25px;
  padding: 0 6px;
  border-radius: 5px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  transition: all 0.16s;
}
.lang-toggle button:hover {
  color: var(--text);
}
.lang-toggle button.is-active {
  color: var(--text);
  background: #232735;
}

.header-login {
  color: var(--muted);
  font-size: 12.5px;
  padding: 8px 8px;
}
.header-login:hover {
  color: var(--text);
}

.user-menu {
  position: relative;
}
.user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 3px 8px 3px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.user-menu__trigger:hover {
  border-color: var(--border-strong);
  background: #151821;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 6px;
  color: #fff;
  background: var(--avatar-color, var(--purple));
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.avatar--lg {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  font-size: 16px;
}
.user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 210px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12151c;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.16s var(--ease);
}
.user-menu.is-open .user-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.user-menu__email {
  padding: 9px 10px 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: left;
}
.user-menu__item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}
.user-menu__separator {
  height: 1px;
  margin: 5px 0;
  background: var(--border-soft);
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 10px 24px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 17, 0.98);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.4);
}
.mobile-nav.is-open {
  display: block;
}
.mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  font-size: 14px;
}
.mobile-nav__link.is-active {
  color: var(--text);
}
.mobile-nav__actions {
  display: flex;
  gap: 10px;
  padding-top: 16px;
}
.mobile-nav__actions .btn {
  flex: 1;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  background: #0a0b10;
}

.footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border-soft);
}
.footer-cta h2 {
  font-size: clamp(24px, 3vw, 34px);
}
.footer-cta p {
  max-width: 560px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
}
.footer-cta__actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 49px 0 42px;
}
.footer-brand p {
  max-width: 300px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}
.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 5px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
}
.footer-status .dot {
  color: var(--teal);
  width: 5px;
  height: 5px;
}
.footer-col h4 {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 16px;
}
.footer-col a {
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.16s;
}
.footer-col a:hover {
  color: var(--text);
}
.footer-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 0 24px;
  border-top: 1px solid var(--border-soft);
}
.footer-bottom__legal {
  max-width: 760px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.7;
}
.footer-bottom__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-align: right;
}
.footer-lang {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.footer-lang button {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
}
.footer-lang button:hover,
.footer-lang button.is-active {
  color: var(--text);
}

/* ---------- General page hero ---------- */

.page-hero {
  position: relative;
  padding: 66px 0 44px;
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 8%;
  width: 520px;
  height: 360px;
  border-radius: 50%;
  background: rgba(124, 107, 255, 0.06);
  filter: blur(100px);
  pointer-events: none;
}
.page-hero__inner {
  position: relative;
}
.page-hero h1 {
  max-width: 830px;
  margin-top: 17px;
  font-size: clamp(34px, 4.4vw, 58px);
  letter-spacing: -0.05em;
}
.page-hero__lede {
  max-width: 680px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}
.page-hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 23px;
}
.page-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}
.breadcrumb a {
  color: var(--muted);
  transition: color 0.16s;
}
.breadcrumb a:hover {
  color: var(--text);
}
.breadcrumb span {
  color: var(--muted-2);
}

/* ---------- Toast / modal ---------- */

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--text-soft);
  background: rgba(20, 23, 31, 0.98);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toast-in 0.25s var(--ease) both;
}
.toast.is-leaving {
  animation: toast-out 0.2s ease both;
}
.toast__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 5px;
  color: var(--teal);
  background: rgba(35, 213, 171, 0.1);
}
.toast--error .toast__icon {
  color: var(--red);
  background: var(--red-soft);
}
.toast--info .toast__icon {
  color: var(--blue);
  background: var(--blue-soft);
}
.toast__close {
  margin-left: auto;
  color: var(--muted-2);
}
.toast__close:hover {
  color: var(--text);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 7, 0.75);
  backdrop-filter: blur(8px);
  animation: fade-in 0.18s ease both;
}
.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: min(84vh, 900px);
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #11141b;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.22s var(--ease) both;
}
.modal--wide {
  width: min(760px, 100%);
}
.modal--key {
  width: min(590px, 100%);
}
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 22px 17px;
  border-bottom: 1px solid var(--border-soft);
}
.modal__head h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
}
.modal__head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  max-width: 440px;
}
.modal__close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
}
.modal__close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.modal__body {
  padding: 21px 22px;
}
.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 22px;
  border-top: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.012);
}
.modal__body > .callout + .field {
  margin-top: 18px;
}
@keyframes fade-in {
  from { opacity: 0; }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ---------- Callouts / notices ---------- */

.callout {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font-size: 12.5px;
  line-height: 1.6;
}
.callout svg {
  flex: 0 0 auto;
  margin-top: 1px;
}
.callout--info {
  border-color: rgba(92, 150, 255, 0.2);
  background: rgba(92, 150, 255, 0.045);
}
.callout--info svg {
  color: var(--blue);
}
.callout--success {
  border-color: rgba(35, 213, 171, 0.2);
  background: rgba(35, 213, 171, 0.045);
}
.callout--success svg {
  color: var(--teal);
}
.callout--warning {
  border-color: rgba(228, 177, 92, 0.22);
  background: rgba(228, 177, 92, 0.05);
}
.callout--warning svg {
  color: var(--amber);
}
.callout--error {
  border-color: rgba(240, 116, 122, 0.24);
  background: rgba(240, 116, 122, 0.05);
}
.callout--error svg {
  color: var(--red);
}
.callout strong {
  color: var(--text-soft);
  font-weight: 600;
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12.5px;
}
.notice-bar--teal {
  border-color: rgba(35, 213, 171, 0.18);
  background: rgba(35, 213, 171, 0.04);
}
.notice-bar > svg {
  flex: 0 0 auto;
  color: var(--teal);
}
.notice-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

/* ---------- Empty states ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 42px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
}
.empty-state__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  background: var(--panel);
}
.empty-state h3 {
  font-size: 18px;
}
.empty-state p {
  max-width: 450px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.empty-state__actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 19px;
}

/* ---------- Skeletons ---------- */

.skeleton {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: linear-gradient(100deg, #111319 30%, #191d26 50%, #111319 70%);
  background-size: 200% 100%;
  animation: shimmer 1.7s infinite linear;
}
.skeleton-card {
  height: 252px;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------- Utility ---------- */

.stack {
  display: flex;
  flex-direction: column;
}
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.row {
  display: flex;
  align-items: center;
}
.between {
  justify-content: space-between;
}
.wrap-flex {
  flex-wrap: wrap;
}
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.hidden { display: none !important; }
.icon-muted { color: var(--muted); }
.tone-red { color: var(--red); }
.tone-teal { color: var(--teal); }
.tone-purple { color: var(--purple); }
.tone-amber { color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
