/* Noto Sans (SIL Open Font License 1.1) ships with the console: Linux browsers otherwise
   substitute a serif for named fonts they lack. */
@font-face { font-family: "Vylra Sans"; src: url("/console/static/NotoSans-Regular.ttf") format("truetype");
  font-weight: 100 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Vylra Sans"; src: url("/console/static/NotoSans-Bold.ttf") format("truetype");
  font-weight: 600 900; font-style: normal; font-display: swap; }

/* Vylra console. Brand: teal hsl(178 52% 52%), coral accent hsl(14 100% 64%), deep navy in
   the dark; the Kente pattern tone on tone, as on the app and the website. */
:root {
  --bg: hsl(200 30% 97%); --panel: #ffffff; --ink: hsl(222 47% 11%); --muted: hsl(209 25% 42%);
  --line: hsl(205 25% 89%); --field: hsl(200 30% 98%);
  --brand: hsl(178 52% 40%); --brand-strong: hsl(178 55% 32%); --brand-soft: hsl(178 45% 94%);
  --brand-ink: #ffffff; --accent: hsl(14 100% 64%);
  --ok: hsl(158 64% 28%); --warn: hsl(32 100% 32%); --bad: hsl(352 66% 46%);
  --ok-bg: hsl(152 50% 93%); --warn-bg: hsl(40 100% 92%); --bad-bg: hsl(352 80% 95%);
  --side: hsl(216 30% 10%); --side-ink: hsl(213 20% 78%); --side-line: hsl(216 22% 18%);
  --radius: 14px; --shadow: 0 1px 2px rgba(10, 20, 30, .05), 0 8px 24px rgba(10, 20, 30, .06);
  --pattern: url("/console/static/kente-light.svg");
  font-family: "Vylra Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(216 28% 9%); --panel: hsl(216 25% 12%); --ink: hsl(210 20% 94%);
    --muted: hsl(213 15% 62%); --line: hsl(216 20% 20%); --field: hsl(216 28% 8%);
    --brand: hsl(178 52% 48%); --brand-strong: hsl(178 52% 56%); --brand-soft: hsl(178 40% 14%);
    --ok: hsl(152 55% 60%); --warn: hsl(38 95% 62%); --bad: hsl(352 85% 70%);
    --ok-bg: hsl(158 45% 14%); --warn-bg: hsl(36 60% 14%); --bad-bg: hsl(352 50% 16%);
    --side: hsl(216 32% 6%); --pattern: url("/console/static/kente-dark.svg");
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); background: var(--bg); }
body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  background-image: var(--pattern); background-size: 120px 96px; min-height: 100vh; }
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 48px; color: var(--muted); }

/* ---- Sign in ----------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; overflow: hidden; color: #eaf6f6; padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    radial-gradient(900px 520px at 12% 0%, hsl(178 52% 40% / .55), transparent 60%),
    radial-gradient(700px 520px at 100% 100%, hsl(14 100% 64% / .22), transparent 55%),
    url("/console/static/kente-panel.svg") 0 0 / 120px 96px,
    hsl(216 32% 8%); }
.auth-logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.auth-logo img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: rgba(255, 255, 255, .06); }
.auth-logo .tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: hsl(178 60% 70%); border: 1px solid hsl(178 50% 50% / .45); padding: 2px 8px; border-radius: 999px; }
.auth-pitch h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.12; margin: 0 0 14px; letter-spacing: -.02em; color: #fff; }
.auth-pitch h1 span { color: hsl(178 60% 66%); }
.auth-pitch p { margin: 0; max-width: 460px; color: hsl(195 20% 78%); font-size: 15px; }
.auth-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; max-width: 460px; }
.auth-points li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.auth-points .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .09); }
.auth-points .ico svg { width: 18px; height: 18px; stroke: hsl(178 60% 70%); fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.auth-points b { display: block; color: #fff; font-weight: 600; }
.auth-points span { color: hsl(195 18% 72%); font-size: 13px; }
.auth-foot { font-size: 12px; color: hsl(195 15% 62%); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.auth-card .sub { margin: 4px 0 0; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; }
.input { position: relative; display: flex; align-items: center; }
.input input { width: 100%; }
.input .reveal { position: absolute; right: 6px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 8px; border-radius: 8px; min-height: 32px; }
.input .reveal:hover { color: var(--ink); background: var(--brand-soft); }
.hint { font-size: 12px; color: var(--warn); min-height: 0; }
.auth-card .btn { width: 100%; min-height: 46px; font-size: 15px; }
.secure { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.secure svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Controls ---------------------------------------------------------------------- */
input, select { border: 1px solid var(--line); background: var(--field); border-radius: 11px;
  padding: 11px 13px; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: hsl(178 30% 70%); }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px hsl(178 52% 45% / .22); }
button:focus-visible, a:focus-visible { outline: 3px solid hsl(178 52% 45% / .45); outline-offset: 2px; }
.btn { border: 0; border-radius: 11px; padding: 9px 16px; min-height: 40px; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s, transform .05s; }
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.error { color: var(--bad); font-weight: 600; margin: 0; }
.error:empty { display: none; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }

/* ---- Shell ------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  background-image: url("/console/static/kente-dark.svg"); background-size: 120px 96px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; padding: 6px 10px 18px; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: hsl(213 15% 50%);
  padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none;
  border: 0; color: inherit; padding: 9px 12px; border-radius: 10px; cursor: pointer; min-height: 40px; }
.nav:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav.on { background: hsl(178 52% 40% / .22); color: #fff; box-shadow: inset 3px 0 0 hsl(178 60% 60%); }
.side .who { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--side-line); font-size: 12px; }
.side .who .btn.ghost { background: transparent; color: var(--side-ink); border-color: var(--side-line); }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 2; }
.top h2 { margin: 0; font-size: 18px; flex: 1; letter-spacing: -.01em; }
.menu { display: none; }
.content { padding: 24px; display: grid; gap: 18px; }

/* ---- Blocks ------------------------------------------------------------------------ */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 14px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.01em; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
  max-width: 420px; overflow-wrap: anywhere; }
th { color: var(--muted); font-weight: 600; background: var(--field); position: sticky; top: 0; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--brand-soft); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.spark { width: 100%; height: 72px; display: block; }
.spark .total { fill: none; stroke: var(--brand); stroke-width: 2; }
.spark .err { fill: none; stroke: var(--bad); stroke-width: 2; }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); z-index: 5; }
.scrim { display: none; }

/* API docs inside the console */
.api-list { display: grid; gap: 14px; }
.api-group h3 { text-transform: capitalize; }
.op { border-top: 1px solid var(--line); }
.op:first-of-type { border-top: 0; }
.op-head { width: 100%; display: grid; grid-template-columns: 72px minmax(0, auto) 1fr; gap: 12px; align-items: center;
  background: none; border: 0; padding: 10px 4px; cursor: pointer; text-align: left; border-radius: 8px; }
.op-head:hover { background: var(--brand-soft); }
.op-path { font-size: 13px; overflow-wrap: anywhere; }
.op-sum { color: var(--muted); font-size: 13px; }
.method { font: 700 11px/1 ui-monospace, monospace; padding: 5px 0; border-radius: 6px; text-align: center; color: #fff; }
.m-get { background: hsl(205 70% 45%); } .m-post { background: hsl(152 55% 36%); }
.m-put, .m-patch { background: hsl(32 90% 45%); } .m-delete { background: hsl(352 66% 48%); }
.op-body { padding: 0 4px 6px; display: grid; gap: 8px; }
.op-body h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.op-desc { margin: 6px 0 0; white-space: pre-wrap; }
.schema { margin: 0; padding: 12px; background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  max-height: 360px; overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
@media (max-width: 860px) { .op-head { grid-template-columns: 60px 1fr; } .op-sum { grid-column: 2; } }

/* ---- Phones and small tablets ------------------------------------------------------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px 26px; gap: 18px; }
  .auth-points, .auth-foot { display: none; }
  .auth-pitch h1 { font-size: 26px; margin-bottom: 8px; }
  .auth-pitch p { font-size: 14px; }
  .auth-form { padding: 0 16px 32px; margin-top: -14px; align-items: start; }
  .auth-card { padding: 24px 20px; border-radius: 18px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(288px, 84vw); z-index: 4;
    transform: translateX(-100%); transition: transform .2s ease; }
  .shell.open .side { transform: none; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 3; }
  .menu { display: inline-flex; }
  .top { padding: 10px 16px; }
  .content { padding: 16px; }
  .stat .value { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .side, .spinner { transition: none; animation: none; } }
