/* Chat-first journal (protocol 2): receipt cards, in-chat questions and the one-line composer.
   Same warm palette as fitness.css (cream bubbles, coral accent, brown ink). */
.chat-log .bubble.turn-reply{white-space:normal;width:min(94%,560px);max-width:94%}
.turn-reply>*+*{margin-top:8px}
.turn-understood{font-size:13px;color:#6b5a54;margin:0 0 6px!important}
.turn-understood small{font-weight:700;opacity:1}
.turn-receipts{display:flex;flex-direction:column;gap:8px}
.turn-receipt{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 10px;align-items:start;padding:10px 12px;border:1px solid #eadfd5;border-radius:14px;background:#fffdfb;box-shadow:0 1px 3px #332b2812}
.turn-receipt-icon{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:#fff0e9;color:#9f4d39}
.turn-receipt-icon .ui-icon{width:18px;height:18px}
.turn-receipt-body{min-width:0}
.turn-receipt-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;line-height:1.4}
.turn-op{font-size:13px;font-weight:800;color:#9f4d39;white-space:nowrap}
.turn-title{font-size:15px;color:#261f29;overflow-wrap:anywhere}
.turn-day-chip{font-size:12px;font-weight:700;color:#5c4a45;background:#f3e9df;border-radius:999px;padding:1px 8px}
.turn-note{margin:4px 0 0!important;font-size:13px;color:#5b4a70;line-height:1.4}
.turn-values{font-size:14px;font-weight:700;color:#332b28;margin-top:2px}
.turn-items{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.turn-chip{font-size:13px;line-height:1.35;color:#4a3d3a;background:#f6eee6;border-radius:999px;padding:3px 9px;overflow-wrap:anywhere}
.turn-chip.is-assumed{background:#fff6ee;border:1px dashed #e6cdb8}
.turn-assumption{font-size:13px;color:#735f58;margin:6px 0 0!important;line-height:1.45}
.turn-changes{margin:6px 0 0;padding-inline-start:18px;font-size:13px;color:#4a3d3a}
.turn-changes li{margin:2px 0}
.turn-receipt-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;align-items:center}
.turn-receipt-actions button{min-height:36px;padding:6px 14px;font-size:14px;border-radius:999px;border:1px solid #eadfd5;background:#fff;color:#5c4a45}
.turn-receipt-actions .turn-undo{color:#9f4d39;border-color:#efcbbd}
.turn-receipt.is-undone{opacity:.72;background:#faf6f2}
.turn-receipt.is-undone .turn-title,.turn-receipt.is-undone .turn-values{text-decoration:line-through}
.turn-undone-label{font-size:13px;font-weight:700;color:#735f58}
.turn-rejected{font-size:14px;color:#6b4137;background:#fff2eb;border-radius:10px;padding:6px 10px;margin:0!important}
.turn-still-open{font-size:14px;color:#5b4a3f;background:#fbf4e8;border-radius:10px;padding:6px 10px;margin:0!important}
.turn-pending{border:1px solid #efcbbd;background:#fff6f0;border-radius:14px;padding:10px 12px}
.turn-pending>small{display:block;font-size:12px;color:#735f58;font-weight:700}
.turn-pending .chat-question{margin:2px 0 8px!important}
.turn-quick{display:flex;flex-wrap:wrap;gap:6px}
/* Up to three option buttons plus "answer in a message": they wrap two or three to a row. */
.turn-quick button{flex:1 1 140px;min-height:44px;padding:7px 14px;font-size:14px;border-radius:999px;line-height:1.3}
.turn-quick button.ghost{flex:0 1 auto}
.turn-pending-closed{font-size:13px;color:#735f58;margin:0!important}
.turn-pending-closed small{font-weight:700}
.turn-coach{white-space:pre-wrap;margin:0!important}
.turn-speech{justify-self:start;min-height:44px;padding-inline:10px}
.turn-speech[aria-pressed="true"]{background:#f8e5d6;color:#653b30}
.turn-next{margin:0!important}
.turn-budget{font-size:13px;font-weight:700;color:#5c4a45;background:#f3e9df;border-radius:10px;padding:5px 10px;margin:0!important;display:inline-block}
.turn-pending-strip{align-self:stretch;display:flex;flex-direction:column;gap:8px;flex-shrink:0}
.chat-log .chat-crisis{flex-shrink:0}

/* One-line composer at every width: [camera] [text] [mic] [send]. Mobile rules in fitness.css match this. */
.chat-form.chat-composer{display:flex;position:relative;align-items:flex-end;gap:3px;min-height:52px;padding:4px;border:1px solid #eadfd5;border-radius:26px;background:#f8f3ee;box-shadow:0 2px 12px #59403812}
.chat-form.chat-composer .chat-tools{display:contents}
.chat-form.chat-composer textarea{order:2;flex:1;width:auto;min-width:0;height:42px;min-height:42px;max-height:none;grid-column:auto;border:0;background:transparent;box-shadow:none;outline:0;padding:9px 5px;resize:none;line-height:1.45;font-size:16px}
.chat-form.chat-composer #attach-chat-photo,.chat-form.chat-composer #chat-voice{flex:0 0 40px;width:40px;height:42px;min-height:42px;padding:8px;background:transparent;color:#5c4a45;font-size:0;justify-content:center;border:0;box-shadow:none}
.chat-form.chat-composer #attach-chat-photo{order:1}
.chat-form.chat-composer #chat-voice{order:3}
.chat-form.chat-composer #attach-chat-photo .ui-icon,.chat-form.chat-composer #chat-voice .ui-icon{width:22px;height:22px}
.chat-form.chat-composer>button[type=submit]{order:4;flex:0 0 42px;width:42px;height:42px;min-height:42px;border-radius:50%;padding:0;font-size:0;align-self:flex-end}
.chat-form.chat-composer>button[type=submit]:after{content:'↑';font-size:25px;line-height:1}
.chat-form.chat-composer .error:not(:empty),.chat-form.chat-composer .chat-send-status:not([hidden]){position:absolute;bottom:calc(100% + 7px);inset-inline:5px auto;max-width:calc(100% - 10px);background:#fffdfb;padding:7px 9px;border:1px solid #eadfd5;border-radius:12px;box-shadow:0 3px 12px #59403817;z-index:1;font-size:13px}
.chat-form.chat-composer .error:empty{display:none}
.chat-panel:has(.chat-form.chat-composer .error:not(:empty)) .chat-log{padding-bottom:64px}
body.chat-keyboard-open .chat-form.chat-composer textarea{height:auto;max-height:none}
@media(max-width:650px){
 .chat-log .bubble.turn-reply{width:96%;max-width:96%}
 .turn-receipt{padding:9px 10px}
 .turn-receipt-icon{width:28px;height:28px}
 .chat-form.chat-composer #attach-chat-photo,.chat-form.chat-composer #chat-voice{flex-basis:37px;width:37px}
}
