/*
 * Screaming Frog CLI Command Builder
 * Standalone, namespaced UI. Deliberately does not depend on /tools/tools-head.php.
 */

:root {
    --sfcb-ink: #171a1f;
    --sfcb-muted: #66717d;
    --sfcb-subtle: #8a949e;
    --sfcb-border: #e1e5e9;
    --sfcb-border-strong: #cdd4da;
    --sfcb-surface: #ffffff;
    --sfcb-soft: #f6f8f7;
    --sfcb-soft-2: #eef3f0;
    --sfcb-green: #22a55b;
    --sfcb-green-dark: #14723c;
    --sfcb-green-soft: #eaf8f0;
    --sfcb-terminal: #0c1117;
    --sfcb-terminal-2: #141b24;
    --sfcb-blue-soft: #edf5ff;
    --sfcb-warning-soft: #fff7df;
    --sfcb-danger-soft: #fff0f1;
    --sfcb-radius: 16px;
    --sfcb-shadow: 0 14px 35px rgba(17, 24, 39, .07);

    /* BrightonSEO 2026 command anatomy */
    --sfcb-anatomy-blue: #57B5E8;
    --sfcb-anatomy-green: #6FD08C;
    --sfcb-anatomy-yellow: #F2CF63;
    --sfcb-anatomy-orange: #F29D5B;
    --sfcb-anatomy-pink: #E78AC3;
    --sfcb-anatomy-purple: #B59BE8;
}

/* Page hero */
.sfcb-hero-section {
    padding: 48px 0 26px;
}

.sfcb-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
    gap: 48px;
    align-items: center;
    padding: 40px;
    border: 1px solid #e4e7e9;
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 0%, rgba(34,165,91,.13), transparent 34%),
        linear-gradient(145deg, #ffffff 0%, #f7faf8 100%);
    box-shadow: 0 18px 50px rgba(16, 24, 40, .06);
}

.sfcb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: #476154;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.sfcb-eyebrow span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--sfcb-green);
    box-shadow: 0 0 0 5px rgba(34,165,91,.12);
}

.sfcb-hero h1 {
    max-width: 760px;
    margin: 0 0 14px;
    color: var(--sfcb-ink);
    font-size: clamp(36px, 4.5vw, 58px);
    font-weight: 760;
    letter-spacing: -.04em;
    line-height: 1.02;
}

.sfcb-hero-copy > p {
    max-width: 720px;
    margin: 0;
    color: #59636e;
    font-size: 18px;
    line-height: 1.65;
}

.sfcb-platform-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.sfcb-platform-row span {
    padding: 7px 10px;
    border: 1px solid #dfe5e1;
    border-radius: 8px;
    background: rgba(255,255,255,.78);
    color: #59645e;
    font-size: 11px;
    font-weight: 650;
}

.sfcb-hero-terminal {
    overflow: hidden;
    border: 1px solid #26303b;
    border-radius: 14px;
    background: var(--sfcb-terminal);
    box-shadow: 0 20px 38px rgba(12,17,23,.18);
}

.sfcb-hero-terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border-bottom: 1px solid #26303b;
    background: #151c24;
}

.sfcb-hero-terminal-bar i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff6b6b;
}
.sfcb-hero-terminal-bar i:nth-child(2) { background: #ffd166; }
.sfcb-hero-terminal-bar i:nth-child(3) { background: #63d391; }
.sfcb-hero-terminal-bar span {
    margin-left: auto;
    color: #8390a0;
    font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sfcb-hero-terminal pre {
    margin: 0;
    padding: 24px;
    overflow: hidden;
    color: #d2dae4;
    font: 12px/1.9 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}
.sfcb-hero-terminal b { color: #fde68a; font-weight: 600; }
.sfcb-hero-terminal em { font-style: normal; }
.sfcb-hero-terminal .sf-demo-crawl { color: var(--sfcb-anatomy-blue); }
.sfcb-hero-terminal .sf-demo-execute { color: var(--sfcb-anatomy-green); }
.sfcb-hero-terminal .sf-demo-save { color: var(--sfcb-anatomy-yellow); }
.sfcb-hero-terminal .sf-demo-organise { color: var(--sfcb-anatomy-pink); }

/* App shell */
.sfcb-app-section {
    padding: 10px 0 46px;
}

.sfcb-app-wrap {
    width: 100%;
}

#sfCliBuilder,
#sfCliBuilder * {
    box-sizing: border-box;
}

#sfCliBuilder {
    width: 100%;
    color: var(--sfcb-ink);
    font-family: inherit;
}

#sfCliBuilder button,
#sfCliBuilder input,
#sfCliBuilder select,
#sfCliBuilder textarea {
    font: inherit;
}

.sf-privacy-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid #cfe8d9;
    border-radius: 12px;
    background: #f2fbf6;
    color: #335c46;
}
.sf-privacy-icon {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    background: #d9f3e4;
    color: var(--sfcb-green-dark);
    font-size: 14px;
    font-weight: 800;
}
.sf-privacy-note strong,
.sf-privacy-note span { display: block; }
.sf-privacy-note strong { font-size: 12px; }
.sf-privacy-note span { margin-top: 2px; color: #648072; font-size: 11px; }

.sfcb-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 22px;
    align-items: start;
}

.sfcb-main-column {
    min-width: 0;
}

.sfcb-preview-column {
    position: sticky;
    top: 110px;
    min-width: 0;
}

/* Cards */
#sfCliBuilder .sfcb-card {
    width: 100%;
    margin: 0 0 18px !important;
    padding: 22px !important;
    border: 1px solid var(--sfcb-border) !important;
    border-radius: var(--sfcb-radius) !important;
    background: var(--sfcb-surface) !important;
    box-shadow: 0 6px 20px rgba(16, 24, 40, .035) !important;
}

#sfCliBuilder .sfcb-recipes-card {
    margin-bottom: 22px !important;
    background: linear-gradient(180deg, #fff 0%, #fbfcfb 100%) !important;
}

.sfcb-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
}

.sfcb-card-head h4 {
    margin: 0 !important;
    color: #20242a !important;
    font-size: 18px !important;
    font-weight: 720 !important;
    line-height: 1.25 !important;
}

.sfcb-step {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    background: var(--sfcb-green-soft);
    color: var(--sfcb-green-dark);
    font-size: 12px;
    font-weight: 800;
}

.sfcb-helper {
    margin: 0 0 18px !important;
    color: var(--sfcb-muted) !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
}

/* Recipes */
.sf-recipe-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

#sfCliBuilder .sf-recipe {
    appearance: none !important;
    display: flex !important;
    min-width: 0;
    align-items: center !important;
    gap: 11px !important;
    margin: 0 !important;
    padding: 13px !important;
    border: 1px solid var(--sfcb-border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: var(--sfcb-ink) !important;
    cursor: pointer;
    text-align: left !important;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease !important;
}
#sfCliBuilder .sf-recipe:hover {
    transform: translateY(-2px);
    border-color: #b9d9c5 !important;
    box-shadow: 0 8px 20px rgba(18, 90, 50, .08) !important;
}
.sf-recipe-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #f0f4f2;
    color: #354c3e;
    font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sf-recipe strong,
.sf-recipe small { display: block; min-width: 0; }
.sf-recipe strong { color: #252a2f; font-size: 12px; line-height: 1.25; }
.sf-recipe small { margin-top: 3px; color: #7b858e; font-size: 10px; line-height: 1.3; }
#sfCliBuilder .sf-recipe-blank { border-style: dashed !important; }
#sfCliBuilder .sf-recipe-blank .sf-recipe-icon { background: #f5f2fb; color: #765b9f; }

/* Choice tiles */
.sf-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}
.sf-three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }

#sfCliBuilder .sf-choice {
    position: relative;
    display: flex !important;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    margin: 0 !important;
    padding: 13px 14px !important;
    border: 1px solid var(--sfcb-border) !important;
    border-radius: 11px !important;
    background: #fff !important;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
#sfCliBuilder .sf-choice:hover { border-color: #bac4ca !important; }
#sfCliBuilder .sf-choice.selected {
    border-color: #8bc9a4 !important;
    background: var(--sfcb-green-soft) !important;
    box-shadow: inset 0 0 0 1px rgba(34,165,91,.08) !important;
}
#sfCliBuilder .sf-choice input,
#sfCliBuilder .sf-source-tab input,
#sfCliBuilder .sf-format-toggle input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.sf-choice-title { color: #2b3036; font-size: 12px; font-weight: 700; }
.sf-choice-sub { color: #7d8790; font-size: 10px; }

/* Source selection */
.sf-source-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
#sfCliBuilder .sf-source-tab {
    position: relative;
    display: grid !important;
    min-height: 40px;
    place-items: center;
    margin: 0 !important;
    padding: 9px 10px !important;
    border: 1px solid var(--sfcb-border) !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: #5f6972 !important;
    cursor: pointer;
    font-size: 11px !important;
    font-weight: 650 !important;
    text-align: center;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
#sfCliBuilder .sf-source-tab:hover { border-color: #b8c3c8 !important; }
#sfCliBuilder .sf-source-tab.selected {
    border-color: #8bc9a4 !important;
    background: var(--sfcb-green-soft) !important;
    color: var(--sfcb-green-dark) !important;
}

/* Form fields */
.sfcb-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.sf-inline-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; }
.sf-four-cols { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.sf-full { grid-column: 1 / -1; }
.sf-mt-16 { margin-top: 16px; }

#sfCliBuilder .sfcb-field {
    min-width: 0;
    margin: 0 !important;
}
#sfCliBuilder .sfcb-field > label,
#sfCliBuilder .sf-field-label {
    display: block !important;
    margin: 0 0 7px !important;
    color: #3e464e !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}
.sf-optional { color: #9099a1; font-size: 9px; font-weight: 500; }

#sfCliBuilder .sfcb-field input[type="text"],
#sfCliBuilder .sfcb-field input[type="url"],
#sfCliBuilder .sfcb-field input[type="email"],
#sfCliBuilder .sfcb-field input[type="number"],
#sfCliBuilder .sfcb-field select {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 1px solid var(--sfcb-border-strong) !important;
    border-radius: 9px !important;
    outline: 0 !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(16,24,40,.02) !important;
    color: #252a30 !important;
    font-size: 12px !important;
    line-height: 42px !important;
    transition: border-color .15s ease, box-shadow .15s ease !important;
}
#sfCliBuilder .sfcb-field select {
    padding-right: 36px !important;
    background-image: linear-gradient(45deg, transparent 50%, #69737c 50%), linear-gradient(135deg, #69737c 50%, transparent 50%) !important;
    background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
}
#sfCliBuilder .sfcb-field input:focus,
#sfCliBuilder .sfcb-field select:focus {
    border-color: #75bd92 !important;
    box-shadow: 0 0 0 3px rgba(34,165,91,.10) !important;
}
#sfCliBuilder .sfcb-field input:disabled {
    background: #f1f3f2 !important;
    color: #929aa1 !important;
    cursor: not-allowed;
}
#sfCliBuilder .input-hint {
    display: block !important;
    margin-top: 6px !important;
    color: #858f98 !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
}

.sf-context-panel,
.sf-dependent-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e6e9eb;
    border-radius: 11px;
    background: #f8faf9;
}
.sf-dependent-panel h5 { margin: 0 0 12px; color: #404850; font-size: 12px; }

.sf-info-box,
.sf-summary-warning {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid #dde4e0;
    border-radius: 10px;
    background: #f6f9f7;
    color: #57645c;
    font-size: 11px;
    line-height: 1.45;
}
.sf-info-box strong,
.sf-summary-warning strong { color: #39473f; font-size: 11px; }
.sf-summary-warning { margin-bottom: 12px; border-color: #f0dda0; background: var(--sfcb-warning-soft); color: #715d1c; }
.sf-summary-warning strong { color: #665214; }

/* Checkbox groups */
.sfcb-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
#sfCliBuilder .sfcb-check {
    display: flex !important;
    min-width: 0;
    align-items: flex-start !important;
    gap: 9px !important;
    margin: 0 !important;
    padding: 10px 11px !important;
    border: 1px solid var(--sfcb-border) !important;
    border-radius: 10px !important;
    background: #fafbfb !important;
    color: #4d5760 !important;
    cursor: pointer;
    font-size: 11px !important;
    line-height: 1.4 !important;
}
#sfCliBuilder .sfcb-check:hover { border-color: #c6d0cb !important; background: #f8faf9 !important; }
#sfCliBuilder .sfcb-check input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: grid !important;
    flex: 0 0 17px !important;
    width: 17px !important;
    min-width: 17px !important;
    max-width: 17px !important;
    height: 17px !important;
    min-height: 17px !important;
    max-height: 17px !important;
    place-items: center;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #aab5ad !important;
    border-radius: 5px !important;
    background: #fff !important;
    box-shadow: none !important;
    cursor: pointer;
}
#sfCliBuilder .sfcb-check input[type="checkbox"]:checked {
    border-color: var(--sfcb-green) !important;
    background: var(--sfcb-green) !important;
}
#sfCliBuilder .sfcb-check input[type="checkbox"]:checked::after {
    content: "✓";
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}
.sf-check-card strong,
.sf-check-card small { display: block; }
.sf-check-card strong { color: #30373d; font-size: 11px; }
.sf-check-card small { margin-top: 2px; color: #7c858e; font-size: 9px; }
.sf-check-card code { font: 600 9px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sf-inline-check { margin-bottom: 8px !important; }

/* Advanced sections */
#sfCliBuilder .sf-advanced {
    overflow: hidden;
    margin-top: 14px;
    border: 1px solid var(--sfcb-border) !important;
    border-radius: 11px !important;
    background: #fff !important;
}
#sfCliBuilder .sf-advanced summary {
    padding: 12px 14px !important;
    background: #fafbfb !important;
    color: #505960 !important;
    cursor: pointer;
    font-size: 11px !important;
    font-weight: 700 !important;
    list-style: none;
}
#sfCliBuilder .sf-advanced summary::-webkit-details-marker { display: none; }
#sfCliBuilder .sf-advanced summary::after { content: "+"; float: right; color: #879089; }
#sfCliBuilder .sf-advanced[open] summary::after { content: "−"; }
.sf-advanced-body { padding: 14px; border-top: 1px solid var(--sfcb-border); }

/* Exports */
.sf-export-intro-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.sf-export-intro-row .sfcb-helper { margin-bottom: 0 !important; }
#sfCliBuilder .sf-clear-all-exports { flex: 0 0 auto; border-color: #d9cdef !important; color: #715a96 !important; }
#sfCliBuilder .sf-clear-all-exports:hover { background: #f7f3fc !important; border-color: var(--sfcb-anatomy-purple) !important; }

.sf-export-tabs-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 14px;
    padding: 5px;
    border-radius: 11px;
    background: #f0f2f1;
}
#sfCliBuilder .sf-export-tabs-nav button {
    appearance: none !important;
    display: flex !important;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 7px 8px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #67717a !important;
    cursor: pointer;
    font-size: 10px !important;
    font-weight: 700 !important;
    white-space: nowrap;
}
#sfCliBuilder .sf-export-tabs-nav button.active {
    background: #fff !important;
    color: #242a2f !important;
    box-shadow: 0 2px 7px rgba(17,24,39,.07) !important;
}
#sfCliBuilder .sf-export-tabs-nav button span {
    display: inline-flex !important;
    box-sizing: border-box !important;
    min-width: 20px !important;
    height: 20px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 5px !important;
    border-radius: 999px;
    background: #e4e8e6;
    color: #77817b;
    font-size: 9px !important;
    line-height: 1 !important;
    font-variant-numeric: tabular-nums;
    vertical-align: middle !important;
}
#sfCliBuilder .sf-export-tabs-nav button.active span { background: #f2edfb; color: #745a9d; }

.sf-export-panel { display: none; }
.sf-export-panel.active { display: block; }
.sf-export-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
}

.sf-search-wrap {
    position: relative;
    display: flex;
    min-width: 0;
    height: 42px;
    align-items: center;
    padding: 0 11px;
    border: 1px solid var(--sfcb-border-strong);
    border-radius: 9px;
    background: #fff;
}
.sf-search-wrap:focus-within { border-color: #75bd92; box-shadow: 0 0 0 3px rgba(34,165,91,.10); }
.sf-search-wrap > span { flex: 0 0 auto; margin-right: 7px; color: #8a949c; font-size: 14px; }
#sfCliBuilder .sf-search-wrap input[type="search"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: block !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #2d3339 !important;
    font-size: 11px !important;
    line-height: 40px !important;
}
#sfCliBuilder .sf-search-wrap input::-webkit-search-decoration,
#sfCliBuilder .sf-search-wrap input::-webkit-search-cancel-button { -webkit-appearance: none; }

#sfCliBuilder .sfcb-btn {
    appearance: none !important;
    display: inline-flex !important;
    width: auto !important;
    min-width: 0;
    height: 38px !important;
    min-height: 38px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 1px solid var(--sfcb-border-strong) !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #4c565f !important;
    cursor: pointer;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap;
}
#sfCliBuilder .sfcb-btn:hover { border-color: #aeb9b2 !important; background: #f8faf9 !important; color: #2f3832 !important; }
#sfCliBuilder .sfcb-btn.copied { border-color: #75bd92 !important; background: var(--sfcb-green-soft) !important; color: var(--sfcb-green-dark) !important; }
#sfCliBuilder .sfcb-btn-secondary { background: #f5f7f6 !important; }

.sf-selected-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0 0 10px;
}
.sf-selected-strip:empty { display: none; }
.sf-chip {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border: 1px solid #d9cdef;
    border-radius: 7px;
    background: #f7f3fc;
    color: #65507f;
    font-size: 9px;
}
.sf-chip > span { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sfCliBuilder .sf-chip button { appearance: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: #765f95 !important; cursor: pointer; font-size: 13px !important; line-height: 1 !important; }

.sf-export-list {
    max-height: 510px;
    overflow: auto;
    border: 1px solid var(--sfcb-border);
    border-radius: 11px;
    background: #fff;
    scrollbar-gutter: stable;
}
.sf-loading,
.sf-no-results { padding: 28px; color: #7d878f; font-size: 11px; text-align: center; }
.sf-category { position: relative; border-bottom: 1px solid #edf0ee; }
.sf-category.has-selection { box-shadow: inset 3px 0 0 var(--sfcb-anatomy-purple); }
.sf-category:last-child { border-bottom: 0; }
#sfCliBuilder .sf-category summary {
    display: flex !important;
    min-height: 44px;
    align-items: center !important;
    gap: 8px;
    margin: 0 !important;
    padding: 10px 12px !important;
    background: #fafbfb !important;
    color: #465049 !important;
    cursor: pointer;
    font-size: 11px !important;
    font-weight: 700 !important;
    list-style: none;
}
#sfCliBuilder .sf-category summary::-webkit-details-marker { display: none; }
#sfCliBuilder .sf-category summary::after { content: "+"; flex: 0 0 18px; width: 18px; color: #8e9791; font-size: 14px; text-align: center; }
#sfCliBuilder .sf-category[open] summary::after { content: "−"; }
.sf-category-meta { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: #8a9490; font-weight: 500; }
.sf-category-count {
    display: inline-flex !important;
    box-sizing: border-box !important;
    min-width: 28px !important;
    height: 24px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 7px !important;
    border-radius: 8px;
    background: #ecefed;
    color: #77817b;
    font-size: 9px !important;
    line-height: 1 !important;
    font-variant-numeric: tabular-nums;
    vertical-align: middle !important;
}
.sf-category-selected { color: #735a98; font-size: 9px; font-weight: 800; }

.sf-option-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 7px;
    background: #fff;
}
#sfCliBuilder .sf-option {
    position: relative;
    display: block !important;
    min-width: 0;
    min-height: 38px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #515b63 !important;
    cursor: pointer;
    font-size: 10px !important;
    line-height: 1.4 !important;
}
#sfCliBuilder .sf-option:hover { border-color: #e5eae7 !important; background: #f8faf9 !important; }
#sfCliBuilder .sf-option input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
#sfCliBuilder .sf-option > span {
    position: relative;
    display: flex !important;
    min-height: 38px;
    align-items: center;
    padding: 8px 10px 8px 38px !important;
    overflow-wrap: anywhere;
}
#sfCliBuilder .sf-option > span::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    border: 1px solid #aeb8b2;
    border-radius: 5px;
    background: #fff;
}
#sfCliBuilder .sf-option input:checked + span::before { border-color: #8c72b7; background: var(--sfcb-anatomy-purple); }
#sfCliBuilder .sf-option input:checked + span::after {
    content: "✓";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-54%);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
}
#sfCliBuilder .sf-option:has(input:checked) { border-color: #cfe7d8 !important; background: #f2faf5 !important; color: #314e3c !important; }
.sf-option mark { background: #fff0a8; color: inherit; padding: 0; }

/* Output */
.sf-output-behaviour { margin-top: 16px; }

/* Command preview */
#sfCliBuilder .sf-command-card {
    overflow: hidden;
    padding: 0 !important;
    border-color: #d5dbd7 !important;
    box-shadow: var(--sfcb-shadow) !important;
}
.sf-command-heading {
    display: block !important;
    padding: 18px 18px 14px;
    margin: 0 !important;
}
.sf-heading-left { display: flex; align-items: center; gap: 10px; }
.sf-command-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.sf-command-actions .sfcb-btn { flex: 1 1 auto; }

.sf-format-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1 1 100%;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--sfcb-border);
    border-radius: 8px;
    background: #f3f5f4;
}
#sfCliBuilder .sf-format-toggle label {
    position: relative;
    margin: 0 !important;
    padding: 7px 8px !important;
    border-radius: 6px;
    color: #6f7972 !important;
    cursor: pointer;
    font-size: 9px !important;
    font-weight: 700 !important;
    text-align: center;
}
#sfCliBuilder .sf-format-toggle label.active { background: #fff; color: #303a33 !important; box-shadow: 0 1px 4px rgba(17,24,39,.08); }

.sf-command-shellbar {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    border-top: 1px solid #29333f;
    border-bottom: 1px solid #29333f;
    background: var(--sfcb-terminal-2);
    color: #c3ced9;
    font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sf-shell-dot {
    width: 8px;
    height: 8px;
    margin-right: 28px;
    border-radius: 50%;
    background: #ff6b6b;
    box-shadow: 14px 0 0 #ffd166, 28px 0 0 #63d391;
}
.sf-command-version { margin-left: auto; color: #728092; }
.sf-anatomy-status {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 12px;
    border-bottom: 1px solid #26303b;
    background: #101720;
}
.sf-anatomy-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    border: 1px solid #2b3744;
    border-radius: 999px;
    color: #6f7c8b;
    font: 650 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    opacity: .58;
}
.sf-anatomy-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sf-anatomy-pill.active { opacity: 1; color: #d6dee8; }
.sf-anatomy-pill.sf-anatomy-crawl.active i { background: var(--sfcb-anatomy-blue); }
.sf-anatomy-pill.sf-anatomy-execute.active i { background: var(--sfcb-anatomy-green); }
.sf-anatomy-pill.sf-anatomy-save.active i { background: var(--sfcb-anatomy-yellow); }
.sf-anatomy-pill.sf-anatomy-destination.active i { background: var(--sfcb-anatomy-orange); }
.sf-anatomy-pill.sf-anatomy-organise.active i { background: var(--sfcb-anatomy-pink); }
.sf-anatomy-pill.sf-anatomy-export.active i { background: var(--sfcb-anatomy-purple); }

.sf-command-output {
    min-height: 200px;
    max-height: 390px;
    overflow: auto;
    background: var(--sfcb-terminal);
}
.sf-command-output pre {
    margin: 0 !important;
    padding: 18px !important;
    color: #d6dee8 !important;
    background: transparent !important;
    font: 11px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    white-space: pre-wrap;
    word-break: break-word;
}
.sf-command-output .sf-executable { color: #d8e0e9; font-weight: 650; }
.sf-command-output .sf-shell-op { color: #667587; }
.sf-command-output .sf-shell-setup { color: #aab6c4; }
.sf-command-output .sf-anatomy-crawl { color: var(--sfcb-anatomy-blue); }
.sf-command-output .sf-anatomy-execute { color: var(--sfcb-anatomy-green); }
.sf-command-output .sf-anatomy-save { color: var(--sfcb-anatomy-yellow); }
.sf-command-output .sf-anatomy-destination { color: var(--sfcb-anatomy-orange); }
.sf-command-output .sf-anatomy-organise { color: var(--sfcb-anatomy-pink); }
.sf-command-output .sf-anatomy-export { color: var(--sfcb-anatomy-purple); }
.sf-command-output .sf-anatomy-neutral { color: #c7d0da; }

.sf-validation {
    display: grid;
    gap: 7px;
    padding: 14px 16px 0;
}
.sf-validation-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 9px 10px;
    border: 1px solid;
    border-radius: 9px;
    font-size: 9px;
    line-height: 1.45;
}
.sf-validation-item strong { display: block; margin-bottom: 2px; font-size: 9px; }
.sf-validation-item.error { border-color: #efc5c9; background: var(--sfcb-danger-soft); color: #7a2a32; }
.sf-validation-item.warning { border-color: #eddda5; background: var(--sfcb-warning-soft); color: #6d5a1b; }
.sf-validation-item.info { border-color: #cfe0f3; background: var(--sfcb-blue-soft); color: #385b78; }
.sf-validation-item.success { border-color: #c7e5d2; background: var(--sfcb-green-soft); color: #315d43; }
.sf-validation-icon { flex: 0 0 auto; font-weight: 900; }

.sf-explain-card {
    margin: 12px 16px 0;
    padding: 11px 12px;
    border: 1px solid #dfe4e8;
    border-radius: 9px;
    background: #fafbfc;
}
.sf-explain-label { margin-bottom: 4px; color: #39434c; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.sf-explain-card p { margin: 0 !important; color: #69747e !important; font-size: 9px !important; line-height: 1.55 !important; }

.sf-breakdown-wrap {
    margin: 14px 16px 0;
    padding-top: 12px;
    border-top: 1px solid var(--sfcb-border);
}
#sfCliBuilder .sf-breakdown-toggle {
    appearance: none !important;
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #59635c !important;
    cursor: pointer;
    font-size: 10px !important;
    font-weight: 700 !important;
}
.sf-breakdown-toggle[aria-expanded="true"] .sf-chevron { transform: rotate(180deg); }
.sf-chevron { transition: transform .15s ease; }
.sf-breakdown { display: grid; gap: 5px; margin-top: 9px; }
.sf-breakdown-row { display: grid; gap: 4px; padding: 8px 8px 8px 11px; border-radius: 7px; border-left: 3px solid #d9dee2; background: #f6f8f7; font-size: 9px; }
.sf-breakdown-row.sf-anatomy-crawl { border-left-color: var(--sfcb-anatomy-blue); }
.sf-breakdown-row.sf-anatomy-execute { border-left-color: var(--sfcb-anatomy-green); }
.sf-breakdown-row.sf-anatomy-save { border-left-color: var(--sfcb-anatomy-yellow); }
.sf-breakdown-row.sf-anatomy-destination { border-left-color: var(--sfcb-anatomy-orange); }
.sf-breakdown-row.sf-anatomy-organise { border-left-color: var(--sfcb-anatomy-pink); }
.sf-breakdown-row.sf-anatomy-export { border-left-color: var(--sfcb-anatomy-purple); }
.sf-breakdown-row code { color: #266041; font: 600 9px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.sf-breakdown-row span { color: #717c74; line-height: 1.4; }

.sf-bottom-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 16px;
}
.sf-saved-state { color: #8c9590; font-size: 9px; line-height: 1.4; }

.sf-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    max-width: 320px;
    padding: 10px 13px;
    border: 1px solid #cbd4dc;
    border-radius: 9px;
    background: #17202a;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .16s ease, transform .16s ease;
}
.sf-toast.show { opacity: 1; transform: translateY(0); }

/* Supporting content should still inherit the main site typography */

@media (max-width: 1199px) {
    .sfcb-workspace { grid-template-columns: minmax(0, 1fr) 340px; }
    .sf-recipe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
    .sfcb-hero { grid-template-columns: 1fr; gap: 28px; }
    .sfcb-workspace { grid-template-columns: 1fr; }
    .sfcb-preview-column { position: static; }
    .sf-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sf-source-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sf-four-cols { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .sf-command-output { min-height: 150px; }
}

@media (max-width: 767px) {
    .sfcb-hero-section { padding-top: 28px; }
    .sfcb-hero { padding: 26px 20px; border-radius: 18px; }
    .sfcb-hero h1 { font-size: 38px; }
    .sfcb-hero-copy > p { font-size: 16px; }
    #sfCliBuilder .sfcb-card { padding: 18px !important; border-radius: 13px !important; }
    .sfcb-fields,
    .sf-inline-grid,
    .sf-three-cols { grid-template-columns: 1fr; }
    .sf-source-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sfcb-check-grid { grid-template-columns: 1fr; }
    .sf-export-tabs-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sf-export-toolbar { grid-template-columns: 1fr; }
    .sf-export-intro-row { flex-direction: column; align-items: stretch; }
    #sfCliBuilder .sf-clear-all-exports { width: 100% !important; }
    #sfCliBuilder .sf-export-toolbar .sfcb-btn { width: 100% !important; }
}

@media (max-width: 520px) {
    .sfcb-hero h1 { font-size: 33px; }
    .sfcb-platform-row span { flex: 1 1 45%; text-align: center; }
    .sf-recipe-grid,
    .sf-choice-grid { grid-template-columns: 1fr; }
    .sf-source-tabs { grid-template-columns: 1fr 1fr; }
    .sf-command-actions { flex-direction: column; }
    .sf-command-actions .sfcb-btn { width: 100% !important; }
    .sf-bottom-actions { flex-direction: column; align-items: stretch; }
    .sf-bottom-actions .sfcb-btn { width: 100% !important; }
    .sf-toast { right: 12px; bottom: 12px; left: 12px; max-width: none; text-align: center; }
}
