:root {
  --bg: #070a0f;
  --panel: #0d121a;
  --panel-2: #111925;
  --line: #1d2633;
  --text: #f6f8fb;
  --muted: #8792a3;
  --cyan: #18d9e7;
  --purple: #715cff;
  --green: #35dd9a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
}
.auth-screen {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(24,217,231,.13), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(113,92,255,.16), transparent 36%),
    #070a0f;
}
.auth-screen.hidden { display: none; }
.auth-card {
  width: min(430px, 100%);
  border: 1px solid #263244;
  border-radius: 22px;
  background: rgba(13,19,28,.96);
  padding: 34px;
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}
.auth-brand { display: inline-flex; margin-bottom: 34px; }
.auth-card h1 { margin: 7px 0; font-size: 34px; letter-spacing: -1.5px; }
.auth-copy { margin: 0 0 25px; color: var(--muted); font-size: 12px; }
.auth-error { min-height: 18px; color: #ff8290; font-size: 10px; }
.auth-switch { display: block; margin: 17px auto 0; border: 0; background: transparent; color: var(--cyan); font-size: 10px; }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 300px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #0c1118;
  padding: 28px 22px;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.7px;
}
.brand > span:last-child span, .mobile-brand span { color: var(--cyan); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--cyan), var(--purple));
  font-size: 21px;
}
.side-label, .section-kicker, .eyebrow {
  color: #667184;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
}
.side-label { margin: 42px 12px 14px; }
#categoryNav { display: grid; gap: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 13px 14px;
  background: transparent;
  color: #9aa5b5;
  text-align: left;
  font-weight: 700;
}
.nav-item:hover { color: white; background: #111924; }
.nav-item.active {
  border-color: rgba(24,217,231,.25);
  background: linear-gradient(90deg, rgba(24,217,231,.18), rgba(113,92,255,.09));
  color: white;
}
.nav-art {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid #283446;
  border-radius: 8px;
  background-image: url("assets/category-sprite.png");
  background-size: 400% 300%;
  background-position: var(--sprite-position);
}
.nav-art.art-fallback { display: grid; place-items: center; background: #15202d; border: 0; font-size: 15px; }
.nav-item .count {
  margin-left: auto;
  border-radius: 20px;
  background: #172230;
  padding: 3px 8px;
  color: #758297;
  font-size: 10px;
}
.balance-card {
  margin-top: 38px;
  border: 1px solid #26303d;
  border-left: 3px solid var(--cyan);
  border-radius: 14px;
  background: linear-gradient(145deg, #121924, #0c1118);
  padding: 20px;
}
.balance-card > span { color: #687486; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.balance-card strong { display: block; margin-top: 10px; font-size: 28px; }
.balance-card small { color: var(--cyan); font-size: 11px; }
.balance-card p { margin: 8px 0 0; color: #647084; font-size: 11px; line-height: 1.5; }

.main { width: calc(100% - 300px); margin-left: 300px; }
.topbar {
  height: 78px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line);
  background: rgba(7,10,15,.88);
  backdrop-filter: blur(14px);
  padding: 0 5vw;
}
.top-actions { display: flex; align-items: center; gap: 14px; }
.credit-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(24,217,231,.35);
  border-radius: 12px;
  padding: 9px 16px;
  background: rgba(24,217,231,.05);
}
.credit-pill span { color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.credit-pill strong { font-size: 18px; }
.avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  background: #12bfcd;
  color: #031013;
  font-weight: 800;
}
.avatar span {
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--green);
}
.logout, .icon-button {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #10151e;
  color: #bbc4d0;
}
.logout { width: 42px; height: 42px; color: #ee826f; }
.icon-button { width: 42px; height: 42px; font-size: 20px; }
.menu-button, .mobile-brand, .close-menu { display: none; }

.content { max-width: 1400px; margin: auto; padding: 62px 5vw 80px; }
.hero { display: flex; justify-content: space-between; gap: 30px; }
.eyebrow { color: var(--cyan); }
h1 { max-width: 650px; margin: 10px 0 12px; font-size: clamp(32px, 4vw, 54px); line-height: 1.08; letter-spacing: -2.4px; }
.hero-copy { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.7; font-size: 15px; }
.status-badge {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(53,221,154,.25);
  border-radius: 50px;
  padding: 9px 13px;
  color: #91e6bd;
  background: rgba(53,221,154,.06);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.notice {
  display: flex;
  gap: 12px;
  margin-top: 35px;
  border: 1px solid #203446;
  border-radius: 12px;
  padding: 14px 16px;
  background: #0c1721;
}
.notice-icon { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #153f53; color: var(--cyan); font-weight: 800; }
.notice strong { font-size: 12px; }
.notice p { margin: 3px 0 0; color: #758397; font-size: 11px; }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 52px 0 22px; }
.toolbar h2 { margin: 5px 0 0; font-size: 25px; letter-spacing: -.7px; }
.section-kicker { margin: 0; color: #5c687a; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1118;
  padding: 0 13px;
  color: #738095;
}
.search:focus-within { border-color: rgba(24,217,231,.45); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: white; padding: 12px 0; font-size: 12px; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service-card {
  position: relative;
  min-height: 186px;
  overflow: hidden;
  border: 1px solid hsl(var(--hue) 72% 34% / .7);
  border-radius: 16px;
  background:
    radial-gradient(circle at 95% 0%, hsl(var(--hue) 90% 56% / .2), transparent 36%),
    linear-gradient(145deg, hsl(var(--hue) 38% 13%), #090e15 62%);
  padding: 0 20px 20px;
  box-shadow: inset 0 1px 0 hsl(var(--hue) 100% 78% / .12), 0 12px 30px #0003;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.service-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0 14% auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 18px var(--accent);
}
.service-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -35px;
  top: -35px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .18;
}
.service-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 16px 40px hsl(var(--hue) 85% 45% / .2), inset 0 1px 0 hsl(var(--hue) 100% 78% / .2); }
.category-art {
  position: relative;
  display: block;
  height: 168px;
  overflow: hidden;
  margin: 0 -20px 16px;
  border-bottom: 1px solid hsl(var(--hue) 68% 38% / .55);
  background:
    radial-gradient(circle at 50% 55%, hsl(var(--hue) 85% 48% / .2), transparent 45%),
    #070d18;
}
.category-art::before {
  content: "";
  position: absolute;
  width: 168px;
  height: 168px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-image: url("assets/category-sprite.png");
  background-repeat: no-repeat;
  background-size: 400% 300%;
  background-position: var(--sprite-position);
  filter: hue-rotate(var(--hue-shift)) saturate(1.3) brightness(1.08);
  transition: transform .35s ease, filter .35s ease;
}
.service-card:hover .category-art::before { transform: translate(-50%, -50%) scale(1.045); filter: hue-rotate(var(--hue-shift)) saturate(1.5) brightness(1.14); }
.card-top { display: flex; align-items: flex-start; justify-content: flex-end; }
.service-icon, .modal-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 15%, #111824);
  color: var(--accent);
  font-size: 19px;
}
.cost { border: 1px solid hsl(var(--hue) 80% 55% / .42); border-radius: 50px; padding: 5px 9px; background: hsl(var(--hue) 75% 45% / .1); color: color-mix(in srgb, var(--accent) 75%, white); font-size: 9px; font-weight: 800; }
.demo-ribbon {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  right: auto;
  backdrop-filter: blur(8px);
  border: 1px solid hsl(var(--hue) 90% 60% / .7);
  border-radius: 5px;
  padding: 3px 7px;
  background: hsl(var(--hue) 65% 16% / .84);
  color: var(--accent);
  box-shadow: 0 0 16px hsl(var(--hue) 90% 55% / .16);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
}
.service-card h3 { margin: 13px 0 5px; color: color-mix(in srgb, var(--accent) 22%, white); font-size: 15px; text-transform: capitalize; }
.service-card p { height: 36px; margin: 0; color: #6f7b8e; font-size: 10px; line-height: 1.7; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }
.param { color: #526074; font-family: monospace; font-size: 9px; }
.open-service { border: 1px solid hsl(var(--hue) 80% 55% / .3); border-radius: 7px; background: hsl(var(--hue) 70% 45% / .11); color: var(--accent); padding: 6px 9px; font-size: 9px; font-weight: 800; }
.open-service:hover { background: var(--accent); color: #061018; }
.empty-state { border: 1px dashed #263141; border-radius: 16px; padding: 60px; text-align: center; color: #667386; }
.empty-state span { font-size: 32px; }
.empty-state h3 { margin-bottom: 6px; color: #aeb8c5; }
.empty-state p { font-size: 12px; }

.overlay { display: none; position: fixed; z-index: 19; inset: 0; background: rgba(0,0,0,.6); }
.modal {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 85% 0%, hsl(var(--hue) 85% 48% / .13), transparent 34%),
    #0d131c;
  color: white;
  padding: clamp(24px, 4vw, 56px);
  box-shadow: none;
}
.modal::backdrop { background: #0d131c; }
.modal > :not(.modal-close) { width: min(1400px, 100%); margin-left: auto; margin-right: auto; }
.modal-close { position: fixed; z-index: 20; right: clamp(18px, 3vw, 42px); top: clamp(16px, 3vw, 34px); border: 1px solid #2a384a; border-radius: 10px; background: rgba(13,19,28,.94); color: #9aabc0; width: 42px; height: 42px; font-size: 26px; backdrop-filter: blur(8px); }
.modal-close:hover { border-color: var(--cyan); color: var(--cyan); }
.modal-heading { display: flex; gap: 15px; padding-right: 30px; }
.modal-icon { flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden; padding: 0; }
.modal-art {
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("assets/category-sprite.png");
  background-size: 400% 300%;
  background-position: var(--sprite-position);
  filter: hue-rotate(var(--hue-shift)) saturate(1.35) brightness(1.1);
}
.modal-category { color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.demo-tag {
  display: inline-block;
  margin-left: 8px;
  border: 1px solid rgba(24,217,231,.35);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
}
.modal h2 { margin: 3px 0; font-size: 22px; text-transform: capitalize; }
.modal-heading p { margin: 0; color: #758196; font-size: 11px; line-height: 1.55; }
.modal form { margin-top: 25px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { color: #9aa6b6; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.field input {
  width: 100%;
  border: 1px solid #263142;
  border-radius: 11px;
  outline: 0;
  background: #080d13;
  color: white;
  padding: 13px 14px;
  font-size: 12px;
}
.field input:focus { border-color: var(--cyan); }
.endpoint-box { display: none; }
.endpoint-box > div { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: #536176; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.endpoint-box code { display: block; overflow-wrap: anywhere; color: #7e8b9e; font-size: 9px; line-height: 1.6; }
.endpoint-warning { margin: 9px 0 0; color: #59687b; font-size: 8px; }
.method { border-radius: 4px; padding: 3px 6px; background: rgba(53,221,154,.11); color: var(--green); }
.consent { display: flex; align-items: flex-start; gap: 9px; margin: 18px 0; color: #7c889a; font-size: 10px; line-height: 1.5; }
.consent input { margin-top: 2px; accent-color: var(--cyan); }
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 13px;
  background: linear-gradient(100deg, #14c5d2, #6654f1);
  color: white;
  font-size: 12px;
  font-weight: 800;
}
.primary-button:disabled { opacity: .5; cursor: wait; }
.primary-button small { border-left: 1px solid rgba(255,255,255,.3); padding-left: 12px; font-size: 9px; }
.result-panel { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.result-title { position: sticky; z-index: 7; top: calc(clamp(24px, 4vw, 56px) * -1); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px -10px 12px; border-bottom: 1px solid #1d2a39; border-radius: 10px; background: rgba(13,19,28,.96); padding: 14px 10px; font-size: 10px; backdrop-filter: blur(10px); }
.success-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); }
.result-title button { border: 0; background: transparent; color: var(--cyan); font-size: 9px; }
.result-actions { display: flex; align-items: center; gap: 7px; }
.result-actions button { border: 1px solid #263548; border-radius: 7px; background: #111a25; padding: 7px 10px; font-weight: 700; }
.result-actions button:hover { border-color: var(--cyan); }
.result-actions .result-close { border-color: rgba(255,113,136,.25); color: #ff91a2; }
.result-visual { display: grid; gap: 14px; }
.result-section { display: grid; gap: 10px; }
.result-section-title { margin: 0; color: #8b9aaf; font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.data-field { min-width: 0; border: 1px solid #1c2a39; border-radius: 10px; background: #090f16; padding: 11px 12px; }
.data-field-label { display: block; margin-bottom: 5px; color: #607089; font-size: 8px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.data-field-value { display: block; overflow-wrap: anywhere; color: #dce5ef; font-size: 11px; line-height: 1.5; }
.data-field-value.is-true { color: var(--green); }
.data-field-value.is-false { color: #ff8290; }
.data-card { border: 1px solid #1e2b3a; border-radius: 12px; background: #0a1018; padding: 13px; }
.data-card + .data-card { margin-top: 8px; }
.data-table-wrap { overflow: auto; border: 1px solid #1e2b3a; border-radius: 11px; }
.data-table { width: 100%; border-collapse: collapse; background: #090f16; }
.data-table th,.data-table td { min-width: 110px; padding: 10px 12px; border-bottom: 1px solid #182331; text-align: left; vertical-align: top; font-size: 9px; }
.data-table th { position: sticky; top: 0; z-index: 1; background: #111a26; color: #718198; font-size: 8px; letter-spacing: .7px; text-transform: uppercase; }
.data-table td { color: #d8e1ec; }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.image-result { overflow: hidden; margin: 0; border: 1px solid #203144; border-radius: 12px; background: #080d13; }
.image-result img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #05080c; }
.image-result-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.image-result-footer strong { color: #aebaca; font-size: 9px; text-transform: capitalize; }
.image-result-footer a,.resource-link { color: var(--cyan); font-size: 9px; text-decoration: none; }
.result-empty,.result-error { border: 1px dashed #2a3849; border-radius: 10px; padding: 18px; color: #7f8c9f; font-size: 10px; text-align: center; }
.result-error { border-color: rgba(255,113,136,.35); color: #ff9aaa; background: rgba(255,113,136,.05); text-align: left; }
.result-json { margin-top: 14px; }
.result-json summary { cursor: pointer; color: #69788d; font-size: 9px; user-select: none; }
.result-json[open] summary { margin-bottom: 9px; }
.result-json pre { max-height: 260px; overflow: auto; margin: 0; border-radius: 10px; background: #060a0f; padding: 15px; color: #85dbc1; font-size: 10px; line-height: 1.55; }
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  border: 1px solid #2d3c4c;
  border-radius: 10px;
  background: #121a23;
  padding: 11px 16px;
  color: #dce3eb;
  font-size: 11px;
  transition: .25s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1050px) {
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-101%); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .sidebar.open + .main { pointer-events: none; }
  .overlay.visible { display: block; }
  .main { width: 100%; margin-left: 0; }
  .topbar { justify-content: space-between; padding: 0 18px; }
  .menu-button, .mobile-brand, .close-menu { display: block; }
  .mobile-brand { font-weight: 800; letter-spacing: -.5px; }
  .content { padding: 40px 18px 60px; }
  .hero { display: block; }
  .status-badge { display: inline-flex; margin-top: 22px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
}
@media (max-width: 520px) {
  .service-grid { grid-template-columns: 1fr; }
  .credit-pill span { display: none; }
  .credit-pill { padding: 9px 12px; }
  .logout { display: none; }
  .hero-copy { font-size: 13px; }
  h1 { letter-spacing: -1.5px; }
  .modal { padding: 22px 18px; }
  .modal-close { right: 12px; top: 12px; }
  .data-grid { grid-template-columns: 1fr; }
  .result-title { top: -22px; align-items: flex-start; flex-direction: column; margin-left: -4px; margin-right: -4px; }
  .result-actions { width: 100%; }
  .result-actions button { flex: 1; padding: 8px 5px; }
}
