/* ---------- tokens ----------
   White paper, cobalt for action and gains, ember for losses.
   Blue/ember instead of green/red: Chinese markets read red as "up",
   Western ones read it as "down" — this pairing means the same thing to both. */
:root {
  --paper: #ffffff;
  --mist: #f4f7fc;
  --line: #e3e9f3;
  --line-2: #cbd6e6;
  --ink: #0b1a33;
  --ink-2: #33425c;
  --slate: #66758f;
  --blue: #1747d6;
  --blue-hover: #123bb5;
  --blue-50: #eef3ff;
  --blue-100: #dce6ff;
  --blue-ink: #0e2e8f;
  --ember: #e06a2e;
  --ember-50: #fdf0e8;
  --ember-ink: #9a3f12;

  --font: "Archivo", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.ico { width: 18px; height: 18px; flex: none; }
.num { font-stretch: 115%; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-weight: 500; }
.muted { color: var(--slate); }
.pos { color: var(--blue); }
.neg { color: var(--ember); }
.eyebrow {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}
html[lang^="zh"] .eyebrow { letter-spacing: 0.04em; font-family: var(--font); font-size: 12px; }

/* ---------- loading bar + toast ---------- */
.progress {
  position: fixed; inset: 0 0 auto; height: 2px; z-index: 50; overflow: hidden;
  background: var(--blue-50);
}
.progress::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 40%;
  background: var(--blue);
  animation: progress 1s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 12px); opacity: 0;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px -10px rgba(11, 26, 51, .45);
  transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-ghost { background: var(--paper); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-quiet { background: none; color: var(--blue); padding: 0 10px; }
.btn-quiet:hover { background: var(--blue-50); }
.btn-danger { background: var(--ember); color: #fff; }
.btn-danger:hover { background: #c95a22; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 48px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: default; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: 9px;
  background: none; color: var(--slate); cursor: pointer;
}
.icon-btn:hover { background: var(--mist); color: var(--ink); }

.lang {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
}
.lang button {
  border: 0; background: none; cursor: pointer;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--slate);
}
.lang button[aria-pressed="true"] { background: var(--blue-50); color: var(--blue); }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--mist); border-radius: 11px; }
.seg button {
  border: 0; background: none; cursor: pointer;
  padding: 6px 11px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--slate);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 26, 51, .1); }

.av {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-50); color: var(--blue);
  font-size: 12.5px; font-weight: 650; letter-spacing: .02em; line-height: 1;
}
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.lg { width: 48px; height: 48px; font-size: 16px; }

.badge {
  display: inline-block; vertical-align: 1px;
  padding: 1px 7px; border-radius: 999px;
  background: var(--blue); color: #fff;
  font-size: 10.5px; font-weight: 650; letter-spacing: .02em; line-height: 1.5;
}

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--maxw); margin: 0 auto; height: 64px; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 650; font-stretch: 112%; letter-spacing: -.01em; white-space: nowrap;
}
.brand .logo { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-self: stretch; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; padding: 0 12px;
  color: var(--slate); font-weight: 500; font-size: 14.5px;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--blue);
}
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 40;
  min-width: 220px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -16px rgba(11, 26, 51, .28);
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--ink); font-size: 14px; text-align: left; cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--mist); }
.menu-pop .danger { color: var(--ember-ink); }
.menu-who { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); display: grid; }
.menu-who b { font-weight: 600; }
.menu-who span { font-size: 12.5px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; }

.page { max-width: var(--maxw); margin: 0 auto; padding: 36px var(--gutter) 96px; }
.tabbar { display: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head h1, .greet {
  font-size: 30px; font-weight: 650; font-stretch: 112%; letter-spacing: -.025em; line-height: 1.15;
}
.greet { margin-bottom: 26px; }

.state { padding: 80px 0; text-align: center; display: grid; gap: 16px; justify-items: center; color: var(--slate); }

/* ---------- hero: one big number, its curve, its facts ---------- */
.hero { padding-bottom: 8px; }
.hero-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-value {
  margin: 10px 0 12px;
  font-size: clamp(42px, 7vw, 78px); line-height: .95;
  font-weight: 600; font-stretch: 125%; letter-spacing: -.035em;
}
.delta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14.5px; color: var(--ink-2); }
.delta .chip { padding: 3px 9px; border-radius: 999px; font-size: 13px; background: var(--mist); color: var(--ink-2); }
.delta.pos .chip { background: var(--blue-50); color: var(--blue); }
.delta.neg .chip { background: var(--ember-50); color: var(--ember-ink); }
.hero-flush { margin-top: 28px; }

.chart-host { margin-top: 22px; }
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; overflow: visible; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--slate); background: var(--mist); border-radius: var(--radius); font-size: 14px; }
.c-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-stop-top { stop-color: var(--blue); stop-opacity: .16; }
.c-stop-bottom { stop-color: var(--blue); stop-opacity: 0; }
.c-grid { stroke: var(--line); stroke-dasharray: 2 4; }
.c-axis { fill: var(--slate); font: 500 11px var(--mono); }
.c-guide { stroke: var(--line-2); stroke-width: 1; }
.c-dot { fill: var(--paper); stroke: var(--blue); stroke-width: 2.5; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 2;
  display: grid; gap: 1px; padding: 7px 10px; border-radius: 9px;
  background: var(--ink); color: #fff; white-space: nowrap;
  font-size: 12px; box-shadow: 0 8px 20px -8px rgba(11, 26, 51, .5);
}
.chart-tip b { font-size: 13.5px; font-weight: 600; font-stretch: 112%; font-variant-numeric: tabular-nums; }
.chart-tip span { opacity: .7; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 18px 20px; }
.stat:first-child, .stats-8 .stat:nth-child(4n + 1) { padding-left: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stats-8 .stat:nth-child(4n + 1) { border-left: 0; }
.stats-8 .stat:nth-child(n + 5) { border-top: 1px solid var(--line); }
.stat dt { font-size: 12.5px; color: var(--slate); }
.stat dd { margin-top: 4px; font-size: 21px; }

.empty-hero {
  padding: 36px; border-radius: var(--radius);
  background: var(--blue-50); display: grid; gap: 10px; justify-items: start;
}
.empty-hero h2 { font-size: 22px; font-weight: 650; font-stretch: 110%; letter-spacing: -.015em; }
.empty-hero p { color: var(--ink-2); max-width: 46ch; margin-bottom: 8px; }

/* ---------- layout blocks ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; margin-top: 40px; align-items: start; }
.grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.stack { display: grid; gap: 20px; }
.section { margin-top: 48px; }
.section-title, .panel-title { font-size: 16px; font-weight: 650; letter-spacing: -.005em; }
.section-title { margin-bottom: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--paper); }
.panel-quiet { border-style: dashed; display: flex; align-items: center; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-sub { margin-top: 4px; font-size: 14px; }
.panel > .panel-title + form, .panel > .panel-title + .kv { margin-top: 18px; }
.more-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; }
.more-link .ico { width: 15px; height: 15px; transition: transform .15s; }
.more-link:hover .ico { transform: translateX(2px); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pair > div { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--mist); }
.pair span, .pair dt { font-size: 12.5px; color: var(--slate); }
.pair b, .pair dd { font-size: 20px; }
.pair-inline { display: flex; gap: 28px; margin: 4px 0 0; }
.pair-inline > div { background: none; padding: 0; }
.pair-inline dd { font-size: 17px; }

.strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); }
.strip > div { padding: 14px 18px; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip dt { font-size: 12.5px; color: var(--slate); }
.strip dd { font-size: 22px; margin-top: 2px; }
.strip-lg { margin-top: 28px; }
.strip-lg dd { font-size: 28px; }

.feed { display: grid; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed-text { display: grid; min-width: 0; }
.feed-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-text small { font-size: 12.5px; color: var(--slate); }
.feed time { font-size: 12.5px; color: var(--slate); white-space: nowrap; }

/* ---------- invite ticket ---------- */
.ticket {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  border-radius: var(--radius); background: var(--blue-50); overflow: hidden;
}
.ticket-main { padding: 22px 24px; min-width: 0; }
.ticket-code {
  margin: 10px 0 8px;
  font: 500 34px/1 var(--mono); letter-spacing: .2em; color: var(--blue-ink);
}
.ticket-link { font: 12.5px/1.4 var(--mono); color: var(--slate); overflow-wrap: anywhere; }
.ticket-side {
  position: relative; display: grid; gap: 8px; align-content: center;
  padding: 20px 22px; border-left: 1.5px dashed var(--blue-100);
}
/* the perforation notches */
.ticket-side::before, .ticket-side::after {
  content: ""; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper);
}
.ticket-side::before { top: -8px; }
.ticket-side::after { bottom: -8px; }
.ticket-compact .ticket-main { padding: 18px 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ticket-compact .ticket-code { margin: 0; font-size: 26px; }
.ticket-compact .ticket-side { display: flex; align-items: center; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field-label {
  display: flex; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.field-label small { font-weight: 400; color: var(--slate); }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
}
.input.has-reveal { padding-right: 64px; }
.input:hover { border-color: #b4c3d9; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.input[readonly] { background: var(--mist); color: var(--slate); }
.input[aria-invalid="true"] { border-color: var(--ember); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--ember-50); }
#f-ref, #l-login { font-family: var(--mono); letter-spacing: .08em; }
.reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
  color: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer;
}
.reveal:hover { background: var(--blue-50); }
.field-msg { margin-top: 6px; font-size: 12.5px; color: var(--slate); }
.field-msg:empty { display: none; }
.field-msg.is-error { color: var(--ember-ink); }
.form-error {
  margin-bottom: 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--ember-50); color: var(--ember-ink); font-size: 13.5px;
}
.invite-chip {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--blue-50); color: var(--blue-ink); font-size: 13.5px; font-weight: 500;
  animation: drop .35s cubic-bezier(.2, .7, .2, 1) both;
}
.invite-chip .ico { margin-left: auto; color: var(--blue); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(400px, 44%) 1fr; }
.auth-panel {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; padding: 36px 48px 44px;
  background: var(--blue); color: #fff;
}
.brand-inverse { color: #fff; }
.auth-art { margin: auto 0 36px; max-width: 360px; }
.tree-art { width: 100%; height: auto; display: block; overflow: visible; }
.ta-lines path { fill: none; stroke: rgba(255, 255, 255, .4); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ta-n { fill: rgba(255, 255, 255, .5); }
.ta-you { fill: #fff; }
.ta-l1 { fill: rgba(255, 255, 255, .82); }
.ta-new { fill: #fff; }
.ta-ring { fill: none; stroke: #fff; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out 1.6s infinite; opacity: 0; }
.ta-n, .ta-lines path { animation: drop .6s cubic-bezier(.2, .7, .2, 1) both; transform-box: fill-box; }
.ta-d1 { animation-delay: .25s; }
.ta-d2 { animation-delay: .55s; }
.ta-d3 { animation-delay: 1.05s; }
@keyframes ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.4); } }
.auth-panel h2 {
  font-size: clamp(30px, 3.1vw, 42px); line-height: 1.06;
  font-weight: 600; font-stretch: 120%; letter-spacing: -.03em;
  max-width: 13ch; margin-bottom: 24px;
}
html[lang^="zh"] .auth-panel h2 { max-width: 11em; letter-spacing: 0; line-height: 1.25; }
.auth-points { display: grid; gap: 10px; font-size: 14.5px; color: rgba(255, 255, 255, .86); }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points .ico { width: 16px; height: 16px; color: #fff; }
.auth-main { display: flex; flex-direction: column; padding: 28px var(--gutter) 40px; }
.auth-top { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.auth-mobile-brand { display: none; }
.auth-form { width: 100%; max-width: 380px; margin: auto; padding-top: 32px; }
.auth-form h1 { font-size: 32px; font-weight: 650; font-stretch: 112%; letter-spacing: -.025em; line-height: 1.1; }
.auth-sub { margin: 8px 0 28px; color: var(--slate); }
.auth-form .btn-block { margin-top: 8px; }
.auth-alt { margin-top: 22px; text-align: center; font-size: 14px; color: var(--slate); }
.auth-alt a { font-weight: 600; }

/* ---------- accounts ---------- */
.acct-tabs { display: flex; gap: 8px; overflow-x: auto; margin: -8px 0 24px; padding-bottom: 4px; }
.acct-tab {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); font-size: 14px;
}
.acct-tab small { color: var(--slate); font-size: 12.5px; }
.acct-tab:hover { border-color: var(--line-2); }
.acct-tab[aria-current="page"] { border-color: var(--blue); background: var(--blue-50); color: var(--blue-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot-live { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.dot-idle { background: var(--slate); }

.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.acct-login { margin: 6px 0 8px; font: 500 26px/1.1 var(--mono); letter-spacing: .04em; }
.acct-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--slate); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-live { color: var(--blue); }
.status-live::before { animation: pulse 2s infinite; }
.status-idle, .status-waiting { color: var(--slate); }
.menu-right .menu-pop { min-width: 180px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 12px; font-size: 12px; font-weight: 500; color: var(--slate); text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .r { text-align: right; }
.side { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.side-buy { background: var(--blue-50); color: var(--blue); }
.side-sell { background: var(--mist); color: var(--ink-2); }

.mr { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 760px; }
.mr th { font-weight: 500; color: var(--slate); padding: 4px; font-size: 12px; }
.mr tbody th { text-align: left; font-family: var(--mono); padding-right: 10px; }
.mr td { height: 38px; text-align: center; border-radius: 7px; color: var(--ink); font-weight: 600; }
.mr td.on-dark { color: #fff; }
.mr .mr-empty { background: var(--mist); }
.mr .mr-year { background: none; text-align: right; padding-left: 10px; font-stretch: 112%; }

/* ---------- team: the tree ---------- */
.levels-strip { margin-top: 20px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); }
.levels-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.levels-bars { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; overflow-x: auto; }
.levels-bars li { display: grid; justify-items: center; gap: 6px; min-width: 44px; flex: 1; max-width: 90px; }
.lb-count { font-size: 15px; }
.lb-bar { width: 100%; height: 56px; display: flex; align-items: flex-end; border-radius: 6px; background: var(--mist); overflow: hidden; }
.lb-bar span { width: 100%; background: var(--line-2); border-radius: 6px 6px 0 0; min-height: 4px; }
.is-paid .lb-bar span { background: var(--blue); }
.lb-label { font-size: 12px; color: var(--slate); }

.team-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 8px; }
.team-tools-end { display: flex; gap: 4px; }
.team-view { margin-top: 8px; }

.tree-scroll {
  overflow-x: auto; overflow-y: hidden;
  margin: 0 calc(-1 * var(--gutter)); padding: 16px var(--gutter) 40px;
  cursor: grab;
}
.tree-scroll.is-panning { cursor: grabbing; user-select: none; }
.org { display: flex; justify-content: center; min-width: max-content; }
.org ul { position: relative; display: flex; justify-content: center; padding-top: 26px; }
.org > ul { padding-top: 0; }
.org li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 7px 0; }
.org > ul > li { padding-top: 0; }

/* connectors: each child draws half of the bar above it plus its own drop */
.org li::before, .org li::after {
  content: ""; position: absolute; top: 0; right: 50%;
  width: 50%; height: 26px; border-top: 1.5px solid var(--line-2);
}
.org li::after { right: auto; left: 50%; border-left: 1.5px solid var(--line-2); }
.org li:first-child::before, .org li:last-child::after { border: 0; }
.org li:last-child::before { border-right: 1.5px solid var(--line-2); border-top-right-radius: 12px; }
.org li:first-child::after { border-top-left-radius: 12px; }
.org li:only-child::before { display: none; }
.org li:only-child::after { border-top: 0; border-left: 1.5px solid var(--line-2); border-radius: 0; }
.org > ul > li::before, .org > ul > li::after { display: none; }
.org ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 1.5px solid var(--line-2); }

.node {
  position: relative; z-index: 1;
  display: grid; justify-items: center; gap: 1px;
  width: 138px; padding: 14px 10px 13px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  text-align: center; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.node:hover { border-color: var(--blue); box-shadow: 0 10px 24px -14px rgba(23, 71, 214, .55); transform: translateY(-1px); }
.node .av { margin-bottom: 7px; }
.node-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.node-meta { font-size: 11.5px; color: var(--slate); }
.node-earn { margin-top: 5px; padding: 1px 8px; border-radius: 999px; background: var(--blue-50); color: var(--blue); font-size: 12px; }
.node.is-you { background: var(--blue); border-color: var(--blue); color: #fff; cursor: default; }
.node.is-you:hover { transform: none; box-shadow: none; }
.node.is-you .av { background: rgba(255, 255, 255, .18); color: #fff; }
.node.is-you .node-meta { color: rgba(255, 255, 255, .78); font-family: var(--mono); letter-spacing: .1em; }
.new-dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse 2s infinite; }
.node-toggle {
  position: relative; z-index: 2; margin-top: -11px;
  min-width: 26px; height: 22px; padding: 0 7px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper);
  font: 600 11.5px/20px var(--mono); color: var(--slate); cursor: pointer;
}
.node-toggle:hover { border-color: var(--blue); color: var(--blue); }
.node-toggle[aria-expanded="false"] { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue); }
/* the toggle pill already covers 11px of the drop, so the line below it is shorter */
.org .node-toggle + ul { padding-top: 15px; }
.org .node-toggle + ul::before { height: 15px; }

@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(23, 71, 214, .45); } 100% { box-shadow: 0 0 0 16px rgba(23, 71, 214, 0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(23, 71, 214, .5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(23, 71, 214, 0); } }
.animate .node { animation: drop .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--d, 0) * 110ms); }
.node.is-revealed, .trow.is-revealed { animation: drop .4s cubic-bezier(.2, .7, .2, 1) both; }
.node.is-fresh { border-color: var(--blue); animation: drop .5s cubic-bezier(.2, .7, .2, 1) both, glow 1.4s ease-out .4s 2; }
.trow.is-fresh { animation: drop .5s cubic-bezier(.2, .7, .2, 1) both; background: var(--blue-50); }

/* list view: an outline with guide rails */
.tlist-you { display: flex; align-items: center; gap: 10px; padding: 10px 8px; font-size: 14px; }
.tlist-you .av { background: var(--blue); color: #fff; }
.tlist, .tlist ul { display: grid; }
.tlist { margin-left: 24px; border-left: 1.5px solid var(--line); padding-left: 6px; }
.tlist ul { margin-left: 22px; padding-left: 6px; border-left: 1.5px solid var(--line); }
.trow {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 4px;
  padding: 4px 8px 4px 0; border-radius: var(--radius-sm); transition: background-color .15s;
}
.trow:hover { background: var(--mist); }
.caret { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--slate); cursor: pointer; }
button.caret:hover { background: var(--paper); color: var(--blue); }
.caret .ico { width: 16px; height: 16px; transition: transform .15s; }
.caret[aria-expanded="true"] .ico { transform: rotate(90deg); }
.trow-main { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 6px 4px; border: 0; background: none; text-align: left; cursor: pointer; }
.trow-text { display: grid; min-width: 0; }
.trow-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-text small { font-size: 12.5px; color: var(--slate); }
.trow-earn { color: var(--blue); font-size: 13.5px; }

/* ---------- commissions ---------- */
.levels { display: grid; gap: 18px; margin-top: 20px; }
.lv-top { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px; }
.lv-name { font-weight: 600; font-size: 14px; }
.lv-rate { font-size: 13px; color: var(--slate); }
.lv-top b { font-size: 16px; }
.lv-bar { height: 6px; margin-top: 8px; border-radius: 6px; background: var(--mist); overflow: hidden; }
.lv-bar span { display: block; height: 100%; border-radius: 6px; background: var(--blue); }
.levels li:nth-child(2) .lv-bar span { background: #4f76e6; }
.levels li:nth-child(n + 3) .lv-bar span { background: #8ea8f0; }

.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 196px; margin-top: 18px; align-items: end; }
.bar { position: relative; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); height: 100%; min-width: 0; align-items: end; gap: 4px; text-align: center; }
.bar-fill { display: block; width: 100%; min-height: 0; border-radius: 5px 5px 2px 2px; background: var(--blue-100); transition: background-color .15s; align-self: end; }
.bar:hover .bar-fill { background: #b8cbff; }
.bar.is-current .bar-fill { background: var(--blue); }
.bar-value { visibility: hidden; font-size: 10.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar:hover .bar-value, .bar.is-current .bar-value { visibility: visible; }
.bar-value { justify-self: center; }
.bar:last-child .bar-value { justify-self: end; }
.bar:first-child .bar-value { justify-self: start; }
.bar-label { font-size: 11px; color: var(--slate); white-space: nowrap; }

.who { display: inline-flex; align-items: center; gap: 9px; }
.lvl { display: inline-block; padding: 2px 8px; border-radius: 6px; font: 600 11.5px var(--mono); }
.lvl-1 { background: var(--blue); color: #fff; }
.lvl-2 { background: var(--blue-100); color: var(--blue-ink); }
.lvl-3 { background: var(--mist); color: var(--ink-2); }
.load-more { display: flex; justify-content: center; margin-top: 20px; }

/* ---------- profile ---------- */
.kv { display: grid; }
.kv > div { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.kv > div:first-child { border-top: 0; }
.kv dt { font-size: 13px; color: var(--slate); }
.kv dd { font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.code-inline { font-size: 16px; letter-spacing: .14em; color: var(--blue-ink); }

/* ---------- empty states ---------- */
.empty-state {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 56px 24px; margin-top: 24px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius);
}
.empty-state h2 { font-size: 20px; font-weight: 650; font-stretch: 110%; }
.empty-state p { max-width: 48ch; color: var(--slate); margin-bottom: 8px; }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-50); color: var(--blue); margin-bottom: 4px; }
.empty-icon .ico { width: 24px; height: 24px; }

/* ---------- dialogs ---------- */
.dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: 18px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -24px rgba(11, 26, 51, .45);
}
.dialog-sm { width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(11, 26, 51, .38); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .22s cubic-bezier(.2, .7, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-body { padding: 24px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-head h2 { font-size: 19px; font-weight: 650; font-stretch: 108%; letter-spacing: -.01em; }
.dialog-head .icon-btn { margin: -6px -8px 0 auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.confirm-text { font-size: 15px; line-height: 1.6; }
.member-head { justify-content: flex-start; }
.member-head h2 { font-size: 18px; }

.steps { counter-reset: step; display: grid; gap: 14px; margin: 18px 0 20px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 4px 12px; align-items: start; font-size: 14px; }
.steps li::before {
  content: counter(step); grid-row: span 2;
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: var(--blue-50); color: var(--blue); font: 600 12px var(--mono);
}
.steps li .btn { justify-self: start; margin-top: 6px; }
.secret {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  margin-top: 8px; padding: 8px 6px 8px 14px; border-radius: var(--radius-sm); background: var(--mist);
}
.secret-label { font-size: 12px; font-weight: 600; color: var(--slate); min-width: 64px; }
.secret code { font: 500 12.5px/1.4 var(--mono); overflow-wrap: anywhere; color: var(--blue-ink); }
.note { margin-top: 12px; font-size: 12.5px; color: var(--ember-ink); }

/* ---------- payouts: member side ---------- */
.strip small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--slate); }
.com-pay { margin-top: 28px; }
.st { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.st .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.st-paid { background: var(--blue-50); color: var(--blue-ink); }
.st-unpaid { padding: 1px 7px; border: 1px solid var(--line-2); color: var(--ink-2); }

/* ---------- admin ---------- */
.adm-tabs { margin-top: 36px; }
.section-first { margin-top: 28px; }
.section-sub { margin: -10px 0 18px; font-size: 14px; max-width: 72ch; }
.empty-line { padding: 18px 0; color: var(--slate); border-top: 1px solid var(--line); }

/* rows: a list that reads like a table on desktop and still fits a phone */
.rows { display: grid; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 8px; }
.row-flat { grid-template-columns: minmax(0, 1fr) auto; }
.row-btn {
  width: 100%; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
  transition: background-color .15s;
}
.row-btn:hover { background: var(--mist); }
.row-text { display: grid; min-width: 0; }
.row-text b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text small { font-size: 12.5px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-amt { font-size: 15px; }
.row-col { display: grid; min-width: 0; font-size: 14px; }
.row-col > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-col small { font-size: 11.5px; color: var(--slate); white-space: nowrap; }
.row-col.r { text-align: right; }
.row-go { width: 16px; height: 16px; color: var(--slate); }
.mem-row { grid-template-columns: auto minmax(0, 1fr) minmax(0, 170px) 112px auto; gap: 16px; }

input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--blue); cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.pick-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 8px; font-size: 13.5px; }
.pick-head .check { font-weight: 600; }
.pay-row { gap: 10px; padding: 0 4px 0 8px; transition: background-color .15s; }
.pay-row:hover { background: var(--mist); }
.pay-row.is-picked { background: var(--blue-50); }
.pay-row .row-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0 12px 4px; min-width: 0; cursor: pointer; }
.paybar {
  position: sticky; bottom: 16px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 8px 8px 8px 18px;
  border-radius: var(--radius); background: var(--ink); color: #fff;
  box-shadow: 0 18px 40px -16px rgba(11, 26, 51, .5);
}
.paybar-text { font-size: 14px; color: rgba(255, 255, 255, .86); }
.paybar-text b { color: #fff; font-size: 16px; }
.paybar .btn[disabled] { opacity: 1; background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .55); }

.search { position: relative; max-width: 520px; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--slate); pointer-events: none; }
.search .input { padding-left: 42px; }
.search-meta { margin: 16px 0 10px; font-size: 13px; }

/* member detail */
.dialog-lg { width: min(680px, calc(100vw - 32px)); }
.member-head .mh-text { min-width: 0; }
.member-head .mh-text p { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-head > .icon-btn:first-child { margin: 0 -4px 0 -8px; }
.mem-strip { margin: 4px 0 6px; }
.mem-strip > div { padding: 12px 14px; }
.mem-strip dd { font-size: 19px; }
.chain { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; }
.chain .ico { width: 13px; height: 13px; color: var(--line-2); }
.link-btn { padding: 0; border: 0; background: none; color: var(--blue); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.move-box { margin-top: 16px; }
.move { margin-top: 12px; padding: 16px; border-radius: var(--radius-sm); background: var(--mist); }
.move-row { display: flex; gap: 8px; }
.move-row .input { flex: 1; min-width: 0; height: 40px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.move-row .input:disabled { background: var(--line); }
.field-msg.is-ok { color: var(--blue-ink); font-weight: 600; }
.move-top { margin-top: 12px; }
.move-note { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.dsec { margin-top: 26px; }
.dsec-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 14px; font-weight: 650; }
.dsec-title small { font-size: 12.5px; color: var(--slate); font-weight: 600; }
.dsec .row { padding-left: 0; padding-right: 0; }
.dsec .row-btn { padding-left: 6px; padding-right: 6px; }
.pay-sum { margin: 16px 0 18px; max-height: 240px; overflow-y: auto; }
.pay-sum .row { padding: 9px 0; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid-2, .grid-even { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(340px, 40%) 1fr; }
  .auth-panel { padding: 32px; }
}

@media (max-width: 820px) {
  :root { --gutter: 16px; }
  .nav { display: none; }
  .topbar-in { height: 56px; gap: 12px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 4px 0; font-size: 10.5px; font-weight: 500; color: var(--slate); }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--blue); }
  .page { padding: 24px var(--gutter) calc(96px + env(safe-area-inset-bottom)); }
  .page-head h1, .greet { font-size: 24px; }
  .page-head .btn span { display: none; }
  .page-head .btn { width: 40px; padding: 0; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .stats, .stats-8 { grid-template-columns: repeat(2, 1fr); }
  .stats .stat { padding: 14px 0 14px 14px; border-left: 1px solid var(--line); }
  .stats .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stats .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .stat dd { font-size: 18px; }

  .ticket, .ticket-compact { grid-template-columns: minmax(0, 1fr); }
  .ticket-side, .ticket-compact .ticket-side { display: grid; grid-template-columns: 1fr 1fr; border-left: 0; border-top: 1.5px dashed var(--blue-100); padding: 16px 20px 18px; }
  .ticket-side .btn-quiet { grid-column: span 2; }
  .ticket-side::before, .ticket-side::after { top: -9px; left: auto; bottom: auto; }
  .ticket-side::before { left: -8px; }
  .ticket-side::after { right: -8px; }
  .ticket-side .btn { padding: 0 10px; }
  .ticket-code { font-size: 28px; }

  .strip > div { padding: 12px 14px; }
  .strip dd, .strip-lg dd { font-size: 20px; }
  .pair b, .pair dd { font-size: 17px; }
  .auth { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .auth-mobile-brand { display: inline-flex; }
  .auth-top { justify-content: space-between; }
  .auth-form { margin-top: 24px; padding-top: 0; }
  .acct-login { font-size: 22px; }
  .dialog { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .dialog[open] { animation: sheet .25s cubic-bezier(.2, .7, .2, 1); }
  @keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .dialog-body { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .paybar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .mem-row { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; }
  .mem-row .row-up { display: none; }
  .adm-tabs { margin-top: 28px; }
}

@media (max-width: 560px) {
  .strip-stack { grid-template-columns: minmax(0, 1fr); }
  .strip-stack > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
  .strip-stack > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .strip-stack dt, .strip-stack small { grid-column: 1; }
  .strip-stack dd { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .paybar { padding-left: 14px; }
  .pay-row .row-main { grid-template-columns: minmax(0, 1fr) auto; }
  .pay-row .row-main .av { display: none; }
}

@media (max-width: 480px) {
  .topbar .lang button { padding: 4px 8px; }
  .brand > span { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; }
  .hero-head .seg { width: 100%; }
  .hero-head .seg button { flex: 1; }
  .delta { font-size: 13.5px; }
  .kv > div { grid-template-columns: 1fr; gap: 4px; }
  .bars { gap: 3px; }
  .bar-label { font-size: 9.5px; }
}

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

/* ======================================================================
   Gold Hunter licences
   ====================================================================== */

/* the auth panel picture when referrals are off: a licence card above a rising line */
.key-art .ka-card { fill: rgba(255, 255, 255, .12); stroke: rgba(255, 255, 255, .55); stroke-width: 1.5; }
.key-art .ka-chip { fill: rgba(255, 255, 255, .7); }
.key-art .ka-key { fill: #fff; font: 600 17px var(--mono); letter-spacing: .06em; }
.key-art .ka-dot { fill: #7fe3a6; }
.key-art .ka-line { stroke: rgba(255, 255, 255, .25); stroke-width: 1.5; }
.key-art .ka-chart { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 400; stroke-dashoffset: 400; animation: ka-draw 1.6s .3s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes ka-draw { to { stroke-dashoffset: 0; } }
.auth-forgot { margin: -6px 0 16px; text-align: right; font-size: 13.5px; }
.form-ok { margin-bottom: 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--blue-50); color: var(--blue-ink); font-size: 14px; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--mist); color: var(--ink-2); }
.pill-active { background: #e6f6ec; color: #17673a; }
.pill-expired { background: var(--ember-50); color: var(--ember-ink); }
.pill-suspended, .pill-pending { background: #fff4d6; color: #7a5300; }
.pill-revoked { background: #f1f2f5; color: #5d6578; text-decoration: line-through; }
.pill-kind { background: var(--blue-50); color: var(--blue-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-right: 7px; flex: none; }
.dot.is-on { background: #1fa45a; box-shadow: 0 0 0 3px rgba(31, 164, 90, .18); }
.warn-text { color: var(--ember-ink); font-weight: 600; }

/* customer: licence page */
.lic-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.lic-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: linear-gradient(180deg, var(--blue-50), var(--paper) 55%); }
.lic-card.is-expired, .lic-card.is-suspended, .lic-card.is-revoked { background: var(--paper); }
.lic-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.lic-plan { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lic-key { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px;
  padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--paper); }
.lic-key code { font-size: 22px; font-weight: 600; letter-spacing: .08em; color: var(--ink); word-break: break-all; }
.lic-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.lic-facts > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.lic-facts dt { font-size: 12px; color: var(--slate); }
.lic-facts dd { display: flex; align-items: center; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lic-facts small { font-size: 12px; color: var(--slate); line-height: 1.4; }
.lic-note { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ember-50); color: var(--ember-ink); font-size: 14px; }
.lic-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.lic-small { margin-top: 10px; font-size: 12.5px; }
.lic-empty .lic-actions { justify-content: center; }
.lic-steps { display: grid; gap: 16px; margin-top: 16px; }
.lic-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.lic-steps p { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; }
.copy-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; border-radius: var(--radius-sm); background: var(--mist); }
.copy-line code { font-size: 13.5px; word-break: break-all; }
.lic-presets { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; color: inherit; transition: border-color .15s; }
.lic-presets:hover { border-color: var(--blue); }
.lic-presets b { display: block; font-size: 15px; }
.lic-presets small { color: var(--slate); font-size: 13px; }
.lic-presets .more-link { grid-column: 2; }
.lic-presets-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); grid-row: span 2; }

/* admin: licences & orders */
.gh-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.gh-stat { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; transition: border-color .15s; }
.gh-stat:hover { border-color: var(--blue); }
.gh-stat span { font-size: 12.5px; color: var(--slate); }
.gh-stat b { font-size: 24px; }
.gh-stat.is-warn { border-color: #f0c873; background: #fffaf0; }
.gh-tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.gh-tools .search { flex: 1; min-width: 240px; }
.gh-filters { margin: 16px 0 4px; overflow-x: auto; }
.gh-note { margin: 14px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--mist); color: var(--ink-2); font-size: 13.5px; }
.gh-note-warn { background: #fff7e3; color: #6b4a00; }
.gh-row { grid-template-columns: minmax(0, 1.6fr) 100px 140px 120px minmax(120px, 160px) auto 18px; }
.ea-cell { display: inline-flex; align-items: center; }
.gh-cards { display: grid; gap: 12px; }
.gh-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.gh-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gh-card-head time { margin-left: auto; font-size: 13px; }
.gh-card-kv { display: grid; gap: 6px; margin-top: 12px; }
.gh-card-kv > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: 14px; }
.gh-card-kv dt { color: var(--slate); }
.gh-card-kv dd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.gh-card-kv .txid { word-break: break-all; font-size: 12.5px; }
.gh-card-kv .txid .more-link { font-family: var(--font); font-weight: 600; }
.gh-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.gh-card-foot { margin-top: 12px; font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gh-mail { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.gh-key { margin: 16px 0 6px; }
.gh-actions { margin: 18px 0 6px; padding: 16px; border-radius: var(--radius-sm); background: var(--mist); display: grid; gap: 14px; }
.gh-inline .move-row .input { text-transform: none; letter-spacing: 0; }
.gh-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.gh-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

@media (max-width: 1080px) {
  .gh-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gh-row { grid-template-columns: minmax(0, 1fr) 100px auto 18px; }
  .gh-row .row-col:nth-of-type(3), .gh-row .row-col:nth-of-type(4), .gh-row .row-col:nth-of-type(5) { display: none; }
}
@media (max-width: 820px) {
  .lic-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .gh-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lic-facts { grid-template-columns: 1fr; }
  .lic-key code { font-size: 18px; }
  .gh-row { grid-template-columns: minmax(0, 1fr) auto 18px; }
  .gh-row .row-col { display: none; }
  .gh-form { grid-template-columns: 1fr; }
  .gh-card-kv > div { grid-template-columns: 1fr; gap: 2px; }
  .gh-mail { grid-template-columns: minmax(0, 1fr) auto; }
  .gh-mail .pill-kind { display: none; }
}

/* ======================================================================
   Security: two-step login, masked keys, customer data deletion, activity log
   ====================================================================== */

.adm-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-tabs .seg button, .gh-filters .seg button { white-space: nowrap; }
.gh-banner { margin: -12px 0 18px; }
.gh-strip-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gh-mail { grid-template-columns: minmax(0, 1fr) auto auto; }
.gh-mail-tags { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.gh-key-note { margin-bottom: 6px; font-size: 12.5px; }
.notice-note { margin-top: 10px; font-size: 14px; line-height: 1.55; }

.tf-body { display: grid; gap: 14px; justify-items: start; margin-top: 14px; }
.tf-page .tf-body { margin-top: 0; }
.tf-body > * { max-width: 100%; }
.tf-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.tf-kv { width: 100%; }
.tf-error { margin: 0; }
.tf-steps { width: 100%; margin-top: 0; }
.tf-steps .copy-line { margin-bottom: 8px; }
.tf-secret { font-size: 15px; letter-spacing: .08em; color: var(--blue-ink); }
.tf-small { font-size: 12.5px; overflow-wrap: anywhere; }
.tf-enable { width: 100%; max-width: 360px; }
.tf-page { max-width: 680px; }
.tf-intro { max-width: 680px; margin: -12px 0 20px; }
.tf-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 16px 0; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--mist); }
.tf-codes code { font-size: 15px; letter-spacing: .06em; color: var(--ink); }
.tf-saved { margin-top: 18px; }
.tf-off-note { margin-bottom: 16px; font-size: 14px; }

.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 26px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); }
.danger-zone p { max-width: 46ch; font-size: 13.5px; color: var(--ink-2); }
.er-warn { margin-top: 0; }
.er-head { margin-top: 14px; font-size: 13px; font-weight: 650; }
.plain-list { display: grid; gap: 5px; margin: 6px 0 4px; padding-left: 20px; list-style: disc; font-size: 14px; color: var(--ink-2); }
.er-field { margin-top: 18px; }

.au-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
.au-tools .field-label { margin: 0; }
.au-tools select.input { width: auto; min-width: 220px; max-width: 100%; height: 40px; }
.au-row .row-text small { white-space: normal; overflow-wrap: anywhere; }
.au-row .au-details { color: var(--ink-2); }

@media (max-width: 1080px) {
  .gh-strip-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gh-strip-7 > :last-child { grid-column: span 2; }
}
@media (max-width: 560px) {
  .gh-strip-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gh-mail { grid-template-columns: minmax(0, 1fr) auto; }
  .gh-mail .btn { justify-self: start; }
  .gh-mail-tags { justify-content: flex-start; }
  .tf-codes { grid-template-columns: minmax(0, 1fr); }
  .au-tools select.input { min-width: 0; width: 100%; }
}

/* Shown only without JavaScript (index.html). A class, not an inline style: the CSP refuses those. */
.noscript { padding: 24px; font-family: sans-serif; }

/* Admin: "Reject selected" for orders and free sign-ups. */
.gh-select { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 6px 0 12px; }
.gh-card-sel { margin-left: auto; font-size: 13px; }
