/* developers.ukisai.com. Same visual system as platform.ukisai.com and ukisai.com: black canvas,
   Avenir (Roman and Black are the only cuts the brand ships), pill controls, and the brand mosaic
   on the primary call to action. */

@font-face {
  font-family: "Avenir";
  src: url("/assets/fonts/Avenir-Roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Avenir";
  src: url("/assets/fonts/Avenir-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0b0b0d;
  --raised: #141416;
  --hover: #1c1c1e;
  --control: #242426;
  --control-hover: #2e2e31;
  --field: #2c2c2e;
  --line: rgb(255 255 255 / 10%);
  --line-strong: rgb(255 255 255 / 16%);
  --text: #ededed;
  --muted: #b5b5b5;
  --faint: #8e8e93;
  --accent: #a98cf6;
  --accent-soft: #c9a9f4;
  --pink: #edaef9;
  --sky: #84cbff;
  --danger: #ff7a7a;
  --font: "Avenir", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-color: #2c2c2e transparent; scrollbar-width: thin; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #ac2ee7; color: #fff; }

a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent); text-underline-offset: 3px; }
a.link:hover, .prose a:hover { text-decoration-color: var(--accent); }

h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.022em; color: var(--text); text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 17px; line-height: 1.3; }
h3 { font-size: 15px; line-height: 1.35; }
p { margin: 0; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
[hidden] { display: none !important; }

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

code, pre, kbd { font-family: var(--mono); }
:not(pre) > code {
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--raised);
  color: var(--text);
  overflow-wrap: anywhere;
}

.num { font-variant-numeric: tabular-nums; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons. Pills for controls; the mosaic banner is the one primary action per screen. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 100ms ease-out;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-light { background: #f5f5f7; color: #000; font-weight: 900; }
.btn-light:hover:not(:disabled) { background: #fff; }
.btn-control { background: var(--control); border-color: var(--line); color: #f5f5f7; }
.btn-control:hover:not(:disabled) { background: var(--control-hover); border-color: var(--line-strong); }
.btn-ghost { background: transparent; color: var(--muted); padding: 0 12px; }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 52px; font-size: 15px; }

.banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 300px;
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid #242431;
  border-radius: 999px;
  background: #060609;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  isolation: isolate;
  transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease-out;
}
.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at bottom left, rgb(132 59 183 / 8%), transparent 50%),
    radial-gradient(ellipse at top right, rgb(63 126 215 / 8%), transparent 50%);
  pointer-events: none;
}
.banner:hover:not(:disabled) { border-color: #394566; background: #10131e; }
.banner:active:not(:disabled) { transform: scale(0.985); }
.banner-label { position: relative; z-index: 1; max-width: calc(100% - 150px); text-align: center; }

.mosaic-frame { position: absolute; inset: 1px; border-radius: inherit; overflow: hidden; pointer-events: none; }
.mosaic-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 4px 1px #060609; }
.mosaic { --tile: 11px; --gap: 2.5px; position: absolute; top: 50%; display: grid; grid-template-columns: repeat(9, var(--tile)); grid-template-rows: repeat(4, var(--tile)); gap: var(--gap); transform: translateY(-50%); }
.mosaic.left { left: 0; }
.mosaic.right { right: 0; }
.tile { width: var(--tile); height: var(--tile); border-radius: 1.5px; background: var(--c); opacity: var(--o); }
.tile.diamond { transform: scale(0.75) rotate(45deg); animation: glint 6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes glint { 0%, 76%, 100% { filter: brightness(1); } 86% { filter: brightness(1.25); } }
@media (max-width: 360px) { .mosaic { --tile: 7.5px; --gap: 2px; } .banner { min-width: 0; } }

/* Inputs */
.input {
  height: 40px;
  min-width: 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hover);
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: color-mix(in oklab, var(--accent) 60%, transparent); background: color-mix(in oklab, #a98cf6 10%, #1c1c1e); }

.field-group { width: 100%; overflow: hidden; border-radius: 22px; background: var(--field); text-align: start; }
.field { display: flex; min-height: 52px; flex-direction: column; justify-content: center; padding: 5px 20px; transition: background-color 180ms ease; }
.field:focus-within { background: color-mix(in oklab, #a98cf6 22%, #2c2c2e); }
.field span { font-size: 12px; line-height: 1.2; letter-spacing: 0.01em; color: color-mix(in oklab, white 58%, #1c1c1e); }
.field input { width: 100%; padding: 0; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--text); }
.field input::placeholder { color: #8e8e93; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #a855f7; flex: none; }

/* Segmented control, used for ranges and code languages */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--raised); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--faint); font-size: 13px; transition: background-color 150ms ease, color 150ms ease; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--field); color: var(--text); }

/* Code */
.code { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--line); }
.code-head .seg { background: transparent; padding: 0; }
.code-title { padding-left: 6px; font-size: 13px; color: var(--faint); }
.copy { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); font-size: 13px; }
.copy:hover { background: var(--hover); color: var(--text); }
.copy.done { color: var(--sky); }
.code pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font-size: 13px; line-height: 1.7; color: #e4e4e7; tab-size: 2; }
.tok-s { color: var(--pink); }
.tok-k { color: var(--accent-soft); }
.tok-n { color: var(--sky); }
.tok-c { color: #6e6e73; }
.tok-f { color: #f5f5f7; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -2px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { padding: 0 14px 10px 2px; text-align: left; font-weight: 400; font-size: 13px; color: var(--faint); white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data td { padding: 13px 14px 13px 2px; border-bottom: 1px solid var(--line); color: var(--text); white-space: nowrap; vertical-align: middle; }
table.data .r { text-align: right; padding-right: 2px; }
table.data th.r { padding-right: 2px; }
table.data tfoot td { border-bottom: 0; font-weight: 900; }
table.data tr.current td { background: color-mix(in oklab, #a98cf6 7%, transparent); }
table.data td .tag { margin-left: 8px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 12px; line-height: 1.5; vertical-align: 1px; }
.tag.accent { background: color-mix(in oklab, #a98cf6 16%, transparent); color: var(--accent-soft); }

.empty { padding: 28px 0; color: var(--faint); font-size: 14px; }
.error { color: var(--danger); font-size: 14px; }
.ok { color: var(--sky); font-size: 14px; }

/* ===== Sign-in (same composition as platform.ukisai.com/auth) ===== */
.auth { position: relative; min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.auth::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 55% at 50% -10%, color-mix(in oklab, #5b3ccc 14%, transparent), transparent 70%);
}
.auth-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 24px 32px; }
.auth-top img { display: block; height: 32px; width: auto; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 384px; margin: auto; padding: 0 24px 15vh; display: flex; flex-direction: column; align-items: stretch; gap: 16px; text-align: center; }
.auth-card h1 { margin-bottom: 24px; }
.auth-card .btn-block { font-weight: 400; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; margin: 8px 0; color: color-mix(in oklab, white 45%, #1c1c1e); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: color-mix(in oklab, white 12%, transparent); }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.field + .field { position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 1px; background: #3a3a3c; }
.auth-links { display: flex; justify-content: center; gap: 24px; margin-top: 16px; }
.auth-fine { margin-top: 24px; font-size: 13px; line-height: 1.6; color: var(--faint); }
.auth-note { font-size: 15px; color: var(--muted); }
.text-btn { border: 0; background: transparent; color: var(--accent); font-size: 15px; }
.text-btn:hover { color: var(--accent-soft); }

/* ===== Console ===== */
.console { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 28px; padding: 22px 14px 18px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.brand img { display: block; height: 26px; width: auto; }
.brand span { padding-left: 10px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 15px; line-height: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-foot a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-size: 14.5px; transition: background-color 150ms ease, color 150ms ease; }
.side-nav a:hover, .side-foot a:hover { background: var(--raised); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--hover); color: var(--text); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.me { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 12px 4px 0 12px; border-top: 1px solid var(--line); }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--faint); }

.view { width: 100%; max-width: 1000px; padding: 44px clamp(20px, 5vw, 64px) 96px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.block + .block { margin-top: 56px; }
.block > h2 { margin-bottom: 16px; }
.spaced { margin-top: 36px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row .input { flex: 1 1 220px; max-width: 360px; }
.view .notice { margin-bottom: 32px; }
.notice { padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 14px; color: var(--muted); }
.notice.warn { border-color: color-mix(in oklab, var(--danger) 35%, transparent); color: #ffb3b3; }
.notice.good { border-color: color-mix(in oklab, var(--sky) 35%, transparent); color: #c5e6ff; }

.balance { font-size: 40px; line-height: 1; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.balance-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* Quickstart steps: a real sequence, so they are numbered. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 18px; padding-bottom: 44px; counter-increment: step; }
.steps > li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 13px; font-weight: 900; color: var(--muted); background: var(--bg); position: relative; z-index: 1; }
.steps > li::after { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps > li > div { min-width: 0; padding-top: 3px; }
.steps h2 { margin-bottom: 16px; }

.reveal { margin-top: 14px; padding: 14px 14px 14px 18px; border: 1px solid color-mix(in oklab, #a98cf6 40%, transparent); border-radius: 14px; background: color-mix(in oklab, #a98cf6 6%, var(--panel)); }
.reveal-key { display: flex; align-items: center; gap: 10px; }
.reveal-key code { flex: 1; min-width: 0; padding: 0; background: none; font-size: 13.5px; overflow-wrap: anywhere; }
.reveal p { margin-top: 8px; font-size: 13px; color: var(--muted); }

.amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.amounts button { height: 40px; min-width: 64px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.amounts button:hover { border-color: var(--line-strong); color: var(--text); }
.amounts button[aria-pressed="true"] { border-color: color-mix(in oklab, #a98cf6 60%, transparent); background: color-mix(in oklab, #a98cf6 12%, transparent); color: var(--text); }
.amount-custom { position: relative; width: 120px; }
.amount-custom::before { content: "$"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 14px; pointer-events: none; }
.amount-custom .input { width: 100%; padding-left: 28px; font-variant-numeric: tabular-nums; }
.topup { display: flex; flex-direction: column; gap: 20px; max-width: 520px; }
.topup .banner { max-width: 360px; }

@media (max-width: 860px) {
  .console { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { position: sticky; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 10px 8px; padding: 12px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); background: rgb(0 0 0 / 88%); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .brand { padding: 0; }
  .brand img { height: 22px; }
  .side-nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { flex: none; height: 34px; }
  .side-nav a .icon { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .side-foot a { height: 34px; }
  .me { margin: 0; padding: 0; border: 0; }
  .me span { display: none; }
  .view { padding-top: 28px; }
  .balance { font-size: 34px; }
}

/* ===== Docs and terms ===== */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgb(0 0 0 / 88%); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar .brand { padding: 0; }
.docs { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.docs-nav { position: sticky; top: 64px; height: calc(100dvh - 64px); overflow-y: auto; padding: 28px 16px 40px; border-right: 1px solid var(--line); scrollbar-width: none; }
.docs-nav h2 { margin: 22px 0 6px; padding: 0 12px; font-size: 13.5px; }
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav a { display: block; padding: 7px 12px; border-radius: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.35; transition: background-color 150ms ease, color 150ms ease; }
.docs-nav a:hover { background: var(--raised); color: var(--text); }
.docs-nav a[aria-current="true"] { background: var(--hover); color: var(--text); }
.prose { min-width: 0; width: 100%; max-width: 880px; margin: 0 auto; padding: 44px clamp(20px, 5vw, 72px) 160px; color: var(--muted); }
.prose h1 { font-size: 36px; line-height: 1.1; margin-bottom: 14px; }
.prose > section { scroll-margin-top: 88px; }
.prose > section + section { margin-top: 64px; padding-top: 0; }
.prose h2 { font-size: 24px; line-height: 1.2; margin-bottom: 14px; scroll-margin-top: 88px; }
.prose h3 { font-size: 16px; margin: 28px 0 10px; }
.prose p { max-width: 68ch; margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; max-width: 68ch; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--text); font-weight: 900; }
.prose .code, .prose .table-wrap { margin: 18px 0 22px; }
.prose table.data td { white-space: normal; }
.prose table.data td:first-child { white-space: nowrap; }
.lede { font-size: 17px; color: var(--muted); }
.terms { max-width: 760px; margin: 0 auto; }
.terms h2 { margin-top: 40px; }
.terms ul { margin-bottom: 0; }

@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { position: sticky; top: 64px; z-index: 15; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); background: rgb(0 0 0 / 88%); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .docs-nav h2 { display: none; }
  .docs-nav a { flex: none; padding: 6px 12px; font-size: 14px; }
  .prose { padding-top: 32px; }
  .prose > section, .prose h2 { scroll-margin-top: 130px; }
  .prose h1 { font-size: 30px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 420px) {
  .copy span { display: none; }
  .code-head .seg button { padding: 0 9px; }
  .steps > li { column-gap: 12px; }
}

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