:root {
  color-scheme: light;
  --ink: #26303e; --muted: #637083; --line: #e8ebf0; --accent: #3469dd;
  --accent-soft: #eaf0ff; --green: var(--accent); --paper: #fff; --wash: #f5f7fc;
  --sidebar: #f2f5fa; --hover: #edf1f7; --glass: #fff; --field: #edf1f7; --frame: #f2f5fa;
  --bubble: #f0f2f6; --outgoing: #e9effc; --danger: #c4363c; --shadow: 0 16px 64px #26334d1a;
  --toolbar-height: 0rem; --app-rail: clamp(10.75rem, 11.5vw, 14rem); --list-width: clamp(9rem, 14vw, 16rem); --pane-radius: .75rem;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-optical-sizing: auto;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8edf5; --muted: #aab6c9; --line: #343e50; --accent: #a6bfff;
  --accent-soft: #304264; --paper: #252e3d; --wash: #2c3749; --sidebar: #202a3b;
  --hover: #303d52; --glass: #2a3547; --field: #2e3a4d; --bubble: #303d52; --frame: #1c2534;
  --outgoing: #34496b; --danger: #ff969c; --shadow: 0 16px 64px #0005;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--frame); font-size: .875rem; overflow: hidden; }
:root[data-theme="dark"] body { background: var(--frame); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; color: inherit; touch-action: manipulation; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
button { transition: box-shadow 120ms; }
button:active:not(:disabled), .toolbar-menu > summary:active { background-color: var(--hover); transition: none; }
.primary:active:not(:disabled), #send:active:not(:disabled) { background-color: var(--accent); }
a { color: var(--accent); text-underline-offset: 3px; }
svg.icon { display: block; width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topbar { position: fixed; inset: 0 auto 0 0; width: var(--app-rail); height: 100dvh; display: flex; flex-direction: column; align-items: stretch; padding: 1.125rem .625rem .875rem; background: transparent; border: 0; }
.brand { display: inline-flex; align-items: center; gap: .65rem; justify-self: start; color: var(--ink); text-decoration: none; }
.mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; background: var(--ink); color: var(--paper); border-radius: .65rem; font-size: 1.25rem; font-weight: 600; }
.brand strong { font-size: 1.125rem; letter-spacing: -.025em; font-weight: 650; }
.top-actions, .inline-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.top-actions { justify-self: end; gap: 1rem; }
.status { font-size: .75rem; color: var(--muted); }
#connection { display: flex; align-items: center; gap: .4rem; }
#connection::before { content: ''; width: .35rem; height: .35rem; border-radius: 50%; background: var(--muted); }
.workspace-nav { display: flex; align-items: center; padding: .25rem; gap: .25rem; border-radius: .75rem; background: var(--field); }
.workspace-nav button { display: flex; align-items: center; justify-content: center; gap: .45rem; border: 0; border-radius: .55rem; padding: .4rem 1.1rem; background: transparent; color: var(--muted); font-size: .8125rem; font-weight: 550; }
.workspace-nav button.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px #00000012; }
.workspace-nav .icon { width: 1rem; height: 1rem; }
.account-button { display: flex; align-items: center; gap: .4rem; padding: .5rem .65rem; border: 0; border-radius: .6rem; background: transparent; color: var(--muted); font-size: .8125rem; }
main { height: 100dvh; min-height: 0; margin-left: var(--app-rail); width: calc(100% - var(--app-rail)); padding: 0; column-gap: 0; }
#personal-workspace { display: grid; grid-template-columns: var(--list-width) minmax(0, 1fr); }
.panel { min-width: 0; min-height: 0; overflow: hidden; background: var(--wash); }
.conversation, .team-panel { display: flex; flex-direction: column; }
.panel-header { min-height: 4.25rem; flex-shrink: 0; display: flex; align-items: center; gap: .85rem; padding: .75rem 1.5rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.panel-header > .inline-actions { margin-left: auto; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 1.125rem; line-height: 1.4; letter-spacing: -.02em; }
h2 { font-size: 1.0625rem; letter-spacing: -.015em; }
h3 { font-size: .875rem; }
.muted, .meta { color: var(--muted); font-size: .75rem; }
.muted { margin: .25rem 0 0; }
.eyebrow { color: var(--muted); font-size: .6875rem; letter-spacing: .04em; margin: 0 0 .4rem; }
.personal-heading { min-width: 0; }
.toolbar { gap: .45rem; flex-wrap: nowrap; }
.icon-button, .toolbar-label { border: 0; background: transparent; color: var(--muted); border-radius: .65rem; min-width: 2.25rem; min-height: 2.25rem; padding: .5rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; line-height: 1; font-size: 1.25rem; }
.toolbar-label { font-size: .8125rem; padding-inline: .65rem; }
.toolbar-label[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.subtle, .text-button { border: 0; background: transparent; border-radius: .5rem; padding: .4rem .65rem; color: var(--accent); white-space: nowrap; font-size: .8125rem; }
.text-button { display: inline-flex; align-items: center; gap: .4rem; }
.text-button .icon { width: 1rem; height: 1rem; }
.primary, #send { border: 0; border-radius: .65rem; background: var(--accent); color: #fff; padding: .65rem 1.25rem; font-size: .875rem; font-weight: 550; }
.danger { color: var(--danger) !important; }
.toolbar-menu { position: relative; }
.toolbar-menu > summary { list-style: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; cursor: pointer; color: var(--muted); border-radius: .65rem; }
.toolbar-menu > summary::-webkit-details-marker { display: none; }
.toolbar-menu[open] > summary { color: var(--ink); background: var(--hover); }
.menu-surface { position: absolute; z-index: 18; top: calc(100% + .6rem); right: 0; width: 13.5rem; padding: .4rem; background: var(--glass); backdrop-filter: blur(24px); border: 1px solid var(--line); border-radius: .85rem; box-shadow: var(--shadow); transform-origin: top right; }
.menu-caption { display: block; color: var(--muted); padding: .4rem .6rem .5rem; font-size: .6875rem; }
.menu-surface button { width: 100%; display: flex; gap: .65rem; align-items: center; padding: .65rem; background: transparent; border: 0; border-radius: .45rem; text-align: left; font-size: .8125rem; }
.menu-surface button .icon { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.menu-divider { border-top: 1px solid var(--line); margin: .35rem .4rem; }
.conversation-tools { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem 1.5rem; background: var(--wash); }
.conversation-tools > div { min-width: 0; }
.conversation-tools select { max-width: min(55vw, 20rem); border: 0; border-radius: .4rem; padding: .35rem; background: transparent; color: var(--muted); font-size: .75rem; }
.messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.5rem 2rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.message { margin: 0 0 1.15rem; max-width: min(82%, 46rem); }
.message.user { margin-left: auto; }
.message-label { font-size: .6875rem; color: var(--muted); margin-bottom: .45rem; }
.user .message-label { text-align: right; }
.bubble { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9375rem; line-height: 1.8; padding: .8rem 1rem; background: var(--bubble); border: 0; border-radius: .8rem; }
.user .bubble { background: var(--outgoing); border-color: transparent; border-radius: .8rem; }
.message.reminder .bubble { border-color: var(--accent); }
.composer-wrap { padding: 1rem 1.75rem 1.25rem; flex-shrink: 0; background: var(--wash); }
#composer, #team-composer { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: .8rem; padding: .65rem .75rem; box-shadow: 0 2px 8px #00000004; }
#composer { display: flex; align-items: flex-end; gap: .75rem; }
#composer:focus-within, #team-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
textarea { width: 100%; resize: none; border: 0; background: transparent; color: var(--ink); line-height: 1.65; max-height: 10rem; }
textarea::placeholder { color: var(--muted); }
#message-input, #team-input { padding: .25rem .15rem; display: block; min-height: 2rem; overflow-y: auto; }
#message-input:focus-visible, #team-input:focus-visible { outline: none; }
#send, #team-send { width: auto; min-width: 3.75rem; height: 2rem; flex-shrink: 0; padding: .3rem .85rem; border-radius: .5rem; font-size: .8125rem; }
.chat-status:empty { display: none; }
.chat-status { color: var(--muted); font-size: .6875rem; min-height: 1rem; margin: 0 .3rem .5rem; }
.footnote { font-size: .6875rem; color: var(--muted); margin: .65rem 0 0; text-align: center; }
.welcome { display: flex; min-height: 16rem; height: 100%; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.welcome h2 { color: var(--ink); font-size: 1.5rem; margin: 1.2rem 0 .2rem; letter-spacing: -.025em; }
.welcome p { font-size: .875rem; line-height: 1.9; }
.starters { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; margin-top: .8rem; }
.starters button { padding: .6rem .9rem; border: 1px solid var(--line); background: var(--paper); border-radius: .75rem; color: var(--ink); font-size: .8125rem; }
#team-workspace { display: grid; grid-template-columns: var(--list-width) minmax(0,1fr); }
.team-list { background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.team-list-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.1rem .65rem; }
.team-list-header h2 { font-size: 1rem; letter-spacing: -.015em; }
.search, .team-search { display: flex; align-items: center; gap: .5rem; background: var(--field); border: 1px solid transparent; border-radius: .6rem; padding: .5rem .65rem; color: var(--muted); }
.search:focus-within, .team-search:focus-within { border-color: var(--accent); }
.team-search .icon, .search .icon { width: 1rem; height: 1rem; }
.team-list > .team-search { margin: 0 1.15rem 1rem; background: var(--paper); }
.search { margin-bottom: 1rem; }
.search input, .team-search input { border: 0; width: 100%; min-width: 0; background: transparent; color: var(--ink); font-size: .8125rem; }
.search select { border: 0; flex: 1; min-width: 0; background: transparent; color: var(--ink); font: inherit; }
.search input:focus-visible, .team-search input:focus-visible { outline: none; }
#team-conversations { overflow: auto; flex: 1; padding: 0 .65rem; }
.conversation-item { display: flex; gap: .7rem; width: 100%; text-align: left; align-items: center; padding: .9rem .65rem; margin-bottom: .3rem; border: 0; border-radius: .8rem; background: transparent; }
.conversation-item.selected { background: var(--accent-soft); }
.conversation-copy { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.conversation-copy strong { font-size: .8125rem; font-weight: 550; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-preview { color: var(--muted); font-size: .75rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.team-list-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--line); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; color: var(--muted); }
.team-heading { min-width: 0; flex: 1; }
.team-heading h1, #team-members { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#team-members { max-width: 32rem; }
#team-list-open, .mobile-list-close { display: none; }
.team-panel .messages { padding-inline: 1.75rem; }
.team-panel .composer-wrap { padding-inline: 1.75rem; }
.team-panel .message { display: flex; align-items: flex-start; gap: .7rem; max-width: min(90%,44rem); }
.team-panel .message.user { flex-direction: row-reverse; }
.message-avatar { flex-shrink: 0; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: .7rem; background: var(--field); color: var(--muted); font-size: .625rem; margin-top: 1.5rem; }
.agent-avatar { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.message-content { min-width: 0; max-width: 100%; }
.message-evidence { color: var(--muted); font-size: .6875rem; margin-top: .55rem; }
.message-evidence summary { cursor: pointer; width: fit-content; }
.message-evidence button { margin: .4rem .35rem 0 0; font-size: .6875rem; }
.pending-reply { margin-top: 1.5rem; color: var(--muted); }
#team-composer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: .75rem; }
#team-compose-status { position: absolute; bottom: calc(100% + .4rem); left: .3rem; color: var(--muted); font-size: .6875rem; }
#team-input { min-height: 2rem; }
.composer-bottom { display: flex; align-items: center; }
#team-mention-choice, .team-avatar-menu {
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--paper);
  box-shadow: 0 6px 20px #22140e18;
  padding: .25rem;
}
#team-mention-choice {
  position: absolute;
  bottom: calc(100% + .45rem);
  left: 0;
  width: min(18rem, 100%);
  max-height: 14rem;
  overflow-y: auto;
}
.team-avatar-menu { position: fixed; }
.mentionable-avatar { cursor: context-menu; }
#team-mention-choice button, .team-avatar-menu button {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-align: start;
  width: 100%;
  min-height: 2.35rem;
  padding: .45rem .65rem;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
}
#team-mention-choice button[aria-selected="true"],
#team-mention-choice button:hover, .team-avatar-menu button:hover { background: var(--accent-soft); }
#team-mention-choice small { color: var(--muted); }
.team-list-actions { display: flex; gap: .25rem; align-items: center; }
#team-invites { position: relative; }
#team-invite-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 1rem;
  padding: .15rem .23rem;
  border-radius: 1rem;
  background: #bd343e;
  color: white;
  font-size: .65rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.inspector { display: flex; min-width: 0; flex-direction: column; background: var(--paper); border-left: 1px solid var(--line); overflow: auto; }
#personal-workspace > .inspector { display: none; }
.personal-memory-open #personal-workspace { grid-template-columns: var(--list-width) minmax(0,1fr) 23rem; }
.personal-memory-open #personal-workspace > .inspector { display: flex; }
.inspector-top { min-height: 4.25rem; padding: 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.tabs { display: flex; margin: 0 1rem .5rem; padding: .2rem; border-radius: .6rem; background: var(--field); }
.tabs button { flex: 1; border: 0; border-radius: .4rem; background: transparent; padding: .4rem .1rem; color: var(--muted); font-size: .75rem; }
.tabs button.active { color: var(--ink); background: var(--paper); box-shadow: 0 1px 3px #0001; }
.tabs span { font-size: .625rem; margin-left: .15rem; color: var(--muted); }
.tab-content { padding: 1rem; flex: 1; overflow: auto; }
.card-list { display: grid; gap: .7rem; }
.card { width: 100%; text-align: left; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); color: var(--ink); }
.card p { font-size: .8125rem; margin: .45rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.card .meta { margin-top: .6rem; font-size: .6875rem; color: var(--muted); }
.card-heading { display: flex; justify-content: space-between; gap: .5rem; }
.badge { font-size: .6875rem; color: var(--accent); background: var(--accent-soft); border-radius: .3rem; padding: .05rem .35rem; white-space: nowrap; }
.badge.ended { color: var(--muted); background: var(--field); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: .8125rem; }
.section-note, .memory-intro { color: var(--muted); font-size: .75rem; margin: 0 0 1rem; line-height: 1.7; }
.inspector-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .6875rem; }
.inspector-footer summary { cursor: pointer; }
.inspector-footer p { margin: .3rem 0; }
.live-dot { display: inline-block; height: .35rem; width: .35rem; background: var(--accent); border-radius: 50%; margin-right: .3rem; }
.memory-intro { padding: 0 1.25rem; }
#team-answer { display: none; }
.team-answer-text, .call-caption p { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-action { color: var(--muted); font-size: .6875rem; border: 0; border-radius: .3rem; background: transparent; padding: .25rem .4rem; }
.source-link { display: inline-block; color: var(--accent); margin: .35rem .5rem 0 0; font-size: .75rem; }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); border-radius: .85rem; padding: .8rem 1.2rem; z-index: 60; max-width: 88vw; box-shadow: var(--shadow); font-size: .8125rem; }
dialog { max-width: 42rem; width: calc(100vw - 3rem); max-height: 88dvh; overflow: auto; padding: 1.75rem; border: 1px solid var(--line); border-radius: 1.4rem; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
dialog::backdrop { background: #1018295c; backdrop-filter: blur(4px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.dialog-header h2 { font-size: 1.25rem; }
.dialog-header form { margin: 0; }
dialog pre { font: inherit; font-size: .875rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--wash); padding: 1rem; max-height: 52dvh; overflow: auto; border-radius: .75rem; }
#detail-links { display: flex; gap: .5rem; flex-wrap: wrap; }
#detail-links button { border: 0; background: var(--accent-soft); border-radius: .45rem; padding: .35rem .65rem; color: var(--accent); font-size: .75rem; }
.stack { display: grid; gap: 1rem; margin: .85rem 0; }
.stack label { display: block; font-size: .8125rem; }
.stack :is(textarea,select,input:not([type=checkbox])), .share-text { display: block; width: 100%; margin-top: .4rem; padding: .65rem .8rem; color: var(--ink); border: 1px solid var(--line); border-radius: .6rem; background: var(--wash); }
.share-text { min-height: 5rem; margin: .5rem 0; }
.voice-preset { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.voice-preset strong { margin-right: auto; }
#voice-settings, #voice-call { max-width: 34rem; }
#voice-preview { width: 100%; margin-top: .75rem; }
#voice-phase { margin: .85rem 0; }
#voice-clone summary { cursor: pointer; margin: 1rem 0; font-size: .8125rem; }
.call-caption { background: var(--wash); padding: 1.25rem; min-height: 8rem; border-radius: .85rem; }
#voice-user-caption { color: var(--muted); }
#voice-agent-caption { font-size: 1rem; }
#voice-hangup { background: var(--danger); color: var(--paper); }
.reader-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin: .85rem 0; }
#reader { max-width: 54rem; }
.reader-body { max-height: 60dvh; overflow: auto; padding: 1rem; background: var(--wash); border-radius: .75rem; }
.reading-block { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.reading-block p { white-space: pre-wrap; overflow-wrap: anywhere; }
.paragraph-question { border: 0; background: transparent; color: var(--accent); font-size: .75rem; padding: .25rem 0; }
.focus-card { border-color: var(--accent); }
.prepared-label { font-size: .75rem; color: var(--accent); margin-top: .85rem; }
.prepared-content { max-height: 12rem; overflow: auto; }
#app-settings { max-width: 30rem; }
.settings-profile { display: flex; align-items: center; gap: .85rem; padding: .5rem 0 1.5rem; }
.profile-avatar { width: 3rem; height: 3rem; border-radius: 1rem; color: var(--accent); background: var(--accent-soft); }
.settings-group { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.settings-group h3 { margin-bottom: .35rem; }
.theme-options { display: flex; gap: .5rem; }
.theme-options button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: .9rem .25rem; background: var(--wash); border: 1px solid var(--line); border-radius: .75rem; font-size: .75rem; }
.theme-options [aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.settings-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin: .7rem 0; font-size: .8125rem; }
.settings-row button { background: var(--field); white-space: normal; }
.privacy-note summary { cursor: pointer; font-size: .8125rem; }
.privacy-note p { color: var(--muted); font-size: .75rem; line-height: 1.8; }
.settings-logout { display: flex; justify-content: center; align-items: center; gap: .5rem; width: 100%; border: 0; background: var(--wash); padding: .75rem; border-radius: .65rem; font-size: .8125rem; }
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 40; background: var(--wash); padding: 1.5rem; overflow: auto; }
.login-card { width: 25rem; max-width: 100%; background: var(--paper); padding: 2.5rem; border: 1px solid var(--line); border-radius: 1.5rem; box-shadow: 0 12px 64px #172f5410; }
.login-card .mark { width: 3rem; height: 3rem; border-radius: 1rem; font-size: 1.75rem; }
.login-card .eyebrow { margin-top: 1.75rem; }
.login-card h1 { font-size: 1.8rem; margin: .6rem 0; letter-spacing: -.03em; }
.login-card .muted { font-size: .8125rem; }
.login-card label { display: block; margin: 1.75rem 0 .5rem; font-size: .8125rem; }
.login-card input { width: 100%; padding: .75rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--wash); color: var(--ink); }
.login-card .primary { width: 100%; margin-top: 1rem; }
#login-error { color: var(--danger); font-size: .75rem; min-height: 1rem; }
.drawer-backdrop { position: fixed; inset: var(--toolbar-height) 0 0; z-index: 20; border: 0; padding: 0; background: #1018295c; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.team-memory-open > .topbar, .team-memory-open #group-list, .team-memory-open .team-panel > .panel-header,
.team-memory-open #team-messages, .team-memory-open .team-panel > .composer-wrap { display: none; }
.team-memory-open #team-workspace { height: 100dvh; display: block; padding: .375rem; }
.team-memory-open .team-panel { height: 100%; }
.team-library { display: grid; grid-template-columns: 16rem minmax(0, 1fr); flex: 1; min-height: 0; padding: 0; overflow: hidden; background: var(--paper); }
.library-sidebar { display: flex; flex-direction: column; gap: 1.1rem; min-height: 0; padding: .85rem .75rem; background: var(--wash); border-right: 1px solid var(--line); }
.library-back { display: flex; gap: .5rem; align-items: center; align-self: flex-start; min-height: 2.5rem; padding: .35rem .65rem; border: 0; border-radius: .4rem; background: none; color: var(--muted); font-size: .8125rem; }
.library-back:hover { background: var(--hover); color: var(--ink); }
.library-space { display: flex; flex-direction: column; gap: .2rem; padding: 0 .65rem; }
.library-space strong { font-size: .9375rem; font-weight: 600; overflow-wrap: anywhere; }
.library-space > span { font-size: .75rem; color: var(--muted); }
.library-search { display: flex; align-items: center; gap: .5rem; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: .4rem; color: var(--muted); background: var(--paper); }
.library-search input { width: 100%; min-width: 0; border: 0; outline: none; color: var(--ink); background: transparent; font-size: .8125rem; }
.library-search:focus-within { border-color: var(--accent); }
.library-search .icon { width: .95rem; height: .95rem; }
#library-tree { flex: 1; min-height: 0; overflow: auto; font-size: .8125rem; }
.library-tree-folder { margin: .6rem 0; }
.library-tree-folder > summary { color: var(--muted); padding: .45rem .6rem; cursor: pointer; font-size: .75rem; }
.library-tree-page { display: block; text-align: left; width: 100%; padding: .55rem .7rem; border: 0; border-radius: .4rem; background: none; font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.library-tree-folder .library-tree-page { padding-left: 1.55rem; }
.library-tree-page:hover { background: var(--hover); }
.library-tree-page[aria-current=page] { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
#library-status { flex-shrink: 0; margin: 0; padding: .6rem; font-size: .6875rem; border-top: 1px solid var(--line); }
.library-reading { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.library-toolbar { display: flex; align-items: center; gap: .75rem; min-height: 3.5rem; padding: .7rem 2rem; border-bottom: 1px solid var(--line); }
#library-tree-toggle { display: none; }
#library-breadcrumb { display: flex; align-items: center; gap: .3rem; min-width: 0; flex-wrap: wrap; font-size: .75rem; }
.breadcrumb-item { border: 0; padding: .2rem 0; border-radius: .2rem; background: none; color: var(--muted); font-size: .75rem; }
.breadcrumb-item[aria-current=page], .breadcrumb-current { color: var(--ink); }
.breadcrumb-current { overflow-wrap: anywhere; }
.breadcrumb-separator { color: var(--muted); padding: 0 .15rem; }
.library-visibility { margin-left: auto; color: var(--muted); font-size: .6875rem; white-space: nowrap; }
.library-reading-body { display: flex; flex: 1; min-height: 0; }
#library-content { flex: 1; min-width: 0; overflow: auto; padding: 3rem max(2rem, calc((100% - 54rem) / 2)) 5rem; scroll-padding-top: 2rem; }
#library-content:focus { outline: none; }
#library-outline { flex: 0 0 11rem; padding: 3.3rem 1rem 1rem 0; overflow: auto; }
#library-outline:empty { display: none; }
.outline-label { display: block; padding: .4rem .65rem; color: var(--muted); font-size: .6875rem; }
.outline-item { display: block; width: 100%; text-align: left; border: 0; border-left: 1px solid var(--line); padding: .4rem .65rem; background: none; color: var(--muted); font-size: .75rem; }
.outline-item:hover { color: var(--accent); border-color: var(--accent); }
.folder-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; margin-top: 2rem; }
.folder-tile { display: flex; align-items: center; gap: .65rem; text-align: left; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .45rem; background: transparent; }
.folder-tile strong { font-size: .8125rem; font-weight: 550; }
.folder-tile .muted { display: none; }
.library-icon { display: inline-flex; color: var(--muted); flex-shrink: 0; }
.library-icon svg { width: 1rem; height: 1rem; }
.document-row { display: flex; gap: .8rem; align-items: center; width: 100%; text-align: left; padding: 1rem .4rem; border: 0; border-bottom: 1px solid var(--line); background: none; }
.document-copy { display: grid; gap: .35rem; flex: 1; min-width: 0; }
.document-copy strong { font-size: .875rem; font-weight: 550; }
.document-preview { color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.row-chevron { color: var(--muted); }
.wiki-document { max-width: 48rem; margin: 0 auto; }
.wiki-document > h2 { font-size: 1.75rem; }
.document-meta { color: var(--muted); font-size: .75rem; margin: 0 0 1.2rem; }
.wiki-prose { font-size: .9375rem; line-height: 1.95; overflow-wrap: anywhere; }
.wiki-prose h2 { font-size: 1.85rem; font-weight: 650; margin: .2rem 0 1.7rem; letter-spacing: -.025em; }
.wiki-prose h3 { font-size: 1.0625rem; margin: 2rem 0 .75rem; scroll-margin-top: 2rem; }
.wiki-prose p { margin: .9rem 0; white-space: pre-line; }
.wiki-prose ul { padding-left: 1.4rem; }
.wiki-prose li { margin: .45rem 0; }
.wiki-overview { max-width: 48rem; margin: 0 auto; }
.wiki-citation { display: inline; vertical-align: baseline; line-height: 1.5; margin-left: .5rem; padding: .1rem .35rem; border: 0; border-radius: .25rem; color: var(--accent); background: var(--accent-soft); font-size: .6875rem; white-space: nowrap; }
.wiki-link { display: inline; border: 0; padding: 0; background: none; color: var(--accent); text-align: left; line-height: inherit; }
.wiki-sources { margin-top: 2.8rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.wiki-sources > summary { cursor: pointer; color: var(--muted); font-size: .8125rem; }
.wiki-archive-link { display: block; padding: .65rem 0; margin-top: 1.25rem; background: none; border: 0; color: var(--muted); font-size: .8125rem; }
.history-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(40rem, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; padding: 1.25rem 1.5rem 2rem; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
.history-dialog .dialog-header { position: sticky; top: -1.25rem; padding: .5rem 0; background: var(--paper); z-index: 1; }
.history-intro { color: var(--muted); font-size: .8125rem; line-height: 1.7; margin: .25rem 0 1.5rem; }
.history-segment { margin-top: 1.25rem; border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; background: var(--paper); }
.history-date { padding: 1rem 1.15rem .25rem; font-size: .8125rem; font-weight: 550; }
.history-participants { color: var(--muted); font-size: .6875rem; padding: 0 1.15rem .8rem; margin: 0; }
.history-turn { margin: .4rem .85rem; padding: .4rem .8rem; border-left: 2px solid var(--line); }
.history-turn.cited { border-color: var(--accent); }
.history-speaker { margin: 0 0 .25rem; color: var(--muted); font-size: .6875rem; }
.history-text { margin: 0; font-size: .875rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.history-correction { margin: .5rem 0 0; color: var(--accent); background: var(--accent-soft); padding: .5rem .65rem; border-radius: .35rem; font-size: .8125rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .7rem 1.15rem; margin-top: .8rem; border-top: 1px solid var(--line); background: var(--wash); }
.source-action { border: 0; background: none; color: var(--accent); padding: .25rem 0; font-size: .75rem; }
.history-manage { font-size: .6875rem; color: var(--muted); max-width: 100%; }
.history-manage > summary { cursor: pointer; padding: .25rem 0; }
.history-memory { display: block; width: 100%; padding: .6rem 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: .75rem; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.source-highlight .bubble { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1100px) { #library-outline { display: none; } }
/* Desktop client frame: app navigation, conversation list, working area. */
.brand { display: flex; justify-content: flex-start; gap: .6rem; padding: 0 .5rem; min-height: 2.25rem; }
.brand strong { display: block; font-size: 1.0625rem; font-weight: 600; }
.mark { width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1rem; }
.workspace-nav { display: flex; flex-direction: column; align-items: stretch; width: 100%; gap: .25rem; padding: .875rem 0 0; background: none; border-radius: 0; }
.workspace-nav button { display: flex; flex-direction: row; justify-content: flex-start; gap: .65rem; min-height: 2.75rem; width: 100%; padding: .65rem .75rem; border-radius: .5rem; font-size: .875rem; font-weight: 400; background: none; color: var(--ink); }
.workspace-nav button.active { color: var(--ink); background: var(--paper); box-shadow: 0 2px 8px #51608505; font-weight: 500; }
.workspace-nav .icon { width: 1.25rem; height: 1.25rem; }
#personal-space [data-icon] { color: #446cce; }
#team-space [data-icon] { color: #227b70; }
:root[data-theme="dark"] #personal-space [data-icon] { color: #a6bfff; }
:root[data-theme="dark"] #team-space [data-icon] { color: #8ad2bf; }
.top-actions { margin-top: auto; display: flex; flex-direction: column; width: 100%; gap: .75rem; }
.account-button { display: flex; flex-direction: row; gap: .65rem; justify-content: flex-start; padding: .65rem .75rem; width: 100%; font-size: .875rem; border-radius: .5rem; }
#connection { font-size: .625rem; justify-content: center; }
.panel-header { min-height: 4.5rem; padding: .875rem 1.25rem; border: 0; border-bottom: 1px solid var(--line); background: var(--paper); }
.panel-header h1 { font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.panel-header .muted { font-size: .75rem; }
.toolbar-label, .subtle, .text-button, .menu-surface button { font-size: .875rem; }
.toolbar-label { min-height: 2.25rem; border-radius: .375rem; }
.primary, #send { border-radius: .375rem; font-size: .875rem; }
:root[data-theme="dark"] :is(.primary,#send,.mark) { color: #1a1d22; }
.primary:hover:not(:disabled), #send:hover:not(:disabled) { background: var(--accent); filter: brightness(.95); }
.team-list, .personal-list { background: var(--paper); border: 0; border-right: 1px solid var(--line); min-width: 0; position: relative; border-radius: 0; }
.team-panel, .conversation.panel { border-radius: 0; background: var(--paper); }
.team-list-header { min-height: 4.5rem; padding: .875rem 1rem; }
.team-list-header h2 { font-size: 1.0625rem; font-weight: 500; }
.team-list > .team-search { margin: 0 1rem .8rem; background: var(--field); padding: .5rem .65rem; border: 0; border-radius: .375rem; }
.team-search input, .search input { font-size: .875rem; }
#team-conversations { padding-inline: .5rem; }
.conversation-item { min-height: 4.875rem; padding: .875rem .75rem; margin: 0 0 .15rem; gap: .75rem; border-radius: .5rem; transition: transform 140ms ease,box-shadow 140ms ease; }
.conversation-copy { flex: 1; gap: .375rem; }
.conversation-title { display: flex; align-items: center; min-width: 0; gap: .75rem; }
.conversation-title strong { flex: 1; font-size: .9375rem; font-weight: 500; }
.conversation-date { flex-shrink: 0; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.conversation-preview { font-size: .75rem; }
.team-list-footer { border: 0; padding: .8rem 1rem; }
.personal-list { display: flex; flex-direction: column; overflow: auto; }
#session-options { padding: .25rem .5rem; flex: 1; overflow: auto; }
#session-options button { display: flex; gap: .75rem; align-items: center; width: 100%; min-height: 4.875rem; text-align: left; border: 0; padding: .875rem .75rem; margin-bottom: .15rem; background: none; color: var(--ink); border-radius: .5rem; font-size: .875rem; overflow-wrap: anywhere; }
#session-options button[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
#session-options button:hover { background: var(--hover); }
#personal-list-open { display: none; }
.messages { background: var(--paper); }
.message { width: fit-content; max-width: min(82%,42rem); margin-bottom: 1.25rem; position: relative; }
.message-label { font-size: .75rem; line-height: 1.4; margin: 0 0 .375rem; }
.bubble { width: fit-content; max-width: 100%; font-size: .9375rem; line-height: 1.65; border-radius: .875rem; padding: .625rem .875rem; }
.user .bubble { margin-left: auto; border-radius: .875rem .25rem .875rem .875rem; }
.assistant .bubble { border-top-left-radius: .25rem; }
.message-content { width: fit-content; }
.messages > .message:has(.chat-card) { width:min(82%,34rem); }
.team-panel .message:has(.chat-card) { width:min(90%,38rem); }
.message-avatar { width: 2rem; height: 2rem; border-radius: 50%; font-size: .75rem; }
.composer-wrap { background: var(--paper); }
#composer, #team-composer { padding: .75rem .85rem; border-radius: .625rem; box-shadow: none; background: var(--paper); }
#message-input, #team-input { font-size: .9375rem; min-height: 2.5rem; }
#send, #team-send { border-radius: .375rem; height: 2rem; min-width: 3.75rem; }
.chat-status { font-size: .75rem; }
.menu-surface { border: 0; border-radius: .5rem; background: var(--glass); backdrop-filter: none; }
.menu-surface button { border-radius: .3rem; }
.welcome h2 { font-size: 1.5rem; font-weight: 600; }
.welcome p { font-size: .9375rem; }
.inspector { border: 0; background: var(--paper); }
.inspector-top h2 { font-size: 1rem; }
.card { border: 0; border-radius: .5rem; background: var(--wash); }
.card h3 { font-size: .875rem; }
.card p { font-size: .875rem; line-height: 1.7; }
.card .meta, .badge, .tabs span { font-size: .75rem; }
.tabs button { font-size: .8125rem; }
.inspector-footer { border: 0; }
.eyebrow { display: none; }
.login-card { border: 0; border-radius: .875rem; padding: 2rem; box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.5rem; margin-top: 1.75rem; }
.login-card .muted, .login-card label { font-size: .875rem; line-height: 1.7; }
.login-card input, .login-card .primary { min-height: 2.5rem; border-radius: .375rem; }
dialog { border: 0; border-radius: .75rem; padding: 1.5rem; }
dialog::backdrop { backdrop-filter: none; }
.dialog-header h2 { font-size: 1.125rem; }
.settings-profile { padding-bottom: 1.25rem; }
.settings-group { border-top-color: var(--line); padding-block: 1.25rem; }
.settings-group h3, .settings-row { font-size: .875rem; }
.section-note, .privacy-note p { font-size: .8125rem; line-height: 1.75; }
.theme-options button { border-radius: .625rem; font-size: .8125rem; padding-block: .8rem; }
.stack :is(input,textarea,select) { font-size: .875rem; border-radius: .375rem; }
/* A document is a document: one readable column aligned near its directory. */
.team-memory-open #team-workspace { margin-left: 0; width: 100%; height: 100dvh; padding: .75rem; }
.team-memory-open .team-panel { background: transparent; border-radius: 0; }
.team-library { grid-template-columns: 15rem minmax(0,1fr); gap: .5rem; background: transparent; border: 0; border-radius: 0; }
.library-reading { background: var(--paper); border-radius: var(--pane-radius); overflow: hidden; }
.library-sidebar { padding: .5rem .75rem .75rem; gap: 1rem; background: var(--paper); border: 0; border-radius: var(--pane-radius); }
.library-back { min-height: 3rem; margin: 0; padding: .5rem .5rem; font-size: .8125rem; }
.library-space { padding: .1rem .5rem .25rem; gap: .35rem; }
.library-space strong { font-size: .9375rem; font-weight: 600; line-height: 1.5; }
.library-space > span { font-size: .75rem; }
.library-search { border: 0; background: var(--field); padding: .5rem .65rem; border-radius: .375rem; }
.library-search input { font-size: .8125rem; }
.team-search:focus-within, .library-search:focus-within, .search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.library-tree-folder { margin-block: .5rem; }
.library-tree-folder > summary { font-size: .75rem; padding: .5rem .5rem; }
.library-tree-page { font-size: .875rem; border-radius: .3rem; padding: .5rem .65rem; line-height: 1.5; }
.library-tree-folder .library-tree-page { padding-left: 1.5rem; }
#library-status { border: 0; padding: .5rem; font-size: .75rem; line-height: 1.7; }
.library-toolbar { min-height: 3rem; padding: .6rem 1.5rem; border: 0; }
#library-breadcrumb, .breadcrumb-item { font-size: .8125rem; }
.library-visibility { font-size: .75rem; }
#library-content { padding: 2rem 3rem 4rem; }
#library-content > * { max-width: 52rem; margin-inline: 0; }
.wiki-document, .wiki-overview { width: 100%; margin: 0; }
.wiki-prose { font-size: 1rem; line-height: 1.8; }
.wiki-prose h2, .wiki-document > h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: 0; margin: 0 0 1.5rem; }
.wiki-prose h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.75rem 0 .65rem; }
.wiki-prose p { margin: .85rem 0; }
.document-meta { font-size: .75rem; margin: 0 0 1.5rem; }
#library-outline { padding: 2rem 1rem; flex-basis: 11rem; }
.outline-label { font-size: .75rem; padding-left: .65rem; }
.outline-item { font-size: .75rem; border: 0; padding-block: .45rem; }
.folder-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 1.5rem; margin-top: 1.75rem; }
.library-home-folder { min-width: 0; }
.folder-tile { display: flex; gap: .65rem; width: 100%; padding: .5rem 0 .65rem; border: 0; border-radius: 0; background: none; }
.folder-tile strong { font-size: .9375rem; font-weight: 550; }
.folder-tile .muted { display: block; margin: 0 0 0 auto; padding-right: .5rem; font-size: .75rem; }
.folder-tile .library-icon { align-self: center; }
.library-home-page { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 2.25rem; border: 0; border-radius: .375rem; padding: .5rem .6rem; text-align: left; background: none; font-size: .875rem; }
.library-home-page:hover { background: var(--wash); }
.library-home-page .library-icon { color: var(--muted); }
.library-home-page .icon { width: 1rem; height: 1rem; }
.library-icon svg { width: 1.1rem; height: 1.1rem; }
.wiki-archive-link { margin-top: 1.5rem; font-size: .8125rem; }
.wiki-citation { vertical-align: baseline; font-size: .75rem; margin-left: .5rem; padding: 0; border-radius: 0; background: none; color: var(--accent); }
.wiki-citation:hover { text-decoration: underline; }
.wiki-sources { border: 0; padding-top: 0; margin-top: 2rem; }
.wiki-sources > summary { font-size: .8125rem; }
.history-dialog { border-radius: 0; width: min(42rem,100vw); }
.history-intro { font-size: .8125rem; line-height: 1.75; }
.history-segment { border: 0; border-radius: 0; margin-top: 1.5rem; }
.history-date { padding: .5rem 0; font-size: .8125rem; font-weight: 550; }
.history-participants { padding: 0 0 .75rem; font-size: .75rem; }
.history-turn { display: grid; grid-template-columns: 5rem minmax(0,1fr); gap: 1rem; margin: 0; padding: .65rem 0; border: 0; }
.history-speaker { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; font-size: .75rem; }
.history-speaker strong { color: var(--ink); font-weight: 500; }
.history-text { font-size: .9375rem; line-height: 1.75; }
.history-reference-label { color: var(--accent); font-size: .6875rem; }
.history-correction { grid-column: 2; margin: 0; font-size: .8125rem; }
.history-footer { border: 0; background: none; padding: .65rem 0; margin-top: .5rem; }
.source-action { font-size: .8125rem; }
/* The supplied client reference uses a soft frame around independent white panes. */
.workspace-search { display: flex; align-items: center; gap: .45rem; width: 100%; min-height: 2.5rem; margin-top: 1.125rem; padding: .55rem .6rem; border: 1px solid #dce3ef; border-radius: .5rem; background: #e5ebf5; color: #5f6c81; text-align: left; font-size: .8125rem; }
.workspace-search .icon { width: 1rem; height: 1rem; }
.workspace-search kbd { margin-left: auto; color: inherit; font: inherit; font-size: .625rem; white-space: nowrap; }
:root[data-theme="dark"] .workspace-search { background: #2a3548; border-color: #3b4960; color: #c1cce0; }
.conversation-avatar, .session-avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 2.625rem; height: 2.625rem; border-radius: 50%; font-size: 1rem; font-weight: 500; color: #fff; background: linear-gradient(145deg,#4973d1,#3159b7); }
[data-tone="0"] { --avatar-a: #4973d1; --avatar-b: #3159b7; }
[data-tone="1"] { --avatar-a: #bd5474; --avatar-b: #a94368; }
[data-tone="2"] { --avatar-a: #b3653e; --avatar-b: #98502d; }
[data-tone="3"] { --avatar-a: #8960bc; --avatar-b: #6c46a1; }
[data-tone="4"] { --avatar-a: #2b7d66; --avatar-b: #206950; }
[data-tone="5"] { --avatar-a: #287b91; --avatar-b: #1d6279; }
.conversation-avatar, .message-avatar[data-tone] { background: linear-gradient(145deg,var(--avatar-a,#4973d1),var(--avatar-b,#3159b7)); color: #fff; }
.team-header-avatar { display: inline-flex; flex-shrink: 0; }
.team-header-avatar .conversation-avatar { width: 2.375rem; height: 2.375rem; font-size: .9375rem; }
.agent-message .message-avatar { color: #fff; background: linear-gradient(145deg,#4e75d2,#5d60bc); }
.session-copy { display: flex; flex-direction: column; gap: .375rem; min-width: 0; }
.session-copy strong { font-size: .9375rem; font-weight: 500; }
.session-subtitle { color: var(--muted); font-size: .75rem; }
.conversation-item:hover { transform: translateX(1px); }
.conversation-item:active { transform: scale(.995); }
.primary:active:not(:disabled), #send:active:not(:disabled) { transform: scale(.97); }
.team-panel, .conversation.panel, .team-library { animation: pane-arrive 160ms cubic-bezier(.2,.7,.3,1); }
@keyframes pane-arrive { from { opacity: .85; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
/* Group identity and the creation/invitation flow use the same compact controls. */
.team-header-avatar { border: 0; padding: 0; background: none; border-radius: 50%; min-width: 2.375rem; }
.member-counts { display: inline-flex; align-items: center; gap: .8rem; margin: .2rem 0 0; padding: .15rem 0; border: 0; background: none; color: var(--muted); font-size: .75rem; }
.member-counts > span { display: inline-flex; align-items: center; gap: .3rem; }
.member-counts .icon { width: .875rem; height: .875rem; }
.team-header .toolbar { gap: .35rem; }
.team-header .toolbar .icon-button { min-width: 2.25rem; min-height: 2.25rem; }
.group-form-dialog, .invite-dialog, .members-dialog, .join-dialog { width: min(32rem,calc(100vw - 2rem)); padding: 1.5rem; }
.group-form label, .form-field, .invite-by-id label { display: flex; flex-direction: column; gap: .5rem; color: var(--ink); font-size: .875rem; }
.group-form input, .group-form textarea, .type-picker-button, .invite-by-id input { border: 1px solid var(--line); background: var(--paper); min-height: 2.75rem; padding: .65rem .75rem; border-radius: .5rem; color: var(--ink); }
.group-form textarea { min-height: 4.25rem; resize: vertical; }
.form-hint { color: var(--muted); font-size: .8125rem; line-height: 1.65; margin: 0; }
.form-error { color: var(--danger); font-size: .8125rem; margin: 0; }
.form-error:empty { display: none; }
.dialog-actions { display: flex; gap: .65rem; justify-content: flex-end; padding-top: .25rem; }
.type-picker { position: relative; }
.type-picker-button { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; }
.type-picker-button .icon { width: 1rem; height: 1rem; color: var(--muted); }
.type-options { position: absolute; z-index: 4; top: calc(100% + .3rem); left: 0; right: 0; max-height: 15rem; overflow-y: auto; padding: .35rem; background: var(--glass); border-radius: .5rem; box-shadow: var(--shadow); }
.type-option { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 2.25rem; padding: .45rem .65rem; border: 0; border-radius: .3rem; background: none; color: var(--ink); text-align: left; }
.type-option .icon { width: 1rem; height: 1rem; opacity: 0; }
.type-option[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.type-option[aria-selected="true"] .icon { opacity: 1; }
.type-option:hover, .type-option:focus { background: var(--hover); }
.invite-team-name { text-align: center; font-size: 1rem; font-weight: 550; margin: 0 0 .5rem; }
.invite-share { display: flex; align-items: center; flex-direction: column; gap: .6rem; padding: .75rem 0 1rem; text-align: center; }
.invite-qr { width: 10.25rem; height: 10.25rem; border-radius: .5rem; background: #fff; }
.invite-code { font: 550 1rem ui-monospace,monospace; letter-spacing: .06em; }
.invite-link { width: 100%; min-height: 2.75rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--paper); color: var(--ink); font-size: .8125rem; }
.team-list-header .toolbar-menu > summary { min-width: 2.75rem; min-height: 2.75rem; }
.invite-share-actions { display: flex; gap: .25rem; justify-content: center; flex-wrap: wrap; }
.invite-by-id { border-top: 1px solid var(--line); padding-top: 1rem; }
.invite-by-id .primary { justify-self: end; }
.member-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; }
.member-row .message-avatar { margin: 0; width: 2.25rem; height: 2.25rem; }
.member-copy { display: flex; flex: 1; flex-direction: column; gap: .25rem; min-width: 0; }
.member-copy strong { font-size: .875rem; font-weight: 500; }
.member-copy .muted { overflow-wrap: anywhere; }
.member-role { color: var(--muted); font-size: .75rem; }
.members-list { margin: .75rem 0 1rem; }
.members-dialog > #team-dialog-content > .primary { display: block; margin-left: auto; }
.join-team-name { margin: 1rem 0; font-size: 1.125rem; }
.join-dialog .form-hint { margin-bottom: 1rem; }
.join-dialog .primary { margin-top: .5rem; }
@media (hover: hover) and (pointer: fine) {
  .folder-tile:hover, .document-row:hover, .account-button:hover, .icon-button:hover, .toolbar-label:hover, .toolbar-menu > summary:hover, .text-button:hover, .subtle:hover, .menu-surface button:hover:not(:disabled), .message-action:hover { background: var(--hover); }
  .primary:hover:not(:disabled), #send:hover:not(:disabled) { background: var(--accent); filter: brightness(.95); }
  .conversation-item:hover { background: var(--hover); }
  .conversation-item.selected:hover { background: var(--accent-soft); }
  .memory-row:hover, .source-link:hover { color: var(--accent); }
  .starters button:hover { border-color: var(--accent); }
}
@media (max-width: 1200px) {
  #personal-workspace > .inspector { position: fixed; top: var(--toolbar-height); right: 0; bottom: 0; width: min(24rem, 100vw); z-index: 25; box-shadow: -12px 0 48px #0002; }
  .personal-memory-open #personal-workspace { grid-template-columns: var(--list-width) minmax(0,1fr); }
}
@media (max-width: 760px) {
  :root { --toolbar-height: 3.5rem; --app-rail: 0rem; --list-width: 18rem; }
  .topbar { position: relative; inset: auto; width: 100%; height: var(--toolbar-height); display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; padding: .5rem .85rem; }
  .brand { justify-self: start; }
  .brand strong, #connection, .account-label, .workspace-search { display: none; }
  .mark { width: 1.875rem; height: 1.875rem; font-size: 1.1rem; }
  .workspace-nav { flex-direction: row; justify-content: center; align-items: center; width: auto; padding: 0; gap: .2rem; }
  .workspace-nav button { width: auto; min-height: 2.5rem; padding: .5rem .65rem; flex-direction: row; gap: .35rem; font-size: .8125rem; }
  .workspace-nav .icon { width: 1rem; height: 1rem; }
  .top-actions { width: auto; margin: 0; }
  .account-button { width: 2.5rem; height: 2.5rem; padding: .5rem; }
  main { margin: 0; padding: 0; column-gap: 0; width: 100%; height: calc(100dvh - var(--toolbar-height)); }
  #team-workspace, #personal-workspace, .personal-memory-open #personal-workspace { display: flex; }
  .team-panel, .conversation.panel { width: 100%; border-radius: 0; }
  #group-list, #personal-list { display: none; position: fixed; top: var(--toolbar-height); bottom: 0; left: 0; width: min(20rem,88vw); z-index: 25; box-shadow: 12px 0 48px #0002; }
  .team-list-open #group-list, .personal-list-open #personal-list { display: flex; }
  #team-list-open, #personal-list-open { display: inline-flex; }
  .mobile-list-close { display: flex; position: absolute; right: .7rem; top: .65rem; }
  .team-list-header { padding-right: 3.25rem; }
  .panel-header { padding: .75rem .875rem; gap: .5rem; min-height: 4.25rem; }
  .team-header-avatar .conversation-avatar { width: 1.875rem; height: 1.875rem; font-size: .8125rem; }
  .toolbar { gap: .1rem; }
  .toolbar-label { padding-inline: .5rem; }
  .toolbar .icon-button, .toolbar-label, .toolbar-menu > summary, #personal-list-open, #team-list-open { min-width: 2.75rem; min-height: 2.75rem; }
  #team-members, #session-title { font-size: .6875rem; }
  .team-panel .messages, .messages { padding: 1.25rem .9rem; }
  .message, .team-panel .message { max-width: 96%; gap: .5rem; }
  .message-avatar { width: 1.8rem; height: 1.8rem; }
  .bubble { font-size: .9375rem; padding: .65rem .8rem; }
  .composer-wrap, .team-panel .composer-wrap { padding: .65rem .85rem max(.85rem,env(safe-area-inset-bottom)); }
  #message-input, #team-input { font-size: 1rem; min-height: 2rem; }
  #send, #team-send { min-height: 2.5rem; height: auto; }
  .team-memory-open #team-workspace { height: 100dvh; display: block; padding: .375rem; }
  .team-library { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); gap: 0; background: var(--paper); border-radius: .625rem; }
  .library-reading { border-radius: 0; }
  .library-sidebar { display: contents; }
  .library-back { grid-row: 1; margin: .5rem .8rem; min-height: 2.75rem; }
  .library-space, .library-sidebar > .library-search, #library-tree, #library-status { display: none; }
  .library-reading { grid-row: 2; }
  .library-toolbar { min-height: 2.5rem; padding: .5rem 1.2rem; }
  #library-tree-toggle { display: block; position: fixed; top: .5rem; right: .8rem; z-index: 2; min-height: 2.75rem; background: var(--paper); }
  .library-visibility { display: none; }
  .tree-open .library-sidebar { display: flex; grid-row: 1 / 3; padding: .5rem .8rem .8rem; gap: .8rem; }
  .tree-open .library-space, .tree-open .library-sidebar > .library-search, .tree-open #library-tree, .tree-open #library-status { display: block; }
  .tree-open .library-sidebar > .library-search { display: flex; }
  .tree-open .library-back { margin: 0; }
  .tree-open .library-reading { display: none; }
  .library-tree-page { min-height: 2.75rem; }
  #library-content { padding: 1.5rem 1.2rem 4rem; }
  .wiki-prose h2, .wiki-document > h2 { font-size: 1.375rem; }
  .history-dialog { width: 100vw; padding: 1.25rem; border-radius: 0; }
  .history-turn { grid-template-columns: 4rem minmax(0,1fr); gap: .75rem; }
  .history-text { font-size: .9375rem; }
  .history-footer { gap: .6rem; }
  .source-action { min-height: 2.5rem; }
  dialog { padding: 1.25rem; width: calc(100vw - 1.5rem); border-radius: .75rem; }
  input, textarea, select, .search input, .team-search input { font-size: 1rem; }
  .login-card { padding: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-transparency: reduce) { .panel-header, .menu-surface { background: var(--paper); backdrop-filter: none; } dialog::backdrop { backdrop-filter: none; } }
@media (prefers-contrast: more) { :root { --muted: #505761; --line: #9299a3; } :root[data-theme="dark"] { --muted: #c8d0dc; --line: #8994a5; } .panel-header, .menu-surface { background: var(--paper); backdrop-filter: none; } }
@media (forced-colors: active) { button, .bubble, .conversation-item.selected, .workspace-nav button.active { border: 1px solid ButtonText; } }

@media (max-width: 600px) {
  .team-header { display: grid; grid-template-columns: auto auto minmax(0,1fr); row-gap: .25rem; }
  .team-header .team-heading { grid-column: 3; }
  .team-header > .toolbar { grid-column: 1 / -1; margin-left: auto; gap: .35rem; }
  .team-header .toolbar .icon-button { min-width: 2.75rem; min-height: 2.75rem; }
  .member-counts { margin-top: .1rem; }
  .group-form-dialog, .invite-dialog, .members-dialog, .join-dialog { padding: 1.25rem; }
}

.onboarding-card { width: min(25rem,calc(100vw - 2rem)); }
.onboarding-card h1 { line-height: 1.4; }
.onboarding-card > .muted { margin: .5rem 0 1.5rem; }
.onboarding-group { display: flex; flex-direction: column; gap: .45rem; padding: 1rem; margin-bottom: 1.25rem; border-radius: .625rem; background: var(--wash); overflow-wrap: anywhere; }
.onboarding-group strong { font-weight: 550; font-size: 1rem; }
.onboarding-card .subtle { display: block; margin: .4rem auto 0; white-space: normal; }
.onboarding-card #login-error:empty { display: none; }
.onboarding-card #login-error { margin: .75rem 0 0; line-height: 1.6; }
.onboarding-card .footnote { margin-top: 1.25rem; line-height: 1.6; }

/* Account continuity, a compact call stage and editable shared documents. */
.otp-row { display:flex; align-items:stretch; gap:.5rem; margin-top:.4rem; }
.otp-row input { min-width:0; flex:1; margin:0; }
.otp-row button { flex-shrink:0; white-space:nowrap; padding:.6rem .75rem; }
#phone-entry > label { display:block; margin-top:1rem; color:var(--muted); font-size:.8125rem; }
#phone-entry > input { width:100%; margin-top:.4rem; }
.nickname-option { margin:1rem 0; color:var(--muted); font-size:.8125rem; }
.nickname-option summary { cursor:pointer; }
.nickname-option input { width:100%; margin-top:.65rem; }
.auth-dialog { width:min(26rem,calc(100vw - 2rem)); }
.settings-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:1rem 0; }
#device-login-link { display:flex; align-items:center; gap:.5rem; }
#voice-call.call-dialog { width:min(40rem,calc(100vw - 2rem)); max-width:70rem; max-height:calc(100dvh - 2rem); padding:0; background:var(--paper); border-radius:1rem; overflow:hidden; }
.call-layout { display:grid; grid-template-columns:minmax(0,1fr); max-height:calc(100dvh - 2rem); }
.call-main { display:flex; flex-direction:column; min-height:0; min-width:0; overflow:auto; }
.call-topbar { padding:1.25rem 1.5rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-shrink:0; }
.call-topbar h2 { font-size:1rem; font-weight:600; line-height:1.5; }
.call-topbar p { display:flex; align-items:center; gap:.4rem; margin:.35rem 0 0; font-size:.75rem; }
.call-topbar p::before { content:''; width:.375rem; height:.375rem; border-radius:50%; background:#b58a44; }
[data-phase="connected"] .call-topbar p::before,[data-phase="speaking"] .call-topbar p::before { background:#388974; }
[data-phase="error"] .call-topbar p::before { background:var(--danger); }
#call-duration { align-self:flex-start; margin-top:.2rem; font-size:.75rem; font-variant-numeric:tabular-nums; color:var(--muted); }
.call-participants { display:grid; grid-template-columns:repeat(auto-fit,minmax(8rem,1fr)); justify-content:center; gap:1rem; padding:1.75rem 2.5rem; min-height:12rem; background:var(--wash); flex-shrink:0; }
.call-person { display:flex; align-items:center; justify-content:center; flex-direction:column; gap:.45rem; min-width:0; padding:.5rem; }
.call-person-avatar { display:grid; place-items:center; width:3.5rem; height:3.5rem; border-radius:50%; background:#e7edff; color:#4263b8; font-size:1.25rem; font-weight:600; }
.call-person-avatar[data-tone="1"],.call-person-avatar[data-tone="4"] { background:#e4f2ed; color:#356b59; }
.call-person-avatar[data-tone="2"],.call-person-avatar[data-tone="5"] { background:#f3eafa; color:#805093; }
.call-person[data-speaking="true"] .call-person-avatar { outline:2px solid var(--accent); outline-offset:4px; }
.call-person strong { margin-top:.3rem; font-size:.875rem; font-weight:550; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.call-person-state { font-size:.75rem; color:var(--muted); }
.call-captions { min-height:0; overflow:auto; padding:0 1.5rem; font-size:.8125rem; color:var(--muted); max-height:17rem; }
.call-captions > summary { display:flex; align-items:center; gap:.5rem; min-height:3.25rem; cursor:pointer; list-style:none; }
.call-captions > summary::-webkit-details-marker { display:none; }
.call-captions > summary .icon { width:1rem; height:1rem; }
.caption-chevron { margin-left:auto; transition:transform 140ms; }
.call-captions[open] .caption-chevron { transform:rotate(180deg); }
.call-captions .call-caption { min-height:0; max-height:none; padding:0; margin:0 0 .75rem; background:transparent; }
.call-caption-row { display:grid; grid-template-columns:2.5rem minmax(0,1fr); gap:.75rem; padding:.5rem 0; }
.call-caption-row:has(p:empty) { display:none; }
.caption-speaker { padding-top:.15rem; font-size:.75rem; color:var(--muted); }
.call-caption-row p { margin:0; font-size:.875rem; line-height:1.8; color:var(--ink); }
.call-caption:has(#voice-user-caption:empty):has(#voice-agent-caption:empty)::before { content:'说话后，对话会显示在这里'; display:block; padding:.5rem 0 .75rem; font-size:.8125rem; color:var(--muted); }
#voice-call-sources:empty { display:none; }
#voice-call-sources { padding:0 0 .75rem; }
#voice-call-sources > p { display:none; }
#voice-call-sources .source-action { display:flex; align-items:center; gap:.375rem; padding:.4rem .65rem; border-radius:.375rem; background:var(--accent-soft); font-size:.75rem; }
#voice-call-sources .source-action::before { content:''; width:.3rem; height:.3rem; border-radius:50%; background:currentColor; }
.call-controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:flex-start; gap:1rem; padding:1rem 1.5rem 1.25rem; background:var(--paper); flex-shrink:0; position:sticky; bottom:0; }
.call-control { display:flex; align-items:center; flex-direction:column; justify-content:flex-start; gap:.5rem; width:3.75rem; min-width:3.75rem; min-height:4.5rem; border:0; background:transparent; color:var(--muted); font-size:.75rem; padding:0; border-radius:.75rem; }
.call-control svg { box-sizing:content-box; width:1.25rem; height:1.25rem; padding:.75rem; border-radius:50%; background:var(--field); }
.call-control:hover:not(:disabled),.call-control:active:not(:disabled) { background:transparent; }
.call-control:hover:not(:disabled) svg { background:var(--hover); color:var(--ink); }
#voice-hangup.call-end { background:transparent; color:var(--danger); padding:0; margin-left:.5rem; }
#voice-hangup.call-end svg { background:#cc414f; color:#fff; }
#voice-hangup.call-end:hover svg { background:#b93242; }
.call-control[aria-pressed="true"] { background:transparent; color:var(--accent); }
.call-control[aria-pressed="true"] svg { background:var(--accent-soft); }
.call-evidence-open#voice-call { width:min(68rem,calc(100vw - 2rem)); }
.call-evidence-open .call-layout { grid-template-columns:minmax(0,1fr) minmax(20rem,.95fr); height:min(39rem,calc(100dvh - 2rem)); }
.call-evidence-open .call-main { justify-content:space-between; }
.call-evidence-open .call-captions { flex:1; }
.call-evidence { min-height:0; min-width:0; display:flex; flex-direction:column; background:var(--paper); border-left:1px solid var(--line); }
.call-evidence-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.25rem; }
.call-evidence-header h3 { font-size:.9375rem; font-weight:600; }
.call-evidence-header p { font-size:.75rem; color:var(--muted); margin:.25rem 0 0; }
#call-evidence-content { flex:1; min-height:0; overflow:auto; padding:0 1.25rem 1.25rem; overscroll-behavior:contain; }
.call-member-picker { display:flex; flex-direction:column; gap:.5rem; }
.call-pick-row { display:flex; align-items:center; gap:.875rem; padding:.5rem .75rem; border-radius:.625rem; background:var(--wash); cursor:pointer; }
.call-pick-row input { accent-color:var(--accent); width:1rem; height:1rem; }
.call-pick-row .call-person { flex-direction:row; justify-content:flex-start; padding:.25rem 0; gap:.75rem; }
.call-pick-row .call-person-avatar { width:2.25rem; height:2.25rem; font-size:1rem; }
.call-pick-row .call-person-state:empty { display:none; }
.call-member-picker > .primary { align-self:flex-end; margin-top:.5rem; }
.incoming-call { position:fixed; top:1.5rem; right:1.5rem; display:flex; align-items:center; gap:.75rem; background:var(--paper); color:var(--ink); padding:1rem; border-radius:1rem; box-shadow:var(--shadow); z-index:120; max-width:calc(100vw - 2rem); }
.incoming-call strong { font-size:.875rem; }
.incoming-call p { margin:.25rem 0 0; font-size:.75rem; color:var(--muted); }
.incoming-call-icon { width:2.5rem; height:2.5rem; border-radius:50%; background:var(--accent-soft); color:var(--accent); }
.document-tools { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:.5rem 0 1.5rem; }
.document-tools .document-meta { margin:0; }
.wiki-edit-button { display:flex; align-items:center; gap:.375rem; border:0; border-radius:.5rem; background:var(--accent-soft); color:var(--accent); padding:.4rem .625rem; font-size:.75rem; }
.wiki-edit-button .icon { width:.875rem; height:.875rem; }
.library-home-folder .folder-tile > .library-icon { color:#ba862e; }
.library-home-page > .library-icon, .document-row > .library-icon { color:#5e87d2; }
.library-home-folder:nth-child(3n+2) .folder-tile > .library-icon { color:#429780; }
.library-home-folder:nth-child(3n) .folder-tile > .library-icon { color:#9370bf; }
.library-tree-folder[open] > summary { color:var(--ink); font-weight:550; }
#team-dialog.wiki-edit-dialog { width:min(48rem,calc(100vw - 2rem)); max-width:48rem; }
.wiki-edit-form { display:flex; flex-direction:column; gap:1rem; }
.wiki-edit-form label { display:flex; flex-direction:column; gap:.5rem; color:var(--muted); font-size:.8125rem; }
.wiki-edit-form textarea { min-height:14rem; max-height:48vh; resize:vertical; line-height:1.8; color:var(--ink); }
.wiki-edit-actions { display:flex; align-items:center; justify-content:flex-end; gap:.5rem; }
@media(max-width:600px) {

 .incoming-call { right:1rem; top:1rem; gap:.5rem; flex-wrap:wrap; }
 .document-tools { align-items:flex-start; }
}
@media(prefers-reduced-motion:no-preference) { .incoming-call { animation:incoming-appear 180ms ease-out; } @keyframes incoming-appear { from{opacity:0;transform:translateY(-.5rem)}to{opacity:1;transform:translateY(0)} } }

/* Conversation sources share the same compact reading rhythm inside and outside a call. */
.history-dialog { inset: .75rem .75rem .75rem auto; width:min(35rem,calc(100vw - 1.5rem)); height:calc(100dvh - 1.5rem); max-height:calc(100dvh - 1.5rem); padding:1.25rem 1.5rem; border:0; border-radius:1rem; }
.history-dialog .dialog-header { top:-1.25rem; padding:1.25rem 0 .75rem; margin-top:-1.25rem; }
.history-dialog .dialog-header h2 { font-size:1rem; }
.history-intro { margin:0 0 1rem; font-size:.75rem; }
.history-segment { margin:0 0 1.5rem; }
.history-date { padding:.25rem 0; font-size:.75rem; font-weight:550; }
.history-participants { padding:0 0 .5rem; font-size:.6875rem; line-height:1.5; }
.history-turn { display:grid; grid-template-columns:1.75rem minmax(0,1fr); gap:.625rem; padding:.6rem 0; }
.history-avatar { display:grid; place-items:center; width:1.75rem; height:1.75rem; margin-top:.125rem; border-radius:50%; background:#e7edff; color:#4263b8; font-size:.75rem; }
.history-avatar[data-tone="1"],.history-avatar[data-tone="4"] { background:#e4f2ed; color:#356b59; }
.history-avatar[data-tone="2"],.history-avatar[data-tone="5"] { background:#f3eafa; color:#805093; }
.history-message { min-width:0; }
.history-speaker { flex-direction:row; align-items:baseline; flex-wrap:wrap; column-gap:.5rem; row-gap:.125rem; margin:0 0 .3rem; font-size:.6875rem; }
.history-speaker strong { font-size:.75rem; }
.history-reference-label { padding:.05rem .3rem; border-radius:.25rem; background:var(--accent-soft); color:var(--accent); font-size:.625rem; }
.history-text { font-size:.875rem; line-height:1.75; }
.history-footer { gap:.5rem; padding:.35rem 0 0 2.375rem; margin:0; }
.history-footer .source-action { font-size:.75rem; }
.history-correction { font-size:.75rem; }
:root[data-theme="dark"] .call-person-avatar,:root[data-theme="dark"] .history-avatar { background:#334965; color:#c6d7ff; }
:root[data-theme="dark"] [data-tone="1"].call-person-avatar,:root[data-theme="dark"] [data-tone="4"].call-person-avatar,:root[data-theme="dark"] [data-tone="1"].history-avatar,:root[data-theme="dark"] [data-tone="4"].history-avatar { background:#284a46; color:#bce6d5; }
:root[data-theme="dark"] [data-tone="2"].call-person-avatar,:root[data-theme="dark"] [data-tone="5"].call-person-avatar,:root[data-theme="dark"] [data-tone="2"].history-avatar,:root[data-theme="dark"] [data-tone="5"].history-avatar { background:#463b59; color:#e0c9f4; }
@media(max-width:700px) {
 #voice-call.call-dialog { width:calc(100vw - 1.5rem); max-height:calc(100dvh - 1.5rem); }
 .call-layout { max-height:calc(100dvh - 1.5rem); }
 .call-topbar { padding:1rem 1.25rem; }
 .call-participants { padding:1.5rem 1rem; grid-template-columns:repeat(2,minmax(0,1fr)); min-height:11rem; }
 .call-controls { gap:.5rem; padding:.875rem 1rem 1rem; }
 .call-captions { padding:0 1.25rem; }
 .call-evidence-open .call-layout { display:flex; flex-direction:column; height:min(43rem,calc(100dvh - 1.5rem)); }
 .call-evidence-open .call-main { display:contents; }
 .call-evidence-open .call-topbar { order:0; }
 .call-evidence-open .call-participants,.call-evidence-open .call-captions { display:none; }
 .call-evidence-open .call-evidence { order:1; flex:1; border:0; }
 .call-evidence-open .call-controls { order:2; }
 .call-evidence-header { padding:.75rem 1.25rem; }
 .history-dialog { padding:1rem 1.25rem; }
 .history-dialog .dialog-header { top:-1rem; margin-top:-1rem; padding:1rem 0 .75rem; }
}
@media(max-height:560px) { .call-participants { min-height:8rem; padding:1rem; } .call-topbar { padding:.75rem 1.25rem; } }

#voice-call-sources .source-action, .history-reference-label { color:#2e5fc8; }
:root[data-theme="dark"] #voice-call-sources .source-action, :root[data-theme="dark"] .history-reference-label { color:var(--accent); }

.caption-speaker { overflow-wrap:anywhere; line-height:1.6; }
.call-caption-row { grid-template-columns:minmax(4rem,7rem) minmax(0,1fr); }
#voice-call[data-mode="group"] #local-caption-row { display:none; }
#member-caption-status { font-size:.75rem; color:var(--muted); line-height:1.6; }
.call-caption:has(#member-captions:not(:empty))::before { display:none; }
@media(max-width:700px) { .call-caption-row { grid-template-columns:minmax(3.5rem,5rem) minmax(0,1fr); } }

#voice-call[data-mode="group"] .call-caption-row:has(#voice-agent-caption) { display:none; }
.voice-history-card { display:flex; align-items:center; gap:.75rem; width:min(22rem,100%); padding:.875rem 1rem; margin:.75rem auto; background:var(--paper); border:1px solid var(--line); border-radius:.75rem; text-align:left; }
.voice-history-card .icon { width:1.25rem; height:1.25rem; color:var(--accent); }
.voice-history-card .voice-history-copy { flex:1; min-width:0; }
.voice-history-copy strong { display:block; font-size:.875rem; font-weight:550; }
.voice-history-copy p { margin:.25rem 0 0; color:var(--muted); font-size:.75rem; }
.voice-history-card > span:last-child { color:var(--muted); font-size:.75rem; }

/* Chat expressions share the composer and message rhythm of the application. */
#personal-emoji,#team-emoji { width:2rem; height:2rem; padding:.3rem; flex:none; color:var(--muted); }
#team-composer .composer-bottom { gap:.5rem; }
.sticker-picker { position:fixed; z-index:100; width:21.5rem; max-width:calc(100vw - 1rem); padding:.75rem; background:var(--paper); border:1px solid var(--line); border-radius:.75rem; box-shadow:0 12px 40px #172a4b26; }
.sticker-tabs { display:flex; align-items:center; gap:.35rem; margin-bottom:.75rem; }
.sticker-tabs > button { padding:.4rem .65rem; border:0; background:transparent; color:var(--muted); font-size:.875rem; }
.sticker-tabs > button[aria-selected="true"] { color:var(--accent); background:var(--accent-soft); }
.sticker-tabs > button:last-child { margin-left:auto; padding:.35rem; }
.sticker-picker input[type="search"] { width:100%; height:2.25rem; padding:.4rem .65rem; border:1px solid var(--line); border-radius:.4rem; background:var(--field); font-size:.875rem; }
.sticker-picker input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.sticker-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:.25rem; height:15rem; overflow:auto; align-content:start; margin-top:.65rem; }
.sticker-grid:has(.sticker-option) { grid-template-columns:repeat(3,minmax(0,1fr)); gap:.4rem; }
.emoji-option,.sticker-option { border:0; background:transparent; padding:.25rem; min-width:0; }
.emoji-option { font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; font-size:1.5rem; line-height:1.5; }
.emoji-option:hover,.sticker-option:hover { background:var(--hover); }
.sticker-option img { display:block; width:100%; height:4.6rem; object-fit:contain; }
.sticker-option span { display:block; font-size:.75rem; color:var(--muted); margin-top:.25rem; }
.sticker-empty { grid-column:1/-1; padding:2rem 1rem; text-align:center; color:var(--muted); font-size:.875rem; }
.sticker-error { font-size:.8125rem; color:var(--danger); margin:.4rem 0 0; }
.sticker-upload { padding:1rem .25rem; display:grid; gap:1rem; }
.sticker-upload input { width:100%; margin-top:.5rem; }
.sticker-upload label { font-size:.875rem; }
.chat-sticker { display:grid; justify-items:center; gap:.2rem; width:10rem; padding:.25rem; margin:.5rem 0 0; background:none; border:0; color:var(--ink); }
.chat-sticker img { display:block; width:100%; height:10rem; object-fit:contain; }
.chat-sticker span { font-size:1.125rem; font-weight:650; line-height:1.5; }
.sticker-credit { display:block; max-width:20rem; margin:.35rem 0 .65rem; color:var(--muted); font-size:.6875rem; line-height:1.5; overflow-wrap:anywhere; }
.message.user.has-sticker .bubble { background:transparent; padding:0; }
.message.user.has-sticker .chat-sticker { margin:0; }
.sticker-message .bubble { background:transparent; padding:0; }
.sticker-message .chat-sticker { margin:0; }
.bubble.emoji-message { font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; font-size:2rem; background:transparent; padding:.25rem 0; }
#sticker-preview { width:min(28rem,calc(100vw - 2rem)); }
#sticker-preview > img { display:block; max-width:100%; max-height:60vh; margin:1rem auto; object-fit:contain; }
@media(max-width:700px) { .sticker-picker { width:calc(100vw - 1rem); } .sticker-grid { height:13rem; } }

/* Agent progress keeps the conversation compact and uses the existing palette. */
.agent-form-actions { display:flex; align-items:center; justify-content:flex-end; gap:.5rem; flex-wrap:wrap; }
.members-dialog .agent-form-actions button { min-height:44px; }
.agent-kind-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
.agent-kind-choice { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:.4rem .5rem; text-align:left; padding:.85rem; background:var(--field); border:1px solid transparent; border-radius:.5rem; }
.agent-kind-choice .muted { grid-column:1 / -1; font-size:.75rem; line-height:1.5; }
.agent-kind-choice[aria-pressed="true"] { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
.agent-kind-choice[aria-pressed="true"] .muted { color:inherit; }
.agent-connection-text { resize:vertical; width:100%; font-size:.8125rem; line-height:1.65; margin:.5rem 0 1rem; }
.agent-progress-card { width:min(34rem,100%); padding:1rem 1.15rem; border-radius:.75rem; background:var(--field); overflow-wrap:anywhere; }
.agent-progress-title { display:flex; align-items:center; gap:.45rem; margin-bottom:.7rem; color:var(--accent); font-size:.8125rem; }
.agent-progress-title .muted { margin-left:auto; font-size:.75rem; }
.agent-progress-section + .agent-progress-section { margin-top:.7rem; }
.agent-progress-section p { margin:0; white-space:pre-wrap; font-size:.9375rem; line-height:1.7; }
.agent-progress-label { display:block; margin-bottom:.15rem; font-size:.75rem; color:var(--muted); }
.agent-progress-card .text-button { margin-top:.7rem; font-size:.75rem; padding:0; }
.agent-progress-message .message-content { width:min(34rem,calc(100% - 3rem)); }
.agent-progress-message .message-avatar .icon, .member-row .message-avatar .icon { width:1.1rem; height:1.1rem; }
@media (max-width:600px) { .agent-kind-options { grid-template-columns:1fr; } .member-row { flex-wrap:wrap; } .member-row .member-copy { min-width:8rem; } }

/* Shared results are compact in chat and read as a document when opened. */
.shared-result-message .message-content {width:min(34rem,calc(100% - 3rem));}
.shared-result-card {display:grid;gap:.55rem;width:100%;padding:1rem 1.15rem;text-align:left;border:1px solid var(--line);background:var(--paper);border-radius:.75rem;color:var(--ink);}
.shared-result-card:hover {background:var(--field);}
.result-kind,.result-meta {font-size:.75rem;color:var(--muted);}
.shared-result-card strong {font-size:1rem;font-weight:600;}
.result-preview {display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:.875rem;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;}
.result-open {color:var(--accent);font-size:.8125rem;}
.shared-result-dialog {width:min(46rem,calc(100vw - 2rem));}
.shared-result-article {padding:1rem 0;line-height:1.8;overflow-wrap:anywhere;}
.shared-result-article p {white-space:pre-wrap;}
.shared-result-article h2,.shared-result-article h3 {margin:1rem 0 .5rem;}
.share-result-draft + .share-result-draft {margin-top:2rem;border-top:1px solid var(--line);padding-top:1.5rem;}
.meeting-dialog { width: min(58rem, calc(100vw - 2rem)); }
.meeting-dialog .meeting-heading { padding: .75rem 0 1.25rem; }
.meeting-title { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.meeting-meta, .meeting-count { color: var(--muted); font-size: .8125rem; line-height: 1.7; margin: 0; }
.meeting-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.75rem; }
.meeting-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .8rem .1rem; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: .875rem; }
.meeting-tab[aria-selected="true"] { color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
.meeting-tab:hover { color: var(--accent); background: transparent; }
.meeting-panel { max-width: 48rem; margin: 0 auto; padding-bottom: 1rem; }
.meeting-section { margin: 0 0 2rem; }
.meeting-section h4 { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; }
.meeting-item { margin: 0 0 1.35rem; }
.meeting-item h5 { margin: 0 0 .35rem; font-size: .9375rem; font-weight: 550; }
.meeting-item p { margin: 0; font-size: .9375rem; line-height: 1.85; overflow-wrap: anywhere; white-space: pre-wrap; }
.meeting-source { display: inline-block; margin-top: .4rem; padding: .15rem 0; border: 0; background: transparent; color: var(--accent); font-size: .75rem; }
.meeting-status { display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: 3rem 1rem; text-align: center; color: var(--muted); }
.meeting-status > .icon { width: 2rem; height: 2rem; color: var(--accent); }
.meeting-status p, .meeting-empty { font-size: .875rem; line-height: 1.8; }
.meeting-dialog .history-turn { border: 0; border-radius: .6rem; margin: .75rem 0; padding: .75rem; }
.meeting-dialog .meeting-highlight { background: var(--accent-soft); }
.meeting-timeline { margin: 0 0 2.5rem; }
.meeting-timeline > h4 { margin: 0 0 1.25rem; font-size: 1rem; font-weight: 600; }
.meeting-stage { display: grid; grid-template-columns: 7.5rem minmax(0,1fr); gap: 1rem; padding: 0 0 1.4rem; position: relative; }
.meeting-stage-time { align-self: start; border: 0; background: var(--accent-soft); color: var(--accent); padding: .35rem .5rem; font-size: .75rem; font-variant-numeric: tabular-nums; border-radius: .4rem; white-space: nowrap; }
.meeting-stage-content { min-width: 0; }
.meeting-stage-content h5 { font-size: .9375rem; font-weight: 600; margin: .25rem 0 .45rem; }
.meeting-stage-content p { font-size: .9375rem; line-height: 1.85; margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .meeting-dialog { inset: 0; width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .meeting-title { font-size: 1.25rem; }
  .meeting-tabs { gap: 1.25rem; }
  .meeting-stage { grid-template-columns: minmax(0,1fr); gap: .5rem; }
  .meeting-stage-time { justify-self: start; }
}

/* Conversation cards keep Feishu-like compact content and clear action states. */
.chat-card { --card-blue:#336cdb; --card-teal:#168275; width:min(100%,34rem); margin:.65rem 0 .2rem; border:1px solid var(--line); border-radius:12px; background:var(--paper); overflow:hidden; color:var(--ink); text-align:left; }
.chat-card-heading { display:flex; align-items:center; gap:.6rem; padding:.85rem 1rem; background:var(--wash); }
.card-heading-icon { display:grid; place-items:center; width:28px; height:28px; border-radius:7px; color:var(--card-blue); background:var(--accent-soft); flex-shrink:0; }
.card-heading-icon .icon { width:17px; height:17px; }
.chat-card h3 { margin:0; font-size:.9375rem; line-height:1.4; font-weight:600; flex:1; min-width:0; overflow-wrap:anywhere; }
.card-heading-meta { color:var(--muted); font-size:.75rem; white-space:nowrap; font-variant-numeric:tabular-nums; }
.chat-card-body { padding:.85rem 1rem .4rem; }
.card-chart-overview { display:flex; align-items:baseline; gap:.6rem; font-size:.75rem; color:var(--muted); margin:0 0 1rem; }
.card-chart-overview .card-number { font-size:1.25rem; color:var(--ink); }
.card-number { font-size:.875rem; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.card-unit-text { font-size:.6875rem; font-weight:400; color:var(--muted); margin-left:.3rem; }
.card-bars { padding-bottom:.65rem; }
.card-bar-row + .card-bar-row { margin-top:.9rem; }
.card-data-label { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; font-size:.8125rem; margin-bottom:.35rem; }
.card-bar-track { height:7px; border-radius:2px; background:var(--wash); overflow:hidden; }
.card-bar { display:block; height:100%; border-radius:inherit; }
.card-chart { display:block; width:100%; overflow:visible; }
.card-chart text { fill:var(--ink); font-family:inherit; }
.card-chart .card-total { font-size:25px; font-weight:600; font-variant-numeric:tabular-nums; }
.card-chart .card-unit { font-size:11px; fill:var(--muted); }
.card-donut-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); gap:1rem; align-items:center; padding:.4rem 0 .7rem; }
.card-donut-layout .card-chart { max-height:190px; }
.card-line-layout .card-chart { max-height:200px; }
.card-point-label { font-size:12px; font-variant-numeric:tabular-nums; }
.card-chart .card-axis-label { font-size:11px; fill:var(--muted); }
.card-legend { display:grid; gap:.7rem; list-style:none; padding:0; margin:0; font-size:.8125rem; }
.card-line-layout .card-legend { grid-template-columns:repeat(2,minmax(0,1fr)); padding-bottom:.75rem; }
.card-legend li { display:flex; gap:.5rem; align-items:center; min-width:0; }
.card-legend-label { flex:1; overflow-wrap:anywhere; }
.card-color { width:8px; height:8px; border-radius:2px; flex-shrink:0; }
.card-data-source { border-top:1px solid var(--line); padding:.6rem 0; font-size:.75rem; color:var(--muted); margin-top:.35rem; }
.card-data-source summary, .card-more-items summary { display:flex; align-items:center; gap:.3rem; cursor:pointer; list-style:none; min-height:28px; }
.card-data-source summary::-webkit-details-marker, .card-more-items summary::-webkit-details-marker { display:none; }
.card-data-source summary .icon, .card-more-items summary .icon { width:14px; height:14px; transition:transform 160ms ease; }
.card-data-source[open] summary .icon, .card-more-items[open] summary .icon { transform:rotate(180deg); }
.card-data-source p { margin:.5rem 0 0; overflow-wrap:anywhere; }
.card-option { display:flex; align-items:flex-start; gap:.65rem; width:100%; padding:.8rem .6rem; text-align:left; background:transparent; border:0; border-radius:6px; cursor:pointer; color:var(--ink); transition:background-color 160ms ease; }
.card-option + .card-option { border-top:1px solid var(--line); border-top-left-radius:0; border-top-right-radius:0; }
.card-option:hover { background:var(--wash); }
.card-option[aria-pressed="true"] { background:var(--accent-soft); }
.card-option[aria-pressed="true"] + .card-option { border-top-color:transparent; }
.card-radio { width:16px; height:16px; border:1px solid var(--muted); border-radius:50%; flex-shrink:0; margin-top:2px; display:grid; place-items:center; }
.card-option[aria-pressed="true"] .card-radio { border-color:var(--accent); }
.card-option[aria-pressed="true"] .card-radio::after { content:''; width:8px; height:8px; border-radius:50%; background:var(--accent); }
.card-option-copy { display:grid; gap:.2rem; min-width:0; overflow-wrap:anywhere; }
.card-option-copy strong { font-size:.875rem; line-height:1.5; font-weight:500; }
.card-option-copy span, .card-option-copy small { color:var(--muted); font-size:.75rem; line-height:1.5; }
.card-option-copy .card-picked { color:var(--card-teal); }
.card-option input { width:16px; height:16px; flex-shrink:0; margin:.2rem 0 0; accent-color:var(--card-blue); }
.card-option:has(input:checked) strong { text-decoration:line-through; color:var(--muted); }
.card-more-items { color:var(--muted); font-size:.75rem; }
.card-more-items summary { padding:.3rem .6rem .6rem; color:var(--accent); }
.card-status { min-height:0; margin:.35rem .6rem .5rem; font-size:.75rem; color:var(--muted); }
.card-status:empty { display:none; }
.card-places { padding-top:.1rem; }
.card-place { display:flex; align-items:center; gap:.65rem; padding:.95rem .1rem; }
.card-place + .card-place { border-top:1px solid var(--line); }
.card-place-icon { width:30px; height:34px; display:grid; place-items:center; flex-shrink:0; border-radius:7px; background:var(--wash); color:var(--card-teal); }
.card-place-icon .icon { width:17px; height:17px; }
.card-place-copy { flex:1; min-width:0; }
.card-place strong { font-size:.875rem; font-weight:500; }
.card-place p { margin:.25rem 0 0; font-size:.75rem; line-height:1.5; color:var(--muted); overflow-wrap:anywhere; }
.card-map-link { flex-shrink:0; display:inline-flex; align-items:center; gap:.25rem; font-size:.75rem; text-decoration:none; padding:.45rem .5rem; border-radius:5px; background:var(--accent-soft); }
.card-map-link .icon { width:13px; height:13px; transform:rotate(45deg); }
.card-map-link:hover { filter:brightness(.95); }
.message-content:has(> .chat-card) { width:100%; }
:root[data-theme="dark"] .chat-card { --card-blue:#a6bfff; --card-teal:#7ed3c5; }
@media(max-width:600px) { .chat-card-heading { padding:.7rem .8rem; }.chat-card-body { padding:.7rem .8rem .25rem; }.card-heading-meta { font-size:.6875rem; }.card-place { flex-wrap:wrap; }.card-place-copy { flex-basis:calc(100% - 3rem); }.card-map-link { margin-left:2.5rem; min-height:44px; }.card-more-items summary, .card-data-source summary { min-height:44px; }.card-donut-layout { gap:.7rem; grid-template-columns:1fr 1fr; }.card-legend li { flex-wrap:wrap; }.card-line-layout .card-legend { grid-template-columns:1fr; } }
@media(prefers-reduced-motion:reduce) { .chat-card *, .chat-card *::after { transition:none!important; } }

/* Group tasks use the existing compact, neutral product surfaces. */
.team-panel { position:relative; }
.todo-count { min-width:15px; height:15px; line-height:15px; border-radius:8px; font-size:10px; color:var(--accent); background:var(--accent-soft); margin-left:-5px; }
.todo-panel { position:absolute; z-index:24; inset:0 0 0 auto; width:min(420px,100%); background:var(--paper); border-left:1px solid var(--line); display:flex; flex-direction:column; box-shadow:-12px 0 30px #24334d0d; }
.todo-panel-header { display:flex; align-items:center; justify-content:space-between; padding:1rem 1.1rem; border-bottom:1px solid var(--line); }
.todo-panel-header h2 { margin:0; font-size:1rem; font-weight:600; }
.todo-panel-header p { margin:.2rem 0 0; color:var(--muted); font-size:.75rem; }
.todo-panel-body { min-height:0; flex:1; overflow:auto; padding:.9rem 1.1rem; }
.todo-section { margin-bottom:1.5rem; }
.todo-section h3 { margin:0 0 .5rem; font-size:.8125rem; color:var(--muted); font-weight:500; }
.todo-row { display:flex; align-items:flex-start; gap:.65rem; padding:.85rem 0; border-bottom:1px solid var(--line); }
.todo-copy { min-width:0; flex:1; }
.todo-copy > strong { font-size:.875rem; font-weight:500; line-height:1.55; overflow-wrap:anywhere; }
.todo-meta { margin:.25rem 0 0; font-size:.75rem; color:var(--muted); }
.todo-actions { display:flex; gap:.7rem; align-items:center; flex-wrap:wrap; margin-top:.5rem; }
.todo-actions:empty { display:none; }
.todo-claim { background:var(--accent-soft); color:var(--accent); border:0; padding:.3rem .65rem; border-radius:5px; font-size:.75rem; }
.todo-complete { display:grid; place-items:center; width:20px; height:20px; padding:0; border:1px solid var(--muted); border-radius:5px; background:var(--paper); color:transparent; margin-top:.13rem; flex-shrink:0; }
.todo-complete:hover, .todo-complete:focus-visible { color:var(--accent); border-color:var(--accent); background:var(--accent-soft); }
.todo-complete .icon { width:14px; height:14px; }
.todo-source, .todo-remind { color:var(--muted); font-size:.75rem; }
.todo-source { margin-top:.45rem; }
.todo-source summary, .todo-remind summary, .todo-ended summary { cursor:pointer; }
.todo-source p { margin:.35rem 0 0; line-height:1.6; }
.todo-source-person { display:block; font-size:.6875rem; margin:.6rem 0 .15rem; }
.todo-time-form { display:flex; align-items:center; gap:.4rem; padding:.5rem 0; }
.todo-time-form input { min-width:0; width:12rem; background:var(--field); color:var(--ink); border:1px solid var(--line); border-radius:4px; padding:.35rem; }
.todo-add { padding:.85rem 1.1rem; border-top:1px solid var(--line); display:flex; gap:.4rem; flex-wrap:wrap; }
.todo-add input { flex:1; min-width:0; background:var(--field); border:1px solid var(--line); color:var(--ink); padding:.6rem; border-radius:6px; font-size:.8125rem; }
.todo-add p { flex-basis:100%; font-size:.75rem; color:var(--danger); margin:0; }
.todo-add p:empty { display:none; }
.todo-empty { color:var(--muted); font-size:.8125rem; margin:.7rem 0; }
.todo-ended { color:var(--muted); font-size:.8125rem; }
.todo-done-mark { color:var(--muted); width:20px; margin-top:.1rem; }
.todo-done-mark .icon { width:18px; height:18px; }
.todo-personal { padding:1rem; border-bottom:0; }
.team-memory-open .todo-panel { display:none; }
@media(max-width:600px) { .todo-panel { width:100%; border:0; }.todo-complete { width:44px; height:44px; border:0; background:transparent; margin:-8px -6px 0 -8px; }.todo-complete .icon { width:22px; height:22px; padding:3px; border:1px solid var(--muted); border-radius:5px; }.todo-actions button,.todo-remind summary,.todo-source summary { min-height:44px; display:flex; align-items:center; }.todo-panel-body { padding-inline:1rem; } }

/* Chat pictures share the existing composer and message rhythm. */
.image-drafts { display:flex; gap:.75rem; padding:.25rem 0 .75rem; overflow-x:auto; }
.image-drafts[hidden] { display:none; }
.image-draft { position:relative; flex:0 0 5rem; height:5rem; border-radius:.5rem; background:var(--wash); }
.image-draft > img { width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.image-remove { position:absolute; top:-.25rem; right:-.25rem; width:2rem; height:2rem; padding:.4rem; display:grid; place-items:center; border-radius:50%; color:var(--ink); background:var(--paper); border:1px solid var(--line); }
.image-remove .icon { width:1rem; height:1rem; }
.image-draft-state { position:absolute; inset:auto 0 0; text-align:center; background:var(--paper); color:var(--muted); font-size:.75rem; padding:.15rem; }
.image-retry { position:absolute; top:1.5rem; left:.6rem; padding:.2rem .5rem; background:var(--paper); color:var(--accent); font-size:.75rem; }
.message-images { display:grid; grid-template-columns:minmax(0,1fr); gap:.4rem; max-width:22rem; margin-top:.4rem; }
.message-images[data-count="2"],.message-images[data-count="3"],.message-images[data-count="4"] { grid-template-columns:repeat(2,minmax(0,1fr)); }
.message-image { display:block; padding:0; border:0; border-radius:.5rem; overflow:hidden; background:var(--wash); max-width:100%; min-width:0; }
.message-image img { display:block; max-width:100%; width:auto; height:auto; max-height:18rem; object-fit:contain; margin:auto; }
.message-image:hover { filter:brightness(.96); }
.image-drop-target { outline:2px dashed var(--accent); outline-offset:3px; }
.image-viewer { width:min(72rem,96vw); max-width:96vw; height:90dvh; max-height:94dvh; padding:0; border:0; border-radius:.75rem; color:var(--ink); background:var(--paper); }
.image-viewer[open] { display:flex; flex-direction:column; }
.image-viewer-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.7rem 1rem; flex-shrink:0; }
.image-viewer-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.875rem; min-width:0; }
.image-viewer-actions { display:flex; align-items:center; flex-shrink:0; gap:.5rem; }
.image-viewer-actions .icon-button { min-width:2.75rem; min-height:2.75rem; }
.image-viewer-content { display:flex; align-items:center; justify-content:center; flex:1; min-height:0; overflow:auto; padding:1rem; background:var(--wash); }
.image-viewer-content > img { display:block; max-width:100%; max-height:100%; object-fit:contain; }
.image-viewer-full .image-viewer-content { display:block; }
.image-viewer-full .image-viewer-content > img { max-width:none; max-height:none; }
@media(max-width:760px) {
  .image-viewer-toolbar { padding:.5rem; flex-wrap:wrap; gap:.25rem; }
  .image-viewer-title { flex:1; }
  .image-viewer-actions { gap:.15rem; }
  .image-viewer-actions .subtle { padding:.4rem; font-size:.8125rem; }
  .message-images { max-width:70vw; }
  .image-remove { width:2.75rem; height:2.75rem; top:-.3rem; right:-.3rem; }
}
.image-draft-preview { display:block; width:100%; height:100%; padding:0; border:0; background:transparent; border-radius:inherit; overflow:hidden; }
.image-draft-preview img { display:block; width:100%; height:100%; object-fit:cover; }
.message-image, .image-viewer-content { position:relative; }
.image-loading { position:absolute; inset:0; display:grid; place-items:center; margin:0; background:var(--wash); color:var(--muted); font-size:.8125rem; pointer-events:none; }
@media(max-width:760px) {
  #team-composer { grid-template-columns:minmax(0,1fr); gap:.35rem; }
  #team-composer .composer-bottom { width:100%; justify-content:flex-start; }
  #team-send { margin-left:auto; }
  #composer { display:grid; grid-template-columns:auto auto 1fr auto; gap:.4rem; }
  #message-input { grid-column:1/-1; grid-row:1; width:100%; }
  #personal-image-add { grid-column:1; }
  #personal-emoji { grid-column:2; }
  #send { grid-column:4; }
}
.image-unavailable { display:block; padding:1.5rem 2rem; color:var(--muted); font-size:.8125rem; }
.message-image:disabled { opacity:1; }

#send.is-generating, #team-send.is-generating { display: inline-grid; place-items: center; }
.generation-stopped { display: block; color: var(--muted); font-size: .75rem; margin: .35rem .5rem; }
.message.is-stopped .bubble:empty { display: none; }

/* Message rhythm: content-sized conversation, with actions outside the reading flow. */
.messages { padding-top:24px; padding-bottom:32px; }
.message-action { position:absolute; top:100%; left:0; display:grid; place-items:center; width:28px; height:28px; padding:6px; opacity:0; transition:opacity 160ms ease; }
.user > .message-action { left:auto; right:0; }
.message-action .icon { width:16px; height:16px; }
.message:hover > .message-action, .message:focus-within > .message-action { opacity:1; }
.message:has(> .message-action) { margin-bottom:36px; }
.bubble.is-typing { min-width:64px; min-height:42px; display:flex; align-items:center; justify-content:center; }
.typing-dots { display:flex; align-items:center; gap:5px; height:20px; color:var(--muted); }
.typing-dots i { width:5px; height:5px; border-radius:50%; background:currentColor; animation:reply-dot 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay:150ms; }
.typing-dots i:nth-child(3) { animation-delay:300ms; }
@keyframes reply-dot { 0%,60%,100% { transform:translateY(0); opacity:.5; } 30% { transform:translateY(-3px); opacity:1; } }
@media(hover:none) { .message-action { opacity:1; width:44px; height:44px; }.message:has(> .message-action) { margin-bottom:48px; } }
@media(max-width:760px) {
  .messages { padding:20px 16px 24px; }
  .message-content { max-width:calc(100vw - 88px); }
}
.toolbar-action-name { display:none; }
.menu-surface .toolbar-action-name { display:inline; }
@media(prefers-reduced-motion:reduce) { .typing-dots i { animation:none; opacity:.7; }.message-action { transition:none; } }
