ui-field,
cso-field {
    --cso-teal-100: #D6EDF4;
    --cso-teal-600: #008CBA;
    --cso-ink: #0f172a;
    --cso-muted: #64748b;
    --cso-hint: #94a3b8;
    --cso-border: #e2e8f0;
    --cso-control-bg: #43ac6a0a;
    --cso-control-bg-hover: #43ac6a12;
    --cso-control-bg-focus: #ffffff;
    --cso-control-bg-readonly: #f8fafc;
    --cso-control-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    --cso-control-border-hover: rgba(0, 140, 186, 0.35);
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

ui-field > .field-label,
cso-field > .field-label {
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--cso-ink, #0f172a);
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
}

.field-label-row > .field-label,
.field-label-row > .markup-text-editor-label {
    margin: 0;
}

.field-guidance-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid rgba(2, 140, 186, 0.42);
    border-radius: 999px;
    background: #ffffff;
    color: #036784;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.field-guidance-button:hover,
.field-guidance-button:focus-visible {
    border-color: #028cba;
    outline: 2px solid rgba(2, 140, 186, 0.18);
    outline-offset: 1px;
}

ui-field > .field-help,
cso-field > .field-help {
    color: var(--cso-muted, #64748b);
    font-size: 0.82rem;
    line-height: 1.35;
}

ui-field > .field-error,
cso-field > .field-error {
    color: #b4232c;
    font-size: 0.82rem;
    line-height: 1.35;
}

ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
ui-field select,
ui-field textarea,
ui-field .form-control,
ui-field .form-select,
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
cso-field select,
cso-field textarea,
cso-field .form-control,
cso-field .form-select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--cso-border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--cso-ink, #0f172a);
    background-color: #ffffff;
    box-shadow: var(--cso-control-shadow, inset 0 1px 2px rgba(15, 23, 42, 0.06));
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not(:disabled):not([readonly]),
ui-field select:not(:disabled),
ui-field textarea:not(:disabled):not([readonly]),
ui-field .form-control:not(:disabled):not([readonly]),
ui-field .form-select:not(:disabled),
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not(:disabled):not([readonly]),
cso-field select:not(:disabled),
cso-field textarea:not(:disabled):not([readonly]),
cso-field .form-control:not(:disabled):not([readonly]),
cso-field .form-select:not(:disabled) {
    background-color: var(--cso-control-bg, #43ac6a0a);
}

ui-field select,
ui-field .form-select,
cso-field select,
cso-field .form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
}

ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
ui-field select,
ui-field .form-select,
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
cso-field select,
cso-field .form-select {
    height: 40px;
}

ui-field textarea,
ui-field textarea.form-control,
cso-field textarea,
cso-field textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

ui-field input::placeholder,
ui-field textarea::placeholder,
ui-field .form-control::placeholder,
cso-field input::placeholder,
cso-field textarea::placeholder,
cso-field .form-control::placeholder {
    color: var(--cso-hint, #94a3b8);
}

ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not(:disabled):not([readonly]):hover,
ui-field select:not(:disabled):hover,
ui-field textarea:not(:disabled):not([readonly]):hover,
ui-field .form-control:not(:disabled):not([readonly]):hover,
ui-field .form-select:not(:disabled):hover,
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not(:disabled):not([readonly]):hover,
cso-field select:not(:disabled):hover,
cso-field textarea:not(:disabled):not([readonly]):hover,
cso-field .form-control:not(:disabled):not([readonly]):hover,
cso-field .form-select:not(:disabled):hover {
    background-color: var(--cso-control-bg-hover, #43ac6a12);
    border-color: var(--cso-control-border-hover, rgba(0, 140, 186, 0.35));
}

ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([readonly]):focus,
ui-field select:focus,
ui-field textarea:not([readonly]):focus,
ui-field .form-control:not([readonly]):focus,
ui-field .form-select:focus,
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([readonly]):focus,
cso-field select:focus,
cso-field textarea:not([readonly]):focus,
cso-field .form-control:not([readonly]):focus,
cso-field .form-select:focus {
    outline: none;
    border-color: var(--cso-teal-600, #008CBA);
    background-color: var(--cso-control-bg-focus, #ffffff);
    box-shadow: var(--cso-control-shadow, inset 0 1px 2px rgba(15, 23, 42, 0.06)), 0 0 0 4px var(--cso-teal-100, #D6EDF4);
}

ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):disabled,
ui-field select:disabled,
ui-field textarea:disabled,
ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"])[readonly],
ui-field textarea[readonly],
ui-field .form-control:disabled,
ui-field .form-control[readonly],
ui-field .form-select:disabled,
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):disabled,
cso-field select:disabled,
cso-field textarea:disabled,
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"])[readonly],
cso-field textarea[readonly],
cso-field .form-control:disabled,
cso-field .form-control[readonly],
cso-field .form-select:disabled {
    background-color: var(--cso-control-bg-readonly, #f8fafc) !important;
    color: var(--cso-muted, #64748b);
    box-shadow: none;
    border-color: rgba(148, 163, 184, 0.35);
    background-image: none;
}

ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"])[readonly],
ui-field textarea[readonly],
ui-field .form-control[readonly],
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"])[readonly],
cso-field textarea[readonly],
cso-field .form-control[readonly] {
    cursor: default;
}

ui-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):disabled,
ui-field select:disabled,
ui-field textarea:disabled,
ui-field .form-control:disabled,
ui-field .form-select:disabled,
cso-field input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):disabled,
cso-field select:disabled,
cso-field textarea:disabled,
cso-field .form-control:disabled,
cso-field .form-select:disabled {
    cursor: not-allowed;
}
