/* One calm form surface, with a single scroll area and persistent actions. */
#prompt-dialog {
  --editor-ink: #252629;
  --editor-muted: #65666d;
  --editor-line: #e8e8eb;
  --editor-soft: #f6f6f7;
  width: min(860px, calc(100% - 40px));
  height: min(900px, calc(100dvh - 40px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--editor-line);
  border-radius: 20px;
  background: #fff;
  color: var(--editor-ink);
  box-shadow: 0 24px 80px rgb(0 0 0 / 16%);
}
#prompt-dialog::backdrop { background: rgb(24 24 27 / 30%); backdrop-filter: blur(3px); }
#prompt-form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}
#prompt-dialog .modal-heading {
  align-items: flex-start;
  padding: 26px 36px 20px;
  border-bottom: 0;
  background: #fff;
}
#prompt-dialog .modal-heading > div { min-width: 0; }
#prompt-dialog .modal-heading .eyebrow { display: none; }
#prompt-dialog .modal-heading h2 { color: var(--editor-ink); font-size: 23px; font-weight: 600; letter-spacing: -.6px; line-height: 1.3; margin: 0 0 6px; }
#prompt-editor-intro { color: var(--editor-muted); font-size: 13px; line-height: 1.55; }
#prompt-dialog .modal-heading .icon-button { margin: -3px -7px 0 10px; min-width: 36px; min-height: 36px; }
.prompt-editor-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 0 36px;
  border-bottom: 1px solid var(--editor-line);
  background: #fff;
}
.prompt-editor-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 47px;
  padding: 10px 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  color: var(--editor-muted);
  background: transparent;
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
}
.prompt-editor-nav button > span:first-child { display: none; }
.prompt-editor-nav button:hover { color: var(--editor-ink); border-bottom-color: #c6c6cb; }
.prompt-editor-nav button[aria-current="step"] { color: var(--editor-ink); border-bottom-color: var(--editor-ink); font-weight: 650; }
#prompt-dialog :is(button, a, summary):focus-visible { outline: 2px solid #888991; outline-offset: 3px; }
#prompt-dialog .prompt-editor-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding-block: 24px;
  padding: 32px 36px 40px;
}
.prompt-editor-section {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.prompt-editor-section + .prompt-editor-section { margin-top: 36px; padding-top: 32px; border-top: 1px solid var(--editor-line); }
.prompt-section-heading { display: flex; align-items: flex-start; margin-bottom: 24px; }
.prompt-section-heading > div { min-width: 0; }
.prompt-section-number { display: none; }
#prompt-dialog .prompt-section-heading h3 { font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.25px; color: var(--editor-ink); margin: 0 0 5px; }
.prompt-section-heading h3:focus { outline: none; }
.prompt-section-heading h3:focus-visible { outline: 2px solid #888991; outline-offset: 4px; border-radius: 2px; }
.prompt-section-heading p { font-size: 13px; line-height: 1.6; color: var(--editor-muted); margin: 0; }
.prompt-section-content { min-width: 0; }
#prompt-dialog label { color: var(--editor-ink); font-size: 13px; line-height: 1.55; margin-bottom: 22px; }
#prompt-dialog label:last-child { margin-bottom: 0; }
#prompt-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
#prompt-dialog select, #prompt-dialog textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 11px 13px; margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--editor-ink); background: #fff; border-color: #dcdce1; border-radius: 9px; box-shadow: 0 1px 2px rgb(0 0 0 / 2%); }
#prompt-dialog input:focus, #prompt-dialog select:focus, #prompt-dialog textarea:focus { border-color: #92939c; outline: 2px solid #d9d9df; outline-offset: 1px; }
#prompt-dialog input::placeholder, #prompt-dialog textarea::placeholder { color: #777880; }
#prompt-dialog textarea { resize: vertical; min-height: 136px; }
#prompt-dialog .field-hint { font-size: 12px; line-height: 1.7; color: var(--editor-muted); overflow-wrap: anywhere; }
#prompt-dialog label > .field-hint { display: block; margin-top: 7px; }
#prompt-dialog p, #prompt-dialog label > span, #prompt-dialog summary { overflow-wrap: anywhere; }
.prompt-project-intro { padding: 0; margin-bottom: 24px; background: transparent; }
#prompt-dialog .prompt-project-intro label { margin: 0; }
#prompt-dialog .prompt-suggestion-action { margin: 2px 0 0; }
#prompt-dialog .prompt-suggestion-button { width: auto; justify-content: flex-start; padding: 8px 11px; gap: 8px; font-size: 12px; }
#prompt-dialog .prompt-suggestion-button:disabled { color: var(--editor-muted); background: #fff; border-color: var(--editor-line); }
#prompt-dialog .coming-soon-badge { color: var(--editor-muted); background: #efeff1; border-color: #e4e4e7; font-size: 10px; }
#prompt-dialog fieldset { min-width: 0; }
#prompt-dialog .model-choice-fieldset { border: 0; padding: 0; margin: 0 0 23px; }
#prompt-dialog .model-choice-fieldset > legend { color: var(--editor-ink); font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
#model-choices { margin-top: 17px; }
#prompt-dialog .model-provider-group { padding: 0; margin: 0; border: 0; border-bottom: 1px solid var(--editor-line); border-radius: 0; background: #fff; overflow: hidden; }
#prompt-dialog .model-provider-group > summary { color: var(--editor-ink); padding: 16px 0; margin: 0; background: transparent; font-size: 13px; }
#prompt-dialog .model-provider-group > summary small { color: var(--editor-muted); }
#prompt-dialog .model-provider-group[open] > summary { border-bottom: 0; }
#prompt-dialog .model-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 0 16px; margin: 0; }
#prompt-dialog .model-choice { min-width: 0; margin: 0; padding: 12px; color: var(--editor-ink); background: #fff; border: 1px solid var(--editor-line); border-radius: 8px; line-height: 1.6; }
#prompt-dialog .model-choice:has(input:checked) { background: var(--editor-soft); border-color: #9899a1; }
#prompt-dialog .model-choice > span { min-width: 0; overflow-wrap: anywhere; }
#prompt-dialog .model-choice input { flex: 0 0 auto; accent-color: var(--editor-ink); }
#prompt-dialog .model-choice{display:flex;align-items:flex-start;gap:10px;padding:13px}
#prompt-dialog .model-choice input{margin-top:4px}
#prompt-dialog .model-choice-content{display:block;flex:1;min-width:0}
#prompt-dialog .model-choice-name{display:flex;align-items:center;gap:6px;min-width:0;color:#222934;line-height:1.5}
#prompt-dialog .model-choice-name strong{font-size:13px;font-weight:600;min-width:0;overflow-wrap:anywhere}
#prompt-dialog .model-choice-name .provider-icon{float:none;margin:0;flex:0 0 18px;width:18px;height:18px}
#prompt-dialog .model-choice-meta{display:block;margin-top:6px;font-size:10px;line-height:1.65;color:#606978;white-space:normal;overflow-wrap:anywhere}
#prompt-dialog .model-default-note{display:inline-block;margin-top:6px;font-size:9px;color:#555f6f;background:#eef0f4;border-radius:4px;padding:1px 5px}
#prompt-dialog .model-category{margin:0 0 12px;border:1px solid #e3e5e9;border-radius:9px;background:#fff;overflow:hidden}
#prompt-dialog .model-category>summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:11px 13px;cursor:pointer;font-size:11px;font-weight:600;color:#455063;background:#fafbfc;list-style:none}
#prompt-dialog .model-category>summary small{font-size:10px;font-weight:400;color:#667083;margin-left:auto}
#prompt-dialog .model-category>summary::after{content:'+';font-size:15px;color:#697384}
#prompt-dialog .model-category[open]>summary::after{content:'−'}
#prompt-dialog .model-category>summary:focus-visible{outline:2px solid #8793a6;outline-offset:-3px}
#prompt-dialog .model-category .model-choice-grid{padding:10px;margin:0;border-top:1px solid #e9ebef}
#prompt-dialog #model-selection-note { margin: 12px 0 0; }
#prompt-dialog .search-options, #prompt-dialog .merchant-option { padding: 20px 0 0; margin: 22px 0 0; background: transparent; border: 0; border-top: 1px solid var(--editor-line); border-radius: 0; }
#prompt-dialog .search-options:has([name="web_search_enabled"]:checked),
#prompt-dialog .merchant-option:has([name="merchant_extraction_enabled"]:checked) { border-color: var(--editor-line); background: transparent; }
#prompt-dialog .checkbox-row { gap: 11px; align-items: flex-start; margin: 14px 0; }
#prompt-dialog .checkbox-row input { width: 17px; height: 17px; margin: 2px 0 0; flex: 0 0 17px; accent-color: var(--editor-ink); }
#prompt-dialog .search-options > .checkbox-row, #prompt-dialog .merchant-option > .checkbox-row { margin: 0 0 7px; }
#prompt-dialog .prompt-option-cost { margin: 0 0 9px 28px; font-size: 12px; color: var(--editor-muted); }
#prompt-dialog #gemini-search-option { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--editor-line); }
#prompt-dialog .explanation { min-width: 0; margin: 16px 0 0; background: transparent; border: 0; border-radius: 0; }
#prompt-dialog .explanation > summary { color: var(--editor-ink); padding: 10px 0; line-height: 1.6; font-size: 12px; }
#prompt-dialog .explanation[open] > summary { margin-bottom: 12px; }
#prompt-dialog .explanation > p { color: var(--editor-muted); margin: 10px 0 15px; line-height: 1.75; }
#prompt-dialog .method-example { padding: 0 0 0 16px; background: transparent; border: 0; border-left: 2px solid var(--editor-line); }
#prompt-dialog .method-example p + p { margin-top: 13px; }
#prompt-dialog .mode-selector { padding: 0; gap: 12px; margin: 0 0 21px; }
#prompt-dialog .mode-option { margin: 0; min-width: 0; padding: 15px; border-color: var(--editor-line); border-radius: 9px; }
#prompt-dialog .mode-option:has(input:checked) { background: var(--editor-soft); border-color: #9899a1; }
#prompt-dialog .mode-option strong, #prompt-dialog .mode-option > span[data-icon], #prompt-dialog .mode-option:has(input:checked) > span[data-icon] { color: var(--editor-ink); }
#prompt-dialog .mode-option .radio-dot { border-color: #b0b0b7; }
#prompt-dialog .mode-option:has(input:checked) .radio-dot { border-color: var(--editor-ink); }
#prompt-dialog .mode-option > span:not([data-icon]):not(.radio-dot) { min-width: 0; }
#prompt-dialog .mode-option small { color: var(--editor-muted); font-size: 12px; margin-top: 4px; }
#prompt-dialog .simple-info { padding: 18px; margin: 0; color: var(--editor-ink); background: var(--editor-soft); border: 0; border-radius: 10px; gap: 13px; }
#prompt-dialog .simple-info > span { color: var(--editor-muted); }
#prompt-dialog .simple-info > div { min-width: 0; }
#prompt-dialog .simple-info p { color: var(--editor-muted); margin-top: 7px; font-size: 13px; }
#prompt-dialog .schedule-explanation { padding: 0; background: #fff; }
#prompt-dialog .form-section-heading { color: var(--editor-muted); margin-top: 24px; padding-top: 23px; margin-bottom: 18px; border-color: var(--editor-line); }
#prompt-dialog .form-section-heading h3 { color: var(--editor-ink); }
#prompt-dialog #advanced-settings > .form-section-heading:first-child { padding-top: 0; margin-top: 23px; border-top: 0; }
#prompt-dialog .weekday-field { margin: 0 0 22px; padding: 0; }
#prompt-dialog .weekday-field legend, #prompt-dialog .schedule-window-field legend { margin-bottom: 11px; font-size: 13px; }
#prompt-dialog .weekdays { gap: 8px; }
#prompt-dialog .weekdays label, #prompt-dialog .schedule-window-choice { margin: 0; }
#prompt-dialog .weekdays span { padding: 10px 4px; color: var(--editor-muted); border-color: var(--editor-line); border-radius: 8px; }
#prompt-dialog .weekdays input:checked + span { color: var(--editor-ink); background: var(--editor-soft); border-color: #9899a1; }
#prompt-dialog .schedule-window-field { margin: 0; padding: 0; }
#prompt-dialog .schedule-window-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
#prompt-dialog .schedule-window-choice { min-width: 0; padding: 12px 10px; border-color: var(--editor-line); border-radius: 8px; }
#prompt-dialog .schedule-window-choice:has(input:checked) { background: var(--editor-soft); border-color: #9899a1; }
#prompt-dialog .schedule-window-choice input { accent-color: var(--editor-ink); }
#prompt-dialog .schedule-window-choice > span { min-width: 0; }
#prompt-dialog .schedule-window-choice strong { color: var(--editor-ink); font-size: 13px; white-space: normal; }
#prompt-dialog .schedule-window-choice small { color: var(--editor-muted); }
#prompt-dialog .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
#prompt-dialog .form-grid label { margin: 0; min-width: 0; }
#prompt-dialog .prompt-model-parameters { background: transparent; }
#prompt-dialog #model-configurations { padding: 0; }
#prompt-dialog .model-config { margin: 12px 0; padding: 13px 15px; background: var(--editor-soft); border-color: var(--editor-line); }
#prompt-dialog .model-config > summary { color: var(--editor-ink); overflow-wrap: anywhere; line-height: 1.7; }
#prompt-dialog .model-config > summary > span { color: var(--editor-muted); }
#prompt-dialog .model-config > .form-grid { margin-top: 16px; }
#prompt-dialog .prompt-future-field { display: block; padding: 22px 0 0; margin: 22px 0 0; border: 0; border-top: 1px solid var(--editor-line); border-radius: 0; background: transparent; }
#prompt-dialog .prompt-future-field input:disabled { color: var(--editor-muted); -webkit-text-fill-color: var(--editor-muted); background: var(--editor-soft); border-color: var(--editor-line); box-shadow: none; }
#prompt-dialog .prompt-cost-preview { padding: 22px; margin: 0; background: var(--editor-soft); border: 0; border-radius: 12px; }
#prompt-dialog .prompt-cost-preview :is(h3, strong) { color: var(--editor-ink); }
#prompt-dialog .prompt-cost-preview :is(p:not(.form-error), span:not(.money-status), details) { color: var(--editor-muted); }
#prompt-dialog .prompt-cost-preview .money-primary { color: var(--editor-ink); }
#prompt-dialog .prompt-cost-preview .cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#prompt-dialog .prompt-cost-preview .cost-grid > div { min-width: 0; }
#prompt-dialog .prompt-cost-preview strong { overflow-wrap: anywhere; }
#prompt-dialog .cost-disclosure { margin-top: 16px; }
#prompt-dialog .consent-box { margin: 24px 0; padding: 0; background: #fff; border: 0; border-radius: 0; }
#prompt-dialog .consent-box h3 { color: var(--editor-ink); }
#prompt-dialog .consent-box > p { color: var(--editor-muted); margin: 11px 0; font-size: 12px; line-height: 1.8; }
#prompt-dialog .consent-box .checkbox-row { margin-top: 16px; font-size: 13px; }
#prompt-dialog .prompt-activate { padding: 20px 0; border-radius: 0; background: #fff; border: 0; border-block: 1px solid var(--editor-line); margin: 22px 0; }
#prompt-dialog .prompt-activate small { display: block; margin-top: 5px; color: var(--editor-muted); line-height: 1.65; font-size: 12px; }
#prompt-dialog .cost-note { color: var(--editor-muted); margin-top: 18px; padding: 0; background: transparent; border: 0; }
#prompt-dialog .form-error { margin-top: 18px; scroll-margin-block: 24px; }
#prompt-dialog .prompt-editor-footer { padding: 16px 36px; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border-top: 1px solid var(--editor-line); }
.prompt-editor-footer > p { font-size: 11px; line-height: 1.6; max-width: 260px; color: var(--editor-muted); }
.prompt-editor-footer > div { display: flex; gap: 10px; flex-shrink: 0; }
#prompt-dialog .prompt-editor-footer .button { border-radius: 9px; border-color: #dcdce1; }
#prompt-dialog .prompt-editor-footer .button.primary { color: #fff; background: var(--editor-ink); border-color: var(--editor-ink); box-shadow: none; }
#prompt-dialog .prompt-editor-footer .button.primary:hover { background: #414249; border-color: #414249; }

@media (max-width: 760px) {
  #prompt-dialog { width: calc(100% - 24px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); border-radius: 16px; }
  #prompt-dialog .modal-heading { padding: 22px 24px 16px; }
  #prompt-dialog .modal-heading h2 { font-size: 21px; }
  .prompt-editor-nav { padding: 0 24px; gap: 16px; }
  .prompt-editor-nav button { padding: 10px 0 12px; font-size: 12px; }
  .prompt-editor-nav .prompt-nav-extra { display: none; }
  #prompt-dialog .prompt-editor-body { padding: 26px 24px 32px; }
  .prompt-section-heading { margin-bottom: 22px; }
  #prompt-dialog .prompt-section-heading h3 { font-size: 17px; }
  #prompt-dialog .schedule-window-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #prompt-dialog .prompt-editor-footer { padding: 14px 24px; }
  .prompt-editor-footer > p { display: none; }
  .prompt-editor-footer > div { width: 100%; justify-content: flex-end; }
}
@media (max-width: 480px) {
  #prompt-dialog { width: calc(100% - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); border-radius: 14px; }
  #prompt-dialog .modal-heading { padding: 20px 18px 14px; }
  #prompt-dialog .modal-heading h2 { font-size: 20px; }
  #prompt-dialog .modal-heading .eyebrow { font-size: 9px; }
  #prompt-editor-intro { font-size: 12px; }
  .prompt-editor-nav { padding: 0 18px; gap: 12px; }
  .prompt-editor-nav button { min-height: 43px; padding: 10px 0; text-align: center; font-size: 12px; }
  #prompt-dialog .prompt-editor-body { padding: 24px 18px 28px; }
  .prompt-editor-section + .prompt-editor-section { margin-top: 30px; padding-top: 28px; }
  #prompt-dialog .prompt-section-heading h3 { font-size: 16px; }
  .prompt-section-heading p { font-size: 12px; }
  #prompt-dialog .model-choice-grid, #prompt-dialog .form-grid, #prompt-dialog .mode-selector { grid-template-columns: minmax(0, 1fr); }
  #prompt-dialog .model-choice-grid { padding: 0 0 15px; }
  #prompt-dialog .prompt-cost-preview { padding: 17px; }
  #prompt-dialog .prompt-option-cost { margin-left: 0; }
  #prompt-dialog .weekdays { gap: 5px; }
  #prompt-dialog .weekdays span { font-size: 12px; }
  #prompt-dialog .prompt-cost-preview .cost-grid { grid-template-columns: minmax(0, 1fr); }
  #prompt-dialog .estimate-figures { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #prompt-dialog .prompt-editor-footer { padding: 12px 18px; }
  .prompt-editor-footer > div { gap: 8px; }
  #prompt-dialog .prompt-editor-footer .button { padding: 10px 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #prompt-dialog * { scroll-behavior: auto; transition: none; }
}
.model-lifecycle-note{display:block;margin-top:5px;color:#80541d;font-size:10px;line-height:1.6;overflow-wrap:anywhere}
#prompt-dialog .openai-options { margin:18px 0; }
#prompt-dialog .openai-options-body { display:grid; gap:18px; padding-top:18px; min-width:0; }
#prompt-dialog .openai-options-body > :is(p,label,details) { margin:0; }
#prompt-dialog .openai-options-body label { min-width:0; }
#prompt-dialog .openai-options-body .field-hint { display:block; line-height:1.65; overflow-wrap:anywhere; }
#prompt-dialog .openai-options-body textarea { width:100%; max-width:100%; min-height:100px; resize:vertical; }
#prompt-dialog .openai-instruction-preview > label { margin-top:14px; }
#prompt-dialog #openai-instructions-preview { background:var(--editor-soft); color:var(--editor-ink); font-size:12px; line-height:1.6; }
#prompt-dialog .openai-profile { padding:17px; border:1px solid var(--editor-line); background:var(--editor-soft); border-radius:9px; }
#prompt-dialog .openai-profile > p { margin:9px 0; }
#prompt-dialog #openai-profile-status:empty { display:none; }
#prompt-dialog .openai-simple-note { padding:12px 14px; margin:18px 0 0; background:var(--editor-soft); border-radius:8px; }
#prompt-dialog .model-temperature { display:grid; align-content:start; gap:12px; min-width:0; }
#prompt-dialog .model-temperature > :is(label,p) { margin:0; }
#prompt-dialog :is(.openai-options,.openai-simple-note,.model-temperature-value,#openai-instructions-custom,#openai-instructions-tracker)[hidden] { display:none!important; }
@media(max-width:480px) { #prompt-dialog #openai-profile { width:100%; white-space:normal; line-height:1.6; } }
.conversation-input .run-instructions { margin:0 20px 18px; padding:12px 14px; min-width:0; }
.conversation-input .run-instructions .detail-prompt { padding:14px 0; font-size:12px; line-height:1.7; background:transparent; }
