.embed-frame .attachment-panel { flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px 12px 0; }
.embed-frame .attachment-panel[hidden] { display: none; }
.embed-frame form.rich-composer[hidden] { display: none; }
.embed-frame .attachment-options { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-14); color: var(--text-2); }
.embed-frame .attachment-options label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.embed-frame .attachment-panel .attachment-drafts { padding: 0; max-height: 132px; }
.embed-frame .attachment-drafts .attachment-draft { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; width: 190px; padding: 4px 24px 4px 4px; text-align: left; cursor: pointer; }
@media (max-width: 720px) { .embed-frame .attachment-panel .attachment-drafts { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; } .embed-frame .attachment-drafts .attachment-draft { flex: 0 0 auto; width: 160px; } }
.embed-frame .attachment-draft img,
.embed-frame .attachment-draft video,
.embed-frame .attachment-draft-ext { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: var(--radius-s); object-fit: cover; background: var(--bg-3); }
.embed-frame .attachment-draft-ext { display: flex; align-items: center; justify-content: center; background: transparent; }
.embed-frame .attachment-draft-ext > svg { width: 35px; height: 44px; }
.embed-frame .attachment-draft-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); color: var(--text-1); }
.embed-frame .attachment-draft small { font-size: var(--fs-12); color: var(--text-3); }
.embed-frame .attachment-draft-remove { position: absolute; top: 2px; right: 6px; font-size: var(--fs-14); color: var(--text-3); }

.embed-frame .attachment-drop { position: absolute; inset: 0; z-index: 40; display: grid; grid-template-rows: 1fr 1fr; gap: 10px; padding: 12px; background: var(--overlay); }
.embed-frame .attachment-drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed var(--border-2); border-radius: var(--radius-l); background: var(--surface); color: var(--text-1); text-align: center; transition: border-color .12s, background .12s; }
.embed-frame .attachment-drop-zone b { font-size: var(--fs-18); }
.embed-frame .attachment-drop-zone span { font-size: var(--fs-14); color: var(--text-2); }
.embed-frame .attachment-drop-zone.active { border-color: var(--accent); background: var(--bg-3); }

.embed-frame :is(.bubble, .comment) .attachment--pending { position: relative; display: flex; align-items: center; justify-content: center; width: min(320px, calc(360px * var(--photo-ratio, 1.3333))); max-width: 100%; aspect-ratio: var(--photo-ratio, 1.3333); margin: 8px 0 0; overflow: hidden; border-radius: var(--radius-m); background: var(--skeleton); }
.embed-frame :is(.bubble, .comment) .attachment--pending img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(6px); opacity: .7; }
.embed-frame :is(.bubble, .comment) .attachment--pending img.attachment-still { filter: none; opacity: 1; }
.embed-frame .attachment-pending-label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-m); background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text-1); font-size: var(--fs-14); text-align: center; }
.embed-frame .attachment-pending-label small { font-size: var(--fs-12); opacity: .85; }
.embed-frame .attachment--pending.is-failed { background: var(--danger-soft); }
.embed-frame .attachment-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: attachment-spin .8s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes attachment-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .embed-frame .attachment-spinner { animation: none; } }
.embed-frame :is(.bubble, .comment) .attachment--file { display: flex; align-items: center; gap: 10px; max-width: min(320px, 100%); margin: 8px 0 0; padding: 8px 10px; border: 1px solid var(--border-1); border-radius: var(--radius-m); background: var(--surface); color: var(--text-1); text-decoration: none; }
.embed-frame .attachment-file-icon { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--text-2); }
.embed-frame .attachment-file-icon > svg { width: 32px; height: 40px; }
.embed-frame .attachment-file-meta { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.embed-frame .attachment-file-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-14); font-weight: var(--fw-bold); }
.embed-frame .attachment-file-meta small,
.embed-frame .attachment-file-state { font-size: var(--fs-12); color: var(--text-3); }
.embed-frame .attachment-file-warning { font-size: var(--fs-12); color: var(--warning); }
.embed-frame .attachment-file-download { margin-left: auto; font-size: var(--fs-18); color: var(--text-2); }
.embed-frame :is(.bubble, .comment) .attachment--audio { display: flex; flex-direction: column; gap: 4px; max-width: min(320px, 100%); margin: 8px 0 0; }
.embed-frame :is(.bubble, .comment) .attachment--audio audio { width: 100%; }

.embed-frame :is(.bubble, .comment) .attachment[data-photo] { --photo-max-w: 320px; --photo-max-h: 360px; display: block; width: min(var(--photo-max-w), calc(var(--photo-max-h) * var(--photo-ratio, 1.3333))); max-width: 100%; aspect-ratio: var(--photo-ratio, 1.3333); margin: 8px 0 0; padding: 0; overflow: hidden; border-radius: var(--radius-m); background: var(--skeleton); line-height: 0; }
.embed-frame :is(.bubble, .comment) .attachment[data-photo] img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; border-radius: inherit; object-fit: cover; }
.embed-frame :is(.bubble, .comment) .attachment[data-photo] { position: relative; isolation: isolate; }
.embed-frame :is(.bubble, .comment) .attachment[data-photo] > .attachment-thumb { position: absolute; inset: 0; filter: blur(10px); transform: scale(1.08); }
.embed-frame :is(.bubble, .comment) .attachment[data-photo] > img:first-child { position: relative; z-index: 1; }
.embed-frame :is(.bubble, .comment) .attachment[data-photo] > img[data-photo-ready] ~ .attachment-thumb { visibility: hidden; }
.embed-frame :is(.bubble, .comment) .attachment--video { position: relative; cursor: pointer; width: min(320px, calc(360px * var(--photo-ratio, 1.7778))); max-width: 100%; margin: 8px 0 0; }
.embed-frame :is(.bubble, .comment) .attachment--video video { display: block; width: 100%; aspect-ratio: var(--photo-ratio, 1.7778); border-radius: var(--radius-m); background: var(--skeleton); object-fit: contain; }
.embed-frame :is(.bubble, .comment) .attachment--video .video-badge { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px 4px 2px 8px; border-radius: var(--radius-m); background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text-1); font-size: var(--fs-12); line-height: var(--lh-tight); }
.embed-frame :is(.bubble, .comment) .attachment--video .video-duration:empty { display: none; }
.embed-frame :is(.bubble, .comment) .attachment--video .video-sound { display: grid; place-items: center; width: 22px; height: 20px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.embed-frame :is(.bubble, .comment) .attachment--video .video-sound svg { width: 16px; height: 16px; }
.embed-frame :is(.bubble, .comment) .attachment--video .attachment-download { display: inline-block; margin-top: 4px; }
@media (max-width: 768px) { .embed-frame :is(.bubble, .comment) .attachment[data-photo] { --photo-max-w: 260px; --photo-max-h: 300px; } }

.embed-frame :is(.bubble, .comment) .attachment-album { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: min(360px, 100%); margin: 8px 0 0; overflow: hidden; border-radius: var(--radius-m); }
.embed-frame :is(.bubble, .comment) .attachment-album[data-count="3"] > :first-child,
.embed-frame :is(.bubble, .comment) .attachment-album[data-count="5"] > :first-child,
.embed-frame :is(.bubble, .comment) .attachment-album[data-count="7"] > :first-child,
.embed-frame :is(.bubble, .comment) .attachment-album[data-count="9"] > :first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.embed-frame :is(.bubble, .comment) .attachment-album > .attachment { width: 100%; max-width: none; margin: 0; border-radius: 0; aspect-ratio: 1; }
.embed-frame :is(.bubble, .comment) .attachment-album > .attachment video,
.embed-frame :is(.bubble, .comment) .attachment-album > .attachment img { width: 100%; height: 100%; object-fit: cover; }
.embed-frame :is(.bubble, .comment) .attachment-album .attachment-download { display: none; }

.embed-frame form.rich-composer { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 14px; border: 0; border-radius: 0; background: var(--surface); }
.embed-frame form.rich-composer .composer-plain,
.embed-frame form.rich-composer .composer-emojis,
.embed-frame .rich-composer-tools > :not(.attach-button) { display: none; }
.embed-frame .rich-composer-field { order: 2; flex: 1; min-width: 0; min-height: 42px; max-height: 180px; padding: 10px 14px; border-radius: var(--radius-control); background: var(--bg-3); color: var(--text-1); overflow-y: auto; outline: none; font: inherit; line-height: var(--lh-text); white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.embed-frame .rich-composer-field:empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.embed-frame .rich-composer-field:focus-visible { box-shadow: inset 0 0 0 1px var(--border-2); }
.embed-frame .rich-composer-field[aria-invalid=true] { box-shadow: inset 3px 0 var(--danger); }
.embed-frame .rich-composer-tools { order: 1; display: flex; flex: 0 0 40px; align-items: center; justify-content: center; height: 42px; }
.embed-frame .rich-composer-tools .attach-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 42px; padding: 9px; color: var(--text-2); background: transparent; border: 0; border-radius: var(--radius-s); cursor: pointer; }
.embed-frame .attach-button svg { width: 23px; height: 23px; }
.embed-frame .rich-composer-tools .attach-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.embed-frame .composer-mention { color: var(--link); background: var(--info-soft); border-radius: var(--radius-s); padding: 0 2px; }
.embed-frame .composer-people { position: absolute; bottom: calc(100% + 6px); left: 12px; width: min(320px, calc(100% - 24px)); max-height: 260px; overflow: auto; z-index: 50; background: var(--surface); border: 1px solid var(--border-1); border-radius: var(--radius-m); padding: 6px; box-shadow: var(--shadow); }
.embed-frame .composer-people button { display: block; width: 100%; text-align: left; border: 0; border-radius: var(--radius-s); padding: 10px 12px; background: var(--surface); color: var(--text-1); cursor: pointer; font: inherit; }
.embed-frame .composer-people button[aria-selected=true],
.embed-frame .composer-people button:hover { background: var(--bg-3); }
.embed-frame .composer-people p { padding: 8px 10px; margin: 0; font-size: var(--fs-14); color: var(--text-3); }
.embed-frame form.rich-composer .composer-send { order: 3; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; align-self: flex-end; width: 42px; max-width: 100%; height: 42px; min-height: 42px; padding: 8px; margin: 0; border: 0; border-radius: 50%; background: transparent; color: var(--link); box-shadow: none; opacity: 1; transition: opacity .12s ease; }
.embed-frame form.rich-composer .composer-send:hover { background: var(--bg-3); }
.embed-frame form.rich-composer .composer-send:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.embed-frame form.rich-composer .composer-send:disabled { opacity: 1; }
.embed-frame form.rich-composer .composer-send svg { display: block; width: 28px; height: 28px; fill: currentColor; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .embed-frame form.rich-composer .composer-send { transition: none; } }
@media (max-width: 600px) { .embed-frame form.rich-composer { padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); gap: 6px; } .embed-frame .rich-composer-field { max-height: 120px; font-size: var(--fs-16); } }

.embed-frame .photo-viewer { position:fixed;inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;box-sizing:border-box;padding:max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));border:0;background:var(--media-bg);color:var(--on-media);overflow:hidden;--photo-glass:var(--media-scrim);--photo-glass-rim:inset 0 0 0 1px color-mix(in srgb, var(--on-media) 14%, transparent);--photo-glass-blur:blur(18px) saturate(140%) }
.embed-frame .photo-viewer:focus { outline:0 }
.embed-frame .photo-viewer::backdrop { background:var(--media-bg) }
.embed-frame .photo-viewer[open] { display:grid;grid-template-rows:minmax(0,1fr) }
.embed-frame .photo-toolbar { position:absolute;z-index:3;top:max(12px, env(safe-area-inset-top));left:max(12px, env(safe-area-inset-left));right:max(12px, env(safe-area-inset-right));display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:12px;min-width:0 }
.embed-frame .photo-round { width:44px;height:44px;min-width:44px;padding:0;margin:0;border:0;border-radius:var(--radius-full);box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;background:var(--photo-glass);box-shadow:var(--photo-glass-rim);color:var(--on-media);-webkit-backdrop-filter:var(--photo-glass-blur);backdrop-filter:var(--photo-glass-blur);cursor:pointer;touch-action:manipulation;text-decoration:none }
.embed-frame .photo-round svg { width:22px;height:22px;display:block;pointer-events:none }
.embed-frame .photo-round:focus-visible { outline:2px solid var(--on-media);outline-offset:2px }
.embed-frame .photo-round:disabled { opacity:.35;cursor:default }
.embed-frame .photo-round[hidden] { display:none }
.embed-frame .photo-title { justify-self:center;min-width:0;max-width:100%;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;padding:5px 16px;border-radius:var(--radius-full);background:var(--photo-glass);box-shadow:var(--photo-glass-rim);-webkit-backdrop-filter:var(--photo-glass-blur);backdrop-filter:var(--photo-glass-blur);color:var(--on-media);font:var(--fw-medium) var(--fs-14)/var(--lh-tight) var(--font-sans);text-align:center }
.embed-frame .photo-title[hidden] { display:flex;visibility:hidden }
.embed-frame .photo-toolbar > [data-close] { grid-column:3;grid-row:1 }
.embed-frame .photo-toolbar > .photo-title { grid-column:2;grid-row:1 }
.embed-frame .photo-toolbar > [data-menu] { grid-column:1;grid-row:1 }
.embed-frame .photo-title strong { max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--fw-bold) }
.embed-frame .photo-title small { max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--fw-regular) var(--fs-12)/var(--lh-tight) var(--font-sans);color:color-mix(in srgb, var(--on-media) 78%, transparent) }
.embed-frame .photo-title small:empty { display:none }
.embed-frame .photo-title [data-date]:not(:empty) + [data-counter]:not(:empty)::before { content:"·";margin:0 6px }
.embed-frame .photo-title strong:empty { display:none }
.embed-frame .photo-menu { position:absolute;top:calc(100% + 8px);left:0;z-index:4;min-width:220px;max-width:calc(100vw - 24px);box-sizing:border-box;padding:6px;display:flex;flex-direction:column;gap:2px;border-radius:var(--radius-l);background:color-mix(in srgb, var(--media-bg) 72%, transparent);box-shadow:var(--photo-glass-rim);-webkit-backdrop-filter:var(--photo-glass-blur);backdrop-filter:var(--photo-glass-blur);color:var(--on-media) }
.embed-frame .photo-menu[hidden] { display:none }
.embed-frame .photo-menu-item { display:flex;align-items:center;gap:12px;min-height:44px;padding:0 12px;margin:0;border:0;border-radius:var(--radius-m);background:transparent;color:var(--on-media);font:var(--fw-regular) var(--fs-16)/var(--lh-tight) var(--font-sans);text-align:left;text-decoration:none;white-space:nowrap;cursor:pointer }
.embed-frame .photo-menu-item:hover { background:color-mix(in srgb, var(--on-media) 12%, transparent) }
.embed-frame .photo-menu-item:focus-visible { outline:0;background:color-mix(in srgb, var(--on-media) 16%, transparent) }
.embed-frame .photo-menu-item[hidden] { display:none }
.embed-frame .photo-menu-item svg { width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round }
.embed-frame .photo-menu-item--danger { color:var(--danger) }
.embed-frame .photo-stage { position:absolute;inset:0;z-index:1;isolation:isolate;display:flex;align-items:center;justify-content:center;overflow:hidden;min-height:0;touch-action:none }
.embed-frame .photo-stage img { max-width:100%;max-height:100%;object-fit:contain;cursor:default }
.embed-frame .photo-stage video { max-width:100%;max-height:100%;object-fit:contain;touch-action:auto }
.embed-frame .photo-stage [hidden] { display:none }
.embed-frame .photo-stage.zoomed { overflow:hidden }
.embed-frame .photo-stage.zoomed img { cursor:grab }
.embed-frame .photo-stage > .photo-round { position:absolute;top:50%;z-index:2;transform:translateY(-50%) }
.embed-frame .photo-stage > [data-prev] { left:max(12px, env(safe-area-inset-left)) }
.embed-frame .photo-stage > [data-next] { right:max(12px, env(safe-area-inset-right)) }
.embed-frame .photo-stage > .photo-round:disabled { visibility:hidden }
.embed-frame .photo-bottom { position:absolute;z-index:3;bottom:max(12px, env(safe-area-inset-bottom));left:max(12px, env(safe-area-inset-left));right:max(12px, env(safe-area-inset-right));display:flex;flex-direction:column;gap:10px;pointer-events:none }
.embed-frame .photo-bottom > * { pointer-events:auto }
.embed-frame .photo-caption { align-self:center;max-width:100%;box-sizing:border-box;padding:4px 12px;border-radius:var(--radius-full);background:var(--photo-glass);box-shadow:var(--photo-glass-rim);-webkit-backdrop-filter:var(--photo-glass-blur);backdrop-filter:var(--photo-glass-blur);font:var(--fs-12)/var(--lh-text) var(--font-sans);color:color-mix(in srgb, var(--on-media) 85%, transparent);text-align:center;overflow-wrap:anywhere }
.embed-frame .photo-caption:empty { display:none }
.embed-frame .photo-caption[hidden] { display:none }
.embed-frame .photo-playbar { display:flex;align-items:center;gap:10px;min-width:0;padding:4px 14px 4px 4px;border-radius:var(--radius-full);background:var(--photo-glass);box-shadow:var(--photo-glass-rim);-webkit-backdrop-filter:var(--photo-glass-blur);backdrop-filter:var(--photo-glass-blur);color:var(--on-media);font:var(--fw-medium) var(--fs-12)/var(--lh-tight) var(--font-sans);font-variant-numeric:tabular-nums }
.embed-frame .photo-playbar[hidden] { display:none }
.embed-frame .photo-playbar .photo-round { width:40px;height:40px;min-width:40px;background:transparent;box-shadow:none }
.embed-frame .photo-playbar input { flex:1;min-width:0;margin:0;accent-color:var(--on-media);cursor:pointer }
.embed-frame .photo-footer { display:grid;grid-template-columns:repeat(3,44px);justify-content:space-between;align-items:center }
.embed-frame .photo-footer[hidden] { display:none }
.embed-frame .photo-footer > [data-forward] { grid-column:1 }
.embed-frame .photo-footer > [data-edit] { grid-column:2 }
.embed-frame .photo-footer > [data-delete] { grid-column:3;color:var(--danger) }
.embed-frame .photo-footer > [data-back] { grid-column:1 }
.embed-frame .photo-footer > [data-send] { grid-column:3;background:var(--quote-accent);color:var(--on-media) }
.embed-frame .photo-footer > [data-send]:disabled { opacity:.45 }
.embed-frame .photo-toolbar > [data-check] { grid-column:3;grid-row:1 }
.embed-frame .photo-check { border:2px solid var(--on-media);font:var(--fw-bold) var(--fs-16)/var(--lh-tight) var(--font-sans);font-variant-numeric:tabular-nums }
.embed-frame .photo-check[aria-checked="true"] { background:var(--quote-accent) }
.embed-frame .photo-toolbar, .embed-frame .photo-bottom, .embed-frame .photo-stage > .photo-round { transition:opacity .2s ease }
.embed-frame .photo-viewer--bare .photo-toolbar, .embed-frame .photo-viewer--bare .photo-bottom, .embed-frame .photo-viewer--bare .photo-bottom > *, .embed-frame .photo-viewer--bare .photo-stage > .photo-round { opacity:0;pointer-events:none }
@media (hover:none) and (pointer:coarse) { .embed-frame .photo-stage > .photo-round { display:none } }
@media (prefers-reduced-motion:reduce) { .embed-frame .photo-toolbar, .embed-frame .photo-bottom, .embed-frame .photo-stage > .photo-round { transition:none } }
