/* Familiar messenger geometry inside Ulya's existing Mystic palette. */
.space-dock button[data-space-target="account-settings"] .nav-medallion { --medallion-art:url('./assets/original-mystic/original-nav-profile.svg'); }
.space-dock button[data-space-target="chat-module"] .nav-medallion { --medallion-art:none; }
.space-dock button[data-space-target="chat-module"] .nav-medallion svg { display:block; }
.account-page[data-chat-open="true"] { overflow:hidden; }
.account-page[data-chat-open="true"] .app-shell > :not(#workspace):not(dialog),
.account-page[data-chat-open="true"] #workspace > :not(#conversation-workspace) { visibility:hidden; }
.account-page[data-chat-open="true"] #conversation-workspace { visibility:visible; }
.account-page #workspace > #conversation-workspace[data-chat-expanded="true"] {
  position:fixed; z-index:120; inset:var(--messenger-top,0px) 0 auto;
  display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; gap:0;
  width:100%; max-width:none; height:var(--messenger-height,100dvh); min-height:0;
  margin:0; padding:0; overflow:hidden; background:var(--bg-space,#010b15);
}
.account-page [data-chat-expanded="true"] #public-trial-paywall:not([hidden]) {
  flex:0 1 auto; min-height:0; max-height:32%; overflow-y:auto;
  margin:8px 12px; padding:12px 16px; visibility:visible;
}
.account-page [data-chat-expanded="true"] #chat-module {
  position:relative; display:flex; flex-direction:column; grid-column:1; grid-row:1;
  width:100%; max-width:960px; height:100%; min-height:0; margin:0 auto; padding:0;
  background:var(--bg-space,#010b15); border:0; border-radius:0; box-shadow:none;
}
.account-page .chat-heading-row { gap:12px; padding:12px 16px; border-bottom:1px solid var(--border-gold); }
.account-page .chat-avatar { flex:0 0 44px; width:44px; height:44px; border-radius:50%; object-fit:cover; border:1px solid var(--border-gold); }
.chat-title { flex:1; min-width:0; }
.account-page .chat-heading-row #dialogue-heading {
  position:static; width:auto; height:auto; padding:0; margin:0; clip-path:none;
  overflow:visible; white-space:normal; font:600 17px/1.35 var(--font-sans); letter-spacing:0; color:var(--text-main); text-align:left; text-wrap:wrap;
}
.chat-title p { margin:2px 0 0; font:400 12px/1.4 var(--font-sans); color:var(--text-muted); }
.account-page #chat-expand,.account-page #chat-history {
  display:flex; align-items:center; justify-content:center; gap:6px; flex:0 0 auto;
  width:44px; height:44px; min-width:44px; min-height:44px; padding:0;
  border:0; border-radius:12px; background:transparent; color:var(--gold-primary); box-shadow:none;
}
.account-page :is(#chat-expand,#chat-history) svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
#chat-expand-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.account-page [data-chat-expanded="false"] #chat-expand { width:auto; padding:0 8px; }
[data-chat-expanded="false"] #chat-expand svg { display:none; }
[data-chat-expanded="false"] #chat-expand-label { position:static; width:auto; height:auto; clip-path:none; }
.account-page [data-chat-expanded="true"] #messages {
  display:flex; flex:1 1 0; flex-direction:column; align-items:flex-start; gap:12px;
  width:100%; max-width:none; height:auto; max-height:none; min-height:0;
  padding:24px clamp(12px,3vw,32px); margin:0; scroll-behavior:auto;
}
.account-page [data-chat-expanded="true"] #messages:not(:has(.message)) {
  justify-content:center; align-items:center; text-align:center; color:var(--text-muted); font-size:16px; line-height:1.6;
}
.account-page [data-chat-expanded="true"] .message {
  width:fit-content; max-width:min(82%,68ch); min-width:0; padding:10px 15px;
  border:1px solid rgba(184,196,201,.12); border-radius:16px 16px 16px 4px;
  background:var(--surface-elevated,#101e31); box-shadow:0 2px 4px #0002;
}
.account-page [data-chat-expanded="true"] .message[data-speaker="user"] {
  align-self:flex-end; background:#253342; border-color:rgba(207,177,121,.22); border-radius:16px 16px 4px 16px;
}
.account-page [data-chat-expanded="true"] .message[data-speaker="ulya"] { margin-left:0; border-left-width:1px; }
.account-page [data-chat-expanded="true"] .message::before { display:none; }
.account-page [data-chat-expanded="true"] .message > strong { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.account-page [data-chat-expanded="true"] .message p { margin:0; font:400 16px/1.6 var(--font-sans); color:var(--text-main); }
.account-page [data-chat-expanded="true"] #send-form {
  flex:0 1 auto; min-height:0; max-height:60%; overflow-y:auto; overscroll-behavior:contain;
  width:100%; max-width:none; margin:0; padding:12px 16px calc(8px + env(safe-area-inset-bottom));
  border-top:1px solid var(--border-gold); background:var(--bg-space,#010b15); scrollbar-width:thin;
}
.account-page .chat-module .question-label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.account-page [data-chat-expanded="true"] .compose-glass {
  align-items:flex-end; gap:8px; padding:6px; border-radius:28px;
  background:var(--surface-elevated,#101e31); border-color:rgba(184,196,201,.28);
  backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:none;
}
.account-page [data-chat-expanded="true"] #question {
  display:block; flex:1 1 auto; width:100%; min-width:0; min-height:44px; max-height:160px;
  padding:10px 8px 10px 12px; margin:0; border:0; border-radius:20px;
  background:transparent; box-shadow:none; font:400 16px/1.5 var(--font-sans);
  color:var(--text-main); caret-color:var(--gold-primary); resize:none; overflow-y:auto;
}
.account-page [data-chat-expanded="true"] #question::placeholder { color:var(--text-muted); opacity:1; }
.account-page [data-chat-expanded="true"] .compose-glass :is(#voice-start,#send) { width:44px; height:44px; min-width:44px; min-height:44px; flex:0 0 44px; }
.account-page [data-chat-expanded="true"] .compose-glass #send { background:var(--gold-primary); color:#010b15; border:0; box-shadow:none; }
[data-chat-expanded="true"] .send-medallion { display:none; }
.account-page [data-chat-expanded="true"] .compose-glass #send svg { width:23px; height:23px; filter:none; }
.account-page [data-chat-expanded="true"] .compose-glass #voice-start { color:var(--text-muted); }
.account-page [data-chat-expanded="true"] .compose-glass #voice-start[data-recording="true"] { color:var(--gold-primary); background:var(--surface-card-hover); }
.account-page [data-chat-expanded="true"] .composer-footer { align-items:center; flex-flow:row wrap; gap:4px 12px; padding:4px 4px 0; }
.account-page [data-chat-expanded="true"] .composer-footer > label { font-size:12px; color:var(--text-muted); }
.account-page [data-chat-expanded="true"] #tone { font-size:16px; min-height:44px; max-width:none; color:var(--gold-primary); }
.account-page .tone-control-copy { display:contents; }
.account-page .tone-control-title { grid-column:1; grid-row:1; }
.account-page .tone-control-hint { grid-column:1 / -1; grid-row:2; font-size:12px; }
.account-page .tone-control #tone { grid-column:2; grid-row:1; }
.account-page [data-chat-expanded="true"] .voice-details { margin-left:auto; font-size:12px; color:var(--text-muted); }
.account-page [data-chat-expanded="true"] .voice-details summary { min-height:44px; display:flex; align-items:center; }
.account-page [data-chat-expanded="true"] .voice-details[open] { flex-basis:100%; }
.chat-keyboard-hint { display:none; font-size:12px; line-height:1.4; color:var(--text-muted); }
.account-page [data-chat-expanded="true"] #feedback { margin:0 4px 4px; color:var(--text-muted); font-size:12px; line-height:1.45; }
.account-page [data-chat-expanded="true"] #safety-support:not([hidden]) { flex:0 1 auto; overflow:auto; max-height:35%; margin:0; padding:12px 16px; }
.account-page [data-chat-expanded="true"] #chat-latest:not([hidden]) { position:absolute; right:20px; bottom:calc(var(--messenger-composer-height,160px) + 12px); z-index:2; margin:0; background:var(--surface-elevated); box-shadow:0 4px 16px #0005; }
.account-page [data-chat-expanded="true"] .conversation-history { display:none; }
.account-page [data-chat-expanded="true"][data-history-open="true"] .conversation-history {
  display:block; grid-row:1; grid-column:1; height:100%; min-height:0; overflow:auto;
  width:100%; margin:0; padding:0 16px 24px; border:0; background:var(--surface-elevated);
}
.account-page [data-chat-expanded="true"][data-history-open="true"] #chat-module { display:none; }
.account-page [data-chat-expanded="true"] #history-summary { min-height:76px; border-bottom:1px solid var(--border-gold); margin-bottom:16px; font-size:16px; color:var(--text-main); }
.history-back { display:none; }
[data-chat-expanded="true"] #history-summary::after { content:none; }
[data-chat-expanded="true"] .history-back { display:block; width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.account-page [data-chat-expanded="true"] #new-session { width:100%; min-height:48px; margin:0 0 16px; text-align:left; background:var(--surface-card-hover); border-color:var(--border-gold); color:var(--gold-primary); }
.account-page [data-chat-expanded="true"] #sessions { display:flex; flex-direction:column; gap:4px; }
.account-page [data-chat-expanded="true"] #sessions button { display:block; min-height:48px; width:100%; padding:12px; border:0; border-radius:12px; text-align:left; background:transparent; color:var(--text-main); }
.account-page [data-chat-expanded="true"] #sessions button[aria-current="true"] { background:#253342; color:var(--gold-primary); }
.account-page [data-chat-expanded="true"] #history-reset-hint { margin-top:32px; font-size:12px; line-height:1.5; color:var(--text-muted); }
.account-page [data-chat-expanded="true"] #reset-history { min-height:44px; font-size:13px; background:transparent; color:var(--text-muted); }
.account-page :is(#chat-expand,#chat-history,#send,#voice-start):focus-visible { outline:2px solid var(--focus-cabinet,#f0ce8d); outline-offset:2px; }
.account-page #send-form[aria-busy="true"] .compose-glass { border-color:var(--gold-primary); }
.account-page #send-form[aria-busy="true"] #send { cursor:progress; }
.account-page [data-chat-expanded="true"] ::selection { background:var(--gold-primary); color:#010b15; }
@media(min-width:761px) {
  .account-page #workspace > #conversation-workspace[data-chat-expanded="true"][data-history-open="true"] { grid-template-columns:280px minmax(0,1fr); }
  .account-page [data-chat-expanded="true"][data-history-open="true"] #chat-module { display:flex; grid-column:2; }
  .account-page [data-chat-expanded="true"][data-history-open="true"] .conversation-history { border-right:1px solid var(--border-gold); }
}
@media(hover:hover) and (pointer:fine) {
  [data-chat-expanded="true"] .chat-keyboard-hint { display:block; }
  .account-page :is(#chat-expand,#chat-history):hover { background:var(--surface-card-hover); }
}
@media(max-width:760px) {
  .account-page [data-chat-expanded="true"] .chat-heading-row { padding:8px 8px; gap:8px; padding-top:calc(8px + env(safe-area-inset-top)); }
  .account-page [data-chat-expanded="true"] .chat-title #dialogue-heading { font-size:16px; }
  .account-page [data-chat-expanded="true"] #send-form { padding:8px 8px calc(4px + env(safe-area-inset-bottom)); }
  .account-page [data-chat-expanded="true"] #messages { padding:16px 12px; }
  .account-page [data-chat-expanded="true"] .message { max-width:90%; padding:10px 12px; }
  .account-page [data-chat-expanded="true"] .composer-footer:not(:has(.voice-details[open])) { flex-wrap:wrap; }
  .account-page [data-chat-expanded="true"] .chat-keyboard-hint { display:none; }
  .account-page .space-dock { gap:12px; }
}
@media(max-height:480px) {
  .account-page [data-chat-expanded="true"] .chat-heading-row { padding-block:4px; }
  .account-page [data-chat-expanded="true"] #send-form { padding-block:4px; max-height:65%; }
  .account-page [data-chat-expanded="true"] .composer-footer { padding-top:0; }
}
.account-page .journey-save-notice { margin:8px 0; font-size:14px; line-height:1.5; color:var(--text-main); }
.account-page .journey-save-notice:empty { display:none; }
.account-page .journey-save-notice[data-error="true"] { color:#f2b5ae; }
.account-page input[aria-invalid="true"] { border-color:#f2b5ae; outline:2px solid #f2b5ae; outline-offset:2px; }
.account-page .journey-next-actions { margin-block:12px; }
.account-page #send-retry:not([hidden]) { display:block; min-height:44px; align-self:flex-start; margin:0 4px 8px; border-color:var(--border-gold); color:var(--gold-primary); background:var(--surface-elevated); }
.account-page :is(#natal-heading,#package-heading) { scroll-margin-top:24px; }

/* Delivery state belongs to the local message; no false read receipts. */
.account-page .message-send-state { display:block; margin-top:6px; color:var(--text-muted); font-size:12px; line-height:1.45; }
