/* Composite fields own their focus ring; inner currency/quantity inputs stay flush. */
@layer throne-inputs {
html[data-throne-theme="dark"] body :is(.throne-main, .tr-dialog, .tr-drawer, .direct-merge-dialog, body > dialog) :is(
    input:not([type]), input[type="text"], input[type="number"], input[type="email"],
    input[type="password"], input[type="search"], input[type="url"], input[type="tel"],
    input[type="date"], input[type="datetime-local"], input[type="time"], textarea, select
):where(:not(.smooth-select-search-input):not(.throne-smooth-select-native):not(.cfg-code-editor #description)) {
    background-color: var(--throne-input-bg) !important;
    border-color: #505050 !important;
    caret-color: var(--throne-text-primary);
}

html[data-throne-theme="dark"] body :is(.throne-main, .tr-dialog, .tr-drawer, .direct-merge-dialog, body > dialog) :is(
    input:not([type]), input[type="text"], input[type="number"], input[type="email"],
    input[type="password"], input[type="search"], input[type="url"], input[type="tel"],
    input[type="date"], input[type="datetime-local"], input[type="time"], textarea, select
):where(:not(.smooth-select-search-input):not(.throne-smooth-select-native)):focus {
    border-color: var(--throne-text-primary) !important;
    outline: 2px solid var(--throne-focus-ring) !important;
    outline-offset: 1px;
    box-shadow: none !important;
}

html[data-throne-theme="dark"] body :is(.throne-main, .tr-dialog, .tr-drawer, .direct-merge-dialog, body > dialog) :is(
    input:not([type]), input[type="text"], input[type="number"], input[type="email"],
    input[type="password"], input[type="search"], input[type="url"], input[type="tel"],
    input[type="date"], input[type="datetime-local"], input[type="time"], textarea, select
):where(:not(.smooth-select-search-input):not(.throne-smooth-select-native)):is(:disabled, [readonly]) {
    background-color: var(--throne-surface-muted) !important;
    color: var(--throne-text-muted) !important;
    border-color: var(--throne-border) !important;
}

html[data-throne-theme="dark"] body :is(
    .lv-price:has(input), .bulk-price-adjust, .inventory-review-price-control,
    .inventory-inline-price-input-wrap
) {
    background: var(--throne-input-bg) !important;
    border-color: #505050 !important;
}

html[data-throne-theme="dark"] body .inventory-location-quantity-control {
    border-radius: 8px;
}

html[data-throne-theme="dark"] body :is(
    .lv-price:has(input), .bulk-price-adjust, .inventory-review-price-control,
    .inventory-inline-price-input-wrap, .inventory-location-quantity-control
):focus-within {
    border-color: var(--throne-text-primary) !important;
    outline: 2px solid var(--throne-text-primary) !important;
    outline-offset: 2px;
    box-shadow: none !important;
}

html[data-throne-theme="dark"] body :is(.throne-main, .tr-dialog, .tr-drawer, .direct-merge-dialog, body > dialog) :is(
    .lv-price, .bulk-price-adjust, .inventory-review-price-control, .inventory-inline-price-input-wrap
) input {
    background: transparent !important;
    border-color: transparent !important;
    border-radius: 0;
}

html[data-throne-theme="dark"] body :is(.throne-main, .tr-dialog, .tr-drawer, .direct-merge-dialog, body > dialog) :is(
    .lv-price, .bulk-price-adjust, .inventory-review-price-control,
    .inventory-inline-price-input-wrap, .inventory-location-quantity-control
):focus-within input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Stepper buttons retain their own keyboard indicator within the focused group. */
html[data-throne-theme="dark"] body .inventory-location-quantity-control button:focus-visible {
    outline-offset: -4px;
}

html[data-throne-theme="dark"] body :is(.throne-main, .tr-dialog, .tr-drawer, .direct-merge-dialog, body > dialog) :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):where(:not(.smooth-select-search-input):not(.throne-smooth-select-native)):is([aria-invalid="true"], .is-invalid, .error) {
    border-color: var(--throne-status-danger-text) !important;
}

html[data-throne-theme="dark"] body :is(
    .lv-price, .bulk-price-adjust, .inventory-review-price-control,
    .inventory-inline-price-input-wrap, .inventory-location-quantity-control
):has(input:is([aria-invalid="true"], .is-invalid, .error)) {
    border-color: var(--throne-status-danger-text) !important;
    outline-color: var(--throne-status-danger-text) !important;
}
}
