/* ================================================================
   nux skin — APM palette for nux8 (dark default, light under
   [data-theme="light"]). Load AFTER nux.min.css and app.css.

   Seeds are bare "r, g, b" triplets (nux wraps them in rgb()/rgba());
   a hex there silently invalidates ~140 declarations. The surface
   ladder and field faces are pinned to the site's own tokens so nux
   panels sit on exactly the colours the website uses, and the
   component rules at the bottom make dialogs, toasts, tabs and the
   segmented switch read like the site's cards, buttons and nav.
   Removable: drop the <link> and nux falls back to its stock theme.
   ================================================================ */

:root {
  /* seeds: --green accent on the --bg ground with --text ink */
  --nux-accent-color:     61, 214, 140;
  --nux-background-color: 8, 14, 26;
  --nux-text-color:       205, 217, 235;
  --nux-shadow-color:     0, 0, 0;

  --nux-surface-mult:  1.6;
  --nux-border-mult:   1.6;
  --nux-accent-mult:   1;
  --nux-contrast-mult: 1;
  --nux-shadows-opacity: 0.45;
  --nux-shadow-mult:     0.6;
  --nux-color-scheme: dark;

  /* geometry + type: the site's radius and system font stack */
  --nux-font:   var(--font-sans);
  --nux-radius: var(--radius);
  --nux-gap:    0.65rem;

  /* surfaces pinned to site tokens */
  --nux-block-bg-1: #0f1d2e;
  --nux-block-bg-2: #13243a;
  --nux-block-bg-3: #172b44;
  --nux-block-bg-4: #1b324f;
  --nux-field-bg:        #0a1424;
  --nux-field-bg-hover:  #0d1a2d;
  --nux-field-bg-active: #0c1e27;
  --nux-field-line:       #2c4562;
  --nux-field-line-hover: #4a6a8c;
  --nux-caption-color:        #6e90b0;
  --nux-caption-active-color: #3dd68c;

  /* tones: green / blue / amber / red from the site */
  --nux-success-color:      61, 214, 140;
  --nux-info-color:         94, 174, 255;
  --nux-warning-color:      245, 166, 35;
  --nux-danger-color:       240, 96, 96;
  --nux-success-deep-color: 61, 214, 140;
  --nux-info-deep-color:    94, 174, 255;
  --nux-warning-deep-color: 245, 166, 35;
  --nux-danger-deep-color:  240, 96, 96;

  --nux-tooltip-bg:    #1a2d42;
  --nux-tooltip-color: #cdd9eb;
}

:root[data-theme="light"] {
  --nux-accent-color:     18, 163, 93;
  --nux-background-color: 244, 247, 251;
  --nux-text-color:       26, 37, 56;
  --nux-surface-mult:  1.7;
  --nux-border-mult:   1.35;
  --nux-accent-mult:   1.1;
  --nux-contrast-mult: 1.3;
  --nux-shadows-opacity: 0.14;
  --nux-shadow-mult:     0.8;
  --nux-color-scheme: light;

  --nux-block-bg-1: #ffffff;
  --nux-block-bg-2: #f6f9fc;
  --nux-block-bg-3: #eef3f9;
  --nux-block-bg-4: #e7edf5;
  --nux-field-bg:        #edf1f8;
  --nux-field-bg-hover:  #e6ecf5;
  --nux-field-bg-active: #e8f6ef;
  --nux-field-line:       #b4c4d8;
  --nux-field-line-hover: #8ba3bb;
  --nux-caption-color:        #45607e;
  --nux-caption-active-color: #0d7d47;

  --nux-success-color:      18, 163, 93;
  --nux-info-color:         26, 111, 212;
  --nux-warning-color:      192, 120, 0;
  --nux-danger-color:       201, 48, 48;
  --nux-success-deep-color: 18, 163, 93;
  --nux-info-deep-color:    26, 111, 212;
  --nux-warning-deep-color: 192, 120, 0;
  --nux-danger-deep-color:  201, 48, 48;

  --nux-tooltip-bg:    #1a2538;
  --nux-tooltip-color: #f4f7fb;
}

/* ── fields: a quiet inset face with the site's hairline ─────────── */

nux-elm {
  border-radius: var(--radius) var(--radius) 0 0;
}

nux-elm > input,
nux-elm > textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
}

nux-elm[caption]:before {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

/* ── dialogs: a site card that floats ────────────────────────────── */

nux-modals {
  background-color: color-mix(in srgb, var(--bg) 70%, transparent);
}

nux-modals > nux-modal {
  gap: 0;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-pop);
  filter: none;
}

nux-modcaption {
  min-height: 0;
  padding: 18px 56px 0 22px;
  border-bottom: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

nux-modals > nux-modal.dlg-danger nux-modcaption { color: var(--red); }

nux-modbody {
  padding: 14px 22px 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

nux-modbody > p { color: var(--text-dim); }

nux-modal > nux-buttons {
  margin-top: 0;
  padding: 12px 22px;
  gap: 10px;
  border-top: 1px solid var(--border-soft);
  background-color: color-mix(in srgb, var(--bg-raised) 70%, var(--bg-card));
}

/* nux sets font-family on every nux-modals descendant; give code its mono back */
nux-modals pre,
nux-modals pre *,
nux-modals code,
nux-modals .mono,
nux-modals .tag,
nux-modals .token-box,
nux-modals .copy-btn,
nux-modals .code-label {
  font-family: var(--font-mono);
}

nux-modals pre { font-size: 0.8rem; line-height: 1.7; }

/* nux resets the size of every descendant of some containers; code inherits its <pre> */
nux-modals pre *,
nux-tabs pre * {
  font-size: inherit;
  line-height: inherit;
}

nux-modclose {
  top: 14px;
  right: 14px;
  border-radius: var(--radius);
}

/* ── buttons: the site's .btn family ─────────────────────────────── */

nux-button {
  min-width: 0;
  height: auto;
  padding: 8px 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background-color: var(--bg-card);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
}

nux-button:hover {
  border-color: var(--border);
  background-color: var(--bg-raised);
  color: var(--text);
}

nux-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

nux-button[nux-color-success],
nux-button[nux-color-success]:hover {
  border-color: transparent;
  background-color: var(--green);
  color: #08200f;
}

[data-theme="light"] nux-button[nux-color-success] { color: #052a10; }

nux-button[nux-color-success]:hover { opacity: 0.88; }

nux-button[nux-color-danger],
nux-button[nux-color-danger]:hover {
  border-color: transparent;
  background-color: var(--red);
  color: #2a0505;
}

[data-theme="light"] nux-button[nux-color-danger] { color: #ffffff; }

nux-button[nux-color-danger]:hover { opacity: 0.88; }

nux-button[nux-color-warning],
nux-button[nux-color-warning]:hover {
  border-color: transparent;
  background-color: var(--amber);
  color: #2a1800;
}

[data-theme="light"] nux-button[nux-color-warning] { color: #ffffff; }

/* ── toasts: a card with the tone on its left edge ───────────────── */

nux-toast {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  background-image: none;
  box-shadow:
    inset 3px 0 0 rgb(var(--nux-toast-tone)),
    var(--shadow-pop);
}

nux-toastcaption { color: var(--text); font-size: 0.86rem; }
nux-toastbody { color: var(--text-dim); font-size: 0.84rem; line-height: 1.45; }

/* ── segmented switch (range selector) ───────────────────────────── */

nux-switches.range-switch nux-switch {
  height: 32px;
  min-width: 46px;
  padding: 0 12px;
  align-items: center;
  border-color: var(--border-soft);
  background-color: var(--bg-card);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

nux-switches.range-switch nux-switch:before { display: none; }

nux-switches.range-switch nux-switch:hover {
  background-color: var(--bg-raised);
  color: var(--text);
  border-bottom-color: var(--border-soft);
}

nux-switches.range-switch nux-switch[nux-selected] {
  background-color: var(--green-faint);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--green);
}

nux-switches.range-switch nux-switch:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

/* ── tabs: the site nav's words-on-a-hairline ────────────────────── */

nux-tabs {
  background-color: transparent;
  border: 0;
}

nux-tablist {
  min-height: 0;
  gap: 4px;
  padding: 0;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  background-color: transparent;
}

nux-tab {
  height: 36px;
  min-width: 0;
  padding: 0 12px;
  /* nux sets line-height 1 + overflow hidden, which clips descenders (the g in Config / Logs) */
  line-height: 1.4;
  overflow: visible;
  border: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background-color: transparent;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
}

nux-tab:before {
  left: 10px;
  right: 10px;
  background-color: var(--green);
}

nux-tab:hover:not([disabled], [nux-selected]) {
  border: 0;
  background-color: var(--bg-raised);
  color: var(--text);
}

nux-tab[nux-selected] {
  border: 0;
  background-color: transparent;
  box-shadow: none;
  color: var(--text);
  font-weight: 600;
}

nux-tab:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

nux-tabpanel {
  background-color: transparent;
  padding: 12px 0 0;
}

/* snippet tabs hold short content: drop nux's 12rem / 8.5rem floors */
nux-tabs.snippet-tabs,
nux-tabs.snippet-tabs nux-tabpanel {
  min-height: 0;
}

nux-tabs.snippet-tabs nux-tabpanel > div > p { margin-bottom: 8px; }

/* ── tooltips ────────────────────────────────────────────────────── */

nux-tooltip {
  border: 1px solid var(--border-soft);
  font-family: var(--font-sans);
}
