:root {
  --chat-ink: #36332e;
  --chat-muted: #98938a;
  --chat-panel: rgba(255, 255, 252, .96);
  --chat-accent: #cc7352;
}

.chat { overflow-anchor: none; }
.history-dialog { width: min(92vw, 520px); max-height: 82dvh; box-sizing: border-box; border: 1px solid #ded9ce; border-radius: 18px; padding: 20px; color: var(--chat-ink); background: #fcfbf8; }
.history-dialog::backdrop { background: #0005; }
.history-dialog header { position: sticky; top: -20px; z-index: 1; padding: 8px 0; background: #fcfbf8; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.history-dialog header button { min-width: 40px; min-height: 40px; }
.history-dialog form, .history-dialog label { display: grid; gap: 8px; }
.history-dialog form { gap: 12px; }
.history-dialog input, .history-dialog select { box-sizing: border-box; width: 100%; min-width: 0; font: inherit; padding: 9px; border: 1px solid #ded9ce; border-radius: 8px; background: #fff; }
.history-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.history-dialog small { color: #777167; }
.history-result { display: grid; gap: 8px; text-align: left; width: 100%; margin: 8px 0; padding: 12px; white-space: normal; overflow-wrap: anywhere; border: 1px solid #e6e0d4; border-radius: 10px; background: #fff; color: inherit; }
.history-navigation { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(var(--composer-height, 100px) + 10px); display: flex; align-items: center; gap: 6px; width: max-content; max-width: 95vw; padding: 8px; border-radius: 14px; background: #fffef7f5; box-shadow: 0 2px 16px #0002; font-size: 12px; }
.history-navigation button { padding: 8px; font: inherit; }
.chat-latest { position: fixed; z-index: 15; right: max(10px, calc((100vw - 780px) / 2)); bottom: calc(var(--composer-height, 100px) + 4px); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #78746e; font: 21px/1 system-ui; isolation: isolate; }
.chat-latest::before { content: ''; position: absolute; inset: 7px; z-index: -1; border-radius: 50%; background: #eeece6; box-shadow: 0 1px 5px #0001; }
.history-navigation[hidden], .chat-latest[hidden], #history-open[hidden], body:not([data-screen="conversation"]) .history-navigation, body:not([data-screen="conversation"]) .chat-latest { display: none !important; }
.history-target { outline: 2px solid #d69b55; outline-offset: 4px; }
html[data-capture-mode="chat"] #history-open, html[data-capture-mode="chat"] .history-navigation, html[data-capture-mode="chat"] .chat-latest { display: none !important; }

html[data-capture-mode="chat"] body { padding: 0; background: #fcfbf8; }
html[data-capture-mode="chat"] .shell { min-height: var(--app-viewport-height, 100dvh); border: 0; border-radius: 0; box-shadow: none; }
html[data-capture-mode="chat"] .conversation-back,
html[data-capture-mode="chat"] .context-ring,
html[data-capture-mode="chat"] .shell-update,
html[data-capture-mode="chat"] .composer { display: none !important; }
html[data-capture-mode="chat"] body[data-screen="conversation"] .chat { height: calc(var(--app-viewport-height, 100dvh) - 78px); padding-bottom: 20px; scroll-padding-bottom: 20px; }
html[data-capture-mode="chat"] .chat-image-keep > button,
html[data-capture-mode="chat"] .chat-photo-stack > button { display: none; }

html[data-resident-perspective] .message.me { margin-right: auto; margin-left: 0; flex-direction: row; }
html[data-resident-perspective] .message:not(.me) { margin-right: 0; margin-left: auto; flex-direction: row-reverse; }
html[data-resident-perspective] .message.me .message-body { justify-items: start; }
html[data-resident-perspective] .message:not(.me) .message-body { justify-items: end; }
html[data-resident-perspective] .message.me .message-body > .chat-sticker { align-self: flex-start; }
html[data-resident-perspective] .message:not(.me) .message-body > .chat-sticker { align-self: flex-end; }

body[data-screen="conversation"] .topbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 42px;
  align-items: center;
  min-height: 78px;
  padding: max(13px, env(safe-area-inset-top)) 10px 8px 3px;
}

body[data-screen="conversation"] .topbar > div { flex: initial; }
.conversation-identity { min-width: 0; text-align: center; }
body[data-screen="conversation"] .topbar h1 { margin: 0; color: var(--chat-ink); font: 550 17px/1.25 ui-sans-serif, system-ui, sans-serif; letter-spacing: .025em; }
.resident-name { min-height: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; letter-spacing: inherit; cursor: pointer; }
.resident-name:disabled { cursor: default; }
.resident-name:focus-visible { outline: 0; border-radius: 8px; background: rgba(112,103,91,.06); box-shadow: 0 0 0 4px rgba(112,103,91,.06); }
body[data-screen="conversation"] .service-state { justify-content: center; margin-top: 3px; padding: 0; background: transparent; color: var(--chat-muted); font-size: 10px; }
body[data-screen="conversation"] .service-state i { width: 6px; height: 6px; }
body[data-screen="conversation"][data-conversation-kind="private"] .topbar { grid-template-columns: 42px minmax(0, 1fr) auto 38px; }
body[data-screen="conversation"][data-conversation-kind="private"] .topbar h1 { font-weight: 450; letter-spacing: .035em; }
body[data-screen="conversation"][data-conversation-kind="private"] .conversation-identity {
  display: grid;
  justify-self: start;
  justify-items: start;
  text-align: left;
}
body[data-screen="conversation"][data-conversation-kind="private"] .service-state {
  display: inline-flex;
  justify-content: initial;
  justify-self: start;
  gap: 5px;
  margin-top: 1px;
}
body[data-screen="conversation"][data-conversation-kind="private"] .service-state i {
  position: static;
  transform: none;
}

.context-ring {
  --context-progress: 0deg;
  --context-color: #70b989;
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #666a64;
  font: 500 9px/1 ui-sans-serif,system-ui,sans-serif;
  cursor: pointer;
}
.context-ring::before { content: ""; position: absolute; width: 29px; height: 29px; border-radius: 50%; background: conic-gradient(var(--context-color) var(--context-progress), #ebece8 0); -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 2px),#000 0); mask:radial-gradient(farthest-side,transparent calc(100% - 2px),#000 0); }
.context-ring::after { content: none; }
.context-ring span { position: relative; z-index: 1; }
.context-ring[hidden] { display: none; }
.context-ring:focus-visible { outline: 2px solid rgba(207,118,84,.38); outline-offset: 3px; }
.session-actions { position: absolute; z-index: 18; top: calc(max(18px, env(safe-area-inset-top)) + 56px); right: 13px; left: 13px; padding: 15px; border: 1px solid #e6e2da; border-radius: 18px; background: #fffefa; box-shadow: 0 14px 38px rgba(58, 52, 44, .16); }
.session-actions[hidden] { display: none; }
.session-actions header { display: flex; align-items: center; justify-content: space-between; }
.session-actions header strong { color: #3c3832; font-size: 14px; }
.session-actions header button { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; background: transparent; color: #77716a; font-size: 22px; font-weight: 300; }
.session-actions > p { margin: 9px 1px; color: #827d74; font-size: 11px; line-height: 1.45; }
.session-actions > button,.successor-request > button { width: 100%; min-height: 38px; padding: 0 12px; border: 0; border-radius: 19px; background: #efece6; color: #5d5851; font: inherit; font-size: 12px; }
.session-actions > button:disabled,.successor-request > button:disabled { opacity: .55; }
.successor-request { margin-top: 9px; padding-top: 11px; border-top: 1px solid #efede8; }
.successor-request > strong { display: block; color: #686259; font-size: 12px; }
.successor-request > p { margin: 6px 2px 0; color: #8a857d; font-size: 11px; line-height: 1.5; }
.successor-request > button { margin-top: 9px; background: #e9d8cf; color: #9e4e34; }
.presence-sheet { position: absolute; z-index: 19; top: calc(max(18px, env(safe-area-inset-top)) + 56px); right: 17px; left: 17px; padding: 16px; border: 1px solid rgba(112,103,91,.1); border-radius: 19px; background: rgba(255,254,250,.98); box-shadow: 0 14px 38px rgba(58,52,44,.14); }
.presence-sheet[hidden] { display: none; }
.presence-sheet header { display: flex; align-items: start; justify-content: space-between; }
.presence-sheet header > div { display: grid; gap: 3px; }
.presence-sheet header small { color: #a09a91; font-size: 9px; letter-spacing: .12em; }
.presence-sheet header strong { color: #403c36; font-size: 16px; font-weight: 480; }
.presence-sheet header button { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: #8b857d; font-size: 22px; font-weight: 300; }
.presence-sheet > p { margin: 12px 0 0; color: #847d74; font-size: 12px; line-height: 1.55; }

body[data-screen="conversation"] .chat {
  height: calc(min(860px, var(--app-viewport-height, 100dvh)) - 78px);
  min-height: 0;
  padding: 10px 16px calc(var(--composer-height, 124px) + 14px);
  scroll-padding-bottom: calc(var(--composer-height, 124px) + 12px);
}

.message {
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 9px;
}
.message.me { margin-bottom: 12px; }
.message-body { display: grid; flex: 0 1 min(78%, 560px); justify-items: start; width: auto; min-width: 0; max-width: calc(100% - 42px); }
.message.me .message-body { justify-items: end; }
.avatar { flex: 0 0 32px; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; }
.avatar img,.resident-avatar img,.conversation-avatar img,.avatar-editor-preview img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.bubble { width: fit-content; min-width: 0; max-width: 100%; margin-bottom: 5px; padding: 9px 13px; border-radius: 18px; color: var(--chat-ink); line-height: 1.55; overflow-wrap: anywhere; }
.message.me .bubble { border-radius: 18px; }
.optimistic-bubble { opacity: .72; }

.message-markdown { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.message-markdown > * { max-width: 100%; }
.room-reply-reference { box-sizing: border-box; width: 100%; min-width: 0; overflow-wrap: anywhere; }
.message-markdown > :first-child { margin-top: 0; }
.message-markdown > :last-child { margin-bottom: 0; }
.message-markdown p { margin: 0 0 .72em; }
.message-markdown p:last-child { margin-bottom: 0; }
.message-markdown ul,.message-markdown ol { margin: .55em 0; padding-left: 1.35em; }
.message-markdown blockquote { margin: .7em 0; padding-left: 10px; border-left: 2px solid #d6d2ca; color: #736f67; }
.message-markdown h1,.message-markdown h2,.message-markdown h3 { margin: .9em 0 .45em; font-size: 1.05em; line-height: 1.35; }
.message-markdown code { padding: .12em .35em; border-radius: 5px; background: rgba(81, 76, 68, .08); font: .88em/1.45 ui-monospace,"SFMono-Regular",Consolas,monospace; }
.code-block-shell { position: relative; max-width: 100%; margin: .7em 0; border: 1px solid rgba(70, 65, 57, .08); border-radius: 10px; background: #e9e7e1; }
.message-markdown pre { box-sizing: border-box; max-width: 100%; max-height: min(70vh, 520px); margin: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; padding: 43px 12px 11px; border: 0; border-radius: 10px; background: transparent; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; }
.message-markdown pre::-webkit-scrollbar { width: 0; height: 0; }
.message-markdown pre:focus-visible { outline: 2px solid rgba(169, 85, 57, .45); outline-offset: -3px; }
.message-markdown pre code { padding: 0; background: transparent; white-space: pre; }
.code-block-copy { position: absolute; z-index: 1; top: 7px; right: 7px; min-width: 48px; min-height: 30px; padding: 0 10px; border: 1px solid rgba(95, 87, 76, .16); border-radius: 8px; background: rgba(255, 253, 249, .88); color: #625b51; cursor: pointer; font: 12px/1 ui-sans-serif,system-ui,sans-serif; }
.code-block-copy:hover { background: #fffdf9; color: #a95539; }
.code-block-copy:focus-visible { outline: 2px solid rgba(169, 85, 57, .45); outline-offset: 2px; }
/* The code box uses the same underlying bubble, with only a slight darkening. */
#chat :is(.code-block-shell,.long-content-reader){--code-fill:var(--code-surface,color-mix(in srgb,var(--bubble-surface,#EDF2F7) 96%,#000));background:var(--code-fill);border:1px solid color-mix(in srgb,currentColor 16%,transparent);color:var(--code-ink,inherit)}
#chat .code-block-shell pre,#chat .code-block-shell pre code{background:transparent;color:inherit}
#chat :is(.code-block-copy,.long-content-actions button){background:var(--code-fill);border:1px solid color-mix(in srgb,currentColor 18%,transparent);color:inherit}
#chat :is(.code-block-copy,.long-content-actions button):hover{background:var(--code-fill);border-color:currentColor;color:inherit}
#chat .long-content-copy{color:inherit}
#chat :is(.code-block-shell,.long-content-reader){text-shadow:none}
#chat .long-content-reader.is-collapsed::after{background:linear-gradient(transparent,var(--code-fill))}
.clipboard-copy-fallback { position: fixed; top: -10000px; left: -10000px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.message-markdown pre.standalone-url-code { overflow: visible; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; }
.message-markdown pre.standalone-url-code code { white-space: inherit; overflow-wrap: inherit; word-break: inherit; }
.message-markdown a { color: #a95539; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.message-markdown table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.message-markdown th,.message-markdown td { padding: 5px 7px; border: 1px solid #ddd9d1; }
.long-content-reader { position: relative; display: grid; width: min(100%,560px); gap: 9px; margin: .45em 0; padding: 12px; overflow: hidden; border: 1px solid rgba(70,65,57,.08); border-radius: 12px; background: #ebe9e3; }
.bubble:has(.long-content-reader) { width: min(100%,590px); }
.message:has(.long-content-reader) .message-body { flex-basis: min(92%,590px); }
.long-content-copy { min-width: 0; color: #403d37; font: .9em/1.7 ui-sans-serif,system-ui,sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.long-content-reader.is-collapsed .long-content-copy { max-height: 210px; overflow: hidden; }
.long-content-reader.is-collapsed::after { position: absolute; right: 0; bottom: 41px; left: 0; height: 48px; pointer-events: none; background: linear-gradient(transparent,#ebe9e3); content: ''; }
.long-content-actions { position: relative; z-index: 1; display: flex; justify-content: flex-end; gap: 6px; }
.long-content-actions button,.long-content-sheet button { width: auto; min-height: 29px; padding: 0 10px; border: 0; border-radius: 12px; background: rgba(255,255,252,.78); color: #706a62; font: 11px/1 ui-sans-serif,system-ui,sans-serif; }
.long-content-sheet { display: grid; gap: 12px; }
.long-content-sheet-actions { display: flex; justify-content: flex-end; }
.long-content-sheet-copy { margin: 0; color: #3f3b35; font: 15px/1.75 ui-sans-serif,system-ui,sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }

.time-divider { display: block; margin: 11px auto 13px; color: #aaa69e; font-size: 10px; text-align: center; }
.free-activity-record { width: fit-content; max-width: 100%; margin: 4px auto 13px; color: #aaa69e; font-size: 10px; line-height: 1.45; text-align: center; }
.process-message .message-body { flex-basis: min(82%, 580px); }
.process-summary { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; padding: 3px 0 9px; border: 0; background: transparent; color: #858179; font-size: 14px; text-align: left; }
.process-summary:focus { outline: none; }
.process-summary:focus-visible { border-radius: 8px; box-shadow: 0 0 0 2px rgba(207,118,84,.22); }
.process-summary svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.process-summary-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.process-summary-chevron { font-size: 18px; line-height: 1; opacity: .55; }
.process-summary-copy{display:grid;gap:3px;min-width:0}
.process-summary-counts{font-size:11px;font-weight:400;color:inherit;opacity:.8;white-space:normal}
.process-summary-tools{display:flex;flex-wrap:wrap;gap:4px 8px;font-size:11px;color:inherit}
.process-summary-tools>span{max-width:100%;overflow-wrap:anywhere}
.trace-phase.single-content{display:block}
.trace-phase.single-content .trace-phase-body{padding-left:0}
.tool-source-badge { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 1px solid #ddd9d1; border-radius: 8px; background: #fffefa; color: #827b71; font: 600 14px/1 ui-sans-serif,system-ui,sans-serif; box-shadow: inset 0 0 0 1px rgba(111,103,92,.035); }
.process-tool-badge { margin-right: 1px; }
.process-summary-tool .process-summary-label { color: #74716a; font-size: 15px; }
.autonomy-heart { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; padding: 3px 0 8px; border: 0; background: transparent; color: #9a7b78; font: 13px/1.35 ui-sans-serif,system-ui,sans-serif; text-align: left; }
.autonomy-heart:focus { outline: none; }
.autonomy-heart:focus-visible { border-radius: 8px; box-shadow: 0 0 0 2px rgba(207,118,84,.22); }
.autonomy-heart-icon { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; color: #c77668; font: 18px/1 Georgia, "Songti SC", serif; }
.autonomy-heart > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autonomy-heart-card { position: relative; margin: 8px 0 18px; padding: 19px 19px 18px 22px; border: 1px solid rgba(203, 124, 98, .16); border-radius: 18px; background: linear-gradient(135deg,#fffaf6,#fffdf9); box-shadow: 0 8px 22px rgba(91, 63, 50, .05); color: #4a403a; }
.autonomy-heart-card > span { position: absolute; top: -12px; left: 14px; display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid #f0d9d0; border-radius: 50%; background: #fffdfa; color: #c77668; font: 20px/1 Georgia, "Songti SC", serif; }
.autonomy-heart-card .message-markdown { font-size: 15px; line-height: 1.68; }
.bubble.quiet-message .message-markdown { color: #aaa39a; letter-spacing: .16em; }
.human-thinking-summary img { width: 34px; height: 34px; flex: 0 0 34px; object-fit: contain; image-rendering: pixelated; }

.trace-overlay { position: fixed; z-index: 40; inset: 0; background: rgba(41, 38, 33, .28); opacity: 0; transition: opacity 160ms ease; }
.trace-overlay[hidden] { display: none; }
.trace-overlay.show { opacity: 1; }
.trace-sheet { position: fixed; z-index: 41; right: 4px; bottom: 0; left: 4px; display: flex; max-height: 78dvh; min-height: min(300px,48dvh); flex-direction: column; overflow: hidden; border: 1px solid rgba(68, 63, 55, .09); border-radius: 28px 28px 0 0; background: #fcfbf8; box-shadow: 0 -16px 45px rgba(42, 38, 32, .15); transform: translateY(102%); transition: transform 280ms cubic-bezier(.2,.8,.2,1); }
.trace-sheet[hidden] { display: none; }
.trace-sheet.show { transform: translateY(0); }
.trace-sheet-handle { width: 36px; height: 5px; margin: 8px auto 5px; border-radius: 3px; background: #d6d2ca; }
.trace-sheet-head { display: grid; grid-template-columns: 40px minmax(0,1fr) 40px; align-items: center; padding: 2px 15px 12px; }
.trace-sheet-head button { display: grid; width: 36px; min-width: 36px; height: 36px; padding: 0; aspect-ratio: 1; flex: 0 0 36px; place-items: center; border: 0; background: transparent; color: #767169; font-size: 28px; font-weight: 300; line-height: 1; }
.trace-sheet-head h2 { margin: 0; color: #2f2c28; font-size: 20px; font-weight: 550; text-align: center; }
.trace-sheet-content { overflow-x: hidden; overflow-y: auto; padding: 12px 21px max(28px,env(safe-area-inset-bottom)); }
.trace-sheet-status { margin: 18px 0; color: var(--muted); font-size: .92rem; }
.trace-phase { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 14px; color: #37342f; }
.trace-phase-rail { display: flex; flex-direction: column; align-items: center; }
.trace-phase-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: #aaa69e; }
.trace-phase.tool .trace-phase-dot { width: 28px; height: 28px; display: grid; margin-top: 1px; place-items: center; background: transparent; }
.trace-tool-badge { width: 28px; height: 28px; }
.trace-phase-line { width: 1.5px; min-height: 22px; flex: 1; margin: 5px 0; background: #ddd9d2; }
.trace-phase-body { min-width: 0; padding: 0 0 22px; }
.trace-phase-body > strong { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 550; }
.trace-phase-body > small { display: block; color: #918c83; font-size: 11px; }
.trace-phase-body > small.trace-phase-warning { color: #c86a53; }
.trace-phase-body .message-markdown { color: #5f5b54; font-size: 14px; line-height: 1.58; }

body[data-screen="conversation"] .composer {
  z-index: 4;
  display: block;
  padding: 23px 12px max(9px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(252, 251, 248, .97) 32%, #fcfbf8 58%);
}
.composer-box {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 9px 10px 8px;
  border: 1px solid rgba(69, 64, 56, .07);
  border-radius: 23px;
  background: var(--chat-panel);
  box-shadow: 0 9px 30px rgba(61, 56, 48, .1);
  backdrop-filter: blur(18px);
}
.composer-box[hidden],.choice-dock[hidden] { display: none; }
.choice-dock {
  max-height: min(58dvh,460px);
  padding: 15px 18px 13px;
  overflow-y: auto;
  border: 1px solid rgba(69,64,56,.08);
  border-radius: 23px;
  background: rgba(252,251,248,.98);
  box-shadow: 0 9px 30px rgba(61,56,48,.12);
  backdrop-filter: blur(18px);
}
.choice-dock .choice-card { width: 100%; }
.composer .composer-box textarea {
  width: 100%;
  min-height: 25px;
  max-height: 120px;
  padding: 2px 4px;
  overflow-y: auto;
  resize: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  line-height: 1.45;
}
.composer-actions { display: flex; align-items: center; gap: 7px; min-height: 35px; }
.composer-spacer { flex: 1; }
.composer .composer-box button { position: static; inset: auto; display: grid; flex: 0 0 35px; width: 35px; min-width: 35px; max-width: 35px; height: 35px; min-height: 35px; max-height: 35px; place-items: center; padding: 0; border: 0; border-radius: 50%; }
.composer .composer-icon { background: #f0efeb; color: #67635b; }
.composer .composer-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.composer #send { background: var(--chat-accent); color: #fff; }
.composer #send:disabled,.composer .composer-icon:disabled { background: #e5e3dd; color: #aaa69e; }
.composer .composer-box .model-label { display: block; flex: 0 1 auto; width: auto; min-width: 0; max-width: 132px; height: 32px; overflow: hidden; padding: 0 12px; border-radius: 16px; background: #f1efe9; color: #625e56; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.composer .composer-box .model-label[hidden] { display: none; }
.composer .composer-box .inner-voice-toggle { display: block; flex: 0 0 auto; width: auto; min-width: 0; max-width: none; height: 32px; min-height: 32px; max-height: 32px; padding: 0 11px; border-radius: 16px; background: #f5eeee; color: #9a6f73; font-size: 12px; }
.composer .composer-box .inner-voice-toggle[hidden] { display: none; }
.inner-voice-panel { margin: -1px 0 3px; padding: 9px 10px 8px; border: 1px solid rgba(183,126,128,.16); border-radius: 15px; background: rgba(255,250,249,.78); }
.inner-voice-panel[hidden] { display: none; }
.inner-voice-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; color: #8e696d; font-size: 12px; }
.composer .composer-box .inner-voice-head button { display: grid; width: 24px; min-width: 24px; max-width: 24px; height: 24px; min-height: 24px; max-height: 24px; border-radius: 50%; background: transparent; color: #9d8582; font-size: 18px; }
.composer .composer-box .inner-voice-panel textarea { min-height: 48px; max-height: 108px; padding: 2px 0; font-size: 14px; line-height: 1.5; }
.inner-voice-panel small { display: block; color: #a18e8a; font-size: 10px; line-height: 1.45; }
.emoji-panel { position: absolute; right: -1px; bottom: calc(100% + 9px); left: -1px; z-index: 8; display: grid; max-height: min(430px, 58vh); padding: 14px 13px 12px; overflow: hidden; border: 1px solid #e6e2da; border-radius: 22px; background: rgba(255,254,250,.98); box-shadow: 0 16px 42px rgba(58,52,44,.18); }
.emoji-panel[hidden] { display: none; }
.emoji-panel > header { display: flex; align-items: center; justify-content: space-between; min-height: 34px; margin-bottom: 8px; }
.emoji-panel > header strong { color: #5e5a53; font-size: 14px; font-weight: 560; }
.emoji-panel > header > div { display: flex; gap: 5px; }
.composer .emoji-panel .sticker-panel-action { display: grid; width: auto; min-width: 31px; max-width: none; height: 31px; min-height: 31px; max-height: 31px; padding: 0 8px; border-radius: 13px; background: #f3f0eb; color: #665f57; font-size: 17px; }
.sticker-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; min-height: 90px; overflow-y: auto; overscroll-behavior: contain; padding: 3px 2px 10px; }
.sticker-grid-item { position: relative; display: grid; min-width: 0; place-items: center; aspect-ratio: 1; }
.composer .emoji-panel .sticker-choice { display: grid; width: 100%; max-width: 74px; height: 100%; max-height: 74px; padding: 5px; border-radius: 16px; background: transparent; }
.sticker-choice img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sticker-edit-controls { position: absolute; inset: -3px -2px auto; display: flex; justify-content: space-between; pointer-events: none; }
.composer .emoji-panel .sticker-edit-controls button { pointer-events: auto; width: 24px; min-width: 24px; max-width: 24px; height: 24px; min-height: 24px; max-height: 24px; border: 1px solid rgba(86,77,68,.1); border-radius: 50%; background: #fff; color: #8e6253; box-shadow: 0 3px 8px rgba(50,45,39,.12); font-size: 14px; }
.sticker-panel-empty { grid-column: 1/-1; align-self: center; margin: 26px 8px; color: #9b958c; text-align: center; font-size: 12px; }
.sticker-metadata-form { display: grid; gap: 8px; }
.sticker-metadata-form > img { width: min(100%,260px); max-height: 270px; margin: 0 auto 7px; object-fit: contain; border-radius: 17px; background: #f8f5ef; }
.sticker-metadata-form label { color: #827c74; font-size: 11px; }
.sticker-metadata-form input,.sticker-metadata-form textarea { width: 100%; padding: 11px 12px; border: 1px solid #e7e1d9; border-radius: 13px; background: #fff; color: #3f3b36; font: inherit; }
.sticker-metadata-form textarea { resize: vertical; line-height: 1.55; }
.sticker-metadata-form p { min-height: 16px; margin: 0; color: #a06b59; font-size: 11px; }
.sticker-metadata-form > button { min-height: 42px; border: 0; border-radius: 15px; background: var(--chat-accent); color: #fff; font: inherit; }
.sticker-draft { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 5px 7px; border-radius: 14px; background: #f8f4f0; color: #766f66; font-size: 12px; }
.sticker-draft[hidden] { display: none; }
.sticker-draft img { width: 48px; height: 48px; object-fit: contain; }
.sticker-draft span { flex: 1; }
.composer .composer-box .sticker-draft button { width: auto; min-width: 0; max-width: none; height: 28px; min-height: 28px; max-height: 28px; padding: 0 9px; border-radius: 10px; background: #eee8e2; color: #8d6656; font-size: 11px; }
.chat-sticker { width: min(148px, 42vw); margin: 0; padding: 0; background: transparent; }
.chat-sticker img { display: block; width: 100%; max-height: 168px; object-fit: contain; }
.message-body > .chat-sticker { align-self: flex-start; }
.message.me .message-body > .chat-sticker { align-self: flex-end; }
.choice-card { display: grid; width: min(100%,330px); gap: 12px; }
.choice-card h3 { margin: 0 2px 3px; font-size: 17px; font-weight: 530; line-height: 1.45; }
.choice-options { display: grid; }
.composer .choice-options button,.choice-options button { position: static; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; width: 100%; max-width: none; min-height: 52px; padding: 8px 4px; border: 0; border-bottom: 1px solid rgba(97,88,79,.12); border-radius: 0; background: transparent; color: #403c37; text-align: left; font: inherit; }
.choice-options button > span:first-child { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: #f7f5f1; color: #777169; font-size: 12px; }
.choice-options button.selected { color: #a6583f; font-weight: 600; }
.choice-options button:disabled:not(.selected) { opacity: .55; }
.choice-custom { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
.choice-custom input { min-width: 0; padding: 9px 2px; border: 0; border-bottom: 1px solid #dcd7cf; background: transparent; color: #403c37; font: inherit; outline: none; }
.choice-custom .choice-custom-send { display: grid; justify-self: end; width: 44px; min-width: 44px; max-width: 44px; height: 44px; min-height: 44px; max-height: 44px; padding: 0; place-items: center; box-sizing: border-box; border: 0; border-radius: 50%; background: var(--chat-accent); color: #fff; cursor: pointer; }
.choice-custom-send svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.choice-card > small { color: #9a7467; font-size: 10px; }
.reply-draft { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 9px; border-left: 2px solid var(--chat-accent); border-radius: 7px; background: #f7f4ef; color: #77736b; font-size: 11px; }
.reply-draft[hidden] { display: none; }
.reply-draft span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer .reply-draft button { width: 25px; height: 25px; background: transparent; color: #8f8a81; font-size: 18px; }
.composer > p { margin: 5px 7px 0; }
.composer > p:empty { display: none; }
.attachment-status:empty { display: none; }
.attachment-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 9; display: grid; width: 190px; gap: 2px; padding: 7px; border: 1px solid #e6e2da; border-radius: 16px; background: #fffefa; box-shadow: 0 14px 38px rgba(58,52,44,.16); }
.attachment-menu[hidden] { display: none; }
.composer .composer-box .attachment-menu button { display: block; width: 100%; max-width: none; height: auto; min-height: 38px; padding: 0 11px; border-radius: 10px; background: transparent; color: #625d55; text-align: left; font-size: 12px; }
.composer .composer-box .attachment-menu button + button { border-top: 1px solid #efebe5; }

.model-panel { position: absolute; right: 0; bottom: calc(100% + 9px); left: 0; z-index: 8; padding: 14px; border: 1px solid #e6e2da; border-radius: 20px; background: #fffefa; box-shadow: 0 14px 38px rgba(58, 52, 44, .16); }
.model-panel[hidden] { display: none; }
.model-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.composer .composer-box .model-panel-head button { flex-basis: 28px; width: 28px; min-width: 28px; height: 28px; background: #f2f0eb; color: #77716a; font-size: 19px; }
.model-panel > p { margin: 11px 2px 6px; color: #8b867d; font-size: 11px; }
.model-options,.effort-options { display: flex; flex-wrap: wrap; gap: 6px; }
.composer .composer-box .model-options button,.composer .composer-box .effort-options button { display: block; flex: 0 0 auto; width: auto; min-width: 0; max-width: none; height: 33px; padding: 0 11px; border-radius: 17px; background: #f2f0eb; color: #655f57; font-size: 12px; }
.composer .composer-box .model-options button[aria-pressed="true"],.composer .composer-box .effort-options button[aria-pressed="true"] { background: #e9d8cf; color: #a45034; }
.composer .composer-box .model-apply { width: 100%; max-width: none; height: 38px; margin-top: 13px; border-radius: 19px; background: var(--chat-accent); color: white; }
.model-status { min-height: 0; margin: 7px 2px 0; color: #8a6256; font-size: 11px; }

@media (max-width: 360px) {
  body[data-screen="conversation"] .chat { padding-right: 13px; padding-left: 13px; }
  .message-body { flex-basis: 77%; }
  body[data-screen="conversation"] .composer { padding-right: 10px; padding-left: 10px; }
}

@media (max-width: 520px), (display-mode: standalone) and (pointer: coarse) {
  html,body { height: var(--app-viewport-height, 100dvh); min-height: var(--app-viewport-height, 100dvh); overflow: hidden; }
  body { padding: 0; }
  .app-sidebar { overflow-y: auto; }
  /* The shell clips pages; only their content panes should be scroll containers. */
  .shell { height: var(--app-viewport-height, 100dvh); min-height: var(--app-viewport-height, 100dvh); overflow: clip; }
}
@media (display-mode: standalone) and (pointer: coarse) {
  .shell { width: 100%; border: 0; border-radius: 0; }
  .hub { border-radius: 0; }
}

.conversation-back { font-size: 0; }
.conversation-back::before { content: ''; width: 10px; height: 10px; border-left: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: rotate(45deg); }
body[data-screen="conversation"] .service-state.is-responding i { width: 9px; height: 9px; background: var(--chat-accent); border-radius: 35%; animation: reply-breathe 1.5s ease-in-out infinite; }
@keyframes reply-breathe { 0%, 100% { transform: scale(.7) rotate(0deg); opacity: .55; } 50% { transform: scale(1) rotate(90deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body[data-screen="conversation"] .service-state.is-responding i { animation: none; } }

body[data-screen="conversation"][data-conversation-kind="private"] .topbar { grid-template-columns: 36px minmax(0, 1fr) 36px 36px; }
#pair-review-open { width: 36px; font-size: 19px; font-weight: 300; }
html[data-capture-mode="chat"] #pair-review-open { display: none; }
.pair-review { width: min(100vw, 540px); height: min(100dvh, 900px); max-width: 100vw; max-height: 100dvh; margin: auto; padding: 0; border: 0; border-radius: 24px; background: #faf8f4; color: #443d35; box-sizing: border-box; }
.pair-review::backdrop { background: #29241e66; backdrop-filter: blur(3px); }
.pair-review > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 0; }
.pair-review button { min-height: 36px; padding: 7px 12px; font: inherit; font-size: 12px; color: #76634f; border: 0; border-radius: 12px; background: #eee8df; cursor: pointer; }
.pair-review .pair-close { width: 44px; height: 44px; font-size: 25px; background: transparent; }
.pair-tabs { display: flex; padding: 8px 22px; gap: 8px; }
.pair-tabs button { background: transparent; color: #9b9388; }
.pair-tabs button[aria-current="true"] { background: #e9dfd2; color: #665039; }
.pair-content { padding: 12px 22px 40px; }
.pair-hero { padding: 27px 22px 24px; border-radius: 22px; background: radial-gradient(ellipse at top right, #ecd3b7aa, transparent 75%), #f1e9dd; }
.pair-hero > small { color: #9b8065; font-size: 11px; letter-spacing: .07em; }
.pair-hero h2 { font: 500 25px/1.4 Georgia, 'Songti SC', serif; margin: 12px 0 24px; }
.pair-numbers { display: flex; gap: 35px; }
.pair-numbers > div { display: grid; gap: 5px; }
.pair-numbers strong { font: 400 33px/1.1 Georgia, serif; color: #795b40; }
.pair-numbers span { font-size: 11px; color: #9d8b77; }
.pair-activity { margin: 26px 0 8px; }
.pair-review h3 { font-size: 14px; font-weight: 550; }
.pair-muted { font-size: 11px; color: #9b9184; line-height: 1.7; }
.pair-acquaintance { font-size: 11px; color: #9b8770; padding: 12px 0; }
.pair-acquaintance input { width: auto; margin: 10px 6px 0 0; }
.pair-heading { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; }
.pair-timeline { padding-left: 13px; border-left: 1px solid #ded3c4; margin-left: 5px; }
.pair-memory { position: relative; padding: 0 0 23px 7px; }
.pair-memory::before { content: ''; position: absolute; top: 5px; left: -18px; width: 7px; height: 7px; border-radius: 50%; background: #bc936a; box-shadow: 0 0 0 4px #faf8f4; }
.pair-memory time { color: #a08c76; font-size: 10px; }
.pair-memory h4 { margin: 8px 0; font-size: 15px; font-weight: 500; }
.pair-memory p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.85; margin: 6px 0 12px; color: #857764; }
.pair-memory footer { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pair-memory footer small { color: #ab9b88; font-size: 10px; }
.pair-memory footer button { padding: 4px 7px; background: transparent; font-size: 10px; }
.pair-editor { padding: 15px; background: #f0ebe3; border-radius: 15px; margin-bottom: 20px; }
.pair-editor label { display: grid; gap: 7px; font-size: 11px; color: #84735e; margin-bottom: 12px; }
.pair-review input, .pair-review textarea { box-sizing: border-box; max-width: 100%; min-width: 0; padding: 10px; border: 1px solid #ded5c8; border-radius: 8px; background: #fffdfa; font: inherit; color: inherit; }
.pair-editor > button { margin: 12px 5px 0 0; }
.pair-editor details { font-size: 11px; }
.pair-editor details[open] { max-height: 220px; overflow-y: auto; }
.pair-editor .pair-reference { display: flex; align-items: start; gap: 8px; margin-top: 10px; line-height: 1.6; }
.pair-reference input { flex-shrink: 0; }
.pair-mcp { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; padding: 16px 0; border-bottom: 1px solid #e8e1d7; }
.pair-mcp strong { font-size: 13px; overflow-wrap: anywhere; }
.pair-mcp span { font-size: 11px; color: #ad8e6c; }
.pair-mcp small { grid-column: 1/-1; color: #9e9385; font-size: 10px; }
@media(max-width: 540px) { .pair-review { border-radius: 0; width: 100vw; height: 100dvh; } }
.pair-tabs { flex-wrap: wrap; gap: 3px; }
.pair-tabs button { padding: 7px 9px; }
.pair-line-chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.pair-line-chart text { fill: #9b9c9c; font: 11px system-ui,sans-serif; }
.pair-review .pair-chart-date { display: block; width: 100%; height: 18px; padding: 0; border: 0; accent-color: #539ac2; background: transparent; }
.pair-review .pair-edit-days { padding: 3px 0; min-height: 28px; background: transparent; text-align: left; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; color: #9b8065; }

/* Only the transcript is personalized; navigation/composer keep their white UI. */
#chat { background-size: cover; background-position: center; }
#chat[data-background="sand"], .appearance-preview[data-background="sand"] { background-color: #f5f0e6; }
#chat[data-background="sage"], .appearance-preview[data-background="sage"] { background-color: #edf3ec; }
#chat[data-background="blue"], .appearance-preview[data-background="blue"] { background-color: #edf3f8; }
#chat[data-background="rose"], .appearance-preview[data-background="rose"] { background-color: #f8efef; }
#chat[data-background="image"] { background-color: #fff; }
:is(#chat,.bubble-theme-preview)[data-bubble="sand"], .appearance-preview[data-bubble="sand"] { --appearance-other: #f4eee3; --appearance-mine: #e9dcc2; }
:is(#chat,.bubble-theme-preview)[data-bubble="sage"], .appearance-preview[data-bubble="sage"] { --appearance-other: #edf3ea; --appearance-mine: #dce9d7; }
:is(#chat,.bubble-theme-preview)[data-bubble="blue"], .appearance-preview[data-bubble="blue"] { --appearance-other: #edf2f7; --appearance-mine: #dae8f3; }
:is(#chat,.bubble-theme-preview)[data-bubble="rose"], .appearance-preview[data-bubble="rose"] { --appearance-other: #f8eeee; --appearance-mine: #efdbdf; }
:is(#chat,.bubble-theme-preview)[data-bubble]:not([data-bubble="default"]):not([data-other-bubble="color"]):not([data-other-bubble="image"]) .message:not(.me) .bubble { background: var(--appearance-other); color: #36332e; }
:is(#chat,.bubble-theme-preview)[data-bubble]:not([data-bubble="default"]):not([data-mine-bubble="color"]):not([data-mine-bubble="image"]) .message.me .bubble { background: var(--appearance-mine); color: #36332e; }
#chat[data-background]:not([data-background="default"]) .time-divider,
#chat[data-background]:not([data-background="default"]) .free-activity-record { width: fit-content; padding: 3px 8px; background: transparent; border: 0; box-shadow: none; border-radius: 0; color: #655f57; }
#chat .time-divider,#chat .free-activity-record{background:transparent;border:0;box-shadow:none;border-radius:0}
#chat[data-background="image"] .process-summary, #chat[data-background="image"] .autonomy-heart,
#chat[data-background="image"] .empty, #chat[data-background="image"] .room-status { background: #fff; border-radius: 8px; color: #655f57; }
.custom-group-avatar { display: block; overflow: hidden; border-radius: 50%; }
.custom-group-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.appearance-editor { display: grid; gap: 16px; min-width: 0; color: #443d35; }
.appearance-editor > p { margin: 0; font-size: 13px; line-height: 1.7; }
.appearance-editor fieldset { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 12px; border: 1px solid #e4e0d9; border-radius: 12px; }
.appearance-editor legend, .appearance-editor label { font-size: 13px; }
.appearance-editor button[aria-pressed="true"] { outline: 2px solid #8f735d; outline-offset: 1px; }
.appearance-editor input[type="file"] { display: block; width: 100%; margin-top: 8px; }
.appearance-editor small { font-size: 11px; line-height: 1.7; }
.appearance-preview { position: relative; display: grid; gap: 14px; min-height: 130px; overflow: hidden; padding: 20px; border: 1px solid #e4e0d9; border-radius: 16px; background: #fcfbf8; }
.appearance-preview > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; }
.appearance-preview .preview-other, .appearance-preview .preview-mine { position: relative; width: fit-content; max-width: 100%; padding: 10px; border-radius: 16px; font-size: 13px; color: #36332e; background: var(--appearance-other, #f0efeb); }
.appearance-preview .preview-mine { justify-self: end; background: var(--appearance-mine, #f4ece8); }
.appearance-avatar-preview { width: 90px; height: 90px; justify-self: center; }
.pair-acquaintance { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-acquaintance[hidden] { display: none; }
.pair-acquaintance label { display: grid; gap: 5px; min-width: 0; }
.pair-acquaintance input { width: 100%; margin: 0; }
.pair-acquaintance > small { grid-column: 1/-1; }
.pair-numbers > div { align-content: start; }

/* Conservative history/tool readability candidate; no shell version change. */
body[data-screen="conversation"][data-conversation-kind="private"] .topbar { grid-template-columns: 32px minmax(0, 1fr) 32px 36px 32px; gap: 4px; }
#history-search-open { width: 36px; min-width: 0; padding: 0; font-size: 12px; }
body[data-conversation-kind="room"] #history-search-open, html[data-capture-mode="chat"] #history-search-open { display: none; }
.history-dialog { background: #fff; overflow-x: hidden; }
.history-dialog header { background: #fff; }
.history-scope, #history-status, #history-reader-status { font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.history-dialog button { font: inherit; min-height: 40px; }
.history-dialog button:disabled { opacity: .55; }
.history-navigation { box-sizing: border-box; flex-wrap: wrap; justify-content: center; background: #fffffff5; }
#history-window-status { flex-basis: 100%; text-align: center; overflow-wrap: anywhere; }
.history-read-text { display: block; max-width: 100%; margin-top: 12px; padding: 8px; border: 1px solid #ddd; border-radius: 8px; background: #fff; color: inherit; white-space: normal; font: 12px/1.5 inherit; }
.history-reader-text { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.75 ui-monospace, monospace; }
.history-reader-actions { position: sticky; bottom: -20px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; background: #fff; }
.pair-review[data-page="mcp"] { background: #fff; }
.pair-mcp-group { margin: 16px 0; }
.pair-mcp-group > summary { padding: 12px 0; font-size: 14px; cursor: pointer; }
.pair-mcp-entry { margin: 8px 0; padding: 10px; border: 1px solid #e5e5e5; border-radius: 10px; }
.pair-mcp-entry summary { cursor: pointer; overflow-wrap: anywhere; }
.pair-mcp-entry summary strong { font-size: 13px; }
.pair-mcp-entry summary span { display: block; margin-top: 6px; font-size: 12px; color: #666; }
.pair-mcp-entry p { overflow-wrap: anywhere; }
.tool-call-details { margin-top: 8px; min-width: 0; font-size: 12px; }
.tool-call-details summary { cursor: pointer; overflow-wrap: anywhere; line-height: 1.7; }
.tool-call-details dl { margin: 10px 0; padding: 10px; border: 1px solid #e5e5e5; border-radius: 8px; background: #fff; }
.tool-call-details dt { color: #777; margin-top: 8px; }
.tool-call-details dd { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 350px) { .history-dates { grid-template-columns: minmax(0, 1fr); } .history-dialog { padding: 14px; } }
.pair-review .pair-chart-date { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }

/* Settings lives in the sidebar; the chat tabs retain messages and space. */
.hub-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
.avatar-settings{display:grid;gap:16px;justify-items:start}
.avatar-settings h3,.avatar-settings p{margin:0}
.avatar-settings .avatar-settings-preview{width:100px;height:100px;flex-basis:100px;border-radius:50%;overflow:hidden;display:grid;place-items:center;font-size:32px;background:#eaf0f7}
.avatar-settings-preview img{width:100%;height:100%;object-fit:cover}
.pair-review .pair-avatar-edit{background:transparent;padding:0;border:0;cursor:pointer;min-width:64px;min-height:64px}
.pair-review .pair-avatar-edit:focus-visible{outline:2px solid #159ee8;outline-offset:4px;border-radius:50%}
body[data-screen="conversation"] .topbar{padding-right:max(12px,env(safe-area-inset-right));padding-left:max(8px,env(safe-area-inset-left))}
body[data-screen="conversation"][data-conversation-kind="room"] .topbar{grid-template-columns:44px minmax(0,1fr) 44px;column-gap:8px}
body[data-screen="conversation"][data-conversation-kind="room"] #pair-review-open{grid-column:3;justify-self:end;width:44px;height:44px;padding:0;display:grid;place-items:center}
body[data-screen="conversation"][data-conversation-kind="room"] #service-state[data-room-idle="true"]{display:none}
body[data-screen="conversation"] .topbar .conversation-identity{display:flex;position:relative;align-self:center;align-items:center;min-height:44px;text-align:left;justify-self:stretch}
body[data-screen="conversation"] .topbar .conversation-identity .service-state{position:absolute;top:calc(50% + 13px);left:0;margin:0;white-space:nowrap}
body[data-screen="conversation"] #conversation-back{width:44px;height:44px;min-height:44px;padding:0;display:grid;place-items:center}
body[data-screen="conversation"] #conversation-back svg{display:block}
body[data-screen="conversation"] #conversation-back::before{content:none}
.pair-activity:focus-within .pair-line-chart { outline: 1px solid #539ac2; outline-offset: 3px; border-radius: 5px; }

/* Full-page chat settings and search: one continuous surface inside the app. */
body[data-screen="conversation"][data-conversation-kind="private"] .topbar { grid-template-columns:32px minmax(0,1fr) 32px 32px; gap:6px; }
body[data-screen="conversation"] .shell[data-background] { background-size:cover; background-position:center; }
body[data-screen="conversation"] .shell[data-background="sand"] { background-color:#f5f0e6; }
body[data-screen="conversation"] .shell[data-background="sage"] { background-color:#edf3ec; }
body[data-screen="conversation"] .shell[data-background="blue"] { background-color:#edf3f8; }
body[data-screen="conversation"] .shell[data-background="rose"] { background-color:#f8efef; }
body[data-screen="conversation"] .shell[data-background]:not([data-background="default"]) .topbar,
body[data-screen="conversation"] .shell[data-background]:not([data-background="default"]) #chat { background-color:transparent; background-image:none!important; }
body:not([data-screen="conversation"]) .shell { background-image:none!important; }
#chat[data-background="image"] .process-summary, #chat[data-background="image"] .autonomy-heart { background:transparent; border-radius:0; color:#625f59; }
#chat .message:has(.process-summary):not(:has(.message-markdown)) .bubble { background:transparent; box-shadow:none; }
.pair-review,.history-dialog { position:fixed; inset:0; width:min(100vw,460px); height:100dvh; max-height:100dvh; max-width:100vw; padding:0; margin:auto; border:0; border-radius:0; box-sizing:border-box; overflow:auto; color:#282b31; background:#f3f4f6; }
.pair-review::backdrop,.history-dialog::backdrop { background:#edf0f5; backdrop-filter:none; }
.pair-review > header,.history-dialog > header { position:sticky; top:0; z-index:3; display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; min-height:64px; padding:env(safe-area-inset-top) 12px 0; margin:0; background:#fff; text-align:center; box-sizing:border-box; }
.pair-review > header strong,.history-dialog > header strong { font-size:17px; font-weight:500; }
.pair-review .pair-back,.history-dialog > header button { display:grid; place-items:center; width:44px; height:44px; min-height:44px; padding:0; border:0; background:transparent; color:#353a42; font:30px/1 system-ui; }
.pair-content { padding:18px 16px 40px; }
.pair-review .chat-settings-identity { display:flex; align-items:center; gap:16px; width:100%; padding:22px 18px; margin:0 0 20px; border-radius:16px; background:#fff; text-align:left; }
.settings-avatar { display:grid; place-items:center; width:58px; height:58px; flex:0 0 58px; overflow:hidden; border-radius:50%; background:#eeedf3; color:#697184; font:25px Georgia,serif; }
.settings-avatar img { width:100%;height:100%;object-fit:cover; }
.settings-identity-copy { display:grid; gap:12px; flex:1; min-width:0; }
.settings-identity-copy strong { display:flex; align-items:center; flex-wrap:wrap; gap:6px; color:#353a42;font-size:19px; font-weight:550; }
.settings-identity-copy small { font-size:13px;color:#777d85; }
.chat-settings-list { overflow:hidden; margin:0 0 20px; border-radius:16px; background:#fff; }
.pair-review .chat-settings-row { display:flex; align-items:center; gap:10px; width:100%; min-height:64px; padding:15px 18px; border:0; border-radius:0; background:#fff; text-align:left; color:#34383f;font-size:15px; }
.chat-settings-row+.chat-settings-row { border-top:1px solid #f0f1f3; }
.chat-settings-row > span:first-child { flex:1; }
.chat-settings-row small { max-width:45%;color:#92969d;font-size:12px;overflow-wrap:anywhere; }
.row-arrow { color:#a9adb4;font-size:25px; }
.settings-pin .row-arrow { width:38px;height:23px;flex:0 0 38px;border-radius:14px;background:#e1e3e7;position:relative; }
.settings-pin .row-arrow::after { content:'';position:absolute;top:3px;left:3px;width:17px;height:17px;background:#fff;border-radius:50%;box-shadow:0 1px 3px #0002; }
.settings-pin[aria-checked="true"] .row-arrow { background:#519fc9; }
.settings-pin[aria-checked="true"] .row-arrow::after { left:18px; }
.conversation-row.is-pinned { background:#edf1f7; }
.history-dialog { background:#fff; }
#history-form { display:block; margin:10px 16px 0; }
.history-search-line { display:flex; align-items:center; gap:9px; }
.history-search-line input { flex:1; height:42px;background:#f4f5f8;border:0;border-radius:11px;padding:0 14px;font-size:14px; }
.history-search-line button { flex:0 0 auto;border:0;background:transparent;color:#537693;font-size:14px; }
.history-filter-line { display:flex;align-items:center;gap:20px;padding:14px 3px 10px;border-bottom:1px solid #f0f1f4; }
.history-filter-line > button { padding:0 10px;border:0;background:transparent;color:#4a6176;font-size:14px; }
.history-filter-line > button[aria-pressed="true"] { border-bottom:2px solid #539ac2; }
.history-filter-line label { display:flex;flex:1;align-items:center;gap:10px;font-size:13px;color:#6c7885; }
.history-filter-line select { width:auto;max-width:130px;border:0;background:#f6f7f9;padding:8px; }
.history-scope { margin:12px 20px;color:#9b9fa6;font-size:11px; }
#history-status { margin:18px 20px;color:#818791; }
#history-results { padding:0 16px; }
.history-result { display:flex;align-items:flex-start;gap:12px;margin:0;padding:17px 0;border:0;border-bottom:1px solid #eff0f3;border-radius:0; }
.history-result-avatar { display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;overflow:hidden;border-radius:50%;background:#eeedf3;color:#697184; }
.history-result-avatar img { width:100%;height:100%;object-fit:cover; }
.history-result-copy { display:grid;gap:7px;min-width:0;flex:1;line-height:1.65;font-size:14px; }
.history-result-copy small { color:#999ea6;font-size:11px; }
#history-more { display:block;margin:18px auto;padding:9px 20px;border:0;background:#f3f5f8;color:#56738c;border-radius:18px; }
#history-calendar { padding:12px 18px; }
.history-month-head { display:flex;align-items:center;justify-content:space-between;margin:10px 0; }
.history-month-head button { width:40px;border:0;background:transparent;font-size:24px;color:#63758a; }
.history-month-head strong { font-weight:500;font-size:16px; }
.history-weekdays,.history-calendar-days { display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;text-align:center; }
.history-weekdays { padding:14px 0;color:#9b9fa5;font-size:12px; }
.history-calendar-days button { width:100%;min-width:0;min-height:39px;border:0;border-radius:50%;background:transparent;font-size:14px;color:#c7c9ce; }
.history-calendar-days button.has-messages { color:#42667e;background:#eef5f9;font-weight:550; }
.history-calendar-days button.has-messages:hover { background:#dceef8; }
#history-calendar-status { font-size:12px;color:#969ca4;line-height:1.7;margin-top:22px; }
#history-calendar-retry { border:0;padding:8px 16px;background:#edf4f8;color:#42667e;border-radius:14px; }
.history-navigation { pointer-events:none;padding:7px 13px;font-size:11px;box-shadow:none;background:#ffffffe6; }
.history-navigation button { display:none!important; }
.history-target { outline:2px solid #bbd0dc;outline-offset:4px;transition:outline-color .3s; }
.load-later { margin:18px auto; }
#history-reader > :not(header) { margin-left:18px;margin-right:18px; }
.history-reader-actions { bottom:0; }
@media(min-width:700px){.pair-review,.history-dialog{height:calc(100dvh - 58px);max-height:calc(100dvh - 58px);border-radius:28px;}}
@media(max-width:350px){.pair-content{padding:14px 11px 30px;}.pair-review .chat-settings-row{padding:14px;font-size:14px;}.chat-settings-row small{font-size:11px;}}

#history-more[hidden], #history-calendar[hidden], #history-results[hidden], #history-status[hidden] { display:none!important; }
.history-load-error { text-align:center; color:var(--muted); font-size:12px; padding:8px; }

/* The pair archive only shows mementos that this pair already owns. */
.pair-review[data-page="memories"] .pair-content { padding:16px 14px 40px; }
.pair-review[data-page="memories"] .pair-hero { padding:18px 14px 15px; overflow:hidden; border-radius:24px; background:radial-gradient(ellipse at 50% 30%,#fff8f2,#fff 68%); box-shadow:0 8px 26px #d7dce333; }
.pair-relationship { display:grid; grid-template-columns:minmax(44px,64px) minmax(0,1fr) minmax(44px,64px); gap:5px; align-items:center; min-height:165px; }
.pair-portrait { min-width:0; width:100%; aspect-ratio:1; border-radius:50%; }
.pair-portrait .settings-avatar { width:100%; height:100%; aspect-ratio:1; box-sizing:border-box; border:4px solid #fff; box-shadow:0 3px 14px #56647c28; font-size:23px; }
.pair-featured-memento { display:grid; place-items:center; min-width:0; min-height:150px; }
.pair-featured-memento img { display:block; width:100%; max-height:190px; aspect-ratio:3/2; object-fit:contain; filter:drop-shadow(0 8px 11px #9c6d5c3d); }
.pair-no-memento { color:#909caf; font-size:12px; line-height:1.6; text-align:center; }
.pair-memento-status { display:flex; align-items:center; justify-content:center; gap:9px; margin-top:3px; font-size:13px; }
.pair-memento-status strong { font-weight:550; color:#4a5365; }
.pair-memento-status span,.pair-memento-item small { padding:3px 9px; border-radius:99px; background:#e9f3fb; color:#376c98; font-size:11px; }
.pair-review .pair-memento-tagline { margin:13px 0 0; color:#8897a9; text-align:center; font-size:12px; line-height:1.6; }
.pair-review[data-page="memories"] .pair-numbers { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0 0; }
.pair-review[data-page="memories"] .pair-number-card { min-width:0; padding:14px 16px; border-radius:20px; background:#fff; box-shadow:0 5px 18px #d7dce326; }
.pair-review[data-page="memories"] .pair-number-card strong { display:block; font-size:29px; line-height:1.2; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.pair-review[data-page="memories"] .pair-number-card span { display:block; margin-top:5px; font-size:12px; }
.pair-review[data-page="memories"] .pair-edit-days { display:block; margin-top:5px; }
.pair-review[data-page="memories"] .characters-entry { display:flex; align-items:center; gap:13px; width:100%; min-height:62px; margin-top:12px; padding:9px 17px; border-radius:20px; background:#fff; box-shadow:0 5px 18px #d7dce326; color:#344d69; text-align:left; font-size:14px; }
.characters-entry-icon { display:grid; place-items:center; width:38px; height:38px; flex:0 0 38px; border-radius:50%; background:#eaf4fc; color:#286995; font-size:17px; }
.characters-entry-arrow { margin-left:auto; color:#8b9bad; font-size:23px; line-height:1; }
.pair-mementos { margin:14px 0; padding:17px 16px; border-radius:22px; background:#fff; }
.pair-mementos h3 { margin:0 0 12px; font-size:16px; }
.pair-mementos .pair-muted { margin:0; font-size:12px; }
.pair-memento-collection { display:flex; gap:12px; overflow-x:auto; padding:2px 0 4px; }
.pair-memento-item { display:grid; gap:5px; justify-items:center; flex:0 0 112px; min-width:0; text-align:center; color:#505c6b; }
.pair-memento-item img { width:112px; height:92px; object-fit:contain; border:1px solid #d6e9f7; border-radius:13px; background:#f7fbfd; }
.pair-memento-item strong { font-size:12px; font-weight:500; }
.pair-review .pair-memento-item small { color:#376c98; font-size:10px; }
@media(max-width:350px) { .pair-review[data-page="memories"] .pair-content { padding:13px 10px 30px; } .pair-review[data-page="memories"] .pair-hero { padding:13px 10px; } .pair-relationship { grid-template-columns:minmax(42px,54px) minmax(0,1fr) minmax(42px,54px); min-height:130px; } .pair-featured-memento { min-height:125px; } .pair-review[data-page="memories"] .pair-number-card { padding:12px; } .pair-review[data-page="memories"] .pair-number-card strong { font-size:25px; } }
.think-favorites .pair-content { padding: 18px 18px 32px; }
.favorites-intro,.favorites-status { color:#667182; font-size:13px; line-height:1.7; }
.favorites-list { display:grid; gap:14px; margin:20px 0; }
.think-favorites .favorites-row { display:block; width:100%; padding:18px; background:#fff; border-radius:20px; text-align:left; color:#344355; box-shadow:0 5px 18px #d7dce326; }
.favorites-row time,.favorites-detail time { display:block; color:#7b8797; font-size:11px; }
.favorites-excerpt { margin:12px 0; font-size:15px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.favorites-reason { margin:0; color:#6d7f92; font-size:12px; line-height:1.7; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.favorites-read { display:block; margin-top:14px; color:#376c98; font-size:12px; }
.favorites-detail { padding:20px; border-radius:22px; background:#fff; }
.favorites-body { margin:20px 0 28px; font-size:16px; line-height:1.95; white-space:pre-wrap; overflow-wrap:anywhere; }
.favorites-detail h3 { margin:22px 0 8px; color:#526a82; font-size:13px; }
.favorites-detail-reason,.favorites-source { margin:0 0 16px; font-size:14px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.think-favorites .favorites-more { display:block; margin:20px auto 0; }
.think-favorites .favorites-more[hidden] { display:none; }
.think-favorites .favorites-locate { color:#376c98; background:#eaf4fc; }

/* Chat settings: one simple list, with whitespace between groups. Memory pages retain their existing layout. */
.pair-review[data-page="menu"] .pair-content { padding: 8px 20px max(32px, env(safe-area-inset-bottom)); }
.pair-review[data-page="menu"] .chat-settings-identity { gap: 13px; padding: 14px 0 18px; margin: 0 0 12px; border-radius: 0; background: transparent; }
.pair-review[data-page="menu"] .settings-avatar { width: 50px; height: 50px; flex-basis: 50px; }
.pair-review[data-page="menu"] .settings-identity-copy { gap: 5px; }
.pair-review[data-page="menu"] .settings-identity-copy strong { font-size: 18px; }
.pair-review[data-page="menu"] .chat-settings-list { margin: 0 0 20px; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.pair-review[data-page="menu"] .chat-settings-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,42%) 38px; gap: 8px; min-height: 56px; padding: 10px 0; border: 0; background: transparent; color: inherit; line-height: 1.45; }
.pair-review[data-page="menu"] .chat-settings-row small { max-width: none; text-align: right; color: var(--device-muted,#69717e); font-size: 12px; }
.pair-review[data-page="menu"] .row-arrow { justify-self: end; text-align: center; width: 38px; font-size: 24px; line-height: 1; }
.pair-review[data-page="menu"] .settings-pin[aria-checked="true"] .row-arrow { background: var(--device-accent,var(--chat-accent)); }
.pair-review[data-page="menu"] button:focus-visible { outline: 2px solid var(--device-accent,var(--chat-accent)); outline-offset: 3px; }

.call-system-record { margin: 12px 0; color: var(--home-text, var(--slate-12, #1c2024)); font-size: 12px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }

/* Date and result navigation stay controls rather than helper copy. */
.history-date-range{display:flex;gap:12px;padding-block:12px}
.history-date-range[hidden],#history-newer[hidden]{display:none!important}
.history-date-range label{display:grid;gap:6px;flex:1;min-width:0;font-size:12px;color:var(--device-muted,#60646c)}
.history-date-range input,#history-month-title{min-width:0;width:100%;min-height:40px;padding:6px;border:0.5px solid var(--device-line,#d9d9e0);border-radius:6px;background:var(--device-panel,#fff);color:var(--device-panel-ink,#1c2024);font-size:14px;font-family:inherit;color-scheme:var(--device-controls-scheme,light)}
#history-month-title{width:150px;border:0;text-align:center}
.history-result-pages{display:flex;justify-content:center;gap:12px}
#history-newer,#history-more{margin:18px 0;padding:9px 16px;border:0;background:var(--device-soft,#e6f4fe);color:var(--device-accent-text,#0d74ce);font-size:14px;font-family:inherit}
.history-search-match{background:var(--device-soft,#e6f4fe);color:inherit;outline:0.5px solid var(--device-accent-text,#0d74ce)}

.history-filter-line{gap:12px}.history-filter-line label{flex:0 0 auto;white-space:nowrap}

/* The search view has fixed controls, a reading surface, and stable paging. */
#history-dialog[open]{display:flex;flex-direction:column;width:min(100vw,460px);max-width:100vw;height:100dvh;max-height:100dvh;margin:0 auto;padding:0;overflow:hidden;border:0;border-radius:0;background:var(--device-panel,#fff);color:var(--device-panel-ink,#1c2024)}
#history-dialog>header{display:grid;grid-template-columns:40px minmax(0,1fr) 40px;align-items:center;flex-shrink:0;min-height:62px;padding:8px 14px;background:inherit}
#history-dialog>header strong{text-align:center;font-size:16px;font-weight:600}
#history-dialog>header button{width:40px;height:40px;padding:0;font-size:24px;color:inherit}
#history-form{flex-shrink:0;margin:0;padding:0 18px 14px;border-bottom:0.5px solid var(--device-line,#d9d9e0)}
#history-dialog .history-search-line{position:relative;gap:12px}
#history-dialog .history-search-icon{position:absolute;left:13px;width:18px;height:18px;fill:none;stroke:var(--device-muted,#60646c);stroke-width:1.6;pointer-events:none}
#history-dialog .history-search-line input{min-width:0;height:44px;padding-left:40px;border-radius:10px;background:var(--device-soft,#e6f4fe);color:inherit;font-size:14px}
#history-dialog .history-search-line input::placeholder{color:var(--device-muted,#60646c);opacity:1}
#history-dialog .history-search-line button{min-height:44px;padding:0 2px;color:var(--device-accent-text,#0d74ce);font-size:14px;font-weight:600}
#history-dialog .history-filter-line{gap:10px;padding:12px 0 0;border:0}
#history-dialog .history-filter-line>button,#history-dialog .history-filter-line select{min-height:38px;border:0;border-radius:8px;background:var(--device-soft,#e6f4fe);color:inherit;font-size:14px}
#history-calendar-toggle{display:flex;align-items:center;gap:7px;min-width:0;max-width:calc(100% - 88px);padding:7px 10px!important;text-align:left}
#history-calendar-toggle svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.5}
#history-calendar-toggle[aria-pressed=true]{color:var(--device-accent-text,#0d74ce)!important;box-shadow:inset 0 0 0 0.5px var(--device-accent-text,#0d74ce)}
#history-dialog .history-filter-line label{margin-left:auto;flex:0 0 auto}
#history-dialog .history-filter-line select{max-width:130px;padding:7px 10px}
.history-control-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#history-dialog .history-date-range{padding:12px 0 0}
#history-dialog #history-results{flex:1;min-height:0;margin:0;padding:0 18px 22px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.history-result-day{margin:18px 0 0}
.history-result-day>h3{position:sticky;z-index:1;top:0;margin:0;padding:10px 0;background:var(--device-panel,#fff);color:var(--device-muted,#60646c);font-size:12px;font-weight:600}
#history-dialog .history-result{display:grid;grid-template-columns:32px minmax(0,1fr) 12px;align-items:start;gap:10px;width:100%;margin:0;padding:14px 4px;border:0;border-radius:8px;background:transparent;color:inherit;text-align:left}
#history-dialog .history-result:hover{background:var(--device-soft,#e6f4fe)}
#history-dialog .history-result-avatar{width:32px;height:32px;min-width:32px;margin-top:1px;background:var(--device-soft,#e6f4fe);color:var(--device-accent-text,#0d74ce);font-size:14px}
#history-dialog .history-result-copy{display:grid;gap:6px;min-width:0;font-size:14px;line-height:1.7}
.history-result-meta{display:flex;align-items:baseline;justify-content:space-between;gap:10px;min-width:0;line-height:1.35}
.history-result-meta strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600}
.history-result-meta time{flex-shrink:0;color:var(--device-muted,#60646c);font-size:12px}
.history-result-snippet{overflow-wrap:anywhere}
.history-result-match{background:var(--device-soft,#e6f4fe);color:inherit;font-weight:600}
.history-result-arrow{align-self:center;color:var(--device-muted,#60646c);font-size:24px;line-height:1}
#history-dialog .history-result-pages{display:none;flex-shrink:0;gap:10px;margin:0;padding:12px 18px max(12px,env(safe-area-inset-bottom));border-top:0.5px solid var(--device-line,#d9d9e0);background:inherit}
#history-dialog .history-result-pages:has(button:not([hidden])){display:flex}
#history-dialog :is(#history-newer,#history-more){flex:1;min-height:40px;margin:0;padding:8px 14px;border-radius:8px;font-size:14px;line-height:1.4}
#history-dialog #history-status{flex-shrink:0;margin:0;padding:16px 20px;color:var(--device-muted,#60646c);font-size:14px;line-height:1.6}
#history-dialog #history-status:empty{display:none}
#history-dialog #history-calendar{flex:1;min-height:0;overflow-y:auto;padding:12px 18px 24px}
#history-dialog .history-month-head{margin:0 0 8px}
#history-dialog .history-month-head button{color:var(--device-accent-text,#0d74ce)}
#history-dialog .history-weekdays{color:var(--device-muted,#60646c)}
#history-dialog .history-calendar-days button{position:relative;border-radius:8px;background:transparent;color:var(--device-muted,#60646c);opacity:.45}
#history-dialog .history-calendar-days button.has-messages{color:inherit;opacity:1}
#history-dialog .history-calendar-days button.has-messages::after{content:'';position:absolute;bottom:3px;left:calc(50% - 1.5px);width:3px;height:3px;border-radius:50%;background:var(--device-accent-text,#0d74ce)}
#history-dialog .history-calendar-days button.has-messages:hover{background:var(--device-soft,#e6f4fe)}
#history-dialog :is(button,input,select):focus-visible{outline:2px solid var(--device-accent-text,#0d74ce);outline-offset:2px}
#history-dialog button:disabled{opacity:.45}
#history-results-return{position:fixed;z-index:15;left:max(14px,calc((100vw - 780px)/2));bottom:calc(var(--composer-height,100px) + 8px);display:inline-flex;align-items:center;gap:4px;min-height:40px;padding:0 11px;border:0.5px solid var(--device-line,#d9d9e0);border-radius:8px;background:var(--device-panel,#fff);color:var(--device-accent-text,#0d74ce);font-size:14px;font-family:inherit;font-weight:500}
#history-results-return svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5}
#history-results-return:focus-visible{outline:2px solid var(--device-accent-text,#0d74ce);outline-offset:2px}
#history-results-return[hidden],body:not([data-screen=conversation]) #history-results-return{display:none}
.history-search-match.history-target{transition:none}
@media(min-width:700px){#history-dialog[open]{height:calc(100dvh - 56px);max-height:calc(100dvh - 56px);margin:28px auto;border:0.5px solid var(--device-line,#d9d9e0);border-radius:20px}}

#history-dialog .history-filter-line label{color:var(--device-panel-ink,#1c2024)}
#history-dialog .history-filter-line select{color-scheme:var(--device-controls-scheme,light)}

#history-dialog :is(#history-newer,#history-more,.history-result-avatar){color:var(--device-panel-ink,#1c2024)}
#history-dialog #history-calendar-toggle[aria-pressed=true]{color:var(--device-panel-ink,#1c2024)!important}
#history-dialog #history-calendar-status{color:var(--device-muted,#60646c)}
