/* The saved Shared designs list uses the dialog's ordinary flow. */
#room-share.share-composer {
  --share-line: #bbb3a6;
  width:min(62rem, calc(100vw - 3rem)); height:min(41rem, calc(100dvh - 3rem));
  max-width:none; max-height:none; padding:0; overflow:hidden; background:var(--dlg-paper);
}
.share-composer [data-content] {
  display:grid; grid-template-columns:minmax(0,53fr) minmax(0,47fr);
  grid-template-rows:auto minmax(0,1fr) auto; height:100%; min-height:0;
  grid-template-areas:"preview head" "preview choices" "preview foot";
}
.share-composer .share-close { z-index:1; width:44px; height:44px; line-height:1; }
.share-head { min-width:0; grid-area:head; padding:1.25rem 1.6rem 0; }
#room-share .share-head h2 { font-size:1.7rem; line-height:1.2; margin:0 2.5rem .5rem 0; }
#room-share .share-head .compare-tabs { max-width:100%; padding:3px; border:0; background:#e9e5de; margin:.25rem 0 .2rem; }
#room-share .share-head .compare-tabs button { min-width:0; white-space:normal; line-height:1.15; padding:.45rem .8rem; border:0; border-radius:2rem; min-height:2.5rem; color:var(--muted); }
#room-share .share-head .compare-tabs [aria-pressed=true] { background:white; color:var(--ink); box-shadow:inset 0 0 0 1px #0002,0 1px 2px #0001; }
.share-stage { grid-area:preview; display:grid; grid-template-rows:auto minmax(0,1fr); gap:.6rem; min-width:0; min-height:0; padding:1.1rem 1.4rem 2rem; background:var(--paper-2); overflow:hidden; }
.share-stage-inner { display:flex; align-items:center; justify-content:center; min-height:0; min-width:0; }
.share-stage .share-card-preview { max-width:100%; height:100%; display:grid; place-items:center; grid-template: minmax(0,1fr) / minmax(0,1fr); }
.share-stage .share-card-preview img,.share-stage-inner > .share-thumb { display:block; width:auto; height:auto; max-height:100%; max-width:100%; object-fit:contain; box-shadow:0 8px 28px #3a2f2229; }
.share-label { font-size:.74rem; line-height:1.3; letter-spacing:.13em; text-transform:uppercase; color:#785a28; margin:0 0 .5rem; }
.share-message { width:min(100%,25rem); max-height:100%; display:flex; flex-direction:column; margin:0; background:#fff; border-radius:1rem; overflow:auto; box-shadow:0 8px 28px #3a2f2229; }
.share-message .share-thumb { width:100%; aspect-ratio:1.91; object-fit:cover; border-radius:0; max-height:none; min-height:0; }
.share-message > div { padding:.75rem 1rem; }
.share-message strong,.share-comparison strong { font-weight:500; }
.share-message span,.share-message small,.share-comparison small { display:block; color:var(--muted); font-size:.84rem; line-height:1.35; margin-top:.2rem; }
.share-comparison { width:100%; text-align:center; max-height:100%; overflow:auto; }
.share-comparison strong { display:block; margin:0 0 .65rem; font-size:1.25rem; }
.share-comparison .comparison-pair img { height:auto; width:100%; max-height:30dvh; aspect-ratio:1.5; object-fit:contain; }
.share-comparison figcaption { font-size:.86rem; }
.share-choices { display:flex; flex-direction:column; grid-area:choices; overflow:auto; overscroll-behavior:contain; padding:1.15rem 1.6rem .6rem; min-width:0; min-height:0; }
.share-choices > * { flex-shrink:0; }
.share-choices .share-status { margin-top:auto; padding-top:.45rem; }
.share-tiles { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem; }
#room-share .share-tile { position:relative; display:flex; flex-direction:column; align-items:start; gap:.6rem; justify-content:space-between; min-height:5.3rem; padding:.7rem; border:1px solid var(--share-line); background:#fcfaf6; color:var(--ink); border-radius:.5rem; text-align:left; font-size:.92rem; line-height:1.25; overflow-wrap:anywhere; cursor:pointer; }
.share-tile svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; }
#room-share .share-tile[aria-pressed=true],.share-composer .compare-options [aria-pressed=true] { background:white; color:var(--ink); border-color:var(--ink); box-shadow:inset 0 0 0 1px var(--ink); }
.share-composer .compare-options button { position:relative; border-radius:.3rem; }
.share-tile[aria-pressed=true]::after,.share-composer .compare-options [aria-pressed=true]::after { content:""; position:absolute; right:.4rem; top:.4rem; border-radius:50%; background:var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.6'%3E%3Cpath d='m4 8 3 3 5-6'/%3E%3C/svg%3E") center/1rem no-repeat; color:white; height:1rem; width:1rem; display:grid; place-items:center; font: .75rem/1 sans-serif; }
.share-options { margin-top:.85rem; }
.share-options label { display:flex; align-items:center; gap:.6rem; min-height:2.75rem; cursor:pointer; }
#room-share.share-composer input[type=checkbox]:checked { background:white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2318181b' stroke-width='2'%3E%3Cpath d='m5 10 3 3 7-7'/%3E%3C/svg%3E") center/100% no-repeat; box-shadow:inset 0 0 0 1px var(--ink); }
.share-options p,.share-foot p,.share-status { margin:.25rem 0 .55rem; color:var(--muted); font-size:.91rem; line-height:1.4; overflow-wrap:anywhere; }
.share-consent .share-thumb { max-height:7rem; }
.share-consent button { margin-right:.9rem; }
.share-foot { grid-area:foot; padding:1rem 1.6rem; min-width:0; border-top:1px solid var(--share-line); background:#fcfaf6; }
.share-buttons,.share-quiet,.share-copy { display:flex; align-items:center; gap:.4rem .65rem; flex-wrap:wrap; }
.share-quiet a,.share-quiet button { font-size:.9rem; color:var(--muted); text-underline-offset:.2em; }
.share-foot .share-address { flex:1 1 7rem; min-width:0; width:auto; }
#room-share .share-foot .share-button { display:inline-flex; justify-content:center; align-items:center; min-height:2.75rem; padding:.55rem .95rem; color:var(--ink); background:transparent; border:1px solid var(--share-line); border-radius:2rem; text-transform:none; text-decoration:none; letter-spacing:normal; font:inherit; font-size:.95rem; line-height:1.2; max-width:100%; text-align:center; cursor:pointer; }
#room-share .share-foot .share-button.primary { background:var(--ink); border-color:var(--ink); color:white; }
.share-foot [disabled],.share-foot [aria-disabled=true] { opacity:.55; }
.share-composer .share-pin-question { margin:0; padding:0; background:transparent; }
.share-composer .share-pin-row { grid-template-columns:minmax(0,1fr); }
.share-composer .share-pin-row figure { display:none; }
.share-stage-inner .share-pin-image { width:auto; height:100%; max-width:100%; max-height:100%; }
#room-share .share-status:empty { display:block; min-height:1lh; }
/* The phone sheet follows the approved hybrid. Only the choices and
   notices scroll vertically; the picture and final actions have their own rows. */
@media (max-width:640px), (max-height:500px) {
  #room-share.share-composer { position:fixed; inset:auto 0 0; margin:0; width:100%; height:94dvh; border-radius:14px 14px 0 0; }
  .share-composer [data-content] { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto auto; grid-template-areas:"head" "preview" "choices" "foot"; }
  .share-head { display:flex; align-items:center; gap:8px; min-height:54px; padding:6px 52px 6px 16px; }
  #room-share .share-head h2 { font-size:1.25rem; font-weight:300; line-height:1.15; margin:0 auto 0 0; }
  #room-share .share-head .compare-tabs { margin:0; padding:3px; flex-shrink:1; }
  #room-share .share-head .compare-tabs button { font-size:.8125rem; padding:3px 12px; min-height:32px; line-height:1.12; }
  .share-composer .share-close { top:5px; right:4px; }
  .share-stage { position:relative; display:block; padding:0; }
  .share-stage > .share-label, .share-choices > .share-label { display:none; }
  .share-stage-inner { position:absolute; inset:12px; container-type:size; }
  .share-stage .share-card-preview { display:grid; margin:0; width:100%; height:100%; }
  .share-stage .share-card-preview img { --card-ratio:.8; width:min(100cqw, calc(100cqh * var(--card-ratio))); height:auto; max-height:100%; }
  .share-stage [data-card=story] img { --card-ratio:.5625; }
  .share-stage [data-card=pin] img { --card-ratio:.666667; }
  .share-overlay { position:absolute; right:10px; bottom:2px; }
  .share-overlay label { display:flex; flex-direction:row-reverse; align-items:center; gap:8px; position:relative; isolation:isolate; min-height:44px; padding:3px 6px 3px 12px; font-size:.75rem; cursor:pointer; }
  .share-overlay label::before { content:""; position:absolute; z-index:-1; inset:6px 0; border-radius:30px; background:#fffffff5; box-shadow:0 1px 4px #0002; }
  #room-share.share-composer .share-overlay input { appearance:none; width:30px; height:18px; border:1px solid var(--share-line); border-radius:20px; margin:0; background:#d9d5cd; position:relative; box-shadow:none; }
  #room-share.share-composer .share-overlay input:checked { background:var(--ink); }
  .share-overlay input::before { content:""; position:absolute; top:1px; left:1px; width:14px; height:14px; border-radius:50%; background:white; }
  .share-overlay input:checked::before { left:13px; }
  .share-message { width:min(100%,330px); border-radius:14px; }
  .share-message > div > span { display:none; }
  .share-message > div { padding:8px 12px; font-size:.875rem; }
  .share-message small,.share-message span { font-size:.75rem; }
  .share-choices { padding:0; max-height:32dvh; overflow-y:auto; }
  .share-tiles { display:flex; flex:none; align-items:start; gap:14px; overflow-x:auto; padding:12px 16px 4px; scrollbar-width:none; mask-image:linear-gradient(90deg,#000 90%,transparent); }
  .share-tiles::-webkit-scrollbar { display:none; }
  #room-share .share-tile { display:grid; flex:0 0 max(56px,5.1em); justify-content:stretch; justify-items:center; min-height:0; gap:5px; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; font-size:.6875rem; font-weight:400; line-height:1.15; text-align:center; color:var(--muted); }
  .share-round-icon { display:grid; place-items:center; box-sizing:border-box; width:46px; height:46px; border-radius:50%; border:1px solid var(--share-line); background:white; color:var(--ink); }
  #room-share .share-tile[aria-pressed=true] { color:var(--ink); font-weight:500; background:transparent; box-shadow:none; }
  .share-tile[aria-pressed=true] .share-round-icon { border-color:var(--ink); box-shadow:inset 0 0 0 1px var(--ink); }
  .share-tile[aria-pressed=true]::after { display:none; }
  .share-round-icon svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; }
  .share-options { margin:0; padding-inline:16px; font-size:.8125rem; }
  .share-options label { display:inline-flex; margin-right:10px; min-height:32px; }
  .share-options:empty,#room-share .share-status:empty { display:none; }
  .share-status:not(:empty),.share-pin-question { margin:4px 16px; font-size:.8125rem; }
  .share-foot { margin-top:8px; padding:10px 16px max(12px,env(safe-area-inset-bottom)); border-color:#18181b29; }
  .share-foot > p { margin:0 0 8px; font-size:.78125rem; line-height:1.35; }
  .share-buttons { flex-wrap:nowrap; align-items:start; gap:12px; }
  #room-share .share-foot .share-button { min-height:44px; padding:4px 12px; font-size:.9375rem; }
  #room-share .share-foot .primary { flex:1 1 0; min-width:0; }
  #room-share .share-foot .share-round { display:grid; justify-items:center; align-items:start; align-content:start; flex:0 0 max(52px,4em); padding:0; min-height:44px; border:0; border-radius:0; font-size:.6875rem; line-height:1.15; gap:3px; }
  .share-foot .share-round-icon { width:44px; height:44px; background:transparent; }
  .share-foot .share-copy { display:flex; flex-wrap:nowrap; padding:3px; border:1px solid var(--share-line); border-radius:28px; background:#fff; }
  #room-share .share-copy .share-address { flex:1 1 0; min-height:32px; padding:0 8px; border:0; border-radius:0; background:none; font-size:.8125rem; }
  #room-share .share-copy .share-button { flex:none; min-height:36px; font-size:.8125rem; }
  .share-foot:has(.share-copy) { padding-block:5px max(3px,env(safe-area-inset-bottom)); }
  .share-quiet { gap:0 10px; margin-top:0; }
  #room-share .share-quiet :is(a,button),#room-share .share-settings-toggle { font-size:.8125rem; line-height:1.2; }
  .share-quiet .share-settings-toggle { margin-left:auto; }
  #room-share .share-foot p .share-button { display:inline; min-height:0; padding:0; border:0; border-radius:0; font:inherit; text-decoration:underline; }
  .share-comparison .comparison-pair img { max-height:18dvh; }
}
@media (max-width:360px) {
  .share-head { gap:3px; padding-inline:8px 43px; }
  #room-share .share-head .compare-tabs button { min-width:min-content; font-size:calc(.6875rem + 2px); padding-inline:clamp(1px,calc(21px - .63rem),12px); }
}
@media (max-width:360px) and (max-height:650px), (max-height:500px) {
  .share-stage:has(.share-overlay) .share-stage-inner { bottom:20px; }
}
@media (max-height:500px) {
  .share-head { min-height:42px; padding-block:2px; }
  .share-choices { max-height:27dvh; }
  .share-tiles { padding-block:4px; }
  .share-foot { margin-top:3px; padding-block:4px; }
  .share-foot > p { margin-bottom:3px; }
  .share-stage-inner { inset:4px 12px; }
}
@media (min-width:821px) and (min-height:650px) {
  .share-foot { min-height:8.6rem; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; }
  .share-foot .share-copy { align-self:stretch; }
}
