/* M9: the floating "+" (menu + bottom sheet) and the conversation pages. Tokens only, from portal.css. */
.compose [hidden], .compose[hidden] { display: none !important; }

/* Room at the bottom of every page so the last card's buttons stay reachable above the round button. */
.app.has-compose .app-body { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

/* The button sits bottom-right just above the tab bar (tab bar = 66px + the safe-area inset). */
.compose { position: static; }
.compose-fab {
  position: absolute; z-index: 30; right: 16px; bottom: calc(66px + 14px + env(safe-area-inset-bottom, 0px));
  width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center; text-decoration: none;
  color: var(--cream); border: 1px solid #54402F; -webkit-tap-highlight-color: transparent;
  background: linear-gradient(180deg, #8C7261, var(--script));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.16),
    0 3px 5px rgba(33, 31, 32, 0.18), 0 14px 24px -10px rgba(33, 31, 32, 0.55);
  transition: transform .18s var(--ease), box-shadow .22s var(--ease), filter .2s var(--ease);
}
.compose-fab svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.compose-fab:active { transform: translateY(1px) scale(0.96); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.22), 0 1px 1px rgba(33, 31, 32, 0.12); }
.compose-fab:focus-visible, .compose-opt:focus-visible { outline: 3px solid var(--script); outline-offset: 3px; }
.compose.is-open .compose-fab svg { transform: rotate(135deg); }
.compose-dot { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 999px; background: var(--alert); border: 3px solid var(--cream); }

.compose-dim { position: absolute; inset: 0; z-index: 20; background: rgba(33, 31, 32, 0.45); opacity: 0; transition: opacity .25s var(--ease); }
.compose.is-open .compose-dim { opacity: 1; }

/* Three labelled round choices rise above the button, nearest first. */
.compose-menu { list-style: none; margin: 0; padding: 0; position: absolute; z-index: 30; right: 16px; bottom: calc(66px + 14px + 64px + 12px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; justify-items: end; }
.compose-menu li { display: flex; align-items: center; gap: 12px; opacity: 0; transform: translateY(14px) scale(0.9); transform-origin: right bottom; transition: opacity .25s var(--ease), transform .3s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
/* --i = place counted from the bottom (the button), so the nearest choice moves first. It was an inline style on each
   li; the page's CSP allows no style attributes. The client menu has 4 choices, the studio + menu 5. */
.compose-menu li:nth-last-child(2) { --i: 1; }
.compose-menu li:nth-last-child(3) { --i: 2; }
.compose-menu li:nth-last-child(4) { --i: 3; }
.compose-menu li:nth-last-child(5) { --i: 4; }
.compose.is-open .compose-menu li { opacity: 1; transform: none; }
.compose-label { font: 700 17px/1 var(--f-body); color: var(--charcoal); background: var(--paper); padding: 12px 16px; border-radius: 999px; box-shadow: 0 2px 3px rgba(33, 31, 32, 0.12), 0 8px 16px -10px rgba(33, 31, 32, 0.5); }
.compose-opt {
  width: 56px; height: 56px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; color: var(--charcoal);
  border: 1px solid rgba(33, 31, 32, 0.16); background: linear-gradient(180deg, #FFFFFF, var(--key-bottom, #EFE8DE));
  box-shadow: inset 0 1px 0 #FFFFFF, inset 0 -3px 0 rgba(106, 85, 70, 0.10), 0 2px 3px rgba(33, 31, 32, 0.10), 0 10px 18px -12px rgba(33, 31, 32, 0.45);
  -webkit-tap-highlight-color: transparent; transition: transform .18s var(--ease), box-shadow .22s var(--ease);
}
.compose-opt svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.compose-opt:active { transform: translateY(1px) scale(0.96); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.18); }

/* The bottom sheet. */
.compose-sheet {
  position: absolute; z-index: 40; left: 0; right: 0; bottom: 0; max-height: 92%; overflow-y: auto;
  background: var(--cream); border-radius: 26px 26px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 30px -12px rgba(33, 31, 32, 0.45); transform: translateY(100%); transition: transform .35s var(--ease);
}
.compose.sheet-open .compose-sheet { transform: none; }
.compose.sheet-open .compose-dim { opacity: 1; }
.compose-sheet form, .msg-form { display: grid; gap: 14px; }
.msg-q { font: 36px/1.15 var(--f-script); color: var(--script); -webkit-text-stroke: 0.3px currentColor; }
.compose-sheet textarea, .msg-form textarea {
  width: 100%; min-height: 120px; padding: 14px 16px; font: 500 19px/1.45 var(--f-body); color: var(--charcoal); resize: vertical;
  background: var(--paper); border: 1px solid rgba(33, 31, 32, 0.2); border-radius: 16px; -webkit-appearance: none; appearance: none;
}
.compose-sheet textarea:focus, .msg-form textarea:focus { outline: 3px solid var(--script); outline-offset: 2px; }
.compose-thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.compose-thumbs:empty { display: none; }
.compose-thumbs li { position: relative; width: 84px; height: 84px; }
.compose-thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; border: 1px solid rgba(33, 31, 32, 0.16); }
.compose-thumbs button {
  position: absolute; top: -10px; right: -10px; width: 34px; height: 34px; border-radius: 999px; cursor: pointer; display: grid; place-items: center;
  border: 2px solid var(--cream); background: var(--charcoal); color: var(--cream); font: 700 18px/1 var(--f-body);
}
.compose-err, .msg-err { margin: 0; font-size: 16px; line-height: 1.4; }
.compose-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.compose-row .btn-outline { min-height: 48px; padding: 0 18px; font-size: 16px; }
.compose-row .btn-quiet { margin-left: auto; }
.msg-send { width: 100%; min-height: 60px; font-size: 19px; }
.compose-sheet .msg-send[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* The conversation, like phone texting. */
.msg-thread { margin: 6px 0 18px; }
.msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.msg { display: grid; gap: 4px; max-width: 86%; }
.msg-mine { justify-self: end; justify-items: end; }
.msg-theirs { justify-self: start; justify-items: start; }
.msg-who { font: 26px/1 var(--f-script); color: var(--script); -webkit-text-stroke: 0.2px currentColor; }
.msg-bubble { padding: 12px 16px; border-radius: 22px; display: grid; gap: 10px; overflow-wrap: anywhere; }
.msg-client .msg-bubble { background: var(--charcoal); color: var(--cream); border-bottom-right-radius: 6px; }
.msg-studio .msg-bubble { background: var(--linen); color: var(--charcoal); border-bottom-left-radius: 6px; }
.msg-text { margin: 0; font: 500 18px/1.45 var(--f-body); white-space: pre-wrap; }
.msg-photos { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.msg-photos-1 { grid-template-columns: minmax(0, 1fr); }
.msg-photos a { display: block; border-radius: 14px; overflow: hidden; }
.msg-photos img { display: block; width: 100%; height: 130px; object-fit: cover; }
.msg-photos-1 img { height: auto; max-height: 280px; }
.msg-time { font: 500 13px var(--f-body); color: var(--muted); }
.msg-empty { font-size: 17px; color: var(--muted); margin: 0 0 12px; }
.msg-photo-pick { display: grid; gap: 6px; font: 600 15px var(--f-body); color: var(--charcoal); }
.msg-photo-pick input { font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  .compose-fab, .compose-fab svg, .compose-dim, .compose-menu li, .compose-sheet, .compose-opt { transition: none; }
  .compose-menu li { transition-delay: 0s; }
}

/* ---------- one centre button (owner 2026-11-17: "One center button for both") ----------
   Centred on the tab bar's top edge, half in and half out, see-through glass like the other keys; its menu
   (Search, Write to Angel, Add a photo, Take a photo) rises centred above it. */
.compose-fab {
  left: 50%; right: auto; bottom: calc(var(--tabbar-h, 66px) - 30px + env(safe-area-inset-bottom, 0px) * 0);
  transform: translateX(-50%); width: 60px; height: 60px; color: var(--charcoal);
  border: 3px solid rgba(255, 248, 241, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(239, 232, 222, 0.58));
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: var(--glass-edge, inset 0 1px 0 rgba(255,255,255,.85)), 0 2px 4px rgba(33, 31, 32, 0.10), 0 12px 24px -8px rgba(33, 31, 32, 0.40);
  transition: transform var(--t-release, .5s) var(--ease), box-shadow var(--t-release, .5s) var(--ease);
}
.compose-fab:active { transform: translateX(-50%) translateY(1px) scale(0.96); box-shadow: inset 0 2px 5px rgba(33, 31, 32, 0.16), 0 1px 1px rgba(33, 31, 32, 0.08); }
.compose-fab svg { width: 28px; height: 28px; stroke-width: 2.2; transition: transform .5s var(--ease); }
.compose-menu { left: 50%; right: auto; transform: translateX(-50%); justify-items: center; bottom: calc(var(--tabbar-h, 66px) + 46px); }
.compose-menu li { flex-direction: row; transform-origin: center bottom; transition: opacity .4s var(--ease), transform .45s var(--ease); transition-delay: calc(var(--i, 0) * 50ms); }
.compose-menu li .compose-label { min-width: 132px; text-align: right; }
.compose-opt { text-decoration: none; display: grid; place-items: center; color: var(--charcoal); }
.compose-menu .compose-opt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(239, 232, 222, 0.62));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--glass-edge, inset 0 1px 0 rgba(255,255,255,.85)), 0 2px 4px rgba(33, 31, 32, 0.10), 0 10px 20px -8px rgba(33, 31, 32, 0.35);
}
.app.has-compose .app-body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

/* smaller circle, same big touch area (owner: "do we need circle to look so big ... just leave touch that large") */
.compose-fab { width: 46px; height: 46px; bottom: calc(var(--tabbar-h, 66px) - 23px); border-width: 2px; }
.compose-fab::before { content: ""; position: absolute; inset: -9px; border-radius: 999px; } /* 64px tap target */
.compose-fab svg { width: 24px; height: 24px; }
.compose-dot { top: -2px; right: -2px; width: 14px; height: 14px; }

/* the + sits fully inside the bar, level with the icons (owner 2026-11-17: "lower plus icon and container fully into nav") */
.compose-fab { bottom: calc(var(--tabbar-h, 66px) - 59px); box-shadow: var(--glass-edge, inset 0 1px 0 rgba(255,255,255,.85)), 0 1px 2px rgba(33, 31, 32, 0.12), 0 6px 12px -6px rgba(33, 31, 32, 0.35); }

/* menu rows on one grid: labels end at the same line, every round key stacked straight above the + (owner
   2026-11-17: "the alignment looks bad") */
.compose-menu { width: min(92vw, 380px); justify-items: stretch; }
.compose-menu li { display: grid; grid-template-columns: 1fr 56px 1fr; align-items: center; column-gap: 12px; }
.compose-menu li .compose-label { grid-column: 1; justify-self: end; min-width: 0; text-align: right; white-space: nowrap; }
.compose-menu li .compose-opt { grid-column: 2; justify-self: center; }
