/* Homepage: "Every way to enter 760-756-7568" - the number-formats poster as a
   live section. Landscape (intro left, formats + File Scrub right) on wide
   screens; reflows to the portrait poster's order on phones. */
.nf-section { position: relative; overflow: hidden; }
.nf-section .section-inner { max-width: 1340px; }
.nf {
  --nf-navy: #0b1f36; --nf-ink: var(--ink-900); --nf-muted: var(--ink-500); --nf-line: var(--border-soft);
  --nf-chip: #f7f9fc; --nf-chip-ink: #071a30; --nf-green: #16a34a; --nf-code: #eef3fa;
  --nf-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 34px; align-items: stretch;
}
[data-theme="dark"] .nf { --nf-navy: #e6edf6; --nf-chip: #1d2733; --nf-chip-ink: #eef4fb; --nf-code: #2a3441; }

/* ---------- intro column ---------- */
.nf-intro { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.nf-brands { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.nf-brands { gap: 7px; }
.nf-brand { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 7px; border-radius: 11px; white-space: nowrap;
  background: var(--bg); border: 1px solid var(--nf-line); font-size: 0.8rem; font-weight: 700; color: var(--nf-ink); }
.nf-brand img { width: 22px; height: 22px; flex: none; }
.nf-amp { font-weight: 700; color: var(--ink-400); }
.nf-intro .section-eyebrow { margin: 0; }
.nf-title { margin: 0; font-size: 2.45rem; line-height: 1.06; font-weight: 800; letter-spacing: -0.035em; color: var(--nf-ink); text-wrap: balance; }
.nf-title span { display: block; color: var(--accent); }
.nf-lede { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--nf-muted); }
.nf-lede b { color: var(--nf-ink); font-weight: 700; }

.nf-field { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; height: 58px; border-radius: 14px;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.nf-field > svg, .nf-field > i { width: 20px; height: 20px; color: var(--ink-400); flex: none; }
.nf-field-val { flex: 1; min-width: 0; font-family: var(--nf-mono); font-size: 1.3rem; font-weight: 700; color: var(--nf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-ok { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--nf-green); color: #fff; flex: none; box-shadow: 0 4px 12px rgba(22,163,74,.35); }
.nf-ok svg { width: 17px; height: 17px; }
.nf-search { display: grid; gap: 10px; }
.nf-field-note { margin: 0 2px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--nf-green); }
.nf-field-note code { font-family: var(--nf-mono); font-size: 0.8rem; font-weight: 700; color: var(--nf-ink); background: var(--nf-code); padding: 2px 8px; border-radius: 6px; }

.nf-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.nf-rules li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9rem; font-weight: 600; line-height: 1.4; color: var(--nf-ink); }
.nf-tick { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; color: var(--nf-green);
  background: rgba(22,163,74,.10); border: 1px solid rgba(22,163,74,.25); }
.nf-tick svg { width: 13px; height: 13px; }
.nf-rules code { font-family: var(--nf-mono); font-size: 0.8rem; font-weight: 700; background: var(--nf-code); padding: 1px 6px; border-radius: 5px; color: var(--nf-ink); }

/* "Won't be accepted" - fills the intro column down to the File Scrub band */
.nf-reject { margin-top: auto; display: grid; gap: 12px; padding: 16px; border-radius: 16px;
  background: color-mix(in srgb, #ef4444 4%, var(--surface)); border: 1px solid color-mix(in srgb, #ef4444 22%, var(--nf-line)); }
.nf-reject-head { display: flex; align-items: center; gap: 11px; }
.nf-reject-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  color: #dc2626; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25); }
.nf-reject-ico svg { width: 18px; height: 18px; }
.nf-reject h3 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--nf-ink); }
.nf-reject-head p { margin: 1px 0 0; font-size: 0.78rem; font-weight: 500; color: var(--nf-muted); }
.nf-reject-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.nf-reject-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px; border-radius: 9px; background: var(--surface); border: 1px dashed color-mix(in srgb, #ef4444 28%, var(--nf-line)); }
.nf-reject-list code { font-family: var(--nf-mono); font-size: 0.88rem; font-weight: 700; color: #b91c1c;
  text-decoration: line-through; text-decoration-color: rgba(185,28,28,.45); text-decoration-thickness: 1.5px; }
.nf-reject-list span { font-size: 0.76rem; font-weight: 600; color: var(--nf-muted); }
[data-theme="dark"] .nf-reject-list code { color: #fca5a5; text-decoration-color: rgba(252,165,165,.5); }
[data-theme="dark"] .nf-reject-ico { color: #fca5a5; }
.nf-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.nf-cta svg { width: 16px; height: 16px; }

/* ---------- format cards ---------- */
.nf-main { display: grid; gap: 20px; min-width: 0; }
.nf-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.nf-card { display: flex; flex-direction: column; min-width: 0; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--nf-line); box-shadow: var(--shadow-card); overflow: hidden; border-top: 4px solid var(--c); }
.nf-card-head { position: relative; padding: 14px 14px 12px; border-bottom: 1px solid var(--nf-line); }
.nf-badge { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px;
  font-family: var(--nf-mono); font-size: 0.9rem; font-weight: 700; color: var(--c); background: var(--cs); border: 1px solid var(--cb); }
.nf-count { position: absolute; right: 14px; top: 18px; font-size: 0.7rem; font-weight: 800; color: var(--c); background: var(--cs);
  border: 1px solid var(--cb); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.nf-card h3 { margin: 10px 0 0; font-size: 1.08rem; font-weight: 800; color: var(--nf-ink); letter-spacing: -0.01em; }
.nf-card-sub { margin: 2px 0 0; font-size: 0.8rem; color: var(--nf-muted); }
.nf-shows { margin: 7px 0 0; font-size: 0.74rem; font-weight: 600; color: var(--nf-muted); }
.nf-shows code { margin-left: 3px; font-family: var(--nf-mono); font-size: 0.74rem; font-weight: 700; color: var(--nf-ink); background: var(--cs); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.nf-list { list-style: none; margin: 0; padding: 11px 10px 12px; display: grid; gap: 6px; align-content: start; }
.nf-list li { display: flex; align-items: center; height: 34px; padding: 0 9px; border-radius: 9px;
  font-family: var(--nf-mono); font-size: 0.93rem; font-weight: 700; letter-spacing: -0.03em; color: var(--nf-chip-ink); white-space: nowrap;
  background: color-mix(in srgb, var(--c) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 22%, var(--nf-line)); }
.nf-list li::before { content: ""; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--c); flex: none; }
.nf-list .x { color: var(--ink-400); font-weight: 600; }
.nf-g4 .nf-list li { font-size: 0.84rem; letter-spacing: -0.04em; }
.nf-tip { margin: 2px 10px 12px; padding: 10px 11px; border-radius: 10px; background: var(--cs); border: 1px dashed var(--cb);
  font-size: 0.8rem; line-height: 1.4; font-weight: 600; color: var(--nf-ink); }
.nf-tip b { display: block; margin-bottom: 2px; font-size: 0.68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--c); }
.nf-g1 { --c: #1877f2; --cs: rgba(24,119,242,.09); --cb: rgba(24,119,242,.24); }
.nf-g2 { --c: #4f46e5; --cs: rgba(79,70,229,.09); --cb: rgba(79,70,229,.24); }
.nf-g3 { --c: #0d9488; --cs: rgba(13,148,136,.09); --cb: rgba(13,148,136,.26); }
.nf-g4 { --c: #c2410c; --cs: rgba(234,88,12,.09); --cb: rgba(234,88,12,.26); }
[data-theme="dark"] .nf-g1 { --c: #4c9bff; } [data-theme="dark"] .nf-g2 { --c: #8b85ff; }
[data-theme="dark"] .nf-g3 { --c: #2dd4bf; } [data-theme="dark"] .nf-g4 { --c: #fb923c; }

/* ---------- File Scrub band (dark in both themes) ---------- */
.nf-fs { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.25fr);
  grid-template-areas: "title txt csv" "specs specs specs"; gap: 14px 16px; padding: 18px 20px 18px; border-radius: 18px;
  background: linear-gradient(135deg, #0b1f36 0%, #12325a 100%); color: #d5e2f2; box-shadow: 0 14px 36px rgba(11,31,54,.22); }
.nf-fs::after { content: ""; position: absolute; right: -90px; top: -130px; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(24,119,242,.35), transparent 65%); pointer-events: none; }
.nf-fs-title { grid-area: title; display: flex; flex-direction: column; justify-content: center; gap: 6px; position: relative; z-index: 1; }
.nf-fs-k { display: inline-flex; align-items: center; gap: 8px; font-size: 0.7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8cc0ff; }
.nf-fs-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #1877f2; color: #fff; box-shadow: 0 6px 16px rgba(24,119,242,.45); }
.nf-fs-ico svg { width: 15px; height: 15px; }
.nf-fs h3 { margin: 4px 0 0; font-size: 1.35rem; line-height: 1.2; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.nf-fs h3 code { font-family: var(--nf-mono); font-size: 1.22rem; color: #6fb1ff; }
.nf-fs-title p { margin: 0; font-size: 0.82rem; font-weight: 600; color: #a9bdd6; }
.nf-colA { color: #8cc0ff; font-weight: 800; }
.nf-file { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; border-radius: 12px; background: #fff; color: #0b1f36;
  overflow: hidden; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.nf-txt { grid-area: txt; } .nf-csv { grid-area: csv; }
.nf-file-top { display: flex; align-items: center; gap: 7px; padding: 8px 11px; background: #f5f8fc; border-bottom: 1px solid #e3e9f1;
  font-family: var(--nf-mono); font-size: 0.76rem; font-weight: 700; color: #1d2b3e; }
.nf-ext { font-family: Inter, sans-serif; font-size: 0.62rem; font-weight: 800; letter-spacing: .06em; color: #fff; padding: 2px 6px; border-radius: 5px; }
.nf-txt .nf-ext { background: #4f46e5; } .nf-csv .nf-ext { background: #16a34a; }
.nf-file pre { flex: 1; margin: 0; padding: 8px 11px; font-family: var(--nf-mono); font-size: 0.86rem; line-height: 1.6; font-weight: 700; color: #071a30; white-space: pre; overflow-x: auto; }
.nf-file pre span { color: #b0bccb; margin-right: 9px; font-weight: 600; }
.nf-sheet-wrap { flex: 1; overflow-x: auto; }
.nf-sheet { width: 100%; border-collapse: collapse; font-family: var(--nf-mono); font-size: 0.8rem; font-weight: 700; color: #1d2b3e; }
.nf-sheet th, .nf-sheet td { padding: 4px 8px; text-align: left; white-space: nowrap; border-bottom: 1px solid #eef2f7; border-right: 1px solid #eef2f7; }
.nf-sheet thead th { font-family: Inter, sans-serif; font-size: 0.64rem; font-weight: 800; text-align: center; color: #8a99ad; background: #f5f8fc; }
.nf-sheet thead th.nf-a { color: #fff; background: #1877f2; }
.nf-sheet .rn { width: 20px; text-align: center; font-family: Inter, sans-serif; font-size: 0.64rem; color: #a3b0c2; background: #f5f8fc; font-weight: 700; }
.nf-sheet td.nf-a { background: rgba(24,119,242,.09); color: #0b4fb3; }
.nf-sheet td.hd { font-family: Inter, sans-serif; font-size: 0.68rem; font-weight: 800; color: #6b7a90; }
.nf-sheet td.nf-a.hd { color: #1877f2; }
.nf-file-cap { padding: 6px 11px 8px; font-size: 0.72rem; font-weight: 700; color: #5b6b80; border-top: 1px dashed #e3e9f1; }
.nf-file-cap b { color: #1877f2; }
.nf-specs { grid-area: specs; list-style: none; margin: 0; padding: 0; position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 22px; }
.nf-specs li { display: flex; align-items: flex-start; gap: 9px; font-size: 0.84rem; line-height: 1.38; font-weight: 600; color: #d5e2f2; }
.nf-specs li b { color: #fff; }
.nf-specs .nf-hl { grid-column: 1 / -1; padding: 8px 10px; border-radius: 10px; background: rgba(24,119,242,.22); border: 1px solid rgba(111,177,255,.35); color: #eaf3ff; }
.nf-specs .nf-hl b { color: #9ccbff; }
.nf-si { width: 19px; height: 19px; border-radius: 6px; display: grid; place-items: center; flex: none; background: rgba(34,197,94,.18); color: #4ade80; }
.nf-si svg { width: 11px; height: 11px; }
.nf-warn .nf-si { background: rgba(251,146,60,.18); color: #fdba74; }
.nf-specs code { font-family: var(--nf-mono); font-size: 0.78rem; color: #fdba74; }

/* ---------- narrower desktops / tablets: intro across the top ---------- */
@media (max-width: 1279px) {
  .nf { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .nf-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 36px; align-items: start; }
  .nf-brands, .nf-intro .section-eyebrow, .nf-title, .nf-lede { grid-column: 1; }
  .nf-search { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .nf-rules { grid-column: 1; }
  .nf-reject { grid-column: 1 / -1; margin-top: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; }
  .nf-reject-list { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nf-cta { grid-column: 2; grid-row: 1; }
}
@media (max-width: 1023px) {
  .nf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nf-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nf-fs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "title title" "txt csv" "specs specs"; }
}

/* ---------- phones: the portrait poster's order ---------- */
@media (max-width: 760px) {
  .nf-intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .nf-brands { justify-content: center; }
  .nf-title { font-size: 2.1rem; }
  .nf-search { align-self: stretch; text-align: left; }
  .nf-rules { align-self: stretch; text-align: left; }
  .nf-reject { align-self: stretch; text-align: left; grid-template-columns: minmax(0, 1fr); }
  .nf-reject-list { grid-template-columns: minmax(0, 1fr); }
  .nf-cta { grid-column: 1; grid-row: auto; }
  .nf-field-val { font-size: 1.12rem; }
  .nf-cards { grid-template-columns: minmax(0, 1fr); }
  .nf-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nf-g4 .nf-list { grid-template-columns: minmax(0, 1fr); }
  .nf-fs { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "txt" "csv" "specs"; padding: 16px; }
  .nf-specs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .nf-list li { font-size: 0.8rem; padding: 0 7px; letter-spacing: -0.04em; }
  .nf-list li::before { width: 5px; height: 5px; margin-right: 6px; }
  .nf-g4 .nf-list li { font-size: 0.86rem; }
  .nf-title { font-size: 1.85rem; }
}

/* Area codes & exchange codes that won't be accepted - a full-width row under
   the poster on desktop; right after the "Won't be accepted" card elsewhere. */
.nf-codes { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "head area exch" "anat area exch"; gap: 14px 22px; padding: 18px 20px; border-radius: 18px;
  background: color-mix(in srgb, #ef4444 4%, var(--surface)); border: 1px solid color-mix(in srgb, #ef4444 22%, var(--nf-line)); }
.nf-codes-head { grid-area: head; display: flex; align-items: flex-start; gap: 11px; }
.nf-codes-head h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; font-weight: 800; color: var(--nf-ink); text-wrap: balance; }
.nf-codes-head p { margin: 4px 0 0; font-size: 0.8rem; line-height: 1.45; color: var(--nf-muted); }
.nf-anatomy { grid-area: anat; align-self: end; display: flex; align-items: flex-start; gap: 6px; }
.nf-anatomy span { display: grid; justify-items: center; gap: 5px; }
.nf-anatomy code { display: block; padding: 6px 10px; border-radius: 9px; font-family: var(--nf-mono); font-size: 1.25rem; font-weight: 700;
  color: #b91c1c; background: var(--surface); border: 1.5px dashed color-mix(in srgb, #ef4444 45%, var(--nf-line)); }
.nf-anatomy .nf-line code { color: var(--nf-ink); border-style: solid; border-color: var(--nf-line); }
.nf-anatomy small { font-size: 0.68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--nf-muted); }
.nf-anatomy > i { padding-top: 8px; font-style: normal; font-weight: 800; color: var(--ink-400); }
.nf-codes-col { display: grid; gap: 9px; align-content: start; min-width: 0; }
.nf-codes-col:nth-of-type(3) { grid-area: area; } .nf-codes-col:nth-of-type(4) { grid-area: exch; }
.nf-codes-col h4 { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 0.86rem; font-weight: 800; color: var(--nf-ink); }
.nf-codes-col h4 svg { width: 16px; height: 16px; color: #dc2626; }
.nf-codes-col h4 em { font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--nf-muted); background: var(--nf-code); padding: 2px 7px; border-radius: 999px; }
.nf-code-list code { text-decoration: none; color: var(--nf-muted); }
.nf-code-list code b { color: #b91c1c; font-weight: 800; text-decoration: underline wavy rgba(220,38,38,.55); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
[data-theme="dark"] .nf-code-list code b, [data-theme="dark"] .nf-anatomy code { color: #fca5a5; }
[data-theme="dark"] .nf-anatomy .nf-line code { color: var(--nf-ink); }
[data-theme="dark"] .nf-codes-col h4 svg { color: #fca5a5; }
@media (min-width: 1280px) {
  .nf-intro { grid-column: 1; grid-row: 1; }
  .nf-main { grid-column: 2; grid-row: 1; }
  .nf-codes { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 1279px) {
  .nf-codes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head anat" "area exch"; }
  .nf-anatomy { justify-self: end; align-self: center; }
}
@media (max-width: 760px) {
  .nf-codes { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "anat" "area" "exch"; padding: 16px; }
  .nf-anatomy { justify-self: center; }
  .nf-anatomy code { font-size: 1.1rem; padding: 5px 8px; }
}
.nf-codes .nf-code-list { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
[data-theme="dark"] .nf-codes .nf-code-list code { color: var(--nf-muted); }

/* ---------- phones: tabs instead of long stacked lists ----------
   The four format groups, the two invalid-code lists and the two sample files
   each become a small tab bar showing one panel at a time (desktop unchanged;
   the bars are built by the script under the section and hidden above 760px). */
.nf-tabs { display: none; }
@media (max-width: 760px) {
  .nf-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px;
    border-radius: 14px; background: var(--nf-code, #eef2f7); border: 1px solid var(--nf-line); }
  .nf-tab { appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit; min-width: 0;
    display: grid; justify-items: center; gap: 1px; padding: 7px 4px; border-radius: 10px; color: var(--nf-muted);
    transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
  .nf-tab b { font-size: 0.8rem; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nf-tab small { font-size: 0.66rem; font-weight: 700; opacity: .85; white-space: nowrap; }
  .nf-tab.is-active { background: var(--surface); color: var(--nf-ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
  .nf-tab:focus-visible { outline: 2px solid var(--accent, #1877f2); outline-offset: 1px; }
  .nf-pane:not(.is-active) { display: none !important; }

  /* format groups: the tab names the group, so the card keeps just its "Shows as" line */
  .nf-cards { gap: 10px; }
  .nf-cards .nf-card-head .nf-badge, .nf-cards .nf-card-head .nf-count, .nf-cards .nf-card-head h3 { display: none; }
  .nf-cards .nf-card-head { padding-bottom: 10px; }
  /* invalid codes: tab bar between the number anatomy and the list */
  .nf-codes { grid-template-areas: "head" "anat" "tabs" "area" "exch"; gap: 12px; }
  .nf-codes > .nf-tabs { grid-area: tabs; }
  .nf-codes .nf-codes-col h4 { display: none; }
  /* sample files */
  .nf-fs { grid-template-areas: "title" "tabs" "txt" "csv" "specs"; gap: 12px; }
  .nf-fs > .nf-tabs { grid-area: tabs; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }
  .nf-fs > .nf-tabs .nf-tab { color: rgba(255,255,255,.75); }
  .nf-fs > .nf-tabs .nf-tab.is-active { background: rgba(255,255,255,.95); color: #0f172a; }
  /* tighter intro */
  .nf-intro { gap: 12px; }
}
[data-theme="dark"] .nf-tab.is-active { background: var(--surface); color: var(--nf-ink); box-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* ---------- all screens: the four format groups as tabs ----------
   One group at a time, its formats in a wide grid (3 rows instead of 11). */
.nf-cards > .nf-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px;
  border-radius: 14px; background: var(--nf-code, #eef2f7); border: 1px solid var(--nf-line); }
.nf-cards .nf-tab { appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit; min-width: 0;
  display: grid; justify-items: center; gap: 1px; padding: 9px 6px; border-radius: 10px; color: var(--nf-muted);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.nf-cards .nf-tab b { font-size: 0.92rem; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nf-cards .nf-tab small { font-size: 0.72rem; font-weight: 700; opacity: .85; white-space: nowrap; }
.nf-cards .nf-tab:hover { color: var(--nf-ink); }
.nf-cards .nf-tab.is-active { background: var(--surface); color: var(--nf-ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.nf-cards .nf-tab:focus-visible { outline: 2px solid var(--accent, #1877f2); outline-offset: 1px; }
.nf-cards .nf-pane:not(.is-active) { display: none !important; }
@media (min-width: 761px) {
  .nf-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .nf-cards .nf-card-head .nf-badge, .nf-cards .nf-card-head .nf-count, .nf-cards .nf-card-head h3 { display: none; }
  .nf-cards .nf-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; }
  .nf-cards .nf-card-head p { margin: 0; }
  .nf-cards .nf-list { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); padding: 12px 14px 14px; gap: 8px; }
  .nf-cards .nf-g4 .nf-list { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}
[data-theme="dark"] .nf-cards .nf-tab.is-active { box-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* ---------- desktop: two balanced rows ----------
   Row 1: intro | formats + File Scrub.  Row 2: Won't be accepted | invalid codes. */
@media (min-width: 1280px) {
  .nf-reject { grid-column: 1; grid-row: 2; margin-top: 0; }
  .nf-codes { grid-column: 2; grid-row: 2; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "head anat" "area exch"; }
  .nf-anatomy { justify-self: end; align-self: center; }
}
