


/* AI Design Space shared form-control primitives.
   Specialized editors may keep tool-specific controls, but ordinary application
   forms should compose these classes instead of defining local theme colors.
*/

.aidc-field {
  display: grid;
  gap: 6px;
}

.aidc-field__label {
  color: var(--aidc-text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.aidc-control {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--aidc-border-default);
  border-radius: var(--aidc-radius-control);
  outline: none;
  background: var(--aidc-bg-elevated);
  color: var(--aidc-text-primary);
  font: inherit;
  font-size: var(--aidc-font-size-body, 14px);
  line-height: 1.35;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

textarea.aidc-control {
  min-height: 96px;
  resize: vertical;
}

.aidc-control::placeholder {
  color: var(--aidc-text-muted);
  opacity: 0.82;
}

.aidc-control:hover:not(:disabled):not([readonly]) {
  border-color: var(--aidc-border-strong);
}

.aidc-control:focus,
.aidc-control:focus-visible {
  border-color: var(--aidc-action-focus);
  box-shadow: 0 0 0 3px var(--aidc-action-focus-ring);
}

.aidc-control:disabled,
.aidc-control[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}

.aidc-control[readonly] {
  background: var(--aidc-bg-panel);
  color: var(--aidc-text-secondary);
}

.aidc-control[aria-invalid="true"],
.aidc-control--error {
  border-color: var(--aidc-action-danger-border);
  box-shadow: 0 0 0 3px var(--aidc-action-danger-glow);
}

.aidc-field__hint {
  color: var(--aidc-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.aidc-field__error {
  color: var(--aidc-red-500);
  font-size: 12px;
  line-height: 1.35;
}

/* Native select decoration only. The enhanced dropdown wrapper is also named
   .aidc-select and is owned by design-system/components/dropdowns.css; styling
   that wrapper here used to reserve a 34px gutter beside its button. */
select.aidc-select {
  appearance: none;
  padding-right: 34px;
  background-color: var(--aidc-bg-elevated);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--aidc-text-muted) 50%),
    linear-gradient(135deg, var(--aidc-text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.aidc-control-group {
  display: flex;
  align-items: stretch;
}

.aidc-control-group > .aidc-control:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.aidc-control-group > .aidc-control:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}


.kling4-materials { display: grid; gap: 12px; min-width: 0; color: var(--aidc-text-primary); }
.kling4-materials__help { color: var(--aidc-text-secondary); font-size: 13px; line-height: 1.5; }
.kling4-materials__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; padding: 12px; border: 1px solid var(--aidc-border-default); border-radius: 12px; }
.kling4-materials__row > span { grid-column: 1 / -1; overflow-wrap: anywhere; }
.kling4-materials__row .aidc-field { min-width: 0; align-content: start; }
.kling4-materials__row-hint { grid-column: 1 / -1; margin: 0; }
.kling4-materials__row [hidden] { display: none; }
.aidc-kling4-active .ms-field[hidden] { display: none; }
.aidc-kling4-active .refp-reference-guide { display: none !important; }
.kling4-materials__assignments > summary { cursor: pointer; color: var(--aidc-text-secondary); font-size: 13px; }
.kling4-materials__assignments[open] > .kling4-materials__row { margin-top: 8px; }
