:root {
  --nx-red: #e10028;
  --nx-red-dark: #b8001f;
  --nx-red-soft: #fde8ec;
  --nx-ink: #1a1a1f;
  --nx-ink-mid: #3d3d45;
  --nx-muted: #6b6b78;
  --nx-line: #e4e2de;
  --nx-cream: #f7f5f2;
  --nx-white: #ffffff;
  --nx-sidebar: #141418;
  --nx-sidebar-text: #c8c8d0;
  --nx-accent: #00a3ad;
  --nx-max: 74rem;
  --nx-radius: 10px;
  --nx-radius-lg: 18px;
  --nx-font: "DM Sans", system-ui, -apple-system, sans-serif;
  --nx-mono: "IBM Plex Mono", ui-monospace, monospace;
  --nx-shadow: 0 4px 24px rgba(26, 26, 31, 0.08);
  --nx-shadow-lg: 0 20px 50px rgba(26, 26, 31, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 4.5rem; }

body {
  margin: 0;
  font-family: var(--nx-font);
  font-size: 1.02rem;
  line-height: 1.68;
  color: var(--nx-ink);
  background: var(--nx-cream);
}

a {
  color: var(--nx-red);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--nx-red-dark); }

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

/* --- App shell: sidebar + main --- */
.nx-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.nx-skip {
  position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}
.nx-skip:focus {
  position: fixed; left: 1rem; top: 1rem; width: auto; height: auto;
  padding: 0.5rem 1rem; background: var(--nx-ink); color: #fff; z-index: 300;
  border-radius: var(--nx-radius);
}

/* --- Sidebar navigation --- */
.nx-sidebar {
  background: var(--nx-sidebar);
  color: var(--nx-sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.nx-sidebar__brand {
  padding: 1.35rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nx-sidebar__brand a {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: #fff; font-weight: 700; font-size: 0.95rem;
}
.nx-sidebar__brand a:hover { color: #fff; }
.nx-sidebar__brand img { width: 38px; height: 38px; border-radius: 8px; }

.nx-sidebar__ribbon {
  margin: 0.85rem 1rem 0;
  padding: 0.55rem 0.75rem;
  background: rgba(225, 0, 40, 0.15);
  border-left: 3px solid var(--nx-red);
  border-radius: 0 var(--nx-radius) var(--nx-radius) 0;
  font-size: 0.78rem;
  line-height: 1.45;
}
.nx-sidebar__ribbon a { color: #ff8fa3; font-weight: 600; text-decoration: none; }
.nx-sidebar__ribbon a:hover { color: #fff; }

.nx-nav { flex: 1; padding: 0.75rem 0.65rem 1.5rem; }
.nx-nav ul { list-style: none; margin: 0; padding: 0; }
.nx-nav li { margin-bottom: 0.15rem; }
.nx-nav a {
  display: block; padding: 0.55rem 0.85rem;
  color: var(--nx-sidebar-text); text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
  border-radius: var(--nx-radius);
  transition: background 120ms, color 120ms;
}
.nx-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nx-nav a[aria-current="page"] {
  background: var(--nx-red); color: #fff; font-weight: 600;
}
.nx-nav__cta {
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.nx-nav__cta a {
  background: rgba(0, 163, 173, 0.2); color: #7ee8ef;
  font-weight: 700; text-align: center;
}
.nx-nav__cta a:hover { background: var(--nx-accent); color: #fff; }

.nx-sidebar__foot {
  padding: 1rem 1.25rem;
  font-size: 0.72rem;
  color: #6a6a75;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* --- Mobile header --- */
.nx-mobhead {
  display: none;
  background: var(--nx-white);
  border-bottom: 1px solid var(--nx-line);
  padding: 0.75rem 1rem;
  position: sticky; top: 0; z-index: 50;
  align-items: center; justify-content: space-between; gap: 0.75rem;
}
.nx-mobhead__logo {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; color: var(--nx-ink); font-weight: 700; font-size: 0.92rem;
}
.nx-mobhead__logo img { width: 32px; height: 32px; }
.nx-mobtoggle {
  background: var(--nx-ink); color: #fff; border: 0;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  font-weight: 600; font-size: 0.82rem; cursor: pointer;
}

/* --- Main content area --- */
.nx-body { display: flex; flex-direction: column; min-width: 0; }

.nx-topbar {
  background: var(--nx-white);
  border-bottom: 1px solid var(--nx-line);
  padding: 0.5rem 1.5rem;
  font-size: 0.8rem;
  color: var(--nx-muted);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.nx-topbar a { color: var(--nx-red); font-weight: 600; text-decoration: none; }

.nx-main {
  flex: 1;
  width: 100%;
  max-width: var(--nx-max);
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}

.nx-crumb {
  padding: 1rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--nx-muted);
}
.nx-crumb a { color: var(--nx-muted); text-decoration: none; }
.nx-crumb a:hover { color: var(--nx-red); }
.nx-crumb span { color: var(--nx-ink); font-weight: 600; }

/* --- Buttons --- */
.nx-btn {
  display: inline-block; padding: 0.62rem 1.3rem;
  border-radius: 6px; font-weight: 700; font-size: 0.9rem;
  text-decoration: none; border: 2px solid transparent;
  cursor: pointer; font-family: inherit;
  transition: transform 120ms, box-shadow 120ms, background 120ms;
}
.nx-btn--primary {
  background: var(--nx-red); color: #fff; border-color: var(--nx-red);
  box-shadow: 0 6px 18px rgba(225, 0, 40, 0.28);
}
.nx-btn--primary:hover { background: var(--nx-red-dark); color: #fff; transform: translateY(-1px); }
.nx-btn--outline {
  background: transparent; color: var(--nx-ink); border-color: var(--nx-line);
}
.nx-btn--outline:hover { border-color: var(--nx-red); color: var(--nx-red); }
.nx-btn--light {
  background: #fff; color: var(--nx-red); border-color: #fff;
}
.nx-btn--light:hover { background: var(--nx-red-soft); color: var(--nx-red-dark); }
.nx-btn--teal {
  background: var(--nx-accent); color: #fff; border-color: var(--nx-accent);
}
.nx-btn--teal:hover { background: #008a93; color: #fff; }

/* --- Homepage hero --- */
.nx-hero {
  margin: 0 -1.5rem 2rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: linear-gradient(135deg, var(--nx-ink) 0%, #2a2a32 60%, var(--nx-red-dark) 100%);
  border-radius: 0 0 var(--nx-radius-lg) var(--nx-radius-lg);
  overflow: hidden;
  box-shadow: var(--nx-shadow-lg);
}
.nx-hero__copy {
  padding: 2.5rem 2rem 2.5rem 2.5rem;
  color: #ececef;
}
.nx-hero__tag {
  display: inline-block; font-family: var(--nx-mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #ff8fa3; margin-bottom: 0.85rem;
}
.nx-hero__title {
  font-size: clamp(1.65rem, 3.2vw, 2.45rem);
  line-height: 1.18; margin: 0 0 1rem; color: #fff; font-weight: 800;
}
.nx-hero__text { margin: 0 0 1.5rem; color: #b0b0ba; max-width: 36rem; }
.nx-hero__acts { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.nx-hero__visual {
  display: flex; align-items: flex-end; justify-content: center;
  padding: 1.5rem 1.5rem 0 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(225,0,40,0.25), transparent 60%);
}
.nx-hero__visual img { border-radius: var(--nx-radius-lg) var(--nx-radius-lg) 0 0; }

/* --- Keyword pills --- */
.nx-pills {
  display: flex; flex-wrap: wrap; gap: 0.45rem;
  margin-bottom: 2rem;
}
.nx-pill {
  font-family: var(--nx-mono); font-size: 0.72rem;
  padding: 0.35rem 0.75rem; border-radius: 999px;
  background: var(--nx-white); border: 1px solid var(--nx-line);
  color: var(--nx-ink-mid);
}

/* --- Card grid --- */
.nx-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.nx-grid--2 { grid-template-columns: repeat(2, 1fr); }
.nx-grid--3 { grid-template-columns: repeat(3, 1fr); }
.nx-grid--4 { grid-template-columns: repeat(4, 1fr); }

.nx-card {
  background: var(--nx-white);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-lg);
  padding: 1.35rem;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: box-shadow 140ms, border-color 140ms, transform 140ms;
}
.nx-card:hover {
  box-shadow: var(--nx-shadow);
  border-color: var(--nx-red-soft);
  transform: translateY(-2px);
  color: inherit;
}
.nx-card__icon { width: 36px; height: 36px; }
.nx-card h3 { margin: 0; font-size: 1.05rem; color: var(--nx-ink); }
.nx-card p { margin: 0; font-size: 0.9rem; color: var(--nx-muted); flex: 1; }
.nx-card__link { font-size: 0.82rem; font-weight: 700; color: var(--nx-red); }

/* --- Split layout --- */
.nx-split {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.nx-aside {
  position: sticky; top: 1rem; align-self: start;
  background: var(--nx-white);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-lg);
  padding: 1.25rem;
}
.nx-aside h2 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.nx-aside ul { margin: 0; padding: 0; list-style: none; }
.nx-aside li { margin-bottom: 0.4rem; }
.nx-aside a { font-size: 0.88rem; text-decoration: none; color: var(--nx-ink-mid); }
.nx-aside a:hover { color: var(--nx-red); }

/* --- Section blocks --- */
.nx-section { margin-bottom: 2.5rem; }
.nx-section__head {
  font-size: 1.45rem; margin: 0 0 0.35rem; color: var(--nx-ink);
}
.nx-section__sub { margin: 0 0 1.25rem; color: var(--nx-muted); font-size: 0.95rem; }

.nx-panel {
  background: var(--nx-white);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.nx-panel--accent {
  border-left: 4px solid var(--nx-red);
  background: linear-gradient(90deg, var(--nx-red-soft), var(--nx-white) 30%);
}

.nx-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.nx-steps li {
  counter-increment: step;
  padding: 1rem 0 1rem 3rem;
  border-bottom: 1px solid var(--nx-line);
  position: relative;
}
.nx-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1rem;
  width: 2rem; height: 2rem;
  background: var(--nx-red); color: #fff;
  border-radius: 50%; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
.nx-steps li:last-child { border-bottom: 0; }
.nx-steps h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.nx-steps p { margin: 0; color: var(--nx-muted); font-size: 0.92rem; }

/* --- FAQ accordion --- */
.nx-faq { max-width: 48rem; }
.nx-faq details {
  background: var(--nx-white);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.nx-faq summary {
  padding: 1rem 1.15rem; cursor: pointer;
  font-weight: 600; font-size: 0.95rem;
  list-style: none;
}
.nx-faq summary::-webkit-details-marker { display: none; }
.nx-faq details[open] summary { border-bottom: 1px solid var(--nx-line); color: var(--nx-red); }
.nx-faq__body { padding: 1rem 1.15rem; color: var(--nx-muted); font-size: 0.92rem; }
.nx-faq__body p { margin: 0; }

/* --- Table --- */
.nx-table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.nx-table {
  width: 100%; border-collapse: collapse;
  background: var(--nx-white);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius);
  font-size: 0.9rem;
}
.nx-table caption {
  text-align: left; font-weight: 700; padding: 0.75rem 0;
  font-size: 0.95rem;
}
.nx-table th, .nx-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--nx-line);
  text-align: left;
}
.nx-table th { background: var(--nx-cream); font-weight: 700; }
.nx-table tr:last-child td { border-bottom: 0; }

/* --- Forms --- */
.nx-form {
  background: var(--nx-white);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-lg);
  padding: 1.5rem;
  max-width: 28rem;
}
.nx-field { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--nx-ink-mid); }
.nx-input, .nx-select, .nx-textarea {
  width: 100%; padding: 0.65rem 0.85rem;
  border: 1px solid var(--nx-line); border-radius: var(--nx-radius);
  font-family: inherit; font-size: 0.95rem;
  margin-bottom: 1rem; background: var(--nx-cream);
}
.nx-input:focus, .nx-select:focus, .nx-textarea:focus {
  outline: 2px solid var(--nx-red-soft); border-color: var(--nx-red);
}
.nx-textarea { min-height: 6rem; resize: vertical; }
.nx-alert {
  font-size: 0.88rem; padding: 0.65rem 0.85rem;
  border-radius: var(--nx-radius); margin-bottom: 1rem;
  background: var(--nx-red-soft); color: var(--nx-red-dark);
}
.nx-alert--ok { background: #e6f7f0; color: #0d6b4a; }

/* --- Inner page hero --- */
.nx-pagehead {
  padding: 1.75rem 0 1.25rem;
  border-bottom: 1px solid var(--nx-line);
  margin-bottom: 1.75rem;
}
.nx-pagehead h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1.2;
}
.nx-pagehead p { margin: 0; color: var(--nx-muted); max-width: 40rem; }

/* --- Article prose --- */
.nx-prose h2 { font-size: 1.2rem; margin: 1.75rem 0 0.65rem; }
.nx-prose h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
.nx-prose p, .nx-prose li { color: var(--nx-ink-mid); font-size: 0.95rem; }
.nx-prose ul, .nx-prose ol { padding-left: 1.35rem; }
.nx-prose li { margin-bottom: 0.35rem; }

/* --- CTA band --- */
.nx-band {
  background: var(--nx-ink);
  color: #d0d0d8;
  border-radius: var(--nx-radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}
.nx-band h2 { margin: 0 0 0.5rem; color: #fff; font-size: 1.3rem; }
.nx-band p { margin: 0 0 1.25rem; font-size: 0.92rem; }

/* --- Footer --- */
.nx-footer {
  background: var(--nx-white);
  border-top: 1px solid var(--nx-line);
  padding: 2rem 1.5rem;
  margin-top: auto;
}
.nx-footer__grid {
  max-width: var(--nx-max); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 1.5rem;
}
.nx-footer h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.65rem; color: var(--nx-muted); }
.nx-footer ul { list-style: none; margin: 0; padding: 0; }
.nx-footer li { margin-bottom: 0.35rem; }
.nx-footer a { font-size: 0.88rem; text-decoration: none; color: var(--nx-ink-mid); }
.nx-footer a:hover { color: var(--nx-red); }
.nx-footer__brand p { margin: 0; font-size: 0.88rem; color: var(--nx-muted); line-height: 1.55; }
.nx-footer__copy {
  max-width: var(--nx-max); margin: 1.5rem auto 0;
  font-size: 0.78rem; color: var(--nx-muted);
  padding-top: 1rem; border-top: 1px solid var(--nx-line);
}

.nx-badges {
  display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem;
}
.nx-badges img { height: 32px; width: auto; opacity: 0.75; }

/* --- Cookie notice --- */
.nx-notice {
  position: fixed; bottom: 1rem; right: 1rem; left: 1rem;
  max-width: 26rem; margin-left: auto;
  background: var(--nx-ink); color: #c8c8d0;
  padding: 1rem 1.15rem; border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-shadow-lg); z-index: 200;
  font-size: 0.85rem;
}
.nx-notice p { margin: 0 0 0.75rem; }
.nx-notice a { color: #ff8fa3; }
.nx-notice__acts { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nx-notice .nx-btn--light { font-size: 0.8rem; padding: 0.45rem 0.9rem; }
.nx-notice .nx-btn--outline { color: #fff; border-color: rgba(255,255,255,0.3); font-size: 0.8rem; padding: 0.45rem 0.9rem; }

/* --- Login form page --- */
.nx-loginwrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  align-items: start; margin-bottom: 2rem;
}
.nx-loginbox {
  background: var(--nx-white);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-lg);
  padding: 2rem;
  box-shadow: var(--nx-shadow);
}
.nx-loginbox h2 { margin: 0 0 0.35rem; font-size: 1.25rem; }
.nx-loginbox > p { margin: 0 0 1.25rem; color: var(--nx-muted); font-size: 0.9rem; }

/* --- Responsive --- */
@media (max-width: 960px) {
  .nx-app { grid-template-columns: 1fr; }
  .nx-sidebar {
    position: fixed; left: -280px; top: 0;
    width: 260px; height: 100vh;
    transition: left 200ms ease;
  }
  .nx-sidebar.nx-sidebar--open { left: 0; }
  .nx-mobhead { display: flex; }
  .nx-hero { grid-template-columns: 1fr; }
  .nx-hero__visual { display: none; }
  .nx-hero__copy { padding: 2rem 1.5rem; }
  .nx-split { grid-template-columns: 1fr; }
  .nx-aside { position: static; }
  .nx-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .nx-grid--3 { grid-template-columns: 1fr; }
  .nx-loginwrap { grid-template-columns: 1fr; }
  .nx-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .nx-grid--4, .nx-grid--2 { grid-template-columns: 1fr; }
  .nx-footer__grid { grid-template-columns: 1fr; }
  .nx-main { padding: 0 1rem 2.5rem; }
  .nx-hero { margin: 0 -1rem 1.5rem; }
}
