/* ════════════════════════════════════════════════════════════════════════
 * scx-mobile-audit.css · v18.10.2
 * SUPERSEDES v18.10.1 — fixes 4 critical issues from harsh audit.
 * ════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

/* ─── FIX 1 — GLOBAL width overrides (NOT scoped to #ns-result) ───────── */
@media (max-width: 640px) {
  div[style*="min-width:220px"],
  div[style*="min-width: 220px"],
  div[style*="min-width:200px"],
  div[style*="min-width: 200px"],
  div[style*="min-width:240px"],
  div[style*="min-width: 240px"] {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  div[style*="justify-content:space-between"][style*="display:flex"],
  div[style*="justify-content: space-between"][style*="display: flex"],
  div[style*="display:flex"][style*="justify-content:space-between"],
  div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-wrap: wrap !important;
    gap: 0.9rem !important;
  }

  button[style*="flex-shrink:0"],
  button[style*="flex-shrink: 0"] {
    width: 100% !important;
    flex-shrink: 1 !important;
    margin-top: 0.5rem;
  }

  div[style*="margin:1.5rem 0"][style*="border:1.5px solid #FF4D1F"],
  div[style*="margin:1.5rem 0"][style*="border: 1.5px solid #FF4D1F"] {
    padding: 1.2rem 1rem !important;
  }
}

/* ─── Result panel full width on mobile ───────────────────────────────── */
@media (max-width: 880px) {
  .nx-input-zone .nx-n,
  .nx-input-zone .nx-n > * {
    max-width: 100%;
    width: 100%;
  }
  #ns-result {
    max-width: 100%;
    overflow-x: clip;
    padding: 0;
  }
  #ns-result > div[style*="border-radius:22px"],
  #ns-result > div[style*="border-radius: 22px"] {
    border-radius: 14px !important;
    margin: 0 0 1.5rem 0 !important;
  }
  #ns-result > div > div:first-child[style*="2.6rem"] {
    padding: 1.4rem 1rem 1.2rem !important;
  }
  #ns-result > div > div[style*="2.4rem"] {
    padding: 0 1rem 0.5rem !important;
  }
}

@media (max-width: 640px) {
  #ns-result * { max-width: 100% !important; }
  #ns-result .scx-acc-score,
  #ns-result .scx-acc-chev,
  #ns-result span[style*="width:5px"],
  #ns-result span[style*="width:6px"],
  #ns-result span[style*="width:7px"],
  #ns-result span[style*="width:8px"],
  #ns-result span[style*="width:9px"],
  #ns-result span[style*="width:10px"],
  #ns-result span[style*="width:12px"],
  #ns-result span[style*="width:16px"] {
    max-width: none !important;
  }
}

/* ─── FIX 2 — INTERVIEW PRO MODAL ─────────────────────────────────────── */
@media (max-width: 980px) {
  .scx-itv-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .scx-itv-gate {
    height: auto !important;
    min-height: 100% !important;
    padding: 1.8rem 1.4rem 2.4rem !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .scx-itv-gate h2 { font-size: 1.4rem !important; line-height: 1.2 !important; }
  .scx-itv-gate p,
  .scx-itv-gate .scx-itv-gate-list { font-size: 0.92rem !important; }
  .scx-itv-gate-btns {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.6rem !important;
  }
  .scx-itv-gate-btns button,
  .scx-itv-gate-btns a {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px;
  }
}

@media (max-width: 640px) {
  .scx-itv-shell {
    inset: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .scx-itv-transcript {
    max-height: 180px !important;
    min-height: 80px !important;
  }
  .scx-itv-qpane {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1rem 1.1rem 1.5rem !important;
  }
  .scx-itv-report {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1.4rem 1.2rem 3rem !important;
  }
}

/* ─── FIX 3 — MOBILE HEADER REDESIGN ──────────────────────────────────── */
@media (max-width: 820px) {
  .nav {
    padding: 0 16px !important;
    height: 64px !important;
  }
  .nav.sc { height: 56px !important; }
  .nav-logo-img {
    height: 40px !important;
    border-radius: 8px;
  }
  .nav.sc .nav-logo-img { height: 36px !important; }

  .nav-hbg {
    width: 44px !important;
    height: 44px !important;
    padding: 8px !important;
    background: var(--bone2) !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    gap: 2px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: background 0.2s, border-color 0.2s;
  }
  .nav-hbg:active {
    background: var(--tang-soft) !important;
    border-color: var(--tang) !important;
  }
  .nav-hbg .hbg-dot {
    width: 4px !important;
    height: 4px !important;
    background: var(--ink) !important;
  }
}

@media (max-width: 560px) {
  .nav {
    padding: 0 14px !important;
    height: 60px !important;
  }
  .nav-logo-img { height: 36px !important; }
  .nav-hbg { width: 40px !important; height: 40px !important; }
}

@media (max-width: 820px) {
  .mmenu {
    padding: 5rem 1.5rem 3rem !important;
    background: linear-gradient(180deg, var(--ink) 0%, var(--ink2) 100%) !important;
  }
  .mmenu .nl {
    font-size: 1.3rem !important;
    padding: 0.85rem 1.4rem !important;
    width: 100%;
    max-width: 320px;
    text-align: center;
    margin: 0 auto;
  }
  .mmenu .nav-cta {
    margin-top: 1.5rem !important;
    padding: 1rem 2.4rem !important;
    font-size: 1rem !important;
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  .mmenu-close {
    top: 1rem !important;
    right: 1rem !important;
    width: auto !important;
    height: 40px !important;
    padding: 0.5rem 1rem !important;
  }
}

/* ─── FIX 4 — HIDE PROGRESS BAR WHEN ZERO SECTIONS ────────────────────── */
.scx-mobile-progress[data-section-count="0"] { display: none !important; }

/* ─── Headers / typography ────────────────────────────────────────────── */
@media (max-width: 640px) {
  #ns-result h2[style*="clamp(2rem"] {
    font-size: clamp(1.35rem, 6vw, 1.85rem) !important;
    letter-spacing: -0.5px !important;
    line-height: 1.15 !important;
  }
  #ns-result h3,
  #ns-result .scx-acc-h3 {
    font-size: 1.1rem !important;
    letter-spacing: -0.2px !important;
    line-height: 1.3 !important;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  .nx-h1 { font-size: clamp(1.85rem, 8vw, 2.6rem) !important; line-height: 1.08 !important; }
  .nx-sec-h2 { font-size: clamp(1.35rem, 6vw, 2rem) !important; }
}

/* ─── Tables / SVG / code ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  #ns-result table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #ns-result svg { max-width: 100% !important; height: auto !important; }
  #ns-result pre, #ns-result code {
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-break: break-all;
  }
}

/* ─── Grid collapse ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #ns-result [style*="grid-template-columns:repeat(2"],
  #ns-result [style*="grid-template-columns: repeat(2"],
  #ns-result [style*="grid-template-columns:repeat(3"],
  #ns-result [style*="grid-template-columns: repeat(3"],
  #ns-result [style*="grid-template-columns:repeat(4"],
  #ns-result [style*="grid-template-columns: repeat(4"],
  #ns-result [style*="grid-template-columns:1fr 1fr"],
  #ns-result [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ─── Cert card numbers ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  #ns-result [style*="position:absolute"][style*="top:"][style*="right:"],
  #ns-result [style*="position: absolute"][style*="top:"][style*="right:"] {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    display: inline-block;
    margin-left: 0.4rem;
    vertical-align: middle;
  }
}

/* ─── iOS input zoom ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .finp, .fsel, input, select, textarea { font-size: 16px !important; }
  .nx-input-card { padding: 1rem !important; border-radius: 12px !important; }
  .dropzone { padding: 1.2rem 0.8rem !important; }
}

/* ─── Touch targets ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #ns-result button, .scx-acc-head {
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(255, 77, 31, 0.15);
  }
}

/* ─── Prevent body scroll ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  #ns-result  { overflow-x: clip; }
}

/* ═══════════════════════════════════════════════════════════════════════
 * ACCORDION STYLES
 * ═══════════════════════════════════════════════════════════════════════ */
.scx-acc { position: relative; }

.scx-acc-head {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 0.75rem 0;
  border-radius: 8px;
  min-height: 52px;
  border-top: 2px solid transparent;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 0.5rem;
}
.scx-acc-head:hover { background: rgba(255, 77, 31, 0.04); }
.scx-acc-head:focus-visible { outline: 2px solid #FF4D1F; outline-offset: 2px; }

.scx-acc-title { flex: 1; min-width: 0; }

.scx-acc-prefix {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: #FF4D1F;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.scx-acc-h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0B0D10;
  letter-spacing: -0.2px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  word-break: normal;
  overflow-wrap: anywhere;
}

.scx-acc-score {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #f0f0f0;
  color: #555;
  flex-shrink: 0;
}
.scx-acc-score.scx-score-high { background: #dcfce7; color: #166534; }
.scx-acc-score.scx-score-mid  { background: #fef3c7; color: #854d0e; }
.scx-acc-score.scx-score-low  { background: #fee2e2; color: #991b1b; }

.scx-acc-chev {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #fff;
  background: #FF4D1F;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.15s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(255,77,31,0.3);
}
.scx-acc-head:hover .scx-acc-chev { background: #E83E10; transform: scale(1.05); }
.scx-acc-locked .scx-acc-chev { background: #B8893A; font-size: 0.85rem; }

/* STICKY MOBILE PROGRESS BAR */
.scx-mobile-progress { display: none; }
@media (max-width: 768px) {
  .scx-mobile-progress {
    display: block;
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.07);
    padding: 9px 14px 8px;
    margin: 0 0 10px;
  }
}
.scx-mobile-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.scx-mobile-progress-tier {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tier-free       { background: #f0f0f0; color: #555; }
.tier-boost      { background: #1e40af; color: #fff; }
.tier-pro        { background: #FF4D1F; color: #fff; }
.tier-recruiter  { background: #7c3aed; color: #fff; }
.tier-enterprise { background: #047857; color: #fff; }
.scx-mobile-progress-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #666;
}
.scx-mobile-progress-bar {
  margin-top: 7px;
  height: 3px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}
.scx-mobile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF4D1F, #FF7050);
  width: 0%;
  transition: width 0.35s ease;
  border-radius: 2px;
}

.scx-acc-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 1rem;
  padding: 0.55rem 0.9rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #666;
  flex-wrap: wrap;
}
.scx-acc-controls button {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: #1a1a1a;
  min-height: 32px;
}
.scx-acc-controls button:hover {
  border-color: #FF4D1F;
  color: #FF4D1F;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
