/* ======================================================
   SC Mods & Specs — behavioural / non-utility-expressible rules.
   Visual styling (typography, spacing, color, radius) is composed
   from utility.css `u-*` classes on the markup itself.
   ====================================================== */

/* Empty-state dashed border (no dashed utility yet). */
.sc-mods-empty {
    border: 1.5px dashed rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.02);
}

/* --- Modal dialog shell layout --- */
.sc-mods-editor-dialog {
    width: 100%;
    max-width: 560px;
    color: #f4f4f4;
    background: #1e1e1e !important;
    border-radius: 10px !important;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
@media (min-width: 1200px) {
    .sc-mods-editor-dialog { max-width: 110rem; }
}
.sc-mods-editor__header,
.sc-mods-editor__footer { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
/* Desktop-only hover affordances (skip sticky hover on touch). */
@media (hover: hover) and (pointer: fine) {
    .sc-mods-editor__close:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
    .sc-mods-editor__btn--cancel:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
    .sc-mods-cat__head:hover { background: rgba(255, 255, 255, 0.04); }
}
.sc-mods-editor__footer { border-top: 1px solid rgba(255, 255, 255, 0.05); border-bottom: 0; }
.sc-mods-editor__body {
    flex: 0 0 auto;
    height: 440px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;                                       /* Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;       /* Firefox */
}
.sc-mods-editor__body::-webkit-scrollbar { width: 3px; }
.sc-mods-editor__body::-webkit-scrollbar-track { background: transparent; }
.sc-mods-editor__body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
}
.sc-mods-editor__body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.30); }
.sc-mods-editor__header,
.sc-mods-editor__footer { flex-shrink: 0; }


/* --- Per-category accent color --------------------------------
   --cat-rgb is the r,g,b triplet of the category accent. It's
   reused for the open-state tint, Add button, and input focus.
   Sources for exterior/wheels/suspension/engine/interior/electronics/
   audio/accessories match the rgba bgs of .u-mod-tile-* in utility.css.
   Brakes & exhaust use distinct values so the Save button stays
   the loudest red — see summary.
----------------------------------------------------------------- */
.sc-mods-cat[data-cat="exterior"]     { --cat-rgb: 99,153,34; }
.sc-mods-cat[data-cat="wheels_tires"] { --cat-rgb: 55,138,221; }
.sc-mods-cat[data-cat="brakes"]       { --cat-rgb: 178,53,53; }    /* deeper crimson, darker than Save #e23838 */
.sc-mods-cat[data-cat="suspension"]   { --cat-rgb: 31,158,117; }
.sc-mods-cat[data-cat="engine"]       { --cat-rgb: 239,159,39; }
.sc-mods-cat[data-cat="exhaust"]      { --cat-rgb: 216,120,48; }   /* burnt-orange, pushed off-red */
.sc-mods-cat[data-cat="interior"]     { --cat-rgb: 127,119,221; }
.sc-mods-cat[data-cat="electronics"]  { --cat-rgb: 55,138,221; }
.sc-mods-cat[data-cat="audio"]        { --cat-rgb: 212,83,126; }
.sc-mods-cat[data-cat="accessories"]  { --cat-rgb: 136,135,128; }

/* Open-row tint (background + border). Closed rows keep neutral utilities. */
.sc-mods-cat.is-open {
    background: rgba(var(--cat-rgb), 0.08);
    border-color: rgba(var(--cat-rgb), 0.25);
    overflow: visible;
}

/* Add button — muted/darker tone of the category color so Save remains
   the loudest fully-saturated red on screen. */
.sc-mods-cat__add-btn {
    background: rgba(var(--cat-rgb, 255 255 255), 0.55);
}
.sc-mods-cat__add-btn:hover {
    background: rgba(var(--cat-rgb, 255 255 255), 0.75);
}

/* Composer "+ Add shop" sits to the right of the part field, before Add.
   Keep the pill/chip content-height so they don't stretch with the row. */
.sc-mods-cat__addshop,
.sc-mods-cat__pending-shop {
    align-self: center;
}
.sc-mods-cat__pending-shop {
    display: inline-flex;
    max-width: 160px;
}
.sc-mods-cat__shop-field {
    flex: 1 1 160px;
    min-width: 140px;
    max-width: 240px;
}
.sc-mods-cat__shop-field .sc-mods-item__source-suggest {
    right: 0;
}

/* Per-category clear button */
.sc-mods-cat__clear {
    display: none;
    color: rgba(226, 85, 75, 0.65);
    font-size: 11px;
    padding: 2px 0;
    transition: color 150ms ease;
    text-align: right;
    width: 100%;
}
.sc-mods-cat__clear:hover { color: rgba(226, 85, 75, 1); }
.sc-mods-cat__clear:not([hidden]) { display: block; }

/* Footer clear all */
.sc-mods-clear-all {
    color: rgba(226, 85, 75, 0.55);
    font-size: 12px;
    padding: 2px 0;
    transition: color 150ms ease;
}
.sc-mods-clear-all:hover { color: rgba(226, 85, 75, 1); }

/* Quick-add input — tints on hover & focus (same color, same intensity). */
.sc-mods-cat__input:hover,
.sc-mods-cat__input:focus {
    border-color: rgba(var(--cat-rgb, 255 255 255), 0.50);
    background: rgba(var(--cat-rgb, 0 0 0), 0.04);
}

/* --- Tightened item list spacing & flexible remove button --- */
.sc-mods-cat__items { gap: 2px; }
.sc-mods-item { padding-top: 6px; padding-bottom: 6px; }
.sc-mods-item__remove {
    width: 32px;          /* min tap target on mobile */
    height: auto;
    align-self: stretch;
    font-size: 18px;
    line-height: 1;
}

/* --- Accordion chevron rotation --- */
.sc-mods-cat__chev { transition: transform 0.18s ease; }
.sc-mods-cat.is-open .sc-mods-cat__chev { transform: rotate(180deg); }

/* --- Input warn state --- */
.sc-mods-cat__input { outline: none; }
.sc-mods-cat__input.is-warn {
    border-color: rgba(245, 175, 60, 0.6);
    background: rgba(245, 175, 60, 0.06);
}

/* --- Inline shop picker (mod item "from" field) ---
   Uses the per-category --cat-rgb tint so pills and chips feel
   native to each category row. */
.sc-mods-item__addshop {
    display: inline-flex;
    gap: 4px;
    padding: 3px 9px;
    color: rgb(var(--cat-rgb, 255 255 255));
    background: rgba(var(--cat-rgb, 255 255 255), 0.10);
    border: 0.5px solid rgba(var(--cat-rgb, 255 255 255), 0.32);
    transition: background 140ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .sc-mods-item__addshop:hover { background: rgba(var(--cat-rgb, 255 255 255), 0.18); }
}
.sc-mods-item.is-editing-source .sc-mods-item__addshop,
.sc-mods-item.is-editing-source .sc-mods-item__source-text { display: none; }

.sc-mods-item__source-chip {
    max-width: 100%;
    padding: 2px 4px 2px 7px;
    color: rgb(var(--cat-rgb, 255 255 255));
    background: rgba(var(--cat-rgb, 255 255 255), 0.10);
    border: 0.5px solid rgba(var(--cat-rgb, 255 255 255), 0.32);
    transition: background 140ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .sc-mods-item__source-chip:hover { background: rgba(var(--cat-rgb, 255 255 255), 0.18); }
}
.sc-mods-item__source-clear {
    width: 16px;
    height: 16px;
    font-size: 13px;
    line-height: 1;
    color: rgb(var(--cat-rgb, 255 255 255));
    border-radius: 3px;
    transition: background 140ms ease, color 140ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .sc-mods-item__source-clear:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
}
.sc-mods-item__source-input {
    font-size: 12px;
    padding: 6px 10px;
    border-color: rgba(var(--cat-rgb, 255 255 255), 0.42);
    outline: none;
}
.sc-mods-item__source-input:focus {
    border-color: rgba(var(--cat-rgb, 255 255 255), 0.70);
    background: rgba(var(--cat-rgb, 255 255 255), 0.05);
}
.sc-mods-item__source-cancel {
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    transition: color 140ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .sc-mods-item__source-cancel:hover { color: rgba(255, 255, 255, 0.7); }
}
.sc-mods-item.is-editing-source {
    background: rgba(var(--cat-rgb, 255 255 255), 0.06);
    border: 1px solid rgba(var(--cat-rgb, 255 255 255), 0.20);
}

/* Shop autocomplete dropdown */
.sc-mods-item__source-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 30px;
    margin-top: 4px;
    z-index: 40;
    max-height: 176px;
    overflow-y: auto;
    background: #242424;
    border: 0.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.sc-mods-item__source-suggest[hidden] { display: none; }
.sc-mods-item__source-suggest::-webkit-scrollbar { width: 3px; }
.sc-mods-item__source-suggest::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 2px; }
.sc-mods-item__source-suggest li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    font-size: 12px;
    line-height: 1.3;
    color: #e6e6e6;
    cursor: pointer;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
    transition: background 120ms ease;
}
.sc-mods-item__source-suggest li:last-child { border-bottom: 0; }
.sc-mods-item__source-suggest li[aria-selected="true"] { background: rgba(var(--cat-rgb, 255 255 255), 0.14); }
@media (hover: hover) and (pointer: fine) {
    .sc-mods-item__source-suggest li:hover { background: rgba(var(--cat-rgb, 255 255 255), 0.10); }
}
.sc-mods-item__source-suggest .ss-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-mods-item__source-suggest .ss-count { flex-shrink: 0; font-size: 10px; color: #8d8d93; }
.sc-mods-item__source-suggest .ss-create { color: rgb(var(--cat-rgb, 255 255 255)); border-top: 0.5px solid rgba(255, 255, 255, 0.08); }
.sc-mods-item__source-suggest .ss-create svg { flex-shrink: 0; }

/* --- Suggestions dropdown --- */
.sc-mods-cat__suggest {
    position: fixed;
    z-index: 9999;
    max-height: 208px;
    overflow-y: auto;
    background: #242424;
    border: 1px solid rgba(var(--cat-rgb, 255 255 255), 0.28);
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.sc-mods-cat__suggest::-webkit-scrollbar { width: 3px; }
.sc-mods-cat__suggest::-webkit-scrollbar-track { background: transparent; }
.sc-mods-cat__suggest::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
}
.sc-mods-cat__suggest[hidden] { display: none; }
.sc-mods-cat__suggest-item {
    display: block;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.35;
    color: #e6e6e6;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 120ms ease, color 120ms ease;
}
.sc-mods-cat__suggest-item:last-child { border-bottom: 0; }
.sc-mods-cat__suggest-item[aria-selected="true"] {
    background: rgba(var(--cat-rgb, 255 255 255), 0.14);
    color: #fff;
}
@media (hover: hover) and (pointer: fine) {
    .sc-mods-cat__suggest-item:hover {
        background: rgba(var(--cat-rgb, 255 255 255), 0.10);
        color: #fff;
    }
}
.sc-mods-cat__suggest-hl {
    background: transparent;
    color: rgb(var(--cat-rgb, 255 255 255));
    font-weight: 600;
    padding: 0;
}

/* --- Drag: entire item row is draggable; handle is only a visual cue --- */
.sc-mods-item { cursor: grab; user-select: none; }
.sc-mods-item:active { cursor: grabbing; }
.sc-mods-item__handle { pointer-events: none; }
.sc-mods-item__remove { cursor: pointer; }
.sc-mods-item--ghost { opacity: 0.4; }

/* --- Item remove hover --- */
[data-mods-remove]:hover { color: #f08080; background: rgba(240, 128, 128, 0.08); }

/* --- Save button spinner --- */
.sc-mods-editor__spinner {
    display: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: scModsSpin 0.7s linear infinite;
}
.sc-mods-editor__save.is-loading .sc-mods-editor__spinner { display: inline-block; }
.sc-mods-editor__save[disabled] { opacity: 0.7; cursor: not-allowed; }
@keyframes scModsSpin { to { transform: rotate(360deg); } }

/* --- Mobile: bottom sheet (mods / tags / snapshot share this shell) ---
   Featured Mods already did this; these editors were still a centered
   .sc-modal. sc-modal.css loads with equal/higher specificity, so the
   sheet rules below are restated at (0,4,0)+ like .sc-fm-dialog.
   Transition-only — a parallel @keyframes sheet-in fights the transform
   and reads as a peek → pause → continue. */
@media (max-width: 991px) {
    .sc-modal.sc-mods-editor-modal {
        opacity: 1 !important;
        --sc-modal-transition-duration: 360ms;
        align-items: flex-end;
        padding: 0;
    }

    .sc-modal.sc-mods-editor-modal.show {
        align-items: flex-end;
    }

    .sc-modal.sc-mods-editor-modal .sc-modal-overlay {
        transition: opacity 360ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    /* Beat .sc-modal .sc-modal-dialog (220ms pop) and
       .sc-modal.show .sc-modal-dialog { position: relative }. */
    .sc-modal.sc-mods-editor-modal .sc-mods-editor-dialog,
    .sc-modal.sc-mods-editor-modal .sc-modal-dialog.sc-mods-editor-dialog {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        width: 100%;
        max-width: 100%;
        margin: 0;
        max-height: 92vh;
        max-height: 92dvh;
        background: #181818 !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
        opacity: 1 !important;
        transform: translateY(100%) !important;
        animation: none !important;
        transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1) !important;
        touch-action: pan-y;
    }

    .sc-modal.sc-mods-editor-modal.show .sc-mods-editor-dialog,
    .sc-modal.sc-mods-editor-modal.show .sc-modal-dialog.sc-mods-editor-dialog {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        background: #181818 !important;
        border-radius: 16px 16px 0 0 !important;
        transform: translateY(0) !important;
        animation: none !important;
    }

    .sc-modal.sc-mods-editor-modal.sc-is-closing .sc-modal-dialog.sc-mods-editor-dialog {
        transform: translateY(100%) !important;
        animation: none !important;
        transition: transform 360ms cubic-bezier(0.4, 0, 1, 1) !important;
    }

    .sc-modal.sc-mods-editor-modal.sc-is-closing {
        --sc-modal-transition-duration: 360ms;
    }

    .sc-modal.sc-mods-editor-modal.sc-is-closing .sc-modal-overlay {
        transition: opacity 360ms cubic-bezier(0.4, 0, 1, 1);
    }

    .sc-mods-editor-dialog::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.28);
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    .sc-mods-editor__body {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    .sc-modal.sc-mods-editor-modal .sc-mods-editor__footer {
        padding-bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px));
    }

    .sc-mods-editor-dialog.sc-snap-dismissing {
        transform: translateY(100%) !important;
        opacity: 1 !important;
        transition: transform 360ms cubic-bezier(0.4, 0, 1, 1) !important;
    }
}

@media (max-width: 991px) and (prefers-reduced-motion: reduce) {
    .sc-modal.sc-mods-editor-modal .sc-modal-dialog.sc-mods-editor-dialog,
    .sc-modal.sc-mods-editor-modal.sc-is-closing .sc-modal-dialog.sc-mods-editor-dialog {
        transition: none !important;
        animation: none !important;
        transform: translateY(0) !important;
    }
    .sc-modal.sc-mods-editor-modal.sc-is-closing .sc-modal-dialog.sc-mods-editor-dialog {
        transform: translateY(100%) !important;
    }
    .sc-mods-editor-dialog.sc-snap-dismissing {
        transition: opacity 200ms ease-out !important;
        transform: none !important;
        opacity: 0 !important;
    }
}

/* ======================================================
   Build Snapshot editor — extras (reuses .sc-mods-editor-* shell)
   ====================================================== */

.sc-snapshot-editor-modal .sc-mods-editor-dialog {
    box-sizing: border-box;
}

/* Live preview */
.sc-snapshot-preview {
    border: 1px dashed rgba(226, 56, 56, 0.26);
    background: rgba(226, 56, 56, 0.04);
}
.sc-snapshot-preview__dot {
    display: inline-block;
    width: 8px; height: 8px; border-radius: 50%;
    background: #e23838;
    box-shadow: 0 0 0 0 rgba(226, 56, 56, 0.6);
    animation: scSnapPulse 1.4s ease-out infinite;
}
@keyframes scSnapPulse {
    0%   { box-shadow: 0 0 0 0 rgba(226, 56, 56, 0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(226, 56, 56, 0); }
    100% { box-shadow: 0 0 0 0 rgba(226, 56, 56, 0); }
}
.sc-snapshot-preview__rail {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.sc-snapshot-preview__rail::-webkit-scrollbar { display: none; }
.sc-snapshot-preview__empty { white-space: nowrap; }

.sc-snapshot-mini-card {
    flex: 0 0 auto;
    width: 86px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 3px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.sc-snapshot-mini-card__value-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    line-height: 1;
    min-width: 0;
}
.sc-snapshot-mini-card__value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    max-width: 100%;
}
.sc-snapshot-mini-card__value--medium { font-size: 13px; }
.sc-snapshot-mini-card__value--small { font-size: 11px; }
.sc-snapshot-mini-card__unit {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: #4b94ff;
    flex-shrink: 0;
}
.sc-snapshot-mini-card__label {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(178, 186, 196, 0.85);
    line-height: 1.2;
}
.sc-snapshot-mini-card.is-empty {
    opacity: 0.35;
    border-style: dashed;
}
.sc-snapshot-mini-card.is-empty .sc-snapshot-mini-card__value {
    color: rgba(255, 255, 255, 0.55);
}

/* Fields */
.sc-snapshot-grid {
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .sc-snapshot-grid          { grid-template-columns: repeat(3, 1fr); }
    .sc-snapshot-grid--2       { grid-template-columns: repeat(2, 1fr); }
    .sc-snapshot-grid--drive   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sc-snapshot-grid--stack   { grid-template-columns: 1fr; }
    .sc-snapshot-field--full   { grid-column: 1 / -1; }
}
.sc-snapshot-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.sc-snapshot-field__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.sc-snapshot-field__input-wrap {
    position: relative;
    min-width: 0;
}
.sc-snapshot-field__input,
.sc-snap-select__el {
    min-width: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 140ms ease, background-color 140ms ease;
}
.sc-snapshot-field__input {
    appearance: none;
    -webkit-appearance: none;
}
input.sc-snapshot-field__input[inputmode="numeric"],
input.sc-snapshot-field__input[inputmode="decimal"] {
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.sc-snapshot-field__input:hover,
.sc-snapshot-field__input:focus,
.sc-snap-select__el:hover,
.sc-snap-select__el:focus {
    border-color: rgba(226, 56, 56, 0.45);
    background: rgba(226, 56, 56, 0.04);
}
.sc-snapshot-field__suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
}
.sc-snapshot-field__input:has(+ .sc-snapshot-field__suffix) {
    padding-right: 38px;
}

/* Separator groups */
.sc-snap-group {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0 0 16px;
    min-inline-size: 0;
    padding: 16px 0 0;
}
.sc-snap-group:last-child {
    margin-bottom: 0;
}
.sc-snap-group__legend {
    float: left;
}
.sc-snap-group__legend + * {
    clear: both;
}
.sc-snap-group__icon {
    border-radius: 7px;
}
.sc-snap-group__icon svg {
    width: 13px;
    height: 13px;
}
.sc-snap-group__icon--perf {
    background: rgba(226, 56, 56, 0.12);
    color: #e23838;
}
.sc-snap-group__icon--drive {
    background: rgba(75, 148, 255, 0.12);
    color: #4b94ff;
}
.sc-snap-group__icon--style {
    background: rgba(111, 220, 140, 0.12);
    color: #6fdc8c;
}
.sc-snap-group__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}
.sc-snap-group__hint {
    margin-left: auto;
    font-size: 10px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.45);
}

/* Drivetrain segmented control */
.sc-snap-segmented {
    padding: 3px;
}
.sc-snap-segmented__opt {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 4px;
    transition: background-color 140ms ease, color 140ms ease;
}
.sc-snap-segmented__opt.is-active {
    background: #e23838;
    color: #fff;
}

/* Styled native select */
.sc-snap-select {
    position: relative;
    display: block;
}
.sc-snap-select__el {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 32px;
}
.sc-snap-select::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid rgba(255, 255, 255, 0.45);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.45);
    pointer-events: none;
    transform: translateY(-70%) rotate(45deg);
}

/* Combo chip input */
.sc-snap-combo {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 4px;
    transition: border-color 140ms ease, background-color 140ms ease;
}
.sc-snap-combo:focus-within {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}
.sc-snap-combo__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
    padding: 2px;
}
.sc-snap-combo__chip {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.62);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
    white-space: nowrap;
}
.sc-snap-combo__chip.is-active {
    background: #e23838;
    border-color: #e23838;
    color: #fff;
}
.sc-snap-combo__input {
    width: 100%;
    background: transparent;
    border: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 0;
    color: #fff;
    font: inherit;
    font-size: 13px;
    outline: none;
    padding: 7px 10px;
}
.sc-snap-combo__input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    font-style: italic;
}

.sc-snap-hint-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    line-height: 1.35;
}
.sc-snap-hint-row__icon {
    display: inline-flex;
    flex-shrink: 0;
}
.sc-snap-hint-row__icon svg {
    width: 12px;
    height: 12px;
}
@media (hover: hover) and (pointer: fine) {
    .sc-snap-segmented__opt:not(.is-active):hover,
    .sc-snap-combo__chip:not(.is-active):hover {
        background: rgba(255, 255, 255, 0.06);
        color: rgba(255, 255, 255, 0.82);
    }
}

/* ======================================================
   Build Snapshot — SAVE FLOW (idle → saving → success → toast / error)
   ====================================================== */

/* Footer becomes a column so the inline error sits above the actions. */
.sc-snap-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Inline error line */
.sc-snap-error {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.3;
    color: #f0a0a0;
}
.sc-snap-error[hidden] { display: none; }
.sc-snap-error__icon { display: inline-flex; flex-shrink: 0; color: #e26464; }

/* Cancel: dim + non-interactive while a save is in flight */
.sc-snap-cancel-locked .sc-snap-cancel {
    opacity: 0.3;
    pointer-events: none;
}
.sc-snap-cancel { transition: opacity 160ms ease; }

/* Save button base — keep transitions on color only (cheap) */
.sc-snap-save {
    position: relative;
    min-width: 104px;
    padding-left: 14px !important;
    padding-right: 14px !important;
    transition:
        background-color 320ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 180ms ease;
    overflow: hidden;
}
.sc-snap-save[disabled] { cursor: default; }

/* Spinner + check are layered so state changes do not shift the label. */
.sc-snap-save__spinner,
.sc-snap-save__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    width: 0;
    height: 14px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transform: scale(0.86);
    transition:
        width 220ms cubic-bezier(0.22, 1, 0.36, 1),
        margin-right 220ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 260ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.sc-snap-save__spinner svg { animation: scSnapSpin 0.9s linear infinite; }
@keyframes scSnapSpin { to { transform: rotate(360deg); } }

/* Label fades between states */
.sc-snap-save__label,
.sc-mods-editor__save-label {
    display: inline-block;
    transform: translateX(0);
    transition:
        opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- State: SAVING --- */
.sc-snap-save.is-saving {
    background: #B83A39;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(184, 58, 57, 0.18);
}
.sc-snap-save.is-saving .sc-snap-save__spinner {
    width: 14px;
    margin-right: 5px;
    opacity: 1;
    transform: scale(1);
}
.sc-snap-save.is-saving .sc-snap-save__label,
.sc-snap-save.is-saving .sc-mods-editor__save-label,
.sc-snap-save.is-success .sc-snap-save__label,
.sc-snap-save.is-success .sc-mods-editor__save-label {
    transform: translateX(0);
}

/* --- State: SUCCESS --- */
.sc-snap-save.is-success {
    background: #1D9E75;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10), 0 8px 18px rgba(29, 158, 117, 0.18);
}
.sc-snap-save.is-success .sc-snap-save__check {
    width: 14px;
    margin-right: 5px;
    opacity: 1;
    transform: scale(1);
}

/* --- State: ERROR --- */
.sc-snap-save.is-error { background: #e2554b; }

/* Modal dismiss — transform + opacity only */
.sc-mods-editor-dialog.sc-snap-dismissing {
    transition: transform 200ms ease-out, opacity 200ms ease-out;
    transform: scale(0.98);
    opacity: 0;
}
.sc-mods-editor-dialog.sc-snap-dismissing-fade {
    transition: opacity 200ms ease-out;
    opacity: 0;
}

/* Reduced motion — cross-fade only, no slide / scale-in */
@media (prefers-reduced-motion: reduce) {
    .sc-snap-save__spinner,
    .sc-snap-save__check,
    .sc-snap-save__label,
    .sc-mods-editor__save-label,
    .sc-snap-save { transition-duration: 80ms; }
    .sc-mods-editor-dialog.sc-snap-dismissing {
        transition: opacity 200ms ease-out;
        transform: none;
    }
}
