/* Shared personal workspace, with a single conversation as the focal point. */
.ui-icon { display:inline-block; width:20px; height:20px; flex-shrink:0; vertical-align:middle; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.chat-mark .ui-icon,.assistant-symbol .ui-icon { width:26px; height:26px; }
.welcome-mark .ui-icon { width:38px; height:38px; }
.chat-menu summary .ui-icon,.text-link .ui-icon { width:16px; height:16px; }
.chat-suggestions .ui-icon { width:18px; height:18px; color:var(--accent); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
[hidden] { display:none!important; }
.assistant-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:20px; }
.assistant-heading h1 { margin-bottom:0; }
.assistant-heading .eyebrow { margin-bottom:8px; }
.assistant-heading .text-link { font-size:.8rem; }
.chat-workspace { display:flex; flex-direction:column; height:calc(100dvh - 250px); min-height:min(490px,calc(100dvh - 250px)); max-height:1000px; background:#fff; border:1px solid #e2e7ee; border-radius:26px; box-shadow:0 16px 50px #14243d06; overflow:hidden; }
.chat-header { display:flex; align-items:center; justify-content:space-between; padding:18px 26px; border-bottom:1px solid var(--line); gap:12px; }
.chat-identity { display:flex; align-items:center; gap:12px; min-width:0; }
.chat-mark { display:grid; place-items:center; flex:none; width:42px; height:42px; border-radius:15px; background:#eef2f7; color:var(--accent); font-size:1.8rem; }
.chat-identity strong { display:block; font-size:.9rem; }
#ai-availability { display:block; color:var(--muted); font-size:.7rem; }
.chat-tools { display:flex; gap:8px; }
.chat-menu { position:relative; }
.chat-menu summary { display:flex; align-items:center; gap:10px; cursor:pointer; padding:10px 12px; border:1px solid var(--line); border-radius:12px; font-size:.78rem; list-style:none; white-space:nowrap; }
.chat-menu summary::-webkit-details-marker { display:none; }
.chat-popover { position:absolute; z-index:15; top:calc(100% + 8px); right:0; width:280px; max-width:calc(100vw - 44px); max-height:380px; overflow:auto; padding:18px; border:1px solid var(--line); border-radius:18px; box-shadow:0 15px 50px #14243d20; background:white; }
.chat-popover button { width:100%; margin:4px 0; font-size:.76rem; justify-content:flex-start; text-align:left; }
.chat-popover p { font-size:.78rem; margin:10px 0 0; }
.chat-scroll { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:24px 30px; scroll-behavior:smooth; }
.chat-scroll:has(#ai-empty:not([hidden])) { padding-block:12px; }
.chat-welcome { text-align:center; max-width:650px; margin:clamp(6px,3vh,40px) auto; }
.welcome-mark { display:grid; place-items:center; width:68px; height:68px; margin:0 auto 22px; border:1px solid #e4e9ef; border-radius:23px; color:var(--accent); background:linear-gradient(145deg,#fff,#edf2f7); box-shadow:0 8px 20px #14243d05; font-size:2.7rem; }
.chat-welcome .eyebrow { justify-content:center; font-size:.6rem; letter-spacing:.15em; }
.chat-welcome .eyebrow::before { display:none; }
.chat-welcome h2 { font-size:clamp(1.6rem,2.5vw,2.2rem); font-weight:500; line-height:1.25; letter-spacing:-.045em; }
.chat-welcome p { font-size:.86rem; }
.chat-suggestions { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; margin-top:24px; }
.chat-suggestions button { font-size:.74rem; min-height:42px; padding:9px 13px; border-radius:12px; }
.chat-suggestions button span { font-size:1.1rem; color:var(--accent); }
.chat-message { display:flex; flex-direction:column; align-items:flex-start; margin:0 0 24px; }
.chat-message.user { align-items:flex-end; }
.message-label { font-size:.65rem; color:var(--muted); margin:0 4px 6px; }
.message-text { max-width:90%; white-space:pre-wrap; overflow-wrap:anywhere; font-size:.9rem; line-height:1.75; }
.user .message-text { background:#eef2f7; padding:12px 18px; border-radius:18px 18px 4px 18px; }
.chat-message img { max-width:min(240px,80%); max-height:230px; object-fit:contain; border-radius:16px; margin:6px 0; }
.chat-composer-wrap { padding:0 24px 14px; background:#fff; }
.chat-composer { padding:13px 16px 12px; border:1px solid #dce3ed; border-radius:20px; background:#fcfdff; box-shadow:0 3px 12px #14243d04; }
.chat-composer:focus-within { border-color:#839fc5; box-shadow:0 0 0 3px #28549a08; }
.chat-composer textarea { min-height:48px; max-height:160px; width:100%; resize:vertical; margin:0; padding:2px; border:0; outline:none; background:transparent; font-size:.9rem; box-shadow:none; }
.composer-bottom { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:6px; }
.attach-button { background:transparent; color:var(--muted); box-shadow:none; padding:8px 9px; min-height:40px; font-size:.78rem; }
#ai-send { min-height:42px; border-radius:12px; padding:9px 16px; font-size:.78rem; background:var(--navy); }
.composer-note { margin:8px 0 0; font-size:.65rem; text-align:center; color:#7d8797; }
#premium-status:not(:empty) { padding:8px 0; font-size:.8rem; color:var(--accent); }
#ai-attachment { display:flex; align-items:center; gap:12px; margin-bottom:10px; font-size:.75rem; }
#ai-attachment img { width:56px; height:56px; border-radius:10px; object-fit:cover; }
#ai-attachment button { min-height:32px; padding:5px 10px; }
.chat-draft { padding:20px; margin:14px 0; background:#f7f9fc; border:1px solid var(--line); border-radius:18px; }
.chat-draft summary { cursor:pointer; font-weight:600; font-size:.88rem; }
.chat-draft p,.chat-draft label { font-size:.78rem; }
.chat-draft .fields { margin-top:10px; }
.draft-ingredient { border-top:1px solid var(--line); padding:14px 0; }
.draft-macros { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.draft-macros input { padding:8px; }
.draft-total { padding:10px 14px; border-radius:10px; background:#e9eef5; font-size:.82rem; }
.subscription-intro { margin-bottom:28px; }
.subscription-hero { display:grid; grid-template-columns:1fr 1fr; gap:30px; color:white; background:linear-gradient(120deg,#14243d,#294566); border:0; padding:32px; }
.subscription-hero p,.subscription-hero small { color:#d3dce9; }
.subscription-hero h2 { font-size:2.3rem; margin:8px 0; }
.subscription-hero .eyebrow { color:#d4be9e; }
.subscription-quota { align-self:center; padding-left:28px; border-left:1px solid #ffffff26; }
.subscription-quota strong { font-size:2rem; font-weight:500; }
.subscription-quota progress { margin:14px 0; }
.plan-card ul { padding-left:20px; font-size:.87rem; color:var(--muted); line-height:2; }
.plan-premium { background:#f3f6fa; }
.plan-card .tag { margin-bottom:16px; }
.offer-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.premium-offer { border:1px solid var(--line); border-radius:16px; padding:18px; }
.premium-offer strong { display:block; font-size:1.1rem; margin:8px 0; }
.premium-offer p { font-size:.72rem; }
.premium-offer button { width:100%; padding:10px; font-size:.78rem; }
@media (max-height:800px) {
  .chat-welcome { margin:0 auto; }.chat-welcome .welcome-mark,.chat-welcome .eyebrow { display:none; }
  .chat-welcome h2 { font-size:1.65rem; margin-bottom:12px; }.chat-welcome p { margin:0 0 14px; }
  .chat-suggestions { margin-top:12px; }
}
@media (min-width:1100px) { body:has([data-section=assistant]:not([hidden])) .shell { padding-top:24px; padding-bottom:20px; } }
@media (max-width:1099px) { .chat-workspace { height:calc(100dvh - 295px); } }
@media (max-width:700px) {
  body:has([data-section=assistant]:not([hidden])) .shell { padding:14px 12px 92px; }
  .assistant-heading { margin-bottom:12px; padding:0 4px; gap:8px; }
  .assistant-heading h1 { font-size:1.65rem; }.assistant-heading .eyebrow { display:none; }
  .assistant-heading .text-link { font-size:.7rem; }
  .chat-workspace { height:calc(100dvh - 232px); min-height:390px; border-radius:20px; }
  .chat-header { padding:12px; }.chat-identity { gap:8px; }.chat-mark { width:34px; height:34px; }
  .chat-identity strong { font-size:.8rem; }#ai-availability { font-size:.62rem; }
  .chat-menu summary { padding:8px; font-size:.7rem; }.chat-tools { gap:5px; }
  .chat-scroll { padding:20px 16px; }.chat-welcome { margin:4px auto; }
  .welcome-mark { width:48px; height:48px; font-size:2rem; margin-bottom:16px; }
  .chat-welcome .eyebrow { font-size:.5rem; }.chat-welcome p { font-size:.78rem; }
  .chat-suggestions { margin-top:18px; gap:6px; }.chat-suggestions button { font-size:.67rem; padding:7px 9px; min-height:36px; }
  .chat-composer-wrap { padding:0 10px 10px; }.chat-composer { padding:10px; border-radius:16px; }
  .chat-composer textarea { font-size:16px; }.composer-note { font-size:.56rem; }
  .message-text { max-width:96%; font-size:.86rem; }.chat-draft { padding:14px; }
  .draft-macros { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .subscription-hero { grid-template-columns:1fr; gap:16px; padding:24px; }.subscription-quota { border:0; padding:0; }
  .offer-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.keyboard .chat-workspace { height:calc(100dvh - 155px); min-height:230px; }
}

/* Let the conversation fill the space between the header and navigation. */
body:has([data-section=assistant]:not([hidden])) { height:100dvh; display:flex; flex-direction:column; overflow:hidden; }
body:has([data-section=assistant]:not([hidden])) > .top { flex-shrink:0; }
body:has([data-section=assistant]:not([hidden])) .shell { flex:1; min-height:0; width:100%; max-width:none; margin:0; padding:16px 20px calc(88px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; }
[data-section=assistant]:not([hidden]) { display:flex; flex:1; min-height:0; flex-direction:column; }
.assistant-heading { flex-shrink:0; margin-bottom:12px; }
.assistant-heading h1 { margin-top:0; font-size:clamp(1.65rem,2.5vw,2.2rem); }
[data-section=assistant] .chat-workspace { flex:1; height:auto; min-height:0; max-height:none; }
.chat-header,.chat-composer-wrap { flex-shrink:0; }
@media (min-width:1100px) {
  body:has([data-section=assistant]:not([hidden])) .shell { width:calc(100% - 260px); margin-left:260px; padding:20px 28px 20px 0; }
}
@media (max-width:700px) {
  body:has([data-section=assistant]:not([hidden])) .shell { padding:12px 10px calc(88px + env(safe-area-inset-bottom)); }
}
body.keyboard:has([data-section=assistant]:not([hidden])) .shell { padding-bottom:8px; }
