:root {
    --np-bg: #fafaf7;
    --np-fg: #111;
    --np-muted: #6b6b66;
    --np-border: #e8e7df;
    --np-accent: #c9a227;
    --np-pulse: #2dba78;
    --np-card: #fff;
    --np-radius: 12px;
    --np-shadow-card: 0 1px 2px rgba(17,17,17,0.04);
    --np-overlay-soft: rgba(0,0,0,0.04);
    --np-overlay-mid:  rgba(0,0,0,0.05);
    --np-header-bg: rgba(250, 250, 247, 0.85);
    --np-header-h: 58px;
    --np-accent-soft: rgba(201, 162, 39, 0.12);
    color-scheme: light;
}
:root[data-theme="dark"] {
    --np-bg: #0d0d0c;
    --np-fg: #ececdf;
    --np-muted: #8f8f83;
    --np-border: #2a2a26;
    --np-accent: #e0b738;
    --np-pulse: #3ad08a;
    --np-card: #16161a;
    --np-shadow-card: 0 1px 2px rgba(0,0,0,0.45);
    --np-overlay-soft: rgba(255,255,255,0.04);
    --np-overlay-mid:  rgba(255,255,255,0.06);
    --np-header-bg: rgba(13, 13, 12, 0.78);
    --np-accent-soft: rgba(224, 183, 56, 0.16);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]),
    :root[data-theme="auto"] {
        --np-bg: #0d0d0c;
        --np-fg: #ececdf;
        --np-muted: #8f8f83;
        --np-border: #2a2a26;
        --np-accent: #e0b738;
        --np-pulse: #3ad08a;
        --np-card: #16161a;
        --np-shadow-card: 0 1px 2px rgba(0,0,0,0.45);
        --np-overlay-soft: rgba(255,255,255,0.04);
        --np-overlay-mid:  rgba(255,255,255,0.06);
        --np-header-bg: rgba(13, 13, 12, 0.78);
        --np-accent-soft: rgba(224, 183, 56, 0.16);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
/* `overflow-x: clip` (not hidden) — `hidden` on the viewport root turns
 * <html> into a scroll containing block which silently disables every
 * `position: sticky` descendant (most importantly .np-header). `clip`
 * still suppresses horizontal scrollbars without creating that block. */
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: var(--np-header-h); }
body {
    margin: 0;
    background: var(--np-bg);
    color: var(--np-fg);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* See note on <html> above — same reason: `hidden` breaks sticky
     * descendants by turning <body> into a scroll containing block. */
    overflow-x: clip;
    overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.np-container { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 1600px) {
    .np-container { max-width: 1520px; }
}
/* .np-container-wide used to be a wider variant; .np-container is now
 * wide by default. Class kept (without rules) so older templates that
 * still pair `np-container np-container-wide` don't break. */

/* Pro charts (line + candles) render with viewBox + no fixed width attr
 * so they can scale up to fill the container while preserving aspect
 * ratio. Hover overlay JS reads viewBox.baseVal so scaling is fine. */
.np-chart-pro { width: 100%; height: auto; max-width: 100%; display: block; }

/* Skip-link — visually hidden until focused via Tab. Lets keyboard users
 * jump past the ticker bar + sticky header straight to main content. */
.np-skip-link {
    position: absolute; top: -40px; left: 8px; z-index: 200;
    padding: 8px 12px;
    background: var(--np-fg); color: var(--np-bg);
    text-decoration: none; font-weight: 600; font-size: 14px;
    border-radius: 6px;
    transition: top 0.15s ease-in-out;
}
.np-skip-link:focus { top: 8px; }

.np-header {
    border-bottom: 1px solid var(--np-border);
    background: var(--np-header-bg);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    /* Sticky pins the header to the viewport top once the visitor scrolls
     * past the ticker (which sits above the header in normal flow). This
     * relies on neither <html> nor <body> establishing a scroll containing
     * block — see the `overflow-x: clip` notes above. */
    position: sticky; top: 0; z-index: 50;
}
.np-header-row {
    display: flex; align-items: center; gap: 24px;
    padding-top: 12px; padding-bottom: 12px;
    justify-content: space-between;
}
.np-logo {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--np-fg);
    flex-shrink: 0;
}
.np-logo:hover { opacity: 0.85; }
.np-logo-mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 6px rgba(201, 162, 39, 0.20), 0 1px 2px rgba(0,0,0,0.08);
    transition: transform 0.18s ease;
}
.np-logo:hover .np-logo-mark { transform: rotate(-3deg) scale(1.04); }
.np-logo-text {
    display: inline-flex; align-items: baseline;
    line-height: 1;
    font-weight: 700; font-size: 18px;
    letter-spacing: -0.025em;
}
.np-logo-name { color: var(--np-fg); }
.np-logo-tld {
    color: var(--np-accent);
    font-weight: 600;
    font-size: 0.78em;
    letter-spacing: -0.01em;
    margin-left: 1px;
}

.np-nav {
    display: flex; align-items: center; gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.np-nav-link {
    padding: 7px 12px; border-radius: 7px;
    font-size: 14px; font-weight: 500;
    color: var(--np-muted);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.np-nav-link:hover { background: var(--np-overlay-mid); color: var(--np-fg); }
.np-nav-link.is-active { color: var(--np-fg); background: var(--np-accent-soft); }

.np-header-actions {
    display: flex; align-items: center; gap: 5px;
    flex-shrink: 0;
    margin-left: auto;  /* always pin to the right edge */
}

/* Language dropdown */
.np-langs { position: relative; }
.np-flag {
    width: 22px; height: 16px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}
.np-lang-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 8px;
    color: var(--np-fg);
    font: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.np-lang-btn:hover { background: var(--np-overlay-soft); border-color: var(--np-fg); }
.np-lang-btn-text {
    letter-spacing: 0.04em;
    font-variant: tabular-nums;
}
.np-caret {
    width: 10px; height: 7px;
    color: var(--np-muted);
    transition: transform 0.18s ease;
    flex-shrink: 0;
}
.np-langs.is-open .np-caret { transform: rotate(180deg); }

.np-lang-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 200px;
    margin: 0; padding: 6px;
    list-style: none;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    opacity: 0; visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 60;
}
.np-langs.is-open .np-lang-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.np-lang-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px; color: var(--np-fg);
    transition: background 0.12s;
}
.np-lang-item:hover { background: var(--np-overlay-mid); }
.np-lang-item.is-active { background: var(--np-accent-soft); }
.np-lang-item-name { flex: 1; }
.np-lang-item-sub {
    font-size: 11px;
    color: var(--np-muted);
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* Search button + spotlight overlay */
.np-search-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 8px;
    color: var(--np-fg);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative; z-index: 1;
}
.np-search-btn:hover { background: var(--np-overlay-soft); border-color: var(--np-fg); color: var(--np-accent); }
.np-search-btn svg { width: 16px; height: 16px; display: block; }

/* Spotlight overlay. [hidden] is the inert state; .is-open triggers the
 * fade-in. JS handles the timing dance (remove hidden → next frame add
 * is-open; on close, remove is-open → wait for transition → add hidden).
 *
 * NOTE: no backdrop-filter here. blur() on a full-viewport overlay is
 * GPU-expensive at the first paint and was the root cause of the modal
 * feeling laggy on open. A solid translucent backdrop is enough. */
.np-search-overlay {
    position: fixed; inset: 0;
    /* Above the sticky ticker (z-1100) so the modal covers it instead
     * of being pinched between ticker and the top of the viewport. */
    z-index: 1200;
    background: rgba(15,15,15,0.55);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 80px 16px 40px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity .14s linear;
}
.np-search-overlay[hidden] { display: none !important; }
.np-search-overlay.is-open { opacity: 1; }
:root[data-theme="dark"] .np-search-overlay { background: rgba(0,0,0,0.7); }

.np-search-modal {
    width: 100%; max-width: 560px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.22);
    overflow: hidden;
    /* Lightweight transition: opacity + a tiny translate. Avoid scale
     * (forces a layer rasterise on every frame) and complex easing. */
    opacity: 0;
    transform: translateY(-6px);
    transition: transform .14s ease-out, opacity .14s ease-out;
    will-change: transform, opacity;
}
.np-search-overlay.is-open .np-search-modal {
    transform: translateY(0);
    opacity: 1;
}
.np-search-input-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--np-border);
}
.np-search-input-row svg { width: 18px; height: 18px; color: var(--np-muted); flex-shrink: 0; }
.np-search-input-row input {
    flex: 1; min-width: 0;
    appearance: none; background: transparent;
    border: 0; padding: 0;
    font: inherit; font-size: 16px;
    color: var(--np-fg);
    outline: none;
}
.np-search-input-row input::placeholder { color: var(--np-muted); }
/* Close (X) button at the right of the input row. Always visible so
 * touch users have an obvious way out. On desktop, Esc still works. */
.np-search-close {
    appearance: none;
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--np-muted);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
    -webkit-tap-highlight-color: transparent;
}
.np-search-close:hover,
.np-search-close:focus-visible {
    background: var(--np-overlay-mid);
    border-color: var(--np-border);
    color: var(--np-fg);
    outline: none;
}
.np-search-close svg { width: 16px; height: 16px; display: block; }

/* Section label sits above the result list. Empty unless JS sets text. */
.np-search-section-label {
    padding: 10px 18px 4px;
    font-size: 11px; font-weight: 600;
    color: var(--np-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.np-search-section-label:empty { display: none; }

.np-search-results {
    list-style: none; margin: 0; padding: 4px 8px 8px;
    max-height: 56vh;
    overflow-y: auto;
}
.np-search-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .1s, transform .1s;
}
.np-search-item:hover { background: var(--np-overlay-mid); }
.np-search-item.is-active {
    background: var(--np-accent-soft);
}
.np-search-item-label {
    flex: 1; min-width: 0;
    color: var(--np-fg); font-size: 14px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-search-item-label mark {
    background: rgba(var(--nc, 201, 162, 39), .22);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
.np-search-item-sub {
    color: var(--np-muted); font-size: 12px; flex-shrink: 0;
    white-space: nowrap;
}
.np-search-item-arrow {
    color: var(--np-muted);
    font-size: 14px;
    opacity: 0;
    transition: opacity .12s, transform .12s;
    flex-shrink: 0;
}
.np-search-item.is-active .np-search-item-arrow,
.np-search-item:hover .np-search-item-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.np-search-empty {
    padding: 32px 18px;
    text-align: center;
    color: var(--np-muted);
    font-size: 14px;
}

/* Footer hint with keyboard shortcuts. The "esc" item is a real button
 * (not just a hint) so mobile users — who don't have a keyboard — can
 * tap it to close the modal. */
.np-search-foot {
    display: flex; align-items: center; gap: 16px;
    padding: 9px 16px;
    border-top: 1px solid var(--np-border);
    background: var(--np-overlay-soft);
    color: var(--np-muted);
    font-size: 11px;
}
.np-search-foot-hint { display: inline-flex; align-items: center; }
.np-search-foot-close {
    appearance: none;
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--np-muted);
    font: inherit;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    -webkit-tap-highlight-color: transparent;
}
.np-search-foot-close:hover,
.np-search-foot-close:focus-visible {
    background: var(--np-overlay-mid);
    border-color: var(--np-border);
    color: var(--np-fg);
    outline: none;
}
.np-search-foot kbd {
    display: inline-flex; align-items: center; justify-content: center;
    margin-right: 4px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
    color: var(--np-muted);
}
.np-search-foot kbd + kbd { margin-left: -2px; }

body.np-no-scroll { overflow: hidden; }

@media (max-width: 540px) {
    /* Extra top padding accounts for the iOS notch / safe-area; without
     * it the modal lands underneath the status bar on devices with
     * non-zero env(safe-area-inset-top). */
    .np-search-overlay {
        padding: calc(40px + env(safe-area-inset-top, 0px)) 12px 24px;
    }
    .np-search-input-row input { font-size: 15px; }
    /* No keyboard on mobile — keyboard hints are irrelevant and the X
     * button in the input row is the close affordance, so the whole
     * footer can go away. */
    .np-search-foot { display: none; }
}

/* Theme toggle */
.np-theme-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 8px;
    color: var(--np-fg);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}
.np-theme-btn:hover { background: var(--np-overlay-soft); border-color: var(--np-fg); color: var(--np-accent); }
.np-theme-btn svg { width: 16px; height: 16px; display: block; }
/* show only the active theme glyph */
.np-theme-btn .np-theme-icon { display: none; }
:root[data-theme="light"] .np-theme-btn .np-theme-icon-light { display: block; }
:root[data-theme="dark"]  .np-theme-btn .np-theme-icon-dark  { display: block; }
:root[data-theme="auto"]  .np-theme-btn .np-theme-icon-auto  { display: block; }
:root:not([data-theme])   .np-theme-btn .np-theme-icon-auto  { display: block; }

/* Mobile burger */
.np-burger {
    display: none;
    align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-direction: column; gap: 4px;
}
.np-burger:hover { background: var(--np-overlay-soft); border-color: var(--np-fg); }
.np-burger span {
    display: block;
    width: 18px; height: 2px;
    background: var(--np-fg);
    border-radius: 1px;
    transition: transform 0.18s, opacity 0.12s;
}
.np-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.np-burger.is-open span:nth-child(2) { opacity: 0; }
.np-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.np-drawer {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--np-card);
    border-bottom: 1px solid var(--np-border);
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.18s, opacity 0.15s;
    z-index: 49;
}
.np-drawer.is-open { transform: translateY(0); opacity: 1; }
.np-drawer-nav {
    display: flex; flex-direction: column;
    padding: 10px 24px 18px;
}
.np-drawer-link {
    padding: 12px 4px;
    font-size: 16px; font-weight: 500;
    color: var(--np-fg);
    border-bottom: 1px solid var(--np-border);
}
.np-drawer-link:last-child { border-bottom: 0; }
.np-drawer-link.is-active { color: var(--np-accent); }

body.np-no-scroll { overflow: hidden; }

.np-hero { padding: 72px 0 48px; }
.np-hero-tagline {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 13px; color: var(--np-muted); margin: 0 0 20px;
    padding: 6px 14px 6px 10px;
    background: var(--np-card); border: 1px solid var(--np-border);
    border-radius: 999px;
    font-weight: 500;
}
.np-hero-title {
    font-size: clamp(34px, 5.2vw, 56px);
    line-height: 1.05; margin: 0 0 20px;
    font-weight: 700; letter-spacing: -0.025em; max-width: 18ch;
}
.np-hero-intro {
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.5; color: var(--np-muted);
    margin: 0; max-width: 56ch;
}
.np-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--np-pulse);
    box-shadow: 0 0 0 0 rgba(45, 186, 120, 0.5);
    animation: pulse 1.8s ease-out infinite;
    flex-shrink: 0;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(45, 186, 120, 0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(45, 186, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 186, 120, 0); }
}

/* Featured "live snapshot" strip on the home page */
.np-featured { padding: 0 0 8px; }
.np-featured-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin: 0 0 12px;
}
.np-featured-heading {
    font-size: 12px; font-weight: 700;
    color: var(--np-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin: 0;
}
.np-featured-stamp {
    font-size: 11px; color: var(--np-muted);
    font-variant-numeric: tabular-nums;
    opacity: 0; transition: opacity 0.2s;
}
.np-featured-stamp.is-visible { opacity: 1; }
.np-featured-stamp::before {
    content: ''; display: inline-block;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--np-pulse, #2dba78);
    margin-right: 6px; vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(45,186,120,.55);
    animation: pulse 1.8s infinite;
}
.np-featured-price.is-flash-up   { animation: np-flash-up   .55s ease; }
.np-featured-price.is-flash-down { animation: np-flash-down .55s ease; }
@keyframes np-flash-up   { 0% { color: var(--np-pulse, #2dba78); } 100% { color: inherit; } }
@keyframes np-flash-down { 0% { color: #e0573e; }                   100% { color: inherit; } }
.np-featured-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.np-featured-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px 14px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-variant-numeric: tabular-nums;
}
.np-featured-card:hover {
    border-color: var(--np-fg);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(17,17,17,0.05);
}
.np-featured-top {
    display: inline-flex; align-items: center; gap: 7px;
    min-width: 0;
}
.np-featured-top .np-coin-icon {
    width: 18px; height: 18px; flex-shrink: 0;
}
.np-featured-label {
    font-size: 11px; font-weight: 600;
    color: var(--np-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-featured-price {
    font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
    color: var(--np-fg);
}
.np-featured-change {
    font-size: 12px; font-weight: 600;
}
.np-featured-change.is-up   { color: var(--np-pulse); }
.np-featured-change.is-down { color: #e0573e; }

/* Crypto coin icon — used in /crypto table, /crypto/{coin} hero,
 * /watchlist cards, and the homepage compact strip. Default 22px;
 * detail hero scales up via .np-coin-icon-hero. */
.np-coin-icon {
    width: 22px; height: 22px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--np-bg);
    object-fit: contain;
    font-size: 10px;
}
.np-coin-icon-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--np-overlay-soft);
    color: var(--np-muted);
    border: 1px solid var(--np-border);
    font-weight: 700;
    text-transform: uppercase;
}
/* Flag <img> — circle-flags SVGs are already round, so no border-radius
 * trickery needed; just give it a subtle outline so dark/light themes
 * don't bleed into the flag's edge. */
.np-coin-icon-flag {
    background: transparent;
    box-shadow: 0 0 0 1px var(--np-border);
}
/* Bare icon — inline <svg> with non-circular shape (commodity ingots,
 * oil barrel, gas pump). Strips the circular crop + bg so the glyph
 * reads as itself, not floating inside a chip. */
.np-coin-icon-bare {
    background: transparent;
    border-radius: 0;
    border: 0;
    overflow: visible;
    display: inline-flex; align-items: center; justify-content: center;
}
.np-coin-icon-bare svg { width: 100%; height: 100%; display: block; }
.np-coin-icon-hero { width: 40px; height: 40px; font-size: 16px; }

.np-niches { padding: 0 0 96px; }
.np-niche-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}
/* Per-niche accent color (RGB triplet so we can mix shades via rgba()).
 * Used sparingly: glyph tint, hover border, hover shadow, live badge. */
.np-niche-gold   { --nc: 201, 162, 39;  }
.np-niche-fx     { --nc: 91, 141, 239;  }
.np-niche-crypto { --nc: 247, 147, 26;  }
.np-niche-fuel   { --nc: 224, 87, 62;   }
.np-niche-rates  { --nc: 45, 186, 120;  }
.np-niche-stocks { --nc: 165, 102, 212; }

.np-niche {
    position: relative;
    display: flex; gap: 16px; align-items: flex-start;
    padding: 22px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, border-color .15s, box-shadow .18s;
}
.np-niche:hover {
    border-color: rgba(var(--nc), .45);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--nc), .12);
}

.np-niche-arrow {
    position: absolute; top: 22px; right: 22px;
    color: var(--np-muted);
    font-size: 18px; line-height: 1;
    transition: transform .18s, color .15s;
    flex-shrink: 0;
}
.np-niche:hover .np-niche-arrow {
    transform: translateX(3px);
    color: rgb(var(--nc));
}
.np-niche-glyph {
    width: 52px; height: 52px; flex: 0 0 52px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    transition: transform .18s ease;
}
.np-niche-glyph svg,
.np-niche-glyph .np-niche-img { width: 44px; height: 44px; display: block; }
.np-niche:hover .np-niche-glyph { transform: scale(1.05); }
/* Hero icon shown next to the h1 on /crypto, /gold, /fx, /fuel,
 * /stocks, /rates hubs. Same colored SVG asset used on the home
 * "Markets we track" grid. Sized to baseline-align with the H1. */
.np-hero-icon {
    width: 1.1em; height: 1.1em;
    display: inline-block; vertical-align: -0.18em;
    margin-right: .35em;
}
/* ============================================================
 * Watchlist star buttons — shared across all hubs (crypto, gold,
 * fx, fuel, stocks, rates). Markup uses [data-np-watch-toggle="<niche>:<key>"]
 * which np-watchlist.js picks up via bindGeneric. Three variants:
 *
 *   .np-star          — base (used inline in tables, sized 16px)
 *   .np-star-cell     — table cell wrapper (fixed 36px width)
 *   .np-star-col      — table header cell (same width)
 *   .np-star-corner   — absolutely-positioned overlay for cards
 * ============================================================ */
.np-star-col, .np-star-cell { width: 36px; padding: 0 4px !important; }
.np-star {
    appearance: none; background: transparent; border: 0;
    padding: 6px; cursor: pointer;
    color: var(--np-border);
    transition: color 0.12s, transform 0.12s;
    line-height: 0;
}
.np-star svg { width: 16px; height: 16px; display: block; }
.np-star:hover { color: var(--np-muted); transform: scale(1.12); }
.np-star.is-on { color: #c9a227; }
.np-star.is-on svg { fill: currentColor; }
.np-star-corner {
    position: absolute; top: 8px; right: 8px;
    z-index: 2;
}
/* Larger variant for asset detail pages — sits inline next to the H1
 * title, baseline-aligned. Idle: outlined star in border color; .is-on
 * flips to filled gold accent. */
.np-star-detail {
    vertical-align: middle;
    margin-left: 12px;
    padding: 6px 8px;
    border: 1px solid var(--np-border);
    border-radius: 8px;
    color: var(--np-muted);
    background: var(--np-card);
    line-height: 0;
    transition: color .12s, border-color .12s, background .12s;
}
.np-star-detail svg { width: 18px; height: 18px; }
.np-star-detail:hover {
    color: var(--np-accent); border-color: var(--np-accent);
    background: var(--np-accent-soft);
    transform: none;
}
.np-star-detail.is-on {
    color: var(--np-accent); border-color: var(--np-accent);
    background: var(--np-accent-soft);
}
.np-star-detail.is-on svg { fill: currentColor; }

/* Watchlist filter chip + counter — used in category/filter bars on
 * each hub. Reuses any existing .np-cat-chip pill styling around it. */
.np-cat-chip-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; padding: 0 5px;
    height: 16px; line-height: 16px;
    font-size: 10px; font-weight: 700;
    background: var(--np-overlay-mid); color: var(--np-muted);
    border-radius: 8px;
    margin-left: 4px;
    transition: background 0.1s, color 0.1s;
}
.is-active .np-cat-chip-count {
    background: rgba(255,255,255,0.22);
    color: inherit;
}

.np-niche-body { flex: 1; min-width: 0; padding-right: 24px; }
/* Title row: name + tiny live dot, sits inline so the card stays compact. */
.np-niche-head {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 4px;
    min-height: 22px;
}
.np-niche-title {
    margin: 0;
    font-size: 17px; font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--np-fg);
}
.np-niche-desc {
    margin: 0;
    font-size: 14px; line-height: 1.45;
    color: var(--np-muted);
}
/* Default (coming-soon) badge — text pill, used only for non-live niches. */
.np-niche-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px;
    padding: 2px 8px;
    background: var(--np-bg);
    border: 1px solid var(--np-border);
    border-radius: 999px;
    color: var(--np-muted);
    letter-spacing: 0.02em;
}
/* Live indicator collapses to just a pulsing dot — title carries the
 * meaning, the dot conveys "live" at a glance. Text lives in aria-label. */
.np-niche-badge.is-live {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
}
.np-niche-badge.is-live .np-pulse {
    width: 8px; height: 8px;
    background: rgb(var(--nc));
    animation: np-niche-dot 1.8s ease-out infinite;
}
@keyframes np-niche-dot {
    0%   { box-shadow: 0 0 0 0 rgba(var(--nc), .55); }
    70%  { box-shadow: 0 0 0 8px rgba(var(--nc), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--nc), 0); }
}

/* Numeric display: never break a value mid-line, use tabular figures.
 * Used for change %, prices, volumes, market cap, FDV, supply, ATH, etc.
 * The arrow + space + number must stay on one line — also see nbsp in
 * np_fmt_change formatter for defense in depth. */
.np-num,
.np-change,
.np-change-pill,
.np-change-pill val,
.np-coin-change,
.np-coin-price,
.np-mover-sym,
.np-mover-price,
.np-mover-change,
.np-mover-ath,
.np-stat-value,
.np-stat-sub,
.np-deriv-value,
.np-deriv-sub,
.np-market-value,
.np-market-sub,
.np-market-pills span {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.np-crypto-table td.np-num,
.np-crypto-table td.np-change,
.np-crypto-table td.np-price,
.np-crypto-table td.np-volume,
.np-crypto-table td.np-mcap { white-space: nowrap; }

/* Stat cards: clip rather than overflow when exceptionally long */
.np-stat { min-width: 0; }
.np-stat-value { overflow: hidden; text-overflow: ellipsis; }

/* Pill rows wrap as a whole; pills themselves stay rigid */
.np-changes { flex-wrap: wrap; }
.np-change-pill { flex: 0 0 auto; }
.np-coin-meta { flex-wrap: wrap; }

/* Breadcrumb sits inside an .np-container[-wide] wrapper for max-width
 * and side padding. .np-breadcrumb-shell only adds the top margin and
 * neutralizes the inner .nav-breadcrumb's own padding/max-width. */
.np-breadcrumb-shell { margin-top: 16px; }
.np-breadcrumb-shell .nav-breadcrumb { padding: 0; margin: 0; max-width: none; }
@media (max-width: 540px) {
    .np-breadcrumb-shell { margin-top: 12px; }
}

/* Breadcrumb — targets existing Bootstrap-style markup
 * (.nav-breadcrumb > .breadcrumb > .breadcrumb-item) used on /about,
 * /privacy, /terms, /editorial, /suggest. Renders as a slim, theme-aware
 * row with chevron separators and a CSS-drawn home icon. */
.nav-breadcrumb {
    width: 100%;
    margin: 16px 0 8px;
    padding: 0 24px;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}
.breadcrumb {
    list-style: none;
    margin: 0;
    padding: 8px 14px;
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 4px 8px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 999px;
    font-size: 13px; color: var(--np-muted);
    line-height: 1.3;
    width: max-content; max-width: 100%;
}
.breadcrumb-item {
    display: inline-flex; align-items: center;
    color: var(--np-muted);
}
.breadcrumb-item a {
    color: var(--np-muted);
    text-decoration: none;
    transition: color 0.15s;
    border-radius: 4px;
    padding: 2px 0;
}
.breadcrumb-item a:hover { color: var(--np-fg); }
.breadcrumb-item.active {
    color: var(--np-fg);
    font-weight: 600;
}
/* Replace the Bootstrap home img with a CSS-drawn icon that follows theme */
.breadcrumb-item img { display: none; }
.breadcrumb-item:first-child > a::before {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    margin-right: 6px;
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11l9-8 9 8v9a2 2 0 01-2 2h-4v-7h-6v7H5a2 2 0 01-2-2z'/></svg>") center / 14px 14px no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11l9-8 9 8v9a2 2 0 01-2 2h-4v-7h-6v7H5a2 2 0 01-2-2z'/></svg>") center / 14px 14px no-repeat;
}
/* Chevron separator between items */
.breadcrumb-item + .breadcrumb-item::before {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    margin: 0 4px 0 0;
    border-right: 1.5px solid var(--np-border);
    border-top: 1.5px solid var(--np-border);
    transform: rotate(45deg);
    flex-shrink: 0;
}
/* Hide the wutools-flavoured d-flex wrapper artefacts so the breadcrumb
 * sits flush in our layout. */
main#wrapper { padding-top: 0; }
main#wrapper > .d-flex { display: block; }

@media (max-width: 540px) {
    .nav-breadcrumb { padding: 0 16px; }
    .breadcrumb { font-size: 12px; padding: 6px 12px; }
}

/* Static pages — about, privacy, terms, editorial, suggest */
.np-static-page { padding: 24px 0 56px; max-width: 760px; }
.np-static-hero { margin-bottom: 28px; }
.np-static-hero h1 {
    margin: 0 0 8px;
    font-size: 32px; font-weight: 700; letter-spacing: -0.02em;
    color: var(--np-fg);
}
.np-static-meta {
    display: inline-block;
    margin: 0 0 8px;
    font-size: 12px; color: var(--np-muted);
    padding: 2px 10px;
    background: var(--np-overlay-soft);
    border-radius: 999px;
}
.np-static-lead {
    margin: 8px 0 0;
    font-size: 17px; line-height: 1.5;
    color: var(--np-muted);
}
.np-static-section { margin: 28px 0; }
.np-static-section h2 {
    font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
    margin: 0 0 12px; color: var(--np-fg);
}
.np-static-body { font-size: 15px; line-height: 1.65; color: var(--np-fg); }
.np-static-body p { margin: 0 0 12px; }
.np-static-body p:last-child { margin-bottom: 0; }
.np-static-body ul, .np-static-body ol { margin: 0 0 12px; padding-left: 24px; }
.np-static-body li { margin-bottom: 6px; }
.np-static-body a { color: var(--np-accent); text-decoration: underline; text-underline-offset: 3px; }
.np-static-body a:hover { color: var(--np-fg); }
.np-static-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
    padding: 1px 5px;
    background: var(--np-overlay-soft);
    border-radius: 4px;
}
.np-static-body strong { color: var(--np-fg); font-weight: 600; }

/* Contact card grid (suggest page) */
.np-contact-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 4px;
}
.np-contact-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 18px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.np-contact-card:hover {
    border-color: var(--np-fg);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(17,17,17,0.06);
}
.np-contact-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--np-fg); }
.np-contact-body  { margin: 0; font-size: 13px; line-height: 1.5; color: var(--np-muted); }
.np-contact-link  { margin-top: 4px; font-size: 13px; color: var(--np-accent); font-weight: 500; }

@media (max-width: 540px) {
    .np-static-hero h1 { font-size: 26px; }
    .np-static-lead { font-size: 15px; }
}

/* Drivers explainer card (niche detail pages) */
.np-drivers { margin: 28px 0; }
.np-drivers h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; color: var(--np-fg); }
.np-drivers-card { background: var(--np-card); border: 1px solid var(--np-border); border-radius: var(--np-radius); padding: 18px 22px; }
.np-drivers-card p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; color: var(--np-fg); }
.np-drivers-card ul { margin: 0; padding-left: 20px; color: var(--np-muted); font-size: 14px; line-height: 1.7; }
.np-drivers-card li { margin-bottom: 4px; }

/* FAQ accordion (used on niche hubs) */
.np-faq {
    margin: 36px 0;
    width: 100%;
}
.np-faq-heading {
    font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
    margin: 0 0 14px;
    color: var(--np-fg);
}
.np-faq-list {
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    overflow: hidden;
}
.np-faq-item { border-bottom: 1px solid var(--np-border); }
.np-faq-item:last-child { border-bottom: 0; }
.np-faq-q {
    cursor: pointer;
    list-style: none;
    padding: 16px 20px;
    font-size: 16px; font-weight: 600; color: var(--np-fg);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    line-height: 1.4;
    transition: background 0.15s;
}
.np-faq-q:hover { background: var(--np-overlay-soft); }
.np-faq-q::-webkit-details-marker { display: none; }
.np-faq-q::after {
    content: "+";
    font-size: 20px; font-weight: 400;
    color: var(--np-muted);
    transition: transform 0.18s;
    flex-shrink: 0;
}
.np-faq-item[open] .np-faq-q::after { content: "−"; color: var(--np-accent); }
.np-faq-a {
    padding: 0 20px 18px;
    font-size: 15px; line-height: 1.65; color: var(--np-fg);
}
.np-faq-a p { margin: 0 0 10px; }
.np-faq-a p:last-child { margin-bottom: 0; }
.np-faq-a a { color: var(--np-accent); text-decoration: underline; text-underline-offset: 2px; }
.np-faq-a a:hover { color: var(--np-fg); }
.np-faq-a strong { color: var(--np-fg); font-weight: 600; }
@media (max-width: 600px) {
    .np-faq-heading { font-size: 19px; }
    .np-faq-q { padding: 14px 16px; font-size: 15px; }
    .np-faq-a { padding: 0 16px 16px; font-size: 14.5px; }
}

/* Honour user preference for reduced motion. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

.np-footer {
    border-top: 1px solid var(--np-border);
    padding: 28px 0; margin-top: 32px;
    font-size: 13px; color: var(--np-muted);
}
.np-footer-row {
    display: flex; justify-content: space-between;
    flex-wrap: wrap; gap: 16px; align-items: center;
}
.np-footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.np-footer-links a { transition: color 0.15s; }
.np-footer-links a:hover { color: var(--np-fg); }

/* Tablet: shrink nav padding so 10 links fit until ~960px */
@media (max-width: 1280px) {
    .np-header-row { gap: 16px; }
    .np-nav-link { padding: 6px 10px; font-size: 13px; }
    .np-lang-btn-text { display: none; }
    .np-lang-btn { padding: 6px 8px; gap: 6px; }
}

/* Mobile: collapse nav into drawer, show burger */
@media (max-width: 960px) {
    .np-nav { display: none; }
    .np-burger { display: inline-flex; }
    .np-niche-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
    :root { --np-header-h: 52px; }
    .np-header-row { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
    .np-hero { padding: 56px 0 32px; }
    .np-niche { padding: 18px; }
    .np-niche-grid { grid-template-columns: 1fr; gap: 12px; }
    .np-logo-text { font-size: 20px; }
    .np-lang-menu { right: -8px; min-width: 180px; }
}

@media (max-width: 380px) {
    .np-header-row { position: relative; }
    .np-logo { position: relative; z-index: 1; min-width: 0; }
    .np-header-actions {
        position: absolute; right: 0; top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        padding-left: 10px;
        background: var(--np-header-bg);
        box-shadow: -8px 0 8px -4px var(--np-header-bg);
    }
}

/* Dark-mode-only refinements (shadows, flag border) — applied when the
 * effective theme is dark, regardless of whether that came from an
 * explicit data-theme="dark" or from auto+system-dark. */
:root[data-theme="dark"] .np-niche:hover { box-shadow: 0 14px 36px rgba(var(--nc), .26), 0 4px 12px rgba(0,0,0,0.55); }
:root[data-theme="dark"] .np-flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15); }
:root[data-theme="dark"] .np-lang-menu { box-shadow: 0 8px 28px rgba(0,0,0,0.5); }
:root[data-theme="dark"] .np-drawer { box-shadow: 0 12px 28px rgba(0,0,0,0.5); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .np-niche:hover,
    :root[data-theme="auto"] .np-niche:hover { box-shadow: 0 14px 36px rgba(var(--nc), .26), 0 4px 12px rgba(0,0,0,0.55); }
    :root:not([data-theme]) .np-flag,
    :root[data-theme="auto"] .np-flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15); }
    :root:not([data-theme]) .np-lang-menu,
    :root[data-theme="auto"] .np-lang-menu { box-shadow: 0 8px 28px rgba(0,0,0,0.5); }
    :root:not([data-theme]) .np-drawer,
    :root[data-theme="auto"] .np-drawer { box-shadow: 0 12px 28px rgba(0,0,0,0.5); }
}

/* ----------------------------------------------------------------- PWA pill */
.np-pwa-pill {
    position: fixed; right: 16px; bottom: 16px; z-index: 1500;
    display: flex; align-items: center; gap: 4px;
    padding: 0; background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(17,17,17,.12), 0 2px 8px rgba(17,17,17,.06);
    transform: translateY(20px); opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
    font-variant-numeric: tabular-nums;
}
.np-pwa-pill.is-visible { transform: translateY(0); opacity: 1; }
.np-pwa-pill-cta {
    appearance: none; background: transparent; border: 0;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px 10px 16px; cursor: pointer;
    font: inherit; font-weight: 600; color: var(--np-fg);
    border-radius: 999px;
}
.np-pwa-pill-cta:hover { background: var(--np-bg); }
.np-pwa-pill-cta svg { color: #c9a227; }
.np-pwa-pill-close {
    appearance: none; background: transparent; border: 0;
    padding: 8px 12px 8px 4px; cursor: pointer; color: var(--np-muted);
    border-radius: 999px;
}
.np-pwa-pill-close:hover { color: var(--np-fg); }

/* -------------------------------------------------------------- live ticker */
/* Sticky bar at the very top — scrolling marquee of key prices. Reuses the
 * live-snapshot data sources (no extra fetches).
 * NOTE: selector is scoped to `aside.np-ticker` (the marquee root, see
 * np-ticker.js) to avoid colliding with `td.np-ticker` used in the stocks
 * table for ticker codes. */
aside.np-ticker {
    position: relative; z-index: 1100;
    background: #0d0d0c;
    color: #e5e5e0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    overflow: hidden;
    font-variant-numeric: tabular-nums;
    font-size: 12px; line-height: 28px;
    contain: layout paint style;
}
aside.np-ticker .np-ticker-track {
    display: flex; gap: 0;
    width: max-content;
    animation: np-ticker-scroll 60s linear infinite;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}
aside.np-ticker.is-paused .np-ticker-track,
aside.np-ticker:hover .np-ticker-track,
aside.np-ticker:focus-within .np-ticker-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
    .np-ticker-track { animation: none; }
}
.np-ticker-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 14px; white-space: nowrap;
    color: inherit; text-decoration: none;
    border-right: 1px solid rgba(255,255,255,.06);
}
.np-ticker-item:hover { background: rgba(255,255,255,.04); }
.np-ticker-label { font-weight: 600; color: #fafaf7; letter-spacing: .03em; font-size: 11px; }
.np-ticker-price {
    color: #fafaf7;
    display: inline-block; min-width: 9ch; text-align: right;
}
.np-ticker-change {
    display: inline-block; min-width: 6ch; text-align: right;
}
.np-ticker-change.is-up   { color: #2dba78; }
.np-ticker-change.is-down { color: #ef6a52; }
@keyframes np-ticker-scroll {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}
@media (max-width: 640px) {
    .np-ticker-track { animation-duration: 48s; }
    .np-ticker-item  { padding: 0 10px; }
}

/* ------------------------------------------------------------- watchlist UI */
.np-watch-toggle {
    appearance: none; background: transparent; border: 0;
    padding: 4px; cursor: pointer; color: var(--np-muted);
    border-radius: 4px; transition: color .15s, transform .12s;
    line-height: 0;
}
.np-watch-toggle:hover { color: #c9a227; transform: scale(1.08); }
.np-watch-toggle.is-on { color: #c9a227; }
.np-watch-toggle.is-on svg { fill: currentColor; }

/* /watchlist page */
.np-watchlist-page { padding-top: 32px; padding-bottom: 80px; }
.np-watchlist-empty {
    border: 1px dashed var(--np-border); border-radius: var(--np-radius);
    padding: 40px 24px; text-align: center; color: var(--np-muted);
}
.np-watchlist-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
/* Full /watchlist card — denser, with optional 24h H/L strip and inline
 * sparkline. Tabular-nums keeps prices aligned across the grid. */
.np-watchlist-card {
    position: relative;
    display: flex; flex-direction: column; gap: 4px;
    padding: 11px 12px 8px; background: var(--np-card);
    border: 1px solid var(--np-border); border-radius: 10px;
    text-decoration: none; color: inherit;
    font-variant-numeric: tabular-nums;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    overflow: hidden;
}
.np-watchlist-card:hover {
    border-color: var(--np-fg); transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.np-watchlist-card-label {
    font-size: 10px; font-weight: 700; color: var(--np-muted);
    text-transform: uppercase; letter-spacing: .06em;
    padding-right: 18px;  /* leave space for remove × */
    display: flex; align-items: center; gap: 6px;
    min-height: 22px;     /* match icon size — keeps card heights aligned across niches */
}
.np-watchlist-card-label-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0; flex: 1;
}
.np-watchlist-card-label .np-coin-icon {
    /* Flex item, so neither inline alignment nor margin-top nudges are
     * needed; the parent's align-items: center handles vertical centring. */
    margin: 0;
}
.np-watchlist-card-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px; margin-top: 2px;
}
.np-watchlist-card-price {
    font-size: 17px; font-weight: 700; color: var(--np-fg);
    letter-spacing: -0.01em; line-height: 1.15;
}
.np-watchlist-card-change { font-size: 11px; font-weight: 600; flex-shrink: 0; }
.np-watchlist-card-change.is-up   { color: var(--np-pulse); }
.np-watchlist-card-change.is-down { color: #e0573e; }

/* Skeleton state for cards painted from localStorage before the snapshot
 * fetch resolves. Price/change spans get a shimmering placeholder so the
 * page never feels blank, then the .is-loading class is removed once
 * hydrateCompactCard / hydrateFullCard fills in real values. */
.np-watchlist-card.is-loading .np-watchlist-card-price,
.np-watchlist-card.is-loading .np-watchlist-card-change {
    color: transparent;
    background: linear-gradient(
        90deg,
        var(--np-border) 0%,
        var(--np-bg) 50%,
        var(--np-border) 100%
    );
    background-size: 200% 100%;
    animation: np-skel-shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
    min-width: 60px;
    display: inline-block;
}
.np-watchlist-card.is-loading .np-watchlist-card-change { min-width: 40px; }
.np-watchlist-card.is-loading {
    /* Stable height so non-loaded cards don't reflow when range/spark
     * arrive. 4px of margin reserved for where the spark SVG lands. */
}
.np-watchlist-card .np-watchlist-card-price,
.np-watchlist-card .np-watchlist-card-change {
    transition: color 180ms ease-out;
}
@keyframes np-skel-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .np-watchlist-card.is-loading .np-watchlist-card-price,
    .np-watchlist-card.is-loading .np-watchlist-card-change {
        animation: none;
        background: var(--np-border);
    }
}
.np-watchlist-card-range {
    font-size: 10px; color: var(--np-muted); margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-watchlist-card-range .np-sep { margin: 0 5px; opacity: .5; }
.np-watchlist-spark {
    width: 100%; height: 26px; display: block;
    margin-top: 6px;
    opacity: .85;
}
.np-watchlist-card-tools {
    position: absolute; top: 6px; right: 6px;
    display: flex; align-items: center; gap: 4px;
}
.np-watchlist-remove, .np-watchlist-bell {
    appearance: none; background: transparent; border: 0;
    color: var(--np-border); cursor: pointer;
    line-height: 1;
    transition: color .12s, background .12s;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
}
.np-watchlist-remove { font-size: 14px; }
.np-watchlist-bell svg { width: 14px; height: 14px; display: block; }
.np-watchlist-remove:hover { color: #e0573e; }
.np-watchlist-bell:hover {
    color: var(--np-accent);
    background: var(--np-accent-soft);
}

/* /watchlist hero — title left, actions (clear-all + stamp) right */
.np-watchlist-hero {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.np-watchlist-hero h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.02em; }
.np-watchlist-hero .np-static-lead { margin: 0; color: var(--np-muted); }
.np-watchlist-actions {
    display: flex; align-items: center; gap: 12px;
    font-variant-numeric: tabular-nums;
}
.np-watchlist-actions .np-watchlist-stamp { margin: 0; }
.np-btn-ghost {
    background: transparent; border: 1px solid var(--np-border);
    color: var(--np-muted); padding: 6px 12px; font-size: 13px;
}
.np-btn-ghost:hover { color: #e0573e; border-color: #e0573e; }

/* count pill on /watchlist section headings */
.np-watchlist-h2-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; padding: 0 6px;
    height: 18px; line-height: 18px;
    font-size: 11px; font-weight: 700;
    background: var(--np-overlay-mid); color: var(--np-muted);
    border-radius: 9px; margin-left: 6px;
    text-transform: none; letter-spacing: 0;
}

/* Compact card variant (homepage strip) — even tighter; no remove,
 * no sparkline, no h/l strip. */
.np-watchlist-card.is-compact {
    padding: 10px 12px;
    gap: 2px;
}
.np-watchlist-card.is-compact .np-watchlist-card-label { padding-right: 0; }
.np-watchlist-card.is-compact .np-watchlist-card-price { font-size: 15px; }

/* Homepage watchlist strip (above "Markets we track"). Hidden by JS
 * when the user has nothing starred yet. */
.np-home-watchlist { padding: 22px 0 6px; }
.np-home-watchlist-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin-bottom: 14px;
}
.np-home-watchlist-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; padding: 0 7px; height: 22px; line-height: 22px;
    font-size: 12px; font-weight: 700;
    background: var(--np-accent-soft); color: var(--np-fg);
    border-radius: 11px; margin-left: 8px;
    vertical-align: middle;
}
.np-home-watchlist-more {
    font-size: 13px; font-weight: 600; color: var(--np-accent);
    text-decoration: none;
}
.np-home-watchlist-more:hover { text-decoration: underline; }
.np-home-watchlist-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* ----------------------------------------------------------- calculators */
.np-calc-page { padding-top: 32px; padding-bottom: 80px; max-width: 760px; margin: 0 auto; }
.np-calc-page h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -0.02em; }
.np-calc-card {
    background: var(--np-card); border: 1px solid var(--np-border);
    border-radius: var(--np-radius); padding: 24px;
}
.np-calc-row {
    display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 14px;
}
.np-calc-row label { font-size: 13px; font-weight: 600; color: var(--np-muted); }
.np-calc-row input, .np-calc-row select {
    appearance: none; -webkit-appearance: none;
    width: 100%; padding: 12px 14px; font-size: 16px;
    background: var(--np-bg); color: var(--np-fg);
    border: 1px solid var(--np-border); border-radius: 8px;
    font-variant-numeric: tabular-nums; font-family: inherit;
}
.np-calc-row input:focus, .np-calc-row select:focus {
    outline: 2px solid #c9a227; outline-offset: -1px; border-color: #c9a227;
}
.np-calc-swap {
    appearance: none; background: var(--np-bg); border: 1px solid var(--np-border);
    width: 40px; height: 40px; border-radius: 8px; cursor: pointer; color: var(--np-muted);
}
.np-calc-swap:hover { color: #c9a227; border-color: #c9a227; }
.np-calc-result {
    margin-top: 18px; padding: 18px; border-radius: 10px;
    background: var(--np-bg); border: 1px solid var(--np-border);
    font-size: 13px; color: var(--np-muted);
}
.np-calc-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.np-calc-tile {
    display: flex; flex-direction: column; gap: 6px;
    padding: 22px; background: var(--np-card);
    border: 1px solid var(--np-border); border-radius: var(--np-radius);
    text-decoration: none; color: inherit;
    transition: transform .15s, border-color .15s;
}
.np-calc-tile:hover { border-color: var(--np-fg); transform: translateY(-2px); }
.np-calc-tile-icon { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.np-calc-tile-title { font-size: 16px; font-weight: 700; margin: 0; }
.np-calc-tile-desc { font-size: 13px; color: var(--np-muted); margin: 0; }
.np-calc-tile-body { display: flex; flex-direction: column; gap: 4px; }
.np-calc-hub { padding-top: 32px; padding-bottom: 80px; }

/* watchlist sections + stamps */
.np-watchlist-section { margin-top: 28px; }
.np-watchlist-h2 {
    font-size: 13px; font-weight: 700; color: var(--np-muted);
    text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px;
}
.np-watchlist-stamp { margin-top: 24px; color: var(--np-muted); font-size: 12px; }
.np-watchlist-cta { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* generic button used on watchlist + elsewhere */
.np-btn {
    display: inline-block; padding: 8px 14px; font-weight: 600; font-size: 14px;
    border: 1px solid var(--np-border); border-radius: 8px;
    color: var(--np-fg); text-decoration: none; background: var(--np-card);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.np-btn:hover { border-color: var(--np-fg); }
.np-btn-primary { background: #c9a227; color: #1a1a1a; border-color: #c9a227; }
.np-btn-primary:hover { background: #b89020; border-color: #b89020; }
.np-btn-danger { background: #e0573e; color: #fff; border-color: #e0573e; }
.np-btn-danger:hover { background: #c84830; border-color: #c84830; }

/* Lightweight in-page modal — used for "Clear all" confirm. Symmetric
 * fade/scale transitions on `is-open` so opening AND closing feel smooth.
 * The [hidden] attribute is the resting state (display:none, removed
 * from a11y tree); JS removes it on open, re-adds it after the close
 * transition finishes. No backdrop-filter blur — too expensive on
 * lower-end GPUs and the perceived gain is minimal. */
.np-modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease-out;
}
.np-modal[hidden] { display: none; }
.np-modal.is-open { opacity: 1; pointer-events: auto; }
.np-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.np-modal-card {
    position: relative;
    width: 100%; max-width: 380px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 14px;
    padding: 22px 24px 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(8px) scale(0.98);
    transition: transform .18s ease-out;
    will-change: transform;
}
.np-modal.is-open .np-modal-card { transform: translateY(0) scale(1); }
.np-modal-title {
    margin: 0 0 6px; font-size: 16px; font-weight: 700;
    letter-spacing: -0.01em;
}
.np-modal-msg {
    margin: 0 0 18px; color: var(--np-muted); font-size: 13px;
    line-height: 1.5;
}
.np-modal-actions {
    display: flex; justify-content: flex-end; gap: 8px;
}
body.np-modal-open { overflow: hidden; }

/* calculator form fields */
.np-calc-row {
    display: grid; gap: 12px; align-items: end;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 14px;
}
.np-calc-field { display: flex; flex-direction: column; gap: 6px; }
.np-calc-label { font-size: 12px; font-weight: 600; color: var(--np-muted); text-transform: uppercase; letter-spacing: .04em; }
.np-calc-input, .np-calc-select {
    appearance: none; -webkit-appearance: none;
    width: 100%; padding: 12px 14px; font-size: 16px;
    background: var(--np-bg); color: var(--np-fg);
    border: 1px solid var(--np-border); border-radius: 8px;
    font-variant-numeric: tabular-nums; font-family: inherit;
}
.np-calc-input:focus, .np-calc-select:focus {
    outline: 2px solid #c9a227; outline-offset: -1px; border-color: #c9a227;
}
.np-calc-secondary {
    align-self: end; padding: 10px 14px; font-size: 14px; font-weight: 600;
    background: var(--np-card); color: var(--np-fg);
    border: 1px solid var(--np-border); border-radius: 8px; cursor: pointer;
}
.np-calc-secondary:hover { border-color: #c9a227; color: #c9a227; }

/* calculator result block */
.np-calc-result-amount {
    font-size: 28px; font-weight: 700; color: var(--np-fg);
    letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.np-calc-result-amount.is-up   { color: var(--np-pulse); }
.np-calc-result-amount.is-down { color: #e0573e; }
.np-calc-result-vnd { font-size: 18px; font-weight: 600; color: var(--np-muted); margin-top: 2px; }
.np-calc-result-meta {
    margin-top: 8px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    font-size: 12px; color: var(--np-muted);
}
.np-calc-result-stamp { font-variant-numeric: tabular-nums; }

/* gold-weight readout grid */
.np-calc-grid-rows {
    display: grid; gap: 8px; margin-top: 16px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.np-calc-readout {
    padding: 10px 12px; background: var(--np-bg);
    border: 1px solid var(--np-border); border-radius: 8px;
    font-size: 14px; font-variant-numeric: tabular-nums;
    display: flex; justify-content: space-between; gap: 8px;
}
.np-calc-readout-label { color: var(--np-muted); font-size: 12px; }

/* loan summary tiles */
.np-calc-summary {
    display: grid; gap: 12px; margin-top: 18px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.np-calc-summary-tile {
    padding: 14px; background: var(--np-bg);
    border: 1px solid var(--np-border); border-radius: 10px;
}
.np-calc-summary-label { font-size: 11px; font-weight: 600; color: var(--np-muted); text-transform: uppercase; letter-spacing: .04em; }
.np-calc-summary-value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* loan amortization schedule */
.np-calc-schedule { margin-top: 18px; }
.np-calc-schedule summary {
    cursor: pointer; padding: 10px 14px; font-weight: 600;
    background: var(--np-bg); border: 1px solid var(--np-border); border-radius: 8px;
    list-style: none;
}
.np-calc-schedule summary::-webkit-details-marker { display: none; }
.np-calc-schedule summary::before { content: '▸ '; transition: transform .15s; display: inline-block; }
.np-calc-schedule[open] summary::before { transform: rotate(90deg); }
.np-calc-schedule-table-wrap { max-height: 360px; overflow: auto; margin-top: 10px; border: 1px solid var(--np-border); border-radius: 8px; }
.np-calc-schedule-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.np-calc-schedule-table th, .np-calc-schedule-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--np-border); }
.np-calc-schedule-table th:first-child, .np-calc-schedule-table td:first-child { text-align: left; }
.np-calc-schedule-table thead th { background: var(--np-bg); position: sticky; top: 0; z-index: 1; color: var(--np-muted); font-weight: 600; }

/* ---------- Calculator advanced/pro features ---------------------------- */
.np-calc-advanced, .np-calc-compare {
    margin-top: 14px;
    border-top: 1px solid var(--np-border);
    padding-top: 14px;
}
.np-calc-advanced > summary, .np-calc-compare > summary {
    cursor: pointer; list-style: none;
    font-size: 13px; font-weight: 600; color: var(--np-muted);
    padding: 6px 0; user-select: none;
}
.np-calc-advanced > summary::-webkit-details-marker,
.np-calc-compare > summary::-webkit-details-marker { display: none; }
.np-calc-advanced[open] > summary, .np-calc-compare[open] > summary { color: var(--np-fg); }
.np-calc-extra-out {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-top: 10px;
}
.np-calc-extra-tile {
    background: rgba(45,186,120,0.06); border: 1px solid rgba(45,186,120,0.18);
    border-radius: 10px; padding: 10px 14px;
    font-variant-numeric: tabular-nums;
}
.np-calc-extra-label {
    display: block; font-size: 11px; color: var(--np-muted);
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px;
}
.np-calc-extra-tile strong { font-size: 16px; color: var(--np-pulse); font-weight: 700; }

/* Stacked-area chart */
.np-calc-chart-card {
    margin-top: 18px; padding: 14px;
    background: var(--np-bg); border: 1px solid var(--np-border);
    border-radius: 10px;
}
.np-calc-chart-head {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
}
.np-calc-chart-title { font-size: 13px; font-weight: 600; color: var(--np-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.np-calc-chart-legend { display: flex; gap: 12px; font-size: 12px; }
.np-calc-leg { position: relative; padding-left: 14px; color: var(--np-muted); }
.np-calc-leg::before {
    content: ''; position: absolute; left: 0; top: 50%;
    width: 10px; height: 10px; border-radius: 2px; transform: translateY(-50%);
}
.np-calc-leg-p::before { background: rgba(45, 186, 120, 0.55); }
.np-calc-leg-i::before { background: rgba(224, 87, 62, 0.55); }
.np-calc-leg-b::before { background: transparent; border: 1.5px dashed #c9a227; height: 0; }
.np-calc-chart {
    width: 100%; height: 220px; display: block;
}

/* Side-by-side compare grid */
.np-calc-compare-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin-top: 12px;
}
.np-calc-compare-col {
    padding: 12px; border: 1px solid var(--np-border);
    border-radius: 10px; background: var(--np-bg);
}
.np-calc-compare-h {
    font-size: 12px; font-weight: 700; color: var(--np-muted);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.np-calc-compare-stat {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 4px 0; font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.np-calc-compare-stat span { color: var(--np-muted); }
.np-calc-compare-stat strong { color: var(--np-fg); font-weight: 700; }
.np-calc-compare-savings {
    margin-top: 12px; padding: 10px 14px;
    border-radius: 10px;
    display: flex; align-items: baseline; gap: 8px;
    font-variant-numeric: tabular-nums;
    background: rgba(201,162,39,0.08); border: 1px solid rgba(201,162,39,0.25);
}
.np-calc-compare-savings.is-cheaper {
    background: rgba(45,186,120,0.08); border-color: rgba(45,186,120,0.25);
}
.np-calc-compare-savings.is-cheaper strong { color: var(--np-pulse); }
.np-calc-compare-savings.is-more {
    background: rgba(224,87,62,0.08); border-color: rgba(224,87,62,0.25);
}
.np-calc-compare-savings.is-more strong { color: #e0573e; }
.np-calc-compare-savings strong { font-size: 17px; font-weight: 700; }
.np-calc-cmp-label, .np-calc-cmp-vs { font-size: 12px; color: var(--np-muted); }

@media (max-width: 540px) {
    .np-calc-compare-grid { grid-template-columns: 1fr; }
    .np-calc-extra-out { grid-template-columns: 1fr; }
}

/* Pro-mode crypto P&L specifics */
.np-calc-readout-strong {
    font-size: 17px; font-weight: 700; color: var(--np-fg);
    padding: 10px 14px; border: 1px solid var(--np-border);
    background: var(--np-bg); border-radius: 8px;
    font-variant-numeric: tabular-nums;
}
.np-calc-sub-h {
    font-size: 13px; font-weight: 700; color: var(--np-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin: 16px 0 8px;
}
.np-calc-dca-grid {
    display: grid; gap: 8px; margin-bottom: 10px;
}
.np-calc-dca-row {
    display: grid; grid-template-columns: 1fr auto 1fr;
    gap: 8px; align-items: center;
}
.np-calc-dca-row input { width: 100%; }
.np-calc-dca-x { color: var(--np-muted); font-weight: 700; }
.np-calc-dca-out {
    display: flex; gap: 12px; align-items: stretch;
}
.np-calc-dca-out > .np-calc-extra-tile { flex: 1; }
.np-calc-dca-out > .np-btn { align-self: stretch; }

/* Multi-target currency table */
.np-calc-multi-table {
    width: 100%; border-collapse: collapse;
    font-variant-numeric: tabular-nums; font-size: 13px;
    margin-bottom: 6px;
}
.np-calc-multi-table th, .np-calc-multi-table td {
    padding: 8px 10px; border-bottom: 1px solid var(--np-border); text-align: left;
}
.np-calc-multi-table th.np-num, .np-calc-multi-table td.np-num { text-align: right; }
.np-calc-multi-table thead th {
    color: var(--np-muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid var(--np-border);
}
.np-calc-multi-table tbody tr:last-child td { border-bottom: none; }

/* Bank fee comparison grid */
.np-calc-fee-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px; margin-top: 10px;
}
.np-calc-fee-tile {
    padding: 10px 12px; border-radius: 10px;
    background: rgba(45,186,120,0.06); border: 1px solid rgba(45,186,120,0.18);
    font-variant-numeric: tabular-nums;
}
.np-calc-fee-tile strong { display: block; font-size: 15px; font-weight: 700; color: var(--np-pulse); margin-top: 2px; }
.np-calc-fee-tile-warn {
    background: rgba(224,87,62,0.05); border-color: rgba(224,87,62,0.18);
}
.np-calc-fee-tile-warn strong { color: #e0573e; }

/* Loan: interest method toggle (declining vs flat) */
.np-calc-method {
    margin-bottom: 12px; padding: 12px;
    background: var(--np-bg); border: 1px solid var(--np-border);
    border-radius: 10px;
}
.np-calc-method-label {
    display: block; font-size: 11px; font-weight: 700;
    color: var(--np-muted); text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 8px;
}
.np-calc-method-toggle {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.np-calc-method-opt {
    flex: 1 1 200px;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--np-border); border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.12s, background 0.12s;
}
.np-calc-method-opt:hover { border-color: var(--np-fg); }
.np-calc-method-opt input[type="radio"] { accent-color: var(--np-accent); }
.np-calc-method-opt input[type="radio"]:checked + span {
    color: var(--np-fg); font-weight: 600;
}
.np-calc-method-note {
    margin: 10px 0 0; padding: 8px 12px;
    font-size: 12.5px; color: var(--np-muted); line-height: 1.5;
    background: var(--np-card); border-left: 3px solid var(--np-accent);
    border-radius: 4px;
}
.np-calc-method-apr {
    display: inline-flex; align-items: baseline; gap: 8px;
    margin-top: 10px; padding: 8px 14px;
    background: rgba(224,87,62,0.08); border: 1px solid rgba(224,87,62,0.25);
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}
.np-calc-method-apr strong { font-size: 16px; color: #e0573e; font-weight: 700; }

/* ---------- Price alerts (np-alerts.js) ---------------------------------- */
:root.np-alerts-locked, :root.np-alerts-locked body { overflow: hidden; }
.np-alerts-modal {
    position: fixed; inset: 0; z-index: 1300;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.np-alerts-modal[hidden] { display: none !important; }
.np-alerts-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,15,15,0.55);
}
:root[data-theme="dark"] .np-alerts-modal-backdrop { background: rgba(0,0,0,0.7); }
.np-alerts-modal-card {
    position: relative;
    width: 100%; max-width: 420px;
    background: var(--np-card);
    border: 1px solid var(--np-border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.22);
    overflow: hidden;
    animation: np-alerts-pop .14s ease-out;
}
@keyframes np-alerts-pop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.np-alerts-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--np-border);
}
.np-alerts-modal-title { font-size: 15px; font-weight: 600; margin: 0; }
.np-alerts-modal-x {
    appearance: none; background: transparent; border: 0;
    width: 28px; height: 28px; border-radius: 6px;
    color: var(--np-muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.np-alerts-modal-x:hover { background: var(--np-overlay-mid); color: var(--np-fg); }
.np-alerts-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.np-alerts-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; font-size: 13px;
}
.np-alerts-label { color: var(--np-muted); font-weight: 600; }
.np-alerts-asset { font-weight: 600; color: var(--np-fg); }
.np-alerts-current { font-variant-numeric: tabular-nums; color: var(--np-fg); }
.np-alerts-input {
    appearance: none;
    background: var(--np-bg);
    border: 1px solid var(--np-border);
    color: var(--np-fg);
    padding: 8px 10px;
    border-radius: 8px;
    font: inherit; font-size: 14px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 140px;
}
.np-alerts-input:focus { outline: none; border-color: var(--np-accent); }
select.np-alerts-input.np-alerts-op {
    text-align: left;
    min-width: 200px;
    background-image: linear-gradient(45deg, transparent 50%, var(--np-muted) 50%),
                      linear-gradient(-45deg, transparent 50%, var(--np-muted) 50%);
    background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 26px;
}
.np-alerts-value-wrap {
    display: inline-flex; align-items: center; gap: 6px;
}
.np-alerts-value-suffix {
    font-size: 13px; color: var(--np-muted); min-width: 14px;
    font-variant-numeric: tabular-nums;
}
.np-alerts-err {
    color: #c0392b; font-size: 12px; padding-top: 2px;
}
:root[data-theme="dark"] .np-alerts-err { color: #ff7f6e; }
.np-alerts-modal-foot {
    display: flex; gap: 8px; justify-content: flex-end;
    padding: 12px 18px; border-top: 1px solid var(--np-border);
    background: var(--np-bg);
}
.np-alerts-btn-ghost, .np-alerts-btn-primary {
    appearance: none; border: 1px solid var(--np-border);
    background: transparent; color: var(--np-fg);
    padding: 8px 14px; border-radius: 8px;
    font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer;
}
.np-alerts-btn-primary {
    background: var(--np-accent);
    color: #181410; border-color: var(--np-accent);
}
.np-alerts-btn-primary:disabled { opacity: 0.6; cursor: wait; }
.np-alerts-btn-ghost:hover { background: var(--np-overlay-mid); }

/* "Embed this card" button — sits next to ★ + 🔔 in asset headlines.
 * Same shape as np-alert-btn so the row stays visually balanced. */
.np-embed-btn {
    appearance: none;
    background: transparent;
    border: 1px solid var(--np-border);
    color: var(--np-muted);
    width: 28px; height: 28px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: color .1s, border-color .1s, background .1s;
}
.np-embed-btn:hover, .np-embed-btn:focus-visible {
    color: var(--np-accent);
    border-color: var(--np-accent);
    background: var(--np-accent-soft);
    outline: none;
}
.np-embed-btn svg { width: 14px; height: 14px; display: block; }

/* Bell button used on watchlist + asset pages */
.np-alert-btn {
    appearance: none;
    background: transparent;
    border: 1px solid var(--np-border);
    color: var(--np-muted);
    width: 28px; height: 28px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: color .1s, border-color .1s, background .1s;
}
.np-alert-btn:hover, .np-alert-btn:focus-visible {
    color: var(--np-accent);
    border-color: var(--np-accent);
    background: var(--np-accent-soft);
    outline: none;
}
.np-alert-btn svg { width: 14px; height: 14px; }

/* Toast — bottom-center confirmation pill */
.np-alerts-toast {
    position: fixed;
    left: 50%; bottom: 24px;
    transform: translateX(-50%) translateY(8px);
    z-index: 1400;
    background: var(--np-fg);
    color: var(--np-bg);
    padding: 10px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    opacity: 0; pointer-events: none;
    transition: opacity .15s, transform .15s;
}
.np-alerts-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Active-alerts list (rendered inside /watchlist below the cards) */
.np-alerts-list {
    margin-top: 28px;
    border: 1px solid var(--np-border);
    border-radius: 12px;
    background: var(--np-card);
    padding: 14px 16px;
}
.np-alerts-list[hidden] { display: none; }
.np-alerts-list-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.np-alerts-list-title { font-size: 14px; font-weight: 600; margin: 0; }
.np-alerts-list-count {
    font-size: 12px; color: var(--np-muted);
    background: var(--np-bg); padding: 2px 8px; border-radius: 999px;
    border: 1px solid var(--np-border);
}
.np-alerts-list ul { list-style: none; margin: 0; padding: 0; }
.np-alerts-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-top: 1px solid var(--np-border);
    font-size: 13px;
}
.np-alerts-list li:first-child { border-top: 0; }
.np-alerts-list-asset { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-alerts-list-cond { color: var(--np-muted); font-variant-numeric: tabular-nums; }
.np-alerts-list-cond.is-trig { color: var(--np-accent); }
.np-alerts-list-del {
    appearance: none; background: transparent; border: 1px solid var(--np-border);
    color: var(--np-muted); padding: 4px 8px; border-radius: 6px;
    cursor: pointer; font: inherit; font-size: 12px;
}
.np-alerts-list-del:hover { color: #c0392b; border-color: #c0392b; }

/* "Market closed" card — sits between the headline and the body when
 * spot metals haven't ticked for >6h (weekend / pre-open). Single
 * component reused by /gold and /gold/spot. Markup is rendered by
 * np_market_closed_card() in src/helpers/functions.php. */
.np-market-closed {
    display: flex; align-items: center; gap: 14px;
    margin: 16px 0 20px;
    padding: 14px 16px;
    background: linear-gradient(135deg,
        rgba(201, 162, 39, 0.10) 0%,
        rgba(201, 162, 39, 0.04) 100%);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-left: 3px solid var(--np-accent);
    border-radius: 12px;
}
:root[data-theme="dark"] .np-market-closed {
    background: linear-gradient(135deg,
        rgba(224, 183, 56, 0.12) 0%,
        rgba(224, 183, 56, 0.04) 100%);
    border-color: rgba(224, 183, 56, 0.30);
}
.np-market-closed-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: rgba(201, 162, 39, 0.18);
    color: var(--np-accent);
}
:root[data-theme="dark"] .np-market-closed-icon {
    background: rgba(224, 183, 56, 0.15);
}
.np-market-closed-icon svg { width: 18px; height: 18px; display: block; }
.np-market-closed-body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
    line-height: 1.35;
}
.np-market-closed-title {
    font-size: 14px; font-weight: 700;
    color: var(--np-fg);
    letter-spacing: -0.01em;
}
.np-market-closed-meta {
    font-size: 13px; color: var(--np-muted);
    font-variant-numeric: tabular-nums;
}
.np-market-closed-label { color: var(--np-muted); }
.np-market-closed-time { color: var(--np-fg); font-weight: 600; }
.np-market-closed-reopens {
    font-size: 12px; color: var(--np-muted);
    margin-top: 2px;
    display: inline-flex; align-items: center; gap: 6px;
}
.np-market-closed-reopens::before {
    content: '↻'; font-size: 13px; color: var(--np-accent);
}
@media (max-width: 600px) {
    .np-market-closed {
        gap: 11px; padding: 12px 14px;
    }
    .np-market-closed-icon { width: 32px; height: 32px; }
    .np-market-closed-icon svg { width: 16px; height: 16px; }
    .np-market-closed-title { font-size: 13px; }
    .np-market-closed-meta { font-size: 12px; }
}

/* Wholesale-only / "no retail price" badge in gold dealer rows */
.np-gold-cell-note {
    display: inline-block;
    padding: 1px 8px;
    font-size: 11px; font-weight: 600;
    color: var(--np-muted);
    background: var(--np-bg);
    border: 1px dashed var(--np-border);
    border-radius: 6px;
}

/* Inline info icon (ⓘ) used next to G/S ratio + similar headers */
.np-gold-info-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    color: var(--np-muted);
    cursor: help;
    vertical-align: middle;
    user-select: none;
}
.np-gold-info-icon:hover { color: var(--np-fg); }
