/* Journal and optional quote dialog: shared clinical palette, readable at 320px. */
.jm-journal{--jm-ink:#173b4e;--jm-muted:#4e6b78;--jm-line:#d9e8ec;--jm-tint:#edf7f8;--jm-accent:#147a85;color:var(--jm-ink);min-width:0}
.jm-tabs{display:flex;gap:6px;max-width:620px;background:#e8f1f4;border:1px solid var(--jm-line);padding:6px;border-radius:18px;margin:0 0 24px}
.jm-tabs>[role=tab]{display:flex;align-items:center;justify-content:center;gap:9px;min-height:48px;min-width:0;flex:1;border:1px solid transparent;background:transparent;color:var(--jm-muted);border-radius:13px;padding:10px 14px;font:inherit;font-weight:650;white-space:normal;line-height:1.3}
.jm-tabs>[role=tab][aria-selected=true]{background:#fff;color:#126f7b;border-color:#d7e7ec;box-shadow:0 3px 12px #214b6010}
.jm-tabs svg,.jm-small-mark svg,.jm-quote-actions svg{width:20px;height:20px;flex:0 0 20px}
.jm-tab-count{display:inline-grid;place-items:center;min-width:23px;height:23px;padding:0 5px;background:#dcebef;border-radius:7px;font-size:.75rem;font-variant-numeric:tabular-nums}
.jm-tabs [aria-selected=true] .jm-tab-count{background:#e0f3f2;color:#126f7b}
.jm-journal [role=tabpanel]{min-width:0;outline-offset:5px}
.jm-journal [hidden],#modal .jm-quote [hidden]{display:none!important}
.jm-toolbar{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:20px;min-width:0}
.jm-toolbar .search{width:min(320px,50%);margin:0;min-width:0}
.jm-toolbar .search input{width:100%;min-width:0}
.jm-notes{margin-top:18px}
.jm-note h3{margin-top:16px;line-height:1.4;overflow-wrap:anywhere}
.jm-note .entry-body{overflow-wrap:anywhere}
.jm-motivation-intro{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:22px}
.jm-motivation-intro h2{margin:5px 0 7px;font-size:clamp(1.3rem,2vw,1.7rem);letter-spacing:-.035em}
.jm-motivation-intro p{color:var(--jm-muted);margin:0;max-width:470px}
.jm-motivation-intro>button{flex-shrink:0}
.jm-quote-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.jm-saved-quote{display:flex;flex-direction:column;border:1px solid var(--jm-line);background:linear-gradient(145deg,#fff 20%,#f0f9f9);padding:24px;min-width:0;box-shadow:0 5px 20px #214b6007}
.jm-saved-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.jm-small-mark{display:flex;align-items:center;gap:7px;color:var(--jm-accent);font-size:.76rem;font-weight:650}
.jm-saved-top time{font-size:.75rem;color:var(--jm-muted)}
.jm-saved-quote blockquote{margin:28px 0 22px;font-size:clamp(1.15rem,1.6vw,1.42rem);line-height:1.5;font-weight:550;letter-spacing:-.025em;overflow-wrap:anywhere}
.jm-saved-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;border-top:1px solid var(--jm-line);padding-top:12px}
.jm-saved-bottom>span{font-size:.78rem;color:var(--jm-muted)}
.jm-saved-bottom button{min-height:44px;min-width:64px}
.jm-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:240px;padding:32px 22px;text-align:center}
.jm-empty h2{margin:5px 0;font-size:1.4rem;letter-spacing:-.03em}
.jm-empty p{max-width:390px;color:var(--jm-muted);margin:0 0 15px}
.jm-empty-icon{display:grid;place-items:center;width:56px;height:56px;border-radius:17px;background:var(--jm-tint);color:var(--jm-accent)}
.jm-empty-icon svg{width:30px;height:30px}
.jm-demo{background:#eef6fa;border:1px solid #d2e4ec;border-radius:12px;padding:11px 13px;color:#355d72;font-size:.78rem;line-height:1.5}
.jm-load-error,.jm-quote-error{border:1px solid #ebc9c5;border-radius:12px;background:#fff3f1;color:#8e3535;padding:12px 14px;font-size:.9rem;line-height:1.5}
.jm-load-error p{margin:0 0 8px}
body.ux-ready #modal:has([data-journal-quote]){width:min(540px,calc(100vw - 32px));max-height:min(820px,calc(100dvh - 40px));padding:24px;border-radius:27px;border:1px solid #d8e8ed;background:#fff;color:#173b4e;box-shadow:0 25px 100px #153d5233;overflow-y:auto;overscroll-behavior:contain;animation:jm-appear 180ms ease-out}
body.ux-ready #modal:has([data-journal-quote])::backdrop{background:#15384966;backdrop-filter:blur(5px)}
body.ux-ready #modal:has([data-journal-quote]) #modalContent{padding:0}
body.ux-ready #modal:has([data-journal-quote]) .modal-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
body.ux-ready #modal:has([data-journal-quote]) .modal-top h2{margin:0;font-size:1rem;line-height:1.35;color:#4b6877;font-weight:600}
body.ux-ready #modal:has([data-journal-quote]) .close{display:grid;place-items:center;min-width:44px;min-height:44px;flex:0 0 44px;background:#eef5f7;color:#315569;border-radius:50%;font-size:25px}
.jm-quote{text-align:center;min-width:0}
.jm-quote-symbol{width:48px;height:48px;margin:0 auto 12px;display:grid;place-items:center;border-radius:21px;background:#e8f5f5;color:#137681}
.jm-quote-symbol svg{width:27px;height:27px}
.jm-quote .eyebrow{color:#467681;font-size:.65rem;letter-spacing:.18em}
.jm-quote blockquote{margin:12px 0 12px;font-size:clamp(1.4rem,5.2vw,1.75rem);font-weight:570;line-height:1.38;letter-spacing:-.045em;color:#173b4e;overflow-wrap:anywhere;outline-offset:7px}
.jm-quote-credit{display:flex;flex-direction:column;gap:3px;min-width:0;margin:0 0 14px;color:#4e6b78;font-size:.8rem;line-height:1.5;overflow-wrap:anywhere}
.jm-quote-author{font-size:1rem;color:#173b4e;font-weight:700}
.jm-quote-credit cite{font-style:normal}
.jm-quote-location,.jm-quote-context{font-size:.76rem}
.jm-quote-context{font-style:italic}
.jm-source-link{display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:flex-start;min-height:44px;padding:7px 3px;color:#126f7b;font-weight:650;text-decoration:underline;text-underline-offset:3px}
.jm-quote .jm-source-link{align-self:center}
.jm-translation-label{font-size:.72rem}
.jm-original{margin:3px 0 0;text-align:left;border-top:1px solid #d9e8ec}
.jm-original summary{cursor:pointer;min-height:44px;padding:12px 5px;font-size:.76rem;color:#406476}
.jm-original p{margin:0 4px 10px;font-size:.85rem;line-height:1.6;color:#355d72;overflow-wrap:anywhere}
.jm-original small{display:block;margin:0 4px 12px;line-height:1.5;font-size:.7rem}
.jm-quote.jm-quote-long blockquote{font-size:clamp(1.3rem,4.7vw,1.7rem);line-height:1.45}
.jm-saved-quote .jm-quote-credit{margin-top:-8px}
.jm-source-link:focus-visible,.jm-original summary:focus-visible{outline:3px solid #237fba;outline-offset:3px;border-radius:5px}
.jm-quote-hint{max-width:350px;margin:0 auto 14px;color:#4e6b78;line-height:1.6;font-size:.9rem}
.jm-quote-actions{display:grid;gap:6px;margin-top:14px}
.jm-quote-actions>button{display:flex;align-items:center;justify-content:center;gap:10px;min-height:50px;white-space:normal;line-height:1.4;padding:12px 14px}
.jm-quote-actions>button.primary{background:#147a85;color:#fff;border:1px solid #147a85;box-shadow:0 5px 14px #147a851c}
.jm-quote-actions>button.text{color:#406476}
.jm-quote-actions>button:disabled{opacity:.65;cursor:wait}
.jm-journal button:focus-visible,.jm-quote button:focus-visible{outline:3px solid #237fba;outline-offset:3px}
.dark .jm-journal{--jm-ink:#e0f1f5;--jm-muted:#afc8d1;--jm-line:#38525e;--jm-tint:#203f48;--jm-accent:#83d9db}
.dark .jm-tabs{background:#17333e}.dark .jm-tabs>[role=tab][aria-selected=true]{background:#284752;color:#c3f2f1;border-color:#46636e}
.dark .jm-tab-count,.dark .jm-tabs [aria-selected=true] .jm-tab-count{background:#345763;color:#e0f5f5}
.dark .jm-saved-quote{background:linear-gradient(145deg,#203c47,#17353d);color:#e0f1f5}
.dark .jm-demo{background:#203d4b;color:#c1dbe5;border-color:#3f5b68}
.dark .jm-load-error,.dark .jm-quote-error{background:#452c32;color:#ffd6d0;border-color:#84525a}
body.ux-ready.dark #modal:has([data-journal-quote]){background:#18333f;color:#e0f1f5;border-color:#38525e}
body.ux-ready.dark #modal:has([data-journal-quote]) .modal-top h2,.dark .jm-quote-credit,.dark .jm-quote-hint,.dark .jm-quote-actions>button.text{color:#b6d0db}
.dark .jm-quote-author{color:#e5f2f7}.dark .jm-source-link{color:#9ee4e3}.dark .jm-original{border-color:#38525e}.dark .jm-original summary,.dark .jm-original p{color:#b6d0db}
body.ux-ready.dark #modal:has([data-journal-quote]) .close,.dark .jm-quote-symbol{background:#284b56;color:#aae2e4}
.dark .jm-quote blockquote{color:#e5f2f7}.dark .jm-quote .eyebrow{color:#9dcbd0}
@keyframes jm-appear{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:640px){.jm-tabs{width:100%;margin-bottom:20px}.jm-tabs>[role=tab]{padding:10px 7px;font-size:.82rem;gap:6px}.jm-tabs svg{display:none}.jm-tabs>[role=tab]>span:not(.jm-tab-count){min-width:0}.jm-toolbar{align-items:stretch;flex-direction:column;gap:14px}.jm-toolbar .search{width:100%}.jm-toolbar>.primary{align-self:flex-start}.jm-motivation-intro{flex-direction:column;align-items:flex-start;gap:15px}.jm-quote-grid{grid-template-columns:minmax(0,1fr)}.jm-saved-quote{padding:21px}.jm-saved-quote blockquote{font-size:1.25rem}.jm-empty{padding:26px 18px}body.ux-ready #modal:has([data-journal-quote]){width:calc(100vw - 24px);max-height:calc(100dvh - 24px - env(safe-area-inset-top));padding:20px 20px max(20px,env(safe-area-inset-bottom));border-radius:24px;margin:auto auto max(12px,env(safe-area-inset-bottom))}.jm-quote-symbol{margin-bottom:10px;width:44px;height:44px}.jm-quote-actions{margin-top:16px}.jm-quote blockquote{font-size:clamp(1.35rem,5.8vw,1.6rem)}}
@media(prefers-reduced-motion:reduce){body.ux-ready #modal:has([data-journal-quote]){animation:none}}

/* Keep attribution and sources readable with the user’s larger-text preference. */
body.ux-large-text .jm-quote-credit,body.ux-large-text .jm-quote-location,body.ux-large-text .jm-quote-context,body.ux-large-text .jm-translation-label,body.ux-large-text .jm-source-link,body.ux-large-text .jm-original summary,body.ux-large-text .jm-original small{font-size:1rem;line-height:1.6}
.jm-quote blockquote,.jm-saved-quote blockquote{white-space:pre-line}

@media(max-height:700px){body.ux-ready #modal:has([data-journal-quote]) .jm-quote-symbol{display:none}body.ux-ready #modal:has([data-journal-quote]) .modal-top{margin-bottom:8px}.jm-quote blockquote{margin-top:9px}}
