/* ============================================================
   Soap Calculator — embedded in product-builder editor card
   Light-theme, matches the app design system.
   ============================================================ */

/* ── Recipe name ──────────────────────────────────────────── */
.sc-recipe-name-input {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--color-border);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    outline: none;
    padding: 2px 0 8px;
    margin-bottom: 18px;
    box-sizing: border-box;
    transition: border-color var(--transition);
}
.sc-recipe-name-input::placeholder { color: var(--color-text-light); font-weight: 400; }
.sc-recipe-name-input:focus { border-bottom-color: var(--color-primary); }

/* ── Embedded two-column layout ───────────────────────────── */
.sc-embed-layout {
    display: grid;
    grid-template-columns: 1fr 270px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 800px) { .sc-embed-layout { grid-template-columns: 1fr; } }

/* ── Left column sections ─────────────────────────────────── */
.sc-embed-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}
.sc-embed-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.sc-embed-sec-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.sc-embed-sec-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── Right panel ──────────────────────────────────────────── */
.sc-embed-right {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px;
}

/* ── Number input ─────────────────────────────────────────── */
.sc-num-input {
    padding: 5px 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 13px;
    text-align: right;
    font-family: var(--font-base);
    transition: border-color var(--transition);
}
.sc-num-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

/* ── Select ───────────────────────────────────────────────── */
.sc-select {
    padding: 5px 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font-base);
}
.sc-select:focus { outline: none; border-color: var(--color-primary); }
.sc-frag-method-sel { min-width: 0; }

/* ── Mode toggle ──────────────────────────────────────────── */
.sc-mode-toggle {
    display: flex;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 1px;
}
.sc-mode-btn {
    padding: 3px 10px;
    background: none;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    font-family: var(--font-base);
}
.sc-mode-btn.active { background: var(--color-surface); color: var(--color-text); font-weight: 600; box-shadow: var(--shadow-sm); }

.sc-batch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

/* ── Empty states ─────────────────────────────────────────── */
.sc-list-empty {
    font-size: 12px;
    color: var(--color-text-light);
    padding: 8px 0;
    font-style: italic;
}

/* ── Oils list ────────────────────────────────────────────── */
.sc-oils-list { display: flex; flex-direction: column; gap: 6px; }

.sc-oil-row {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color .15s, box-shadow .15s;
}
.sc-oil-row:hover { border-color: var(--color-border-dark); box-shadow: var(--shadow-sm); }

.sc-oil-info {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.sc-oil-name  { font-size: 13px; color: var(--color-text); font-weight: 600; }
.sc-oil-sap   { font-size: 11px; color: var(--color-text-light); margin-left: auto; }
.sc-oil-cost  { font-size: 11px; color: var(--color-success); font-weight: 500; }

.sc-oil-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sc-oil-pct-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--color-bg);
    border-radius: 2px;
    overflow: hidden;
}
.sc-oil-pct-bar { height: 100%; background: var(--color-primary); border-radius: 2px; transition: width .25s; }
.sc-oil-pct-label { font-size: 11px; color: var(--color-text-light); min-width: 34px; text-align: right; }

.sc-oil-remove {
    background: none; border: none; color: var(--color-text-light);
    font-size: 16px; cursor: pointer; padding: 0 3px; line-height: 1;
    border-radius: 3px; transition: color .15s, background .15s;
}
.sc-oil-remove:hover { color: var(--color-danger); background: var(--color-danger-bg); }

/* Oil role badges — light theme */
.sc-oil-role {
    font-size: 10px; padding: 1px 7px; border-radius: 99px; font-weight: 600; white-space: nowrap;
}
.sc-role-base      { background: #eff6ff; color: #2563eb; }
.sc-role-support   { background: #f0fdf4; color: #16a34a; }
.sc-role-hardener  { background: #fffbeb; color: #d97706; }
.sc-role-luxury    { background: #fdf4ff; color: #9333ea; }
.sc-role-specialty { background: #fff1f2; color: #e11d48; }

/* ── Fragrance list ───────────────────────────────────────── */
.sc-frag-list { display: flex; flex-direction: column; gap: 5px; }

.sc-frag-row {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sc-frag-auto-label {
    font-size: 10px; color: var(--color-text-light);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px; padding: 2px 8px; white-space: nowrap;
}

/* ── Notes textarea ───────────────────────────────────────── */
.sc-textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
    font-family: var(--font-base);
    transition: border-color var(--transition);
}
.sc-textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

/* ── Results panel ────────────────────────────────────────── */
.sc-unit-toggle {
    display: flex;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    padding: 2px;
}
.sc-unit-btn {
    padding: 2px 9px; background: none; border: none;
    border-radius: 3px; font-size: 11px; color: var(--color-text-muted);
    cursor: pointer; transition: all .15s; font-family: var(--font-base);
}
.sc-unit-btn.active { background: var(--color-surface); color: var(--color-text); font-weight: 600; box-shadow: var(--shadow-sm); }

.sc-results-grid { display: flex; flex-direction: column; margin-top: 8px; }

.sc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
}
.sc-result-row:last-child { border-bottom: none; }
.sc-result-label { color: var(--color-text-muted); }
.sc-result-val { font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }

.sc-result-highlight {
    background: #eef2ff;
    border-radius: 6px;
    padding: 7px 8px;
    margin: 2px -8px;
    border-bottom: none !important;
}
.sc-result-highlight .sc-result-val { color: var(--color-primary); font-size: 13px; }

.sc-result-total .sc-result-val { color: var(--color-success); font-size: 13px; font-weight: 800; }
.sc-result-frag  .sc-result-val { color: #9333ea; }

.sc-result-divider { height: 1px; background: var(--color-border); margin: 4px 0; }

.sc-cost-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0 0; font-size: 11px; border-top: 1px solid var(--color-border); margin-top: 4px;
}
.sc-cost-row .sc-result-val { color: var(--color-success); }

.sc-results-note {
    font-size: 11px; color: var(--color-warning); margin-top: 8px; display: none;
    background: var(--color-warning-bg); border-radius: 5px; padding: 5px 8px;
}

.sc-product-profile-card {
    margin-top: 10px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .08);
}

.sc-product-profile-kicker {
    margin-bottom: 4px;
    color: #4f46e5;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sc-product-profile-title {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.sc-product-profile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.sc-product-profile-chip {
    display: inline-flex;
    gap: 4px;
    max-width: 100%;
    padding: 5px 8px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    color: #3730a3;
    font-size: 11px;
    line-height: 1.35;
}

.sc-product-profile-chip strong {
    color: #312e81;
}

.sc-product-profile-notes {
    margin: 9px 0 0 16px;
    padding: 0;
    color: #475569;
    font-size: 11.5px;
    line-height: 1.5;
}

.sc-product-profile-notes li + li {
    margin-top: 4px;
}

/* ── Settings ─────────────────────────────────────────────── */
.sc-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 11px;
}
.sc-setting-row:last-child { margin-bottom: 0; }
.sc-setting-label {
    font-size: 12px; color: var(--color-text-muted);
    display: flex; align-items: center; gap: 4px; flex: 1;
}
.sc-tip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--color-bg); border: 1px solid var(--color-border);
    font-size: 9px; color: var(--color-text-muted); cursor: help; flex-shrink: 0;
}

.sc-toggle-group {
    display: flex; gap: 2px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.sc-toggle-btn {
    padding: 3px 9px; background: none; border: none; border-radius: 4px;
    font-size: 11px; color: var(--color-text-muted); cursor: pointer;
    transition: all .15s; white-space: nowrap; font-family: var(--font-base);
}
.sc-toggle-btn.active { background: var(--color-primary); color: #fff; font-weight: 600; }

.sc-input-suffix {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--color-text-muted);
}
.sc-frag-rate-row { display: flex; align-items: center; gap: 5px; }

.sc-water-setting-row {
    align-items: flex-start;
    flex-wrap: wrap;
}
.sc-water-setting-row .sc-setting-label {
    flex: 1 0 100%;
}
.sc-water-method-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    width: 100%;
    max-width: 100%;
}
.sc-water-input-wrap {
    justify-content: flex-end;
}
.sc-water-help {
    display: block;
    width: 100%;
    margin-top: -5px;
    color: var(--color-text-light);
    font-size: 10.5px;
    line-height: 1.4;
}

.sc-all-units {
    margin-top: 10px;
    border-top: 1px solid var(--color-border);
    padding-top: 8px;
}
.sc-units-table,
.sc-quality-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.sc-units-table th,
.sc-units-table td,
.sc-quality-table th,
.sc-quality-table td {
    padding: 5px 4px;
    border-bottom: 1px solid var(--color-border);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.sc-units-table th:first-child,
.sc-units-table td:first-child,
.sc-quality-table th:first-child,
.sc-quality-table td:first-child {
    text-align: left;
}
.sc-units-table th,
.sc-quality-table th {
    color: var(--color-text-light);
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}
.sc-water-method-note {
    margin-top: 6px;
    color: var(--color-text-light);
    font-size: 10.5px;
    line-height: 1.35;
}

.sc-quality-profile {
    display: grid;
    gap: 10px;
}
.sc-quality-value {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
}
.sc-quality-value strong {
    text-align: right;
}
.sc-quality-bar {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}
.sc-quality-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #4f46e5;
}
.sc-quality-ok strong { color: #166534; }
.sc-quality-ok .sc-quality-bar span { background: #22c55e; }
.sc-quality-low strong { color: #92400e; }
.sc-quality-low .sc-quality-bar span { background: #f59e0b; }
.sc-quality-high strong { color: #991b1b; }
.sc-quality-high .sc-quality-bar span { background: #ef4444; }
.sc-fatty-title {
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}
.sc-fatty-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sc-fatty-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 10.5px;
    line-height: 1.25;
}
.sc-fatty-pill b {
    color: #312e81;
}

/* ── Oil profile bars ─────────────────────────────────────── */
.sc-profile-empty { font-size: 11px; color: var(--color-text-light); font-style: italic; }
.sc-profile-row { margin-bottom: 12px; }
.sc-profile-row:last-child { margin-bottom: 0; }
.sc-profile-label { font-size: 10px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }

.sc-profile-bar-wrap {
    height: 8px; background: var(--color-bg); border-radius: 4px;
    display: flex; overflow: hidden; margin-bottom: 4px;
    border: 1px solid var(--color-border);
}
.sc-profile-segment { height: 100%; min-width: 2px; transition: width .3s; }
.sc-profile-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 10px; }

/* ── Bar count ────────────────────────────────────────────── */
.sc-bar-count {
    margin-top: 8px;
    padding: 7px 10px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    text-align: center;
}

/* ── Override fields ──────────────────────────────────────── */
.sc-override-row { margin-top: 4px; }
.sc-override-label {
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.sc-override-label input[type="checkbox"] { cursor: pointer; accent-color: var(--color-primary); }

/* ── Recipe profile (benefits + scent) ───────────────────── */
.sc-recipe-profile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 600px) { .sc-recipe-profile { grid-template-columns: 1fr; } }

.sc-rp-col {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.sc-rp-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}
.sc-rp-body { display: flex; flex-direction: column; gap: 6px; }

/* Benefits */
.sc-rp-benefit {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.sc-rp-benefit-tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    min-width: 90px;
}
.sc-rp-benefit-src {
    font-size: 11px;
    color: var(--color-text-light);
    flex: 1;
}

/* Scent notes */
.sc-rp-note-group { margin-bottom: 8px; }
.sc-rp-note-group:last-child { margin-bottom: 0; }
.sc-rp-note-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.sc-rp-frag { display: flex; flex-direction: column; gap: 1px; margin-bottom: 5px; }
.sc-rp-frag:last-child { margin-bottom: 0; }
.sc-rp-frag-name { font-size: 12px; font-weight: 600; color: var(--color-text); }
.sc-rp-frag-desc { font-size: 11px; color: var(--color-text-muted); line-height: 1.4; }
.sc-rp-frag-desc em { font-style: italic; color: #7c3aed; }

/* ── Suggestions panel ────────────────────────────────────── */
.sc-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.sc-suggestions:empty { margin-bottom: 0; }

.sc-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid transparent;
    width: 100%;
    box-sizing: border-box;
}

.sc-alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.sc-alert-danger  { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.sc-alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.sc-alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; font-weight: 600; }

/* ── Guide section ────────────────────────────────────────── */
.sc-guide-section {
    margin-top: 20px;
    border-top: 1px solid var(--color-border);
    padding-top: 2px;
}

.sc-guide-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: var(--font-base);
    transition: color .15s;
}
.sc-guide-toggle:hover { color: var(--color-primary); }
.sc-guide-chevron { margin-left: auto; transition: transform .2s; flex-shrink: 0; }
.sc-guide-toggle.open .sc-guide-chevron { transform: rotate(180deg); }

.sc-guide-body { margin-top: 12px; }

.sc-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 640px) { .sc-guide-grid { grid-template-columns: 1fr; } }

.sc-guide-item {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.sc-guide-item strong {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}
.sc-guide-item p {
    font-size: 11.5px;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin: 0;
}
.sc-guide-divider { height: 1px; background: var(--color-border); margin: 4px 0; }

/* ── Oil picker modal ─────────────────────────────────────── */
.sc-oil-pick-filters {
    display: flex; gap: 5px; flex-wrap: wrap;
}
.sc-pick-filter {
    padding: 3px 10px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 99px;
    font-size: 11px; color: var(--color-text-muted); cursor: pointer;
    transition: all .15s; font-family: var(--font-base);
}
.sc-pick-filter.active,
.sc-pick-filter:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.sc-oil-pick-list {
    max-height: 240px; overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); margin-top: 8px;
    background: var(--color-surface);
}
.sc-pick-item {
    padding: 9px 12px; border-bottom: 1px solid var(--color-border);
    cursor: pointer; transition: background .1s;
}
.sc-pick-item:last-child { border-bottom: none; }
.sc-pick-item:hover    { background: var(--color-bg); }
.sc-pick-item.selected { background: var(--color-primary-light); border-left: 3px solid var(--color-primary); }
.sc-pick-name { font-size: 13px; color: var(--color-text); font-weight: 500; }
.sc-pick-meta { font-size: 11px; color: var(--color-text-light); margin-top: 1px; }

.sc-list-loading { text-align: center; color: var(--color-text-light); padding: 18px; font-size: 12px; }

.sc-add-weight-row {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 8px;
}
.sc-selected-oil-name { font-size: 13px; color: var(--color-text); font-weight: 600; margin-bottom: 7px; }
.sc-add-weight-input  { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-muted); }
.sc-add-weight-hint   { display: block; font-size: 11px; color: var(--color-text-light); margin-top: 4px; }

.sc-frag-custom-row { margin-top: 8px; }
.sc-or-divider {
    text-align: center; position: relative;
    color: var(--color-text-light); font-size: 11px; margin: 12px 0;
}
.sc-or-divider::before,
.sc-or-divider::after {
    content: ''; position: absolute; top: 50%;
    width: 43%; height: 1px; background: var(--color-border);
}
.sc-or-divider::before { left: 0; }
.sc-or-divider::after  { right: 0; }
.sc-or-divider span {
    background: var(--color-surface); padding: 0 10px; position: relative;
}

/* Fragrance blend picker inside Product Builder */
.sc-blend-picker-overlay {
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 650;
}

.sc-blend-picker-dialog {
    display: flex;
    flex-direction: column;
    width: min(680px, 100%);
    max-width: 680px;
    max-height: 92vh;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.sc-blend-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.sc-blend-picker-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #4f46e5;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sc-blend-picker-header .modal-title {
    margin: 0;
    color: var(--color-text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
}

.sc-blend-picker-body {
    padding: 16px 20px 12px;
    gap: 10px;
}

.sc-blend-picker-filters {
    display: grid;
    grid-template-columns: minmax(160px, .8fr) minmax(180px, 1.2fr);
    gap: 8px;
}

.sc-blend-picker-filters .form-control {
    width: 100%;
    min-width: 0;
}

.sc-blend-picker-help {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.sc-blend-picker-list {
    max-height: min(48vh, 430px);
    overflow-y: auto;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.sc-blend-picker-empty {
    padding: 24px;
    color: var(--color-text-muted);
    font-size: 13px;
    text-align: center;
}

.sc-blend-picker-list .fc-bp-item {
    display: grid !important;
    gap: 7px !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff;
    cursor: pointer;
}

.sc-blend-picker-list .fc-bp-item:hover {
    background: #eef2ff !important;
}

.sc-blend-picker-list .fc-bp-item.selected {
    background: #eef2ff !important;
    box-shadow: inset 3px 0 0 #4f46e5;
}

.sc-blend-picker-list .fc-bp-item > div:first-child {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 10px !important;
}

.sc-blend-picker-list .fc-bp-item > div:first-child span:first-child {
    color: var(--color-text);
    font-size: 13.5px !important;
    font-weight: 800 !important;
    line-height: 1.3;
}

.sc-blend-picker-list .fc-bp-item > div:first-child span:last-child {
    padding: 3px 7px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569 !important;
    font-size: 11px !important;
}

.sc-blend-picker-list .fc-bp-item > div:nth-child(2) {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    color: #475569 !important;
    font-size: 11.5px !important;
    line-height: 1.45;
}

.sc-blend-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

/* ── Reference DB tables (manage modals) ──────────────────── */
.sc-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}
.sc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sc-table th {
    background: var(--color-bg); padding: 9px 12px; text-align: left;
    font-size: 10.5px; font-weight: 700; color: var(--color-text-muted);
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
.sc-table td {
    padding: 9px 12px; border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted); vertical-align: middle;
}
.sc-table tbody tr:last-child td { border-bottom: none; }
.sc-table tbody tr:hover td { background: #fafbfc; }
.sc-table-loading { text-align: center; color: var(--color-text-light); padding: 22px; }
.sc-card-sub { font-size: 11px; color: var(--color-text-light); }

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

#soapCalculatorCard,
.sc-embed-layout,
.sc-embed-left,
.sc-embed-right,
.sc-embed-section,
.sc-recipe-profile,
.sc-rp-col,
.sc-oils-list,
.sc-frag-list,
.sc-oil-row,
.sc-frag-row,
.sc-oil-info,
.sc-oil-controls,
.sc-results-grid,
.sc-table-wrap {
    min-width: 0;
    max-width: 100%;
}

.sc-oil-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.sc-oil-input-wrap .sc-num-input {
    flex: 0 1 auto;
}

.sc-oil-unit-label {
    font-size: 11px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* ============================================================
   Mobile layout
   ============================================================ */
@media (max-width: 768px) {
    #soapCalculatorCard {
        width: 100%;
        max-width: 100%;
        padding: 16px;
        overflow: hidden;
    }

    #soapCalculatorCard .card-head-row {
        align-items: stretch;
    }

    #soapCalculatorCard .card-head-actions {
        width: 100%;
        justify-content: stretch;
    }

    #soapCalculatorCard .card-head-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .sc-recipe-name-input {
        font-size: 15px;
        margin-bottom: 14px;
    }

    .sc-embed-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .sc-embed-left,
    .sc-embed-right,
    .sc-embed-section {
        min-width: 0;
    }

    .sc-embed-right {
        padding: 12px;
    }

    .sc-embed-sec-head {
        align-items: stretch;
    }

    .sc-embed-sec-head > * {
        min-width: 0;
    }

    .sc-mode-toggle,
    .sc-unit-toggle,
    .sc-toggle-group,
    .sc-frag-rate-row,
    .sc-water-method-row,
    .sc-input-suffix {
        width: 100%;
        max-width: 100%;
        margin-left: 0 !important;
    }

    .sc-mode-toggle,
    .sc-unit-toggle {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
    }

    .sc-mode-btn,
    .sc-unit-btn {
        text-align: center;
        padding-left: 6px;
        padding-right: 6px;
    }

    #scBtnAddOil,
    #scBtnAddFrag {
        width: 100%;
        justify-content: center;
        margin-left: 0 !important;
    }

    .sc-batch-row,
    .sc-setting-row,
    .sc-frag-rate-row,
    .sc-water-method-row,
    .sc-input-suffix,
    .sc-add-weight-input {
        flex-wrap: wrap;
    }

    .sc-water-method-row {
        grid-template-columns: 1fr;
    }

    .sc-setting-row {
        align-items: flex-start;
    }

    .sc-setting-label {
        min-width: 100%;
    }

    .sc-num-input,
    .sc-select {
        min-width: 0;
        max-width: 100%;
    }

    .sc-results-grid,
    .sc-product-profile-card,
    .sc-cost-row,
    .sc-table-wrap {
        min-width: 0;
        max-width: 100%;
    }

    .sc-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 560px) {
    .sc-alert {
        padding: 8px 9px;
    }

    .sc-oil-row,
    .sc-frag-row,
    .sc-add-weight-row {
        padding: 10px;
    }

    .sc-oil-info {
        gap: 5px;
    }

    .sc-oil-name {
        flex: 1 1 100%;
        overflow-wrap: anywhere;
    }

    .sc-oil-sap {
        margin-left: 0;
    }

    .sc-oil-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .sc-oil-pct-bar-wrap {
        flex: 1 1 100%;
    }

    .sc-oil-pct-label {
        min-width: 0;
        text-align: left;
        flex: 1 1 auto;
    }

    .sc-oil-input-wrap {
        flex: 0 1 auto;
        max-width: 100%;
    }

    .sc-oil-weight-input,
    .sc-oil-pct-input,
    .sc-frag-weight-input {
        width: 74px !important;
        max-width: 100%;
        min-width: 74px;
    }

    .sc-frag-row {
        align-items: stretch;
        flex-direction: column;
    }

    .sc-frag-row .sc-oil-controls {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        width: 100%;
    }

    .sc-result-row,
    .sc-cost-row {
        gap: 10px;
    }

    .sc-result-label {
        min-width: 0;
    }

    .sc-result-val {
        text-align: right;
        overflow-wrap: anywhere;
    }

    .sc-guide-toggle {
        padding: 12px 0;
    }

    .sc-guide-item {
        padding: 10px;
    }

    .sc-product-profile-chip {
        width: 100%;
    }

    .sc-blend-picker-overlay {
        padding: 10px;
    }

    .sc-blend-picker-dialog {
        max-height: calc(100vh - 20px);
    }

    .sc-blend-picker-header,
    .sc-blend-picker-body,
    .sc-blend-picker-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .sc-blend-picker-filters {
        grid-template-columns: 1fr;
    }

    .sc-blend-picker-list {
        max-height: 46vh;
    }

    .sc-oil-pick-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sc-pick-filter {
        text-align: center;
        padding-left: 6px;
        padding-right: 6px;
    }

    .sc-oil-pick-list {
        max-height: min(46vh, 280px);
    }

    .sc-table {
        min-width: 680px;
    }

    #manageFragsModal .sc-table {
        min-width: 620px;
    }
}

@media (max-width: 420px) {
    #soapCalculatorCard {
        padding: 14px 12px;
    }

    .sc-embed-right {
        padding: 10px;
    }

    .sc-setting-row {
        gap: 6px;
    }

    .sc-toggle-group,
    .sc-frag-rate-row,
    .sc-water-method-row,
    .sc-input-suffix {
        width: 100%;
    }

    .sc-toggle-btn {
        flex: 1;
    }

    .sc-frag-rate-row .sc-num-input,
    .sc-frag-method-sel {
        flex: 1;
        width: auto !important;
    }

    .sc-add-weight-input .sc-num-input {
        flex: 1;
        width: auto !important;
    }

    .sc-rp-col {
        padding: 10px;
    }
}

/* ── Soap type picker ─────────────────────────────────────── */
.sc-type-picker {
    padding: 20px 0 8px;
}
.sc-type-picker-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 14px;
}
.sc-type-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.sc-type-pick-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}
.sc-type-pick-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft, #eef2ff);
}
.sc-type-pick-btn strong {
    font-size: 13px;
    color: var(--color-text);
}
.sc-type-pick-btn span {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* ── Soap type bar (shown when recipe exists) ────────────── */
.sc-type-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 12px;
}
.sc-type-bar-label {
    color: var(--color-text-muted);
    font-weight: 500;
}
.sc-type-bar-name {
    font-weight: 600;
    color: var(--color-text);
}
.sc-type-change-btn {
    margin-left: auto;
    font-size: 11px;
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.sc-type-change-btn:hover {
    background: var(--color-primary-soft, #eef2ff);
}

.fc-scent-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    margin-right: 5px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
    color: #3730a3;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    white-space: nowrap;
}

.fc-scent-type-fo {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.fc-scent-type-blend {
    color: #0f766e;
    background: #ccfbf1;
    border-color: #99f6e4;
}

.fc-scent-type-flavor {
    color: #be123c;
    background: #fff1f2;
    border-color: #fecdd3;
}

.cc-wax-family {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    font-size: 10px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.cc-wax-meta,
.cc-frag-meta,
.cc-wax-pick-meta,
.cc-frag-pick-meta,
.cc-ref-sub {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.cc-wax-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cc-reference-wrap {
    margin-top: 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface);
}

.cc-reference-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    background: #f8fafc;
}

.cc-reference-head strong {
    display: block;
    font-size: 12px;
    color: var(--color-text);
}

.cc-reference-head span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.cc-reference-table-wrap {
    overflow-x: auto;
}

.cc-reference-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.cc-reference-table th,
.cc-reference-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    font-size: 12px;
}

.cc-reference-table th {
    background: #f8fafc;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cc-reference-table tr:last-child td {
    border-bottom: none;
}

.cc-wax-pick-row,
.cc-frag-pick-row {
    padding: 11px 12px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.cc-wax-pick-row:last-child,
.cc-frag-pick-row:last-child {
    border-bottom: none;
}

.cc-wax-pick-row:hover,
.cc-frag-pick-row:hover,
.cc-wax-pick-row.selected,
.cc-frag-pick-row.selected {
    background: #eef2ff;
}

.cc-wax-pick-title,
.cc-frag-pick-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

@media (max-width: 700px) {
    .cc-reference-table {
        min-width: 0;
    }

    .cc-reference-table thead {
        display: none;
    }

    .cc-reference-table,
    .cc-reference-table tbody,
    .cc-reference-table tr,
    .cc-reference-table td {
        display: block;
        width: 100%;
    }

    .cc-reference-table tr {
        border-bottom: 1px solid var(--color-border);
    }

    .cc-reference-table tr:last-child {
        border-bottom: none;
    }

    .cc-reference-table td {
        border-bottom: none;
        padding: 8px 12px;
    }

    .cc-reference-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: var(--color-text-light);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
    }
}
