/* Royal Cobalt & Midnight Sapphire App Portal Theme - Clean Zero-Footprint Static CSS */
:root {
  --nx-bg: #f4f7fb;
  --nx-surface: #ffffff;
  --nx-surface-soft: #eef4ff;
  --nx-ink: #0f172a;
  --nx-ink-body: #334155;
  --nx-muted: #64748b;
  --nx-border: #dbe4f0;
  --nx-primary: #1d4ed8;
  --nx-primary-deep: #1e3a8a;
  --nx-primary-soft: #dbeafe;
  --nx-dl-from: #059669;
  --nx-dl-to: #10b981;
  --nx-reg-from: #4f46e5;
  --nx-reg-to: #7c3aed;
  --nx-badge-bg: #fef3c7;
  --nx-badge-fg: #92400e;
  --nx-radius: 16px;
  --nx-radius-sm: 10px;
  --nx-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--nx-bg);
  color: var(--nx-ink-body);
  line-height: 1.65;
  font-size: 16px;
  padding-bottom: 84px;
}

a {
  color: var(--nx-primary);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

a:hover {
  color: var(--nx-primary-deep);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 0;
}

.nx-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--nx-primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 1000;
}

.nx-skip:focus {
  left: 12px;
}

/* Header & Navigation */
.nx-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nx-border);
}

.nx-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nx-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--nx-primary-deep);
  letter-spacing: -0.02em;
}

.nx-brand img {
  border-radius: 10px;
  width: 44px;
  height: 44px;
}

.nx-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nx-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--nx-ink);
}

.nx-nav a:hover,
.nx-nav a[aria-current="page"] {
  background: var(--nx-surface-soft);
  color: var(--nx-primary);
}

.nx-menu-btn {
  display: none;
  background: var(--nx-surface-soft);
  border: 1px solid var(--nx-border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--nx-ink);
}

/* Breadcrumbs */
.nx-crumbs {
  max-width: 1120px;
  margin: 14px auto 0;
  padding: 0 20px;
  font-size: 0.88rem;
  color: var(--nx-muted);
}

.nx-crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Main Container */
.nx-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

/* Hero Banner & Channel Header */
.nx-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
  color: #ffffff;
  border-radius: var(--nx-radius);
  padding: 28px;
  box-shadow: var(--nx-shadow);
  margin-bottom: 28px;
}

.nx-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(254, 243, 199, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.nx-hero h1 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffffff;
}

.nx-hero-lead {
  color: #dbeafe;
  max-width: 780px;
  margin-bottom: 20px;
  font-size: 1.02rem;
}

.nx-carousel {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0b1120;
}

.nx-slide {
  display: none;
}

.nx-slide.is-active {
  display: block;
}

.nx-slide a {
  display: block;
}

.nx-slide img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.nx-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.85);
}

.nx-dot {
  width: 28px;
  height: 7px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.nx-dot.is-active {
  background: #38bdf8;
}

.nx-perks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 22px;
}

.nx-perks li {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  color: #f8fafc;
}

.nx-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.nx-btn-dl,
.nx-btn-reg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.nx-btn-dl {
  background: linear-gradient(135deg, var(--nx-dl-from), var(--nx-dl-to));
}

.nx-btn-reg {
  background: linear-gradient(135deg, var(--nx-reg-from), var(--nx-reg-to));
}

.nx-btn-dl:hover,
.nx-btn-reg:hover {
  opacity: 0.94;
}

/* Channel Hero Split */
.nx-channel-hero {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 24px;
  align-items: center;
}

.nx-app-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.nx-app-box img {
  border-radius: 14px;
  width: 72px;
  height: 72px;
}

/* In-page Jump TOC */
.nx-jump-nav {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-sm);
  padding: 16px 20px;
  margin-bottom: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

.nx-jump-nav strong {
  color: var(--nx-ink);
  font-size: 0.92rem;
}

.nx-jump-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--nx-surface-soft);
  padding: 5px 12px;
  border-radius: 999px;
}

/* Sections & Modular Visual Cards */
.nx-section {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  padding: 28px;
  margin-bottom: 26px;
  box-shadow: var(--nx-shadow);
}

.nx-sec-head {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--nx-border);
}

.nx-sec-head h1,
.nx-sec-head h2 {
  font-size: 1.42rem;
  color: var(--nx-ink);
  font-weight: 800;
  margin-bottom: 6px;
}

.nx-sec-head p {
  color: var(--nx-muted);
  font-size: 0.96rem;
}

.nx-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.nx-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.nx-card {
  background: var(--nx-bg);
  border: 1px solid var(--nx-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.nx-card-media {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  margin-bottom: 4px;
}

.nx-card-media img,
.nx-card img {
  width: 100%;
  border-radius: 12px;
  transition: transform 0.25s ease;
}

.nx-card-media:hover img {
  transform: scale(1.02);
}

.nx-card h3 {
  font-size: 1.12rem;
  color: var(--nx-ink);
  font-weight: 700;
  margin-top: 2px;
}

.nx-card ul,
.nx-card ol {
  padding-left: 18px;
  font-size: 0.94rem;
}

.nx-callout {
  background: var(--nx-surface-soft);
  border: 1px solid var(--nx-primary-soft);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 0.95rem;
  color: var(--nx-ink-body);
}

/* Knowledge Layout */
.nx-knowledge {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  align-items: start;
}

.nx-side-toc {
  background: var(--nx-surface-soft);
  border: 1px solid var(--nx-primary-soft);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nx-side-toc strong {
  color: var(--nx-primary-deep);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nx-side-toc a {
  font-size: 0.9rem;
  color: var(--nx-ink-body);
  padding: 4px 0;
  border-bottom: 1px dashed var(--nx-border);
}

.nx-kb-articles article {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--nx-border);
}

.nx-kb-articles article:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.nx-kb-articles h3 {
  font-size: 1.18rem;
  color: var(--nx-primary-deep);
  margin-bottom: 10px;
}

.nx-kb-articles h4 {
  font-size: 1rem;
  color: var(--nx-ink);
  margin: 10px 0 6px;
}

.nx-kb-articles ul {
  padding-left: 20px;
  margin-top: 6px;
}

/* Accordions (<details>) */
.nx-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nx-faq-item {
  border: 1px solid var(--nx-border);
  border-radius: 12px;
  background: var(--nx-bg);
  padding: 14px 18px;
}

.nx-faq-item summary {
  font-weight: 700;
  color: var(--nx-ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nx-faq-item summary::after {
  content: "+";
  color: var(--nx-primary);
  font-weight: 800;
  font-size: 1.2rem;
}

.nx-faq-item[open] summary::after {
  content: "−";
}

.nx-faq-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--nx-border);
  font-size: 0.95rem;
}

.nx-faq-body ul,
.nx-faq-body ol {
  padding-left: 20px;
  margin: 8px 0;
}

/* Dialogue / Chat Q&A */
.nx-chat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.nx-chat-card {
  border: 1px solid var(--nx-border);
  border-radius: 12px;
  padding: 18px;
  background: var(--nx-bg);
}

.nx-chat-card h3 {
  font-size: 1.05rem;
  color: var(--nx-ink);
  margin-bottom: 12px;
}

.nx-chat-log {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nx-chat-log li {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
}

.nx-msg-user {
  background: #ffffff;
  border: 1px solid var(--nx-border);
}

.nx-msg-guide {
  background: var(--nx-surface-soft);
  border: 1px solid var(--nx-primary-soft);
}

.nx-chat-log small {
  display: block;
  font-weight: 700;
  color: var(--nx-primary-deep);
  margin-bottom: 3px;
}

/* Annotated Visuals (<dl>) & Tables */
.nx-annotated {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--nx-border);
  border-radius: 12px;
  background: var(--nx-bg);
  margin-bottom: 16px;
}

.nx-annotated img {
  border-radius: 12px;
}

.nx-annotated dl {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.nx-annotated dt {
  font-weight: 700;
  color: var(--nx-ink);
}

.nx-annotated dd {
  color: var(--nx-ink-body);
  font-size: 0.94rem;
}

.nx-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
}

.nx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.nx-table caption {
  text-align: left;
  font-weight: 700;
  color: var(--nx-ink);
  margin-bottom: 10px;
}

.nx-table th,
.nx-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--nx-border);
  text-align: left;
}

.nx-table th {
  background: var(--nx-surface-soft);
  color: var(--nx-primary-deep);
  font-weight: 700;
}

/* Code / Config Box */
.nx-codebox {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  margin-top: 14px;
}

.nx-codebox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.nx-copy-btn {
  background: #1e293b;
  color: #38bdf8;
  border: 1px solid #334155;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.nx-codebox pre {
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
}

/* Numbered Steps */
.nx-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nx-steps > li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 12px;
  background: var(--nx-bg);
  border: 1px solid var(--nx-border);
}

.nx-step-num {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--nx-primary);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer & Sticky Conversion Bar */
.nx-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--nx-border);
  color: var(--nx-muted);
  font-size: 0.9rem;
}

.nx-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
}

.nx-floatbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  background: rgba(15, 23, 42, 0.96);
  color: #ffffff;
  padding: 10px 20px;
  border-top: 1px solid rgba(56, 189, 248, 0.3);
}

.nx-floatbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nx-floatbar-btns {
  display: flex;
  gap: 10px;
}

.nx-floatbar .nx-btn-dl,
.nx-floatbar .nx-btn-reg {
  padding: 8px 16px;
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .nx-grid-3,
  .nx-grid-2,
  .nx-chat-grid,
  .nx-channel-hero,
  .nx-knowledge,
  .nx-annotated {
    grid-template-columns: 1fr;
  }
  .nx-menu-btn {
    display: inline-flex;
  }
  .nx-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 10px;
  }
  .nx-nav.is-open {
    display: flex;
  }
  .nx-header-inner {
    flex-wrap: wrap;
  }
  .nx-floatbar-text {
    display: none;
  }
  .nx-floatbar-btns {
    width: 100%;
    justify-content: space-between;
  }
  .nx-floatbar-btns a {
    flex: 1;
  }
}
