label { display: grid; gap: 7px; color: var(--text-muted); font-size: 13px; font-weight: 800; line-height: 1.25; }
label, input, select, textarea { min-width: 0; }
input, select, textarea { width: 100%; max-width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; background-color: var(--surface); color: var(--text); min-height: 44px; font-size: 16px; color-scheme: var(--control-color-scheme); }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: var(--native-icon-filter); opacity: .9; cursor: pointer; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
select {
    appearance: none;
    -webkit-appearance: none;
    text-overflow: ellipsis;
    padding-right: 44px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 22px) 50%,
        calc(100% - 16px) 50%;
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
}
select:hover,
select:focus { background-image:
        linear-gradient(45deg, transparent 50%, var(--primary) 50%),
        linear-gradient(135deg, var(--primary) 50%, transparent 50%);
}
select::-ms-expand { display: none; }
textarea { resize: vertical; min-height: 110px; }
.password-field { position: relative; display: block; min-width: 0; }
.password-field input { padding-right: 54px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--text-muted); display: grid; place-items: center; cursor: pointer; transition: background var(--duration), color var(--duration), transform var(--duration); }
.password-toggle:hover,
.password-toggle:focus-visible { background: var(--surface-hover); color: var(--primary); }
.password-toggle:active { transform: translateY(-50%) scale(.96); }
.password-toggle svg { width: 19px; height: 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.form-error { min-height: 20px; color: var(--error); margin: 0; font-weight: 750; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.choice-card { grid-column: 1 / -1; display: grid; gap: 10px; border: 1px solid var(--border); border-radius: 16px; padding: 12px; margin: 0; background: var(--surface-hover); min-width: 0; }
.choice-card-title { color: var(--text-muted); font-size: 13px; font-weight: 850; line-height: 1.2; }
.segmented-radio { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.segmented-radio label { position: relative; display: block; color: var(--text); min-width: 0; }
.segmented-radio input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented-radio span { min-height: 46px; width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; font-weight: 900; line-height: 1.15; text-align: center; overflow-wrap: anywhere; transition: background var(--duration), border-color var(--duration), color var(--duration), box-shadow var(--duration); }
.segmented-radio input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 10px 22px color-mix(in srgb, var(--primary), transparent 72%); }
.segmented-radio input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary), transparent 70%); outline-offset: 2px; }
.segmented-radio svg { width: 18px; height: 18px; }
.remember-choice { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-hover); color: var(--text); cursor: pointer; }
.remember-choice input { width: 22px; height: 22px; min-height: 22px; padding: 0; accent-color: var(--primary); }
.remember-choice strong, .remember-choice small { display: block; min-width: 0; overflow-wrap: anywhere; }
.remember-choice strong { font-size: 14px; font-weight: 900; line-height: 1.15; }
.remember-choice small { margin-top: 3px; color: var(--text-muted); font-size: 12px; font-weight: 750; line-height: 1.2; }
.range-row { display: grid; grid-template-columns: 1fr 54px; gap: 12px; align-items: center; }
input[type="range"] { padding: 0; }
.file-input-hidden { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; inset: auto auto 0 0; }
.modal-actions { position: sticky; bottom: -22px; background: var(--surface); padding-top: 14px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

@media (max-width: 560px) {
    label { gap: 6px; font-size: 12px; }
    input, select, textarea { min-height: 48px; border-radius: 14px; padding: 12px; font-size: 16px; }
    select { padding-right: 42px; background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%; }
    textarea { min-height: 128px; }
    .password-field input { padding-right: 52px; }
    .password-toggle { width: 42px; height: 42px; min-height: 42px; right: 4px; border-radius: 13px; }
    .form-grid { gap: 12px; }
    .choice-card { padding: 11px; border-radius: 15px; }
    .segmented-radio span { min-height: 48px; }
    .range-row { grid-template-columns: minmax(0, 1fr) 48px; gap: 9px; }
    .modal-actions { justify-content: stretch; }
}

@media (max-width: 340px) {
    input, select, textarea { padding-inline: 10px; }
    select { padding-right: 38px; background-position: calc(100% - 19px) 50%, calc(100% - 13px) 50%; }
    .segmented-radio { grid-template-columns: 1fr; }
}
