/* Nicco Compound Selector – matches niccoleaksealing.com (red #CC0000, ink #111, grey #5C5E62, rule #E6E6E0)
 *
 * Every rule is scoped under .ncs-scope with at least two classes so the site's
 * Elementor kit rules (e.g. ".elementor-kit-12 button") cannot override it.
 */
.ncs-scope {
    --ncs-red: #CC0000;
    --ncs-red-hover: #E60000;
    --ncs-ink: #111111;
    --ncs-grey: #5C5E62;
    --ncs-rule: #E6E6E0;
    --ncs-paper: #FFFFFF;
    --ncs-tint: #FAFAF7;
    color: var(--ncs-ink);
    font-size: 15px;
    line-height: 1.5;
}
.ncs-scope *, .ncs-scope *::before, .ncs-scope *::after { box-sizing: border-box; }
.ncs-scope [hidden] { display: none !important; }

/* ---------- Form ---------- */
.ncs-scope.ncs-wrapper { width: 100%; }
.ncs-scope .ncs-form {
    background: var(--ncs-paper);
    border: 1px solid var(--ncs-rule);
    border-radius: 8px;
    padding: 28px;
    margin: 0;
}
.ncs-scope .ncs-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ncs-scope .ncs-field { margin: 0 0 20px; min-width: 0; }
.ncs-scope .ncs-field label {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--ncs-ink);
}
.ncs-scope .ncs-field label small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ncs-grey); margin-left: 4px; font-size: 12px; }
.ncs-scope .ncs-required { color: var(--ncs-red); }

.ncs-scope .ncs-field input.ncs-input.ncs-input {
    display: block;
    width: 100%;
    height: auto;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 16px; /* 16px stops iOS zooming on focus */
    line-height: 1.4;
    color: var(--ncs-ink);
    background: var(--ncs-paper);
    border: 1px solid #CFCFC8;
    border-radius: 4px;
    box-shadow: none;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.ncs-scope .ncs-field input.ncs-input.ncs-input:focus { border-color: var(--ncs-ink); box-shadow: 0 0 0 3px rgba(204, 0, 0, .12); }

/* ---------- Media combobox + chips ---------- */
.ncs-scope .ncs-combo { position: relative; }
.ncs-scope .ncs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.ncs-scope .ncs-chips:empty { display: none; }
.ncs-scope .ncs-chips .ncs-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: 0;
    padding: 6px 6px 6px 12px;
    background: #F3F3EF;
    color: var(--ncs-ink);
    border: 1px solid var(--ncs-rule);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}
.ncs-scope .ncs-chips .ncs-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncs-scope .ncs-chips button.ncs-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--ncs-grey);
    box-shadow: inset 0 0 0 1px var(--ncs-rule);
    font: normal 400 0/0 Arial, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}
.ncs-scope .ncs-chips button.ncs-chip-x svg { display: block; width: 10px; height: 10px; }
.ncs-scope .ncs-chips button.ncs-chip-x:hover,
.ncs-scope .ncs-chips button.ncs-chip-x:focus-visible { background: var(--ncs-red); color: #FFFFFF; box-shadow: none; outline: none; }

.ncs-scope .ncs-listbox {
    position: absolute; z-index: 50; left: 0; right: 0; top: 100%;
    margin: 4px 0 0; padding: 4px 0; list-style: none;
    max-height: 290px; overflow-y: auto;
    background: var(--ncs-paper); border: 1px solid var(--ncs-rule); border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}
.ncs-scope .ncs-listbox li { margin: 0; padding: 10px 14px; cursor: pointer; font-size: 14px; line-height: 1.35; list-style: none; }
.ncs-scope .ncs-listbox li[role=option]:hover,
.ncs-scope .ncs-listbox li.is-active { background: #F3F3EF; color: var(--ncs-red); }
.ncs-scope .ncs-listbox li.ncs-empty { color: var(--ncs-grey); cursor: default; }

/* ---------- Buttons (same look as the site's red Elementor buttons) ---------- */
.ncs-scope .ncs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 0; }
.ncs-scope .ncs-btn.ncs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 17px 34px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    border: 2px solid transparent;
    border-radius: 4px;
    box-shadow: none;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.ncs-scope .ncs-btn.ncs-btn-primary { background: var(--ncs-red); color: #FFFFFF; border-color: var(--ncs-red); }
.ncs-scope .ncs-btn.ncs-btn-primary:hover,
.ncs-scope .ncs-btn.ncs-btn-primary:focus-visible { background: var(--ncs-red-hover); border-color: var(--ncs-red-hover); color: #FFFFFF; }
.ncs-scope .ncs-btn.ncs-btn-secondary { background: transparent; color: var(--ncs-ink); border-color: var(--ncs-ink); }
.ncs-scope .ncs-btn.ncs-btn-secondary:hover,
.ncs-scope .ncs-btn.ncs-btn-secondary:focus-visible { background: var(--ncs-ink); color: #FFFFFF; border-color: var(--ncs-ink); }

/* ---------- States ---------- */
.ncs-scope .ncs-error { margin: 16px 0 0; padding: 12px 16px; border-left: 3px solid var(--ncs-red); background: #FDF2F2; color: #8A0000; }
.ncs-scope .ncs-loading { padding: 18px 0; color: var(--ncs-grey); }

/* ---------- Results (inline under the form, or in [nicco_compound_results]) ---------- */
.ncs-scope.ncs-results-host { width: 100%; }
.ncs-scope .ncs-results-inline { margin-top: 32px; }
.ncs-scope .ncs-placeholder {
    padding: 22px; border: 1px dashed #CFCFC8; border-radius: 6px; color: var(--ncs-grey); background: var(--ncs-tint); margin: 0;
}
.ncs-scope .ncs-results-title { margin: 0 0 4px; font-size: 22px; line-height: 1.25; color: var(--ncs-ink); }
.ncs-scope .ncs-summary { margin: 0 0 16px; color: var(--ncs-grey); }

.ncs-scope .ncs-rows { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ncs-scope .ncs-row-item {
    display: grid;
    grid-template-columns: minmax(110px, 1.1fr) minmax(150px, 1.4fr) minmax(0, 2fr) auto;
    align-items: center;
    gap: 8px 24px;
    margin: 0;
    padding: 16px 20px;
    background: var(--ncs-paper);
    border: 1px solid var(--ncs-rule);
    border-left: 4px solid var(--ncs-red);
    border-radius: 6px;
    list-style: none;
}
.ncs-scope .ncs-row-name { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--ncs-ink); }
.ncs-scope .ncs-row-rank { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ncs-grey); margin-bottom: 2px; }
.ncs-scope .ncs-cell-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ncs-red); }
.ncs-scope .ncs-cell-value { display: block; font-size: 14px; font-weight: 600; }
.ncs-scope .ncs-row-notes { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ncs-scope .ncs-row-notes:empty::before { content: "—"; color: #B8B8B0; }
.ncs-scope .ncs-note { padding: 6px 10px; background: #FFF6E0; border-radius: 4px; font-size: 13px; line-height: 1.4; color: #6B4A00; }
.ncs-scope .ncs-note-plain { background: var(--ncs-tint); color: var(--ncs-grey); }
.ncs-scope .ncs-btn.ncs-btn-row { padding: 12px 20px; font-size: 13px; white-space: nowrap; }

.ncs-scope .ncs-no-results, .ncs-scope .ncs-alert { padding: 22px; border-radius: 6px; border: 1px solid var(--ncs-rule); background: var(--ncs-tint); }
.ncs-scope .ncs-no-results p, .ncs-scope .ncs-alert p { margin: 0 0 14px; }
.ncs-scope .ncs-alert { border-color: var(--ncs-red); background: #FDF2F2; }
.ncs-scope .ncs-alert strong { display: block; margin-bottom: 6px; color: #8A0000; }
.ncs-scope .ncs-disclaimer { margin: 16px 0 0; font-size: 13px; color: var(--ncs-grey); }

/* ---------- Responsive: based on the width of the box the shortcode sits in ----------
 * Container queries, so the form and the results box adapt whether they are in a
 * full-width section or a narrow Elementor column, on any device.
 */
.ncs-scope.ncs-wrapper,
.ncs-scope.ncs-results-host { container-type: inline-size; }

/* Narrow form (phones, or a narrow column on tablet/desktop) */
@container (max-width: 520px) {
    .ncs-scope .ncs-form { padding: 18px; }
    .ncs-scope .ncs-row { grid-template-columns: 1fr; gap: 0; }
    .ncs-scope .ncs-actions .ncs-btn.ncs-btn { flex: 1 1 100%; padding-left: 16px; padding-right: 16px; }
}

/* Medium results box: notes move to a second line */
@container (max-width: 760px) {
    .ncs-scope .ncs-row-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
    .ncs-scope .ncs-row-notes { grid-column: 1 / -1; grid-row: 2; }
    .ncs-scope .ncs-row-notes:empty { display: none; }
}

/* Narrow results box: everything stacks */
@container (max-width: 480px) {
    .ncs-scope .ncs-row-item { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
    .ncs-scope .ncs-row-notes { grid-column: auto; grid-row: auto; }
    .ncs-scope .ncs-btn.ncs-btn-row { width: 100%; }
    .ncs-scope .ncs-results-title { font-size: 20px; }
}
