/* components.css — Nexera component library (nx- namespaced)
 *
 * Uses the rebrand tokens from nexera.css. Namespaced so it can coexist with
 * the legacy Bootstrap/global styles while pages migrate.
 */

:root {
    --nx-accent: var(--brand-teal);
    --nx-on-accent: #ffffff;
    --nx-line: #c9d4da;
    --nx-line-strong: #a6b4bd;
    --nx-radius: 16px;
}

.theme-software {
    --nx-accent: var(--brand-coral);
    --nx-on-accent: #0f1b24;
}

/* Restore border-box sizing inside nx content (the Bootstrap reset is gone).
 * Without this, width:100% form controls overflow their column by their
 * padding/border and collide with the calculator details divider. */
.nx-container,
.nx-container *,
.nx-container *::before,
.nx-container *::after {
    box-sizing: border-box;
}

.nx-container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Visually hidden but available to assistive tech (replaces Bootstrap .sr-only). */
.nx-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nx-section {
    padding: clamp(48px, 7vw, 88px) 0;
}

.nx-section--tight {
    padding: clamp(32px, 4vw, 56px) 0;
}

.nx-section--alt {
    background: var(--nx-paper);
}

.nx-section--dark {
    background: var(--nx-ink-900);
    color: #ffffff;
}

.nx-section--dark .nx-lead,
.nx-section--dark .nx-muted {
    color: rgba(255, 255, 255, 0.72);
}

/* Headings on dark surfaces must inherit the surface colour — global.css sets
 * a navy colour on every h1–h6, which renders black-on-black otherwise. */
.nx-section--dark :is(h1, h2, h3, h4, h5, h6),
.nx-card--dark :is(h1, h2, h3, h4, h5, h6),
.nx-cta :is(h1, h2, h3, h4, h5, h6),
.nx-hero--dark :is(h1, h2, h3, h4, h5, h6) {
    color: inherit;
}

/* Body links on dark surfaces inherit the text colour instead of the default
 * browser blue (e.g. the hero email address). Buttons keep their own colour. */
.nx-hero a:not(.nx-btn),
.nx-cta a:not(.nx-btn),
.nx-section--dark a:not(.nx-btn),
.nx-card--dark a:not(.nx-btn) {
    color: inherit;
}

.nx-head {
    max-width: 740px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.nx-head--left {
    margin-left: 0;
    text-align: left;
}

.nx-h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4.6vw, 3.4rem);
    line-height: 1.06;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}

.nx-h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin: 0 0 0.75rem;
}

.nx-h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}

.nx-lead {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--nx-ink-700);
    max-width: 62ch;
    margin: 0 0 1rem;
}

.nx-muted {
    color: var(--nx-ink-500);
}

.nx-center {
    text-align: center;
}

/* Status pages (success / failure / 404) */
.nx-status {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.nx-status .nx-lead {
    margin-left: auto;
    margin-right: auto;
}

.nx-status .nx-grid {
    margin-top: 2.25rem;
    text-align: left;
}

/* Buttons */
.nx-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0.85rem 1.3rem;
    border-radius: 10px;
    border: 1.5px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nx-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.nx-btn--primary {
    background: var(--nx-accent);
    color: var(--nx-on-accent);
    border-color: var(--nx-accent);
}

.nx-btn--ghost {
    background: transparent;
    color: var(--nx-ink-900);
    border-color: var(--nx-line-strong);
}

.nx-section--dark .nx-btn--ghost,
.nx-cta .nx-btn--ghost,
.nx-card--dark .nx-btn--ghost,
.nx-hero--dark .nx-btn--ghost {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.nx-btn--dark {
    background: var(--nx-ink-900);
    color: #ffffff;
    border-color: var(--nx-ink-900);
}

/* Grids */
.nx-grid {
    display: grid;
    gap: 1.25rem;
}

.nx-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nx-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nx-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Cards */
.nx-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: stretch;
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
    padding: 1.4rem;
    color: inherit;
    text-decoration: none;
}

a.nx-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.nx-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(15, 27, 36, 0.1);
    text-decoration: none;
    color: inherit;
}

.nx-card--dark {
    background: var(--nx-ink-900);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.14);
}

.nx-card--dark .nx-muted {
    color: rgba(255, 255, 255, 0.7);
}

/* Emphasised card (e.g. the primary lane on /services) */
.nx-card--callout {
    border: 2px solid var(--nx-accent);
    box-shadow: 0 0 0 4px rgba(14, 124, 134, 0.14);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--nx-accent) 16%, transparent);
}

.nx-card__tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nx-accent);
}

.nx-card__title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin: 0;
}

.nx-card__body {
    color: var(--nx-ink-700);
    margin: 0;
}

.nx-card--dark .nx-card__body {
    color: rgba(255, 255, 255, 0.72);
}

.nx-card__cta {
    margin-top: auto;
    padding-top: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--nx-accent);
}

/* Check lists */
.nx-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nx-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.55rem;
    line-height: 1.55;
}

.nx-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: var(--nx-accent);
    opacity: 0.18;
}

.nx-list li::after {
    content: "";
    position: absolute;
    left: 0.26em;
    top: 0.72em;
    width: 0.32em;
    height: 0.16em;
    border-left: 2px solid var(--nx-accent);
    border-bottom: 2px solid var(--nx-accent);
    transform: rotate(-45deg);
}

/* Stats */
.nx-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.nx-stat__v {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--nx-accent);
}

.nx-stat__k {
    color: var(--nx-ink-500);
    font-size: 0.9rem;
    margin: 0;
}

.nx-section--dark .nx-stat__k {
    color: rgba(255, 255, 255, 0.72);
}

/* Hero */
.nx-hero {
    position: relative;
    overflow: hidden;
    background-color: var(--nx-paper);
    /* Low-alpha dot pattern in the ink colour. */
    background-image:
        radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--nx-ink-900) 7%, transparent) 1px, transparent 0);
    background-size: 22px 22px;
}

/* Soft central glow behind the hero copy; tints to the lane accent. */
.nx-hero::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: -35%;
    left: 50%;
    width: min(900px, 92%);
    height: min(620px, 85%);
    transform: translateX(-50%);
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-band, #0e7c86) 30%, transparent), transparent 72%);
    filter: blur(40px);
    pointer-events: none;
}

.nx-hero--dark::before {
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-band, #0e7c86) 36%, transparent), transparent 70%);
}

.nx-hero > .nx-container {
    position: relative;
    z-index: 1;
}

.nx-hero__grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 46px;
    align-items: center;
    padding: clamp(40px, 6vw, 84px) 0;
}

.nx-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.5rem;
}

.nx-hero__actions--center {
    justify-content: center;
}

.nx-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--nx-radius);
}

/* Dashboard mock */
.nx-mock {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    background: var(--nx-ink-900);
    color: #ffffff;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(15, 27, 36, 0.28);
}

.nx-mock__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.nx-mock__dots {
    display: flex;
    gap: 6px;
}

.nx-mock__dots i {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
}

.nx-mock__body {
    padding: 1rem;
}

.nx-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.nx-kpi {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
}

.nx-kpi__k {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.nx-kpi__v {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
}

.nx-panel {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
}

.nx-panel__ph {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.7rem;
}

.nx-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 110px;
}

.nx-bars i {
    flex: 1;
    display: block;
    min-height: 8px;
    border-radius: 4px 4px 0 0;
    background: var(--brand-stripe);
    opacity: 0.9;
}

.nx-bars i.hot {
    background: var(--brand-band);
    opacity: 1;
}

.nx-bars--mock i:nth-child(1) { height: 38%; }
.nx-bars--mock i:nth-child(2) { height: 52%; }
.nx-bars--mock i:nth-child(3) { height: 44%; }
.nx-bars--mock i:nth-child(4) { height: 66%; }
.nx-bars--mock i:nth-child(5) { height: 58%; }
.nx-bars--mock i:nth-child(6) { height: 82%; }
.nx-bars--mock i:nth-child(7) { height: 74%; }

/* CTA band */
.nx-cta {
    background: var(--nx-ink-900);
    color: #ffffff;
    border-radius: 20px;
    padding: clamp(2rem, 4vw, 3rem);
    text-align: center;
}

.nx-cta .nx-lead {
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.74);
}

.nx-cta__actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.25rem;
}

/* Numbered steps */
.nx-list--num {
    counter-reset: nx-step;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nx-list--num li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.6rem;
    line-height: 1.55;
    counter-increment: nx-step;
}

.nx-list--num li::before {
    content: counter(nx-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--nx-accent);
    color: var(--nx-on-accent);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Long-form richtext (service detail scope) */
.nx-richtext h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin: 1.6rem 0 0.6rem;
}

.nx-richtext h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin: 1.2rem 0 0.5rem;
}

.nx-richtext h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin: 1rem 0 0.4rem;
}

.nx-richtext p {
    line-height: 1.7;
    color: var(--nx-ink-700);
}

.nx-richtext ul {
    padding-left: 1.2rem;
}

.nx-richtext li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
}

.nx-prose {
    max-width: 72ch;
}

.nx-prose p {
    line-height: 1.7;
    color: var(--nx-ink-700);
}

/* Utilities */
.nx-lead--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.nx-head--split {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: none;
    margin: 0 0 1.5rem;
    text-align: left;
}

.nx-h2--flush {
    margin: 0;
}

.nx-mt-6 {
    margin-top: 1.5rem;
}

.nx-grid--top {
    align-items: start;
}

.nx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.nx-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--nx-line);
    border-radius: 999px;
    background: var(--nx-surface);
    color: var(--nx-ink-900);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.nx-chip:hover,
.nx-chip:focus {
    border-color: var(--nx-accent);
    color: var(--nx-accent);
    text-decoration: none;
}

/* Forms */
.nx-form-wrap {
    max-width: 720px;
    margin: 0 auto;
}

.nx-form {
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
    padding: clamp(1.25rem, 3vw, 1.75rem);
}

.nx-field {
    display: block;
    margin-bottom: 1rem;
}

.nx-field > span {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}

.nx-field input,
.nx-field textarea,
.nx-field select {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1.5px solid var(--nx-line-strong);
    border-radius: 10px;
    font: inherit;
    font-size: 0.95rem;
    color: var(--nx-ink-900);
    background: #ffffff;
}

.nx-field input:focus,
.nx-field textarea:focus,
.nx-field select:focus {
    outline: none;
    border-color: var(--nx-accent);
    box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.15);
}

.nx-help {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.82rem;
    color: var(--nx-ink-500);
}

.nx-form__note {
    font-size: 0.85rem;
    color: var(--nx-ink-500);
    margin: 1rem 0 0;
}

.nx-btn--block {
    width: 100%;
    justify-content: center;
}

.nx-devbar {
    background: var(--nx-ink-900);
    color: #ffffff;
}

.nx-devbar__inner {
    padding: 0.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 991px) {
    .nx-grid--3,
    .nx-grid--4,
    .nx-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .nx-hero__grid,
    .nx-grid--2,
    .nx-grid--3,
    .nx-grid--4,
    .nx-stats {
        grid-template-columns: 1fr;
    }

    .nx-hero__actions .nx-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Content sections — blog, playbooks, calculators
   ========================================================================== */

.nx-related {
    margin-top: 3rem;
}

.nx-is-hidden {
    display: none !important;
}

a.nx-card__cta {
    text-decoration: none;
}

a.nx-card__cta:hover,
a.nx-card__cta:focus {
    text-decoration: none;
}

.nx-card__title a {
    color: inherit;
    text-decoration: none;
}

.nx-card__title a:hover,
.nx-card__title a:focus {
    color: var(--nx-accent);
    text-decoration: none;
}

/* Dark hero variant (calculators, optional elsewhere) */
.nx-hero--dark {
    background-color: var(--nx-ink-900);
    color: #ffffff;
}

.nx-hero--center {
    text-align: center;
}

.nx-hero--dark .nx-lead,
.nx-hero--dark .nx-muted {
    color: rgba(255, 255, 255, 0.74);
}

.nx-hero--dark .nx-hero__grid {
    padding: clamp(48px, 7vw, 88px) 0;
}

.nx-hero .nx-h1 {
    max-width: 20ch;
}

.nx-hero--center > .nx-container {
    padding-top: clamp(48px, 7vw, 88px);
    padding-bottom: clamp(48px, 7vw, 88px);
}

.nx-hero--center .nx-h1,
.nx-hero--center .nx-lead {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    max-width: 60ch;
}

/* Card media inside a standard nx-card */
.nx-card__media {
    margin: -1.4rem -1.4rem 0.9rem;
    overflow: hidden;
    border-radius: calc(var(--nx-radius) - 1px) calc(var(--nx-radius) - 1px) 0 0;
}

.nx-card__media img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.nx-card__meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nx-ink-500);
    margin: 0;
}

/* Chips */
.nx-chips--center {
    justify-content: center;
}

.nx-chips--scroll {
    max-height: 190px;
    overflow: hidden;
}

.nx-chips--scroll.is-expanded {
    max-height: none;
}

ul.nx-chips {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nx-chip.is-active {
    border-color: var(--nx-accent);
    color: var(--nx-accent);
}

.nx-chip__count {
    margin-left: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.6;
}

button.nx-chip {
    cursor: pointer;
    font-family: var(--font-heading);
}

/* Filter / search row */
.nx-filter {
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
    background: var(--nx-surface);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.75rem;
}

.nx-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 640px;
    margin: 0 auto;
}

.nx-search input[type="text"],
.nx-search input[type="search"] {
    flex: 1 1 240px;
    min-width: 0;
    padding: 0.75rem 0.9rem;
    border: 1.5px solid var(--nx-line-strong);
    border-radius: 10px;
    font: inherit;
    font-size: 0.95rem;
    color: var(--nx-ink-900);
    background: #ffffff;
}

.nx-search input:focus {
    outline: none;
    border-color: var(--nx-accent);
    box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.15);
}

.nx-empty {
    text-align: center;
    color: var(--nx-ink-500);
    margin-top: 1.25rem;
}

.nx-search-status {
    margin: 0.75rem 0 1.75rem;
}

.nx-search-status.is-error {
    color: #b91c1c;
}

/* Pagination */
.nx-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
}

.nx-pagination__item a,
.nx-pagination__item button,
.nx-pagination__item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.7rem;
    border: 1px solid var(--nx-line);
    border-radius: 10px;
    background: var(--nx-surface);
    color: var(--nx-ink-900);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
}

.nx-pagination__item button {
    cursor: pointer;
}

.nx-pagination__item a:hover,
.nx-pagination__item a:focus,
.nx-pagination__item button:hover,
.nx-pagination__item button:focus {
    border-color: var(--nx-accent);
    color: var(--nx-accent);
    text-decoration: none;
}

.nx-pagination__item.is-active a {
    background: var(--nx-accent);
    border-color: var(--nx-accent);
    color: var(--nx-on-accent);
}

.nx-pagination__item.is-disabled span {
    opacity: 0.45;
}

/* Long-form article */
.nx-article {
    max-width: 800px;
    margin: 0 auto;
}

.nx-article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.75rem 0 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--nx-ink-500);
}

.nx-article__meta a {
    color: inherit;
    text-decoration: none;
}

.nx-article__meta a:hover {
    color: var(--nx-accent);
    text-decoration: none;
}

.nx-article__media {
    margin: 1.5rem 0 0;
    border-radius: var(--nx-radius);
    overflow: hidden;
}

.nx-article__media img {
    display: block;
    width: 100%;
    height: auto;
}

.nx-article .nx-richtext {
    margin-top: 1.75rem;
}

.nx-article .nx-richtext img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.nx-article .nx-richtext blockquote {
    margin: 1.5rem 0;
    padding: 0.9rem 1.1rem;
    border-left: 4px solid var(--nx-accent);
    border-radius: 0 12px 12px 0;
    background: var(--nx-paper);
    font-style: italic;
}

.nx-richtext a {
    color: var(--nx-accent);
}

.nx-section--tight-top {
    padding-top: clamp(24px, 3vw, 40px);
}

/* Playbooks */
.nx-playbook {
    max-width: 880px;
    margin: 0 auto;
}

.nx-playbook-summary {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.nx-playbook-nav {
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
    background: var(--nx-surface);
    padding: 1.1rem 1.4rem 1.25rem;
    margin-bottom: 2.25rem;
}

.nx-playbook-nav__title {
    display: block;
    margin-bottom: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nx-ink-500);
}

.nx-playbook-nav ol {
    columns: 2;
    column-gap: 1.5rem;
    margin: 0;
    padding-left: 1.15rem;
}

.nx-playbook-nav li {
    break-inside: avoid;
    margin-bottom: 0.3rem;
}

.nx-quicktake {
    border-left: 4px solid var(--nx-accent);
    border-radius: 0 12px 12px 0;
    background: var(--nx-paper);
    padding: 0.8rem 1.1rem;
    margin: 1rem 0;
}

.nx-quicktake__label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nx-accent);
}

.nx-quicktake p {
    margin: 0.3rem 0 0;
}

.nx-playbook-section {
    margin-bottom: 2.5rem;
}

.nx-playbook-section__title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.nx-playbook-section__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--nx-paper);
    color: var(--nx-accent);
}

.nx-playbook-section__icon svg,
.nx-playbook-section__icon img {
    width: 2rem;
    height: 2rem;
}

.nx-playbook-section h3 {
    margin-top: 1.25rem;
}

.nx-note {
    border: 1px solid var(--nx-line);
    border-left: 4px solid var(--nx-accent);
    border-radius: 0 12px 12px 0;
    background: var(--nx-paper);
    padding: 1rem 1.2rem;
    margin-top: 1rem;
}

.nx-note p:last-child {
    margin-bottom: 0;
}

.nx-pill-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.nx-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 1.15rem 0.4rem 0.4rem;
    border: 1px solid var(--nx-line);
    border-radius: 999px;
    background: var(--nx-surface);
    color: var(--nx-ink-900);
    font-weight: 600;
    text-decoration: none;
}

.nx-pill:hover,
.nx-pill:focus {
    border-color: var(--nx-accent);
    color: var(--nx-accent);
    text-decoration: none;
}

.nx-pill__icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--nx-paper);
    color: var(--nx-accent);
}

.nx-pill__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.nx-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}

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

.nx-table th,
.nx-table td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--nx-line);
    text-align: left;
    vertical-align: top;
}

.nx-table thead th {
    border-bottom: 2px solid var(--nx-line-strong);
    font-family: var(--font-heading);
}

.nx-further {
    margin-top: 1.25rem;
}

/* Calculators */
.nx-calc-index {
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
    background: var(--nx-surface);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}

.nx-calc-index__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nx-calc-index__head h2 {
    margin: 0;
}

.nx-calc-index__toggle {
    display: none;
}

.nx-calc-index__list-wrapper {
    transition: max-height 0.35s ease, opacity 0.25s ease;
    max-height: none;
    opacity: 1;
}

.nx-calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.nx-calc {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
    background: var(--nx-surface);
}

.nx-calc__main {
    flex: 1 1 0;
    min-width: 0;
}

.nx-calc__head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.nx-calc__head h3 {
    margin: 0 0 0.25rem;
}

.nx-calc__head p {
    margin: 0;
    color: var(--nx-ink-500);
    line-height: 1.4;
}

.nx-calc__result {
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--nx-paper);
    font-weight: 700;
    color: var(--nx-ink-900);
}

.nx-calc__toggle {
    display: none;
    margin-top: 0.75rem;
}

.nx-calc__details {
    flex: 0 0 46%;
    max-width: 46%;
    min-width: 0;
    padding-left: 1.25rem;
    border-left: 1px solid var(--nx-line);
    font-size: 0.95rem;
    color: var(--nx-ink-700);
}

.nx-calc__details p:last-child {
    margin-bottom: 0;
}

.nx-formula {
    margin: 0.85rem 0;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: var(--nx-ink-900);
    color: #ffffff;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.nx-formula__label {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-stripe);
}

.nx-formula__latex {
    font-size: 0.9rem;
}

.nx-formula .katex-display {
    margin: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.nx-calc-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--nx-ink-900);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 27, 36, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nx-calc-fab.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nx-calc-fab:hover,
.nx-calc-fab:focus {
    color: #ffffff;
    text-decoration: none;
}

@media (max-width: 991px) {
    .nx-playbook-summary {
        grid-template-columns: 1fr;
    }

    .nx-calc {
        flex-direction: column;
    }

    .nx-calc__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .nx-calc__toggle {
        display: inline-flex;
    }

    .nx-calc:not(.is-open) .nx-calc__details {
        display: none;
    }

    .nx-calc__details {
        flex: 1 1 auto;
        max-width: 100%;
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--nx-line);
        padding-top: 1rem;
    }

    .nx-calc-index__head {
        align-items: flex-start;
    }

    .nx-calc-index__toggle {
        display: inline-flex;
    }

    .nx-calc-index__list-wrapper {
        max-height: 0;
        opacity: 0;
        pointer-events: none;
        overflow: hidden;
    }

    .nx-calc-index.is-open .nx-calc-index__list-wrapper {
        max-height: 1200px;
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 767px) {
    .nx-playbook-nav ol {
        columns: 1;
    }

    .nx-card__media img {
        height: 200px;
    }
}
