/* Approved B is a complete photo message measured in a 480px design column. */
#chatMessages .cc-photo-message { display:block; width:100%; min-width:0; }
#chatMessages .cc-photo-result { container-type:inline-size; width:min(100%,360px); max-width:100%; min-width:0; padding:0; border:0; border-radius:0; background:transparent; overflow:visible; box-shadow:none; gap:0; }
#chatMessages .cc-photo-message .cc-photo-result:not(.travel-airmail-card) { width:min(100%,360px); }
#chatMessages .cc-photo-sender { display:flex; align-items:center; gap:4.166667cqw; padding:1.666667cqw 0 0 2.083333cqw; height:14.583333cqw; }
#chatMessages .cc-photo-sender .message-avatar { width:12.916667cqw; height:12.916667cqw; flex:0 0 12.916667cqw; margin:0; }
#chatMessages .cc-photo-sender .message-avatar img { width:100%; height:100%; object-fit:cover; object-position:center; transform:none; }
#chatMessages .cc-photo-sender > div { position:relative; top:-.416667cqw; }
#chatMessages .cc-photo-sender strong { display:block; color:#4b4239; font:500 4.583333cqw/1.35 system-ui,sans-serif; -webkit-text-stroke:.045cqw currentColor; }
#chatMessages .cc-photo-sender .message-time { display:block; margin:1.041667cqw 0 0; padding:0; color:#a29b92; font:400 3.611111cqw/1.2 system-ui,sans-serif; }
#chatMessages .cc-photo-paper { position:relative; width:91.25cqw; margin:.833333cqw 0 0 5.416667cqw; padding:5.416667cqw 4.375cqw 6.666667cqw; border:.208333cqw solid #e9e4d9; border-radius:.833333cqw; background:#f6f3ed url('/assets/photo-letter/paper-grain-v2.webp') center/100% 100% no-repeat; box-shadow:0 2.083333cqw 3.125cqw #53453220,0 .416667cqw .833333cqw #53453212; transform:matrix(1,-.022693,.014374,1,0,0); transform-origin:center; }
#chatMessages .cc-photo-paper .cc-b-result-media { width:100%; margin:0; border-radius:.416667cqw; background:#f1eadf; }
#chatMessages .cc-photo-paper .cc-b-result-media > img { display:block; width:100%; max-width:100%; height:auto; max-height:none; aspect-ratio:auto; object-fit:contain; margin:0; border:0; border-radius:.416667cqw!important; }
#chatMessages .cc-photo-paper .cc-photo-caption { display:block; max-width:77.5cqw; margin:3.472222cqw 0 0 1.666667cqw; padding:0; color:#403b32; font:400 5.166667cqw/1.72043 "Kaiti SC","STKaiti","KaiTi","Microsoft YaHei",system-ui,sans-serif; -webkit-text-stroke:.1cqw currentColor; letter-spacing:-.416667cqw; transform:translateY(.555556cqw) rotate(-1deg); transform-origin:left top; text-align:left; white-space:pre-wrap; overflow-wrap:anywhere; }
#chatMessages .cc-photo-heart { position:absolute; right:6.041667cqw; bottom:6.25cqw; width:6.111111cqw; height:7.013889cqw; fill:none; stroke:#f394a0; stroke-width:2.2; stroke-linejoin:round; stroke-linecap:round; pointer-events:none; }
#chatMessages .cc-photo-controls { display:flex; align-items:flex-start; gap:2.5cqw; width:92.5cqw; margin:11.666667cqw 0 0 3.75cqw; order:2; }
#chatMessages .cc-photo-controls .message-result-card__actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); flex:1; gap:1.666667cqw; padding:0; margin:0; min-width:0; }
#chatMessages .cc-photo-controls .message-result-card__actions.is-single { grid-template-columns:minmax(0,1fr); }
#chatMessages .cc-photo-result:not(.travel-airmail-card) .message-result-card__actions:not(.is-single) { grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr); }
#chatMessages .cc-photo-result:lang(en):not(.travel-airmail-card) .message-result-card__actions:not(.is-single) { grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr); }
#chatMessages .cc-photo-controls .message-result-card__actions button { display:flex; justify-content:center; align-items:center; gap:3.125cqw; min-width:0; min-height:max(44px,12.5cqw); padding:1.25cqw; border:0; border-radius:7cqw; background:#e6ead5; color:#455439; font:500 4.444444cqw/1.4 system-ui,sans-serif; letter-spacing:-.347222cqw; white-space:normal; overflow-wrap:anywhere; }
#chatMessages .cc-photo-controls .message-result-card__actions button:hover { background:#dbe3c8; }
#chatMessages .cc-photo-controls .message-result-card__actions svg { flex:none; width:5.416667cqw; height:5.416667cqw; }
#chatMessages .cc-photo-controls .cc-b-result-menu { display:block; position:relative; top:auto; right:auto; flex:0 0 max(44px,14.583333cqw); order:4; }
#chatMessages .cc-photo-controls .cc-b-result-menu > summary { width:max(44px,14.583333cqw); height:max(44px,12.5cqw); border-radius:7cqw; background:#f4f0e6; font-size:5.833333cqw; }
#chatMessages .cc-media-platform { display:flex; align-items:center; gap:7px; margin:8px 3.75cqw 0; order:3; }
#chatMessages .cc-media-platform .ai-generated-label { position:static; padding:0; background:none; border:0; color:#9b9083; font-size:10px; }
#chatMessages .cc-photo-result .message-result-card__reference { margin:3px 3.75cqw 0!important; order:4; }
#chatMessages .cc-video-letter .cc-photo-caption { margin:10px 12px 14px; font:400 16px/1.65 "Kaiti SC","STKaiti","KaiTi","Microsoft YaHei",system-ui,sans-serif; white-space:pre-wrap; overflow-wrap:anywhere; }
#chatMessages .cc-video-result .cc-media-platform { margin-left:12px; }
#chatMessages .cc-b-task { width:calc(100% - 38px); max-width:calc(100% - 38px); margin-left:38px; padding:0; }
#chatMessages .cc-b-task .cc-b-task-platform { font-weight:400; }

/* The travel alpha frame must not restyle ordinary co-create photo messages.
   :where keeps the approved travel cascade specificity unchanged. */
#chatMessages .cc-photo-result:where(.travel-airmail-card){width:178.56px;max-width:calc(100% - 30px);margin-left:10px;isolation:isolate}
#chatMessages :where(.travel-airmail-card) .cc-photo-postcard{position:relative;display:flow-root;padding:12cqw 0 12cqw;isolation:isolate}
#chatMessages :where(.travel-airmail-card) .cc-photo-postcard .cc-photo-paper{isolation:isolate;overflow:visible}
#chatMessages :where(.travel-airmail-card) .cc-photo-postcard .cc-photo-paper::before{content:"";position:absolute;left:-16.5%;top:-14.4%;width:132.6%;height:129.2%;background:url('/assets/photo-letter/postcard-frame-generated-v1.webp') center/100% 100% no-repeat;z-index:-1;pointer-events:none}
#chatMessages :where(.travel-airmail-card) .cc-photo-controls{width:100%;margin:0;gap:6px;align-items:stretch}
#chatMessages :where(.travel-airmail-card) .cc-photo-controls .message-result-card__actions{display:flex;gap:6px;flex-wrap:wrap}
#chatMessages :where(.travel-airmail-card) .cc-photo-controls .message-result-card__actions button{min-height:44px;font:500 12px/1.35 system-ui,sans-serif;gap:5px;padding:6px 8px;letter-spacing:0;border:1px solid #d9c8a8;background:#fff9ea;color:#8b714a;border-radius:12px;flex:1 1 100%}
#chatMessages :where(.travel-airmail-card) .cc-photo-controls .message-result-card__actions svg{width:15px;height:15px}
#chatMessages :where(.travel-airmail-card) .cc-photo-controls .cc-b-result-menu{flex:0 0 44px}
#chatMessages :where(.travel-airmail-card) .cc-photo-controls .cc-b-result-menu>summary{width:44px;height:44px;font-size:20px;border:1px solid #d9c8a8;background:#fff9ea;border-radius:12px}
#chatMessages .cc-photo-result:where(.travel-airmail-card) .cc-media-platform{margin:7px 0 0;flex-wrap:wrap;font-size:10px}
#chatMessages .cc-photo-result:where(.travel-airmail-card) .cc-photo-caption{font-size:12px;line-height:1.6;letter-spacing:0;-webkit-text-stroke:0;max-width:100%;margin-top:7px}
#chatMessages .cc-photo-result:where(.travel-airmail-card) .cc-b-result-menu[open]>button{display:flex;align-items:center;gap:6px;width:100%;min-height:44px;font-size:12px}

/* Selected B: media, segmented actions and source form one chat bubble.
   Travel postcards and the full-screen viewer retain their own styles. */
#chatMessages :is(.message--original-photo, .message--original-video) { gap:8px; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) {
  container-type:normal; width:calc(100% - 42px); max-width:330px; min-width:0;
  padding:8px; border:1px solid #eee5d9; border-radius:22px; background:#fffaf3;
  overflow:visible; box-shadow:0 2px 5px #71573b0b; gap:0; box-sizing:border-box;
}
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original)::before {
  content:''; position:absolute; top:19px; left:-5px; width:9px; height:9px;
  background:#fffaf3; border-left:1px solid #eee5d9; border-bottom:1px solid #eee5d9; transform:rotate(45deg); pointer-events:none;
}
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) > .message-time { display:none; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .cc-b-result-media {
  position:relative; align-self:flex-start; width:100%; max-width:100%; padding:0; margin:0;
  border:0; border-radius:16px; overflow:visible; background:#f6efe5; box-shadow:none;
}
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .cc-b-result-media > :is(img, video) {
  display:block; width:100%; max-width:100%; max-height:min(360px,48dvh); height:auto;
  aspect-ratio:auto; object-fit:contain; margin:0; border-radius:16px; background:#f6efe5;
}
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .cc-b-result-media .ai-generated-label {
  position:absolute; left:8px; bottom:8px; margin:0; padding:3px 7px; border-radius:9px;
  color:#fff; background:#4c3b3180; font-size:11px; line-height:16px; pointer-events:none;
}
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__copy { display:contents; padding:0; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__actions {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.65fr)!important;
  gap:0; width:100%; margin:0; padding:3px 2px; border:0; border-radius:0 0 13px 13px;
  overflow:hidden; background:#edf0e1; box-shadow:none;
}
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__actions button {
  display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0;
  min-height:58px; border:0; border-radius:10px; padding:5px 3px; gap:4px; font-size:13px;
  font-weight:500; line-height:1.35; white-space:normal; overflow-wrap:anywhere; text-align:center;
  color:#494334; background:transparent;
}
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__actions button.is-primary-action { color:#46573c; background:transparent; border:0; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__actions button svg { flex:none; width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__reference {
  display:grid!important; grid-template-columns:36px minmax(0,1fr) 14px; align-items:center; gap:10px;
  width:100%!important; max-width:100%; min-height:56px; margin:0!important; padding:9px 3px 2px!important;
  border:0!important; border-radius:0!important; color:#806148!important; background:transparent!important;
  box-shadow:none!important; text-align:left;
}
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__reference img,
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__reference-placeholder { width:36px!important; height:40px!important; display:grid; place-items:center; border-radius:6px!important; object-fit:contain; background:#f2e8dc; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__reference-copy { min-width:0; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__reference-copy > small { display:none!important; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__reference-copy > b { display:block; color:#806148; font-size:13px; font-weight:400; line-height:1.4; white-space:normal; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__reference-arrow { width:14px!important; height:14px!important; padding:0!important; color:#8a8179!important; background:none!important; fill:none; stroke:currentColor; stroke-width:1.8; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .cc-b-result-menu { top:3px; right:3px; z-index:2; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .cc-b-result-menu > summary { position:relative; isolation:isolate; width:44px; height:44px; background:transparent; color:#675346; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .cc-b-result-menu > summary::before { content:''; position:absolute; inset:6px; z-index:-1; border-radius:9px; background:#fffaf3e8; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .cc-b-result-menu button { display:flex; align-items:center; gap:9px; min-height:44px; padding:10px 14px; border:1px solid #e8dccd; border-radius:12px; background:#fffaf5; color:#4c3b31; font-size:13px; font-weight:500; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .cc-b-result-menu button svg { width:18px; height:18px; flex:none; }
#chatMessages .message--photo:is([data-co-create-status="photo_ready"],[data-co-create-status="video_ready"]) .message-source-actions { display:none!important; }
#chatMessages .message--photo[data-co-create-source] .message-photo > span { display:none; }
#chatMessages .cc-video-result--original .cc-b-result-media > video { max-height:min(360px,46dvh); background:#211d1a; }
#chatMessages .cc-video-result--original .cc-b-result-media .ai-generated-label { top:8px; bottom:auto; }
#chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__actions:not(:has(.is-primary-action)) { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
@media(max-width:360px) {
  #chatMessages :is(.cc-photo-result--original, .cc-video-result--original) { width:calc(100% - 36px); padding:6px; }
  #chatMessages :is(.cc-photo-result--original, .cc-video-result--original) .message-result-card__actions button { font-size:12px; min-height:58px; }
}

/* The approved ordinary-photo preview owns its two toolbar actions. */
#mediaViewer.is-photo-flow { padding:max(66px,calc(env(safe-area-inset-top) + 56px)) 0 max(22px,env(safe-area-inset-bottom)); background:rgba(35,29,25,.97); }
#mediaViewer.is-photo-flow > .viewer-toolbar { justify-content:flex-start; }
#mediaViewer.is-photo-flow #viewerDownloadButton { margin-right:auto; min-height:44px; padding:8px 14px; border-radius:24px; font-size:12px; font-weight:500; }
#mediaViewer.is-photo-flow > .viewer-toolbar > #closeViewerButton { display:grid!important; width:44px; height:44px; min-width:44px; flex:none; margin-left:auto; background:transparent; border-radius:0; }
#mediaViewer.is-photo-flow > .site-action-bar { display:none!important; }
#mediaViewer.is-photo-flow .viewer-content { padding:0 10px; }
#mediaViewer.is-photo-flow .viewer-caption { display:flex; justify-content:center; align-items:center; gap:6px; padding:20px 16px 12px; text-align:center; }
#mediaViewer.is-photo-flow .viewer-caption :is(strong,span) { display:inline; margin:0; font-size:14px; line-height:20px; font-weight:400; color:#e5ddd6; }
#mediaViewer.is-photo-flow .viewer-caption span::before { content:'·'; margin-right:6px; }
