/* Composition studio: follows the main gallery's light visual language. */
.compose-panel { display: grid; gap: 23px; }
.compose-random-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 19px 23px; border: 1px solid #dce6f3; border-radius: 20px;
  background: linear-gradient(110deg, #fff, #eef4fd);
}
.compose-random-copy { min-width: 0; }
.compose-random-copy strong { display: block; font-size: 16px; font-weight: 720; letter-spacing: -.025em; }
.compose-random-copy p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; color: var(--secondary); }
.compose-random-primary {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
  gap: 9px; min-height: 43px; padding: 11px 20px; border: 0;
  border-radius: 999px; color: #fff; background: var(--accent);
  font-size: 13px; font-weight: 700; transition: background .18s, transform .18s;
}
.compose-random-primary:hover { background: #005bb5; transform: translateY(-1px); }
.compose-random-primary:active { transform: translateY(0); }
.compose-random-filters {
  display: flex; align-items: end; flex-wrap: wrap; gap: 13px 18px;
  padding: 16px 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff;
}
.compose-random-filters > label:not(.compose-random-duo-option) {
  display: grid; flex: 1 1 180px; max-width: 290px; gap: 6px;
  color: var(--secondary); font-size: 12px; font-weight: 600;
}
.compose-random-filters select { height: 40px; font-size: 12px; }
.compose-random-duo-option {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  font-size: 12px; color: var(--secondary); cursor: pointer;
}
.compose-random-duo-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.compose-random-pool-size { margin-left: auto; padding-bottom: 11px; white-space: nowrap; color: var(--tertiary); font-size: 11px; }
.compose-drawn-meta {
  margin: 10px 2px 0; min-height: 18px; color: var(--secondary);
  font-size: 12px; line-height: 1.5; overflow-wrap: anywhere;
}
.compose-slot-preview img.compose-random-appear { animation: compose-reveal .32s ease-out both; }
@keyframes compose-reveal {
  from { opacity: .35; transform: scale(.965); }
  to { opacity: 1; transform: scale(1); }
}
.compose-selection { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.compose-slot, .compose-editor {
  min-width: 0; padding: 22px; border: 1px solid var(--line);
  border-radius: 22px; background: #fff; box-shadow: var(--shadow);
}
.compose-slot-head { display: flex; justify-content: space-between; gap: 10px; align-items: center;
  min-height: 27px; margin-bottom: 16px; font-size: 13px; font-weight: 700; }
.compose-slot-head span:last-child { min-width: 0; color: var(--secondary); font-weight: 500;
  font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-slot-preview { display: flex; justify-content: center; align-items: center; height: 245px;
  overflow: hidden; border-radius: 15px; background: #f5f6f8; color: var(--tertiary); font-size: 13px; }
.compose-slot-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.compose-slot-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.compose-choose, .compose-secondary, .compose-folder-button {
  border: 1px solid #dedfe5; border-radius: 999px; background: #fff; color: var(--ink);
  padding: 10px 20px; font-size: 12px; font-weight: 650;
}
.compose-choose { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.compose-choose:hover { background: #414145; }
.compose-secondary:hover, .compose-folder-button:hover { background: #f5f6f8; }
.compose-editor { padding: 27px; }
.compose-editor-head { display: flex; justify-content: space-between; gap: 12px;
  align-items: center; margin-bottom: 18px; }
.compose-editor-head .section-eyebrow { margin-bottom: 5px; }
.compose-editor-head h3 { margin: 0; font-size: clamp(20px, 2vw, 27px); letter-spacing: -.035em; }
#compose-size { color: var(--secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.compose-canvas-wrap { display: grid; place-items: center; position: relative;
  min-height: 280px; padding: 20px; overflow: hidden; border-radius: 16px;
  background: #f1f2f5; }
#compose-canvas { display: block; max-width: 100%; max-height: 600px; width: auto;
  height: auto; object-fit: contain; box-shadow: 0 12px 35px rgb(0 0 0 / 8%); }
.compose-placeholder { position: absolute; inset: 0; display: grid; place-items: center;
  padding: 26px; text-align: center; color: var(--tertiary); font-size: 14px; background: #f1f2f5; }
.compose-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 15px; margin-top: 21px; }
.compose-tools > label:not(.compose-checkbox) { display: grid; gap: 8px; min-width: 170px;
  color: var(--secondary); font-size: 12px; font-weight: 600; }
.compose-tools select { height: 43px; }
.compose-checkbox { display: flex; align-items: center; gap: 8px; min-height: 43px;
  font-size: 12px; color: var(--secondary); font-weight: 600; cursor: pointer; }
.compose-checkbox input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.compose-tools .compose-secondary { min-height: 43px; }
.compose-prompt-box {
  margin-top: 20px; padding: 15px 18px;
  border: 1px solid #e4e8ef; border-radius: 15px; background: #fafbfd;
}
.compose-prompt-box summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink); }
.compose-prompt-box > p { margin: 11px 0; font-size: 12px; color: var(--secondary); line-height: 1.6; }
#compose-prompt-text {
  display: block; width: 100%; min-height: 180px; resize: vertical;
  padding: 13px; border: 1px solid #e2e5ec; border-radius: 11px;
  background: #fff; color: var(--ink); font: inherit; font-size: 12px; line-height: 1.75;
}
.compose-prompt-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 11px; }
.compose-prompt-actions button:disabled { cursor: not-allowed; color: #999ca5; background: #f0f1f3; }
#compose-copy-status { font-weight: 650; }
#compose-copy-status[data-status="error"] { color: #b42318; }
.compose-export { display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.compose-export-help { min-width: 0; }
.compose-export-help p { margin: 0; color: var(--secondary); font-size: 12px; line-height: 1.7; }
.compose-export-help #compose-status { font-weight: 650; color: #276e57; }
.compose-export-help #compose-status[data-status="error"] { color: #b42318; }
.compose-export-help #compose-status[data-status="error"] {
  margin-top: 7px; padding: 10px 12px; border: 1px solid #efcac4;
  border-radius: 10px; background: #fff2f0; font-size: 13px; font-weight: 700;
}
.compose-folder-button { margin-top: 10px; font-size: 12px; }
/* Offline export guidance: visible only for file:// pages without a valid img grant. */
.compose-local-notice {
  display: flex; gap: 13px; align-items: flex-start;
  margin-top: 20px; padding: 17px 19px;
  border: 1px solid #e8c98d; border-radius: 16px;
  background: #fffaee; color: #49391e;
}
.compose-local-notice-icon {
  display: grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: #b87818; color: white; font-size: 16px; font-weight: 800;
}
.compose-local-notice-content { min-width: 0; }
.compose-local-notice-content > strong { display: block; font-size: 14px; font-weight: 750; line-height: 1.5; }
.compose-local-notice-content p { margin: 8px 0; font-size: 12px; line-height: 1.7; }
.compose-local-path {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding: 9px 12px; border-radius: 9px; background: #fff;
  border: 1px solid #efdfc4; font-size: 12px; color: #55525a;
  overflow-wrap: anywhere;
}
.compose-local-path strong { color: #a05d06; font-size: 14px; }
.compose-local-subfolders { color: #77777f; }
.compose-local-notice .compose-folder-button {
  margin-top: 7px; background: #1d1d1f; color: white;
  border-color: #1d1d1f; font-size: 13px; font-weight: 700;
}
.compose-local-notice .compose-folder-button:hover { background: #38383b; }
#compose-download { min-width: 170px; flex-shrink: 0; padding: 13px 23px;
  border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }
#compose-download:disabled { cursor: not-allowed; background: #d3d7e0; color: #777d87; }
#compose-download:not(:disabled):hover { background: #005bb5; }
.dialog-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: end; }
#add-to-compose { min-height: 42px; padding: 10px 17px; border: 1px solid #d5d8df;
  border-radius: 999px; color: var(--ink); background: #f5f6f8; font-weight: 650; font-size: 13px; }
#add-to-compose:hover { background: #e9ebf0; }
@media (max-width: 760px) {
  .compose-random-bar { padding: 15px; gap: 12px; }
  .compose-selection { gap: 11px; }
  .compose-slot, .compose-editor { padding: 14px; border-radius: 18px; }
  .compose-slot-preview { height: 210px; }
  .compose-canvas-wrap { padding: 12px; min-height: 180px; }
  .compose-tools > label:not(.compose-checkbox) { flex: 1 1 120px; min-width: 120px; }
  .compose-export { align-items: stretch; flex-direction: column; }
}
@media (max-width: 480px) {
  .compose-random-filters { padding: 12px; gap: 10px; }
  .compose-random-filters > label:not(.compose-random-duo-option) { max-width: none; flex: 1 1 100%; }
  .compose-random-pool-size { width: 100%; margin: 0; padding: 0; }
  .compose-prompt-box { padding: 12px; }
  .compose-random-bar { align-items: stretch; flex-direction: column; }
  .compose-random-primary { width: 100%; }
  .compose-local-notice { padding: 12px; gap: 10px; }
  .compose-local-notice-content > strong { font-size: 13px; }
  .compose-local-path { gap: 5px; }
  .compose-slot-head { font-size: 11px; align-items: start; flex-direction: column; gap: 3px; }
  .compose-slot-preview { height: 165px; font-size: 11px; }
  .compose-choose, .compose-secondary { padding: 9px 13px; }
  .compose-slot-actions { align-items: stretch; flex-direction: column; }
  .compose-slot-actions button { width: 100%; }
  .compose-editor-head { align-items: start; flex-direction: column; }
  .dialog-bottom { align-items: start; flex-direction: column; }
  .dialog-actions { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .compose-slot-preview img.compose-random-appear { animation: none; }
}
