:root {
  color-scheme: light;
  /* Shared roles: metadata / labels / reading text / card title / page title. */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-editorial: "Songti SC", "Noto Serif CJK SC", var(--font-ui);
  --type-caption: 12px;
  --type-small: 14px;
  --type-body: 16px;
  --type-title: 20px;
  --type-heading: 24px;
  --type-display: 32px;
  --weight-body: 400;
  --weight-medium: 500;
  --weight-title: 600;
  --leading-body: 1.7;
  --leading-label: 1.5;
  --leading-title: 1.35;

  --text-primary: #1b1f25;
  --text-secondary: #505963;
  --text-muted: #737d88;
  --text-placeholder: #6a7480;
  --text-disabled: #71717a;
  --text-on-image: #ffffff;
  --text-on-accent: #ffffff;
  --ink: var(--text-primary);
  --ink-soft: var(--text-secondary);
  --ink-faint: var(--text-muted);
  --accent: #27272a;
  --accent-soft: rgba(39, 39, 42, .12);
  --danger: #9c3025;
  --warning-text: #713f12;
  --warning-bg: #fff5e5;
  --warning-line: #b98948;
  --separator: rgba(39, 39, 42, .15);
  --text-shadow: none;
  --text-halo: var(--text-shadow);
  --image-text-shadow: var(--text-shadow);
  --ui-border-width: 1px;
  --ui-border-color: rgba(255, 255, 255, .62);
  --ui-border: var(--ui-border-width) solid var(--ui-border-color);
  --line: var(--ui-border-color);
  --glass: linear-gradient(135deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, .16));
  --shadow: 0 8px 24px rgba(24, 24, 27, .07);
  --app-width: 430px;
  --nav-offset: max(12px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #dad9dd; }
body { min-height: 100%; margin: 0; color: var(--text-primary); font-family: var(--font-sans); font-size: var(--type-body); line-height: var(--leading-body); font-weight: var(--weight-body); -webkit-font-smoothing: antialiased; }
button, input, textarea { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button, a, input, textarea { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent-soft); color: var(--text-primary); }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.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; }

.app-shell { position: relative; min-height: 100svh; max-width: var(--app-width); margin: 0 auto; isolation: isolate; background: transparent; box-shadow: 0 0 65px rgba(28, 20, 24, .10); }
.site-backdrop { position: fixed; top: var(--frame-top, 0px); left: 50%; z-index: -2; width: min(100%, var(--app-width)); height: calc(100lvh - var(--frame-top, 0px) * 2); transform: translateX(-50%); pointer-events: none; overflow: hidden; background: #fff; }
.site-backdrop img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.app-shell::before, .app-shell::after { content: none; }
.page { padding: max(18px, env(safe-area-inset-top)) 18px calc(108px + env(safe-area-inset-bottom)); }
.page:focus { outline: none; }
.topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 10px; }
.eyebrow, .card-kicker, .date-line, .section-kicker { margin: 0; letter-spacing: .04em; font-family: var(--font-sans); }
.eyebrow { text-align: center; font-size: var(--type-caption); color: var(--text-primary); text-shadow: var(--text-halo); }
.icon-button, .tiny-button { display: grid; place-content: center; border: var(--ui-border); background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(115%); -webkit-backdrop-filter: blur(16px) saturate(115%); }
.icon-button { width: 42px; height: 42px; border-radius: 12px; gap: 5px; }
.icon-button > span { display: block; width: 17px; height: 1.5px; border-radius: 2px; background: var(--ink); }
.icon-button > span:last-child { width: 11px; }
.tiny-button { width: 40px; height: 40px; border-radius: 10px; font-size: var(--type-title); }
.star-button.is-on { color: var(--accent); }
.star-button.is-on .icon { fill: var(--accent-soft); }

.hero { display: flex; flex-direction: column; align-items: center; padding: 30px 0 24px; text-align: center; color: var(--text-on-image); text-shadow: var(--image-text-shadow); }
.avatars { position: relative; display: flex; align-items: center; justify-content: center; gap: 92px; margin-bottom: 18px; }
.avatar { position: relative; width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; border: var(--ui-border); background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.avatar span { position: relative; font-family: var(--font-editorial); font-size: var(--type-display); font-weight: var(--weight-medium); color: var(--text-primary); }
.avatar-shen { transform: rotate(-5deg); }
.avatar-qiqi { transform: rotate(5deg); }
.heart-orbit { position: absolute; left: 50%; width: 28px; height: 28px; transform: translateX(-50%); border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .26); border: var(--ui-border); color: var(--text-primary); font-size: var(--type-small); text-shadow: var(--text-halo); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.date-line { font-size: var(--type-caption); opacity: 1; }
.together-label { margin: 13px 0 10px; font-size: var(--type-body); letter-spacing: .08em; opacity: 1; }
.love-clock { display: flex; align-items: baseline; justify-content: center; gap: 5px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.love-clock strong { font-family: var(--font-sans); font-size: var(--type-heading); font-weight: var(--weight-medium); letter-spacing: .03em; min-width: 24px; }
.love-clock span { margin-right: 3px; font-size: var(--type-caption); opacity: 1; }
.anniversary-link.text-button { font-size: var(--type-caption); color: var(--text-on-image); margin-top: 6px; min-height: 30px; text-decoration: underline; text-underline-offset: 4px; text-shadow: var(--image-text-shadow); }

.dashboard { position: relative; display: grid; gap: 16px; }
.glass-card { position: relative; border: var(--ui-border); border-radius: 18px; padding: 20px; background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(18px) saturate(115%); -webkit-backdrop-filter: blur(18px) saturate(115%); }
.glass-card::before { content: none; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-kicker { font-size: var(--type-caption); color: var(--text-secondary); }
.card-heading h2 { margin: 4px 0 0; font-size: var(--type-title); font-weight: var(--weight-title); letter-spacing: .05em; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 30px; background: rgba(255, 255, 255, .42); border: var(--ui-border); font-size: var(--type-caption); color: var(--text-secondary); white-space: nowrap; }
.status-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status-dot.disconnected::before { background: var(--text-disabled); box-shadow: 0 0 0 3px rgba(113, 113, 122, .10); }
.quota-content { display: flex; align-items: center; gap: 23px; padding: 18px 2px 2px; }
.progress-ring { --size: 112px; position: relative; width: var(--size); height: var(--size); flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--progress) * 1%), rgba(255, 255, 255, .25) 0); box-shadow: inset 0 0 18px #ffffff30, 0 8px 20px rgba(45, 32, 49, .05); }
.progress-ring::before { content: ""; position: absolute; width: 88px; height: 88px; border-radius: 50%; background: rgba(244, 248, 253, .12); border: var(--ui-border); box-shadow: inset 0 1px 8px #ffffff40; }
.progress-ring div { z-index: 1; display: flex; align-items: baseline; }
.progress-ring strong { font-family: var(--font-sans); font-size: var(--type-display); font-weight: var(--weight-medium); }
.progress-ring span { font-size: var(--type-small); }
.quota-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.quota-copy > strong { font-family: var(--font-sans); font-size: var(--type-heading); font-weight: var(--weight-medium); letter-spacing: .02em; }
.quota-copy > .quota-pending { font-family: inherit; font-size: var(--type-title); }
.quota-copy > span { margin-top: 6px; color: var(--text-secondary); font-size: var(--type-small); line-height: 1.5; }
.mini-bars { display: flex; align-items: end; gap: 5px; height: 24px; margin-top: 14px; opacity: .4; }
.mini-bars i { display: block; flex: 1; min-width: 4px; border-radius: 4px; background: linear-gradient(rgba(63, 63, 70, .45), rgba(63, 63, 70, .10)); }
.mini-bars i:nth-child(1) { height: 30%; }.mini-bars i:nth-child(2) { height: 62%; }.mini-bars i:nth-child(3) { height: 45%; }.mini-bars i:nth-child(4) { height: 84%; }.mini-bars i:nth-child(5) { height: 70%; }
.calendar-heading { justify-content: center; text-align: center; }
.calendar-heading .tiny-button:first-child { margin-right: auto; }
.calendar-heading .tiny-button:last-child { margin-left: auto; }
.week-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.week-row { margin-top: 16px; color: var(--text-secondary); font-size: var(--type-caption); }
.calendar-grid { margin-top: 7px; gap: 5px 1px; }
.calendar-grid button { position: relative; aspect-ratio: 1; display: grid; place-items: center; border: .5px solid transparent; border-radius: 9px; background: transparent; font-size: var(--type-small); }
.calendar-grid button.muted { color: var(--text-secondary); }
.calendar-grid button.today { color: var(--text-on-accent); background: var(--accent); border-color: #ffffff80; box-shadow: 0 5px 12px rgba(74, 47, 66, .12); }
.calendar-grid button.selected:not(.today) { border-color: var(--accent); background: rgba(255, 255, 255, .5); }
.calendar-grid button.has-entry::after { content: ""; position: absolute; width: 3px; height: 3px; background: currentColor; border-radius: 50%; bottom: 4px; left: calc(50% - 1.5px); }
.calendar-note.text-button { width: 100%; margin: 14px 0 0; padding: 14px 0 2px; border-top: .5px solid var(--separator); text-align: center; font-size: var(--type-small); color: var(--text-secondary); letter-spacing: .04em; }
.note-list { position: relative; display: grid; gap: 13px; margin: 18px 0 0 7px; padding-left: 19px; }
.note-list::before { content: ""; position: absolute; left: 4px; top: 13px; bottom: 26px; border-left: 1px dashed rgba(63, 63, 70, .30); }
.paper-note { position: relative; width: 100%; padding: 0 0 8px; border: 0; border-bottom: .5px solid rgba(255, 255, 255, .26); background: transparent; box-shadow: none; }
.paper-note:last-child { border-bottom: 0; padding-bottom: 0; }
.note-content { position: relative; display: block; width: 100%; min-height: 42px; padding: 4px 0 7px; border: 0; background: transparent; text-align: left; }
.note-content .node-dot { position: absolute; top: 11px; left: -20px; width: 11px; height: 11px; border: 2px solid var(--text-muted); border-radius: 50%; background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.note-content .node-text { display: block; font-size: var(--type-body); font-weight: var(--weight-body); letter-spacing: .02em; overflow-wrap: anywhere; line-height: var(--leading-body); }
.note-heart { display: grid; place-items: center; width: 27px; height: 32px; border: 0; background: transparent; color: var(--text-secondary); }
.note-heart .icon { width: 17px; height: 17px; }
.paper-note.loved { background: transparent; }.paper-note.loved .node-dot { background: var(--accent-soft); }
.paper-note.loved .note-heart { color: var(--accent); }.paper-note.loved .note-heart .icon { fill: var(--accent-soft); }
.inline-empty { color: var(--text-secondary); font-size: var(--type-small); line-height: var(--leading-body); margin: 0; padding: 10px 0; }
.closing-line { margin: 8px 0 5px; text-align: center; color: var(--text-secondary); text-shadow: var(--text-halo); font: italic var(--type-small)/var(--leading-body) var(--font-editorial); letter-spacing: .08em; }

.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: var(--nav-offset); width: min(calc(100% - 30px), calc(var(--app-width) - 30px)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 7px; border: var(--ui-border); border-radius: 18px; background: linear-gradient(135deg, rgba(255, 255, 255, .40), rgba(245, 249, 255, .24)); box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(115%); -webkit-backdrop-filter: blur(22px) saturate(115%); }
.nav-item { position: relative; height: 54px; border: .5px solid transparent; border-radius: 12px; background: transparent; display: grid; place-items: center; align-content: center; gap: 5px; color: var(--text-secondary); transition: background .2s; }
.nav-item .icon { width: 19px; height: 19px; }
.nav-item b { font-size: var(--type-caption); font-weight: var(--weight-medium); letter-spacing: .05em; }
.nav-item.active { color: var(--text-primary); background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .42); box-shadow: inset 0 .5px 0 #ffffff80; }
.nav-item.active::after { content: ""; position: absolute; bottom: 3px; width: 11px; height: 2px; border-radius: 2px; background: var(--accent); }

.inner-page { min-height: 100svh; }
.inner-topbar { margin-bottom: 22px; min-height: 44px; }
.page-intro, .mood-intro { color: var(--text-on-image); padding: 22px 5px 28px; text-shadow: var(--image-text-shadow); }
.section-kicker { font-size: var(--type-caption); color: var(--text-on-image); line-height: 1.8; }
.page-intro h1 { font-family: var(--font-editorial); font-weight: var(--weight-body); font-size: var(--type-display); letter-spacing: .01em; line-height: 1.75; margin: 17px 0 12px; }
.page-intro > p:last-child, .mood-intro > p:last-child { margin: 0; color: var(--text-on-image); font-size: var(--type-small); letter-spacing: .08em; line-height: var(--leading-body); }
.journal-summary { display: flex; justify-content: space-between; align-items: center; padding: 6px 3px 16px; color: var(--text-on-image); font-size: var(--type-small); }
.journal-summary strong { font: var(--weight-medium) var(--type-heading)/var(--leading-title) var(--font-sans); padding-right: 5px; }
.journal-summary .text-button { color: var(--text-on-image); font-size: var(--type-small); }
.search-box { display: flex; align-items: center; gap: 10px; padding: 4px 14px; min-height: 47px; border: var(--ui-border); border-radius: 12px; background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); color: var(--text-primary); }
.search-box .icon { width: 17px; height: 17px; }
.search-box input { width: 100%; min-width: 0; height: 40px; border: 0; background: transparent; outline-offset: 0; font-size: var(--type-body); }
input::placeholder, textarea::placeholder { color: var(--text-placeholder); opacity: 1; }
.filter-row { display: flex; align-items: center; gap: 9px; margin: 17px 0 18px; }
.filter-button { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; border: var(--ui-border); background: #ffffff0d; color: var(--text-primary); border-radius: 10px; padding: 7px 13px; font-size: var(--type-small); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.filter-button .icon { width: 12px; height: 12px; }
.filter-button.active { background: #ffffffd4; border-color: #ffffffcf; color: var(--text-primary); }
.journal-list { display: grid; gap: 12px; }
.empty-state { text-align: center; padding: 38px 16px; }
.empty-symbol { display: block; font: var(--type-display)/1 var(--font-editorial); color: var(--text-muted); margin-bottom: 19px; }
.empty-state h2 { font-size: var(--type-body); font-weight: var(--weight-medium); letter-spacing: .06em; margin: 0 0 11px; }
.empty-state > p { font-size: var(--type-small); color: var(--text-primary); line-height: var(--leading-body); margin: 0; }
.empty-state .secondary-button { margin-top: 22px; }
.page-footnote { color: var(--text-secondary); text-shadow: var(--text-halo); text-align: center; font-size: var(--type-small); line-height: var(--leading-body); margin: 28px 0 0; letter-spacing: .05em; }
.page-footnote span { font-size: var(--type-caption); color: var(--text-primary); }
.journal-entry { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 16px; padding: 20px 17px; text-align: left; width: 100%; }
.entry-date { border-right: .5px solid var(--separator); padding-right: 12px; display: flex; flex-direction: column; gap: 4px; }
.entry-date strong { font: var(--weight-medium) var(--type-display)/var(--leading-title) var(--font-sans); color: var(--text-primary); }
.entry-date span { font-size: var(--type-caption); color: var(--text-secondary); line-height: 1.8; }
.entry-copy { min-width: 0; }.entry-copy h2 { margin: 0 0 9px; font-size: var(--type-body); line-height: 1.6; font-weight: var(--weight-medium); overflow-wrap: anywhere; padding-right: 13px; }
.entry-copy p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: var(--type-small); line-height: var(--leading-body); color: var(--text-secondary); }
.entry-meta { display: block; margin-top: 12px; font-size: var(--type-caption); color: var(--text-secondary); }
.entry-star { position: absolute; top: 21px; right: 13px; width: 12px; height: 12px; color: var(--accent); fill: var(--accent-soft); }

.chat-page { display: flex; flex-direction: column; gap: 12px; }
.chat-page .inner-topbar { margin-bottom: 0; }
.topbar-title { width: fit-content; margin: 0 auto; text-align: center; color: var(--text-primary); padding: 7px 22px; border: var(--ui-border); border-radius: 99px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }.topbar-title h1 { font: var(--weight-medium) var(--type-title)/var(--leading-title) var(--font-sans); margin: 0; letter-spacing: .03em; }
.topbar-title .eyebrow { font-size: var(--type-caption); }.connection-caption { font-size: var(--type-caption); color: var(--text-secondary); letter-spacing: .06em; }
.conversation-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-secondary); font-size: var(--type-caption); padding: 0 2px; text-shadow: var(--text-halo); }
.conversation-caption span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.message-list { display: flex; flex-direction: column; gap: 13px; min-height: 0; padding: 1px 0 3px; }
.chat-empty { flex: 1; min-height: 36svh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: var(--text-on-image); padding: 32px 10px;  text-shadow: var(--image-text-shadow); }
.chat-seal { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: var(--text-primary); background: var(--glass); border: var(--ui-border); box-shadow: var(--shadow); font: var(--type-heading)/1 var(--font-editorial); margin-bottom: 23px; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.chat-empty .card-kicker { color: var(--text-on-image); font-size: var(--type-caption); }
.chat-empty h2 { font-family: var(--font-editorial); font-size: var(--type-heading); font-weight: var(--weight-body); letter-spacing: .06em; margin: 17px 0 11px; }
.chat-empty > p:last-child { font-size: var(--type-small); line-height: 1.8; color: var(--text-on-image); margin: 0; max-width: 230px; }
.message-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 9px; align-items: end; width: 100%; }.message-row.incoming { grid-template-columns: 34px minmax(0, 1fr); }
.message-bubble { max-width: 100%; border: var(--ui-border); border-radius: 22px 22px 4px 22px; padding: 12px 15px; color: var(--text-primary); background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(18px) saturate(115%); -webkit-backdrop-filter: blur(18px) saturate(115%); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--type-body); line-height: 1.75; }.incoming .message-bubble { border-radius: 22px 22px 22px 4px; }
.message-status { color: var(--text-secondary); font-size: var(--type-caption); text-shadow: var(--text-halo); }
.chat-composer { position: sticky; bottom: calc(var(--nav-offset) + 84px); z-index: 5; display: flex; align-items: center; gap: 8px; padding: 6px 7px 6px 16px; margin: 3px 0 0; border-radius: 99px; background: var(--glass); }
.chat-composer textarea { flex: 1; width: 100%; min-width: 0; min-height: 42px; max-height: 120px; resize: none; border: 0; background: transparent; padding: 8px 0; font-size: var(--type-body); line-height: 1.65; field-sizing: content; }
.chat-composer textarea:focus-visible { outline: none; }
.chat-composer:focus-within { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft); }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 5px; }
.composer-actions > span { font-size: var(--type-caption); color: var(--text-secondary); }

.mood-intro { text-align: center; padding: 24px 4px 29px; }
.mood-intro h1 { margin: 17px 0 12px; font-family: var(--font-editorial); font-weight: var(--weight-body); font-size: var(--type-display); letter-spacing: .04em; }
.mood-now { text-align: center; padding-bottom: 26px; }
.mood-orbit { position: relative; width: 174px; height: 174px; margin: 24px auto 12px; display: grid; place-items: center; }
.orbit-line { position: absolute; border-radius: 50%; border: var(--ui-border); }
.orbit-a { inset: 2px; transform: rotate(-24deg) scaleY(.65); }
.orbit-b { inset: 9px; transform: rotate(29deg) scaleY(.72); border-color: rgba(113, 113, 122, .28); }
.mood-core { width: 101px; height: 101px; border-radius: 50%; display: grid; place-items: center; color: var(--text-primary); background: radial-gradient(circle at 30% 25%, #ffffffeb, #fff6 62%, rgba(194, 194, 201, .55)); border: var(--ui-border); box-shadow: 0 0 33px #ffffff66, inset 0 1px 9px #fff9; animation: none; }
.mood-core .icon { width: 38px; height: 38px; stroke-width: .8; }
.orbit-spark { position: absolute; top: 39px; right: 14px; font-size: var(--type-body); color: var(--text-muted); }
.mood-now h2 { font-family: var(--font-editorial); font-weight: var(--weight-body); font-size: var(--type-title); letter-spacing: .02em; margin: 8px 0 10px; }
.mood-now > p { color: var(--text-secondary); font-size: var(--type-small); line-height: 1.8; margin: 0; }
.last-sync { display: block; margin-top: 20px; font-size: var(--type-caption); color: var(--text-secondary); letter-spacing: .08em; }
.mood-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin: 15px 0; }
.mood-metric { padding: 19px 17px; }.metric-symbol { position: absolute; right: 17px; top: 19px; color: var(--text-muted); font-size: var(--type-title); }
.mood-metric h2 { font-size: var(--type-body); font-weight: var(--weight-medium); margin: 11px 0 8px; letter-spacing: .08em; }.mood-metric > p:last-of-type { font-size: var(--type-small); color: var(--text-primary); margin: 0; }
.quiet-meter { height: 3px; margin-top: 17px; border-radius: 5px; background: linear-gradient(90deg, rgba(113, 113, 122, .24), #fff6); }
.thought-card, .mood-history { margin-top: 15px; }.thought-card > h2 { font-size: var(--type-body); font-weight: var(--weight-medium); margin: 7px 0 0; letter-spacing: .06em; }
.empty-thought { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; }.empty-thought > span { font: var(--type-display)/1 var(--font-editorial); line-height: 1; color: var(--text-muted); }.empty-thought > p { margin: 4px 0 6px; color: var(--text-secondary); font-size: var(--type-small); line-height: var(--leading-body); letter-spacing: .04em; }
.subtle-label { font-size: var(--type-caption); color: var(--text-secondary); }
.history-placeholder { height: 68px; margin: 16px 0 12px; display: flex; flex-direction: column; justify-content: space-between; }.history-placeholder i { width: 100%; height: 1px; border-top: .5px dashed var(--separator); }
.mood-history > p { text-align: center; margin: 0; font-size: var(--type-caption); color: var(--text-secondary); }

.text-button { padding: 3px; min-height: 36px; border: 0; background: transparent; color: var(--text-primary); }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 43px; padding: 11px 18px; border-radius: 11px; font-size: var(--type-small); letter-spacing: .04em; }
.primary-button { border: var(--ui-border); color: var(--text-on-accent); background: var(--accent); box-shadow: 0 5px 15px rgba(39, 39, 42, .08), inset 0 .5px 0 #ffffff80; }
.secondary-button { border: var(--ui-border); color: var(--text-primary); background: #ffffff30; box-shadow: inset 0 .5px 0 #fff; }
.primary-button.compact { min-height: 38px; padding: 8px 12px; font-size: var(--type-small); }.primary-button.compact .icon { width: 13px; height: 13px; }
.full-width { width: 100%; }
body:has(dialog[open]) { overflow: hidden; }
.sheet { position: fixed; inset: auto 0 max(14px, env(safe-area-inset-bottom)); margin: 0 auto; width: min(calc(100% - 24px), calc(var(--app-width) - 24px)); max-height: calc(100dvh - 28px); overflow-y: auto; padding: 23px 22px; color: var(--text-primary); border: var(--ui-border); border-radius: 19px; background: linear-gradient(135deg, rgba(255, 255, 255, .58), rgba(242, 247, 253, .40)); box-shadow: 0 20px 70px #18111d29, inset 0 1px 0 #ffffffa6; backdrop-filter: blur(28px) saturate(110%); -webkit-backdrop-filter: blur(28px) saturate(110%); }
.sheet::backdrop { background: rgba(25, 30, 38, .13); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 26px; }
.sheet-header h2 { font-family: var(--font-editorial); font-size: var(--type-heading); font-weight: var(--weight-body); letter-spacing: .06em; margin: 10px 0 0; line-height: 1.5; }.sheet-header .icon-button { background: #ffffff70; }
.field { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; color: var(--text-secondary); font-size: var(--type-small); letter-spacing: .05em; }
.field input, .field textarea { width: 100%; min-width: 0; max-width: 100%; border: var(--ui-border); border-radius: 11px; padding: 12px 13px; background: #ffffff26; color: var(--text-primary); box-shadow: inset 0 1px 4px #77658008; font-size: var(--type-body); line-height: 1.75; letter-spacing: 0; }
.field textarea { resize: vertical; min-height: 110px; }
.check-field { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: var(--type-small); color: var(--text-secondary); margin-top: 12px; }.check-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.sheet-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 22px; }.sheet-actions .danger { margin-right: auto; font-size: var(--type-small); color: var(--danger); }
.editor-hint { color: var(--text-secondary); font-size: var(--type-caption); line-height: var(--leading-body); margin: 10px 0 0; }
.settings-info { margin: 25px 0 18px; padding-top: 20px; border-top: .5px solid var(--separator); display: flex; align-items: flex-start; gap: 12px; color: var(--text-secondary); }.settings-info > .icon { width: 17px; height: 17px; margin-top: 3px; }.settings-info p { margin: 0; color: var(--text-primary); font-size: var(--type-small); line-height: var(--leading-body); }
.export-button { width: 100%; justify-content: space-between; }
.conversation-list { display: grid; gap: 9px; margin-bottom: 18px; }.conversation-item { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; padding: 14px 15px; background: #ffffff73; border: var(--ui-border); border-radius: 11px; text-align: left; min-width: 0; }.conversation-item.current { border-color: var(--accent); background: #ffffffb3; }.conversation-item strong { font-size: var(--type-body); font-weight: var(--weight-medium); overflow-wrap: anywhere; }.conversation-item span { font-size: var(--type-caption); color: var(--text-secondary); }
.connection-detail { margin-bottom: 26px; }.connection-detail > p { font-size: var(--type-small); color: var(--text-secondary); line-height: var(--leading-body); margin: 18px 0 0; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--nav-offset) + 86px); width: max-content; max-width: calc(100% - 40px); transform: translate(-50%, 12px); display: flex; align-items: center; gap: 12px; padding: 11px 17px; border: var(--ui-border); border-radius: 13px; background: #ffffffe0; color: var(--text-primary); box-shadow: 0 8px 26px #21162b29; backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); opacity: 0; pointer-events: none; transition: .2s ease; font-size: var(--type-small); line-height: 1.8; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }.toast button { border: 0; background: transparent; color: var(--accent); font-size: var(--type-small); font-weight: var(--weight-title); min-height: 30px; white-space: nowrap; }
.storage-warning { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(calc(100% - 30px), calc(var(--app-width) - 30px)); margin: 0; border: 1px solid var(--warning-line); border-radius: 10px; padding: 12px; background: var(--warning-bg); color: var(--warning-text); font-size: var(--type-small); line-height: 1.8; }
@media (hover: hover) { .nav-item:hover, .icon-button:hover, .tiny-button:hover { background: #ffffffd9; }.note-content:hover { color: var(--text-primary); }.journal-entry:hover, .conversation-item:hover { border-color: #fff; }.primary-button:hover { filter: brightness(1.07); } }
@media (min-width: 700px) { :root { --nav-offset: 44px; } body { padding: 32px 0; background: radial-gradient(ellipse at 30% 20%, #f1f1f2, transparent 60%), linear-gradient(135deg, #dddde0, #bdbdc2); }.app-shell { min-height: calc(100svh - 64px); border-radius: 32px; }:root { --frame-top: 32px; }.inner-page { min-height: calc(100svh - 64px); }.sheet { bottom: 44px; max-height: calc(100dvh - 88px); } }
@media (max-width: 360px) { .page { padding-left: 14px; padding-right: 14px; }.glass-card { padding: 17px; }.avatars { gap: 74px; }.avatar { width: 73px; height: 73px; }.quota-content { gap: 16px; }.progress-ring { --size: 96px; }.progress-ring::before { width: 75px; height: 75px; }.sheet { padding: 20px 17px; }.composer-actions { gap: 5px; }.primary-button.compact { padding: 8px 9px; }.journal-entry { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; } }
@media (prefers-reduced-motion: reduce) { *:not(.thinking-dots span), *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }

.small-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: var(--ui-border); border-radius: 50%; color: var(--text-primary); background: linear-gradient(135deg, rgba(255, 255, 255, .40), rgba(255, 255, 255, .18)); box-shadow: inset 0 1px 0 #ffffff80; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-family: var(--font-sans); font-size: var(--type-body); }
.notes-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }.notes-identity > div { min-width: 0; }.notes-identity h2 { margin: 0; font-size: var(--type-title); font-weight: var(--weight-medium); letter-spacing: 0; }.notes-subtitle { margin: 3px 0 0; font-size: var(--type-small); line-height: 1.6; color: var(--text-secondary); }
.notes-subtitle span { display: inline-block; white-space: nowrap; }
.notes-card .tiny-button { flex: 0 0 auto; width: 34px; height: 34px; }
.node-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--text-secondary); font-size: var(--type-caption); }.node-label { display: flex; align-items: center; gap: 1px; }.node-source { white-space: nowrap; font-size: var(--type-caption); }
.chat-page .icon-button { border-radius: 50%; }.chat-profile { padding: 15px; }.chat-profile .small-avatar { margin-bottom: 5px; }.chat-profile h2 { margin: 0; font-size: var(--type-title); font-weight: var(--weight-medium); line-height: 1.6; }.chat-profile p { margin: 2px 0 0; font-size: var(--type-small); line-height: 1.8; color: var(--text-secondary); }

.chat-preview-label { margin: 0 0 -3px; color: var(--text-secondary); text-shadow: var(--text-halo); text-align: center; font-size: var(--type-caption); letter-spacing: .04em; }
.message-content { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; padding-left: 13px; }.incoming .message-content { align-items: flex-start; padding-left: 0; padding-right: 13px; }.message-avatar { margin-bottom: 2px; width: 34px; height: 34px; }.preview-message .message-content { gap: 0; }
.composer-submit { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border: var(--ui-border); border-radius: 50%; background: rgba(255, 255, 255, .36); color: var(--text-primary); font-size: 27px; line-height: 1; }.composer-submit:disabled { opacity: .48; }.composer-note { margin: -7px 0 0; text-align: center; color: var(--text-secondary); font-size: var(--type-caption); text-shadow: var(--text-halo); }

.avatar span, .small-avatar { text-shadow: none; }

/* Typography follows the established frosted-glass design; no display-size UI labels. */
h1, h2 { text-wrap: balance; }
.card-heading h2, .notes-identity h2, .chat-profile h2,
.entry-copy h2, .mood-now h2, .thought-card > h2, .mood-metric h2 {
  line-height: var(--leading-title);
  letter-spacing: 0;
  font-weight: var(--weight-title);
}
.page-intro h1, .mood-intro h1 { line-height: 1.45; letter-spacing: .01em; }
.eyebrow, .card-kicker, .date-line, .section-kicker { line-height: var(--leading-label); font-weight: var(--weight-medium); }
.eyebrow { letter-spacing: .04em; }
.notes-subtitle { font-size: var(--type-caption); letter-spacing: 0; }
.note-content .node-text, .message-bubble, .entry-copy p,
.empty-thought > p { line-height: var(--leading-body); letter-spacing: 0; }
.entry-copy p { font-size: var(--type-small); }
.node-meta, .node-source, .message-status, .composer-note,
.composer-actions > span, .chat-preview-label, .connection-caption,
.last-sync, .editor-hint, .entry-meta, .conversation-item span {
  font-size: var(--type-caption); line-height: var(--leading-label); letter-spacing: .02em;
}
.field { font-size: var(--type-small); font-weight: var(--weight-medium); letter-spacing: 0; }
.field input, .field textarea { font-weight: var(--weight-body); line-height: var(--leading-body); }
.field textarea { max-inline-size: 65ch; }
.love-clock, .progress-ring, .quota-copy, .calendar-grid,
#calendar-year, .journal-summary, .entry-date, .entry-meta,
.last-sync, .subtle-label, .node-label { font-variant-numeric: tabular-nums; }
.love-clock strong { min-width: 2ch; letter-spacing: 0; }
.icon-button, .tiny-button, .notes-card .tiny-button, .composer-submit { width: 44px; height: 44px; }
.note-heart { width: 44px; height: 44px; }
.topbar { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.nav-item { height: 60px; gap: 4px; }
.nav-item b { font-size: var(--type-small); letter-spacing: 0; }
.calendar-grid button { min-height: 44px; aspect-ratio: auto; font-variant-numeric: tabular-nums; }
.filter-button, .primary-button, .secondary-button, .text-button,
.anniversary-link.text-button { min-height: 44px; }
.node-meta { flex-wrap: wrap; gap: 0 8px; }
.conversation-caption { line-height: var(--leading-label); }
.composer-note { margin-top: 0; }

/* Keepsakes: quiet editorial type, real paper edges, transparent glass. */
.date-line { font-family: var(--font-ui); font-size: 19px; font-style: italic; font-weight: 400; letter-spacing: .01em; text-transform: none; }
.eyebrow { font-family: var(--font-ui); font-size: 12px; letter-spacing: .13em; }
.heart-orbit { width: 40px; height: 40px; background: rgba(255,255,255,.3); }
.heart-orbit svg { width: 32px; height: 26px; }
.avatar span { font-family: var(--font-editorial); font-weight: 400; }
.love-clock strong { font-family: var(--font-ui); font-weight: 400; }
.card-heading h2, .notes-identity h2, .chat-profile h2 { font-weight: 500; }
.little-moments { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.08fr); gap: 18px; align-items: center; margin: 2px 0 8px; }
.weather-card { padding: 17px 14px; min-width: 0; position: relative; }
.weather-card .card-kicker { font-size: 10px; letter-spacing: .08em; }
.weather-symbol { position: absolute; right: 13px; top: 46px; font-size: 34px; font-family: var(--font-ui); }
.weather-card h2 { margin: 15px 0 0; font: 44px/1.1 var(--font-ui); }
#weather-description { font-size: 12px; margin: 8px 0 0; min-height: 18px; }
#weather-city { display: block; font-size: 14px; margin: 0; padding: 0; }
.weather-refresh { font-size: 12px; min-height: 32px; padding: 0; }
.weather-credit { display: block; font-size: 10px; color: var(--text-muted); }
.photo-widget { min-width: 0; text-align: center; padding-top: 10px; }
.photo-stack { position: relative; width: calc(100% - 16px); aspect-ratio: .85; margin: 0 auto 14px; }
.instant-photo { position: absolute; inset: 0; border: var(--ui-border); background: #f8f7f4; padding: 7px 7px 0; box-shadow: 0 5px 15px #18181b24; display: flex; flex-direction: column; width: 100%; color: #45454d; }
.layer-0 { z-index: 3; transform: rotate(-5deg); cursor: pointer; }
.layer-1 { z-index: 2; transform: rotate(7deg) translate(4px, -2px); }
.layer-2 { z-index: 1; transform: rotate(-10deg) translate(-3px, -4px); }
.instant-photo img, .photo-blank { width: 100%; height: 0; flex: 1; min-height: 0; object-fit: contain; background: #e8e5e2; }
.photo-blank { display: grid; place-content: center; justify-items: center; gap: 10px; background: linear-gradient(145deg,#e2dfdc,#f0eeeb); }
.photo-blank .icon { width: 25px; height: 25px; stroke-width: 1; }
.photo-blank span { font: italic 11px var(--font-ui); }
.photo-number { display: block; padding: 10px 0; font: italic 10px var(--font-ui); }
.photo-caption { font: italic 15px var(--font-ui); margin: 6px 0 0; text-shadow: var(--text-halo); }
#manage-photos { font-size: 12px; text-shadow: var(--text-halo); padding: 0; }
.photo-upload { margin-top: 18px; position: relative; overflow: hidden; display: flex; justify-content: center; }
.photo-upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.photo-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.photo-manager-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--separator); }
.photo-manager-row img { width: 72px; height: 72px; object-fit: contain; background: #fff8; }
#photo-upload-status, #city-results { font-size: 14px; line-height: 1.7; margin: 12px 0; }
#city-results { display: grid; gap: 8px; }
.chat-header-caption { font: italic 13px var(--font-ui); margin: 4px 0 0; }
.chat-page .topbar-title h1 { font: 25px/1.2 var(--font-ui); }
.chat-profile { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; border-radius: 16px; }
.chat-profile .small-avatar { grid-row: 1 / 3; margin: 0; }
.chat-profile h2 { font-size: 16px; }
.chat-profile p { grid-column: 2; font-size: 12px; line-height: 1.5; }
.message-list { gap: 22px; }
.message-row { align-items: start; }
.message-avatar { margin-top: 4px; }
.message-bubble { border-radius: 18px 18px 18px 5px; font-size: 15px; line-height: 1.8; }
.outgoing .message-bubble { border-radius: 18px 18px 5px 18px; }
.preview-message .message-content { gap: 6px; }
.message-status { font-size: 11px; color: var(--text-muted); text-shadow: var(--text-halo); font-variant-numeric: tabular-nums; }
.process-card { margin: 0 10px -8px 46px; color: var(--text-secondary); text-shadow: var(--text-halo); }
.process-card summary { cursor: pointer; font: 13px/1.7 var(--font-ui); padding: 8px 0; min-height: 40px; }
.process-demo { font-size: 11px; margin: 0 0 12px; }
.process-timeline { list-style: none; padding: 0 0 0 16px; margin: 0 0 10px 3px; border-left: 1px solid #71717a66; }
.process-timeline li { position: relative; padding: 0 0 16px; font-size: 13px; }
.process-timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 6px; height: 6px; border: 1px solid #71717a; background: #eeeded; transform: rotate(45deg); }
.process-timeline strong { font-weight: 500; }.process-timeline p { margin: 5px 0 0; font-size: 12px; line-height: 1.7; }
.action-prose { margin: -12px 12px 0 47px; font-size: 13px; font-style: italic; color: var(--text-muted); text-shadow: var(--text-halo); }
.chat-divider { display: flex; align-items: center; gap: 13px; color: var(--text-muted); font: italic 12px var(--font-ui); text-shadow: var(--text-halo); }
.chat-divider::before,.chat-divider::after { content:''; height:1px; flex:1; background:var(--separator); }
.chat-composer { display: flex; flex-direction: column; gap: 8px; align-items: stretch; border-radius: 20px; padding: 12px 14px 8px; background: linear-gradient(120deg,#ffffff85,#ffffff50); }
.chat-composer textarea { width: 100%; min-height: 45px; padding: 2px 0; font-size: 15px; }
.composer-toolbar { display: flex; align-items: center; gap: 8px; border-top: 1px solid #ffffff50; padding-top: 3px; }
.model-label { margin-right: auto; font-size: 12px; padding: 0; text-align: left; }
.composer-toolbar .tiny-button { background: transparent; border: 0; font-size: 25px; }
.composer-submit { width: 36px; height: 36px; font-size: 24px; background: #27272a; color: #fff; }
@media(max-width:360px) { .little-moments { gap: 13px; }.weather-card { padding: 15px 11px; }.weather-symbol { right: 10px; font-size: 29px; }.date-line { font-size: 17px; }.photo-caption { font-size: 13px; }.photo-blank span { font-size: 10px; }.chat-page .topbar-title h1 { font-size: 22px; } }
/* Small metadata keeps a readable local backing over the textured wallpaper. */
.message-status, .action-prose, .process-card, .chat-preview-label, .conversation-caption { text-shadow: var(--text-shadow); }
@media(max-width:360px) { .eyebrow { font-size: 10px; letter-spacing: .07em; white-space: nowrap; } }
.message-status, .process-demo { font-size: 12px; }
.weather-credit { font-size: 11px; }
#weather-city { overflow-wrap: anywhere; text-align: left; }
.sheet-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-heading h2 { margin: 0; font-size: 22px; font-weight: 500; }
.sheet-heading .tiny-button { flex-shrink: 0; }

/* One handwriting family per script, served with the site for consistent phones. */
@font-face { font-family: 'Blue Hour English'; src: url('./assets/fonts/blue-hour-english-italic.woff') format('woff'); font-weight: 300 700; font-style: italic; font-display: swap; unicode-range: U+0041-005A,U+0061-007A,U+00C0-024F; }
@font-face { font-family: 'Blue Hour Han'; src: url('./assets/fonts/blue-hour-han.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+2000-206F,U+2E80-9FFF,U+F900-FAFF,U+FF00-FFEF; }
:root { --font-ui: 'Blue Hour English','Blue Hour Han','Kaiti SC','KaiTi','STKaiti',serif; --font-sans: var(--font-ui); --font-editorial: var(--font-ui); }
body { font-size: 17px; }
.eyebrow { font-family: var(--font-ui); font-size: 15px; letter-spacing: .07em; }
.card-kicker, .section-kicker { font-size: 14px; letter-spacing: .06em; }
.hero { padding: 24px 0 20px; }
.avatars { margin-bottom: 8px; }
.heart-orbit { width: 28px; height: 28px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; text-shadow: none; }
.heart-orbit .icon { width: 24px; height: 24px; fill: var(--text-primary); stroke: none; }
.hero-prelude { font-size: 24px; font-style: italic; margin: 0; line-height: 1.2; }
.date-line { font-family: var(--font-ui); font-style: italic; font-size: clamp(25px,6.5vw,31px); line-height: 1.35; white-space: nowrap; margin: 3px 0 18px; letter-spacing: 0; }
.love-clock { gap: 6px; }
.love-clock strong { font-family: var(--font-ui); font-size: 32px; }
.love-clock span { font-size: 20px; margin-right: 4px; font-style: italic; }
.anniversary-link.text-button { margin-top: 2px; }
.little-moments { align-items: stretch; gap: 14px; grid-template-columns: 1fr 1fr; margin: 0; }
.little-moments .glass-card { padding: 14px; min-height: 222px; }
.weather-card .card-kicker { font-size: 13px; }
.weather-card h2 { font: 54px/1 var(--font-ui); margin-top: 19px; }
.weather-symbol { top: 48px; font-size: 32px; }
#weather-description { font-size: 12px; }
#weather-city { min-height: 35px; }
.weather-credit { font-family: var(--font-ui); font-size: 12px; }
.weather-refresh { min-height: 26px; }
.quota-card .card-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
.quota-card .card-heading h2 { font-size: 17px; margin-top: 0; }
.quota-card .status-dot { border: 0; padding: 0; background: transparent; font-size: 12px; }
.quota-card .quota-content { padding: 10px 0 0; display: block; }
.quota-card .progress-ring { --size: 65px; margin: 0 auto 5px; }
.quota-card .progress-ring::before { width: 51px; height: 51px; }
.quota-card .progress-ring strong { font: 28px/1 var(--font-ui); }
.quota-card .quota-copy { text-align: center; }
.quota-card .quota-pending { font-size: 14px; }
.quota-card .quota-copy > span { font-size: 12px; margin-top: 2px; }
.quota-card .mini-bars { display: none; }
.album-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 18px 12px; min-height: 262px; overflow: hidden; }
.album-copy { flex: 1; min-width: 0; }
.album-copy h2 { font-size: 20px; font-weight: 400; line-height: 1.65; margin: 13px 0 9px; }
.album-copy > p:last-child { font-size: 12px; margin: 0; }
.album-section .photo-widget { flex: 0 0 44%; padding: 8px 0 0; }
.photo-caption { font-family: var(--font-ui); font-size: 17px; }
.photo-number { font-family: var(--font-ui); font-size: 12px; }
.photo-blank span { font-family: var(--font-ui); font-size: 14px; }
.closing-line { font-family: var(--font-ui); font-size: 21px; }
.notes-identity h2 { font-size: 25px; }
.notes-subtitle { font-size: 14px; }
.note-content .node-text { font-weight: 400; font-size: 17px; }
.note-content .node-dot { border: 0; border-radius: 0; background: var(--text-secondary); width: 9px; height: 9px; transform: rotate(45deg); top: 13px; left: -19px; box-shadow: 0 0 0 3px #ffffff80; }

/* The name, current status and menu share a single full-width header. */
.chat-page { gap: 14px; }
.chat-namebar { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 9px; border-radius: 16px; min-height: 83px; }
.plain-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 12px; background: transparent; padding: 0; color: var(--text-primary); }
.chat-name-copy { min-width: 0; flex: 1; }
.chat-name-line { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.chat-name-line h1 { margin: 0; font-size: 23px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.feeling-label.text-button { font-size: 12px; min-height: 22px; padding: 0; color: var(--text-muted); }
.chat-service-status { font-size: 12px; margin: 3px 0 0; line-height: 1.5; color: var(--text-secondary); }
.chat-service-status > span { display: inline-block; vertical-align: middle; width: 5px; height: 5px; background: var(--text-disabled); border-radius: 50%; margin-right: 4px; }
.conversation-caption { align-items: center; gap: 12px; margin: 0; }
.conversation-caption > span { min-width: 0; overflow-wrap: anywhere; }
.conversation-caption .text-button { min-height: 30px; padding: 0; white-space: nowrap; font-size: 12px; }
.message-row { grid-template-columns: minmax(0,1fr) 52px; gap: 10px; align-items: start; }
.message-row.incoming { grid-template-columns: 52px minmax(0,1fr); }
.message-avatar.small-avatar { width: 52px; height: 52px; margin: 0; font: 23px/1 var(--font-ui); }
.message-content { padding-left: 0; }
.incoming .message-content { padding-right: 0; }
.message-bubble { font-size: 17px; min-height: 52px; padding: 11px 14px; line-height: 1.75; }
.message-status { padding: 0 3px; font-size: 12px; }
.process-card { margin-left: 62px; }
.process-card summary { font-family: var(--font-ui); font-size: 19px; }
.process-timeline { font-family: var(--font-ui); }
.process-timeline strong { font-size: 15px; }
.action-prose { margin-left: 63px; font-size: 13px; }
.chat-divider { font-family: var(--font-ui); font-size: 17px; }
.chat-composer textarea { font-size: 17px; }
.model-label { font-size: 13px; }
.chat-menu, .composer-panel { position: fixed; margin: 0; color: var(--text-primary); background: linear-gradient(130deg,#f8f8f8df,#f6f5f5b8); box-shadow: 0 12px 36px #18181b29,inset 0 1px #fff; backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px); padding: 12px; }
.chat-menu { width: 210px; max-width: calc(100vw - 36px); left: auto; right: max(18px,calc(50% - 197px)); top: calc(var(--frame-top,0px) + 105px); border-radius: 18px; }
.popover-kicker { font-size: 14px; margin: 0 8px 6px; letter-spacing: .08em; color: var(--text-muted); }
.chat-menu > button { width: 100%; display: flex; gap: 13px; align-items: center; padding: 8px 11px; background: transparent; border: 0; border-radius: 9px; min-height: 45px; text-align: left; font-size: 17px; }
.chat-menu .new-chat-action { border-top: 1px solid var(--separator); border-radius: 0; margin-top: 5px; padding-top: 13px; }
.chat-menu button:hover { background: #ffffff70; }
.composer-panel { bottom: calc(var(--nav-offset) + 215px); left: 50%; transform: translateX(-50%); width: min(calc(100vw - 36px),394px); max-height: 47svh; overflow-y: auto; border-radius: 20px; padding: 15px 17px 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; }
.panel-title h2 { font-size: 17px; font-weight: 400; margin: 0; }
.composer-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 9px; }
.composer-shortcuts > button { display: grid; justify-items: center; gap: 9px; min-height: 88px; border: 0; background: transparent; font-size: 14px; }
.composer-shortcuts > button > span { display: grid; place-items: center; width: 57px; height: 57px; border: var(--ui-border); border-radius: 50%; background: #fff7; }
.composer-shortcuts .icon { width: 27px; height: 27px; }
.emoji-picker { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--separator); }
.emoji-choice { border: 0; background: #fff7; border-radius: 10px; min-height: 45px; font-size: 15px; padding: 5px; overflow-wrap: anywhere; }
.service-list { display: grid; gap: 13px; }
.service-list > div { padding: 13px 0; border-bottom: 1px solid var(--separator); }
.service-list strong { font-size: 18px; font-weight: 400; }.service-list span { float: right; font-size: 13px; }.service-list p { font-size: 14px; margin: 7px 0 0; color: var(--text-secondary); }
#chat-search-results { margin-top: 17px; }.conversation-item span { white-space: pre-wrap; overflow-wrap: anywhere; }
.field select { width: 100%; min-height: 46px; font: inherit; color: inherit; background: #ffffff40; border: var(--ui-border); border-radius: 11px; padding: 8px 12px; }

/* Memory is a reading page: clear totals, focused search and generous cards. */
.memory-intro { padding: 24px 5px 19px; color: var(--text-on-image); text-shadow: var(--image-text-shadow); }
.memory-intro h1 { font: italic 59px/1.1 var(--font-ui); margin: 0 0 13px; }
.memory-system { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.memory-system > span { font-size: 25px; font-style: italic; }
.memory-connection.text-button { min-height: 32px; padding: 0; font-size: 13px; color: inherit; text-shadow: inherit; }
.memory-intro > p { font-size: 14px; margin: 8px 0 0; }
.memory-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 8px; gap: 8px; }
.memory-tab { display: grid; grid-template-columns: 1fr auto; align-items: center; text-align: left; border: 1px solid transparent; border-radius: 12px; background: transparent; padding: 13px; color: var(--text-secondary); }
.memory-tab.active { background: #ffffff50; border-color: #ffffffc0; }
.memory-tab > span { font-size: 20px; }.memory-tab em { grid-row: 2; font-size: 20px; line-height: 1.2; }.memory-tab strong { grid-column: 2; grid-row: 1 / 3; font-size: 32px; font-weight: 400; font-variant-numeric: tabular-nums; }
.memory-search { display: flex; gap: 10px; margin: 20px 0 3px; align-items: center; }
.memory-search .search-box { margin: 0; min-width: 0; flex: 1; padding-left: 16px; }.memory-search .icon-button { flex-shrink: 0; height: 48px; width: 48px; }
.memory-list-caption { display: flex; justify-content: space-between; align-items: center; font-size: 13px; text-shadow: var(--text-halo); margin-bottom: 6px; }.memory-list-caption .text-button { font-size: 13px; }
.memory-list { display: grid; gap: 16px; }
.memory-entry { text-align: left; width: 100%; display: flex; flex-direction: column; min-height: 238px; padding: 22px; }
.memory-entry-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--text-secondary); font-size: 17px; }
.memory-entry-meta span { font-style: italic; }.memory-entry h2 { font-size: 23px; font-weight: 400; margin: 14px 0 10px; }
.memory-entry-preview { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 16px; line-height: 1.9; white-space: pre-wrap; margin: 0 0 17px; }
.memory-entry-footer { font-size: 12px; color: var(--text-muted); margin-top: auto; }
.memory-list .empty-state { padding: 28px 22px; min-height: 250px; border-radius: 18px; background: var(--glass); border: var(--ui-border); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
@media(max-width:360px) { .eyebrow { font-size: 12px; white-space: nowrap; }.avatars { gap: 76px; }.date-line { font-size: 25px; }.little-moments { gap: 11px; }.little-moments .glass-card { padding: 12px; }.quota-card .card-heading h2 { font-size: 15px; }.weather-card .card-kicker { font-size: 12px; }.album-section { padding: 17px 14px 12px; }.album-copy h2 { font-size: 17px; }.album-section .photo-widget { flex-basis: 44%; }.chat-namebar { gap: 3px; padding: 10px 5px; }.chat-name-line { gap: 5px; }.chat-name-line h1 { font-size: 21px; }.feeling-label.text-button { font-size: 11px; }.message-row { grid-template-columns: minmax(0,1fr) 48px; gap: 8px; }.message-row.incoming { grid-template-columns: 48px minmax(0,1fr); }.message-avatar.small-avatar { width: 48px; height: 48px; }.message-bubble { min-height: 48px; padding: 9px 11px; font-size: 16px; }.process-card { margin-left: 56px; }.action-prose { margin-left: 56px; }.memory-tab { padding: 10px; }.memory-tab > span { font-size: 18px; }.memory-tab strong { font-size: 29px; }.memory-entry { padding: 19px; } }

/* Screenshot refinements: quiet nested controls and default, upright numerals. */
:root { --font-default: -apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',system-ui,sans-serif; --font-ui: 'Blue Hour English','Blue Hour Han',var(--font-default); }
.site-backdrop img { filter: blur(1.6px); }
.avatars { gap: 74px; }
.hero { padding-bottom: 24px; }
.hero .date-line { font-size: clamp(24px,6.4vw,30px); }
.love-clock strong, .calendar-grid button, #calendar-year,
#weather-temp, .quota-value, .message-status, .node-date,
.memory-tab strong, .photo-number, .memory-entry-meta time,
.entry-date, .entry-meta, .last-sync { font-family: var(--font-default); font-style: normal; font-variant-numeric: tabular-nums; }
.love-clock strong { font-size: 27px; font-weight: 400; }
#weather-temp { font-size: 46px; font-weight: 300; }
.photo-number { font-size: 11px; }
#calendar-year { font-size: 12px; letter-spacing: .03em; }
.card-kicker { letter-spacing: .03em; }
.quota-card .quota-content { padding-top: 22px; }
.quota-strip { padding: 0 0 15px; }
.quota-value { display: flex; align-items: baseline; gap: 4px; margin-bottom: 13px; }
.quota-value strong { font-weight: 300; font-size: 35px; line-height: 1.1; }
.quota-value span { font-size: 15px; }
.quota-track { width: 100%; height: 7px; border-radius: 6px; border: var(--ui-border); background: #ffffff52; overflow: hidden; }
.quota-track span { display: block; height: 100%; width: 0; background: var(--accent); }
.quota-card .quota-copy { text-align: left; }
.quota-card .quota-pending { font-size: 14px; }
.calendar-heading .tiny-button { background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; font-family: var(--font-default); font-size: 28px; font-weight: 600; }
.calendar-grid button.today { color: var(--text-primary); background: transparent; border: 1px solid #27272a55; box-shadow: none; font-weight: 500; }
.calendar-grid button.selected, .calendar-grid button.selected:not(.today) { color: var(--text-primary); background: transparent; border: 1px solid var(--text-primary); box-shadow: none; }
.glass-card .tiny-button { border: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.notes-identity { gap: 12px; }
.notes-identity .small-avatar { width: 50px; height: 50px; font-size: 25px; }
.notes-identity h2 { font-size: 26px; }
.notes-subtitle { font-size: 15px; }
.notes-card .tiny-button { font-family: var(--font-default); font-size: 25px; }
.note-content .node-dot, .paper-note.loved .note-content .node-dot { width: 20px; height: 23px; left: -25px; top: 6px; transform: none; background: transparent; border: 0; border-radius: 0; box-shadow: none; color: var(--text-primary); }
.node-dot > .icon { width: 20px; height: 23px; fill: none; stroke-width: 1.25; }
.node-meta { justify-content: flex-end; gap: 0 7px; flex-wrap: nowrap; min-height: 42px; padding-top: 1px; font-size: 12px; }
.node-emotion { white-space: nowrap; }
.node-date { white-space: nowrap; font-size: 11px; }
.note-heart { flex-shrink: 0; width: 34px; height: 42px; margin-right: -6px; }
.note-heart > .icon { width: 17px; height: 17px; }
.note-fields { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.6fr); gap: 12px; }
.note-fields input { min-width: 0; }

/* A continuous, square-edged top bar, following the messenger reference. */
.chat-namebar { position: sticky; top: var(--frame-top,0px); z-index: 9; width: calc(100% + 36px); margin: calc(-1 * max(18px,env(safe-area-inset-top))) -18px 0; padding: 10px 12px; min-height: 75px; border: 0; border-bottom: 1px solid #ffffff8c; border-radius: 0; box-shadow: none; background: #f4f3f1b3; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.chat-name-copy { text-align: center; }
.chat-name-line { justify-content: center; gap: 8px; }
.chat-name-line h1 { font-size: 22px; }
.chat-service-status { font-size: 11px; }
.chat-menu { top: calc(var(--frame-top,0px) + 82px); }
.message-bubble, .incoming .message-bubble, .outgoing .message-bubble { border-radius: 17px; }
.chat-composer { width: calc(100% + 16px); margin: 3px -8px 0; border-radius: 15px; padding: 7px 12px 5px; gap: 1px; }
.chat-composer textarea { min-height: 31px; max-height: 88px; padding: 1px 0; line-height: 1.5; }
.composer-toolbar { padding-top: 0; border: 0; min-height: 36px; gap: 5px; }
.model-label.text-button { min-height: 34px; font-size: 12px; }
.composer-toolbar .tiny-button { width: 36px; height: 36px; min-height: 36px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; font-family: var(--font-default); font-size: 26px; }
.composer-submit { width: 34px; height: 34px; font-family: var(--font-default); font-size: 23px; }
.composer-panel { bottom: calc(var(--nav-offset) + 172px); }
.chat-composer + .composer-note { font-size: 11px; }
.composer-shortcuts > button > span { border: 0; background: transparent; }
@media(max-width:360px) { .avatars { gap: 60px; }.hero .date-line { font-size: 24px; }.chat-namebar { width: calc(100% + 28px); margin-left: -14px; margin-right: -14px; padding: 10px 7px; }.chat-name-line h1 { font-size: 21px; }.notes-identity .small-avatar { width: 45px; height: 45px; font-size: 23px; }.notes-identity h2 { font-size: 24px; }.notes-subtitle { font-size: 13px; }.node-meta { gap: 0 5px; }.node-date { font-size: 10px; }.node-emotion { font-size: 11px; }.note-fields { grid-template-columns: 1fr; } }
.chat-page { min-height: 100svh; }
.chat-page .message-list { flex: 1 0 auto; }
@media(min-width:700px) { .chat-page { min-height: calc(100svh - 64px); } }
.sheet .icon-button, .sheet .tiny-button { border: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Final density pass: one glass material, a lighter numeric rhythm, plain symbols. */
:root { --chat-glass: linear-gradient(120deg,rgba(255,255,255,.52),rgba(255,255,255,.31)); --weight-numeric: 300; --chat-avatar-size: 40px; --chat-icon-size: 25px; }
.heart-orbit .icon { fill: #fff; width: 23px; height: 23px; filter: drop-shadow(0 1px 3px #18181b40); }
.love-clock strong, .memory-tab strong { font-family: var(--font-default); font-weight: var(--weight-numeric); font-style: normal; font-variant-numeric: tabular-nums; }
.memory-tab strong { font-size: 30px; }
.memory-tab.active { background: transparent; border: 1px solid var(--text-primary); }
.chat-namebar, .chat-composer { background: var(--chat-glass); backdrop-filter: blur(18px) saturate(115%); -webkit-backdrop-filter: blur(18px) saturate(115%); }
.chat-namebar { min-height: 68px; padding-top: 8px; padding-bottom: 8px; }
.chat-name-copy { text-align: left; }
.chat-name-line { justify-content: flex-start; }
.chat-name-line h1 { font-size: 20px; }
.chat-service-status { text-align: left; }
.chat-page { gap: 12px; }
.chat-page .message-list { gap: 16px; padding-top: 4px; }
.message-row { grid-template-columns: minmax(0,1fr) var(--chat-avatar-size); gap: 8px; }
.message-row.incoming { grid-template-columns: var(--chat-avatar-size) minmax(0,1fr); }
.message-avatar.small-avatar { width: var(--chat-avatar-size); height: var(--chat-avatar-size); font-size: 19px; }
.message-bubble { min-height: var(--chat-avatar-size); font-size: 15px; line-height: 1.65; padding: 8px 12px; }
.message-status { font-size: 11px; }
.process-card { margin: 0 5px -5px 48px; }
.process-card summary { font-size: 15px; min-height: 32px; padding: 4px 0; line-height: 1.6; }
.process-demo, .process-timeline p { font-size: 11px; }
.process-timeline { margin-bottom: 5px; }.process-timeline li { padding-bottom: 12px; }.process-timeline strong { font-size: 13px; }
.action-prose { margin-left: 49px; font-size: 12px; }
.chat-divider { font-size: 15px; }
.chat-preview-label { font-size: 11px; }
.chat-composer textarea { font-size: 15px; }
.chat-back .icon, #chat-settings-toggle .icon, #composer-more .icon, .composer-submit .icon { width: var(--chat-icon-size); height: var(--chat-icon-size); stroke-width: 1.85; }
#chat-settings-toggle .icon { fill: currentColor; }
.composer-toolbar .tiny-button, .composer-submit { width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text-primary); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.composer-submit:disabled { opacity: .4; }
@media(max-width:360px) { :root { --chat-avatar-size: 36px; }.chat-name-line h1 { font-size: 19px; }.message-avatar.small-avatar { font-size: 18px; }.message-bubble { padding: 7px 10px; font-size: 14px; }.process-card { margin-left: 44px; }.action-prose { margin-left: 45px; }.memory-tab strong { font-size: 28px; } }

/* Shared alignment, border and text roles for every page. */
@font-face { font-family: 'Ferrum Numerals'; src: url('./assets/fonts/ferrum-numerals.woff') format('woff'); font-style: normal; font-weight: 400; font-display: swap; unicode-range: U+0030-0039,U+002D,U+2014,U+0025,U+00B0; }
:root { --font-numeric-display: 'Ferrum Numerals',Georgia,serif; --chat-gutter: 12px; --icon-stroke: 1.35; }
.love-clock strong, .memory-tab strong, #weather-temp, .quota-value strong { font-family: var(--font-numeric-display); font-weight: 400; font-style: normal; font-variant-numeric: lining-nums tabular-nums; }
.love-clock strong { font-size: 34px; min-width: 1.5ch; line-height: 1.2; }
.memory-tab strong { font-size: 36px; }
#weather-temp { font-size: 53px; }
.quota-value strong { font-size: 38px; }

.chat-page { padding-inline: var(--chat-gutter); }
.chat-page .chat-namebar { margin-inline: calc(-1 * var(--chat-gutter)); width: calc(100% + var(--chat-gutter) * 2); padding-inline: var(--chat-gutter); border-bottom: var(--ui-border); }
.chat-page .message-list { width: 100%; margin-inline: 0; }
.chat-page .chat-composer { width: 100%; margin-inline: 0; }
.chat-back .icon, #chat-settings-toggle .icon, #composer-more .icon, .composer-submit .icon { stroke-width: var(--icon-stroke); }
#chat-settings-toggle .icon { fill: none; }

.glass-card, .avatar, .small-avatar, .message-bubble, .bottom-nav,
.sheet, .search-box, .field input, .field textarea, .field select,
.secondary-button, .primary-button, .toast { border-width: var(--ui-border-width); border-color: var(--ui-border-color); }
.avatar, .small-avatar { box-shadow: var(--shadow); }
.sheet { box-shadow: 0 20px 60px #18111d29; }
.chat-menu, .composer-panel { box-shadow: 0 12px 36px #18181b29; }
.chat-composer:focus-within { border-color: var(--ui-border-color); box-shadow: var(--shadow); }

/* Dark reading text, medium descriptions, quiet metadata. */
.glass-card h2, .chat-name-line h1, .message-bubble, .note-content .node-text,
.memory-entry h2, .memory-tab.active > span { color: var(--text-primary); }
.card-kicker, .notes-subtitle, .chat-service-status, .feeling-label.text-button,
.album-copy > p:last-child, .quota-copy > span, .memory-tab em,
.memory-entry-preview, .editor-hint, .settings-info p, .service-list p { color: var(--text-secondary); }
.node-meta, .node-date, .entry-meta, .memory-entry-footer, .last-sync,
.subtle-label, .weather-credit, .composer-note, .page-footnote,
.page-footnote span { color: var(--text-muted); }
.note-heart { color: var(--text-secondary); }
.card-kicker { font-weight: 400; }
.notes-subtitle, .album-copy > p:last-child { font-size: 13px; }
.node-meta, .node-date, .memory-entry-footer { font-size: 11px; }
input::placeholder, textarea::placeholder { color: var(--text-placeholder); }
.empty-state > p, #weather-description { color: var(--text-secondary); }
.process-card, .message-status, .action-prose, .chat-preview-label, .chat-divider { color: #f2f3f5; text-shadow: var(--text-shadow); }
.process-demo, .process-timeline p { color: #e2e5e9; }
.chat-composer + .composer-note { color: var(--text-muted); text-shadow: var(--text-shadow); }
.memory-list-caption { color: var(--text-secondary); }
@media(max-width:360px) { .love-clock { gap: 4px; }.love-clock strong { font-size: 31px; }.memory-tab strong { font-size: 33px; } }
.hero-prelude, .love-clock span { color: rgba(255,255,255,.76); }
.hero .date-line { color: #fff; }
.memory-system > span { color: rgba(255,255,255,.84); }
.memory-intro > p { color: rgba(255,255,255,.72); }
.memory-tab strong { color: var(--text-primary); }
.eyebrow { color: var(--text-secondary); }

/* Appearance roles and on-device settings. */
:root { --wallpaper-blur: 1.6px; --text-image-muted: #f2f3f5; }
.site-backdrop img { filter: blur(var(--wallpaper-blur)); }
[data-avatar] { overflow: hidden; }
[data-avatar] img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
[data-avatar].has-avatar-image { padding: 0; }
.hero .date-line, .love-clock strong, .memory-intro { color: var(--text-on-image); }
.hero-prelude, .love-clock span, .memory-system > span, .memory-intro > p { color: var(--text-on-image); opacity: .82; }
.process-card, .message-status, .action-prose, .chat-preview-label, .chat-divider, .process-demo, .process-timeline p { color: var(--text-image-muted); }
.settings-sheet { padding: 20px; }
.settings-header { gap: 9px; align-items: center; margin-bottom: 10px; }
.settings-header > div { flex: 1; min-width: 0; }
.settings-header h2 { margin: 0; font-size: 23px; }
.settings-header .card-kicker { font-size: 11px; color: var(--text-muted); }
.settings-header .plain-icon { flex: 0 0 32px; width: 32px; height: 40px; display: grid; place-items: center; }
.settings-profile { display: flex; align-items: center; gap: 14px; width: 100%; padding: 20px 0 24px; background: none; border: 0; text-align: left; }
.settings-profile-avatar.small-avatar { width: 68px; height: 68px; font-size: 28px; }
.settings-profile > span:nth-child(2) { min-width: 0; flex: 1; }
.settings-profile strong { display: block; font-size: 23px; font-weight: 400; line-height: 1.4; }
.settings-profile em { display: block; font-size: 18px; color: var(--text-secondary); line-height: 1.5; }
.settings-profile small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.settings-chevron { width: 16px; height: 16px; transform: rotate(180deg); color: var(--text-secondary); }
.settings-menu { border-top: 1px solid var(--separator); }
.settings-menu > button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 13px 0; text-align: left; border: 0; border-bottom: 1px solid var(--separator); background: none; }
.settings-menu > button > span { flex: 1; font-size: 17px; }
.settings-menu small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.5; margin-top: 3px; }
.settings-footnote { color: var(--text-secondary); font: italic 19px/1.5 var(--font-ui); text-align: center; margin: 21px 0 4px; }
.avatar-settings-row { display: flex; gap: 22px; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--separator); }
.settings-edit-avatar.small-avatar { width: 86px; height: 86px; font-size: 32px; }
.avatar-settings-row > div { display: grid; gap: 8px; justify-items: start; }
.avatar-settings-row strong { font-weight: 400; font-size: 18px; }
.media-upload { display: inline-flex; justify-content: center; align-items: center; position: relative; overflow: hidden; min-height: 38px; padding: 7px 15px; font-size: 14px; cursor: pointer; border-radius: 10px; }
.media-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.media-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.media-upload:has(input:disabled) { opacity: .5; }
.media-reset { display: block; font-size: 12px; color: var(--text-secondary); padding: 4px 0; }
.settings-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 0 13px; }
.settings-section-heading h3 { font-size: 18px; font-weight: 400; margin: 0; }
.settings-section-heading > span { color: var(--text-secondary); font-size: 17px; }
.wallpaper-setting { display: flex; align-items: center; gap: 20px; }
.wallpaper-setting > img { width: 90px; height: 118px; object-fit: contain; background: #ffffff30; border-radius: 10px; border: var(--ui-border); }
.wallpaper-setting > div { min-width: 0; }
.wallpaper-setting p { font-size: 14px; color: var(--text-secondary); margin: 0 0 10px; }
.blur-label { display: flex; justify-content: space-between; font-size: 15px; margin: 20px 0 4px; }
.blur-label output { font-family: var(--font-default); font-size: 13px; color: var(--text-secondary); }
.blur-slider { display: block; width: 100%; height: 32px; margin: 0; accent-color: var(--accent); }
.range-caption { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 11px; }
.colors-heading { border-top: 1px solid var(--separator); padding-top: 22px; margin-top: 22px; }
.color-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 73px; border-bottom: 1px solid var(--separator); }
.color-role-label { min-width: 0; }
.color-role-label strong { font-size: 15px; font-weight: 400; }
.color-role-label small { display: block; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.color-inputs { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.color-inputs input[type="color"] { width: 29px; height: 29px; padding: 2px; border: var(--ui-border); border-radius: 50%; background: transparent; cursor: pointer; }
.color-inputs input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-inputs input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-inputs input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.color-inputs input[type="text"] { width: 79px; min-width: 0; padding: 6px 3px; border: 0; border-bottom: 1px solid var(--separator); border-radius: 0; background: transparent; font: 11px/1.5 var(--font-default); text-align: center; color: var(--text-secondary); }
.type-preview { display: grid; gap: 5px; padding: 17px 12px; margin-top: 20px; border: var(--ui-border); border-radius: 12px; background: #ffffff30; }
.type-preview strong { font-size: 17px; font-weight: 400; color: var(--text-primary); }
.type-preview span { font-size: 13px; color: var(--text-secondary); }
.type-preview small { font-size: 11px; color: var(--text-muted); }
.palette-actions { display: flex; flex-direction: column; align-items: start; gap: 12px; margin: 20px 0; }
.palette-actions .text-button { font-size: 13px; }
.palette-dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.palette-dots i { width: 10px; height: 10px; border-radius: 50%; background: #131112; }
.palette-dots i:nth-child(2) { background: #494849; }.palette-dots i:nth-child(3) { background: #8a8a8a; }.palette-dots i:nth-child(4) { background: #c3c3c3; }.palette-dots i:nth-child(5) { background: #e6e6e6; }
.settings-services { margin-top: 20px; }.settings-services span { color: var(--text-muted); }
.storage-summary { display: grid; gap: 4px; padding: 24px 0; }
.storage-summary > span { font-size: 13px; color: var(--text-secondary); }
.storage-summary strong { font: 300 32px/1.4 var(--font-default); color: var(--text-primary); }
.storage-summary small { font-size: 12px; color: var(--text-muted); }
.cache-action { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--separator); padding: 22px 0 5px; margin-top: 26px; }
.cache-action > div { flex: 1; }.cache-action strong { font-weight: 400; font-size: 16px; }.cache-action p { color: var(--text-secondary); font-size: 12px; margin: 5px 0 0; }.cache-action > button { padding: 8px 0; font-size: 14px; }
#settings-media-status:empty { display: none; }
@media(max-width:360px) { .settings-sheet { padding: 17px; }.settings-profile { gap: 11px; }.settings-profile-avatar.small-avatar { width: 58px; height: 58px; }.settings-profile em { font-size: 16px; }.color-inputs { gap: 3px; }.color-inputs input[type="text"] { width: 71px; font-size: 10px; }.color-role-label small { font-size: 10px; }.color-role-label strong { font-size: 14px; }.settings-section-heading > span { font-size: 15px; } }
.cache-recovery { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; font-size: 13px; color: var(--text-secondary); }.cache-recovery button { font-size: 13px; }

/* A single optional, adjustable text shadow; glass and icon shadows stay separate. */
.shadow-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0 15px; font-size: 16px; }
.shadow-toggle small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.shadow-toggle input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
#shadow-options input:disabled { opacity: .4; cursor: default; }
#shadow-options .blur-label { margin-top: 17px; }
.shadow-preview { display: grid; gap: 4px; text-align: center; margin-top: 20px; padding: 21px 8px; border: var(--ui-border); border-radius: 12px; background: linear-gradient(110deg,#c5d4da,#f5f8f9); color: var(--text-on-image); text-shadow: var(--text-shadow); }
.shadow-preview > span { font: italic 23px/1.4 var(--font-ui); }
.shadow-preview strong { font: 400 34px/1.2 var(--font-numeric-display); letter-spacing: .05em; }
#shadow-preview-caption { text-align: center; margin: 7px 0 16px; }
#reset-text-shadow { font-size: 13px; }

/* Reference rows 1, 3, 4 and 5: four text shades at 900, 400, 300 and 200.
   Glass outlines remain independently white. */
:root { --text-primary:#18181b; --text-secondary:#a1a1aa; --text-muted:#a1a1aa; --text-placeholder:#d4d4d8; --text-disabled:#e4e4e7; --neutral-border:#e4e4e7; --page-ground:#fafafa; --separator:color-mix(in srgb,var(--neutral-border) 75%,transparent); --ui-border-color:color-mix(in srgb,var(--neutral-border) 70%,transparent); --font-english:'Blue Hour English'; --font-ui:var(--font-english),'Blue Hour Han',var(--font-default); --chat-glass:var(--glass); }
/* Map normal and italic English to the same original italic face, avoiding synthetic slants. */
@font-face { font-family:'Blue Hour English'; src:url('./assets/fonts/blue-hour-english-italic.woff') format('woff'); font-weight:300 700; font-style:normal; font-display:swap; unicode-range:U+0041-005A,U+0061-007A,U+00C0-024F; }
body { font-synthesis:weight; }
.eyebrow,.hero-prelude,.hero .date-line,.card-kicker,.section-kicker,.notes-identity h2,.notes-subtitle,.photo-caption,.closing-line,.memory-system > button,.memory-tab em,.popover-kicker,.settings-footnote,.settings-section-heading > span { font-family:var(--font-ui); font-style:italic; font-weight:400; }
.hero-prelude,.hero .date-line { letter-spacing:.02em; }
.avatar-shen,.avatar-qiqi { transform:none; }
[data-avatar] img { transform:none; image-orientation:from-image; }
.site-backdrop { background:var(--page-ground); }
.glass-card,.avatar,.small-avatar,.message-bubble,.bottom-nav,.sheet,.search-box,.secondary-button,.conversation-item,.chat-menu,.composer-panel,.chat-namebar,.chat-composer,.field input,.field textarea,.field select { background:var(--glass); }
.icon-button,.tiny-button,.type-preview { background:var(--glass); }
.sheet .icon-button,.sheet .tiny-button,.glass-card .tiny-button { background:transparent; }
.calendar-heading .tiny-button { background:transparent; }
.nav-item.active { background:transparent; box-shadow:none; }
button:disabled,.composer-submit:disabled { color:var(--text-disabled); opacity:1; }
input::placeholder,textarea::placeholder { color:var(--text-placeholder); opacity:1; }
.chat-service-status,.node-meta,.node-date,.weather-credit,.last-sync,.entry-meta,.memory-entry-footer,.card-kicker,.settings-menu small,.color-role-label small,.range-caption { color:var(--text-secondary); }
.type-preview small { color:var(--text-muted); }
.instant-photo { background:transparent; border:var(--ui-border); border-radius:9px; padding:7px 7px 0; color:var(--text-secondary); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); box-shadow:var(--shadow); }
.instant-photo img,.photo-blank,.photo-manager-row img { background:transparent; }
.instant-photo img { border:0; border-radius:4px; }
.photo-number { color:var(--text-secondary); }
.photo-blank { background:transparent; }
/* A single quiet meter in both orientations; empty tracks mean no live data. */
.meter-track,.quota-track,.quiet-meter { height:5px; border:1px solid color-mix(in srgb,var(--neutral-border) 70%,transparent); border-radius:999px; background:color-mix(in srgb,var(--text-secondary) 13%,transparent); overflow:hidden; }
.meter-track > span { display:block; width:0; height:100%; background:var(--text-secondary); }
.quiet-meter { margin-top:17px; }
.mood-signal { height:150px; display:flex; justify-content:center; align-items:center; gap:12px; margin:20px 0 12px; }
.mood-signal .meter-vertical { display:block; width:6px; height:106px; margin:0; }
.mood-now { padding-bottom:24px; }
/* Every color opens the same picker at its current hue/saturation/value. */
.color-well { display:block; flex:0 0 auto; width:29px; height:29px; min-height:29px; border:var(--ui-border); border-radius:50%; padding:0; box-shadow:none; cursor:pointer; }
.color-picker-sheet { background:var(--glass); }
.color-picker-sheet .sheet-header { margin-bottom:15px; }
.color-picker-sheet h2 { font-size:21px; }
.color-sv { --picker-hue:0; display:block; position:relative; width:100%; height:155px; min-height:155px; padding:0; border:var(--ui-border); border-radius:12px; background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent),hsl(var(--picker-hue) 100% 50%); touch-action:none; overflow:hidden; cursor:crosshair; }
#color-sv-marker { position:absolute; display:block; width:14px; height:14px; border:2px solid #fff; box-shadow:0 0 0 1px #18181b99; border-radius:50%; transform:translate(-50%,-50%); pointer-events:none; }
.color-hue { width:100%; height:22px; margin:4px 0 14px; appearance:none; -webkit-appearance:none; border:var(--ui-border); border-radius:99px; background:linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); cursor:pointer; }
.color-hue::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:15px; height:23px; border:2px solid #fff; border-radius:6px; background:transparent; box-shadow:0 0 0 1px #18181b88; }
.color-hue::-moz-range-thumb { width:12px; height:22px; border:2px solid #fff; border-radius:6px; background:transparent; box-shadow:0 0 0 1px #18181b88; }
.picker-value-row { display:flex; align-items:center; gap:16px; }.picker-samples { display:flex; height:38px; width:84px; flex:0 0 auto; border:var(--ui-border); border-radius:9px; overflow:hidden; }.picker-samples span { width:50%; height:100%; }.picker-value-row .field { margin:0; flex:1; }.picker-value-row input { font-family:var(--font-default); font-size:14px; padding:8px 12px; }
#reset-glass { margin-top:10px; font-size:13px; }
.palette-save-row { display:flex; gap:9px; align-items:center; }.palette-save-row .field { margin:0; flex:1; min-width:0; }.palette-save-row input { font-size:14px; min-height:42px; padding:8px 10px; }.palette-save-row > button { padding:8px 12px; flex:0 0 auto; font-size:13px; }
.saved-color-palettes { display:grid; gap:8px; margin-top:15px; }.saved-palette { display:flex; align-items:center; border:1px solid transparent; border-bottom-color:var(--separator); border-radius:10px; }.saved-palette.active { border-color:var(--accent); }.palette-apply { display:flex; flex:1; min-width:0; min-height:62px; border:0; background:transparent; padding:10px 12px; text-align:left; }.palette-copy { min-width:0; }.palette-copy strong { display:block; font-size:15px; font-weight:400; overflow-wrap:anywhere; }.palette-chips { display:flex; gap:4px; margin-top:5px; }.palette-chips i { display:block; width:11px; height:11px; border:1px solid #e4e4e780; border-radius:50%; }.palette-delete { width:36px; height:44px; margin-right:5px; display:grid; place-items:center; }.palette-delete .icon { width:18px; height:18px; }
#undo-palette-delete { font-size:13px; }
.color-well:disabled { opacity:.35; cursor:default; }
.color-inputs input:disabled,.field input:disabled,.field textarea:disabled { color:var(--text-disabled); opacity:1; }
.storage-summary strong { font-family:var(--font-ui); }

/* Final common theme: four text roles, white glass edges, no fixed dark states. */
@font-face { font-family:'Blue Hour Song'; src:url('./assets/fonts/blue-hour-song.woff2') format('woff2'); font-style:normal; font-weight:400; font-display:swap; unicode-range:U+2000-206F,U+2E80-9FFF,U+F900-FAFF,U+FF00-FFEF; }
:root { --font-default:'Blue Hour Song','Blue Hour Song Extra',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,serif; --font-ui:'Blue Hour English','Blue Hour Song','Blue Hour Song Extra','Songti SC','SimSun',serif; --font-sans:var(--font-ui); --font-editorial:var(--font-ui); --accent:var(--text-primary); --accent-soft:color-mix(in srgb,var(--text-primary) 14%,transparent); --text-muted:var(--text-secondary); --text-on-image:var(--text-primary); --text-image-muted:var(--text-secondary); --text-on-accent:var(--text-primary); --ui-border-color:rgba(255,255,255,.62); --line:var(--ui-border-color); --separator:rgba(255,255,255,.36); }
body { font-family:var(--font-ui); text-shadow:var(--text-shadow); }
button,input,textarea,select { text-shadow:inherit; caret-color:var(--text-primary); }
button:disabled,input:disabled,textarea:disabled,select:disabled { color:var(--text-disabled); }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline:1px solid color-mix(in srgb,var(--text-primary) 65%,transparent); outline-offset:2px; }
.search-box input:focus-visible { outline:none; }
.search-box:focus-within { border-color:var(--text-primary); box-shadow:var(--shadow); }
.primary-button { color:var(--text-primary); background:var(--glass); border:var(--ui-border); }
.primary-button:hover { filter:none; }
.conversation-item.current,.saved-palette.active,.memory-tab.active,.calendar-grid button.selected,.calendar-grid button.selected:not(.today) { border-color:var(--text-primary); background:var(--glass); }
.calendar-grid button.today { border-color:color-mix(in srgb,var(--text-primary) 45%,transparent); color:var(--text-primary); background:transparent; }
.nav-item.active::after { background:var(--text-primary); }
#home-favorites,.star-button,.star-button.is-on { color:var(--text-primary); }
.paper-note.loved .note-heart { color:var(--text-primary); }
.note-content { cursor:default; }
.hero,.hero .date-line,.hero-prelude,.love-clock strong,.memory-intro,.memory-intro h1,.mood-intro,.mood-intro h1,.section-kicker { color:var(--text-primary); opacity:1; }
.love-clock span,.memory-system > span,.memory-intro > p,.mood-intro > p,.mood-intro .section-kicker,.process-card,.process-demo,.process-timeline p,.message-status,.action-prose,.chat-preview-label,.chat-divider { color:var(--text-secondary); opacity:1; }
.glass-card,.avatar,.small-avatar,.message-bubble,.bottom-nav,.sheet,.search-box,.secondary-button,.primary-button,.instant-photo,.chat-menu,.composer-panel,.conversation-item,.icon-button,.app-shell { box-shadow:var(--shadow); }
.sheet .icon-button,.sheet .tiny-button,.glass-card .tiny-button,.composer-toolbar .tiny-button,.composer-submit { box-shadow:none; }
.status-dot { border:0; border-radius:0; background:transparent; box-shadow:none; padding:0; }
.mood-now .status-dot::before { content:none; }
.instant-photo,.instant-photo img { border-radius:0; }
.meter-track,.quota-track,.quiet-meter { border:0; border-radius:0; height:4px; box-shadow:none; background:color-mix(in srgb,var(--text-primary) 13%,transparent); }
.meter-track > span { border-radius:0; background:var(--text-primary); }
.mood-signal { display:grid; width:100%; min-width:0; grid-template-columns:minmax(0,1fr); justify-content:stretch; align-items:stretch; height:auto; gap:21px; margin:30px 0 25px; padding:5px 0; }
.mood-emotion-row { display:grid; width:100%; min-width:0; grid-template-columns:2.5em minmax(0,1fr) 1em; align-items:center; gap:13px; text-align:left; color:var(--text-secondary); font-size:14px; }
.mood-emotion-row small { font-size:12px; text-align:right; color:var(--text-placeholder); }
/* Native date/select artwork uses the current text color, never a black bitmap. */
.field input[type='date'],.field input[type='datetime-local'] { background-image:var(--calendar-icon),var(--glass); background-repeat:no-repeat; background-position:right 14px center,center; background-size:19px 19px,auto; }
.field input[type='date']::-webkit-calendar-picker-indicator,.field input[type='datetime-local']::-webkit-calendar-picker-indicator { opacity:0; width:20px; height:20px; cursor:pointer; }
.field select { appearance:none; -webkit-appearance:none; padding-right:42px; background-image:var(--select-chevron),var(--glass); background-repeat:no-repeat; background-position:right 14px center,center; background-size:18px 18px,auto; }
input[type='checkbox'] { appearance:none; -webkit-appearance:none; display:inline-grid; place-content:center; flex:0 0 auto; width:17px; height:17px; border:var(--ui-border); border-radius:2px; background:var(--glass); color:var(--text-primary); cursor:pointer; }
input[type='checkbox']:checked { border-color:var(--text-primary); background:var(--accent-soft); }
input[type='checkbox']:checked::before { content:''; width:4px; height:8px; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(45deg) translate(-1px,-1px); }
.blur-slider { --range-progress:0%; appearance:none; -webkit-appearance:none; height:4px; margin:16px 0; padding:0; border:0; border-radius:0; background:linear-gradient(to right,var(--text-primary) 0 var(--range-progress),rgba(255,255,255,.45) var(--range-progress) 100%); accent-color:var(--text-primary); cursor:pointer; }
.blur-slider::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:14px; height:14px; border:0; border-radius:50%; background:var(--text-primary); }
.blur-slider::-moz-range-thumb { width:14px; height:14px; border:0; border-radius:50%; background:var(--text-primary); }
.blur-slider:disabled { opacity:.35; cursor:default; }
.palette-dots i:nth-child(1) { background:var(--text-primary); }.palette-dots i:nth-child(2) { background:var(--text-secondary); }.palette-dots i:nth-child(3) { background:var(--text-placeholder); }.palette-dots i:nth-child(4) { background:var(--text-disabled); }
#color-sv-marker,.color-hue::-webkit-slider-thumb,.color-hue::-moz-range-thumb { box-shadow:0 0 0 1px var(--text-primary); }
#reset-ui-shadow { font-size:13px; margin-top:15px; }

@font-face { font-family:'Blue Hour Song Extra'; src:url('./assets/fonts/blue-hour-song-extra.woff2') format('woff2'); font-style:normal; font-weight:400; font-display:swap; unicode-range:U+2000-206F,U+2E80-9FFF,U+F900-FAFF,U+FF00-FFEF; }


/* chat-layout-final */
body:has(#page-chat:not([hidden])) {
  overflow: hidden;
}

.chat-page {
  height: 100dvh;
  min-height: 0 !important;
  overflow: hidden;
}

.chat-page .chat-namebar {
  position: relative;
  top: auto;
}

.chat-page .message-list {
  flex: 1 1 auto !important;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.chat-page .chat-composer {
  position: relative !important;
  bottom: auto !important;
  flex: 0 0 auto;
}

.chat-page .message-content {
  width: fit-content;
  max-width: 100%;
  align-items: stretch;
}

.chat-page .message-row:not(.incoming) .message-content {
  justify-self: end;
}

.chat-page .message-row.incoming .message-content {
  justify-self: start;
}

.chat-page .gateway-retry,
.chat-page .gateway-edit,
.chat-page .action-prose {
  align-self: flex-end;
  width: max-content;
  margin: 0 !important;
  min-height: 22px;
  line-height: 1.35;
}

.chat-page .process-card {
  order: -1;
  width: 100%;
  margin: 0 0 2px !important;
}

.chat-page .process-card summary {
  padding: 2px 0;
  min-height: 26px;
  font-size: 12px;
}

.chat-page .process-timeline {
  margin: 0;
  padding-left: 22px;
}

.chat-page .process-timeline li {
  padding-bottom: 5px;
  font-size: 11px;
}


/* chat-process-existing-style */
.chat-page .message-list > .process-card {
  order: initial;
  width: auto;
  margin: 0 5px -5px 48px !important;
}

@media (max-width: 360px) {
  .chat-page .message-list > .process-card {
    margin-left: 44px !important;
  }
}


/* ui-final-cleanup */
.chat-page {
  padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important;
}

.chat-page .composer-note {
  display: none !important;
}

.chat-page .chat-composer {
  margin-bottom: 0 !important;
}

.chat-page .message-content > .message-status {
  width: 100%;
  flex: 0 0 auto;
  margin: 2px 0 0 !important;
}

.chat-page .message-row.incoming .message-content > .message-status {
  text-align: left;
}

.chat-page .message-row:not(.incoming) .message-content > .message-status {
  text-align: right;
}

.conversation-item {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
  gap: 8px;
}

.conversation-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.conversation-open strong,
.conversation-open span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.conversation-delete {
  flex: 0 0 auto;
  align-self: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 24px;
  line-height: 1;
}

.conversation-delete:hover,
.conversation-delete:focus-visible {
  color: var(--danger);
}


/* ui-final-cleanup-2 */
.chat-page {
  padding-bottom: calc(170px + env(safe-area-inset-bottom)) !important;
}

.chat-page .composer-note {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.chat-page .message-content > .message-status {
  width: max-content !important;
  max-width: 100%;
  margin: 2px 0 0 !important;
  line-height: 1.25;
}

.chat-page .message-row.incoming .message-content > .message-status {
  align-self: flex-start;
  text-align: left;
}

.chat-page .message-row:not(.incoming) .message-content > .message-status {
  align-self: flex-end;
  text-align: right;
}

.chat-page .message-list > .process-card {
  order: initial;
  width: auto;
  margin: 0 5px -5px 48px !important;
}

@media (max-width: 360px) {
  .chat-page .message-list > .process-card {
    margin-left: 44px !important;
  }
}

.conversation-item {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
  gap: 8px;
}

.conversation-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.conversation-open strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.conversation-delete {
  flex: 0 0 auto;
  align-self: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 25px;
  line-height: 1;
}

.conversation-delete:hover,
.conversation-delete:focus-visible {
  color: var(--danger);
}


/* final-chat-layout-20261025 */
.chat-page {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
}

.chat-page .message-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding-bottom: 14px !important;
}

.chat-page .chat-composer {
  position: relative !important;
  inset: auto !important;
  flex: 0 0 auto !important;
  margin: 8px 0 0 !important;
}

.chat-page .composer-note {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.message-row .message-content {
  position: relative !important;
  width: fit-content !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.message-row.outgoing .message-content {
  justify-self: end !important;
  align-items: flex-end !important;
}

.message-row.incoming .message-content {
  justify-self: start !important;
  align-items: flex-start !important;
}

.message-row .message-status {
  position: absolute !important;
  top: -24px !important;
  left: 0 !important;
  right: auto !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

.message-row .gateway-edit,
.message-row .gateway-retry {
  align-self: flex-end !important;
  margin: 6px 0 0 !important;
}

.conversation-item {
  position: relative !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
}

.conversation-open {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  text-align: left !important;
}

.conversation-delete {
  flex: 0 0 auto !important;
  min-height: 32px !important;
  padding: 4px 8px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: var(--type-caption) !important;
}

.conversation-delete:hover,
.conversation-delete:focus-visible {
  color: var(--danger) !important;
}

.conversation-item > span:not(.conversation-delete) {
  display: none !important;
}

/* === 手绘草图定制样式（统一原生毛玻璃与字体风格） === */
.chat-page .chat-namebar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  padding: 10px 12px !important;
}
.chat-page .chat-name-copy {
  display: grid !important;
  grid-template-columns: auto auto !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  justify-content: start !important;
  column-gap: 10px !important;
  row-gap: 1px !important;
  text-align: left !important;
}
.chat-page .chat-name-line {
  display: contents !important;
}
.chat-page #chat-display-name {
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  font-size: 22px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}
.chat-page #header-mood {
  grid-column: 2 !important;
  grid-row: 1 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
  justify-self: start !important;
  color: var(--text-secondary) !important;
}
.chat-page .chat-service-status {
  grid-column: 2 !important;
  grid-row: 2 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  justify-self: start !important;
  color: var(--text-secondary) !important;
}
.chat-page .chat-service-status > span {
  display: none !important;
}

/* 气泡与外部上方时间戳、左下方操作按钮 */
.chat-page .message-content {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.chat-page .message-row .message-bubble {
  padding: 10px 14px !important;
  order: 2 !important;
}
.chat-page .message-row .message-status {
  position: static !important;
  order: 1 !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  margin: 0 2px !important;
  padding: 0 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: var(--text-secondary) !important;
  pointer-events: auto !important;
}
.chat-page .message-row.incoming .message-status {
  align-self: flex-start !important;
  text-align: left !important;
}
.chat-page .message-row.outgoing .message-status {
  align-self: flex-end !important;
  text-align: right !important;
}
.chat-page .message-row .gateway-retry,
.chat-page .message-row .gateway-edit {
  order: 3 !important;
  align-self: flex-start !important;
  margin: 2px 0 0 2px !important;
  padding: 0 !important;
  min-height: 0 !important;
  font-size: 11px !important;
  color: var(--text-secondary) !important;
}

/* === 手绘草图定制样式（统一原生毛玻璃与字体风格） === */
.chat-page .chat-namebar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  padding: 10px 12px !important;
}
.chat-page .chat-name-copy {
  display: grid !important;
  grid-template-columns: auto auto !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  justify-content: start !important;
  column-gap: 10px !important;
  row-gap: 1px !important;
  text-align: left !important;
}
.chat-page .chat-name-line {
  display: contents !important;
}
.chat-page #chat-display-name {
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  font-size: 22px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}
.chat-page #header-mood {
  grid-column: 2 !important;
  grid-row: 1 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
  justify-self: start !important;
  color: var(--text-secondary) !important;
}
.chat-page .chat-service-status {
  grid-column: 2 !important;
  grid-row: 2 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  justify-self: start !important;
  color: var(--text-secondary) !important;
}
.chat-page .chat-service-status > span {
  display: none !important;
}

/* 气泡与外部上方时间戳、左下方操作按钮 */
.chat-page .message-content {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.chat-page .message-row .message-bubble {
  padding: 10px 14px !important;
  order: 2 !important;
}
.chat-page .message-row .message-status {
  position: static !important;
  order: 1 !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  margin: 0 2px !important;
  padding: 0 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: var(--text-secondary) !important;
  pointer-events: auto !important;
}
.chat-page .message-row.incoming .message-status {
  align-self: flex-start !important;
  text-align: left !important;
}
.chat-page .message-row.outgoing .message-status {
  align-self: flex-end !important;
  text-align: right !important;
}
.chat-page .message-row .gateway-retry,
.chat-page .message-row .gateway-edit {
  order: 3 !important;
  align-self: flex-start !important;
  margin: 2px 0 0 2px !important;
  padding: 0 !important;
  min-height: 0 !important;
  font-size: 11px !important;
  color: var(--text-secondary) !important;
}


/* chat-layout-final-fix */
.chat-page { gap: 0 !important; }
.chat-page .message-list {
  flex: 0 0 auto !important;
  gap: 16px;
  padding-top: 0;
  padding-bottom: 0;
}
.chat-page .chat-composer {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.chat-composer + .composer-note { display: none; }

.message-bubble {
  position: relative;
  padding-top: 31px;
}
.message-bubble > .message-status {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 1;
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}
.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-text > :first-child { margin-top: 0; }


/* chat-layout-final-fix5 */
.chat-page {
  gap: 0 !important;
}

.chat-page .message-list {
  flex: 1 1 auto !important;
  min-height: 0;
  gap: 16px;
  padding-top: 0;
  padding-bottom: 0;
}

.chat-page .chat-composer {
  position: sticky;
  bottom: calc(var(--nav-offset) + 84px);
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  z-index: 12;
}

/* 时间戳：在气泡外，紧贴气泡左上角 */
.message-bubble {
  position: relative;
  margin-top: 24px;
  padding-top: 8px;
}

.message-bubble > .message-status {
  position: absolute;
  top: -22px;
  left: 0;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-text > :first-child {
  margin-top: 0;
}

.chat-composer + .composer-note {
  display: none;
}
