.compose-tools { margin: 9px 0 14px; }
.compose-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: start; }
.compose-tools details { min-width: 0; flex: 1 1 145px; border: 1px solid var(--line); border-radius: 15px; background: #fffdf8; }
.compose-tools summary { min-height: 44px; padding: 10px 13px; cursor: pointer; font-weight: 700; font-size: 15px; }
.compose-tools summary::marker { color: #b49137; }
.compose-tools details[open] { flex-basis: 100%; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 4px; padding: 7px; }
.emoji-choice { min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-size: 25px; }
.emoji-choice:hover, .emoji-choice:focus-visible { background: #fff0c8; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); padding: 8px; gap: 7px; }
.sticker-choice { min-width: 0; padding: 5px 2px 7px; border: 2px solid transparent; border-radius: 13px; background: #fffaf0; display: flex; flex-direction: column; align-items: center; color: #172d50; font-size: 12px; font-weight: 700; }
.sticker-choice[aria-pressed="true"] { background: #fff0bf; border-color: #d9ad43; }
.sticker-art { display: inline-block; flex: none; width: 96px; height: 96px; background-image: url('/stickers.png'); background-size: 300% 200%; background-repeat: no-repeat; }
.sticker-choice .sticker-art { width: min(74px, 100%); height: auto; aspect-ratio: 1; }
.sticker-wink { background-position: 0 0; }
.sticker-crown { background-position: 50% 0; }
.sticker-caught { background-position: 100% 0; }
.sticker-thinking { background-position: 0 100%; }
.sticker-bloom { background-position: 50% 100%; }
.sticker-sorry { background-position: 100% 100%; }
.sticker-display { display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 0 0 12px; }
.sticker-caption { font-size: 13px; color: #766137; font-weight: 700; }
.entry-card > .sticker-display .sticker-art { width: 120px; height: 120px; }
.selected-sticker { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 4px 10px; background: #fff8e8; border-radius: 15px; }
.selected-sticker .sticker-display { margin: 0; }
.selected-sticker .sticker-art { width: 72px; height: 72px; }
.selected-sticker .text-button { min-height: 44px; }
.comment-body .sticker-display { margin: 3px 0 8px; }
.comment-form .compose-tools { margin-bottom: 9px; }
.comment-form .compose-tools details { flex-basis: 130px; }
.comment-form .compose-toolbar { gap: 6px; }
.comment-form .compose-tools details[open] { flex-basis: 100%; }
.comment-form .sticker-choice .sticker-art { width: min(66px, 100%); }
.image-upload-section { margin: 18px 0 10px; padding-top: 18px; border-top: 1px dashed #dccfad; }
.photos-heading { display: flex; align-items: start; gap: 12px; flex-wrap: wrap; }
.photos-heading > div { flex: 1; min-width: 160px; }
.photos-heading h3 { font-size: 18px; margin: 0 0 6px; }
.photos-heading .field-hint { margin: 0 0 9px; }
.photo-picker { margin: 0; min-height: 44px; padding: 10px 12px; cursor: pointer; font-size: 15px; }
.photo-picker[aria-disabled="true"] { opacity: .5; cursor: default; }
.photos-heading:has(#entryPhotos:focus-visible) .photo-picker { outline: 3px solid #eaae18; outline-offset: 4px; }
.image-draft { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.draft-image { min-width: 0; padding: 6px; border-radius: 14px; background: #f9f5ed; border: 1px solid #e9e0d0; }
.draft-image-picture { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #eee9df; }
.draft-image img { width: 100%; height: 100%; object-fit: cover; }
.draft-image-placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; }
.draft-image-info { text-align: center; font-size: 12px; margin: 7px 0 0; color: #69768a; }
.draft-image .text-button { width: 100%; min-height: 44px; padding: 5px; font-size: 13px; }
.draft-image progress { display: block; width: 100%; height: 7px; margin: 8px 0 4px; accent-color: #ba9035; }
.draft-upload-status { min-height: 18px; text-align: center; font-size: 12px; color: #69768a; }
.draft-upload-status.failed { color: #a8484c; }
.image-removal-message { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; color: #895551; }
.image-removal-message button { min-height: 44px; }
.entry-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.entry-image { position: relative; border: 0; border-radius: 13px; padding: 0; background: #eee8dc; overflow: hidden; aspect-ratio: 1.25; min-width: 0; min-height: 44px; }
.entry-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-placeholder { display: grid; place-items: center; position: absolute; inset: 0; font-size: 13px; padding: 5px; color: #657287; }
.gallery-caption { color: #6d7789; font-size: 13px; margin: -8px 0 18px; }
.image-viewer { width: min(820px, 94vw); padding: 0; }
.image-viewer .dialog-heading { padding: 17px 20px; margin: 0; }
.image-viewer h2 { font-size: 22px; margin: 0; }
.viewer-picture { display: flex; align-items: center; justify-content: center; background: #f0ece3; min-height: 200px; padding: 10px; }
.viewer-picture img { display: block; max-width: 100%; max-height: min(65vh, 640px); object-fit: contain; }
.viewer-picture p { max-width: 280px; text-align: center; line-height: 1.8; }
.viewer-footer { padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.viewer-footer a { text-decoration: none; min-height: 44px; }
#entryForm[aria-busy="true"] .compose-toolbar { pointer-events: none; opacity: .7; }
@media (max-width: 900px) {
  .compose-tools summary { font-size: 16px; }
  .comment-form .compose-tools details { flex-basis: 120px; }
  .image-viewer { width: 100%; }
  .image-viewer .dialog-heading { padding: 14px 16px; }
  .viewer-picture img { max-height: calc(var(--visible-height, 100dvh) - 190px); }
  .viewer-footer { padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }
  .viewer-footer .button { font-size: 16px; }
}
@media (max-width: 400px) {
  .image-draft, .entry-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compose-toolbar { gap: 5px; }
  .compose-tools details { flex-basis: 120px; }
}
