/* ==========================================================================
   营销体系 · Design system
   ========================================================================== */

:root {
  --bg: #070a11;
  --bg-soft: #0b1020;
  --surface: rgba(17, 24, 39, 0.76);
  --surface-solid: #111827;
  --surface-2: #151d30;
  --surface-3: #1a2338;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f6fb;
  --muted: #8d99ad;
  --muted-2: #667389;
  --gold: #e8c372;
  --gold-light: #f8e7b8;
  --gold-deep: #a9772f;
  --silver: #cbd6e4;
  --silver-light: #f0f5fc;
  --silver-deep: #78869b;
  --green: #49d6a3;
  --red: #ff7f8d;
  --blue: #7fa8ff;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 11px;
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.48);
  --shadow-md: 0 16px 44px rgba(0, 0, 0, 0.32);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas,
    monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% -8%, rgba(232, 195, 114, 0.12), transparent 34%),
    radial-gradient(circle at 92% 2%, rgba(89, 122, 207, 0.16), transparent 38%),
    radial-gradient(circle at 50% 110%, rgba(66, 48, 110, 0.18), transparent 42%),
    linear-gradient(180deg, #070a11 0%, #080d17 42%, #06090f 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 74%);
}

body.modal-open {
  overflow: hidden;
}

::selection {
  color: #171006;
  background: var(--gold);
}

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

button {
  color: inherit;
}

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

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

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

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

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

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.gold-text {
  background: linear-gradient(120deg, var(--gold-light), var(--gold) 45%, #b98438);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ==========================================================================
   Boot
   ========================================================================== */

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fade-up 0.6s ease both;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: var(--gold);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(232, 195, 114, 0.2), transparent 64%),
    rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(232, 195, 114, 0.34);
  box-shadow: 0 0 42px rgba(232, 195, 114, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-mark svg {
  width: 38px;
  height: 38px;
}

.boot-name {
  margin-top: 7px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.boot-sub {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.32em;
}

.boot-loader {
  width: 120px;
  height: 2px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.boot-loader::after {
  content: "";
  display: block;
  width: 48%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: loading-slide 1.15s ease-in-out infinite;
}

/* ==========================================================================
   Brand / avatar / chips
   ========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.brand .brand-mark svg {
  width: 28px;
  height: 28px;
}

.brand-word {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-word strong {
  font-size: 16px;
  letter-spacing: 0.12em;
}

.brand-word span {
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  isolation: isolate;
}

.avatar .icon {
  width: 19px;
  height: 19px;
}

.avatar-gold {
  color: #35230a;
  background: linear-gradient(145deg, #f9e8bb 0%, #e8c372 42%, #c59445 74%, #9c6d2b 100%);
  box-shadow:
    0 0 0 1px rgba(255, 235, 184, 0.5),
    0 6px 18px rgba(232, 195, 114, 0.24),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.avatar-gold::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(232, 195, 114, 0.22);
  border-radius: inherit;
  z-index: -1;
}

.avatar-silver {
  color: #192333;
  background: linear-gradient(145deg, #f4f8ff 0%, #cbd6e4 40%, #97a6ba 72%, #6e7c90 100%);
  box-shadow:
    0 0 0 1px rgba(231, 239, 250, 0.45),
    0 6px 18px rgba(148, 165, 190, 0.16),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.avatar-lg {
  width: 50px;
  height: 50px;
  border-radius: 17px;
}

.avatar-lg .icon {
  width: 25px;
  height: 25px;
}

.avatar-hero {
  width: 70px;
  height: 70px;
  border-radius: 23px;
}

.avatar-hero .icon {
  width: 33px;
  height: 33px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.role-gold {
  color: #332208;
  background: linear-gradient(120deg, #f5dfa3, #e8c372 55%, #c7964a);
  box-shadow: 0 2px 10px rgba(232, 195, 114, 0.22);
}

.role-silver {
  color: #1e293b;
  background: linear-gradient(120deg, #f2f7ff, #cbd6e4 55%, #9dabbd);
}

/* ==========================================================================
   Buttons / forms
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.99);
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.btn-primary {
  color: #201607;
  background: linear-gradient(135deg, #f8e7b8 0%, #e8c372 45%, #c99747 100%);
  border-color: rgba(255, 238, 190, 0.42);
  box-shadow:
    0 10px 26px rgba(201, 151, 71, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--line-strong);
}

.btn-outline-gold {
  color: var(--gold);
  background: rgba(232, 195, 114, 0.07);
  border-color: rgba(232, 195, 114, 0.3);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ff8f9c, #d94d61);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-danger-ghost {
  color: var(--red);
  background: rgba(255, 127, 141, 0.06);
  border-color: rgba(255, 127, 141, 0.2);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12px;
}

.btn-lg {
  min-height: 52px;
  border-radius: 15px;
  font-size: 15px;
}

.btn.is-loading {
  pointer-events: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  transition: 0.18s ease;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.icon-button .icon {
  width: 18px;
  height: 18px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.22);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-ghost .spinner,
.btn-outline-gold .spinner {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #c2cbd9;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field-label .optional {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 400;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(8, 12, 20, 0.58);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.input-wrap:focus-within {
  border-color: rgba(232, 195, 114, 0.5);
  background: rgba(12, 17, 28, 0.86);
  box-shadow: 0 0 0 3px rgba(232, 195, 114, 0.08);
}

.input-wrap.is-invalid {
  border-color: rgba(255, 127, 141, 0.55);
}

.input-icon {
  display: grid;
  place-items: center;
  width: 44px;
  color: var(--muted-2);
  flex: 0 0 auto;
}

.input-icon .icon {
  width: 18px;
  height: 18px;
}

.input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px 0 0;
  color: var(--text);
  font-size: 16px;
  background: transparent;
  border: 0;
  outline: none;
}

.input-wrap:has(.input-icon) .input {
  padding-left: 0;
}

.input::placeholder {
  color: #566176;
}

.input-action {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--muted-2);
  border-radius: 10px;
  flex: 0 0 auto;
}

.input-action:hover {
  color: var(--text);
}

.input-action .icon {
  width: 18px;
  height: 18px;
}

select.input {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

option {
  color: var(--text);
  background: #111827;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-semantic {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-alert {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  color: #ffb7c0;
  font-size: 12.5px;
  border: 1px solid rgba(255, 127, 141, 0.22);
  border-radius: 11px;
  background: rgba(255, 127, 141, 0.07);
}

.form-alert.is-visible {
  display: flex;
}

.form-alert .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.form-actions .btn {
  min-width: 92px;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.form-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ==========================================================================
   Auth
   ========================================================================== */

.auth-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
  width: min(1180px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 46px 48px;
}

.auth-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: min(720px, calc(100dvh - 92px));
  padding: 10px 0;
  animation: fade-up 0.7s ease both;
}

.auth-copy {
  margin: 46px 0 28px;
}

.auth-copy h1 {
  margin: 20px 0 18px;
  font-size: clamp(38px, 4.2vw, 58px);
  line-height: 1.13;
  letter-spacing: -0.035em;
  font-weight: 720;
}

.auth-copy > p {
  max-width: 440px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}

.auth-points {
  display: grid;
  gap: 13px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #b9c3d2;
  font-size: 13px;
}

.auth-points .point-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--gold);
  border-radius: 9px;
  border: 1px solid rgba(232, 195, 114, 0.18);
  background: rgba(232, 195, 114, 0.06);
}

.auth-points .point-icon .icon {
  width: 14px;
  height: 14px;
}

.auth-foot {
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.network-visual {
  position: relative;
  width: min(410px, 100%);
  height: 190px;
  margin: 28px 0 0;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  background:
    radial-gradient(circle at 50% 18%, rgba(232, 195, 114, 0.1), transparent 44%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  overflow: hidden;
}

.network-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.network-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(232, 195, 114, 0.32);
}

.network-node {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 5px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 99px;
  background: rgba(12, 17, 28, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
  font-size: 9.5px;
  color: #bdc8d8;
  white-space: nowrap;
}

.network-node .avatar {
  width: 22px;
  height: 22px;
}

.network-node .avatar .icon {
  width: 11px;
  height: 11px;
}

.network-node .avatar-gold::after {
  display: none;
}

.network-node.n-root {
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  border-color: rgba(232, 195, 114, 0.28);
  color: var(--gold-light);
  animation: float-node-center 5s ease-in-out infinite;
}

.network-node.n-a {
  left: 13%;
  top: 105px;
  animation: float-node 5.5s ease-in-out 0.4s infinite;
}

.network-node.n-b {
  left: 42%;
  top: 132px;
  animation: float-node 5.2s ease-in-out 0.8s infinite;
}

.network-node.n-c {
  right: 10%;
  top: 98px;
  animation: float-node 5.8s ease-in-out 0.2s infinite;
}

.auth-panel {
  width: 100%;
  max-width: 452px;
  justify-self: end;
  animation: fade-up 0.72s 0.08s ease both;
}

.auth-mobile-head {
  display: none;
  margin-bottom: 24px;
}

.auth-card {
  position: relative;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(155deg, rgba(22, 30, 47, 0.92), rgba(10, 14, 24, 0.94));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -110px;
  right: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 195, 114, 0.12), transparent 65%);
  pointer-events: none;
}

.auth-card-head {
  position: relative;
  margin-bottom: 23px;
}

.auth-card-head h2 {
  font-size: 25px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.auth-card-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 7, 13, 0.5);
}

.auth-tab {
  height: 37px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  transition: 0.2s ease;
}

.auth-tab.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.auth-submit {
  width: 100%;
  margin-top: 5px;
}

.invite-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(73, 214, 163, 0.18);
  border-radius: 12px;
  background: rgba(73, 214, 163, 0.055);
}

.invite-preview.is-visible {
  display: flex;
  animation: fade-up 0.25s ease both;
}

.invite-preview.is-invalid {
  border-color: rgba(255, 127, 141, 0.2);
  background: rgba(255, 127, 141, 0.05);
}

.invite-preview .preview-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--green);
  border-radius: 9px;
  background: rgba(73, 214, 163, 0.1);
}

.invite-preview.is-invalid .preview-icon {
  color: var(--red);
  background: rgba(255, 127, 141, 0.1);
}

.invite-preview .preview-icon .icon {
  width: 15px;
  height: 15px;
}

.invite-preview strong {
  display: block;
  color: #d9e7e2;
  font-size: 12.5px;
  font-weight: 600;
}

.invite-preview span {
  color: var(--muted);
  font-size: 10.5px;
}

.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.auth-meta .secure {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.auth-meta .icon {
  width: 13px;
  height: 13px;
}

.admin-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 22px;
  color: var(--muted-2);
  font-size: 11.5px;
  transition: color 0.2s;
}

.admin-entry:hover {
  color: var(--gold);
}

.admin-entry .icon {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Mobile app shell
   ========================================================================== */

.app-frame {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 18px calc(102px + var(--safe-bottom));
  position: relative;
}

.app-content {
  padding-top: calc(22px + var(--safe-top));
}

.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 21px;
  animation: fade-up 0.45s ease both;
}

.home-head h1 {
  margin-top: 5px;
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.home-head h1 span {
  color: var(--gold-light);
}

.home-head .today {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.profile-orb {
  padding: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.025);
  transition: 0.2s ease;
}

.profile-orb:hover {
  border-color: rgba(232, 195, 114, 0.38);
}

.profile-orb .avatar {
  width: 41px;
  height: 41px;
}

/* Identity card */

.identity-card {
  position: relative;
  margin-bottom: 15px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.09);
  overflow: hidden;
  animation: fade-up 0.5s 0.03s ease both;
}

.identity-card::before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -94px;
  top: -118px;
  border-radius: 50%;
  pointer-events: none;
}

.identity-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(115deg, transparent 30%, black);
}

.identity-card.is-gold {
  background:
    radial-gradient(circle at 88% 0%, rgba(232, 195, 114, 0.17), transparent 48%),
    linear-gradient(140deg, #1b1c1d 0%, #171a21 52%, #121720 100%);
  border-color: rgba(232, 195, 114, 0.27);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 242, 203, 0.13);
}

.identity-card.is-gold::before {
  background: radial-gradient(circle, rgba(232, 195, 114, 0.15), transparent 66%);
}

.identity-card.is-silver {
  background:
    radial-gradient(circle at 88% 0%, rgba(197, 214, 233, 0.11), transparent 48%),
    linear-gradient(140deg, #171c26 0%, #111720 55%, #0e141e 100%);
  border-color: rgba(203, 214, 228, 0.16);
}

.identity-card.is-silver::before {
  background: radial-gradient(circle, rgba(197, 214, 233, 0.09), transparent 66%);
}

.identity-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
}

.identity-info {
  flex: 1;
  min-width: 0;
}

.identity-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.identity-uid {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.identity-uid strong {
  color: #cdd7e4;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.uid-copy {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted-2);
  border-radius: 7px;
  transition: 0.18s;
}

.uid-copy:hover {
  color: var(--gold);
  background: rgba(232, 195, 114, 0.08);
}

.uid-copy .icon {
  width: 13px;
  height: 13px;
}

.identity-seal {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--gold);
  border: 1px solid rgba(232, 195, 114, 0.18);
  border-radius: 10px;
  background: rgba(232, 195, 114, 0.06);
}

.identity-card.is-silver .identity-seal {
  color: var(--silver);
  border-color: rgba(203, 214, 228, 0.15);
  background: rgba(203, 214, 228, 0.05);
}

.identity-seal .icon {
  width: 15px;
  height: 15px;
}

.identity-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--muted-2);
  font-size: 10px;
}

.identity-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.identity-meta .icon {
  width: 13px;
  height: 13px;
}

.identity-tier {
  color: var(--gold);
  letter-spacing: 0.05em;
}

.identity-card.is-silver .identity-tier {
  color: #b8c6d8;
}

/* Stats */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 24px;
  animation: fade-up 0.5s 0.07s ease both;
}

.stat-card {
  position: relative;
  padding: 13px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -16px;
  bottom: -22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(232, 195, 114, 0.035);
}

.stat-label {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 4px;
  color: var(--text);
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 400;
}

.stat-card:nth-child(1) .stat-value {
  color: var(--gold-light);
}

/* Sections */

.section {
  margin-bottom: 24px;
  animation: fade-up 0.5s 0.1s ease both;
}

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

.section-head h2 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.section-head p {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10.5px;
  transition: color 0.18s;
}

.section-link:hover {
  color: var(--gold);
}

.section-link .icon {
  width: 14px;
  height: 14px;
}

.section-note {
  color: var(--muted-2);
  font-size: 10px;
}

/* Invite card */

.invite-card {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(232, 195, 114, 0.19);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 12%, rgba(232, 195, 114, 0.11), transparent 48%),
    linear-gradient(140deg, rgba(30, 28, 24, 0.7), rgba(14, 18, 27, 0.86));
  overflow: hidden;
}

.invite-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 195, 114, 0.5), transparent);
}

.invite-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.invite-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d9c9a5;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.invite-label .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.invite-tag {
  padding: 2px 7px;
  color: var(--muted-2);
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
}

.invite-code {
  margin: 10px 0 14px;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: clamp(27px, 8.2vw, 34px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-shadow: 0 0 30px rgba(232, 195, 114, 0.16);
  user-select: all;
}

.invite-actions {
  display: flex;
  gap: 9px;
}

.invite-actions .btn {
  flex: 1;
  min-height: 39px;
  font-size: 12px;
  border-radius: 11px;
}

.invite-note {
  margin-top: 11px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
}

/* Upline / root */

.upline-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012));
}

.upline-main {
  flex: 1;
  min-width: 0;
}

.upline-main strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.upline-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.upline-tag {
  padding: 3px 8px;
  color: var(--gold);
  font-size: 9px;
  border: 1px solid rgba(232, 195, 114, 0.18);
  border-radius: 99px;
  background: rgba(232, 195, 114, 0.05);
  white-space: nowrap;
}

.chain-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 0 2px;
}

.chain-label {
  padding-top: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.chain-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  color: #aeb9c8;
  font-size: 9.5px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

.chain-item.is-current {
  color: var(--gold-light);
  border-color: rgba(232, 195, 114, 0.2);
  background: rgba(232, 195, 114, 0.06);
}

.chain-arrow {
  color: #4d586a;
  font-size: 10px;
}

.root-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(232, 195, 114, 0.19);
  border-radius: var(--radius-md);
  background: linear-gradient(130deg, rgba(232, 195, 114, 0.07), rgba(255, 255, 255, 0.015));
}

.root-note-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  color: var(--gold);
  border-radius: 10px;
  background: rgba(232, 195, 114, 0.09);
}

.root-note-icon .icon {
  width: 17px;
  height: 17px;
}

.root-note strong {
  display: block;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 600;
}

.root-note p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

/* Member list */

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

.member-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}

.member-item:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.member-item:active {
  transform: scale(0.995);
}

.member-main {
  flex: 1;
  min-width: 0;
}

.member-main strong {
  display: block;
  overflow: hidden;
  color: #e7edf6;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.member-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 0 0 auto;
}

.member-side strong {
  color: var(--gold);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.member-side span {
  color: var(--muted-2);
  font-size: 8.5px;
}

.member-chevron {
  color: #4e5a6d;
}

.member-chevron .icon {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   Tabbar
   ========================================================================== */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 560px);
  min-height: calc(70px + var(--safe-bottom));
  padding: 8px 24px calc(8px + var(--safe-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(8, 12, 20, 0.86);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(22px);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #626f83;
  font-size: 9px;
  font-weight: 550;
  border-radius: 12px;
  transition: color 0.2s ease;
}

.tab .icon {
  width: 21px;
  height: 21px;
  transition: transform 0.2s ease;
}

.tab.is-active {
  color: var(--gold);
}

.tab.is-active .icon {
  transform: translateY(-1px);
}

.tab.is-active::before {
  content: "";
  position: absolute;
  top: -9px;
  width: 22px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(232, 195, 114, 0.55);
}

/* ==========================================================================
   Team page
   ========================================================================== */

.page-content {
  padding-top: calc(25px + var(--safe-top));
  animation: fade-up 0.42s ease both;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 19px;
}

.page-head h1 {
  margin-top: 5px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.team-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
  overflow: hidden;
}

.team-summary > div {
  padding: 12px;
  text-align: center;
  background: rgba(13, 18, 29, 0.96);
}

.team-summary strong {
  display: block;
  color: var(--text);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.team-summary strong.gold {
  color: var(--gold-light);
}

.team-summary span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.55);
  transition: border-color 0.18s;
}

.search-box:focus-within {
  border-color: rgba(232, 195, 114, 0.4);
}

.search-box .icon {
  width: 16px;
  height: 16px;
  margin: 0 9px 0 13px;
  color: var(--muted-2);
}

.search-box input {
  width: 100%;
  height: 100%;
  padding: 0 12px 0 0;
  color: var(--text);
  font-size: 13px;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-box input::placeholder {
  color: #566176;
}

.tree-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  overflow: hidden;
}

.tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.tree-toolbar span {
  color: var(--muted-2);
  font-size: 10px;
}

.tree-toolbar .toolbar-actions {
  display: flex;
  gap: 6px;
}

.tree-toolbar .mini-link {
  padding: 4px 8px;
  color: var(--muted);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: 0.18s;
}

.tree-toolbar .mini-link:hover {
  color: var(--gold);
  border-color: rgba(232, 195, 114, 0.24);
}

.tree-body {
  padding: 8px;
}

.tree-node > .tree-children {
  display: none;
}

.tree-node.is-open > .tree-children {
  display: block;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  text-align: left;
  border-radius: 12px;
  transition: background 0.16s;
}

.tree-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.tree-toggle {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--muted-2);
  border-radius: 7px;
  transition:
    transform 0.2s,
    background 0.18s;
}

.tree-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tree-toggle .icon {
  width: 14px;
  height: 14px;
}

.tree-node.is-open > .tree-row .tree-toggle {
  transform: rotate(180deg);
}

.tree-toggle.is-leaf {
  opacity: 0;
  pointer-events: none;
}

.tree-avatar {
  width: 31px;
  height: 31px;
}

.tree-avatar .icon {
  width: 15px;
  height: 15px;
}

.tree-main {
  flex: 1;
  min-width: 0;
}

.tree-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  overflow: hidden;
  color: #e4ebf5;
  font-size: 11.5px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-name .role-chip {
  height: 17px;
  padding: 0 5px;
  font-size: 8px;
}

.tree-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 1px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

.tree-meta .dot {
  color: #3d4758;
}

.tree-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 0 0 auto;
}

.tree-count strong {
  color: #b9c5d6;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tree-count span {
  color: var(--muted-2);
  font-size: 8px;
}

.tree-children {
  position: relative;
  margin-left: 21px;
  padding-left: 10px;
}

.tree-children::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, rgba(232, 195, 114, 0.2), rgba(255, 255, 255, 0.055));
}

/* Search results */

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

.search-result-count {
  padding: 9px 3px 4px;
  color: var(--muted-2);
  font-size: 10px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.028);
}

.search-result:hover {
  border-color: var(--line-strong);
}

.search-result .path {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

/* Empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 11px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.empty-icon .icon {
  width: 20px;
  height: 20px;
}

.empty-state h3 {
  color: #adb9ca;
  font-size: 12px;
  font-weight: 600;
}

.empty-state p {
  max-width: 250px;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.65;
}

/* ==========================================================================
   Profile
   ========================================================================== */

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 24px;
  text-align: center;
}

.profile-hero .avatar {
  width: 74px;
  height: 74px;
  border-radius: 25px;
}

.profile-hero .avatar .icon {
  width: 35px;
  height: 35px;
}

.profile-hero h1 {
  margin-top: 13px;
  font-size: 19px;
  font-weight: 680;
}

.profile-hero .profile-role {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.profile-hero .profile-uid {
  margin-top: 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
}

.settings-group {
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.settings-title {
  padding: 12px 15px 8px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 49px;
  padding: 9px 15px;
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.settings-row:first-of-type {
  border-top: 0;
}

.settings-row .row-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: var(--muted);
}

.settings-row .row-icon .icon {
  width: 17px;
  height: 17px;
}

.settings-row .row-main {
  flex: 1;
  min-width: 0;
}

.settings-row .row-main strong {
  display: block;
  color: #d5dee9;
  font-size: 12px;
  font-weight: 500;
}

.settings-row .row-main span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.settings-row .row-value {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.settings-row .row-chevron {
  color: #4d586a;
}

.settings-row .row-chevron .icon {
  width: 15px;
  height: 15px;
}

.settings-row.is-button {
  transition: background 0.18s;
}

.settings-row.is-button:hover {
  background: rgba(255, 255, 255, 0.04);
}

.settings-row.is-danger .row-main strong {
  color: var(--red);
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 18px;
}

.profile-actions .btn {
  width: 100%;
}

.version {
  margin: 25px 0 6px;
  color: #4a5567;
  font-size: 9px;
  text-align: center;
  letter-spacing: 0.1em;
}

.version span {
  color: #6a7689;
}

/* ==========================================================================
   Toast / modal / sheet
   ========================================================================== */

#toast-root {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  z-index: 900;
  width: min(calc(100% - 30px), 400px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid rgba(73, 214, 163, 0.22);
  border-radius: 13px;
  background: rgba(13, 27, 25, 0.95);
  box-shadow: var(--shadow-md);
  color: #d9f5e9;
  font-size: 12px;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  backdrop-filter: blur(16px);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  border-color: rgba(255, 127, 141, 0.25);
  background: rgba(34, 14, 19, 0.96);
  color: #ffdbe0;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: var(--green);
  border-radius: 7px;
  background: rgba(73, 214, 163, 0.1);
}

.toast-error .toast-icon {
  color: var(--red);
  background: rgba(255, 127, 141, 0.1);
}

.toast-icon .icon {
  width: 13px;
  height: 13px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(3, 6, 12, 0.72);
  opacity: 0;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(7px);
}

.modal-overlay.is-open {
  opacity: 1;
}

.sheet {
  width: min(100%, 540px);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  border-radius: 25px 25px 0 0;
  background:
    radial-gradient(circle at 90% -10%, rgba(232, 195, 114, 0.08), transparent 40%),
    linear-gradient(160deg, #161e2d, #0d121d);
  box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(26px);
  transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.modal-overlay.is-open .sheet {
  transform: translateY(0);
}

.sheet-wide {
  max-width: 640px;
}

.sheet-grabber {
  width: 34px;
  height: 4px;
  margin: 9px auto 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 12px;
}

.sheet-title {
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.sheet-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.sheet-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
}

.sheet-body {
  flex: 1;
  min-height: 0;
  padding: 4px 20px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-actions {
  display: flex;
  gap: 9px;
  padding: 12px 20px calc(18px + var(--safe-bottom));
  border-top: 1px solid var(--line);
}

.sheet-actions .btn {
  flex: 1;
}

.confirm-message {
  padding: 8px 0 18px;
  color: #c4cedd;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}

.confirm-message strong {
  color: var(--text);
}

/* Detail list in sheets */

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 3px 0 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  overflow: hidden;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 45px;
  padding: 10px 13px;
  background: rgba(12, 17, 27, 0.98);
}

.detail-row dt {
  color: var(--muted-2);
  font-size: 11px;
}

.detail-row dd {
  margin: 0;
  color: #d8e1ec;
  font-size: 11.5px;
  text-align: right;
  word-break: break-all;
}

.detail-row dd.mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.detail-note {
  margin-top: 12px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
  border: 1px solid rgba(232, 195, 114, 0.16);
  border-radius: 11px;
  background: rgba(232, 195, 114, 0.05);
}

.credential-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed rgba(232, 195, 114, 0.28);
  border-radius: 13px;
  background: rgba(232, 195, 114, 0.045);
}

.credential-box .credential-label {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.credential-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.credential-line:last-child {
  border-bottom: 0;
}

.credential-line span {
  color: var(--muted);
  font-size: 10px;
}

.credential-line strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  word-break: break-all;
}

/* ==========================================================================
   Admin login
   ========================================================================== */

.admin-body {
  background: var(--bg);
}

.admin-login-page {
  display: grid;
  grid-template-columns: 1fr 480px;
  min-height: 100dvh;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 40px 48px;
  gap: 60px;
  align-items: center;
}

.admin-login-story {
  display: flex;
  flex-direction: column;
  min-height: min(640px, calc(100dvh - 80px));
  justify-content: space-between;
}

.admin-login-story h1 {
  max-width: 470px;
  margin: 22px 0 15px;
  font-size: clamp(38px, 4.2vw, 54px);
  line-height: 1.15;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.admin-login-story > div > p {
  max-width: 430px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.admin-login-features {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 27px;
}

.admin-login-features span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: #aeb9c9;
  font-size: 10.5px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-login-features .icon {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.admin-login-card {
  padding: 32px;
  border: 1px solid rgba(232, 195, 114, 0.17);
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, rgba(23, 29, 43, 0.94), rgba(10, 14, 22, 0.96));
  box-shadow: var(--shadow-lg);
}

.admin-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.15em;
  border: 1px solid rgba(232, 195, 114, 0.2);
  border-radius: 99px;
  background: rgba(232, 195, 114, 0.05);
}

.admin-login-card h2 {
  margin-top: 17px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.admin-login-card > p {
  margin: 7px 0 24px;
  color: var(--muted);
  font-size: 12px;
}

.admin-login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 10px;
}

.admin-login-foot a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

.admin-login-foot a:hover {
  color: var(--gold);
}

.admin-login-foot .icon {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   Admin shell
   ========================================================================== */

.admin-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 23px 17px 17px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 195, 114, 0.06), transparent 30%),
    rgba(9, 13, 22, 0.9);
  backdrop-filter: blur(22px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 7px;
  margin-bottom: 28px;
}

.sidebar-brand .brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 11px;
}

.sidebar-brand .brand-mark svg {
  width: 25px;
  height: 25px;
}

.sidebar-brand strong {
  display: block;
  font-size: 13.5px;
  letter-spacing: 0.1em;
}

.sidebar-brand span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 7.5px;
  letter-spacing: 0.18em;
}

.sidebar-label {
  margin: 0 9px 8px;
  color: #4f5b6d;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  color: #8491a5;
  font-size: 12.5px;
  text-align: left;
  border-radius: 10px;
  transition:
    color 0.18s,
    background 0.18s;
}

.nav-item .icon {
  width: 17px;
  height: 17px;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.is-active {
  color: var(--gold-light);
  background: linear-gradient(90deg, rgba(232, 195, 114, 0.12), rgba(232, 195, 114, 0.035));
  box-shadow: inset 2px 0 0 var(--gold);
}

.nav-badge {
  margin-left: auto;
  padding: 1px 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  border: 1px solid var(--line);
  border-radius: 99px;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.sidebar-admin {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 4px;
}

.sidebar-admin .avatar {
  width: 33px;
  height: 33px;
  border-radius: 11px;
  color: #171006;
  background: linear-gradient(145deg, #f3dfab, #d3a454);
}

.sidebar-admin-main {
  flex: 1;
  min-width: 0;
}

.sidebar-admin-main strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-admin-main span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.sidebar-logout {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--muted-2);
  border-radius: 8px;
  transition: 0.18s;
}

.sidebar-logout:hover {
  color: var(--red);
  background: rgba(255, 127, 141, 0.08);
}

.sidebar-logout .icon {
  width: 15px;
  height: 15px;
}

.sidebar-scrim {
  display: none;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 20, 0.8);
  backdrop-filter: blur(20px);
}

.menu-toggle {
  display: none;
}

.admin-topbar-titles {
  flex: 1;
  min-width: 0;
}

.admin-topbar-titles span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-topbar-titles h1 {
  margin-top: 1px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.topbar-chip .icon {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.admin-content {
  padding: 26px 28px 50px;
}

.admin-page {
  max-width: 1320px;
  margin: 0 auto;
  animation: fade-up 0.35s ease both;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-page-head h2 {
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.admin-page-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-page-head .head-actions {
  display: flex;
  gap: 8px;
}

/* Admin stats */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.008));
  overflow: hidden;
}

.admin-stat::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(232, 195, 114, 0.035);
}

.admin-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.admin-stat-head .icon {
  width: 15px;
  height: 15px;
  color: #68758a;
}

.admin-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 30px;
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.admin-stat strong small {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 400;
}

.admin-stat.is-gold strong {
  color: var(--gold-light);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  font-size: 14px;
  font-weight: 620;
}

.panel-head p {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.panel-head .icon {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
}

.panel-body {
  padding: 17px;
}

/* Chart */

.level-chart {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.level-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9.5px;
}

.level-bar-head strong {
  color: #c7d1df;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.level-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.level-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b8873b, #e8c372 60%, #f8e7b8);
  box-shadow: 0 0 12px rgba(232, 195, 114, 0.22);
  transform-origin: left;
  animation: bar-grow 0.7s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}

/* Root panel */

.root-panel-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 17px;
}

.root-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.root-identity .avatar {
  width: 45px;
  height: 45px;
  border-radius: 15px;
}

.root-identity .avatar .icon {
  width: 22px;
  height: 22px;
}

.root-identity strong {
  display: block;
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 620;
}

.root-identity span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.root-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 195, 114, 0.16);
  border-radius: 11px;
  background: rgba(232, 195, 114, 0.045);
}

.root-invite span {
  color: var(--muted);
  font-size: 9.5px;
}

.root-invite strong {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-stat {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.mini-stat span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
}

.mini-stat strong {
  display: block;
  margin-top: 2px;
  color: #d6dfea;
  font-size: 16px;
  font-weight: 620;
}

/* ==========================================================================
   Admin table
   ========================================================================== */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar .search-box {
  max-width: 300px;
  height: 38px;
}

.table-toolbar .result-count {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.data-table th {
  padding: 11px 14px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.08);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.16s;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.026);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cell-user .avatar {
  width: 29px;
  height: 29px;
}

.cell-user .avatar .icon {
  width: 14px;
  height: 14px;
}

.cell-user strong {
  display: block;
  color: #dce5f0;
  font-size: 12px;
  font-weight: 550;
}

.cell-user span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

.uid-text {
  color: #aebacb;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.phone-text {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.parent-cell {
  color: var(--muted);
  font-size: 10.5px;
}

.parent-cell strong {
  display: block;
  color: #b8c3d3;
  font-size: 10.5px;
  font-weight: 500;
}

.parent-cell span {
  display: block;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.num-cell {
  color: #c0cbd9;
  font-variant-numeric: tabular-nums;
}

.depth-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.depth-badge.is-root {
  color: var(--gold);
  border-color: rgba(232, 195, 114, 0.2);
  background: rgba(232, 195, 114, 0.06);
}

.date-text {
  color: var(--muted-2);
  font-size: 10px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 29px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: 0.16s;
}

.row-action:hover {
  color: var(--gold);
  border-color: rgba(232, 195, 114, 0.22);
  background: rgba(232, 195, 114, 0.045);
}

.row-action .icon {
  width: 11px;
  height: 11px;
}

.row-action.is-danger {
  color: var(--red);
  border-color: rgba(255, 127, 141, 0.18);
  background: rgba(255, 127, 141, 0.035);
}

.row-action.is-danger:hover {
  color: #ffd5db;
  border-color: rgba(255, 127, 141, 0.38);
  background: rgba(255, 127, 141, 0.12);
}

.row-action.is-icon {
  width: 29px;
  padding: 0;
  justify-content: center;
}

.row-action.is-icon .icon {
  width: 13px;
  height: 13px;
}

.row-action.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Admin cards for mobile */

.admin-mobile-list {
  display: none;
}

/* Admin tree page */

.admin-tree-panel .tree-body {
  max-height: calc(100dvh - 230px);
  overflow-y: auto;
}

.admin-tree-panel .tree-row {
  padding: 9px;
}

.admin-tree-panel .tree-name {
  font-size: 12px;
}

/* Admins page */

.admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 11px;
}

.admin-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.008));
}

.admin-card .avatar {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  color: #171006;
  background: linear-gradient(145deg, #f3dfab, #d3a454);
}

.admin-card .avatar .icon {
  width: 18px;
  height: 18px;
}

.admin-card-main {
  flex: 1;
  min-width: 0;
}

.admin-card-main strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.admin-card-tag {
  padding: 2px 6px;
  color: var(--gold);
  font-size: 8px;
  border: 1px solid rgba(232, 195, 114, 0.18);
  border-radius: 99px;
}

/* Logs */

.log-list {
  display: flex;
  flex-direction: column;
}

.log-item {
  display: flex;
  gap: 12px;
  padding: 13px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.log-item:last-child {
  border-bottom: 0;
}

.log-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  color: var(--gold);
  border: 1px solid rgba(232, 195, 114, 0.14);
  border-radius: 9px;
  background: rgba(232, 195, 114, 0.05);
}

.log-icon .icon {
  width: 14px;
  height: 14px;
}

.log-main {
  flex: 1;
  min-width: 0;
}

.log-main strong {
  display: block;
  color: #d3dde9;
  font-size: 12px;
  font-weight: 550;
}

.log-main p {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  word-break: break-all;
}

.log-meta {
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
  text-align: right;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.noscript {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

.loading-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60dvh;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.loading-page .spinner {
  width: 24px;
  height: 24px;
  border-color: rgba(232, 195, 114, 0.16);
  border-top-color: var(--gold);
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.035),
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.035)
  );
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}

.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;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    max-height: min(86dvh, 800px);
  }

  .sheet-grabber {
    display: none;
  }

  .sheet-head {
    padding-top: 23px;
  }
}

@media (max-width: 980px) {
  .auth-page {
    grid-template-columns: 1fr;
    width: min(500px, 100%);
    padding: 28px 20px;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    max-width: none;
    justify-self: stretch;
  }

  .auth-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .admin-login-page {
    grid-template-columns: 1fr;
    width: min(480px, 100%);
    padding: 28px 20px;
    gap: 25px;
  }

  .admin-login-story {
    min-height: auto;
    display: block;
  }

  .admin-login-story h1 {
    font-size: 30px;
    margin: 15px 0 10px;
  }

  .admin-login-story > div > p {
    font-size: 12.5px;
  }

  .admin-login-features,
  .admin-login-story .auth-foot {
    display: none;
  }
}

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(278px, 84vw);
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.28, 1);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.42);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: block;
    background: rgba(3, 6, 12, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s;
    backdrop-filter: blur(3px);
  }

  body.sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .admin-topbar {
    padding: 11px 18px;
  }

  .admin-content {
    padding: 20px 18px 40px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-topbar .topbar-chip span {
    display: none;
  }

  .admin-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-page-head .head-actions {
    width: 100%;
  }

  .admin-page-head .head-actions .btn {
    flex: 1;
  }

  .admin-stats {
    gap: 9px;
  }

  .admin-stat {
    padding: 13px;
  }

  .admin-stat strong {
    font-size: 23px;
  }

  .data-table th:nth-child(4),
  .data-table td:nth-child(4),
  .data-table th:nth-child(7),
  .data-table td:nth-child(7) {
    display: none;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .table-toolbar .search-box {
    max-width: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-frame {
    padding-left: 15px;
    padding-right: 15px;
  }

  .auth-page {
    padding: 18px 15px 28px;
  }

  .auth-card {
    padding: 23px 19px;
    border-radius: 24px;
  }

  .auth-card-head h2 {
    font-size: 23px;
  }

  .auth-mobile-head {
    margin-bottom: 18px;
  }

  .auth-mobile-head .brand .brand-mark {
    width: 37px;
    height: 37px;
  }

  .identity-card {
    padding: 17px;
  }

  .identity-name {
    font-size: 16.5px;
  }

  .identity-uid strong {
    font-size: 10px;
  }

  .invite-code {
    font-size: 28px;
    letter-spacing: 0.13em;
  }

  .stat-card {
    padding: 11px 10px;
  }

  .stat-value {
    font-size: 21px;
  }

  .admin-content {
    padding: 17px 13px 35px;
  }

  .admin-topbar {
    padding: 10px 13px;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }

  .admin-login-card {
    padding: 24px 19px;
  }

  .data-table th,
  .data-table td {
    padding: 10px;
  }

  .data-table th:nth-child(3),
  .data-table td:nth-child(3) {
    display: none;
  }

  .data-table th:nth-child(5),
  .data-table td:nth-child(5) {
    display: none;
  }

  .sheet-head {
    padding-left: 17px;
    padding-right: 17px;
  }

  .sheet-body {
    padding-left: 17px;
    padding-right: 17px;
  }

  .sheet-actions {
    padding-left: 17px;
    padding-right: 17px;
  }
}

@media (max-width: 380px) {
  .invite-code {
    font-size: 24px;
    letter-spacing: 0.1em;
  }

  .invite-actions {
    flex-direction: column;
  }

  .stat-label {
    font-size: 9px;
  }

  .stat-value {
    font-size: 19px;
  }

  .home-head h1 {
    font-size: 20px;
  }
}

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

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loading-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(330%);
  }
}

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

@keyframes float-node {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes float-node-center {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
}

@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes skeleton {
  0% {
    background-position: 150% 0;
  }
  100% {
    background-position: -50% 0;
  }
}
