/* Shared controls: preserve the painted base; animate only a translucent highlight. */
.character-profile-trigger { display:none; width:max(44px,calc(44px / var(--phone-scale,1))); height:max(44px,calc(44px / var(--phone-scale,1))); padding:0; border:0; border-radius:50%; background:var(--ds-surface); cursor:pointer; overflow:hidden; }
.character-profile-trigger img { transform:scale(1.65); transform-origin:60% 28%; display:block; width:100%; height:100%; object-fit:cover; object-position:50% 25%; pointer-events:none; }
.is-chatting .favorite { display:none; }
.is-chatting .character-profile-trigger { display:block; }
.character-profile-trigger:focus-visible { outline:2px solid var(--ds-focus); outline-offset:4px; }
.character-journal { z-index:24; --journal-hit:calc(44px / var(--phone-scale,1)); --journal-day:max(48px,var(--journal-hit)); }
.character-journal::before { inset:auto 0 0; height:440px; opacity:1; pointer-events:none;
  background:radial-gradient(118% 64% at 50% 110%,#9a63f5 0%,rgba(120,66,214,.62) 30%,rgba(48,30,96,.30) 56%,transparent 80%); }
[data-theme=realism].character-journal::before { background:radial-gradient(118% 64% at 50% 110%,#f6e3a4 0%,rgba(226,196,116,.55) 30%,rgba(120,100,52,.20) 56%,transparent 80%); }
.journal-header { position:relative; display:flex; align-items:center; justify-content:space-between; padding:58px 20px 10px; gap:12px; flex:none; }
.journal-header>span { font-size:13px; color:var(--ds-muted); }
.journal-header-space { width:var(--journal-hit); }
.character-journal .journal-control { display:grid; place-items:center; flex:none; width:var(--journal-hit); height:var(--journal-hit); padding:0; border:0; border-radius:50%; background:var(--messenger-card); color:var(--ds-text); }
.character-journal button { box-shadow:inset 0 0 0 100px transparent; transition:box-shadow var(--ds-duration-fast) ease-out,transform var(--ds-duration-fast) ease-out; }
@media(hover:hover) { .character-journal button:hover { box-shadow:inset 0 0 0 100px var(--messenger-divider); } }
.character-journal button:active { transform:translateY(1px); }
.journal-body { position:relative; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 20px 32px; scrollbar-width:thin; scrollbar-color:var(--messenger-divider) transparent; }
/* Portrait and latest thought share the first row; name anchors the portrait. */
.journal-hero { display:grid; grid-template-columns:146px minmax(0,1fr); align-items:center; column-gap:20px; padding:12px 0 8px; }
.journal-portrait { width:146px; height:174px; border-radius:28px 28px 18px 18px; overflow:hidden; background:var(--messenger-card); }
.journal-portrait img { transform:scale(1.55); transform-origin:60% 28%; width:100%; height:100%; display:block; object-fit:cover; object-position:50% 25%; -webkit-user-drag:none; }
.journal-identity { min-width:0; padding-bottom:8px; }
.journal-hero h2 { position:relative; margin:0 0 10px; font-size:24px; line-height:1.25; font-weight:750; letter-spacing:-.035em; overflow-wrap:anywhere; word-break:keep-all; }
.journal-latest { position:relative; margin:0; padding:16px; border-radius:22px 22px 22px 5px; background:linear-gradient(135deg,#fffafc,#e3dfff); color:#27223b; box-shadow:0 8px 24px #080b201c; font-size:14px; font-weight:550; line-height:1.65; overflow-wrap:anywhere; word-break:keep-all; }
.journal-latest::after { content:""; position:absolute; width:7px; height:7px; left:-9px; bottom:-9px; border-radius:50%; background:#e3dfff; }
[data-theme=realism] .journal-latest { background:#fffdea; color:#3b3325; box-shadow:0 6px 18px #a3862e14; }
[data-theme=realism] .journal-latest::after { background:#fffdea; }
.journal-stats { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:18px 0; }
.journal-stat { display:flex; align-items:center; gap:8px; min-width:0; }
.journal-stat strong { font-size:32px; line-height:1; font-weight:750; font-variant-numeric:tabular-nums; letter-spacing:-.035em; }
.journal-stat>span:last-child { font-size:11px; line-height:1.55; color:var(--ds-muted); white-space:nowrap; }
.journal-stat-icon { position:relative; display:grid; place-items:center; flex:0 0 30px; height:38px; }
.journal-stat-icon::before { content:""; position:absolute; inset:-8px; background:radial-gradient(ellipse,currentColor,transparent 68%); opacity:.25; pointer-events:none; }
.character-journal .journal-stat-icon svg { position:relative; width:27px; height:30px; fill:currentColor; stroke:none; filter:drop-shadow(0 1px 4px currentColor); }
.journal-stat-icon.together { color:#ba9bff; }
.journal-stat-icon.streak { color:#ff683e; }
[data-theme=realism] .journal-stat-icon.together { color:#ffb43d; }
[data-theme=realism] .journal-stat-icon.streak { color:#ff6b3d; }
.journal-calendar { padding-top:16px; border-top:1px solid var(--messenger-divider); }
.journal-calendar-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.journal-month { margin:0; font-size:15px; font-weight:600; white-space:nowrap; }
.journal-date-actions { display:flex; align-items:center; gap:4px; margin-right:calc((var(--journal-hit) - 22px) / -2); }
.journal-date-actions .journal-control { background:transparent; }
.character-journal .journal-today { border:0; background:transparent; color:var(--ds-muted); border-radius:999px; min-width:var(--journal-hit); min-height:var(--journal-hit); padding:8px; font-size:12px; }
.journal-date-rail { position:relative; display:flex; gap:8px; overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x mandatory; scrollbar-width:none; margin:4px -20px 0; padding:2px calc((100% + 40px - var(--journal-day))/2) 4px; touch-action:pan-x; cursor:grab; }
.journal-date-rail::-webkit-scrollbar { display:none; }
.journal-date-rail.is-dragging { scroll-snap-type:none; cursor:grabbing; }
.character-journal .journal-date { flex:0 0 var(--journal-day); display:flex; flex-direction:column; align-items:center; gap:3px; padding:6px 0; border:0; border-radius:24px; background:transparent; color:var(--ds-muted); scroll-snap-align:center; touch-action:pan-x; }
.journal-weekday { font-size:11px; line-height:16px; }
.journal-date-number { width:36px; height:36px; display:grid; place-items:center; font-size:20px; font-weight:650; border-radius:50%; background:transparent; transition:background-color var(--ds-duration-fast),color var(--ds-duration-fast); }
.journal-date[aria-selected=true] { color:var(--ds-text); }
.journal-date[aria-selected=true] .journal-date-number { background:var(--ds-accent); color:var(--ds-on-accent); }
.journal-date[aria-current=date] .journal-weekday { color:var(--ds-text); font-weight:700; }
.journal-date-dot { width:4px; height:4px; border-radius:50%; background:transparent; }
.journal-date.has-record .journal-date-dot { background:var(--ds-muted); }
.journal-date[aria-selected=true].has-record .journal-date-dot { background:var(--ds-accent); }
.journal-summary { margin-top:16px; min-height:168px; padding:22px; border-radius:18px; background:var(--messenger-card); color:var(--ds-text); user-select:text; -webkit-user-select:text; }
.journal-summary-heading { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:22px; }
.journal-summary-heading p { margin:0; font-size:12px; }
.journal-summary-heading span { font-size:11px; color:var(--ds-muted); white-space:nowrap; }
.journal-summary h3 { font-size:20px; line-height:1.4; letter-spacing:-.025em; margin:0 0 10px; font-weight:650; word-break:keep-all; }
.journal-message-count { margin:0 0 20px; color:var(--ds-muted); font-size:11px; line-height:1.6; }
.journal-highlights { margin:0; padding-left:16px; font-size:14px; line-height:1.8; overflow-wrap:anywhere; }
.journal-highlights li+li { margin-top:10px; }
.journal-highlights li::marker { color:var(--ds-muted); font-size:10px; }
.journal-summary blockquote { margin:20px 0 0; padding:16px 0 0; border-top:1px solid var(--messenger-divider); }
.journal-summary blockquote span { font-size:11px; color:var(--ds-muted); }
.journal-summary blockquote p { margin:6px 0 0; font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.journal-record-note,.journal-empty-copy { font-size:13px; color:var(--ds-muted); line-height:1.8; margin:16px 0 0; }
.character-journal :focus-visible { outline:2px solid var(--ds-focus); outline-offset:3px; }
.journal-hero h2:focus { outline:none; }
@media(prefers-reduced-motion:reduce) { .character-journal * { transition:none!important; } }
.character-journal.reduce-effects * { transition:none!important; }
