/* apistore design system: bright white surfaces, electric blue gradients. */
:root {
  --bg: #f3f6ff;
  --surface: #ffffff;
  --surface-2: #f6f8ff;
  --line: #e3e9f8;
  --line-2: #d3dcf2;
  --text: #0a1433;
  --text-2: #3f4b75;
  --muted: #7884a6;
  --blue-1: #0a3dff;
  --blue-2: #2563ff;
  --blue-3: #3b9bff;
  --cyan: #22d3ee;
  --blue-soft: #eaf0ff;
  --grad: linear-gradient(120deg, #0a3dff 0%, #2563ff 38%, #3b9bff 72%, #22d3ee 100%);
  --grad-deep: linear-gradient(155deg, #0a2fd6 0%, #1d55ff 45%, #2f95ff 80%, #3fd0f5 100%);
  --glow: 0 14px 34px -12px rgb(37 99 255 / .6);
  --shadow: 0 1px 2px rgb(16 40 120 / .04), 0 12px 32px -14px rgb(30 70 200 / .18);
  --ok: #0c9b6a;
  --ok-soft: #e6f8f0;
  --warn: #b86b00;
  --warn-soft: #fff3df;
  --bad: #dc2f4b;
  --bad-soft: #fdebee;
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* Soft blue light in the background. */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(36% 30% at 12% 6%, rgb(37 99 255 / .16), transparent 70%),
    radial-gradient(30% 26% at 92% 2%, rgb(34 211 238 / .16), transparent 70%),
    radial-gradient(40% 34% at 70% 100%, rgb(59 130 255 / .10), transparent 70%);
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, 2%, 0) scale(1.05); } }

a { color: var(--blue-2); text-decoration: none; font-weight: 600; transition: color .15s ease; }
a:hover { color: var(--blue-1); }
h1, h2, h3 { margin: 0; }
h1 { font-size: 40px; font-weight: 800; line-height: 1.08; letter-spacing: -.035em; }
h2 { font-size: 15.5px; font-weight: 750; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 750; margin: 26px 0 8px; }
p { margin: 0; }
em, .grad-text {
  font-style: normal;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--blue-soft); border: 1px solid #dbe5ff; padding: 1px 7px; border-radius: 7px; color: #1d3fc4; }
td code { white-space: nowrap; }
pre { background: #f5f8ff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; margin: 8px 0 6px; color: #1b2a5c; line-height: 1.75; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus-visible { outline: 3px solid rgb(37 99 255 / .35); outline-offset: 2px; border-radius: 8px; }
::selection { background: rgb(37 99 255 / .2); }

/* ---- brand ---- */
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--grad-deep); color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), var(--glow);
}
.brand-text { font-size: 21px; font-weight: 800; letter-spacing: -.04em; }
.brand-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--blue-2);
  border: 1px solid #c9d7ff; border-radius: 99px; padding: 4px 10px 3px; background: #fff;
}

/* ---- buttons & inputs ---- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 20px; border-radius: 99px; border: 1px solid transparent;
  font: 700 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), var(--glow); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / .45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn-primary:hover:not(:disabled) { color: #fff; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 18px 40px -12px rgb(37 99 255 / .75); }
.btn-primary:hover:not(:disabled)::after { transform: translateX(120%); }
.btn-ghost { background: #fff; color: var(--text-2); border-color: var(--line-2); box-shadow: 0 1px 2px rgb(16 40 120 / .05); }
.btn-ghost:hover:not(:disabled) { color: var(--blue-2); border-color: #a9c0ff; background: #f7f9ff; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f6c3cc; }
.btn-danger:hover:not(:disabled) { background: var(--bad-soft); }
.btn-white { background: #fff; color: var(--blue-1); box-shadow: 0 14px 34px -12px rgb(0 20 120 / .5); }
.btn-white:hover:not(:disabled) { color: var(--blue-1); transform: translateY(-1px); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 12.5px; }
.btn-lg { height: 52px; padding: 0 30px; font-size: 15px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 700; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.input, select.input {
  height: 46px; padding: 0 15px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-2);
  background: #fff; color: var(--text); font: 500 14px var(--font); width: 100%; min-width: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: #a3adc8; }
.input:hover { border-color: #b8c7ec; }
.input:focus { outline: none; border-color: var(--blue-2); box-shadow: 0 0 0 4px rgb(37 99 255 / .14); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form-error { color: var(--bad); font-size: 13px; font-weight: 600; }
.form-error:empty { display: none; }

/* ---- surfaces ---- */
.card, .stat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 24px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin-top: 3px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { padding: 20px 22px; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s ease; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgb(16 40 120 / .04), 0 22px 44px -16px rgb(30 70 200 / .28); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 36px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 10px; }
/* Highlighted stat: full blue gradient. */
.stat.accent { background: var(--grad-deep); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.stat.accent::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -90px; border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / .28), transparent 65%); pointer-events: none;
}
.stat.accent .stat-label, .stat.accent .stat-foot, .stat.accent .stat-value small { color: rgb(255 255 255 / .78); }
.stat.accent .bar { background: rgb(255 255 255 / .25); }
.stat.accent .bar > i { background: #fff; box-shadow: 0 0 12px rgb(255 255 255 / .8); }
.bar { height: 6px; border-radius: 99px; background: #e8eefc; overflow: hidden; margin-top: 14px; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width .6s var(--ease); }
.bar.full > i { background: linear-gradient(90deg, #ff6b81, #dc2f4b); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; padding-top: 4px; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .15s ease; }
tbody tr:hover { background: #f6f9ff; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
td > .msg { display: inline-block; min-width: 220px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-completed, .b-active { color: var(--ok); background: var(--ok-soft); }
.b-failed, .b-banned, .b-revoked { color: var(--bad); background: var(--bad-soft); }
.b-queued, .b-processing { color: var(--warn); background: var(--warn-soft); }
.b-processing::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---- membership card (blue metal) ---- */
.mcard {
  --tilt: -7deg;
  position: relative; width: 100%; max-width: 400px; aspect-ratio: 1.586; border-radius: 24px; padding: 26px 28px;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; isolation: isolate; color: #fff;
  background:
    radial-gradient(80% 70% at 0% 0%, rgb(255 255 255 / .35), transparent 50%),
    radial-gradient(70% 60% at 100% 100%, rgb(34 211 238 / .55), transparent 60%),
    linear-gradient(135deg, #0a2fd6 0%, #1f5cff 45%, #3b9bff 80%, #45d4f5 100%);
  border: 1px solid rgb(255 255 255 / .45);
  box-shadow: 0 40px 70px -28px rgb(20 60 220 / .65), inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -20px 40px -20px rgb(0 20 120 / .35);
}
.mcard::before { /* engraved lines */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .22;
  background: repeating-radial-gradient(circle at 115% 125%, transparent 0 13px, rgb(255 255 255 / .55) 13px 14px);
}
.mcard::after { /* moving sheen */
  content: ""; position: absolute; inset: -40%; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgb(255 255 255 / .28) 50%, transparent 58%);
  animation: sheen 6s ease-in-out infinite;
}
@keyframes sheen { 0%, 50% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.mcard-top { display: flex; align-items: center; justify-content: space-between; }
.mcard-word { font-size: 24px; font-weight: 800; letter-spacing: -.04em; color: #fff; text-shadow: 0 2px 12px rgb(0 20 120 / .3); }
.mcard .brand-tag { color: #fff; background: rgb(255 255 255 / .16); border-color: rgb(255 255 255 / .5); backdrop-filter: blur(6px); }
.mcard-chip {
  width: 46px; height: 34px; border-radius: 8px; position: relative; margin-top: 4px;
  background: linear-gradient(135deg, #ffffff, #d6e2ff 45%, #a9c1ff 70%, #f1f5ff);
  box-shadow: inset 0 0 0 1px rgb(20 50 160 / .25), 0 4px 10px rgb(0 20 120 / .25);
}
.mcard-chip::before { content: ""; position: absolute; inset: 7px 0; border-top: 1px solid rgb(20 50 160 / .3); border-bottom: 1px solid rgb(20 50 160 / .3); }
.mcard-chip::after { content: ""; position: absolute; inset: 0 15px; border-left: 1px solid rgb(20 50 160 / .3); border-right: 1px solid rgb(20 50 160 / .3); }
.mcard-num { font: 600 17px/1 var(--mono); letter-spacing: .16em; color: #fff; text-shadow: 0 1px 8px rgb(0 20 120 / .35); }
.mcard-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mcard-bottom small { display: block; font-size: 9px; letter-spacing: .22em; color: rgb(255 255 255 / .72); font-weight: 800; margin-bottom: 4px; }
.mcard-bottom b { font-weight: 800; font-size: 14.5px; letter-spacing: .1em; text-transform: uppercase; }
.float { animation: float 7s ease-in-out infinite; transform: perspective(1200px) rotateY(var(--tilt)) rotateX(5deg); }
@keyframes float { 50% { transform: perspective(1200px) rotateY(calc(var(--tilt) * -.4)) rotateX(2deg) translateY(-12px); } }

/* ---- app shell: blue gradient sidebar, white content ---- */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  background: var(--grad-deep); color: #fff; padding: 24px 16px;
  box-shadow: 10px 0 40px -20px rgb(20 60 220 / .5);
}
.sidebar::before, .sidebar::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; }
.sidebar::before { width: 340px; height: 340px; left: -140px; top: -120px; background: radial-gradient(circle, rgb(255 255 255 / .22), transparent 65%); }
.sidebar::after { width: 420px; height: 420px; right: -220px; bottom: -160px; background: radial-gradient(circle, rgb(34 211 238 / .55), transparent 65%); }
.sidebar > .brand { padding: 0 8px 30px; color: #fff; }
.sidebar .brand-mark { background: #fff; color: var(--blue-1); box-shadow: 0 10px 24px -8px rgb(0 20 120 / .5); }
.nav-label { font-size: 10.5px; font-weight: 800; letter-spacing: .2em; color: rgb(255 255 255 / .6); padding: 0 12px 10px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
  color: rgb(255 255 255 / .84); font-weight: 650; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: rgb(255 255 255 / .14); color: #fff; }
.nav a.active { background: #fff; color: var(--blue-1); box-shadow: 0 12px 26px -10px rgb(0 20 120 / .55); }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgb(255 255 255 / .2); padding: 16px 8px 0; display: flex; align-items: center; gap: 11px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; text-transform: uppercase; background: #fff; color: var(--blue-1); font-weight: 800; font-size: 15px; box-shadow: 0 6px 16px -6px rgb(0 20 120 / .5); }
.who { min-width: 0; flex: 1; }
.who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 11.5px; color: rgb(255 255 255 / .72); }
.icon-btn { background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .2); color: #fff; border-radius: 11px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; transition: background-color .15s ease; }
.icon-btn:hover { background: rgb(255 255 255 / .22); }
.icon-btn svg { width: 17px; height: 17px; }

.content { min-width: 0; padding: 44px 48px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .eyebrow { display: inline-block; margin-bottom: 10px; }
.page-head p { color: var(--muted); margin-top: 8px; font-weight: 500; }
.page { max-width: 1160px; animation: page-in .45s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

.welcome { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 18px; margin-bottom: 16px; align-items: stretch; }
.welcome .mcard { max-width: none; height: 100%; }
.welcome .stats { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome .mcard { max-width: 400px; height: auto; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: sticky; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; }
  .sidebar > .brand { padding: 0; }
  .sidebar .brand-text, .nav-label, .who { display: none; }
  .nav { flex-direction: row; overflow-x: auto; flex: 1; scrollbar-width: none; }
  .nav a { padding: 8px 13px; white-space: nowrap; border-radius: 99px; }
  .nav a svg { display: none; }
  .sidebar-foot { margin: 0; border: 0; padding: 0; }
  .sidebar-foot .avatar { display: none; }
  .content { padding: 26px 16px 56px; }
  h1 { font-size: 30px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 30px; }
}

/* ---- playground ---- */
.pg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.pg-form { display: flex; flex-direction: column; gap: 16px; }
.pg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
textarea.input { height: auto; min-height: 120px; padding: 12px 15px; line-height: 1.55; resize: vertical; font: 500 14px/1.55 var(--font); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; background: #eef2fc; border-radius: 14px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 10px; font: 700 14px var(--font); color: var(--text-2); cursor: pointer; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.seg button.active { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.drop {
  display: grid; place-items: center; min-height: 96px; padding: 14px; border: 1.5px dashed #b9c8ef; border-radius: var(--radius-sm);
  background: #f7f9ff; color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.drop:hover { border-color: var(--blue-2); background: #f0f4ff; color: var(--blue-2); }
.drop img { max-height: 160px; max-width: 100%; border-radius: 10px; }
.pg-submit { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.pg-out { position: sticky; top: 24px; }
.pg-stage {
  position: relative; display: grid; place-items: center; min-height: 340px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(80% 70% at 30% 20%, rgb(37 99 255 / .08), transparent 70%), #f5f8ff; border: 1px solid var(--line);
}
.pg-stage video, .pg-stage img { display: block; width: 100%; max-height: 560px; object-fit: contain; background: #0b1533; }
.pg-dl { position: absolute; right: 12px; bottom: 12px; }
.pg-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 20px; text-align: center; }
.pg-empty b { font-size: 16px; }
.pg-empty span { color: var(--muted); font-size: 13px; max-width: 340px; }
.pg-spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #dbe5ff; border-top-color: var(--blue-2); animation: spin .9s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pg-progress { width: 220px; height: 5px; border-radius: 99px; background: #e3eaff; overflow: hidden; margin-top: 10px; }
.pg-progress i { display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--grad); animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: block; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer;
  background: #0b1533; aspect-ratio: 16 / 10; text-align: left; transition: transform .2s var(--ease), box-shadow .2s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -14px rgb(30 70 200 / .45); }
.tile video, .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-tag { position: absolute; top: 8px; left: 8px; background: rgb(255 255 255 / .9); color: var(--blue-1); font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 99px; }
.tile-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(transparent, rgb(5 15 50 / .85)); }
@media (max-width: 1000px) {
  .pg { grid-template-columns: 1fr; }
  .pg-out { position: static; }
}
@media (max-width: 520px) {
  .pg-grid { grid-template-columns: 1fr 1fr; }
  .pg-stage { min-height: 240px; }
}

/* ---- API docs ---- */
.docs .card h2 { font-size: 19px; }
.docs pre { position: relative; padding-right: 76px; }
.docs pre.json { background: #f8faff; }
.steps { margin: 12px 0 0; padding-left: 20px; line-height: 1.9; color: var(--text-2); }
.method { display: inline-block; font: 700 10.5px/1 var(--mono); letter-spacing: .04em; padding: 4px 7px; border-radius: 6px; vertical-align: middle; }
.method.get { color: #0c7a55; background: var(--ok-soft); }
.method.post { color: #1d3fc4; background: var(--blue-soft); }
.method.ok { color: #0c7a55; background: var(--ok-soft); }
.code-tabs { margin-top: 6px; }
.tab-bar { display: flex; gap: 4px; padding: 4px; background: #eef2fc; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab-bar button { border: 0; background: transparent; color: var(--text-2); font: 700 12.5px var(--font); padding: 7px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.tab-bar button:hover { color: var(--blue-2); }
.tab-bar button.active { background: #fff; color: var(--blue-1); box-shadow: 0 2px 8px -2px rgb(30 70 200 / .25); }
.copy-btn {
  position: absolute; top: 10px; right: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--text-2);
  font: 700 11.5px var(--font); padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.copy-btn:hover { color: var(--blue-2); border-color: #a9c0ff; }
@media (max-width: 860px) {
  .docs pre { padding-top: 48px; padding-right: 18px; } /* copy button gets its own row above the code */
}

/* ---- dialog & toast ---- */
dialog.ui {
  border: 0; border-radius: 26px; color: var(--text); background: #fff;
  padding: 28px; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 40px 100px -24px rgb(16 40 140 / .45);
}
dialog.ui.wide { width: min(820px, calc(100vw - 32px)); }
dialog.ui h2 { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
dialog.ui[open] { animation: dialog-in .28s var(--ease); }
dialog.ui::backdrop { background: rgb(12 28 90 / .35); backdrop-filter: blur(6px); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.dialog-body { display: flex; flex-direction: column; gap: 16px; }
.dialog-body > p { color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.secret {
  font-family: var(--mono); font-size: 13px; word-break: break-all; white-space: pre-wrap; line-height: 1.8;
  background: #f3f7ff; border: 1.5px dashed #9fb8ff; color: #1638c8; border-radius: 14px; padding: 16px 18px;
}
.warn-note { font-size: 13px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border: 1px solid #ffdfa8; border-radius: 14px; padding: 12px 16px; }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue-2); color: var(--text); font-weight: 600;
  padding: 12px 16px; border-radius: 14px; font-size: 13px; box-shadow: 0 18px 40px -12px rgb(16 40 140 / .35); animation: dialog-in .25s var(--ease); max-width: calc(100vw - 36px);
}
.toast.error { border-left-color: var(--bad); }

/* ---- auth pages: blue showcase left, white form right ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff; }
.auth-show {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 56px;
  overflow: hidden; isolation: isolate; color: #fff; background: var(--grad-deep);
}
.auth-show::before, .auth-show::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; }
.auth-show::before { width: 620px; height: 620px; left: -200px; top: -240px; background: radial-gradient(circle, rgb(255 255 255 / .28), transparent 62%); }
.auth-show::after { width: 700px; height: 700px; right: -260px; bottom: -300px; background: radial-gradient(circle, rgb(63 208 245 / .7), transparent 62%); }
.auth-show .brand { color: #fff; }
.auth-show .brand-mark { background: #fff; color: var(--blue-1); }
.auth-show .mcard { margin: 40px 0; max-width: 420px; }
.auth-show blockquote { margin: 0; max-width: 460px; font-size: 26px; font-weight: 800; line-height: 1.3; letter-spacing: -.03em; }
.auth-show cite { display: block; margin-top: 14px; font-size: 12.5px; color: rgb(255 255 255 / .75); font-style: normal; font-weight: 600; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 40px; margin: 12px 0 10px; }
.auth-card .lead { color: var(--muted); margin-bottom: 30px; font-weight: 500; }
.auth-card form { display: flex; flex-direction: column; gap: 18px; }
.auth-card .btn { height: 52px; margin-top: 6px; font-size: 15px; }
.auth-foot { color: var(--muted); font-size: 12.5px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.auth-mobile-brand { display: none; margin-bottom: 28px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-show { display: none; }
  .auth-mobile-brand { display: inline-flex; }
}

/* ---- landing ---- */
.landing { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1180px; width: 100%; margin: 0 auto; padding: 24px 20px; }
.hero-wrap { position: relative; isolation: isolate; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center;
  max-width: 1180px; width: 100%; margin: 0 auto; padding: 48px 20px 80px;
}
.hero h1 { font-size: clamp(44px, 6.4vw, 80px); line-height: 1.02; letter-spacing: -.05em; margin: 22px 0 22px; }
.hero p { color: var(--text-2); font-size: 17px; max-width: 520px; line-height: 1.7; font-weight: 500; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.hero-art { display: grid; place-items: center; position: relative; }
.hero-art::before { content: ""; position: absolute; width: 90%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgb(37 99 255 / .28), rgb(34 211 238 / .12) 45%, transparent 68%); filter: blur(10px); }
.hero-art .mcard { max-width: 450px; }
.strip { max-width: 1180px; width: calc(100% - 40px); margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.strip div { padding: 26px 26px; border-left: 1px solid var(--line); }
.strip div:first-child { border-left: 0; }
.strip b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.strip span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1180px; width: 100%; margin: 0 auto; padding: 80px 20px; }
.features-head { grid-column: 1 / -1; margin-bottom: 14px; }
.features-head h2 { font-size: 42px; font-weight: 800; letter-spacing: -.045em; line-height: 1.1; margin-top: 12px; }
.features .card + .card { margin-top: 0; }
.feature { padding: 30px; transition: transform .25s var(--ease), box-shadow .25s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgb(16 40 120 / .04), 0 26px 50px -18px rgb(30 70 200 / .3); }
.feature .ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--grad-deep); color: #fff; margin-bottom: 22px; box-shadow: var(--glow); }
.feature .ico svg { width: 22px; height: 22px; }
.feature b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 13.5px; line-height: 1.7; font-weight: 500; }
.cta-band {
  max-width: 1180px; width: calc(100% - 40px); margin: 0 auto 64px; padding: 48px; border-radius: 32px; position: relative; overflow: hidden; isolation: isolate;
  background: var(--grad-deep); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; box-shadow: var(--glow);
}
.cta-band::before { content: ""; position: absolute; width: 500px; height: 500px; right: -160px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / .3), transparent 65%); z-index: -1; }
.cta-band h2 { font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1.15; max-width: 560px; }
.cta-band p { color: rgb(255 255 255 / .8); margin-top: 8px; font-weight: 500; }
.landing-foot { max-width: 1180px; width: 100%; margin: auto auto 0; padding: 24px 20px 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; font-weight: 500; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-top: 24px; }
  .hero-art .mcard { max-width: 360px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip div:nth-child(3) { border-left: 0; }
  .strip div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .features { grid-template-columns: 1fr; padding: 56px 20px; }
  .features-head h2 { font-size: 32px; }
  .cta-band { padding: 32px 24px; }
  .cta-band h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- legal page ---- */
.legal { max-width: 820px; width: 100%; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 16px; }
.legal h1 { font-size: clamp(34px, 5vw, 48px); margin: 8px 0 4px; }
.legal .card h2 { margin-bottom: 10px; }
.legal .card p, .legal .card li { color: var(--text-2); line-height: 1.75; }
.legal .card p + p { margin-top: 10px; }
.legal ul { margin: 8px 0 0; padding-left: 20px; }
.legal li + li { margin-top: 4px; }

/* ---- webhook settings ---- */
.wh-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.wh-row .input { flex: 1; min-width: 240px; }
.wh-secret { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.wh-secret code { flex: 1; min-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- report ---- */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding: 8px 0 0; border-bottom: 1px solid var(--line); }
.chart .col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.chart .col i { display: block; border-radius: 4px 4px 0 0; min-height: 0; }
.chart .col i.v { background: var(--blue-2); }
.chart .col i.g { background: #8fb4ff; }
.chart .col:hover::after {
  content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px;
  background: var(--text); color: #fff; font-size: 11.5px; font-weight: 600; padding: 5px 8px; border-radius: 7px; white-space: nowrap; z-index: 2; pointer-events: none;
}
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.money-pos { color: var(--ok); }
.money-neg { color: var(--bad); }
.legal .card + .card { margin-top: 0; }
