/* Detection form only: keep the existing homepage, gallery and pipeline layout. */
#test-form { gap: 14px; }
#test-form label, #test-form .form-reasoning-label { font-size: 12px; }
#test-form :is(#base-url, #api-key) { height: 40px; font-size: 14px; }
#test-form .form-label-hint { font-weight: 400; color: var(--muted); margin-left: 4px; }
#test-form .secret-field button { top: 5px; right: 0; width: 40px; height: 40px; }
#test-form #api-key { padding-right: 40px; }
#test-form .form-key-note { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 11px; }
#test-form .form-key-note button { min-height: 24px; text-align: left; }
#test-form .model-control { gap: 8px; }
#test-form .model-select { min-height: 40px; font-size: 13px; }
#test-form .form-reasoning-label { width: 90px; text-align: center; }
#test-form .reasoning-trigger { min-width: 90px; min-height: 40px; justify-content: center; font-size: 12px; }
#test-form .form-topic { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 9px; text-align: left; background: #f8faff; }
#test-form .form-topic:hover { border-color: #9db2ef; }
#test-form .form-topic-heading { display: flex; justify-content: space-between; gap: 8px; width: 100%; font-size: 11px; color: var(--muted); }
#test-form .form-topic-change { color: var(--blue); }
#test-form #topic-summary { font-size: 14px; }
#test-form #topic-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 11px; line-height: 1.6; color: #64748b; }
#test-form .form-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
#test-form .form-settings-row button { min-height: 28px; }
#test-form #settings-count { font-size: 10px; color: #64748b; }
#test-form .form-config-summary { margin-top: -10px; color: #64748b; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#test-form .publication-notice { margin: 0; padding: 0; border: 0; background: none; font-size: 10px; line-height: 1.7; color: #64748b; }
#test-form .start-button { min-height: 44px; font-size: 14px; }
#test-form .form-note { font-size: 10px; line-height: 1.7; }
.form-dialog { width: min(580px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 24px; overflow-y: auto; overscroll-behavior: contain; }
.form-dialog .dialog-heading { position: sticky; top: -24px; z-index: 2; margin-bottom: 12px; padding-block: 8px; background: #fff; border-bottom: 1px solid var(--line); }
.form-dialog .form-panel-intro { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.form-dialog .form-panel-error { padding: 10px 12px; margin-bottom: 12px; border-radius: 6px; background: #fff1f0; color: #a33434; font-size: 13px; }
.form-dialog .form-settings-group { display: grid; gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.form-dialog h3 { font-size: 15px; }
.form-dialog label, .form-dialog legend { display: block; font-size: 13px; font-weight: 600; }
.form-dialog :is(input, select, textarea) { width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fff; font-size: 14px; line-height: 1.6; font-weight: 400; }
.form-dialog :is(input, select) { min-height: 42px; }
.form-dialog :is(small, .prompt-note) { display: block; font-size: 11px; line-height: 1.7; font-weight: 400; color: #64748b; margin-top: 6px; }
.form-dialog .advanced { margin: 0; border: 0; }
.form-dialog .advanced-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 0; }
.form-dialog :is(.connection-memory, .creative-switch) label { display: flex; align-items: center; gap: 8px; }
.form-dialog input[type=checkbox] { width: 17px; height: 17px; min-height: 17px; margin: 0; padding: 0; flex: 0 0 17px; accent-color: var(--blue); }
.form-dialog .text-button { justify-self: start; min-height: 32px; font-size: 12px; text-align: left; }
.form-dialog .output-budget { border: 0; margin: 0; }
.form-dialog .output-budget summary { font-size: 13px; padding: 0 0 8px; }
.form-dialog .output-presets button { min-height: 36px; font-size: 12px; }
.form-dialog .form-panel-actions { position: sticky; bottom: -24px; margin-top: 8px; padding: 14px 0; background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.form-dialog .form-panel-actions p { font-size: 11px; color: var(--muted); }
.form-dialog .form-panel-actions .primary { min-height: 44px; white-space: nowrap; }
.form-dialog .form-topic-body { display: grid; gap: 14px; }
.form-dialog .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-dialog .theme { min-height: 44px; flex-direction: row; justify-content: center; font-size: 12px; }
.form-dialog .theme-icon { font-size: 20px; }
.form-dialog .creative-switch { gap: 8px; }
.form-dialog .creative-help { width: 26px; height: 26px; }
.form-dialog #prompt { height: 200px; resize: vertical; min-height: 140px; line-height: 1.8; }
.form-dialog .prompt-note { margin-top: -10px; }
:is(#test-form, .form-dialog) [aria-invalid=true] { border-color: #c54747; }
@media (max-width: 540px) {
  #test-form :is(#base-url, #api-key, #model-search), .form-dialog :is(input, select, textarea) { font-size: 16px; }
  .form-dialog { padding: 18px; }
  .form-dialog .dialog-heading { top: -18px; }
  .form-dialog .form-panel-actions { bottom: -18px; }
}
