/* Prompt builder. Icons use the Heroicons v2.2.0 license in index.html. */
body:has(.prompt-editor-dialog[open]) { overflow: hidden; }
.signed-out #prompts-view { display: none !important; }
.prompt-page { min-height: min(680px, calc(100dvh - 235px)); display: flex; flex-direction: column; gap: 24px; padding-bottom: 6px; }
.prompt-content { display: flex; flex-direction: column; gap: 27px; }
.prompt-section { min-width: 0; }
.prompt-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.prompt-section-heading h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; line-height: 1.5; font-weight: 650; color: #292c46; text-wrap: balance; }
.prompt-section-heading label { cursor: text; }
.prompt-optional { color: #746981; font-size: 12px; font-weight: 450; }
.prompt-section-note { color: #746981; font-size: 12px; }
.prompt-field-row, .prompt-fixed-row { display: grid; grid-template-columns: minmax(0, 1fr) 236px; align-items: start; gap: 24px; }
.prompt-input-shell { position: relative; min-width: 0; }
.prompt-textarea { display: block; border: 1px solid #dedfea; border-radius: 12px; padding: 18px 20px 65px; background: #fff; font-size: 15px; line-height: 1.95; color: #34374f; box-shadow: 0 2px 5px #37305003; transition: border-color .16s, box-shadow .16s; }
.prompt-topic-textarea { height: 242px; min-height: 190px; }
.prompt-fixed-textarea { height: 292px; min-height: 210px; }
.prompt-textarea::placeholder { color: #786e87; }
.prompt-textarea:disabled { background: #fafafe; color: #7f8497; cursor: wait; }
.prompt-textarea:hover:not(:disabled) { border-color: #a39be4; }
.prompt-textarea:focus { border-color: #9588ee; box-shadow: 0 0 0 3px #9383ed13; outline: none; }
.prompt-expand-button { position: absolute; right: 13px; bottom: 13px; min-height: 40px; gap: 7px; padding: 8px 12px; border: 1px solid #e2ddf9; border-radius: 8px; background: #faf9ff; color: #6b5cba; font-size: 12px; font-weight: 550; transition: background-color .16s, border-color .16s, transform .16s; }
.prompt-expand-button:hover:not(:disabled) { background: #f1edff; border-color: #c0b4ef; }
.prompt-expand-button:disabled { background: #f4f4f9; color: #9b9bad; border-color: #e8e7ef; }
.prompt-icon { width: 19px; height: 19px; flex: none; stroke-width: 1.65; }
.prompt-help { min-width: 0; padding: 18px 18px 17px; border-radius: 12px; background: #f0eff8; color: #6f6c82; }
.prompt-help-icon { display: flex; margin-bottom: 10px; color: #9585c7; }
.prompt-help-icon .prompt-icon { width: 21px; height: 21px; }
.prompt-help h3 { margin: 0 0 8px; color: #625976; font-size: 13px; font-weight: 600; line-height: 1.7; }
.prompt-help p { font-size: 12px; line-height: 1.85; margin: 0; text-wrap: pretty; }
.prompt-help .prompt-help-foot { margin-top: 12px; padding-top: 11px; border-top: 1px solid #e5e1f1; color: #746981; }
.prompt-fixed-panel { min-width: 0; border: 1px solid #e1dfec; border-radius: 12px; background: #fff; box-shadow: 0 2px 5px #37305003; }
.prompt-fixed-summary { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 87px; padding: 18px 20px; cursor: pointer; list-style: none; border-radius: 12px; transition: background-color .16s; }
.prompt-fixed-summary::-webkit-details-marker { display: none; }
.prompt-fixed-summary:hover { background: #fbfaff; }
.prompt-fixed-heading { display: flex; align-items: center; gap: 13px; min-width: 0; }
.prompt-fixed-heading > .prompt-icon { color: #8878c4; width: 23px; height: 23px; }
.prompt-fixed-heading strong { display: block; color: #38334f; font-size: 16px; line-height: 1.5; font-weight: 600; }
.prompt-fixed-heading small { display: block; margin-top: 4px; color: #766c84; font-size: 12px; line-height: 1.6; }
.prompt-fold-action { display: flex; align-items: center; gap: 7px; color: #7560be; font-size: 12px; font-weight: 550; flex: none; }
.prompt-fold-icon { width: 17px; height: 17px; transition: transform .16s; }
.prompt-fixed-panel[open] .prompt-fold-icon { transform: rotate(180deg); }
.prompt-fixed-panel[open] .prompt-fixed-summary { border-radius: 12px 12px 0 0; }
.prompt-fixed-editor { padding: 0 17px 17px; }
.prompt-field-label { display: block; margin: 0 0 9px; color: #766c84; font-size: 12px; line-height: 1.6; }
.prompt-fixed-help { background: transparent; padding-top: 4px; }
.prompt-fixed-help .prompt-help-foot { border-top-color: #e8e4ef; }
.prompt-guide-button { display: inline-flex; align-items: center; justify-content: flex-start; gap: 9px; min-height: 40px; border: 0; padding: 7px 0; margin-top: 7px; background: transparent; color: #7660ba; font-size: 12px; line-height: 1.6; text-align: left; }
.prompt-guide-button:hover { color: #52409b; }
.prompt-bottom { margin-top: auto; }
.prompt-action-bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 26px; border-top: 1px solid #dedfea; }
.prompt-state { display: flex; align-items: center; gap: 13px; min-width: 0; }
.prompt-state-icon { display: grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 50%; background: #e8e3fa; color: #8472c8; }
.prompt-state-icon .prompt-icon { width: 23px; height: 23px; }
.prompt-state strong { display: block; color: #45405e; font-size: 14px; font-weight: 600; line-height: 1.6; }
.prompt-state p { margin: 3px 0 0; color: #746981; font-size: 12px; line-height: 1.7; text-wrap: pretty; }
.prompt-state.dirty .prompt-state-icon { background: #fff0dd; color: #bd8b43; }
.prompt-state.dirty strong { color: #876332; }
.prompt-state.error .prompt-state-icon { background: #fbe9e8; color: #b2766f; }
.prompt-state.error strong { color: #98594f; }
.prompt-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.prompt-save-button, .prompt-copy-button { min-height: 46px; min-width: 142px; padding: 12px 23px; border-radius: 9px; font-size: 13px; transition: background-color .16s, border-color .16s, box-shadow .16s, transform .16s; }
.prompt-save-button { border: 1px solid #bdb3e7; background: transparent; color: #7461ba; }
.prompt-save-button:hover:not(:disabled) { background: #f0ecff; border-color: #9c8bd5; }
.prompt-copy-button { min-width: 180px; gap: 11px; background: #6452d9; box-shadow: 0 3px 7px #6551cf14; }
.prompt-copy-button:hover:not(:disabled) { background: #5644c6; box-shadow: 0 4px 11px #6551cf25; }
.prompt-copy-button .prompt-icon { width: 20px; height: 20px; }
.prompt-save-button:disabled { border-color: #dedbea; color: #a09aaa; background: #f5f4f9; }
.prompt-copy-note { margin: 9px 0 0; font-size: 11px; line-height: 1.8; color: #746981; text-align: right; }
.prompt-feedback { font-size: 12px; line-height: 1.8; color: #716584; margin: 15px 0 0; padding: 12px 15px; border-radius: 9px; background: #eeeaf9; overflow-wrap: anywhere; }
.prompt-feedback.error { background: #fff1ec; color: #a45e4d; }
.prompt-load-error { display: flex; align-items: center; gap: 14px; font-size: 13px; line-height: 1.8; color: #9c5d50; padding: 13px 16px; background: #fff1ec; border-radius: 10px; margin: 0; }
.prompt-load-error p { flex: 1; margin: 0; }
.prompt-retry { flex: none; }
.prompt-editor-dialog { padding: 0; margin: auto; width: min(1040px, calc(100vw - 64px)); height: min(670px, calc(100dvh - 80px)); max-width: none; max-height: calc(100dvh - 40px); border: 1px solid #eeebf6; border-radius: 18px; background: #fff; color: #302b48; box-shadow: 0 5px 16px #21194314, 0 28px 90px #21194329; overflow: hidden; overscroll-behavior: contain; }
.prompt-editor-dialog[open] { display: flex; flex-direction: column; }
.prompt-editor-dialog::backdrop { background: #28243c6b; backdrop-filter: blur(2px); }
.prompt-editor-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 27px 30px 20px; flex: none; }
.prompt-editor-heading { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.prompt-editor-heading-icon { width: 30px; height: 30px; flex: none; color: #7962db; margin-top: 3px; }
.prompt-editor-heading h2 { margin: 0; font-size: 22px; line-height: 1.5; font-weight: 650; letter-spacing: -.25px; text-wrap: balance; }
.prompt-editor-heading p { margin: 7px 0 0; color: #746981; font-size: 13px; line-height: 1.8; text-wrap: pretty; }
.prompt-editor-close { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 9px; background: transparent; color: #44365f; margin: -4px -6px 0 0; transition: background-color .16s; }
.prompt-editor-close .prompt-icon { width: 23px; height: 23px; }
.prompt-editor-close:hover { background: #f3f0fa; }
.prompt-editor-body { min-height: 0; flex: 1; display: flex; flex-direction: column; padding: 0 30px 21px; }
.prompt-editor-label { color: #746981; font-size: 12px; line-height: 1.7; margin-bottom: 8px; }
.prompt-editor-input { flex: 1; display: block; min-height: 100px; height: 100%; resize: none; padding: 19px 21px; border: 1px solid #c6b8ef; border-radius: 10px; background: #fefeff; color: #393049; font-size: 15px; line-height: 2; box-shadow: 0 0 0 2px #bba8f409; }
.prompt-editor-input:focus { border-color: #a48be5; outline: none; box-shadow: 0 0 0 3px #ad92f313; }
.prompt-editor-input:disabled { background: #f8f7fc; }
.prompt-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex: none; padding: 19px 0 22px; margin: 0 30px; border-top: 1px solid #ebe7f2; }
.prompt-editor-footer p { color: #746981; font-size: 12px; line-height: 1.8; margin: 0; text-wrap: pretty; }
.prompt-editor-done { min-width: 144px; min-height: 45px; background: #6650dd; font-size: 13px; flex: none; }
.prompt-editor-done:hover:not(:disabled) { background: #5843c8; }
.prompt-page button:focus-visible, .prompt-page summary:focus-visible, .prompt-editor-dialog button:focus-visible { outline: 3px solid #b6a4eb; outline-offset: 3px; }
.prompt-page .button:active:not(:disabled), .prompt-editor-dialog .button:active:not(:disabled) { transform: scale(.98); }
@media (max-width: 1150px) {
  .prompt-field-row, .prompt-fixed-row { grid-template-columns: minmax(0, 1fr) 204px; gap: 18px; }
  .prompt-help { padding: 15px; }
  .prompt-fixed-help { padding-top: 4px; }
  .prompt-action-bar { align-items: flex-start; flex-direction: column; gap: 19px; }
  .prompt-actions { align-self: flex-end; }
}
@media (max-width: 850px) {
  .prompt-field-row, .prompt-fixed-row { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .prompt-help { padding: 13px 16px; }
  .prompt-help-icon { display: none; }
  .prompt-help h3 { margin-bottom: 5px; }
  .prompt-help .prompt-help-foot { padding-top: 0; border: 0; margin-top: 5px; }
  .prompt-fixed-help { padding-top: 1px; background: transparent; }
  .prompt-guide-button { margin-top: 3px; }
  .prompt-topic-textarea { height: 223px; }
}
/* Keep the primary actions in the first screen on compact desktop windows. */
@media (min-width: 851px) and (max-height: 800px) {
  .prompt-page { min-height: 0; gap: 16px; }
  .prompt-content { gap: 18px; }
  .prompt-section-heading { margin-bottom: 12px; }
  .prompt-topic-textarea { height: 180px; min-height: 165px; }
  .prompt-help { padding: 12px 15px; }
  .prompt-help-icon { display: none; }
  .prompt-help h3 { margin-bottom: 5px; }
  .prompt-help p { line-height: 1.7; }
  .prompt-help .prompt-help-foot { margin-top: 8px; padding-top: 8px; }
  .prompt-fixed-help { padding-top: 0; padding-bottom: 0; }
  .prompt-fixed-summary { min-height: 80px; padding: 16px 18px; }
  .prompt-guide-button { min-height: 40px; margin-top: 1px; padding-top: 4px; padding-bottom: 4px; }
  .prompt-action-bar { flex-direction: row; align-items: center; gap: 16px; padding-top: 16px; }
  .prompt-actions { align-self: auto; }
  .prompt-copy-note { margin-top: 7px; }
}
@media (max-width: 650px) {
  .workspace-tabs { display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; gap: 5px; padding-bottom: 10px; }
  .workspace-tabs .tab { flex: 0 0 auto; min-width: 98px; min-height: 43px; padding: 9px 10px; }
  .prompt-page { min-height: 0; gap: 20px; }
  .prompt-content { gap: 23px; }
  .prompt-section-heading { gap: 9px; margin-bottom: 11px; }
  .prompt-section-heading h2 { font-size: 17px; gap: 8px; }
  .prompt-section-note { display: none; }
  .prompt-optional { font-size: 11px; }
  .prompt-textarea { padding: 15px 16px 63px; font-size: 16px; line-height: 1.85; }
  .prompt-topic-textarea { height: 218px; min-height: 185px; }
  .prompt-fixed-textarea { height: 285px; }
  .prompt-expand-button { right: 10px; bottom: 10px; min-height: 41px; }
  .prompt-fixed-summary { min-height: 81px; padding: 16px; gap: 10px; }
  .prompt-fixed-heading { gap: 10px; }
  .prompt-fixed-heading strong { font-size: 15px; }
  .prompt-fixed-heading small { font-size: 11px; }
  .prompt-fixed-editor { padding: 0 12px 12px; }
  .prompt-help { font-size: 12px; }
  .prompt-action-bar { padding-top: 21px; gap: 18px; }
  .prompt-state { gap: 10px; }
  .prompt-state strong { font-size: 13px; }
  .prompt-state p { font-size: 11px; }
  .prompt-actions { width: 100%; align-self: stretch; gap: 10px; }
  .prompt-save-button, .prompt-copy-button { flex: 1; min-width: 0; min-height: 46px; padding: 11px 13px; font-size: 12px; }
  .prompt-copy-button { flex: 1.25; gap: 7px; }
  .prompt-copy-note { text-align: left; font-size: 10px; }
  .prompt-load-error { align-items: stretch; flex-direction: column; }
  .prompt-retry { align-self: flex-start; }
  .prompt-editor-dialog { width: calc(100vw - 24px); height: min(720px, calc(100dvh - 30px)); max-height: calc(100dvh - 24px); border-radius: 16px; }
  .prompt-editor-header { gap: 12px; padding: 21px 19px 16px; }
  .prompt-editor-heading { gap: 10px; }
  .prompt-editor-heading-icon { width: 25px; height: 25px; }
  .prompt-editor-heading h2 { font-size: 19px; }
  .prompt-editor-heading p { font-size: 12px; margin-top: 6px; }
  .prompt-editor-body { padding: 0 18px 17px; }
  .prompt-editor-input { font-size: 16px; padding: 15px 16px; line-height: 1.9; }
  .prompt-editor-footer { margin: 0 19px; padding: 15px 0 19px; gap: 13px; align-items: stretch; flex-direction: column; }
  .prompt-editor-footer p { font-size: 11px; }
  .prompt-editor-done { min-height: 44px; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .prompt-textarea, .prompt-expand-button, .prompt-fixed-summary, .prompt-fold-icon, .prompt-save-button, .prompt-copy-button, .prompt-editor-close { transition: none; }
  .prompt-page .button:active:not(:disabled), .prompt-editor-dialog .button:active:not(:disabled) { transform: none; }
}
