/* ═══════════════════════════════════════════════════════════════════
   Interactive components for the content pages built from the July 2026
   GSC gap analysis. Mobile-first, matching the site's min-width
   breakpoints (480/768/1024) and design tokens from styles.css.

   Paired with /assets/interactive.js. Every component degrades to
   readable static content with JS disabled — the copy is never hidden
   behind a script.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Shared shell ────────────────────────────────────────────────── */
.ix {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 18px;
    margin: 28px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .04);
}
.ix-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--primary);
    font-weight: 700;
    margin: 0 0 4px;
}
.ix-title {
    font-family: var(--font-heading);
    font-size: 1.08rem;
    color: var(--text-dark);
    margin: 0 0 4px;
    line-height: 1.35;
}
.ix-help {
    font-size: .86rem;
    color: var(--text-light);
    margin: 0 0 16px;
    line-height: 1.6;
}
.ix-field { margin-bottom: 14px; }
.ix-field > label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.ix select,
.ix input[type="date"],
.ix input[type="number"] {
    width: 100%;
    min-height: var(--tap-target);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    -webkit-appearance: none;
    appearance: none;
}
.ix select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235E6E6B'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 22px;
    padding-right: 36px;
}
.ix select:focus-visible,
.ix input:focus-visible,
.ix button:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* ── Segmented option group (radio-backed) ───────────────────────── */
.ix-seg { display: grid; gap: 8px; }
@media (min-width: 480px) { .ix-seg.ix-seg-row { grid-auto-flow: column; grid-auto-columns: 1fr; } }
.ix-seg label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: var(--tap-target);
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-cream);
    cursor: pointer;
    font-size: .9rem;
    color: var(--text-medium);
    line-height: 1.5;
    transition: border-color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
}
.ix-seg label:hover { border-color: var(--primary-light); }
.ix-seg input { margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; width: 18px; height: 18px; }
.ix-seg input:checked + span { color: var(--text-dark); font-weight: 600; }
.ix-seg label:has(input:checked) { border-color: var(--primary); background: var(--bg-sage); }
.ix-seg .ix-seg-sub { display: block; font-weight: 400; font-size: .82rem; color: var(--text-light); margin-top: 2px; }

/* ── Result / verdict panel ──────────────────────────────────────── */
.ix-out {
    border-radius: 12px;
    padding: 16px 18px;
    margin-top: 4px;
    border: 1px solid var(--border);
    background: var(--bg-sage);
}
.ix-out[data-tone="yes"]   { background: #ECFDF5; border-color: #A7F3D0; border-left: 4px solid #059669; }
.ix-out[data-tone="no"]    { background: #FEF2F2; border-color: #FECACA; border-left: 4px solid #DC2626; }
.ix-out[data-tone="care"]  { background: #FFFBEB; border-color: #FDE68A; border-left: 4px solid #F59E0B; }
.ix-out[data-tone="info"]  { background: var(--bg-sage); border-left: 4px solid var(--primary); }
.ix-out h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0 0 8px;
    line-height: 1.4;
}
.ix-out p { font-size: .9rem; color: var(--text-medium); line-height: 1.7; margin: 0 0 10px; }
.ix-out p:last-child { margin-bottom: 0; }
.ix-out ul { margin: 0 0 10px; padding-left: 20px; font-size: .9rem; color: var(--text-medium); line-height: 1.7; }
.ix-out a { color: var(--primary); font-weight: 600; }

/* ── Figure readout (price / dates) ──────────────────────────────── */
.ix-figs { display: grid; gap: 10px; margin: 0 0 14px; }
@media (min-width: 480px) { .ix-figs { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
.ix-fig {
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.ix-fig dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-light); font-weight: 700; margin-bottom: 4px; }
.ix-fig dd {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.ix-fig .ix-fig-note { display: block; font-family: var(--font-body); font-size: .76rem; font-weight: 400; color: var(--text-light); margin-top: 4px; line-height: 1.4; }
.ix-fig[data-emph="true"] { background: var(--bg-sage); border-color: var(--primary-light); }

/* ── Stepper ─────────────────────────────────────────────────────── */
.ix-steps { list-style: none; margin: 0; padding: 0; counter-reset: ixstep; }
.ix-step { border-bottom: 1px solid var(--border); }
.ix-step:last-child { border-bottom: none; }
.ix-step > button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--tap-target);
    padding: 14px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-dark);
    -webkit-tap-highlight-color: transparent;
}
.ix-step > button:hover { color: var(--primary); }
.ix-step-num {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--bg-sage);
    color: var(--primary);
    font-size: .82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ix-step.is-open .ix-step-num { background: var(--primary); color: var(--white); }
.ix-step-chev { margin-left: auto; flex-shrink: 0; transition: transform .25s ease; color: var(--text-light); font-size: .8rem; }
.ix-step.is-open .ix-step-chev { transform: rotate(180deg); }
.ix-step-body { overflow: hidden; }
.ix-step-body > div { padding: 0 0 16px 40px; font-size: .9rem; color: var(--text-medium); line-height: 1.75; }
.ix-step-body p { margin: 0 0 10px; }
.ix-step-body p:last-child { margin-bottom: 0; }
.ix-step-body ul { margin: 0 0 10px; padding-left: 18px; }

/* ── Chip explorer ───────────────────────────────────────────────── */
.ix-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.ix-chip {
    min-height: var(--tap-target);
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--bg-cream);
    color: var(--text-medium);
    font-family: var(--font-body);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    -webkit-tap-highlight-color: transparent;
}
.ix-chip:hover { border-color: var(--primary-light); color: var(--primary); }
.ix-chip[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--white); }
.ix-chip code, .ix-chips code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95em; }

/* ── Checklist ───────────────────────────────────────────────────── */
.ix-check { list-style: none; margin: 0 0 14px; padding: 0; }
.ix-check li { border-bottom: 1px solid var(--border); }
.ix-check li:last-child { border-bottom: none; }
.ix-check label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: var(--tap-target);
    padding: 12px 0;
    cursor: pointer;
    font-size: .9rem;
    color: var(--text-medium);
    line-height: 1.65;
    -webkit-tap-highlight-color: transparent;
}
.ix-check input { margin: 3px 0 0; width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; }
.ix-check input:checked ~ span { color: var(--text-light); text-decoration: line-through; }
.ix-progress {
    display: flex; align-items: center; gap: 10px;
    font-size: .82rem; color: var(--text-light); font-weight: 600;
}
.ix-progress-bar { flex: 1; height: 6px; border-radius: 50px; background: var(--border); overflow: hidden; }
.ix-progress-bar span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 50px; transition: width .3s ease; }

/* ── Small print inside a component ─────────────────────────────── */
.ix-note {
    font-size: .78rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ── Reset/secondary action ─────────────────────────────────────── */
.ix-reset {
    background: none;
    border: none;
    padding: 10px 0;
    min-height: var(--tap-target);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.ix-reset:hover { color: var(--primary); }

/* ── Responsive table wrapper (used by the new content pages) ───── */
.ix-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 18px 0; }
.ix-scroll > table { min-width: 520px; }
.ix-scroll-hint {
    display: block;
    font-size: .76rem;
    color: var(--text-light);
    margin: -10px 0 14px;
}
@media (min-width: 768px) { .ix-scroll-hint { display: none; } }

@media (min-width: 768px) {
    .ix { padding: 26px 28px; }
    .ix-title { font-size: 1.18rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ix-step-chev, .ix-step-body, .ix-progress-bar span, .ix-seg label, .ix-chip { transition: none; }
}
