/* Shared free-text image retouch dialog. */
body.storybd-retouch-open { overflow: hidden !important; }
#storybd-retouch-modal { padding: 24px !important; overflow: hidden !important; background: rgba(19, 26, 43, .68) !important; box-sizing: border-box; }
#storybd-retouch-modal.is-open { display: flex !important; align-items: center !important; justify-content: center !important; }
#storybd-retouch-modal .storybd-retouch-card {
  display: flex; flex-direction: column; width: 1000px !important; max-width: 100% !important; box-sizing: border-box;
  max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); margin: 0 !important;
  padding: 0 !important; overflow: hidden !important; background: #fffdf8;
  border: 2px solid #182235; border-radius: 24px; box-shadow: 0 22px 80px rgba(0, 0, 0, .25);
  color: #182235; text-align: left; font-family: Arial, sans-serif;
}
#storybd-retouch-modal .storybd-retouch-header { display: flex; justify-content: space-between; gap: 20px; padding: 26px 30px 22px; border-bottom: 1px solid #e4e3dd; flex-shrink: 0; }
#storybd-retouch-modal .storybd-retouch-kicker { display: block; margin-bottom: 7px; color: #74541a; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
#storybd-retouch-modal h2 { margin: 0 0 8px; font-size: clamp(23px, 3vw, 30px); line-height: 1.15; color: #182235; }
#storybd-retouch-modal #storybd-mod-intro { margin: 0; font-size: 15px; line-height: 1.5; color: #546071; }
#storybd-retouch-modal .storybd-modal-close { position: static; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 1px solid #d7dbe1; border-radius: 50%; background: #fff; color: #182235; font-size: 26px; line-height: 1; box-shadow: none; cursor: pointer; }
#storybd-retouch-modal .storybd-retouch-content { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); min-height: 0; overflow: auto; overscroll-behavior: contain; }
#storybd-retouch-modal .storybd-retouch-preview { min-width: 0; margin: 0; padding: 24px 30px; background: #f0f0e9; border-right: 1px solid #e0e1da; }
#storybd-retouch-modal figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-bottom: 16px; font-size: 13px; color: #5a6470; }
#storybd-retouch-modal figcaption strong { color: #182235; }
#storybd-mod-preview-frame { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; line-height: 0; box-shadow: 0 5px 18px rgba(24, 34, 53, .12); }
#storybd-mod-preview-image { display: block; width: auto; height: auto; max-width: 100%; max-height: min(50vh, 510px); border-radius: 0; }
#storybd-retouch-modal .storybd-retouch-form { padding: 26px 30px; min-width: 0; }
#storybd-retouch-modal .storybd-retouch-form > label { display: block; margin: 0 0 6px; font-size: 19px; font-weight: 800; color: #182235; }
#storybd-retouch-modal #storybd-mod-help { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: #596373; }
#storybd-retouch-modal #storybd-mod-details { display: block; box-sizing: border-box; width: 100%; min-height: 138px; max-height: 300px; margin: 0; padding: 15px; resize: vertical; border: 1.5px solid #acb3be; border-radius: 12px; background: #fff; color: #182235; font: inherit; font-size: 16px; line-height: 1.5; box-shadow: none; }
#storybd-retouch-modal #storybd-mod-details::placeholder { color: #737b86; opacity: 1; }
#storybd-retouch-modal #storybd-mod-details[aria-invalid="true"] { border-color: #b02d35; }
#storybd-retouch-modal #storybd-mod-error { margin: 8px 0 0; color: #a3232d; font-size: 14px; line-height: 1.4; }
#storybd-retouch-modal [hidden] { display: none !important; }
#storybd-retouch-modal .storybd-retouch-reassurance { margin-top: 18px; padding: 14px 16px; border: 1px solid #d9e4dc; border-radius: 12px; background: #f1f7f2; }
#storybd-retouch-modal .storybd-retouch-reassurance strong { display: block; font-size: 14px; color: #31523b; }
#storybd-retouch-modal .storybd-retouch-reassurance p { margin: 5px 0 0; font-size: 13px; line-height: 1.55; color: #4d5f53; }
#storybd-retouch-modal .storybd-retouch-next { margin: 16px 0; font-size: 13px; line-height: 1.6; color: #596373; }
#storybd-retouch-modal .storybd-retouch-dialogues { display: grid; gap: 5px; padding-top: 16px; border-top: 1px solid #e4e3dd; font-size: 13px; line-height: 1.5; color: #596373; }
#storybd-retouch-modal .storybd-retouch-dialogues a { width: fit-content; color: #182235; font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
#storybd-retouch-modal .storybd-retouch-dialogues a span { color: #31523b; }
#storybd-retouch-modal .storybd-retouch-footer { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-shrink: 0; padding: 18px 30px; border-top: 1px solid #e4e3dd; background: #fffdf8; }
#storybd-retouch-modal .storybd-retouch-footer .storybd-btn { width: auto; min-height: 48px; margin: 0; padding: 12px 20px; font-size: 15px; line-height: 1.4; border-radius: 12px; }
#storybd-retouch-modal .storybd-retouch-footer .storybd-secondary { background: transparent; border: 1px solid #c9ced4; color: #455163; box-shadow: none; }
#storybd-retouch-modal #storybd-apply-board-mod { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 5px; background: #ffd65a; border: 2px solid #182235; color: #182235; font-weight: 800; box-shadow: 0 3px 0 #182235; }
#storybd-retouch-modal :is(button, a, textarea):focus-visible { outline: 3px solid #4268b3; outline-offset: 3px; }
/* The older global theme uses !important typography and button decorations. */
#storybd-retouch-modal h2 { font-family: inherit !important; font-size: 30px !important; font-weight: 800 !important; letter-spacing: -.035em !important; text-shadow: none !important; text-transform: none !important; }
#storybd-retouch-modal h2::after, #storybd-retouch-modal button::before, #storybd-retouch-modal button::after { content: none !important; display: none !important; }
#storybd-retouch-modal p { font-family: inherit !important; font-weight: 400 !important; }
#storybd-retouch-modal #storybd-mod-details { border: 1.5px solid #acb3be !important; border-radius: 12px !important; box-shadow: none !important; min-height: 138px !important; }
#storybd-retouch-modal #storybd-mod-details[aria-invalid="true"] { border-color: #b02d35 !important; }
#storybd-retouch-modal button { font-family: inherit !important; text-transform: none !important; letter-spacing: 0 !important; transform: none !important; }
#storybd-retouch-modal .storybd-retouch-footer .storybd-secondary { background: transparent !important; border: 1px solid #c9ced4 !important; color: #455163 !important; box-shadow: none !important; }
#storybd-retouch-modal #storybd-apply-board-mod { background: #ffd65a !important; border: 2px solid #182235 !important; color: #182235 !important; box-shadow: 0 3px 0 #182235 !important; }
@media (max-width: 700px) {
  #storybd-retouch-modal { padding: 10px !important; }
  #storybd-retouch-modal .storybd-retouch-card { border-radius: 18px; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  #storybd-retouch-modal .storybd-retouch-header { gap: 10px; padding: 18px; }
  #storybd-retouch-modal .storybd-retouch-kicker { font-size: 10px; }
  #storybd-retouch-modal h2 { font-size: 23px !important; }
  #storybd-retouch-modal #storybd-mod-intro { font-size: 13px; }
  #storybd-retouch-modal .storybd-modal-close { width: 36px; height: 36px; flex-basis: 36px; }
  #storybd-retouch-modal .storybd-retouch-content { grid-template-columns: minmax(0, 1fr); }
  #storybd-retouch-modal .storybd-retouch-preview { padding: 16px 18px; border-right: 0; border-bottom: 1px solid #e0e1da; }
  #storybd-retouch-modal figcaption { margin-bottom: 10px; }
  #storybd-mod-preview-image { max-height: 210px; }
  #storybd-retouch-modal .storybd-retouch-form { padding: 20px 18px; }
  #storybd-retouch-modal .storybd-retouch-footer { gap: 10px; padding: 14px; }
  #storybd-retouch-modal .storybd-retouch-footer .storybd-btn { padding: 10px 12px; font-size: 14px; }
  #storybd-retouch-modal #storybd-apply-board-mod { flex: 1; }
}
