:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: #f7f1e9;
  color: #433936;
}

* { box-sizing: border-box; }

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(90% 31rem at 108% -8%, rgba(229, 180, 158, .34), transparent 64%),
    radial-gradient(72% 28rem at -18% 32%, rgba(214, 187, 202, .22), transparent 70%),
    linear-gradient(165deg, #fbf7f1, #f4ece3 74%);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
p { line-height: 1.55; }

.app-shell {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  width: min(100%, 46rem);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.app-header { padding: .2rem .05rem 0; }
.topbar, .identity, .space-persona-row, .persona-row { display: flex; align-items: center; }
.topbar { justify-content: space-between; }
.identity { gap: .68rem; }

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .92rem;
  box-shadow: 0 .55rem 1.4rem rgba(151, 92, 72, .18);
  object-fit: cover;
}

.identity-name, .presence, .persona-label, .persona-summary { margin: 0; }
.identity-name { color: #433633; font-size: 1rem; font-weight: 760; letter-spacing: -.02em; }
.presence {
  display: flex;
  align-items: center;
  gap: .32rem;
  margin-top: .13rem;
  color: #93827d;
  font-size: .7rem;
}

.presence i, .connection-badge i {
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: #b7a8a2;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .56rem;
  border: 1px solid rgba(137, 105, 94, .1);
  border-radius: 99rem;
  background: rgba(255, 252, 247, .68);
  box-shadow: 0 .3rem .9rem rgba(116, 83, 68, .05);
  color: #8d7d77;
  font-size: .68rem;
  font-weight: 680;
}

.space-switch {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .25rem;
  margin-top: 1.05rem;
  padding: .25rem;
  border: 1px solid rgba(135, 99, 87, .09);
  border-radius: .9rem;
  background: rgba(255, 252, 247, .68);
  box-shadow: 0 .45rem 1.5rem rgba(124, 87, 70, .05);
}

.space-persona-row {
  gap: .6rem;
  margin-top: 1.05rem;
}

.space-option {
  border: 0;
  border-radius: .67rem;
  background: transparent;
  color: #93827c;
  padding: .58rem .5rem;
  font-size: .82rem;
  font-weight: 700;
}

.space-option.is-active {
  background: #f1d9cd;
  box-shadow: inset 0 0 0 1px rgba(184, 119, 96, .08);
  color: #704c42;
}

.persona-row {
  gap: 1rem;
  margin-top: .5rem;
  padding: 0 .1rem;
}

.persona-label { color: #a08f89; font-size: .68rem; }
.persona-summary { margin-top: .09rem; color: #695955; font-size: .81rem; }
.persona-picker {
  flex: 0 0 auto;
  width: min(10.2rem, 38%);
}
.conversation-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .72rem;
  padding: 0 .1rem;
}
.conversation-actions button, .desktop-only, .back-link {
  border: 0;
  background: transparent;
  color: #a26b5b;
  font-size: .72rem;
  font-weight: 720;
  text-decoration: none;
}
.desktop-only { color: #8e7a73; }
.conversation-history {
  position: relative;
  margin-left: auto;
  color: #8e7a73;
  font-size: .72rem;
}
.conversation-history summary {
  cursor: pointer;
  list-style: none;
  font-weight: 720;
}
.conversation-history summary::-webkit-details-marker { display: none; }
.conversation-history summary::after { content: "⌄"; margin-left: .22rem; }
.conversation-history[open] summary::after { content: "⌃"; }
.conversation-list {
  position: absolute;
  z-index: 3;
  top: 1.45rem;
  right: 0;
  display: grid;
  gap: .2rem;
  width: min(15rem, 72vw);
  max-height: 14rem;
  overflow-y: auto;
  padding: .4rem;
  border: 1px solid rgba(145, 105, 89, .12);
  border-radius: .8rem;
  background: rgba(255, 251, 245, .97);
  box-shadow: 0 .8rem 1.8rem rgba(125, 88, 72, .14);
}
.conversation-list button {
  overflow: hidden;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: #76635c;
  padding: .5rem .55rem;
  font-size: .74rem;
  font-weight: 500;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-list button.is-current { background: #f5e1d7; color: #7d5146; font-weight: 720; }

.persona-picker select {
  padding: .5rem 1.8rem .5rem .65rem;
  border-radius: .66rem;
  background: rgba(255, 250, 244, .8);
  color: #76645f;
  font-size: .71rem;
}

select, input, textarea {
  width: 100%;
  padding: .74rem .82rem;
  border: 1px solid rgba(134, 98, 86, .13);
  border-radius: .9rem;
  background: rgba(255, 252, 247, .88);
  color: #443835;
}

input::placeholder, textarea::placeholder { color: #b09f98; }
input, textarea { font-size: 16px; }
.is-service-online .presence i, .is-connected .connection-badge i {
  background: #75ae87;
  box-shadow: 0 0 0 .22rem rgba(117, 174, 135, .11);
}
.is-service-online .presence, .is-connected .connection-badge { color: #658c70; }

.card {
  position: relative;
  overflow: hidden;
  padding: 1.3rem;
  border: 1px solid rgba(145, 105, 89, .1);
  border-radius: 1.35rem;
  background: rgba(255, 251, 245, .9);
  box-shadow: 0 1rem 2.8rem rgba(125, 88, 72, .09);
}

.install-hint {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .66rem .7rem;
  border: 1px solid rgba(145, 105, 89, .1);
  border-radius: 1rem;
  background: rgba(255, 251, 245, .82);
  box-shadow: 0 .7rem 1.7rem rgba(125, 88, 72, .07);
}
.install-hint p {
  flex: 1;
  margin: 0;
  color: #927c74;
  font-size: .72rem;
  line-height: 1.42;
}
.install-hint strong { color: #6c554e; font-size: .78rem; }
.install-icon {
  width: 2rem;
  height: 2rem;
  border-radius: .66rem;
  object-fit: cover;
}
.install-hint button {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #a8968f;
  font-size: 1.25rem;
  line-height: 1;
}

.card::after {
  position: absolute;
  top: -4rem;
  right: -3.5rem;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: rgba(226, 163, 137, .12);
  content: "";
  pointer-events: none;
}

.card > * { position: relative; }
.card h1 { margin: 0; color: #4d3e3a; font-size: 1.32rem; letter-spacing: -.035em; }
.card-kicker {
  margin: 0 0 .45rem !important;
  color: #b77561 !important;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .1em;
}
.card p { margin: .55rem 0 1.1rem; color: #88736c; }
.card form { display: flex; gap: .65rem; }
.card button, .composer button {
  border: 0;
  border-radius: .85rem;
  background: linear-gradient(135deg, #d99a80, #be7565);
  color: #fffaf6;
  padding: .78rem 1.05rem;
  box-shadow: 0 .5rem 1rem rgba(154, 87, 67, .18);
  font-weight: 700;
}
.error {
  min-height: 1.2rem;
  margin: .75rem 0 0 !important;
  color: #b65358 !important;
  font-size: .85rem;
}

.chat-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .75rem;
  min-height: 0;
}

.conversation-stamp {
  align-self: center;
  margin: .1rem 0 .25rem;
  padding: .22rem .58rem;
  border: 1px solid rgba(132, 98, 86, .08);
  border-radius: 99rem;
  background: rgba(255, 251, 246, .52);
  color: #a29089;
  font-size: .68rem;
  font-weight: 650;
}

.agent-inbox {
  display: grid;
  gap: .55rem;
  padding: .78rem;
  border: 1px solid rgba(146, 106, 90, .12);
  border-radius: .85rem;
  background: rgba(255, 251, 245, .88);
  box-shadow: 0 .55rem 1.4rem rgba(125, 88, 72, .07);
}
.agent-inbox.hidden { display: none; }
.agent-inbox-header,
.agent-inbox-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.agent-inbox-header h2 {
  margin: .08rem 0 0;
  color: #644b45;
  font-size: .88rem;
}
.agent-inbox-kicker {
  margin: 0;
  color: #b77561;
  font-size: .62rem;
  font-weight: 760;
  letter-spacing: .04em;
}
.agent-inbox-header button {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #a47768;
  font-size: 1.2rem;
}
.agent-inbox-items {
  display: grid;
  gap: .42rem;
  max-height: 15rem;
  overflow-y: auto;
}
.agent-inbox-item {
  display: grid;
  gap: .25rem;
  padding: .62rem .68rem;
  border: 1px solid rgba(146, 106, 90, .1);
  border-radius: .68rem;
  background: rgba(255, 255, 255, .55);
}
.agent-inbox-item strong {
  color: #6e554e;
  font-size: .72rem;
}
.agent-inbox-item time {
  color: #ac9992;
  font-size: .62rem;
}
.agent-inbox-item p {
  margin: 0;
  color: #7d6861;
  font-size: .78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.agent-inbox-item button {
  justify-self: start;
  padding: .34rem .6rem;
  border: 0;
  border-radius: .55rem;
  background: #efd0c2;
  color: #704d44;
  font-size: .68rem;
  font-weight: 720;
}

.agent-choice-ledger {
  display: grid;
  gap: .55rem;
  margin: .85rem 0 0;
  padding: .78rem;
  border-top: 1px solid rgba(146, 106, 90, .12);
}
.agent-choice-ledger.hidden { display: none; }
.agent-choice-ledger-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .75rem;
}
.agent-choice-ledger-header h2 {
  margin: .08rem 0 0;
  color: #644b45;
  font-size: .88rem;
}
.agent-choice-ledger-header small {
  max-width: 11rem;
  color: #a29089;
  font-size: .62rem;
  line-height: 1.35;
  text-align: right;
}
.agent-choice-ledger-list {
  display: grid;
  gap: .42rem;
}
.agent-choice-ledger-status {
  margin: 0;
  padding: .62rem .65rem;
  border: 1px dashed rgba(146, 106, 90, .14);
  border-radius: .68rem;
  color: #9b8982;
  font-size: .72rem;
  line-height: 1.45;
}
.agent-choice-ledger-status.hidden { display: none; }
.agent-choice-ledger-item {
  display: grid;
  gap: .25rem;
  padding: .58rem .64rem;
  border: 1px solid rgba(146, 106, 90, .1);
  border-radius: .68rem;
  background: rgba(255, 255, 255, .55);
}
.agent-choice-ledger-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.agent-choice-ledger-item time,
.agent-choice-ledger-item-header span {
  color: #ac9992;
  font-size: .62rem;
}
.agent-choice-ledger-item p {
  margin: 0;
  color: #7d6861;
  font-size: .76rem;
  line-height: 1.45;
}

.agent-interaction-feedback {
  display: inline-flex;
  align-items: center;
  gap: .34rem;
  margin-top: .12rem;
}
.agent-inbox-item .agent-interaction-feedback-button {
  display: inline-grid;
  place-items: center;
  width: 1.72rem;
  height: 1.72rem;
  min-width: 1.72rem;
  padding: 0;
  border: 1px solid #e5ddd5;
  border-radius: 50%;
  background: #fffdfa;
  color: inherit;
  font-size: .82rem;
  line-height: 1;
}
.agent-inbox-item .agent-interaction-feedback-button.is-selected {
  border-color: #7e8bd8;
  background: #eef0ff;
  box-shadow: 0 0 0 .14rem rgba(126, 139, 216, .12);
}
.agent-inbox-item .agent-interaction-feedback-button:disabled {
  cursor: wait;
  opacity: .55;
}

.agent-prompt-layer {
  position: fixed;
  z-index: 30;
  top: var(--app-viewport-top, 0);
  right: 0;
  left: 0;
  display: grid;
  height: var(--app-viewport-height, 100dvh);
  align-items: end;
  justify-items: center;
  padding:
    max(.75rem, env(safe-area-inset-top))
    max(.75rem, env(safe-area-inset-right))
    max(.65rem, env(safe-area-inset-bottom))
    max(.75rem, env(safe-area-inset-left));
}
.agent-prompt-layer.hidden { display: none; }
.agent-prompt-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(49, 43, 40, .3);
  backdrop-filter: blur(.3rem);
}
.agent-prompt-panel {
  position: relative;
  display: grid;
  width: min(100%, 30rem);
  max-height: min(38rem, calc(var(--app-viewport-height, 100dvh) - 1.4rem));
  gap: .8rem;
  overflow-y: auto;
  padding: 1.45rem 1.1rem 1rem;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 1.45rem;
  background: #fffaf5;
  box-shadow: 0 1.35rem 3.5rem rgba(66, 55, 49, .28);
  overscroll-behavior: contain;
  animation: agent-prompt-rise .24s cubic-bezier(.2, .8, .2, 1);
}
.agent-prompt-panel::before {
  position: absolute;
  top: .55rem;
  left: 50%;
  width: 2.25rem;
  height: .22rem;
  border-radius: 999px;
  background: #e5d6ca;
  content: "";
  transform: translateX(-50%);
}
.agent-prompt-header,
.agent-prompt-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.agent-prompt-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: .62rem;
}
.agent-prompt-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 2.85rem;
  height: 2.85rem;
  place-items: center;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #22242d;
  color: #e9c761;
  box-shadow: 0 .3rem .8rem rgba(63, 60, 56, .16);
  font-size: .85rem;
}
.agent-prompt-avatar img,
.agent-prompt-avatar span {
  width: 100%;
  height: 100%;
}
.agent-prompt-avatar img {
  object-fit: cover;
}
.agent-prompt-avatar span {
  display: grid;
  place-items: center;
}
.agent-prompt-avatar img.hidden,
.agent-prompt-avatar span.hidden { display: none; }
.agent-prompt-header h2 {
  margin: .12rem 0 0;
  color: #4f4945;
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: 0;
}
.agent-prompt-close {
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  padding: 0;
  border: 1px solid #e4ddd5;
  border-radius: 50%;
  background: #f7f3ee;
  color: #847a73;
  font-size: 1.1rem;
}
.agent-prompt-message {
  display: grid;
  gap: .48rem;
  padding: .95rem 1rem 1rem;
  border: 1px solid #f0e3d9;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 .35rem 1rem rgba(98, 74, 59, .06);
}
.agent-prompt-message strong {
  color: #65534c;
  font-size: .75rem;
}
.agent-prompt-message time {
  color: #a79d96;
  font-size: .64rem;
}
.agent-prompt-message > p {
  margin: 0;
  color: #71645e;
  font-size: .92rem;
  line-height: 1.62;
  white-space: pre-wrap;
}
.agent-prompt-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: .55rem;
}
.agent-prompt-form textarea {
  width: 100%;
  min-height: 3.2rem;
  max-height: 8rem;
  resize: none;
  padding: .72rem .78rem;
  border: 1px solid #ded7cf;
  border-radius: .72rem;
  outline: none;
  background: #fff;
  color: #514c48;
  font-size: .84rem;
  line-height: 1.45;
}
.agent-prompt-form textarea:focus {
  border-color: #8190dd;
  box-shadow: 0 0 0 .18rem rgba(98, 118, 212, .12);
}
.agent-prompt-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-width: 4.7rem;
  height: 3.2rem;
  padding: 0 .82rem;
  border: 0;
  border-radius: 999px;
  background: #d77d68;
  color: #fff;
  font-size: .78rem;
  font-weight: 760;
}
.agent-prompt-form button:disabled { opacity: .55; }
.agent-prompt-form button b { font-size: 1rem; }
.agent-prompt-status {
  min-height: 1rem;
  margin: -.18rem .1rem 0;
  color: #9a9089;
  font-size: .65rem;
}
@keyframes agent-prompt-rise {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.agent-playful-layer {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}
.agent-playful-layer.hidden { display: none; }
.agent-playful-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(57, 38, 34, .26);
  backdrop-filter: blur(.35rem);
}
.agent-playful-panel {
  position: relative;
  width: min(100%, 22rem);
  padding: 1.5rem 1.35rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 1.1rem;
  background: #fffaf3;
  box-shadow: 0 1.2rem 3rem rgba(66, 39, 31, .22);
  text-align: center;
}
.agent-playful-mark {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  margin: 0 auto .6rem;
  place-items: center;
  border-radius: 50%;
  background: #f2d6c7;
  color: #ad6658;
  font-size: 1.35rem;
}
.agent-playful-panel h2 {
  margin: .2rem 0 .55rem;
  color: #604741;
  font-size: 1.12rem;
}
.agent-playful-panel > p:not(.agent-inbox-kicker) {
  margin: 0;
  color: #806c65;
  font-size: .86rem;
  line-height: 1.55;
}
.agent-playful-close {
  margin-top: 1rem;
  padding: .68rem .9rem;
  border: 0;
  border-radius: .7rem;
  background: #c78270;
  color: #fffaf5;
  font-size: .78rem;
  font-weight: 720;
}

.messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .95rem;
  overflow-y: auto;
  padding: .25rem .15rem .5rem;
}

.message {
  max-width: min(84%, 30rem);
  padding: .8rem .95rem .82rem;
  border: 1px solid rgba(137, 100, 87, .08);
  border-radius: .35rem 1.1rem 1.1rem 1.1rem;
  background: rgba(255, 252, 247, .92);
  box-shadow: 0 .45rem 1.2rem rgba(122, 85, 69, .07);
}

.message.user {
  align-self: flex-end;
  border: 0;
  border-radius: 1.1rem .35rem 1.1rem 1.1rem;
  background: linear-gradient(140deg, #dda087, #c57d6c);
  box-shadow: 0 .55rem 1.2rem rgba(153, 88, 68, .15);
  color: #fffdf9;
}

.message.failed { border: 1px solid #cf7779; }
.message p {
  margin: 0;
  font-size: .96rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.composer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: .55rem;
  padding: .55rem;
  border: 1px solid rgba(138, 100, 87, .1);
  border-radius: 1.25rem;
  background: rgba(255, 251, 246, .88);
  box-shadow: 0 1rem 2.2rem rgba(120, 83, 68, .12);
  backdrop-filter: blur(1rem);
}

.composer-icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: .82rem;
  background: transparent;
  color: #9a6c5d;
  font-size: 1.25rem;
}
.composer-main { flex: 1; min-width: 0; }
.composer textarea {
  width: 100%;
  min-height: 2.75rem;
  max-height: 9rem;
  padding: .63rem .55rem;
  border: 0;
  background: transparent;
  resize: vertical;
}
.composer textarea:focus { outline: none; }
.composer button {
  display: grid;
  min-width: 3rem;
  min-height: 2.75rem;
  place-items: center;
  padding: .45rem .6rem;
  border-radius: .92rem;
  line-height: 1;
}
.composer button b { display: none; font-size: 1.25rem; font-weight: 500; }
.composer button:disabled { cursor: wait; opacity: .55; }
.attachment-preview {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: -.1rem .2rem .1rem;
  padding: .5rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .85rem;
  background: rgba(255, 251, 245, .72);
}
.attachment-preview img {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: .55rem;
  object-fit: cover;
}
.attachment-preview div { flex: 1; min-width: 0; }
.attachment-preview strong { color: #725c54; font-size: .74rem; }
.attachment-preview p { margin: .12rem 0 0; color: #a28d84; font-size: .66rem; line-height: 1.35; }
.attachment-preview button {
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #a58f87;
  font-size: 1.2rem;
  line-height: 1;
}
.voice-attachment-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .35rem .6rem;
  margin: -.1rem .2rem .1rem;
  padding: .5rem;
  border: 1px solid rgba(98, 118, 212, .18);
  border-radius: .85rem;
  background: rgba(247, 248, 255, .9);
}
.voice-attachment-preview audio {
  width: 100%;
  height: 2.1rem;
}
.voice-attachment-preview p {
  grid-column: 1;
  margin: 0;
  color: #77716c;
  font-size: .68rem;
}
.voice-attachment-preview button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8b837c;
  font-size: 1.2rem;
}
.recording-status {
  margin: -.05rem .45rem .15rem;
  color: #8a7068;
  font-size: .68rem;
  line-height: 1.25;
  text-align: center;
}
.record-button {
  width: 3.1rem;
  height: 3.1rem;
  min-width: 3.1rem;
  min-height: 3.1rem;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
}
.record-button span { color: #b55f5f; font-size: 1rem; }
.record-button.is-recording {
  background: #f6dddd;
  color: #a53f45;
}
.record-button.is-recording span { color: #a53f45; }
.record-button.is-canceling {
  background: #ecd7d7;
  color: #a53f45;
}
#chat-panel.voice-gesture-active,
#chat-panel.voice-gesture-active * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.voice-message-player {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 8.5rem;
  padding: .55rem .7rem;
  border-radius: .8rem;
  background: rgba(255, 255, 255, .48);
}
.voice-message-player button {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #735e57;
  font-size: .72rem;
}
.voice-message-player span {
  color: #756e69;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.hidden { display: none; }
[data-studio-page].hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 420px) {
  .app-shell { padding-inline: .85rem; }
  .persona-picker { max-width: 9.2rem; }
  #send-button span { display: none; }
  #send-button b { display: block; }
  .composer button { min-width: 2.8rem; }
}

.is-standalone {
  padding-top: max(.7rem, env(safe-area-inset-top));
}
.is-standalone .app-header { padding-top: .1rem; }

/* 聊天中只保留必要控件，避免像后台面板一样堆满状态信息。 */
.is-connected .presence,
.is-connected .connection-badge,
.is-connected .persona-label,
.is-connected .persona-summary {
  display: none;
}
.is-connected .app-shell { gap: .4rem; }
.is-connected .space-persona-row { gap: .5rem; margin-top: .35rem; }
.is-connected .space-switch {
  gap: .14rem;
  margin-top: 0;
  padding: .14rem;
  border-radius: .78rem;
}
.is-connected .space-option {
  padding: .4rem .45rem;
  border-radius: .58rem;
  font-size: .78rem;
}
.is-connected .persona-row {
  min-height: 0;
  margin-top: 0;
}
.is-connected .persona-picker select {
  padding: .38rem 1.65rem .38rem .6rem;
}
.is-connected .conversation-actions {
  min-height: 0;
  margin-top: .18rem;
}
.is-connected .conversation-space-hint { display: none; }
.is-connected .persona-picker { margin-left: auto; }
.is-connected .chat-panel { gap: .45rem; }
.is-connected .conversation-stamp {
  margin: .02rem 0 .08rem;
  padding: .16rem .48rem;
  font-size: .64rem;
}

.studio-shell {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "nav content";
  column-gap: 1.2rem;
  align-items: start;
  width: min(100%, 78rem);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1.6rem, env(safe-area-inset-top)) 1.25rem 3rem;
}
.studio-header {
  grid-area: header;
  width: 100%;
  margin: 0 0 1rem;
  padding: .3rem .25rem 1rem;
  border-bottom: 1px solid rgba(126, 119, 111, .14);
}
.studio-header h1 {
  margin: .35rem 0 .25rem;
  color: #4c3d39;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  letter-spacing: -.05em;
}
.studio-header > p:last-child { max-width: 34rem; margin: 0; color: #88756d; }
.studio-nav {
  position: sticky;
  grid-area: nav;
  top: 1rem;
  display: grid;
  gap: .42rem;
  padding: .55rem;
  border: 1px solid rgba(126, 119, 111, .13);
  border-radius: 1rem;
  background: rgba(255, 252, 247, .76);
  box-shadow: 0 .75rem 1.8rem rgba(61, 57, 53, .06);
  backdrop-filter: blur(1rem);
}
.studio-nav button {
  display: grid;
  gap: .18rem;
  width: 100%;
  padding: .72rem .75rem;
  border: 0;
  border-radius: .72rem;
  background: transparent;
  color: #776f69;
  text-align: left;
}
.studio-nav button strong { font-size: .8rem; }
.studio-nav button span {
  color: #9c958f;
  font-size: .65rem;
  line-height: 1.35;
}
.studio-nav button:hover { background: rgba(98, 118, 212, .07); }
.studio-nav button.is-active {
  background: #6276d4;
  color: #fff;
  box-shadow: 0 .45rem .9rem rgba(98, 118, 212, .2);
}
.studio-nav button.is-active span { color: rgba(255, 255, 255, .76); }
.studio-nav-badge {
  display: inline-grid;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: .22rem;
  padding: 0 .28rem;
  place-items: center;
  border-radius: 99rem;
  background: #b65358;
  color: #fff;
  font-size: .58rem;
  font-style: normal;
  line-height: 1;
  vertical-align: .08rem;
}
.studio-nav button.is-active .studio-nav-badge {
  background: #fff;
  color: #b65358;
}
.studio-nav-badge.hidden { display: none; }
.config-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.config-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .22rem .42rem;
  border-radius: 99rem;
  font-size: .63rem;
  font-weight: 720;
  line-height: 1.2;
  white-space: nowrap;
}
.config-status.active { background: #e4f0e4; color: #5e8168; }
.config-status.pending { background: #f7e9df; color: #a36a56; }
.config-status.local { background: #eee9e5; color: #7d716b; }
.studio-kicker, .section-kicker {
  margin: .85rem 0 .2rem;
  color: #b77864;
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .1em;
}
.studio-form {
  grid-area: content;
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}
.studio-form[data-memory-access="locked"] [data-memory-protected] { display: none; }
.studio-form[data-memory-access="unlocked"] #memory-access-panel { display: none; }
#studio-locked { grid-area: content; }
.studio-section {
  margin-bottom: .85rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(145, 105, 89, .1);
  border-radius: 1rem;
  background: rgba(255, 252, 247, .84);
  box-shadow: 0 .55rem 1.4rem rgba(61, 57, 53, .05);
}
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin: 0; color: #574542; font-size: 1.05rem; letter-spacing: -.02em; }
.section-heading .section-kicker { margin-top: 0; }
.section-copy { margin: .45rem 0 1rem; color: #957f76; font-size: .82rem; }
.memory-transfer-panel {
  padding: .9rem 1.15rem;
}
.memory-transfer-panel > summary {
  cursor: pointer;
  list-style: none;
}
.memory-transfer-panel > summary::-webkit-details-marker { display: none; }
.memory-transfer-summary::after {
  flex: 0 0 auto;
  align-self: center;
  color: #a08c83;
  content: "展开";
  font-size: .7rem;
  font-weight: 650;
}
.memory-transfer-panel[open] > summary::after { content: "收起"; }
.memory-transfer-summary > div:first-child { min-width: 0; }
.memory-transfer-summary h2 { font-size: .98rem; }
.memory-transfer-content { margin-top: .95rem; }
.memory-transfer-content > .section-copy { margin-top: 0; }
.field { display: block; margin-top: .85rem; }
.field > span {
  display: block;
  margin: 0 0 .35rem .1rem;
  color: #88736a;
  font-size: .74rem;
  font-weight: 680;
}
.field textarea { min-height: 5.2rem; resize: vertical; }
.field-limit {
  display: block;
  margin: .32rem .1rem 0;
  color: #a1938b;
  font-size: .64rem;
  line-height: 1.45;
}
.persona-long-field textarea {
  min-height: 8.5rem;
  line-height: 1.58;
}
.soft-button {
  flex: 0 0 auto;
  padding: .52rem .7rem;
  border: 1px solid rgba(178, 112, 91, .15);
  border-radius: .72rem;
  background: #fff8f3;
  color: #a16958;
  font-size: .74rem;
  font-weight: 720;
}
.memory-access-panel {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 42rem);
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: none;
  min-height: 19rem;
  align-content: center;
  margin-inline: 0;
  padding: 1.4rem;
}
.memory-access-panel.hidden { display: none; }
.memory-access-icon {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  place-items: center;
  border-radius: .9rem;
  background: rgba(98, 118, 212, .12);
  color: #6276d4;
  font-size: 1rem;
}
.memory-access-panel h2 {
  margin: 0;
  color: #4f4b48;
  font-size: 1.15rem;
}
.memory-access-panel .section-kicker { margin-top: 0; }
.memory-access-panel .section-copy { margin-bottom: .55rem; }
.memory-access-panel .field { max-width: 24rem; }
.memory-access-panel .field.hidden { display: none; }
.memory-access-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .85rem;
}
.memory-access-actions button {
  min-height: 2.5rem;
  padding: .65rem .9rem;
  border: 0;
  border-radius: .72rem;
  background: #6276d4;
  color: #fff;
  font-size: .78rem;
  font-weight: 740;
  box-shadow: 0 .4rem .85rem rgba(98, 118, 212, .2);
}
.memory-access-actions button:disabled { opacity: .62; cursor: wait; }
.memory-access-actions p {
  margin: 0;
  color: #b65358;
  font-size: .72rem;
}
.memory-access-note {
  max-width: 34rem;
  margin: .8rem 0 0;
  color: #9a938d;
  font-size: .68rem;
  line-height: 1.5;
}
.memory-protected-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .4rem;
}
.memory-lock-button {
  padding: .52rem .7rem;
  border: 1px solid rgba(182, 83, 88, .15);
  border-radius: .72rem;
  background: #fff7f6;
  color: #b65358;
  font-size: .72rem;
  font-weight: 720;
}
.persona-editor-list { display: grid; gap: .8rem; }
.persona-editor {
  padding: 1rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: 1rem;
  background: rgba(251, 239, 231, .48);
}
.persona-editor-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.persona-editor-heading { display: grid; gap: .28rem; min-width: 0; }
.persona-card-title { color: #68534c; font-size: .93rem; }
.persona-state {
  width: fit-content;
  padding: .18rem .42rem;
  border-radius: 99rem;
  background: #edf5ef;
  color: #587866;
  font-size: .64rem;
  font-weight: 720;
}
.persona-state.is-draft { background: #f3eee8; color: #8a7e74; }
.persona-state.is-archived { background: #eee9e4; color: #8d8178; }
.persona-editor-actions { display: flex; flex: 0 0 auto; gap: .35rem; }
.persona-editor-actions button {
  min-height: 2rem;
  padding: .38rem .55rem;
  border: 1px solid rgba(151, 105, 88, .14);
  border-radius: .58rem;
  background: #fffaf5;
  color: #8a6c61;
  font-size: .68rem;
  font-weight: 700;
}
.persona-editor-actions .persona-delete-button { color: #b65f5c; }
.persona-editor.is-archived {
  border-style: dashed;
  background: rgba(238, 233, 228, .58);
}
.persona-editor.is-archived > :not(.persona-editor-top) { opacity: .64; }
.editor-grid { display: grid; grid-template-columns: 1fr .7fr; gap: .75rem; }
.voice-intent-panel {
  margin-top: .9rem;
  padding: .75rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .8rem;
  background: rgba(255, 250, 244, .64);
}
.voice-intent-panel summary {
  cursor: pointer;
  color: #9e6757;
  font-size: .8rem;
  font-weight: 740;
}
.voice-intent-panel > p { margin: .5rem 0 0; color: #9a837a; font-size: .74rem; }
.voice-intent-panel > p .config-status { margin-right: .25rem; vertical-align: .05rem; }
.binding-note { display: flex; align-items: center; gap: .35rem; margin: .7rem 0 0; color: #9a837a; font-size: .7rem; }
.persona-runtime-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .9rem;
  padding: .78rem .82rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .8rem;
  background: rgba(255, 250, 244, .64);
}
.persona-runtime-setting strong {
  display: block;
  color: #68534c;
  font-size: .8rem;
}
.persona-runtime-setting p {
  max-width: 34rem;
  margin: .22rem 0 0;
  color: #9a837a;
  font-size: .7rem;
}
.studio-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .48rem;
  cursor: pointer;
}
.studio-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.studio-toggle-track {
  position: relative;
  width: 2.25rem;
  height: 1.28rem;
  border: 1px solid rgba(151, 105, 88, .2);
  border-radius: 99rem;
  background: #ddd8d3;
  transition: background .16s ease, border-color .16s ease;
}
.studio-toggle-track::after {
  position: absolute;
  top: .12rem;
  left: .12rem;
  width: .92rem;
  height: .92rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(56, 47, 43, .2);
  content: "";
  transition: transform .16s ease;
}
.studio-toggle input:checked + .studio-toggle-track {
  border-color: #708c8e;
  background: #708c8e;
}
.studio-toggle input:checked + .studio-toggle-track::after {
  transform: translateX(.96rem);
}
.studio-toggle input:focus-visible + .studio-toggle-track {
  outline: 2px solid rgba(65, 93, 96, .22);
  outline-offset: 2px;
}
.studio-toggle-label {
  min-width: 1.8rem;
  color: #736a65;
  font-size: .69rem;
  font-weight: 700;
}
.voice-sliders { display: grid; gap: .58rem; margin-top: .9rem; }
.voice-sliders label {
  display: grid;
  grid-template-columns: 4.6rem 1fr 2rem;
  align-items: center;
  gap: .55rem;
  color: #876f66;
  font-size: .72rem;
}
.voice-sliders input { accent-color: #d48b73; }
.voice-sliders output {
  color: #a16a5a;
  font-size: .7rem;
  text-align: right;
}
.studio-save {
  position: sticky;
  bottom: .8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem;
  border: 1px solid rgba(145, 105, 89, .1);
  border-radius: 1rem;
  background: rgba(255, 251, 245, .9);
  box-shadow: 0 1rem 2rem rgba(125, 88, 72, .1);
  backdrop-filter: blur(1rem);
}
.studio-save p { flex: 1; margin: 0 .2rem; color: #8c766d; font-size: .77rem; }
.studio-save button {
  border: 0;
  border-radius: .8rem;
  background: linear-gradient(135deg, #d99a80, #be7565);
  color: #fffaf6;
  padding: .7rem .95rem;
  box-shadow: 0 .4rem .9rem rgba(154, 87, 67, .16);
  font-weight: 720;
}
.template-links { display: flex; flex-wrap: wrap; gap: .55rem; margin: .7rem 0 .2rem; }
.template-links a {
  padding: .42rem .6rem;
  border-radius: .62rem;
  background: #fff7f1;
  color: #a36b5b;
  font-size: .73rem;
  font-weight: 700;
  text-decoration: none;
}
.memory-actions { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; }
.memory-actions p, .memory-status { margin: 0; color: #927b72; font-size: .76rem; }
.memory-zone-guide {
  margin: .85rem 0;
  padding: .75rem;
  border: 1px solid rgba(98, 118, 212, .16);
  border-radius: .82rem;
  background: linear-gradient(135deg, rgba(226, 231, 247, .72), rgba(255, 248, 237, .78));
}
.memory-zone-guide summary {
  cursor: pointer;
  list-style: none;
  color: #586bc4;
  font-size: .78rem;
  font-weight: 700;
}
.memory-zone-guide summary::-webkit-details-marker { display: none; }
.memory-zone-guide summary::after {
  content: "展开";
  float: right;
  color: #8b95c8;
  font-size: .68rem;
  font-weight: 500;
}
.memory-zone-guide[open] summary::after { content: "收起"; }
.memory-zone-guide > div { display: flex; flex-wrap: wrap; gap: .34rem; margin-top: .52rem; }
.memory-zone-guide span {
  border-radius: 99rem;
  background: rgba(255, 255, 255, .76);
  color: #6e6965;
  padding: .26rem .45rem;
  font-size: .65rem;
}
.memory-zone-guide p { margin: .58rem 0 0; color: #8f837b; font-size: .7rem; line-height: 1.45; }
.memory-curator-status {
  margin-top: .8rem;
  padding: .72rem .78rem;
  border: 1px solid rgba(134, 169, 144, .22);
  border-radius: .8rem;
  background: rgba(237, 245, 239, .78);
}
.memory-curator-status strong { color: #587866; font-size: .8rem; }
.memory-curator-status p { margin: .32rem 0 0; color: #75897b; font-size: .72rem; line-height: 1.45; }
.memory-curator-actions { display: flex; align-items: center; gap: .7rem; margin-top: .75rem; }
.memory-curator-actions p { flex: 1; margin: 0; color: #8f837b; font-size: .7rem; line-height: 1.42; }
.memory-v2-generator {
  margin-bottom: .75rem;
  padding: .78rem .82rem;
  border: 1px solid rgba(134, 169, 144, .2);
  border-radius: .82rem;
  background: rgba(246, 250, 246, .72);
}
.memory-v2-generator-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}
.memory-v2-generator-heading > div {
  display: grid;
  gap: .12rem;
}
.memory-v2-generator-heading > div > span {
  color: #86948a;
  font-size: .64rem;
}
.memory-v2-generator-heading strong {
  color: #536f60;
  font-size: .8rem;
}
.memory-v2-generator-controls {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(9rem, .8fr) auto;
  align-items: end;
  gap: .55rem;
  margin-top: .68rem;
}
.memory-v2-generator-controls label {
  display: grid;
  gap: .3rem;
}
.memory-v2-generator-controls label > span {
  color: #7e8c82;
  font-size: .66rem;
  font-weight: 700;
}
.memory-v2-generator-controls select,
.memory-v2-generator-controls input {
  min-height: 2.35rem;
  padding: .48rem .55rem;
  border: 1px solid #d9e1db;
  border-radius: .62rem;
  background: #fffefa;
  color: #655d57;
  font-size: .72rem;
}
.memory-v2-generator-controls > button { min-height: 2.35rem; }
.memory-v2-source-preview {
  margin-top: .62rem;
  padding: .62rem .68rem;
  border-radius: .68rem;
  background: rgba(255, 255, 255, .6);
  color: #7f8981;
  font-size: .69rem;
  line-height: 1.5;
}
.memory-v2-source-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .38rem;
  margin-bottom: .5rem;
}
.memory-v2-source-metrics span {
  display: grid;
  gap: .08rem;
  padding: .45rem .5rem;
  border-radius: .56rem;
  background: rgba(237, 245, 239, .8);
}
.memory-v2-source-metrics small { color: #87928a; font-size: .61rem; }
.memory-v2-source-metrics strong { color: #587866; font-size: .86rem; }
.memory-v2-source-preview p { margin: .28rem 0 0; }
.memory-v2-privacy-warning { color: #a36a56; }
.memory-v2-preview-ready { color: #587866; font-weight: 700; }
.memory-v2-preview-blocked { color: #b65358; font-weight: 700; }
.memory-v2-source-selection {
  margin-bottom: .62rem;
  padding: .56rem .6rem;
  border: 1px solid #d9e1db;
  border-radius: .58rem;
  background: rgba(248, 252, 248, .78);
}
.memory-v2-source-selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.memory-v2-source-selection-heading strong {
  color: #587866;
  font-size: .74rem;
}
.memory-v2-source-selection-heading span {
  color: #87928a;
  font-size: .63rem;
}
.memory-v2-source-selection > p {
  color: #7f8981;
  font-size: .67rem;
}
.memory-v2-source-conversation-list {
  display: grid;
  gap: .34rem;
  margin-top: .5rem;
}
.memory-v2-source-conversation {
  display: flex;
  align-items: flex-start;
  gap: .48rem;
  min-width: 0;
  padding: .42rem .48rem;
  border: 1px solid #e1e8e1;
  border-radius: .48rem;
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
}
.memory-v2-source-conversation input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: .12rem 0 0;
  accent-color: #6276d4;
}
.memory-v2-source-conversation-copy {
  display: grid;
  min-width: 0;
  gap: .1rem;
}
.memory-v2-source-conversation-copy strong {
  overflow: hidden;
  color: #5f6c64;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-v2-source-conversation-copy small {
  color: #929b94;
  font-size: .61rem;
  line-height: 1.35;
}
.memory-v2-source-confirm,
.memory-v2-sanitized-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .5rem;
}
.memory-v2-sanitized-actions span {
  color: #929b94;
  font-size: .64rem;
}
.memory-v2-sanitized-preview {
  display: grid;
  gap: .38rem;
  max-height: 28rem;
  overflow-y: auto;
  margin-top: .5rem;
  padding: .58rem;
  border: 1px solid rgba(98, 118, 212, .13);
  border-radius: .68rem;
  background: rgba(239, 241, 251, .48);
}
.memory-v2-sanitized-preview.hidden { display: none; }
.memory-v2-sanitized-preview > p {
  margin: 0;
  color: #737b8e;
  font-size: .67rem;
  line-height: 1.5;
}
.memory-v2-sanitized-toolbar {
  position: sticky;
  z-index: 2;
  top: -.58rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  margin: -.58rem -.58rem 0;
  padding: .65rem .68rem .58rem;
  border-bottom: 1px solid rgba(98, 118, 212, .1);
  background: rgba(245, 246, 252, .96);
  backdrop-filter: blur(.45rem);
}
.memory-v2-sanitized-toolbar p {
  margin: 0;
  color: #737b8e;
  font-size: .67rem;
  line-height: 1.5;
}
.memory-v2-privacy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .7rem;
  margin-top: .32rem;
  color: #858b94;
  font-size: .62rem;
}
.memory-v2-privacy-legend span {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
}
.memory-v2-privacy-legend i {
  display: inline-block;
  width: .7rem;
  height: .7rem;
  border-radius: .22rem;
}
.memory-v2-privacy-legend i.is-redaction {
  background: #ffe29a;
  box-shadow: inset 0 0 0 1px rgba(181, 125, 38, .18);
}
.memory-v2-privacy-legend i.is-review {
  background: #e8ebff;
  box-shadow: inset 0 0 0 1px rgba(98, 118, 212, .18);
}
.memory-v2-privacy-filter {
  display: grid;
  flex: 0 0 auto;
  gap: .22rem;
  color: #7e8490;
  font-size: .6rem;
  font-weight: 700;
}
.memory-v2-privacy-filter select {
  min-height: 2rem;
  padding: .38rem 1.8rem .38rem .5rem;
  border: 1px solid rgba(98, 118, 212, .16);
  border-radius: .52rem;
  background-color: #fffefa;
  color: #5f6680;
  font-size: .65rem;
}
.memory-v2-sanitized-preview details {
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .58rem;
  background: rgba(255, 255, 255, .72);
}
.memory-v2-sanitized-preview details.is-filtered-out,
.memory-v2-sanitized-message.is-filtered-out { display: none; }
.memory-v2-sanitized-preview summary {
  cursor: pointer;
  padding: .52rem .58rem;
  color: #5e6d9b;
  font-size: .68rem;
  font-weight: 720;
}
.memory-v2-sanitized-preview pre {
  max-height: 18rem;
  overflow: auto;
  margin: 0;
  padding: .58rem;
  border-top: 1px solid rgba(98, 118, 212, .08);
  color: #555860;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .66rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.memory-v2-sanitized-messages {
  display: grid;
  border-top: 1px solid rgba(98, 118, 212, .08);
}
.memory-v2-sanitized-message {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr) minmax(0, auto);
  align-items: start;
  gap: .55rem;
  padding: .5rem .58rem;
  color: #555860;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .65rem;
  line-height: 1.55;
}
.memory-v2-sanitized-message + .memory-v2-sanitized-message {
  border-top: 1px solid rgba(98, 118, 212, .055);
}
.memory-v2-sanitized-message[data-redacted="true"] {
  background: rgba(255, 244, 213, .38);
}
.memory-v2-sanitized-message[data-review="true"]:not([data-redacted="true"]) {
  background: rgba(235, 238, 255, .3);
}
.memory-v2-sanitized-ref {
  color: #7d86a0;
  font-size: .61rem;
  font-weight: 720;
  white-space: nowrap;
}
.memory-v2-sanitized-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.memory-v2-privacy-highlight {
  padding: .06rem .14rem;
  border-radius: .2rem;
  color: inherit;
}
.memory-v2-privacy-highlight.is-redaction {
  background: #ffe29a;
  box-shadow: inset 0 -1px 0 rgba(164, 105, 23, .28);
}
.memory-v2-privacy-highlight.is-blocked {
  background: #ffd9dc;
  color: #a33e48;
  box-shadow: inset 0 -1px 0 rgba(163, 62, 72, .22);
}
.memory-v2-privacy-highlight.is-review {
  background: #e8ebff;
  box-shadow: inset 0 -1px 0 rgba(98, 118, 212, .24);
}
.memory-v2-privacy-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .2rem;
  max-width: 14rem;
}
.memory-v2-privacy-badge {
  padding: .1rem .28rem;
  border-radius: 99rem;
  font-family: inherit;
  font-size: .55rem;
  line-height: 1.35;
  white-space: nowrap;
}
.memory-v2-privacy-badge.is-redaction {
  background: #fff0c5;
  color: #986616;
}
.memory-v2-privacy-badge.is-blocked {
  background: #fae3e5;
  color: #aa4650;
}
.memory-v2-privacy-badge.is-review {
  background: #eceefe;
  color: #5e6eb0;
}
.memory-v2-cloud-confirm {
  display: flex;
  align-items: flex-start;
  gap: .48rem;
  margin-top: .58rem;
  color: #748078;
  font-size: .68rem;
  line-height: 1.48;
}
.memory-v2-source-confirm {
  align-items: flex-start;
  gap: .48rem;
  color: #748078;
  font-size: .68rem;
  line-height: 1.48;
}
.memory-v2-source-confirm input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: .12rem;
  padding: 0;
  border-radius: .2rem;
  accent-color: #6276d4;
}
.memory-v2-source-confirm span { flex: 1; min-width: 0; }
.memory-v2-cloud-confirm input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: .12rem;
  padding: 0;
  border-radius: .2rem;
  accent-color: #6276d4;
}
.memory-v2-cloud-confirm span { flex: 1; min-width: 0; }
.memory-v2-generator-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .58rem;
}
.memory-v2-generator-actions button {
  flex: 0 0 auto;
  min-height: 2.35rem;
  padding: .58rem .76rem;
  border: 0;
  border-radius: .68rem;
  background: #6276d4;
  color: #fff;
  font-size: .72rem;
  font-weight: 740;
}
.memory-v2-generator-actions button:disabled { opacity: .42; }
.memory-v2-generator-actions p {
  margin: 0;
  color: #7d8880;
  font-size: .67rem;
  line-height: 1.45;
}
.memory-v2-current-day {
  margin-bottom: .75rem;
  padding: .78rem .82rem;
  border: 1px solid rgba(98, 118, 212, .15);
  border-radius: .82rem;
  background: rgba(239, 241, 251, .58);
}
.memory-v2-current-day > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.memory-v2-current-day > div > div:first-child {
  display: grid;
  gap: .13rem;
}
.memory-v2-current-day span,
.memory-v2-current-day small {
  color: #7e8497;
  font-size: .66rem;
}
.memory-v2-current-day strong {
  color: #53638f;
  font-size: .92rem;
}
.memory-v2-current-day-state {
  display: grid;
  max-width: 26rem;
  gap: .16rem;
  text-align: right;
}
.memory-v2-current-day-state b {
  color: #5f6c87;
  font-size: .76rem;
}
.memory-v2-filters {
  display: grid;
  grid-template-columns:
    minmax(9rem, 1.15fr)
    minmax(8.5rem, .8fr)
    minmax(8.5rem, .8fr)
    minmax(9rem, 1fr)
    auto;
  align-items: end;
  gap: .55rem;
  margin-bottom: .75rem;
  padding: .72rem;
  border: 1px solid rgba(126, 119, 111, .11);
  border-radius: .82rem;
  background: rgba(250, 247, 242, .74);
}
.memory-v2-filters label {
  display: grid;
  gap: .3rem;
  min-width: 0;
}
.memory-v2-filters label > span {
  color: #8d8178;
  font-size: .66rem;
  font-weight: 700;
}
.memory-v2-filters select,
.memory-v2-filters input {
  width: 100%;
  min-width: 0;
  min-height: 2.35rem;
  padding: .48rem .55rem;
  border: 1px solid #ded7ce;
  border-radius: .62rem;
  background: #fffefa;
  color: #655d57;
  font-size: .72rem;
}
.memory-v2-filters > button { min-height: 2.35rem; }
.memory-v2-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: .9rem;
}
.memory-v2-summary article {
  display: grid;
  gap: .18rem;
  padding: .62rem .68rem;
  border-radius: .72rem;
  background: rgba(246, 250, 246, .78);
}
.memory-v2-summary span {
  color: #849087;
  font-size: .64rem;
}
.memory-v2-summary strong {
  color: #536f60;
  font-size: 1rem;
}
.memory-v2-summary > p {
  grid-column: 1 / -1;
  margin: 0;
  color: #b06a62;
  font-size: .68rem;
}
.memory-v2-list-heading,
.memory-v2-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .55rem;
}
.memory-v2-list-heading h3 {
  margin: 0;
  color: #655650;
  font-size: .86rem;
}
.memory-v2-list-heading p,
.memory-v2-list-heading > span,
.memory-v2-detail-toolbar p {
  margin: .12rem 0 0;
  color: #998c85;
  font-size: .66rem;
}
.memory-v2-day-list {
  display: grid;
  gap: .48rem;
  margin-bottom: .7rem;
}
.memory-v2-day-button {
  display: grid;
  gap: .28rem;
  min-width: 0;
  border: 1px solid rgba(151, 105, 88, .12);
  border-radius: .76rem;
  background: rgba(255, 250, 244, .72);
  color: #6e5b55;
  padding: .66rem .72rem;
  text-align: left;
}
.memory-v2-day-button:hover {
  border-color: rgba(190, 117, 101, .38);
  background: #fff8f2;
  box-shadow: 0 .28rem .7rem rgba(125, 88, 72, .08);
}
.memory-v2-day-button-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}
.memory-v2-day-button strong {
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-v2-day-button > span {
  color: #93847d;
  font-size: .66rem;
}
.memory-v2-day-button > small {
  color: #aa968e;
  font-size: .63rem;
}
.memory-v2-status {
  flex: 0 0 auto;
  padding: .2rem .4rem;
  border-radius: 99rem;
  background: #eee9e5;
  color: #7d716b;
  font-size: .61rem;
  font-weight: 720;
}
.memory-v2-status.is-awaiting_review { background: #f7e9df; color: #a36a56; }
.memory-v2-status.is-approved { background: #e4f0e4; color: #5e8168; }
.memory-v2-status.is-processing { background: #eceefe; color: #6276b4; }
.memory-v2-status.is-failed,
.memory-v2-status.is-missing_journal { background: #fae8e7; color: #b65358; }
.memory-v2-list-empty,
.memory-v2-missing-journal {
  padding: 1rem;
  border: 1px dashed rgba(151, 105, 88, .18);
  border-radius: .78rem;
  background: rgba(255, 250, 244, .62);
  text-align: center;
}
.memory-v2-list-empty strong,
.memory-v2-missing-journal h3 {
  margin: 0;
  color: #71655f;
  font-size: .82rem;
}
.memory-v2-list-empty p,
.memory-v2-missing-journal p {
  margin: .3rem auto 0;
  max-width: 34rem;
  color: #9a8c85;
  font-size: .69rem;
  line-height: 1.55;
}
.memory-v2-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
}
.memory-v2-pagination span {
  color: #8e827b;
  font-size: .68rem;
}
.memory-v2-pagination button:disabled { opacity: .42; }
.memory-v2-detail-toolbar {
  padding-bottom: .65rem;
  border-bottom: 1px solid rgba(126, 119, 111, .11);
}
.memory-v2-review {
  display: grid;
  gap: .9rem;
  padding: .85rem;
  border: 1px solid rgba(134, 169, 144, .2);
  border-radius: .9rem;
  background: rgba(246, 250, 246, .72);
}
.memory-v2-review:empty { display: none; }
.transcript-security-note {
  margin: .75rem 0 .9rem;
  border: 1px solid rgba(92, 139, 105, .17);
  border-radius: .82rem;
  background: rgba(239, 247, 241, .68);
  overflow: hidden;
}
.transcript-security-note > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .62rem .72rem;
  cursor: pointer;
  list-style: none;
}
.transcript-security-note > summary::-webkit-details-marker { display: none; }
.transcript-security-note > summary::after {
  flex: 0 0 auto;
  color: #7f9085;
  content: "查看";
  font-size: .62rem;
}
.transcript-security-note[open] > summary::after { content: "收起"; }
.transcript-security-note > summary strong {
  color: #587866;
  font-size: .72rem;
}
.transcript-security-note > summary span {
  margin-left: auto;
  color: #7f8d83;
  font-size: .64rem;
  text-align: right;
}
.transcript-security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  padding: 0 .65rem .65rem;
}
.transcript-security-grid > div {
  display: grid;
  gap: .18rem;
  min-width: 0;
  padding: .55rem .6rem;
  border-radius: .66rem;
  background: rgba(255, 255, 255, .58);
}
.transcript-security-grid strong {
  color: #587866;
  font-size: .72rem;
}
.transcript-security-grid span {
  color: #849087;
  font-size: .64rem;
  line-height: 1.45;
}
.transcript-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: .8rem;
}
.transcript-summary article {
  display: grid;
  gap: .18rem;
  min-width: 0;
  padding: .65rem .7rem;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .74rem;
  background: rgba(239, 241, 251, .52);
}
.transcript-summary span,
.transcript-summary small {
  overflow: hidden;
  color: #858b9b;
  font-size: .63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transcript-summary strong {
  color: #596bbd;
  font-size: 1rem;
}
.transcript-filters {
  display: grid;
  grid-template-columns:
    minmax(10rem, 1.15fr)
    minmax(8.5rem, .8fr)
    minmax(8.5rem, .8fr)
    minmax(8.5rem, .8fr)
    auto;
  align-items: end;
  gap: .55rem;
  margin-bottom: .8rem;
  padding: .7rem;
  border: 1px solid rgba(126, 119, 111, .11);
  border-radius: .82rem;
  background: rgba(250, 247, 242, .74);
}
.transcript-filters label,
.transcript-detail-search label {
  display: grid;
  gap: .3rem;
  min-width: 0;
}
.transcript-filters label > span,
.transcript-detail-search label > span {
  color: #8d8178;
  font-size: .66rem;
  font-weight: 700;
}
.transcript-filters select,
.transcript-filters input,
.transcript-detail-search input {
  width: 100%;
  min-width: 0;
  min-height: 2.35rem;
  padding: .48rem .55rem;
  border: 1px solid #ded7ce;
  border-radius: .62rem;
  background: #fffefa;
  color: #655d57;
  font-size: .72rem;
}
.transcript-filters > button,
.transcript-detail-search > button { min-height: 2.35rem; }
.transcript-list-heading,
.transcript-detail-heading,
.transcript-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .55rem;
}
.transcript-list-heading h3,
.transcript-detail-heading h3 {
  margin: 0;
  color: #655650;
  font-size: .86rem;
}
.transcript-list-heading p,
.transcript-list-heading > span,
.transcript-detail-heading p,
.transcript-detail-heading > span,
.transcript-detail-toolbar p {
  margin: .12rem 0 0;
  color: #998c85;
  font-size: .66rem;
}
.transcript-list {
  display: grid;
  gap: .48rem;
  margin-bottom: .75rem;
}
.transcript-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
  width: 100%;
  min-width: 0;
  padding: .68rem .72rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .78rem;
  background: rgba(250, 250, 253, .75);
  color: #615b61;
  text-align: left;
}
.transcript-list-open {
  display: grid;
  gap: .3rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.transcript-list-item:hover {
  border-color: rgba(98, 118, 212, .32);
  background: rgba(243, 245, 253, .9);
  box-shadow: 0 .28rem .7rem rgba(78, 88, 140, .08);
}
.transcript-list-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}
.transcript-list-item-badges {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: .3rem;
}
.transcript-list-item strong {
  overflow: hidden;
  color: #596589;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transcript-list-item-top span {
  flex: 0 0 auto;
  padding: .18rem .38rem;
  border-radius: 99rem;
  background: #eceefe;
  color: #6276b4;
  font-size: .61rem;
  font-weight: 720;
}
.transcript-list-item-top span.is-active {
  background: #e9f3ec;
  color: #587866;
}
.transcript-list-item-top span.is-archived {
  background: #f2eee8;
  color: #80766f;
}
.transcript-list-item-top span.is-unmanaged {
  background: #fff2d8;
  color: #926d31;
}
.transcript-list-item p {
  margin: 0;
  color: #857e83;
  font-size: .68rem;
  line-height: 1.45;
}
.transcript-list-item small {
  color: #a0999d;
  font-size: .63rem;
}
.transcript-list-item-actions {
  display: flex;
  align-items: center;
}
.transcript-list-item-actions .is-danger,
.transcript-detail-toolbar-actions .is-danger {
  border-color: rgba(182, 95, 92, .25);
  color: #a85451;
}
.transcript-detail-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  min-width: 0;
}
.transcript-detail-toolbar-actions p {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transcript-empty {
  padding: 1rem;
  border: 1px dashed rgba(98, 118, 212, .18);
  border-radius: .78rem;
  background: rgba(247, 248, 253, .64);
  text-align: center;
}
.transcript-empty strong {
  color: #6c6d78;
  font-size: .8rem;
}
.transcript-empty p {
  margin: .28rem 0 0;
  color: #9293a0;
  font-size: .68rem;
}
.transcript-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
}
.transcript-pagination span {
  color: #8e827b;
  font-size: .68rem;
}
.transcript-pagination button:disabled { opacity: .42; }
.transcript-pagination-top {
  justify-content: flex-end;
  margin: -.15rem 0 .55rem;
}
.transcript-detail-toolbar {
  padding-bottom: .65rem;
  border-bottom: 1px solid rgba(126, 119, 111, .11);
}
.transcript-detail-safety {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .7rem 0;
  padding: .55rem .62rem;
  border-radius: .68rem;
  background: rgba(239, 247, 241, .72);
}
.transcript-detail-safety p {
  margin: 0;
  color: #7d8b81;
  font-size: .66rem;
  line-height: 1.45;
}
.transcript-detail-safety .config-status {
  flex: 0 0 auto;
}
.transcript-task-badge {
  display: inline-grid;
  min-width: 1.08rem;
  height: 1.08rem;
  margin-left: .18rem;
  padding: 0 .28rem;
  place-items: center;
  border-radius: 99rem;
  background: rgba(98, 118, 212, .14);
  color: #596bbd;
  font-size: .58rem;
  font-style: normal;
}
.transcript-task-badge.hidden { display: none; }
[data-studio-page="transcripts"].is-transcript-subview > .section-copy,
[data-studio-page="transcripts"].is-transcript-subview > .transcript-security-note {
  display: none;
}
.primary-compact-button {
  min-height: 2.35rem;
  padding: .52rem .75rem;
  border: 0;
  border-radius: .68rem;
  background: #6276d4;
  color: #fff;
  font-size: .72rem;
  font-weight: 740;
  box-shadow: 0 .35rem .7rem rgba(98, 118, 212, .18);
}
.primary-compact-button:disabled {
  opacity: .48;
  box-shadow: none;
}
.transcript-selection-panel {
  margin: .7rem 0 .8rem;
  border: 1px solid rgba(98, 118, 212, .25);
  border-radius: .76rem;
  background: rgba(244, 246, 253, .86);
  box-shadow: 0 .32rem .9rem rgba(79, 89, 143, .07);
  overflow: hidden;
}
.transcript-selection-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .62rem .68rem;
  cursor: pointer;
  list-style: none;
}
.transcript-selection-panel > summary::-webkit-details-marker { display: none; }
.transcript-selection-panel > summary::after {
  flex: 0 0 auto;
  color: #7e87ad;
  content: "展开";
  font-size: .61rem;
}
.transcript-selection-panel[open] > summary::after { content: "收起"; }
.transcript-selection-panel > summary > div {
  display: flex;
  align-items: center;
  gap: .48rem;
  min-width: 0;
}
.transcript-selection-panel > summary strong {
  color: #596589;
  font-size: .78rem;
}
.transcript-selection-panel > summary span {
  padding: .17rem .36rem;
  border-radius: 99rem;
  background: rgba(98, 118, 212, .11);
  color: #6276b4;
  font-size: .6rem;
}
.transcript-selection-panel > summary small {
  margin-left: auto;
  color: #8d91a0;
  font-size: .61rem;
  text-align: right;
}
.transcript-selection-content {
  padding: 0 .68rem .68rem;
  border-top: 1px solid rgba(98, 118, 212, .09);
}
.transcript-selection-content > p:first-child {
  margin: .58rem 0;
  color: #818594;
  font-size: .65rem;
  line-height: 1.5;
}
.transcript-range-selector {
  display: grid;
  grid-template-columns: minmax(7rem, .7fr) minmax(7rem, .7fr) auto;
  align-items: end;
  gap: .5rem;
}
.transcript-range-selector label {
  display: grid;
  gap: .28rem;
}
.transcript-range-selector label > span {
  color: #858394;
  font-size: .63rem;
  font-weight: 700;
}
.transcript-range-selector input {
  width: 100%;
  min-width: 0;
  min-height: 2.35rem;
  padding: .48rem .55rem;
  border: 1px solid #dcdce8;
  border-radius: .62rem;
  background: #fff;
  color: #5f5e68;
  font-size: .72rem;
}
.transcript-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .55rem;
}
.transcript-selection-actions .primary-compact-button { margin-left: auto; }
.transcript-selection-status {
  min-height: 1em;
  margin: .48rem 0 0;
  color: #8d8178;
  font-size: .64rem;
  line-height: 1.45;
}
.transcript-message-selector {
  display: none;
  align-items: center;
  gap: .3rem;
  color: #747b9b;
  font-size: .62rem;
  font-weight: 700;
}
.transcript-message-selector input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #6276d4;
}
.transcript-detail-view.is-selecting .transcript-message-selector {
  display: inline-flex;
}
.transcript-message.is-selected {
  border-color: rgba(98, 118, 212, .42);
  box-shadow: 0 0 0 .12rem rgba(98, 118, 212, .08);
}
.transcript-detail-search {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto auto;
  align-items: end;
  gap: .5rem;
  margin-bottom: .8rem;
}
.transcript-messages {
  display: grid;
  gap: .5rem;
  margin-bottom: .7rem;
}
.transcript-message {
  display: grid;
  gap: .42rem;
  min-width: 0;
  padding: .7rem .75rem;
  border: 1px solid rgba(126, 119, 111, .1);
  border-left-width: .24rem;
  border-radius: .76rem;
  background: rgba(255, 252, 247, .78);
}
.transcript-message.is-user {
  border-left-color: #6276d4;
  background: rgba(239, 241, 251, .55);
}
.transcript-message.is-assistant {
  border-left-color: #86a990;
  background: rgba(241, 247, 242, .58);
}
.transcript-message header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.transcript-message-heading {
  display: flex;
  align-items: center;
  gap: .48rem;
}
.transcript-message header strong {
  color: #596589;
  font-size: .7rem;
}
.transcript-message.is-assistant header strong { color: #587866; }
.transcript-message header span {
  color: #99959a;
  font-size: .61rem;
}
.transcript-message > p {
  margin: 0;
  color: #57545a;
  font-size: .75rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.transcript-message > small {
  width: fit-content;
  padding: .18rem .36rem;
  border-radius: 99rem;
  background: rgba(98, 118, 212, .09);
  color: #737eaa;
  font-size: .6rem;
}
.transcript-task-safety {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .7rem 0;
  padding: .55rem .62rem;
  border-radius: .68rem;
  background: rgba(239, 247, 241, .72);
}
.transcript-task-safety p {
  margin: 0;
  color: #7d8b81;
  font-size: .66rem;
  line-height: 1.45;
}
.transcript-task-vault-tabs { margin-bottom: .75rem; }
.transcript-task-list-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .7rem;
  padding: .58rem .64rem;
  border-radius: .7rem;
  background: rgba(242, 243, 249, .62);
}
.transcript-task-list-controls label {
  display: grid;
  gap: .24rem;
  min-width: 10.5rem;
}
.transcript-task-list-controls label span {
  color: #766f73;
  font-size: .62rem;
  font-weight: 720;
}
.transcript-task-list-controls select {
  min-height: 2.25rem;
  padding: .42rem .52rem;
  border: 1px solid rgba(98, 118, 212, .14);
  border-radius: .56rem;
  background: rgba(255, 255, 255, .92);
  color: #59545b;
  font: inherit;
  font-size: .68rem;
}
.transcript-task-list-controls p {
  margin: 0 0 .1rem;
  color: #918b93;
  font-size: .61rem;
  line-height: 1.45;
}
.transcript-task-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .55rem;
}
.transcript-task-heading h3 {
  margin: 0;
  color: #655650;
  font-size: .86rem;
}
.transcript-task-heading p,
.transcript-task-heading > span {
  margin: .12rem 0 0;
  color: #998c85;
  font-size: .66rem;
}
.transcript-task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: .75rem;
}
.transcript-task-card {
  display: grid;
  gap: .42rem;
  padding: .68rem .72rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .78rem;
  background: rgba(250, 250, 253, .75);
}
.transcript-task-card header,
.transcript-task-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.transcript-task-card header strong {
  color: #596589;
  font-size: .76rem;
}
.transcript-task-card header span {
  flex: 0 0 auto;
  padding: .18rem .38rem;
  border-radius: 99rem;
  background: #eceefe;
  color: #6276b4;
  font-size: .59rem;
  font-weight: 720;
}
.transcript-task-card p {
  margin: 0;
  color: #807d86;
  font-size: .68rem;
  line-height: 1.5;
}
.transcript-task-card small {
  color: #9c98a0;
  font-size: .62rem;
}
.transcript-task-card-actions {
  justify-content: flex-start;
  padding-top: .15rem;
}
.transcript-task-remove {
  border-color: rgba(182, 83, 88, .12);
  background: #fff7f6;
  color: #a95f64;
}
.transcript-task-stage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin: .7rem 0;
  padding: .68rem .75rem;
  border: 1px solid rgba(82, 132, 102, .12);
  border-radius: .78rem;
  background: rgba(239, 247, 241, .72);
}
.transcript-task-stage-banner > div:first-child {
  display: grid;
  gap: .14rem;
}
.transcript-task-stage-banner span {
  color: #7b8b80;
  font-size: .62rem;
}
.transcript-task-stage-banner strong {
  color: #536e5e;
  font-size: .78rem;
}
.transcript-task-stage-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .3rem;
}
.transcript-task-stage-flags span {
  padding: .22rem .42rem;
  border-radius: 99rem;
  background: rgba(255, 255, 255, .78);
  color: #68796d;
  font-weight: 700;
}
.transcript-task-purpose-panel,
.transcript-task-preview {
  padding: .78rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .82rem;
  background: rgba(252, 251, 253, .82);
}
.transcript-task-preview { margin-top: .7rem; }
.transcript-task-subheading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
}
.transcript-task-subheading > div {
  display: grid;
  gap: .12rem;
}
.transcript-task-subheading span,
.transcript-task-subheading small {
  color: #9a9091;
  font-size: .61rem;
}
.transcript-task-subheading h3 {
  margin: 0;
  color: #655650;
  font-size: .86rem;
}
.transcript-task-purpose-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .65rem;
}
.transcript-task-purpose-options label {
  display: flex;
  align-items: flex-start;
  gap: .48rem;
  min-width: 0;
  padding: .62rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .72rem;
  background: rgba(255, 255, 255, .78);
  cursor: pointer;
}
.transcript-task-purpose-options label:has(input:checked) {
  border-color: rgba(98, 118, 212, .38);
  background: rgba(238, 240, 253, .82);
  box-shadow: 0 0 0 2px rgba(98, 118, 212, .07);
}
.transcript-task-purpose-options input {
  flex: 0 0 auto;
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  margin: .12rem 0 0;
  accent-color: #6276b4;
}
.transcript-task-purpose-options label > span {
  flex: 1 1 auto;
  display: grid;
  gap: .16rem;
  min-width: 0;
}
.transcript-task-purpose-options strong {
  color: #596589;
  font-size: .72rem;
}
.transcript-task-purpose-options small {
  color: #908b94;
  font-size: .62rem;
  line-height: 1.45;
}
.transcript-task-prepare-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .65rem;
}
.transcript-task-prepare-actions .transcript-selection-status {
  margin: 0;
}
.transcript-task-preview-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .45rem;
  margin-top: .65rem;
}
.transcript-task-preview-summary article {
  display: grid;
  gap: .14rem;
  min-width: 0;
  padding: .55rem .6rem;
  border-radius: .68rem;
  background: rgba(242, 243, 249, .78);
}
.transcript-task-preview-summary span,
.transcript-task-preview-summary small {
  color: #908d96;
  font-size: .59rem;
}
.transcript-task-preview-summary strong {
  color: #596589;
  font-size: .86rem;
}
.transcript-task-review-alert {
  display: grid;
  gap: .22rem;
  margin-top: .55rem;
  padding: .55rem .62rem;
  border: 1px solid rgba(193, 139, 56, .17);
  border-radius: .68rem;
  background: rgba(255, 248, 226, .75);
}
.transcript-task-review-alert p {
  margin: 0;
  color: #8f744a;
  font-size: .64rem;
  line-height: 1.5;
}
.transcript-task-preview-filter {
  position: sticky;
  top: .45rem;
  z-index: 4;
  display: grid;
  gap: .48rem;
  margin-top: .58rem;
  padding: .62rem;
  border: 1px solid rgba(193, 139, 56, .2);
  border-radius: .72rem;
  background: rgba(255, 252, 242, .96);
  box-shadow: 0 .35rem 1rem rgba(90, 72, 48, .08);
  backdrop-filter: blur(12px);
}
.transcript-task-preview-filter > div:first-child {
  display: grid;
  gap: .12rem;
}
.transcript-task-preview-filter > div:first-child strong {
  color: #765f3e;
  font-size: .72rem;
}
.transcript-task-preview-filter > div:first-child span {
  color: #917b5d;
  font-size: .62rem;
  line-height: 1.45;
}
.transcript-task-preview-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .34rem;
}
.transcript-task-preview-filter-actions button {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  min-height: 1.75rem;
  padding: .3rem .48rem;
  border: 1px solid rgba(126, 111, 93, .13);
  border-radius: 99rem;
  background: rgba(255, 255, 255, .82);
  color: #817463;
  font: inherit;
  font-size: .61rem;
  font-weight: 700;
  cursor: pointer;
}
.transcript-task-preview-filter-actions button b {
  min-width: 1.12rem;
  padding: .08rem .24rem;
  border-radius: 99rem;
  background: rgba(126, 111, 93, .08);
  font-size: .55rem;
  text-align: center;
}
.transcript-task-preview-filter-actions button.is-active {
  border-color: rgba(193, 139, 56, .42);
  background: #fff1bf;
  color: #795b18;
  box-shadow: 0 0 0 2px rgba(193, 139, 56, .08);
}
.transcript-task-preview-filter-actions button:disabled {
  opacity: .42;
  cursor: default;
}
.transcript-task-preview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .62rem;
  color: #8f8991;
  font-size: .62rem;
}
.transcript-task-preview-legend span {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
}
.transcript-task-preview-legend i {
  width: .68rem;
  height: .68rem;
  border-radius: .2rem;
}
.transcript-task-preview-legend .is-redacted,
.transcript-task-preview-tags .is-redacted,
.transcript-task-preview-message mark.is-redacted {
  background: #dff1e5;
  color: #477158;
}
.transcript-task-preview-legend .is-review,
.transcript-task-preview-tags .is-review,
.transcript-task-preview-message mark.is-review {
  background: #fff0b9;
  color: #87691f;
}
.transcript-task-preview-legend .is-blocked,
.transcript-task-preview-tags .is-blocked,
.transcript-task-preview-message mark.is-blocked {
  background: #f8dfe1;
  color: #9a4e55;
}
.transcript-task-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px solid rgba(98, 118, 212, .08);
}
.transcript-task-preview-toolbar > div:first-child {
  display: grid;
  gap: .08rem;
}
.transcript-task-preview-toolbar strong {
  color: #655650;
  font-size: .74rem;
}
.transcript-task-preview-toolbar span {
  color: #999299;
  font-size: .61rem;
}
.transcript-task-preview-toolbar .transcript-pagination {
  margin: 0;
}
.transcript-task-preview-messages {
  display: grid;
  gap: .38rem;
  margin-top: .5rem;
}
.transcript-task-preview-message {
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .68rem;
  background: rgba(255, 255, 255, .8);
}
.transcript-task-preview-message.is-attention {
  border-color: rgba(193, 139, 56, .32);
  background: rgba(255, 252, 242, .86);
  box-shadow: inset 0 0 0 1px rgba(193, 139, 56, .05);
}
.transcript-task-preview-message.is-assistant {
  border-left: 3px solid rgba(89, 137, 106, .45);
}
.transcript-task-preview-message.is-user {
  border-left: 3px solid rgba(98, 118, 212, .45);
}
.transcript-task-preview-message summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .52rem;
  padding: .5rem .58rem;
  cursor: pointer;
  list-style: none;
}
.transcript-task-preview-message summary::-webkit-details-marker {
  display: none;
}
.transcript-task-preview-message summary > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
}
.transcript-task-preview-message summary strong {
  color: #596589;
  font-size: .66rem;
}
.transcript-task-preview-message summary small {
  padding: .12rem .28rem;
  border-radius: 99rem;
  background: rgba(98, 118, 212, .08);
  color: #7c84a2;
  font-size: .56rem;
}
.transcript-task-preview-snippet {
  min-width: 0;
  overflow: hidden;
  color: #858189;
  font-size: .64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transcript-task-preview-tags {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .25rem;
}
.transcript-task-preview-tags i {
  padding: .15rem .3rem;
  border-radius: 99rem;
  font-size: .55rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}
.transcript-task-preview-tags .is-origin {
  background: rgba(98, 118, 212, .08);
  color: #777f9b;
}
.transcript-task-preview-message > p {
  margin: 0;
  padding: .58rem;
  border-top: 1px solid rgba(98, 118, 212, .08);
  color: #57545a;
  font-size: .7rem;
  line-height: 1.68;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.transcript-task-preview-message mark {
  padding: .04rem .12rem;
  border-radius: .2rem;
}
.transcript-task-preview-empty {
  padding: .85rem;
  border: 1px dashed rgba(98, 118, 212, .18);
  border-radius: .72rem;
  background: rgba(255, 255, 255, .72);
  text-align: center;
}
.transcript-task-preview-empty strong {
  color: #6b6060;
  font-size: .72rem;
}
.transcript-task-preview-empty p {
  margin: .2rem 0 0;
  color: #999299;
  font-size: .62rem;
}
.transcript-task-preview-footnote {
  margin: .55rem 0 0;
  color: #9a949a;
  font-size: .6rem;
  line-height: 1.5;
}
.transcript-task-cloud-panel,
.transcript-task-review-output {
  margin-top: .7rem;
  padding: .78rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .82rem;
  background: rgba(252, 251, 253, .82);
}
.transcript-task-cloud-boundary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  margin-top: .65rem;
}
.transcript-task-cloud-boundary > div {
  display: grid;
  gap: .16rem;
  min-width: 0;
  padding: .58rem .62rem;
  border-radius: .68rem;
  background: rgba(242, 243, 249, .78);
}
.transcript-task-cloud-boundary strong {
  color: #596589;
  font-size: .68rem;
}
.transcript-task-cloud-boundary span {
  color: #8b8891;
  font-size: .61rem;
  line-height: 1.48;
}
.transcript-task-cloud-confirm {
  display: flex;
  align-items: flex-start;
  gap: .46rem;
  margin-top: .58rem;
  padding: .55rem .6rem;
  border: 1px solid rgba(193, 139, 56, .17);
  border-radius: .68rem;
  background: rgba(255, 248, 226, .62);
  cursor: pointer;
}
.transcript-task-cloud-confirm input {
  flex: 0 0 auto;
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  margin: .05rem 0 0;
  accent-color: #6276b4;
}
.transcript-task-cloud-confirm span {
  color: #806d4c;
  font-size: .65rem;
  line-height: 1.5;
}
.transcript-task-cloud-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .58rem;
}
.transcript-task-cloud-actions .transcript-selection-status { margin: 0; }
.transcript-task-run-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.8rem, 1fr));
  gap: .45rem;
  margin-top: .65rem;
}
.transcript-task-run-summary article {
  display: grid;
  gap: .14rem;
  min-width: 0;
  padding: .55rem .6rem;
  border-radius: .68rem;
  background: rgba(239, 247, 241, .68);
}
.transcript-task-run-summary span,
.transcript-task-run-summary small {
  color: #87928a;
  font-size: .59rem;
}
.transcript-task-run-summary strong {
  color: #536e5e;
  font-size: .79rem;
}
.transcript-task-result-panel {
  margin-top: .58rem;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .72rem;
  background: rgba(255, 255, 255, .78);
  overflow: hidden;
}
.transcript-task-result-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .58rem .64rem;
  cursor: pointer;
  list-style: none;
}
.transcript-task-result-panel > summary::-webkit-details-marker {
  display: none;
}
.transcript-task-result-panel > summary > div {
  display: grid;
  gap: .1rem;
}
.transcript-task-result-panel > summary strong {
  color: #596589;
  font-size: .72rem;
}
.transcript-task-result-panel > summary span,
.transcript-task-result-panel > summary small {
  color: #928e96;
  font-size: .61rem;
}
.transcript-task-journal-content {
  display: grid;
  gap: .55rem;
  padding-top: .15rem;
}
.transcript-task-journal-review {
  display: grid;
  gap: .58rem;
  padding: .64rem;
  border-top: 1px solid rgba(98, 118, 212, .08);
}
.transcript-task-storage-boundary {
  display: grid;
  gap: .14rem;
  padding: .5rem .56rem;
  border: 1px solid rgba(193, 139, 56, .16);
  border-radius: .62rem;
  background: rgba(255, 248, 226, .62);
}
.transcript-task-storage-boundary strong {
  color: #806d4c;
  font-size: .65rem;
}
.transcript-task-storage-boundary span {
  color: #8c7b5d;
  font-size: .61rem;
  line-height: 1.5;
}
.transcript-task-journal-review > label,
.transcript-task-candidate-editor label {
  display: grid;
  gap: .24rem;
}
.transcript-task-journal-review > label > span,
.transcript-task-candidate-editor label > span {
  color: #766f73;
  font-size: .62rem;
  font-weight: 720;
}
.transcript-task-journal-review input,
.transcript-task-journal-review textarea,
.transcript-task-candidate-editor select,
.transcript-task-candidate-editor textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .5rem .56rem;
  border: 1px solid rgba(98, 118, 212, .14);
  border-radius: .58rem;
  background: rgba(255, 255, 255, .94);
  color: #57545a;
  font: inherit;
  font-size: .68rem;
  line-height: 1.55;
}
.transcript-task-journal-review textarea,
.transcript-task-candidate-editor textarea {
  resize: vertical;
}
.transcript-task-review-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}
.transcript-task-review-actions .is-reject {
  border-color: rgba(182, 83, 88, .12);
  background: #fff7f6;
  color: #a95f64;
}
.transcript-task-review-actions button:disabled,
.transcript-task-journal-review input:disabled,
.transcript-task-journal-review textarea:disabled,
.transcript-task-candidate-editor select:disabled,
.transcript-task-candidate-editor textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}
.transcript-task-journal-narrative {
  margin: 0;
  color: #57545a;
  font-size: .7rem;
  line-height: 1.72;
  white-space: pre-wrap;
}
.transcript-task-journal-content section {
  display: grid;
  gap: .3rem;
}
.transcript-task-journal-content section > strong {
  color: #655650;
  font-size: .67rem;
}
.transcript-task-journal-content ul {
  display: grid;
  gap: .3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.transcript-task-journal-content li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .6rem;
  padding: .42rem .48rem;
  border-radius: .58rem;
  background: rgba(242, 243, 249, .68);
}
.transcript-task-journal-content li span {
  color: #69666d;
  font-size: .65rem;
  line-height: 1.5;
}
.transcript-task-journal-content li small {
  flex: 0 0 auto;
  color: #9295a5;
  font-size: .57rem;
}
.transcript-task-memory-result {
  margin-top: .58rem;
  padding: .62rem;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .72rem;
  background: rgba(255, 255, 255, .72);
}
.transcript-task-memory-result .transcript-task-preview-toolbar {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.transcript-task-candidate-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .42rem;
  margin-top: .5rem;
}
.transcript-task-candidate-card {
  min-width: 0;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .66rem;
  background: rgba(249, 249, 252, .82);
  overflow: hidden;
}
.transcript-task-candidate-card > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .3rem .5rem;
  padding: .58rem .62rem;
  cursor: pointer;
  list-style: none;
}
.transcript-task-candidate-card > summary::-webkit-details-marker {
  display: none;
}
.transcript-task-candidate-card > summary > div:first-child {
  display: grid;
  gap: .16rem;
  min-width: 0;
}
.transcript-task-candidate-card > summary strong {
  color: #596589;
  font-size: .68rem;
}
.transcript-task-candidate-card > summary p {
  margin: 0;
  color: #6c6870;
  font-size: .64rem;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transcript-task-candidate-card > summary > span {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .22rem;
}
.transcript-task-candidate-card > summary i {
  padding: .14rem .28rem;
  border-radius: 99rem;
  background: rgba(98, 118, 212, .09);
  color: #737eaa;
  font-size: .53rem;
  font-style: normal;
  white-space: nowrap;
}
.transcript-task-candidate-card > summary i.is-approved {
  background: #dff1e5;
  color: #477158;
}
.transcript-task-candidate-card > summary i.is-rejected {
  background: #f8dfe1;
  color: #9a4e55;
}
.transcript-task-candidate-card > summary i.is-duplicate {
  background: #fff0c9;
  color: #90702e;
}
.transcript-task-candidate-editor {
  display: grid;
  gap: .48rem;
  padding: .58rem .62rem .64rem;
  border-top: 1px solid rgba(98, 118, 212, .08);
}
.transcript-task-candidate-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: .45rem;
}
.transcript-task-candidate-meta {
  display: grid;
  gap: .16rem;
}
.transcript-task-candidate-meta small {
  color: #96919a;
  font-size: .58rem;
  line-height: 1.45;
}
.transcript-task-card header span.is-extracting,
.transcript-task-card header span.is-synthesizing {
  background: #fff0c9;
  color: #90702e;
}
.transcript-task-card header span.is-awaiting_review {
  background: #dff1e5;
  color: #477158;
}
.transcript-task-card header span.is-failed {
  background: #f8dfe1;
  color: #9a4e55;
}
.transcript-task-card header span.is-reviewed {
  background: #ececf0;
  color: #716e76;
}
.diagnostic-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .8rem;
}
.diagnostic-summary-grid > article {
  display: grid;
  gap: .22rem;
  min-width: 0;
  padding: .72rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .8rem;
  background: rgba(251, 239, 231, .42);
}
.diagnostic-summary-grid span,
.diagnostic-summary-grid small,
.diagnostic-daily-list small {
  color: #a18b82;
  font-size: .65rem;
}
.diagnostic-summary-grid strong {
  color: #536f60;
  font-size: 1.05rem;
}
.diagnostic-subsection { margin-top: 1rem; }
.diagnostic-subsection h3 {
  margin: 0 0 .5rem;
  color: #6f786f;
  font-size: .78rem;
}
.diagnostic-daily-list {
  display: grid;
  gap: .38rem;
}
.diagnostic-daily-list > article {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: .16rem .65rem;
  padding: .58rem .65rem;
  border-radius: .7rem;
  background: rgba(255, 250, 244, .72);
}
.diagnostic-daily-list strong {
  grid-row: 1 / span 2;
  align-self: center;
  color: #776d67;
  font-size: .72rem;
}
.diagnostic-daily-list span {
  color: #6f786f;
  font-size: .72rem;
  font-weight: 700;
}
.memory-v3-diagnostic {
  padding: .72rem;
  border: 1px solid rgba(98, 118, 212, .14);
  border-radius: .8rem;
  background: rgba(239, 241, 251, .6);
}
.memory-v3-diagnostic > strong {
  color: #53638f;
  font-size: .8rem;
}
.memory-v3-diagnostic p {
  margin: .35rem 0 0;
  color: #7d7e88;
  font-size: .7rem;
  line-height: 1.55;
}
.memory-v3-diagnostic-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .55rem;
}
.memory-v3-diagnostic-metrics span {
  padding: .28rem .42rem;
  border-radius: 999px;
  background: rgba(98, 118, 212, .1);
  color: #63709a;
  font-size: .64rem;
}
.memory-v3-diagnostic .diagnostic-warning {
  display: block;
  margin-bottom: .55rem;
  color: #b34f4f;
}
.memory-v2-review-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .22rem .7rem;
  align-items: center;
}
.memory-v2-review-heading h3 { margin: 0; color: #536f60; font-size: 1rem; }
.memory-v2-review-heading span {
  grid-column: 1;
  color: #829086;
  font-size: .68rem;
}
.memory-v2-review-heading button {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.memory-v2-narrative {
  max-height: 20rem;
  overflow-y: auto;
  margin: 0;
  padding: .75rem .8rem;
  border: 1px solid rgba(134, 169, 144, .14);
  border-radius: .72rem;
  background: rgba(255, 255, 255, .56);
  color: #574f4a;
  font-size: .82rem;
  line-height: 1.72;
  white-space: pre-wrap;
}
.memory-v2-review h4 { margin: 0 0 .45rem; color: #6f786f; font-size: .76rem; }
.memory-v2-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}
.memory-v2-insight-grid > section {
  min-width: 0;
  padding: .65rem;
  border: 1px solid rgba(126, 119, 111, .1);
  border-radius: .72rem;
  background: rgba(255, 255, 255, .42);
}
.memory-v2-evidence-list,
.memory-v2-candidate-list { display: grid; gap: .45rem; }
.memory-v2-candidate-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.memory-v2-evidence-list article,
.memory-v2-candidate-list article {
  padding: .62rem .68rem;
  border-radius: .72rem;
  background: rgba(255, 255, 255, .7);
}
.memory-v2-evidence-list p,
.memory-v2-candidate-list p {
  margin: 0;
  color: #605753;
  font-size: .76rem;
  line-height: 1.5;
}
.memory-v2-evidence-list span,
.memory-v2-candidate-list small {
  display: block;
  margin-top: .28rem;
  color: #9b8e87;
  font-size: .63rem;
}
.memory-v2-candidate-labels { display: flex; flex-wrap: wrap; gap: .28rem; margin-bottom: .38rem; }
.memory-v2-candidate-labels span {
  border-radius: 99rem;
  background: rgba(236, 244, 238, .94);
  color: #688070;
  padding: .2rem .38rem;
  font-size: .61rem;
}
.memory-v2-candidate textarea {
  min-height: 5rem;
  resize: vertical;
  line-height: 1.55;
}
.memory-v2-candidate-settings {
  display: grid;
  grid-template-columns: minmax(9rem, .85fr) minmax(9rem, 1fr);
  gap: .5rem;
  margin-top: .52rem;
}
.memory-v2-candidate-settings select {
  padding: .55rem .62rem;
  border-radius: .65rem;
  font-size: .72rem;
}
.memory-v2-candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  margin-top: .58rem;
}
.memory-v2-candidate-actions button {
  min-height: 2.05rem;
  padding: .48rem .66rem;
  border-radius: .65rem;
  font-size: .7rem;
  font-weight: 720;
}
.memory-v2-approve {
  border: 0;
  background: #6276d4;
  color: #fff;
  box-shadow: 0 .35rem .75rem rgba(98, 118, 212, .18);
}
.memory-v2-reject {
  border: 1px solid rgba(182, 83, 88, .18);
  background: #fff7f6;
  color: #b65358;
}
.memory-v2-candidate-feedback {
  display: block;
  min-height: 1rem;
  margin-top: .35rem;
  color: #927f76;
  font-size: .66rem;
}
.memory-v2-candidate.is-approved {
  border: 1px solid rgba(91, 137, 102, .18);
  background: rgba(239, 247, 241, .78);
}
.memory-v2-candidate.is-duplicate,
.memory-v2-candidate.is-merged {
  border: 1px solid rgba(98, 118, 212, .18);
  background: rgba(238, 240, 251, .72);
}
.memory-v2-candidate.is-rejected {
  border: 1px solid rgba(182, 83, 88, .12);
  background: rgba(250, 241, 240, .72);
}
.memory-v2-candidate.is-rejected textarea,
.memory-v2-candidate.is-rejected select { opacity: .76; }
.memory-v2-similarity-review {
  display: grid;
  gap: .65rem;
  margin-top: .7rem;
  padding: .72rem;
  border: 1px solid rgba(201, 148, 62, .25);
  border-radius: .78rem;
  background: rgba(255, 250, 233, .86);
}
.memory-v2-similarity-review.hidden { display: none; }
.memory-v2-similarity-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
}
.memory-v2-similarity-heading > div {
  display: grid;
  gap: .14rem;
  min-width: 0;
}
.memory-v2-similarity-heading strong {
  color: #765a2f;
  font-size: .76rem;
}
.memory-v2-similarity-heading span {
  color: #958367;
  font-size: .65rem;
  line-height: 1.45;
}
.memory-v2-similarity-heading small {
  flex: 0 0 auto;
  padding: .18rem .35rem;
  border-radius: 99rem;
  background: #e8f1e9;
  color: #5f8067;
  font-size: .56rem;
  font-weight: 720;
}
.memory-v2-similarity-matches {
  display: grid;
  gap: .4rem;
}
.memory-v2-similarity-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .5rem;
  padding: .52rem .58rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .65rem;
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
}
.memory-v2-similarity-choice input { margin-top: .2rem; }
.memory-v2-similarity-choice > div {
  display: grid;
  gap: .2rem;
  min-width: 0;
}
.memory-v2-similarity-choice > div > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.memory-v2-similarity-choice strong {
  color: #9b6757;
  font-size: .65rem;
}
.memory-v2-similarity-choice span,
.memory-v2-similarity-choice small {
  color: #9c8a82;
  font-size: .6rem;
}
.memory-v2-similarity-choice p {
  margin: 0;
  color: #665853;
  font-size: .7rem;
  line-height: 1.48;
}
.memory-v2-similarity-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}
.memory-v2-similarity-comparison > div {
  padding: .52rem .58rem;
  border-radius: .62rem;
  background: rgba(249, 244, 238, .68);
}
.memory-v2-similarity-comparison strong {
  color: #8c736a;
  font-size: .62rem;
}
.memory-v2-similarity-comparison p {
  margin: .22rem 0 0;
  color: #6c5e59;
  font-size: .68rem;
  line-height: 1.48;
}
.memory-v2-similarity-merge-editor {
  display: grid;
  gap: .42rem;
}
.memory-v2-similarity-merge-editor > p {
  margin: 0;
  color: #8e7b72;
  font-size: .64rem;
  line-height: 1.45;
}
.memory-v2-similarity-merge-editor > div {
  display: grid;
  grid-template-columns: minmax(8rem, .72fr) minmax(0, 1.7fr);
  gap: .45rem;
}
.memory-v2-similarity-merge-editor label {
  display: grid;
  gap: .24rem;
  color: #8f7c74;
  font-size: .62rem;
  font-weight: 680;
}
.memory-v2-similarity-merge-editor textarea {
  min-height: 4.7rem;
  resize: vertical;
}
.memory-v2-similarity-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .42rem;
}
.memory-v2-similarity-actions button {
  min-height: 2.15rem;
  padding: .45rem .62rem;
  border-radius: .62rem;
  font-size: .68rem;
  font-weight: 720;
}
.memory-preview {
  display: grid;
  gap: .5rem;
  max-height: 19rem;
  overflow-y: auto;
  margin-top: .85rem;
  padding: .6rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .85rem;
  background: rgba(251, 239, 231, .45);
}
.memory-preview article { padding: .6rem .65rem; border-radius: .65rem; background: rgba(255, 251, 245, .78); }
.memory-preview strong { color: #a16a5a; font-size: .7rem; }
.memory-preview p { margin: .2rem 0; color: #6e5b55; font-size: .8rem; line-height: 1.45; }
.memory-preview span { color: #aa968e; font-size: .67rem; }
.memory-import-button {
  margin-top: .75rem;
  border: 0;
  border-radius: .78rem;
  background: linear-gradient(135deg, #d99a80, #be7565);
  color: #fffaf6;
  padding: .67rem .9rem;
  font-size: .8rem;
  font-weight: 720;
}
.memory-status { margin-top: .62rem; }
.memory-library-tabs {
  display: flex;
  gap: .35rem;
  margin: .85rem 0;
  padding: .25rem;
  border-radius: .76rem;
  background: rgba(249, 237, 229, .72);
}
.memory-library-tabs button {
  flex: 1;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: #947d74;
  padding: .48rem;
  font-size: .75rem;
  font-weight: 700;
}
.memory-library-tabs button.is-active { background: #fff9f4; color: #955f50; box-shadow: 0 .2rem .5rem rgba(125, 88, 72, .08); }
.memory-library-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .75rem 0;
  padding: .78rem .85rem;
  border: 1px solid rgba(201, 148, 62, .24);
  border-left: .28rem solid #d7a649;
  border-radius: .86rem;
  background: rgba(255, 249, 230, .82);
}
.memory-library-reminder.hidden { display: none; }
.memory-library-reminder.is-complete {
  border-color: rgba(92, 139, 105, .2);
  border-left-color: #6e9b79;
  background: rgba(239, 247, 241, .84);
}
.memory-library-reminder > div {
  display: grid;
  gap: .16rem;
  min-width: 0;
}
.memory-library-reminder span {
  color: #a78037;
  font-size: .62rem;
  font-weight: 760;
  letter-spacing: .08em;
}
.memory-library-reminder strong {
  color: #695335;
  font-size: .88rem;
}
.memory-library-reminder p {
  margin: 0;
  color: #91806a;
  font-size: .7rem;
  line-height: 1.45;
}
.memory-library-reminder button {
  flex: 0 0 auto;
  min-height: 2.35rem;
  padding: .58rem .75rem;
  border: 0;
  border-radius: .68rem;
  background: #c68d3e;
  color: #fff;
  font-size: .72rem;
  font-weight: 740;
}
.memory-library-reminder.is-complete button { background: #6e9277; }
.memory-library-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin: .75rem 0 1rem;
}
.memory-library-summary article {
  display: grid;
  gap: .2rem;
  min-width: 0;
  padding: .68rem .72rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .78rem;
  background: rgba(251, 239, 231, .4);
}
.memory-library-summary article.is-review[role="button"] {
  cursor: pointer;
  border-color: rgba(201, 148, 62, .24);
  background: rgba(255, 249, 230, .76);
}
.memory-library-summary article.is-review[role="button"]:hover {
  transform: translateY(-1px);
}
.memory-library-summary span,
.memory-library-summary small {
  overflow: hidden;
  color: #9a887f;
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-library-summary strong {
  color: #62514b;
  font-size: 1.02rem;
}
.memory-library-summary .is-active strong { color: #587866; }
.memory-library-summary .is-review strong { color: #b47d2f; }
.memory-library-summary .is-disabled strong { color: #8a817a; }
.memory-library-subheading,
.memory-library-list-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.memory-library-subheading h3,
.memory-library-list-heading h3 {
  margin: 0;
  color: #6b5750;
  font-size: .8rem;
}
.memory-library-subheading p,
.memory-library-list-heading p {
  margin: .2rem 0 0;
  color: #a08f87;
  font-size: .66rem;
}
.memory-library-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .42rem;
  margin: .55rem 0 .9rem;
}
.memory-library-categories button {
  position: relative;
  display: grid;
  gap: .18rem;
  min-width: 0;
  min-height: 3.4rem;
  padding: .55rem .62rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .7rem;
  background: rgba(255, 250, 244, .7);
  color: #8b746b;
  text-align: left;
}
.memory-library-categories button.is-active {
  border-color: rgba(98, 118, 212, .24);
  background: rgba(235, 238, 252, .78);
  color: #596bbd;
  box-shadow: 0 .2rem .55rem rgba(98, 118, 212, .08);
}
.memory-library-categories strong {
  overflow: hidden;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-library-categories span {
  color: #a7958d;
  font-size: .62rem;
}
.memory-library-categories i {
  position: absolute;
  right: .38rem;
  bottom: .38rem;
  padding: .14rem .28rem;
  border-radius: 99rem;
  background: #fff1cf;
  color: #a77528;
  font-size: .55rem;
  font-style: normal;
}
.memory-similarity-panel {
  margin: 0 0 .9rem;
  border: 1px solid rgba(151, 105, 88, .11);
  border-radius: .8rem;
  background: rgba(249, 244, 238, .5);
  overflow: hidden;
}
.memory-similarity-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .65rem .72rem;
  cursor: pointer;
  list-style: none;
}
.memory-similarity-panel > summary::-webkit-details-marker { display: none; }
.memory-similarity-panel > summary > div {
  display: grid;
  gap: .14rem;
  min-width: 0;
}
.memory-similarity-panel > summary strong {
  color: #765f56;
  font-size: .74rem;
}
.memory-similarity-panel > summary span {
  overflow: hidden;
  color: #9b8b84;
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-similarity-panel > summary i {
  flex: 0 0 auto;
  min-width: 1.45rem;
  padding: .18rem .36rem;
  border-radius: 99rem;
  background: #fff0cd;
  color: #a77528;
  font-size: .6rem;
  font-style: normal;
  font-weight: 760;
  text-align: center;
}
.memory-similarity-panel > summary i.hidden { display: none; }
.memory-similarity-content {
  padding: 0 .72rem .72rem;
  border-top: 1px solid rgba(151, 105, 88, .08);
}
.memory-similarity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .58rem 0 .35rem;
}
.memory-similarity-toolbar p {
  margin: 0;
  color: #96857d;
  font-size: .64rem;
  line-height: 1.48;
}
.memory-similarity-toolbar button {
  flex: 0 0 auto;
  min-height: 2.05rem;
}
.memory-similarity-status {
  min-height: .9rem;
  margin: .1rem 0 .45rem;
  color: #8a837b;
  font-size: .6rem;
}
.memory-similarity-list {
  display: grid;
  gap: .48rem;
}
.memory-similarity-empty {
  display: grid;
  gap: .2rem;
  padding: .7rem;
  border: 1px dashed rgba(151, 105, 88, .14);
  border-radius: .7rem;
  background: rgba(255, 252, 248, .64);
  text-align: center;
}
.memory-similarity-empty strong {
  color: #74655f;
  font-size: .7rem;
}
.memory-similarity-empty p {
  margin: 0;
  color: #9a8a83;
  font-size: .62rem;
}
.memory-similarity-item {
  border: 1px solid rgba(201, 148, 62, .2);
  border-radius: .72rem;
  background: rgba(255, 250, 233, .62);
  overflow: hidden;
}
.memory-similarity-item.is-possible_conflict {
  border-color: rgba(182, 83, 88, .2);
  background: rgba(255, 244, 243, .65);
}
.memory-similarity-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .58rem .64rem;
  cursor: pointer;
  list-style: none;
}
.memory-similarity-item > summary::-webkit-details-marker { display: none; }
.memory-similarity-item > summary > div {
  display: grid;
  gap: .2rem;
  min-width: 0;
}
.memory-similarity-item > summary > div > div {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.memory-similarity-item > summary strong {
  color: #a77528;
  font-size: .64rem;
}
.memory-similarity-item.is-possible_conflict > summary strong {
  color: #b65358;
}
.memory-similarity-item > summary span,
.memory-similarity-item > summary small {
  flex: 0 0 auto;
  color: #9b8a83;
  font-size: .58rem;
}
.memory-similarity-item > summary p {
  overflow: hidden;
  margin: 0;
  color: #6f615c;
  font-size: .67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-similarity-item-body {
  display: grid;
  gap: .55rem;
  padding: .08rem .64rem .64rem;
  border-top: 1px solid rgba(151, 105, 88, .08);
}
.memory-similarity-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  padding-top: .55rem;
}
.memory-similarity-pair section {
  display: grid;
  align-content: start;
  gap: .25rem;
  min-width: 0;
  padding: .55rem;
  border-radius: .62rem;
  background: rgba(255, 255, 255, .72);
}
.memory-similarity-pair section > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.memory-similarity-pair strong {
  color: #8b6e63;
  font-size: .62rem;
}
.memory-similarity-pair span,
.memory-similarity-pair small {
  color: #a09088;
  font-size: .58rem;
}
.memory-similarity-pair p {
  margin: 0;
  color: #665853;
  font-size: .68rem;
  line-height: 1.5;
}
.memory-similarity-merge-editor {
  display: grid;
  grid-template-columns: minmax(8rem, .7fr) minmax(9rem, .9fr) minmax(0, 1.6fr) auto;
  align-items: end;
  gap: .45rem;
}
.memory-similarity-merge-editor > label {
  margin: 0;
}
.memory-similarity-merge-editor > label > span {
  display: block;
  margin: 0 0 .26rem .05rem;
  color: #917a71;
  font-size: .64rem;
  font-weight: 680;
}
.memory-similarity-merge-editor textarea {
  min-height: 4rem;
  resize: vertical;
}
.memory-similarity-merge,
.memory-similarity-prefer {
  min-height: 2.1rem;
  padding: .46rem .62rem;
  border: 0;
  border-radius: .62rem;
  background: #6e9277;
  color: #fff;
  font-size: .68rem;
  font-weight: 720;
}
.memory-similarity-prefer {
  background: #a76a62;
}
.memory-similarity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
}
.memory-similarity-actions button {
  min-height: 2.05rem;
  font-size: .67rem;
}
.memory-similarity-feedback {
  min-height: .9rem;
  margin: 0;
  color: #8d7b73;
  font-size: .62rem;
}
.memory-library-filters {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(7rem, .72fr) minmax(8rem, .8fr) minmax(12rem, 1.35fr) auto;
  align-items: end;
  gap: .5rem;
  margin: 0 0 .9rem;
  padding: .68rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .78rem;
  background: rgba(249, 244, 238, .58);
}
.memory-library-filters label {
  display: grid;
  gap: .28rem;
  min-width: 0;
}
.memory-library-filters label > span {
  color: #8f7c74;
  font-size: .64rem;
  font-weight: 680;
}
.memory-library-filters input,
.memory-library-filters select {
  width: 100%;
  min-width: 0;
}
.memory-library-list-heading { margin: .3rem 0 .55rem; }
.memory-library { display: grid; gap: .65rem; }
.memory-empty {
  display: grid;
  gap: .22rem;
  margin: .4rem 0;
  padding: 1rem;
  border: 1px dashed rgba(151, 105, 88, .16);
  border-radius: .82rem;
  color: #9c8780;
  text-align: center;
}
.memory-empty strong { color: #76645d; font-size: .78rem; }
.memory-empty p { margin: 0; font-size: .7rem; }
.memory-card {
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .85rem;
  background: rgba(251, 239, 231, .42);
  overflow: hidden;
}
.memory-card.is-needs_review {
  border-color: rgba(201, 148, 62, .24);
  background: rgba(255, 249, 230, .45);
}
.memory-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .68rem .75rem;
  cursor: pointer;
  list-style: none;
}
.memory-card > summary::-webkit-details-marker { display: none; }
.memory-card > summary > div {
  display: grid;
  gap: .22rem;
  min-width: 0;
}
.memory-card-summary-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}
.memory-card-summary-labels > span:first-child {
  color: #9b6757;
  font-size: .65rem;
  font-weight: 740;
}
.memory-card > summary p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #665853;
  font-size: .76rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.memory-card > summary small {
  overflow: hidden;
  color: #a3928a;
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-card-status {
  padding: .15rem .34rem;
  border-radius: 99rem;
  font-size: .58rem;
  font-weight: 720;
}
.memory-card-status.is-active { background: #e4f0e4; color: #5e8168; }
.memory-card-status.is-needs_review { background: #fff0cd; color: #a77528; }
.memory-card-status.is-disabled { background: #eee9e5; color: #7d716b; }
.memory-card-expand-hint {
  flex: 0 0 auto;
  color: #9b8a83;
  font-size: .64rem;
}
.memory-card-expand-hint::after { content: " ↓"; }
.memory-card[open] .memory-card-expand-hint::after { content: " ↑"; }
.memory-card-editor {
  padding: .05rem .75rem .75rem;
  border-top: 1px solid rgba(151, 105, 88, .08);
}
.memory-card-form-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr .72fr;
  gap: .55rem;
}
.memory-card .memory-field { margin-top: .6rem; }
.memory-card .memory-field:first-child { margin-top: 0; }
.memory-field > span {
  display: block;
  margin: 0 0 .26rem .05rem;
  color: #917a71;
  font-size: .68rem;
  font-weight: 680;
}
.memory-field textarea { min-height: 4.5rem; resize: vertical; }
.memory-meta { margin: .62rem 0 0; color: #aa968e; font-size: .67rem; }
.memory-card-actions { display: flex; align-items: center; gap: .55rem; margin-top: .68rem; }
.memory-approve,
.memory-pause {
  min-height: 2.1rem;
  padding: .46rem .62rem;
  border-radius: .62rem;
  font-size: .7rem;
  font-weight: 720;
}
.memory-approve {
  border: 0;
  background: #6e9277;
  color: #fff;
}
.memory-pause {
  border: 1px solid rgba(151, 105, 88, .12);
  background: #f4efeb;
  color: #7f746e;
}
.memory-delete {
  border: 0;
  background: transparent;
  color: #b36262;
  padding: .4rem .15rem;
  font-size: .74rem;
}
.memory-feedback { color: #8b776f; font-size: .7rem; }
.memory-library-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin-top: .75rem;
}
.memory-library-pagination span {
  color: #8e827b;
  font-size: .68rem;
}
.memory-library-pagination button:disabled { opacity: .42; }
.memory-policy-panel {
  margin-top: .9rem;
  padding: .75rem;
  border: 1px solid rgba(151, 105, 88, .1);
  border-radius: .8rem;
  background: rgba(255, 250, 244, .64);
}
.memory-policy-panel summary {
  cursor: pointer;
  color: #9e6757;
  font-size: .8rem;
  font-weight: 740;
}
.memory-policy-panel > p { margin: .5rem 0 0; color: #9a837a; font-size: .74rem; }
.memory-policy-panel > p .config-status { margin-right: .25rem; vertical-align: .05rem; }
.site-filing {
  margin-top: auto;
  padding: .1rem 0 max(.1rem, env(safe-area-inset-bottom));
  text-align: center;
}
.site-filing nav {
  display: flex;
  justify-content: center;
  gap: .7rem;
  margin-bottom: .18rem;
}
.site-filing a {
  color: #99918a;
  font-size: .64rem;
  line-height: 1.4;
  text-decoration: none;
}
.site-filing a:hover { color: #6276d4; }
.site-filing .icp-link { display: inline-block; }

.site-review-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .7rem .8rem;
  border: 1px solid #e4ddd4;
  border-left: .28rem solid #e9c761;
  border-radius: .8rem;
  background: rgba(255, 254, 250, .76);
}
.site-review-note div {
  display: grid;
  gap: .12rem;
  min-width: 0;
}
.site-review-note strong {
  color: #4c4945;
  font-size: .78rem;
}
.site-review-note span {
  color: #8d857d;
  font-size: .66rem;
}
.site-review-note a {
  flex: 0 0 auto;
  color: #6276d4;
  font-size: .7rem;
  font-weight: 700;
  text-decoration: none;
}
.is-connected .site-review-note,
.is-native-app .site-review-note {
  display: none;
}

.legal-page {
  min-height: 100dvh;
  margin: 0;
  color: #4c4945;
}
.legal-shell {
  width: min(100% - 2rem, 48rem);
  margin: 0 auto;
  padding: max(2rem, env(safe-area-inset-top)) 0 3rem;
}
.legal-header {
  margin-bottom: 1.2rem;
}
.legal-kicker {
  margin: 0 0 .45rem;
  color: #6276d4;
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .08em;
}
.legal-header h1 {
  margin: 0;
  color: #403c39;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  letter-spacing: -.04em;
}
.legal-lead {
  margin: .65rem 0 0;
  color: #807970;
}
.legal-card {
  margin: 1rem 0;
  padding: 1.15rem 1.2rem;
  border: 1px solid #e2dbd2;
  border-radius: 1rem;
  background: rgba(255, 254, 250, .88);
  box-shadow: 0 .7rem 1.8rem rgba(91, 82, 73, .06);
}
.legal-card h2 {
  margin: 0 0 .55rem;
  color: #4c4945;
  font-size: 1rem;
}
.legal-card h3 {
  margin: 1rem 0 .35rem;
  color: #5b5550;
  font-size: .9rem;
}
.legal-card p,
.legal-card li,
.legal-meta dt,
.legal-meta dd {
  color: #6f6963;
  font-size: .86rem;
  line-height: 1.75;
}
.legal-card p { margin: .4rem 0; }
.legal-card ul { margin: .35rem 0; padding-left: 1.25rem; }
.legal-meta {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  margin: 0;
}
.legal-meta dt,
.legal-meta dd {
  margin: 0;
  padding: .45rem 0;
  border-bottom: 1px solid #eee8e1;
}
.legal-meta dt { color: #8c837b; }
.legal-meta dd { color: #514d49; font-weight: 650; }
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}
.legal-links a,
.legal-back {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: .52rem .72rem;
  border-radius: .65rem;
  background: #eeece8;
  color: #6276d4;
  font-size: .78rem;
  font-weight: 720;
  text-decoration: none;
}
.legal-footer {
  margin-top: 1.3rem;
  color: #99918a;
  font-size: .72rem;
  text-align: center;
}
.legal-footer a { color: inherit; text-decoration: none; }

@media (max-width: 600px) {
  .desktop-only { display: none; }
}
@media (max-width: 840px) {
  .studio-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "nav"
      "content";
    row-gap: .75rem;
    width: min(100%, 52rem);
  }
  .studio-header { margin-bottom: 0; }
  .studio-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    padding: .38rem;
    scrollbar-width: none;
  }
  .studio-nav::-webkit-scrollbar { display: none; }
  .studio-nav button {
    flex: 0 0 9.5rem;
    padding: .6rem .65rem;
  }
  .memory-v2-generator-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .memory-v2-generator-controls > button { width: fit-content; }
  .memory-v2-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .memory-v2-filters > button { width: fit-content; }
  .memory-v2-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-v2-candidate-list { grid-template-columns: 1fr; }
  .memory-v2-insight-grid { grid-template-columns: 1fr; }
  .transcript-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transcript-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transcript-filters > button { width: fit-content; }
  .transcript-task-list-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .transcript-task-list { grid-template-columns: 1fr; }
  .transcript-task-purpose-options { grid-template-columns: 1fr; }
  .transcript-task-preview-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .transcript-task-cloud-boundary { grid-template-columns: 1fr; }
  .transcript-task-run-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .transcript-task-candidate-list { grid-template-columns: 1fr; }
  .diagnostic-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-library-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-library-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-similarity-merge-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .memory-library-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-library-filters > button { width: fit-content; }
}
@media (max-width: 420px) {
  .editor-grid { grid-template-columns: 1fr; gap: 0; }
  .studio-shell {
    row-gap: .48rem;
    padding: max(.72rem, env(safe-area-inset-top)) .72rem 2rem;
  }
  .studio-header {
    padding: .1rem .05rem .58rem;
  }
  .studio-header h1 {
    margin: .18rem 0 .16rem;
    font-size: 1.35rem;
  }
  .studio-header > p:last-child {
    display: -webkit-box;
    overflow: hidden;
    font-size: .7rem;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .studio-kicker {
    margin: .4rem 0 .08rem;
    font-size: .6rem;
  }
  .config-legend {
    gap: .28rem;
    margin-top: .48rem;
  }
  .config-legend .config-status {
    padding: .2rem .38rem;
    font-size: .57rem;
  }
  .studio-nav {
    gap: .28rem;
    padding: .3rem;
    border-radius: .82rem;
  }
  .studio-nav button {
    flex-basis: 6.9rem;
    gap: 0;
    padding: .48rem .55rem;
  }
  .studio-nav button strong { font-size: .72rem; }
  .studio-nav button span { display: none; }
  .studio-section {
    margin-bottom: .62rem;
    padding: .78rem .75rem;
    border-radius: .86rem;
  }
  .section-heading {
    gap: .55rem;
  }
  .section-heading h2 { font-size: .96rem; }
  .section-heading .section-kicker {
    margin-bottom: .12rem;
    font-size: .59rem;
  }
  .section-copy {
    margin: .32rem 0 .68rem;
    font-size: .7rem;
    line-height: 1.48;
  }
  [data-studio-page="transcripts"] > .section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  [data-studio-page="transcripts"] > .section-heading .memory-protected-actions {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    width: 100%;
  }
  [data-studio-page="transcripts"] > .section-heading .memory-protected-actions button {
    min-width: 0;
    padding-inline: .52rem;
  }
  .memory-access-panel {
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: .65rem;
    padding: 1rem;
  }
  .memory-access-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .memory-access-actions button { width: 100%; }
  .memory-protected-actions { justify-content: flex-start; }
  .memory-v2-generator-heading,
  .memory-v2-generator-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .memory-v2-generator-controls { grid-template-columns: 1fr; }
  .memory-v2-generator-controls > button,
  .memory-v2-generator-actions button { width: 100%; }
  .memory-v2-sanitized-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .memory-v2-sanitized-actions button { width: 100%; }
  .memory-v2-source-metrics { grid-template-columns: 1fr 1fr; }
  .memory-v2-sanitized-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .memory-v2-privacy-filter select { width: 100%; }
  .memory-v2-sanitized-message {
    grid-template-columns: 1fr;
    gap: .28rem;
  }
  .memory-v2-privacy-badges {
    justify-content: flex-start;
    max-width: none;
  }
  .memory-v2-current-day > div,
  .memory-v2-list-heading,
  .memory-v2-detail-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .memory-v2-current-day-state { max-width: none; text-align: left; }
  .memory-v2-filters { grid-template-columns: 1fr; }
  .memory-v2-filters > button { width: 100%; }
  .memory-v2-summary { grid-template-columns: 1fr 1fr; }
  .memory-v2-day-button-top { align-items: flex-start; }
  .memory-v2-day-button strong { white-space: normal; }
  .memory-v2-review-heading { grid-template-columns: 1fr; }
  .memory-v2-review-heading span,
  .memory-v2-review-heading button {
    grid-column: 1;
    grid-row: auto;
  }
  .memory-v2-review-heading button { width: 100%; margin-top: .35rem; }
  .memory-v2-candidate-settings { grid-template-columns: 1fr; }
  .memory-v2-candidate-actions button { flex: 1 1 8rem; }
  .memory-v2-similarity-heading,
  .memory-similarity-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .memory-v2-similarity-comparison,
  .memory-v2-similarity-merge-editor > div,
  .memory-similarity-pair,
  .memory-similarity-merge-editor {
    grid-template-columns: 1fr;
  }
  .memory-similarity-toolbar button,
  .memory-similarity-merge-editor > button {
    width: 100%;
  }
  .transcript-security-note > summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .transcript-security-note > summary span {
    order: 3;
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
  .transcript-security-grid { grid-template-columns: 1fr; }
  .transcript-summary { grid-template-columns: 1fr 1fr; }
  .transcript-filters { grid-template-columns: 1fr 1fr; }
  .transcript-filters label:first-child,
  .transcript-filters > button {
    grid-column: 1 / -1;
  }
  .transcript-filters > button { width: 100%; }
  .transcript-list-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .transcript-list-item-actions,
  .transcript-list-item-actions button {
    width: 100%;
  }
  .transcript-list-item-badges {
    align-items: flex-end;
    flex-direction: column;
  }
  .transcript-list-heading,
  .transcript-detail-heading,
  .transcript-detail-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .transcript-detail-toolbar-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }
  .transcript-detail-toolbar-actions p {
    text-align: left;
    white-space: normal;
  }
  .transcript-detail-toolbar-actions button { width: 100%; }
  .transcript-detail-safety {
    align-items: flex-start;
    flex-direction: column;
  }
  .transcript-selection-panel > summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .transcript-selection-panel > summary small {
    order: 3;
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
  .transcript-range-selector { grid-template-columns: 1fr 1fr; }
  .transcript-range-selector > button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .transcript-selection-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .transcript-selection-actions button { width: 100%; }
  .transcript-selection-actions .primary-compact-button {
    grid-column: 1 / -1;
    margin-left: 0;
  }
  .transcript-detail-search { grid-template-columns: 1fr 1fr; }
  .transcript-detail-search label { grid-column: 1 / -1; }
  .transcript-detail-search > button { width: 100%; }
  .transcript-message header {
    align-items: flex-start;
    flex-direction: column;
    gap: .18rem;
  }
  .transcript-message-heading {
    justify-content: space-between;
    width: 100%;
  }
  .transcript-pagination-top { justify-content: center; }
  .transcript-task-safety {
    align-items: flex-start;
    flex-direction: column;
  }
  .transcript-task-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .transcript-task-card header {
    align-items: flex-start;
  }
  .transcript-task-card-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .transcript-task-card-actions button { width: 100%; }
  .transcript-task-stage-banner,
  .transcript-task-subheading,
  .transcript-task-prepare-actions,
  .transcript-task-cloud-actions,
  .transcript-task-preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .transcript-task-stage-flags { justify-content: flex-start; }
  .transcript-task-prepare-actions button { width: 100%; }
  .transcript-task-preview-summary {
    grid-template-columns: 1fr 1fr;
  }
  .transcript-task-preview-filter {
    position: static;
    padding: .55rem;
  }
  .transcript-task-preview-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .transcript-task-preview-filter-actions button {
    justify-content: space-between;
    width: 100%;
  }
  .transcript-task-preview-filter-actions button:last-child {
    grid-column: 1 / -1;
  }
  .transcript-task-run-summary { grid-template-columns: 1fr 1fr; }
  .transcript-task-candidate-editor-grid { grid-template-columns: 1fr; }
  .transcript-task-review-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .transcript-task-review-actions button { width: 100%; }
  .transcript-task-preview-toolbar .transcript-pagination {
    justify-content: space-between;
    width: 100%;
  }
  .transcript-task-preview-message summary {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .transcript-task-preview-snippet {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .transcript-task-preview-tags {
    grid-column: 2;
    grid-row: 1;
  }
  .transcript-task-journal-content li {
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
  }
  .diagnostic-summary-grid { grid-template-columns: 1fr; }
  .diagnostic-daily-list > article { grid-template-columns: 1fr; }
  .diagnostic-daily-list strong { grid-row: auto; }
  .memory-library-reminder {
    align-items: stretch;
    flex-direction: column;
  }
  .memory-library-reminder button { width: 100%; }
  .memory-library-summary { grid-template-columns: 1fr 1fr; }
  .memory-library-categories { grid-template-columns: 1fr 1fr; }
  .memory-similarity-panel > summary {
    align-items: flex-start;
  }
  .memory-similarity-panel > summary span {
    white-space: normal;
  }
  .memory-library-filters { grid-template-columns: 1fr; }
  .memory-library-filters > button { width: 100%; }
  .memory-card-form-grid { grid-template-columns: 1fr; }
  .memory-card-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .memory-card-actions button { flex: 1 1 8rem; }
  .memory-feedback { flex-basis: 100%; }
}

/* 方案 8：柔和撞色。颜色用作信息锚点，避免大面积高饱和。 */
:root { background: #fcfaf6; color: #4c4945; }
body {
  background:
    linear-gradient(90deg, #6276d4 0 24%, #d77d68 24% 48%, #e9c761 48% 64%, #6276d4 64%) top / 100% .32rem no-repeat,
    linear-gradient(165deg, #fcfaf6, #f5f1ea 74%);
}
.app-shell { width: min(100%, 42rem); gap: .85rem; padding-inline: 1.3rem; }
.app-header { padding-top: .55rem; }
.avatar { border-radius: .82rem; box-shadow: 0 .55rem 1.2rem rgba(53, 51, 58, .13); }
.identity-name { color: #4c4945; font-size: 1.2rem; }
.presence { color: #918980; }
.presence i { background: #86a990; }
.connection-badge { border: 0; box-shadow: none; background: transparent; color: #68726b; padding-right: 0; }
.connection-badge i { background: #86a990; }
.space-switch {
  display: flex; gap: .65rem; margin-top: 1.1rem; padding: 0;
  border: 0; border-bottom: 1px solid #ded7ce; border-radius: 0; background: transparent; box-shadow: none;
}
.space-option { flex: 0 0 4.8rem; border-radius: .68rem .68rem 0 0; color: #807a74; padding: .63rem .6rem; }
.space-option.is-active { background: #6276d4; box-shadow: none; color: #fff; }
.persona-row { margin-top: .45rem; padding: 0; }
.persona-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; }
.persona-summary { color: #4c4945; font-size: .95rem; font-weight: 720; }
.persona-picker { border-radius: .6rem; background: #f2eee8; padding: .08rem .3rem; }
.conversation-actions { margin-top: .38rem; padding: 0; }
.conversation-actions button, .desktop-only, .back-link { color: #7e766e; }
.chat-panel { gap: .7rem; }
.conversation-stamp {
  align-self: flex-start; margin: .2rem 0 0; padding: .25rem .5rem;
  border: 0; border-left: .35rem solid #e9c761; border-radius: 0; background: transparent;
  color: #8f867e; font-weight: 650;
}
.companion-pulse {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: .24rem;
  max-width: min(calc(100% - 3.3rem), 20rem);
  margin: -.8rem 0 .08rem 3.3rem;
  color: #97877f;
  font-size: .62rem;
  line-height: 1.28;
  animation: companion-pulse-in .2s ease-out;
}
.companion-pulse.hidden { display: none; }
.companion-pulse > span {
  color: #c98270;
  font-size: .64rem;
}
.companion-pulse p { margin: 0; }
@keyframes companion-pulse-in {
  from { opacity: 0; transform: translateY(.22rem); }
  to { opacity: 1; transform: translateY(0); }
}
.messages { gap: 1rem; padding: .3rem 0 .6rem; }
.message {
  display: grid; grid-template-columns: 2.8rem minmax(0, 1fr); align-items: start; gap: .55rem;
  width: min(100%, 33rem); min-width: 0; max-width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.message.user { grid-template-columns: minmax(0, 1fr) 2.8rem; align-self: flex-end; width: min(100%, 31rem); min-width: 0; max-width: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #4b4642; }
.message-avatar {
  position: relative; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; overflow: hidden;
  padding: 0; border: 2px solid #fff; border-radius: .66rem; background: #22242d; color: #e9c761; font-size: .78rem; box-shadow: 0 .25rem .6rem rgba(63, 60, 56, .12);
}
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message.assistant .message-avatar.has-agent-unread::after {
  position: absolute;
  top: .16rem;
  right: .16rem;
  width: .5rem;
  height: .5rem;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #d77866;
  box-shadow: 0 .1rem .28rem rgba(82, 49, 42, .28);
  content: "";
}
.message.assistant .message-avatar[data-companion-tone]::before {
  position: absolute;
  z-index: 1;
  bottom: .14rem;
  left: .14rem;
  width: .42rem;
  height: .42rem;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #8ca592;
  box-shadow: 0 .08rem .2rem rgba(49, 45, 42, .24);
  content: "";
}
.message.assistant .message-avatar[data-companion-tone="thinking"]::before { background: #6276d4; }
.message.assistant .message-avatar[data-companion-tone="longing"]::before { background: #d77d68; }
.message.assistant .message-avatar[data-companion-tone="care"]::before { background: #8ca592; }
.message.assistant .message-avatar[data-companion-tone="playful"]::before { background: #d7a65e; }
.message.assistant .message-avatar[data-companion-tone="warm"]::before { background: #d77d68; }
.message-avatar:active { transform: scale(.96); }
.message-avatar:focus-visible { outline: 2px solid #6276d4; outline-offset: 2px; }
.message.user .message-avatar { order: 2; border-radius: 50%; background: #f0d2bf; color: #855f52; }

.assistant-avatar-menu {
  position: fixed;
  z-index: 32;
  top: var(--app-viewport-top, 0);
  right: 0;
  left: 0;
  display: grid;
  height: var(--app-viewport-height, 100dvh);
  align-items: end;
  padding:
    1rem
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}
.assistant-avatar-menu.hidden { display: none; }
.assistant-avatar-menu-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(49, 43, 40, .28);
  backdrop-filter: blur(.24rem);
}
.assistant-avatar-menu-panel {
  position: relative;
  display: grid;
  width: min(100%, 26rem);
  margin: 0 auto;
  gap: .78rem;
  padding: .9rem;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: .82rem;
  background: #fffdfa;
  box-shadow: 0 1.2rem 3rem rgba(66, 55, 49, .24);
}
.assistant-avatar-menu-heading {
  display: flex;
  align-items: center;
  gap: .72rem;
  padding: .12rem .18rem .22rem;
}
.assistant-avatar-menu-preview {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: .62rem;
  background: #22242d;
  box-shadow: 0 .25rem .6rem rgba(63, 60, 56, .12);
  color: #e9c761;
  font-size: .82rem;
}
.assistant-avatar-menu-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.assistant-avatar-menu-preview img.hidden,
.assistant-avatar-menu-preview span.hidden { display: none; }
.assistant-avatar-menu-preview[data-companion-tone]::after {
  position: absolute;
  right: -.02rem;
  bottom: -.02rem;
  width: .62rem;
  height: .62rem;
  border: 2px solid #fffdfa;
  border-radius: 50%;
  background: #8ca592;
  content: "";
}
.assistant-avatar-menu-preview[data-companion-tone="thinking"]::after { background: #6276d4; }
.assistant-avatar-menu-preview[data-companion-tone="longing"]::after { background: #d77d68; }
.assistant-avatar-menu-preview[data-companion-tone="playful"]::after { background: #d7a65e; }
.assistant-avatar-menu-preview[data-companion-tone="warm"]::after { background: #d77d68; }
.assistant-avatar-menu-heading p {
  margin: 0 0 .12rem;
  color: #a4938a;
  font-size: .65rem;
  font-weight: 700;
}
.assistant-avatar-menu-heading h2 {
  margin: 0;
  color: #514b47;
  font-size: .98rem;
  letter-spacing: 0;
}
.assistant-avatar-menu-emotion {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  max-width: 100%;
  margin-top: .34rem;
  padding: .22rem .4rem;
  border: 1px solid #d8ddd8;
  border-radius: .42rem;
  background: #f3f5f2;
  color: #65706b;
  font-size: .61rem;
  line-height: 1.2;
}
.assistant-avatar-menu-emotion::before {
  width: .34rem;
  height: .34rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7a9a89;
  content: "";
}
.assistant-avatar-menu-emotion strong {
  overflow: hidden;
  color: #4f5d57;
  font-size: .63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-avatar-menu-emotion .ai-emotion-value {
  color: #7c8581;
  font-variant-numeric: tabular-nums;
}
.assistant-avatar-menu-emotion.hidden { display: none; }
.assistant-avatar-menu-actions {
  display: grid;
  overflow: hidden;
  border: 1px solid #e7e0d8;
  border-radius: .6rem;
  background: #fff;
}
.assistant-avatar-menu-actions > button {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  min-height: 4rem;
  padding: .7rem .78rem;
  border: 0;
  background: #fff;
  color: #5e5550;
  text-align: left;
}
.assistant-avatar-menu-actions > button + button {
  border-top: 1px solid #eee8e1;
}
.assistant-avatar-menu-actions > button:active { background: #f8f4ef; }
.assistant-avatar-menu-actions > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: .16rem;
}
.assistant-avatar-menu-actions strong {
  color: #554c47;
  font-size: .84rem;
}
.assistant-avatar-menu-actions small {
  overflow: hidden;
  color: #9a8f88;
  font-size: .66rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-avatar-menu-actions b {
  color: #b3a9a2;
  font-size: 1.15rem;
}
.assistant-avatar-menu-icon {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: .48rem;
  background: #eef0fb;
  color: #6276d4;
  font-size: .92rem;
}
.assistant-avatar-menu-icon.is-photo {
  background: #f7e9e1;
  color: #bd705e;
}
.assistant-avatar-menu-icon.is-memory {
  background: #e8f1ec;
  color: #648b73;
  font-size: 1.1rem;
}
.assistant-avatar-menu-cancel {
  min-height: 2.8rem;
  border: 0;
  border-radius: .55rem;
  background: #f1ede8;
  color: #746b65;
  font-size: .78rem;
  font-weight: 700;
}
.assistant-avatar-menu-cancel:active { background: #e8e1da; }

.message p {
  min-width: 0; margin: 0; padding: .83rem 1rem; border: 1px solid #e3dcd3; border-left: .34rem solid #6276d4;
  border-radius: 1rem; background: #fffefa; box-shadow: 0 .55rem 1.2rem rgba(94, 88, 79, .08); color: #514d49; font-size: .94rem;
}
.message.user p { border: 0; border-right: .9rem solid #d77d68; background: linear-gradient(135deg, #e9e4df, #ddd6ce); color: #4b4642; }
.message:nth-child(3n) p { border-left-color: #9fcdb8; }
.message.failed p { border-color: #cf7779; }
.message.pending p { border-color: #e0b65b; }
.message-content { min-width: 0; }
.message-timestamp {
  display: block;
  margin-top: .22rem;
  color: #a3948b;
  font-size: .64rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.message.user .message-timestamp {
  color: #a2766b;
  text-align: right;
}
.message-inline-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 1.32rem;
  min-width: 0;
}
.message-inline-row .message-text {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.message .voice-message-player {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: fit-content;
  min-width: 8.2rem;
  max-width: min(100%, 16rem);
  padding: .42rem .58rem;
  border: 1px solid #e1d9d0;
  border-radius: .82rem;
  background: #f4f0eb;
  color: #6f6862;
}
.message.user .voice-message-player {
  border-color: rgba(189, 105, 88, .18);
  background: linear-gradient(135deg, #e9e4df, #ddd6ce);
}
.message .voice-message-player.is-loading {
  opacity: .72;
}
.voice-message-player button {
  display: grid;
  flex: 0 0 auto;
  width: 1.58rem;
  height: 1.58rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fffefa;
  color: #756d67;
  font-size: .58rem;
  line-height: 1;
}
.voice-message-player button::before { content: attr(data-icon); }
.voice-message-player button:disabled { cursor: wait; opacity: .72; }
.voice-message-duration {
  color: #756e69;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.voice-transcript-toggle {
  flex: 0 0 auto;
  justify-self: start;
  min-height: 1.25rem;
  padding: .1rem .2rem;
  border: 0;
  border-radius: .42rem;
  background: transparent;
  color: #8b8179;
  font-size: .68rem;
}
.message-voice-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .18rem .4rem;
  max-width: 100%;
}
.message.user .voice-transcript-toggle {
  justify-self: end;
  color: #956d62;
}
.voice-message-transcript,
.message.user .voice-message-transcript {
  max-width: 100%;
  margin: 0;
  padding: .55rem .7rem;
  border: 1px solid #e4ddd5;
  border-left: .24rem solid #9fcdb8;
  border-radius: .68rem;
  background: #fffefa;
  box-shadow: none;
  color: #5b5550;
  font-size: .82rem;
  line-height: 1.5;
  text-align: left;
}
.message-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.message-recovery-actions button {
  min-height: 2.1rem;
  padding: .44rem .72rem;
  border: 1px solid #d8d0c7;
  border-radius: .65rem;
  background: #f2eee8;
  color: #6f675f;
  font-size: .78rem;
  font-weight: 720;
}
.message-recovery-actions button.is-primary {
  border-color: #6276d4;
  background: #6276d4;
  color: #fff;
}
.conversation-recovery-status {
  margin: 0 .35rem;
  padding: .45rem .6rem;
  border: 1px solid #d9d3c9;
  border-radius: .55rem;
  background: #f8f5ef;
  color: #67615b;
  font-size: .72rem;
  line-height: 1.4;
  text-align: center;
}
.conversation-recovery-status[data-tone="success"] {
  border-color: #bfd8c7;
  background: #f1f8f3;
  color: #42664c;
}
.conversation-recovery-status[data-tone="warning"],
.conversation-recovery-status[data-tone="error"] {
  border-color: #e4c5b9;
  background: #fff5f1;
  color: #8a4f43;
}
.composer {
  gap: .4rem; padding: .43rem; border: 1px solid #d9d1c8; border-radius: .95rem; background: #fffefa;
  box-shadow: 0 .8rem 1.8rem rgba(91, 84, 73, .12); backdrop-filter: none;
}
.composer-icon-button { width: 2.25rem; height: 2.25rem; border-radius: .62rem; background: #f0ece5; color: #716963; }
.composer textarea { min-height: 2.35rem; padding: .52rem .45rem; color: #4c4945; }
.composer button { min-width: 2.5rem; min-height: 2.35rem; border-radius: .68rem; }
#send-button { background: #6276d4; color: #fff; }
#send-button { touch-action: manipulation; }
.message.user { justify-items: end; }
.message.user .message-text { text-align: right; }
.message.user .message-text.is-multiline { text-align: left; }

.avatar-editor { display: flex; align-items: center; gap: .8rem; margin-top: .9rem; padding: .75rem; border: 1px solid rgba(151, 105, 88, .1); border-radius: .85rem; background: rgba(255, 250, 244, .64); }
.avatar-editor strong { color: #68534c; font-size: .8rem; }
.avatar-editor p { margin: .16rem 0 .5rem; color: #9a837a; font-size: .71rem; }
.avatar-preview { display: grid; flex: 0 0 auto; width: 3rem; height: 3rem; place-items: center; overflow: hidden; border: 2px solid #fff; border-radius: .9rem; background: transparent; color: #e9c761; box-shadow: 0 .3rem .8rem rgba(80, 61, 53, .12); font-size: 1rem; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-preview-user { border-radius: 50%; background: #f0d2bf; color: #855f52; }
.avatar-upload-button { display: inline-block; border-radius: .55rem; background: #e2e7f7; color: #6276d4; padding: .38rem .55rem; font-size: .68rem; font-weight: 720; }
.avatar-upload-button input { display: none; }
.avatar-clear { margin-left: .35rem; border: 0; background: transparent; color: #a16a5a; padding: .35rem .15rem; font-size: .68rem; }

/* 手机端可以随时切换私人/工作空间；会话与记忆仍按 vault 隔离。 */
.space-switch { display: flex; }

.conversation-history { z-index: 10; }
.conversation-list-tabs {
  display: flex;
  gap: .35rem;
  margin: .1rem 0 .45rem;
  padding: .2rem;
  border-radius: .62rem;
  background: #f2eee8;
}
.conversation-list-tabs button {
  flex: 1;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: #827a73;
  padding: .34rem .42rem;
  font-size: .65rem;
  font-weight: 700;
}
.conversation-list-tabs button.is-active { background: #fffefa; color: #6276d4; box-shadow: 0 .15rem .4rem rgba(82, 74, 67, .08); }
.conversation-list { gap: .35rem; }
.conversation-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.8rem;
  align-items: center;
  gap: .2rem;
  padding: .12rem;
  border-radius: .62rem;
}
.conversation-row.is-current { background: #edf0ff; }
.conversation-list .conversation-select {
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: .48rem;
  background: transparent;
  color: #5b5550;
  padding: .5rem .55rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .7rem;
}
.conversation-row.is-current .conversation-select { color: #4e63c4; font-weight: 720; }
.conversation-actions-menu { position: relative; }
.conversation-actions-menu summary {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  cursor: pointer;
  border-radius: .45rem;
  color: #827a73;
  list-style: none;
}
.conversation-actions-menu summary::-webkit-details-marker { display: none; }
.conversation-actions-menu[open] summary { background: #f0ece5; color: #4e63c4; }
.conversation-actions-menu > div {
  position: absolute;
  z-index: 2;
  top: 1.85rem;
  right: 0;
  display: grid;
  gap: .18rem;
  width: 6.2rem;
  padding: .3rem;
  border: 1px solid #ded7ce;
  border-radius: .58rem;
  background: #fffefa;
  box-shadow: 0 .65rem 1.3rem rgba(68, 59, 52, .16);
}
.conversation-actions-menu > div button {
  border: 0;
  border-radius: .38rem;
  background: transparent;
  color: #655d57;
  padding: .42rem;
  text-align: left;
  font-size: .66rem;
}
.conversation-actions-menu > div button:hover { background: #f2eee8; }
.conversation-actions-menu > div .is-danger { color: #b65f5c; }
.conversation-empty { margin: .5rem .3rem; color: #9b938c; font-size: .69rem; }

/* 会话管理改为大面板，减少误触并避免操作菜单被小弹窗裁切。 */
.conversation-history[open] .conversation-list-panel {
  position: fixed;
  z-index: 40;
  top: max(5.2rem, env(safe-area-inset-top));
  right: .8rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: .8rem;
  display: flex;
  flex-direction: column;
  padding: .8rem;
  border: 1px solid #d9d1c8;
  border-radius: 1rem;
  background: #fffefa;
  box-shadow: 0 1.1rem 3rem rgba(62, 54, 47, .2);
}
.conversation-history[open] .conversation-list-tabs { flex: 0 0 auto; margin: 0 0 .65rem; }
.conversation-history[open] .conversation-list {
  position: static;
  display: grid;
  flex: 1;
  width: auto;
  max-height: none;
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.conversation-history[open] .conversation-row { min-height: 3.2rem; }
.conversation-history[open] .conversation-list .conversation-select { padding: .75rem .7rem; font-size: .78rem; }
.conversation-history[open] .conversation-actions-menu summary { width: 2.25rem; height: 2.25rem; font-size: 1.1rem; }
.conversation-history[open] .conversation-actions-menu > div { width: 7.1rem; padding: .4rem; }
.conversation-history[open] .conversation-actions-menu > div button { padding: .58rem; font-size: .73rem; }

/* 左侧抽屉式会话记录：不会遮满主聊天页，点右侧空白即可返回。 */
.identity-button {
  min-height: 2.2rem;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}
.identity-button:active { opacity: .75; }
.conversation-space-hint { color: #918a83; font-size: .68rem; }
.conversation-drawer {
  position: fixed;
  z-index: 60;
  inset: 0;
  pointer-events: none;
}
.conversation-drawer.is-open { pointer-events: auto; }
.conversation-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(37, 34, 31, 0);
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
}
.conversation-drawer.is-open .conversation-drawer-backdrop {
  background: rgba(37, 34, 31, .18);
  opacity: 1;
}
.conversation-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(84vw, 21rem);
  padding: max(1rem, env(safe-area-inset-top)) .85rem max(1rem, env(safe-area-inset-bottom));
  background: #fffefa;
  box-shadow: .8rem 0 2.2rem rgba(53, 47, 42, .18);
  transform: translateX(-105%);
  transition: transform .24s ease;
}
.conversation-drawer.is-open .conversation-drawer-panel { transform: translateX(0); }
.conversation-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .2rem .15rem .8rem;
}
.conversation-drawer-header p {
  margin: 0 0 .12rem;
  color: #918980;
  font-size: .65rem;
  letter-spacing: .09em;
}
.conversation-drawer-header h2 { margin: 0; color: #4c4945; font-size: 1.15rem; }
.conversation-drawer-header button {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 0;
  border-radius: .6rem;
  background: #f0ece5;
  color: #716963;
  font-size: 1.25rem;
}
.drawer-new-conversation {
  width: 100%;
  margin-bottom: .7rem;
  border: 0;
  border-radius: .7rem;
  background: #6276d4;
  color: #fff;
  padding: .68rem;
  font-size: .78rem;
  font-weight: 720;
  text-align: left;
}
.conversation-drawer .conversation-list-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.conversation-drawer .conversation-list-tabs {
  flex: 0 0 auto;
  margin: 0 0 .65rem;
}
.conversation-drawer .conversation-list {
  position: static;
  display: grid;
  flex: 1;
  align-content: start;
  grid-auto-rows: min-content;
  width: auto;
  max-height: none;
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.conversation-drawer .conversation-row { min-height: 3.2rem; }
.conversation-drawer .conversation-list .conversation-select { padding: .75rem .7rem; font-size: .78rem; }
.conversation-drawer .conversation-actions-menu summary { width: 2.25rem; height: 2.25rem; font-size: 1.1rem; }
.conversation-drawer .conversation-actions-menu > div { width: 7.1rem; padding: .4rem; }
.conversation-drawer .conversation-actions-menu > div button { padding: .58rem; font-size: .73rem; }

.new-conversation-sheet {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}
.new-conversation-sheet.hidden { display: none; }
.new-conversation-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(37, 34, 31, .22);
}
.new-conversation-panel {
  position: relative;
  width: min(100%, 28rem);
  padding: 1rem;
  border: 1px solid #e2d9cf;
  border-radius: 1rem;
  background: #fffefa;
  box-shadow: 0 1.2rem 3rem rgba(53, 47, 42, .2);
}
.new-conversation-panel > p {
  margin: 0;
  color: #948b83;
  font-size: .66rem;
}
.new-conversation-panel h2 {
  margin: .1rem 0 .85rem;
  color: #4c4945;
  font-size: 1rem;
}
.new-conversation-options {
  display: grid;
  gap: .45rem;
}
.new-conversation-options button {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  width: 100%;
  min-height: 3.6rem;
  padding: .65rem .75rem;
  border: 1px solid #e7dfd6;
  border-radius: .75rem;
  background: #faf7f2;
  color: #4c4945;
  text-align: left;
}
.new-conversation-options button:disabled { opacity: .42; }
.new-conversation-options i {
  width: .72rem;
  height: .72rem;
  border-radius: .2rem;
  background: #6276d4;
}
.new-conversation-options i.work { background: #d77d68; }
.new-conversation-options span { display: grid; gap: .12rem; }
.new-conversation-options strong { font-size: .82rem; }
.new-conversation-options small { color: #918980; font-size: .68rem; }
.new-conversation-options b { color: #9b938b; font-size: 1.25rem; font-weight: 400; }
.new-conversation-cancel {
  width: 100%;
  margin-top: .55rem;
  padding: .65rem;
  border: 0;
  background: transparent;
  color: #7d756e;
  font-size: .76rem;
}

.avatar-viewer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.avatar-viewer.hidden { display: none; }
.avatar-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(33, 31, 30, .52);
  backdrop-filter: blur(.35rem);
}
.avatar-viewer-panel {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 22rem);
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 1rem;
  background: #fffefa;
  box-shadow: 0 1.5rem 4rem rgba(34, 30, 28, .28);
}
.avatar-viewer-panel.is-cropping {
  width: min(100%, 24rem);
}
.avatar-viewer-close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 0;
  border-radius: .6rem;
  background: rgba(238, 233, 228, .86);
  color: #6f6761;
  font-size: 1.2rem;
}
.avatar-viewer-preview {
  display: grid;
  width: min(64vw, 14rem);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  margin-top: .4rem;
  border: .25rem solid #fff;
  border-radius: 1.6rem;
  background: #22242d;
  color: #e9c761;
  box-shadow: 0 .9rem 2.2rem rgba(51, 45, 41, .2);
  font-size: 3.8rem;
}
.avatar-viewer-preview.is-profile {
  border-radius: 50%;
  background: #f0d2bf;
  color: #855f52;
}
.avatar-viewer-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-viewer-preview img.hidden,
.avatar-viewer-preview span.hidden { display: none; }
.avatar-viewer-panel h2 {
  margin: 1rem 0 .2rem;
  color: #4c4945;
  font-size: 1rem;
}
.avatar-viewer-panel > p {
  min-height: 1.05rem;
  margin: 0;
  color: #918980;
  font-size: .7rem;
  text-align: center;
}
.avatar-viewer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  width: 100%;
  margin-top: 1rem;
}
.avatar-viewer-actions button {
  min-height: 2.7rem;
  border-radius: .72rem;
  font-size: .76rem;
  font-weight: 720;
}
.avatar-viewer-actions .avatar-change {
  border: 0;
  background: #6276d4;
  color: #fff;
}
.avatar-viewer-actions .avatar-clear-mobile {
  border: 1px solid #ded7ce;
  background: #f5f1ec;
  color: #796f68;
}
.avatar-viewer-actions button:disabled { opacity: .45; }
.avatar-viewer-panel.is-cropping .avatar-viewer-preview,
.avatar-viewer-panel.is-cropping > h2,
.avatar-viewer-panel.is-cropping > p,
.avatar-viewer-panel.is-cropping > .avatar-viewer-actions {
  display: none;
}
.avatar-cropper {
  display: grid;
  justify-items: center;
  gap: .75rem;
  width: 100%;
  padding-top: 2.1rem;
}
.avatar-cropper.hidden { display: none; }
.avatar-crop-stage {
  position: relative;
  width: min(76vw, 18rem);
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: .25rem solid #fff;
  border-radius: 1.2rem;
  background: #d8d5d1;
  box-shadow: 0 .9rem 2.2rem rgba(51, 45, 41, .2);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage.is-profile { border-radius: 50%; }
.avatar-crop-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.avatar-crop-grid {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, .72);
  background-image:
    linear-gradient(to right, transparent 33.1%, rgba(255, 255, 255, .52) 33.1%, rgba(255, 255, 255, .52) 33.7%, transparent 33.7%),
    linear-gradient(to right, transparent 66.3%, rgba(255, 255, 255, .52) 66.3%, rgba(255, 255, 255, .52) 66.9%, transparent 66.9%),
    linear-gradient(to bottom, transparent 33.1%, rgba(255, 255, 255, .52) 33.1%, rgba(255, 255, 255, .52) 33.7%, transparent 33.7%),
    linear-gradient(to bottom, transparent 66.3%, rgba(255, 255, 255, .52) 66.3%, rgba(255, 255, 255, .52) 66.9%, transparent 66.9%);
  pointer-events: none;
}
.avatar-zoom-controls {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem;
  align-items: center;
  gap: .65rem;
  width: 100%;
}
.avatar-zoom-controls button {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid #ded7ce;
  border-radius: .68rem;
  background: #f5f1ec;
  color: #625c57;
  font-size: 1.2rem;
  line-height: 1;
}
.avatar-zoom-controls input {
  width: 100%;
  accent-color: #6276d4;
}
.avatar-crop-help {
  min-height: 1.05rem;
  margin: -.2rem 0 0;
  color: #918980;
  font-size: .7rem;
  text-align: center;
}
.avatar-crop-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: .5rem;
  width: 100%;
}
.avatar-crop-actions button {
  min-height: 2.7rem;
  border-radius: .72rem;
  font-size: .76rem;
  font-weight: 720;
}
.avatar-crop-actions button:first-child {
  border: 1px solid #ded7ce;
  background: #f5f1ec;
  color: #796f68;
}
.avatar-crop-actions button:last-child {
  border: 0;
  background: #6276d4;
  color: #fff;
}
.avatar-crop-actions button:disabled { opacity: .45; }

/* iPhone 键盘出现时，以实际可见区域作为 App 高度，避免整页被 Safari 顶走。 */
html { height: 100%; }
body.chat-page {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body.chat-page .app-shell {
  height: var(--app-viewport-height, 100dvh);
  min-height: 0;
  overflow: hidden;
}
body.chat-page.pairing-open {
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}
body.chat-page.pairing-open .app-shell {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}
body.chat-page .chat-panel,
body.chat-page .messages {
  min-height: 0;
}
body.chat-page .messages {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.chat-page .site-filing {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0 0 max(.05rem, env(safe-area-inset-bottom));
  line-height: 1;
}
body.chat-page .site-filing nav {
  gap: .55rem;
  margin-bottom: .08rem;
}
body.chat-page .site-filing a {
  display: inline-block;
  color: #aaa39c;
  font-size: .58rem;
  line-height: 1.15;
}
body.chat-page .app-shell:not(.is-connected) .site-filing {
  margin-top: auto;
}

body.chat-page.keyboard-open .app-shell {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  gap: .35rem;
  width: min(100%, 42rem);
  padding-top: max(.7rem, env(safe-area-inset-top));
  padding-bottom: .3rem;
}
body.chat-page.keyboard-open .install-hint,
body.chat-page.keyboard-open .conversation-stamp,
body.chat-page.keyboard-open .site-filing {
  display: none;
}
body.chat-page.keyboard-open .chat-panel {
  gap: .35rem;
}
body.chat-page.keyboard-open .messages {
  padding-top: .1rem;
  padding-bottom: .15rem;
}
body.chat-page.keyboard-open .composer {
  position: relative;
  flex: 0 0 auto;
  bottom: auto;
}

/* 独立 App 里不在聊天主界面展示网站备案信息。 */
body.chat-page .app-shell.is-native-app .site-filing {
  display: none;
}

/* 主页面导航与 Agent 互动聚合页。 */
.activity-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: .82rem;
  overflow-y: auto;
  padding: .15rem 0 .35rem;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-padding-top: 8.6rem;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.activity-panel.hidden { display: none; }
.activity-toolbar {
  position: sticky;
  z-index: 4;
  top: 0;
  display: grid;
  gap: .55rem;
  margin-top: -.15rem;
  padding: .2rem 0 .58rem;
  background: linear-gradient(180deg, #fbf7f1 0%, #fbf7f1 84%, rgba(251, 247, 241, 0));
}
.activity-page-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: .75rem;
  padding: .25rem .08rem 0;
}
.activity-kicker {
  margin: 0;
  color: #a36d5c;
  font-size: .66rem;
  font-weight: 760;
  letter-spacing: .08em;
}
.activity-page-header h1 {
  margin: .12rem 0 .2rem;
  color: #4c4945;
  font-size: 1.45rem;
  letter-spacing: 0;
}
.activity-page-header p:last-child {
  max-width: 24rem;
  margin: 0;
  color: #928982;
  font-size: .72rem;
}
.activity-back,
.activity-refresh,
.activity-jump-top {
  display: grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid #ded7ce;
  border-radius: .7rem;
  background: #fffefa;
  color: #6276d4;
  font-size: 1.15rem;
}
.activity-back { font-size: 1.55rem; line-height: 1; }
.activity-page-actions {
  display: flex;
  gap: .34rem;
}
.activity-jump-top { font-size: 1rem; }
.activity-jump-top.hidden { display: none; }
.activity-filters {
  display: flex;
  gap: .28rem;
  overflow-x: auto;
  padding: .22rem;
  border: 1px solid #e5ddd5;
  border-radius: .78rem;
  background: #f2eee8;
  scrollbar-width: none;
}
.activity-filters::-webkit-scrollbar { display: none; }
.activity-filters button {
  flex: 0 0 auto;
  min-height: 2.15rem;
  padding: .42rem .68rem;
  border: 0;
  border-radius: .58rem;
  background: transparent;
  color: #827a73;
  font-size: .72rem;
  font-weight: 720;
}
.activity-filters button.is-active {
  background: #fffefa;
  color: #6276d4;
  box-shadow: 0 .18rem .48rem rgba(82, 74, 67, .08);
}
.activity-date-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  gap: .45rem;
  min-height: 2rem;
  color: #91867e;
  font-size: .68rem;
  font-weight: 680;
}
.activity-date-filter span {
  white-space: nowrap;
}
.activity-date-filter select {
  width: 100%;
  min-width: 0;
  height: 2rem;
  padding: 0 1.8rem 0 .65rem;
  border: 1px solid #ded7ce;
  border-radius: .48rem;
  outline: none;
  background: #fffefa;
  color: #655d57;
  font-size: .7rem;
  font-weight: 700;
}
.activity-date-filter select:focus {
  border-color: #8b98db;
  box-shadow: 0 0 0 .14rem rgba(98, 118, 212, .12);
}
.activity-groups {
  display: grid;
  gap: .58rem;
  padding-bottom: .5rem;
}
.activity-today-fragment {
  display: grid;
  gap: .4rem;
  padding: .74rem .8rem;
  border: 1px solid #e6ddd4;
  border-left: .28rem solid #9fcdb8;
  border-radius: .5rem;
  background: #fffefa;
}
.activity-today-fragment.hidden { display: none; }
.activity-today-fragment[data-tone="warm"] { border-left-color: #d77d68; }
.activity-today-fragment[data-tone="playful"] { border-left-color: #d7a65e; }
.activity-today-fragment > div { display: grid; gap: .12rem; }
.activity-today-fragment p,
.activity-today-fragment h2,
.activity-today-fragment small { margin: 0; }
.activity-today-fragment > div p {
  color: #9b8e84;
  font-size: .64rem;
  font-weight: 720;
}
.activity-today-fragment h2 {
  color: #5d514b;
  font-size: .9rem;
  line-height: 1.35;
}
.activity-today-fragment > p {
  color: #6c625c;
  font-size: .78rem;
  line-height: 1.55;
}
.activity-today-fragment small {
  color: #9c9189;
  font-size: .64rem;
}
.activity-group {
  overflow: hidden;
  border: 1px solid #e5ddd5;
  border-radius: .82rem;
  background: rgba(255, 254, 250, .78);
}
.activity-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 3.8rem;
  padding: .72rem .78rem;
  cursor: pointer;
  list-style: none;
}
.activity-group summary::-webkit-details-marker { display: none; }
.activity-group summary::after {
  content: "⌄";
  color: #9b9189;
  font-size: .88rem;
  transform: rotate(0);
  transition: transform .15s ease;
}
.activity-group[open] summary::after { transform: rotate(180deg); }
.activity-group-copy {
  display: grid;
  min-width: 0;
  gap: .14rem;
}
.activity-group-copy strong {
  color: #5d514b;
  font-size: .82rem;
}
.activity-group-copy small {
  overflow: hidden;
  color: #9a8f87;
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-group summary > b {
  display: grid;
  flex: 0 0 auto;
  min-width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 50%;
  background: #ececf9;
  color: #6276d4;
  font-size: .66rem;
}
.activity-group summary > b.hidden { display: none; }
.activity-group-list {
  display: grid;
  border-top: 1px solid #eee7df;
}
.activity-group-list .agent-inbox-item {
  border: 0;
  border-bottom: 1px solid #eee7df;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.activity-group-list .agent-inbox-item:last-of-type { border-bottom: 0; }
.activity-group-list .agent-inbox-item p { font-size: .8rem; }
.activity-collapsed-note {
  margin: 0;
  padding: .55rem .78rem .68rem;
  color: #a0948b;
  font-size: .66rem;
}
.activity-empty {
  margin: 1.5rem .2rem;
  color: #9b9189;
  font-size: .78rem;
  text-align: center;
}

/* 信箱是独立阅读工作区，不复用聊天气泡或互动卡片。 */
.assistant-avatar-menu-icon.is-letter {
  background: #f0e9d8;
  color: #8d7044;
}
.assistant-avatar-letter-badge {
  display: grid;
  min-width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  padding: 0 .34rem;
  border-radius: 99rem;
  background: #d96f5d;
  color: #fff;
  font-size: .65rem;
  font-weight: 760;
}
.assistant-avatar-letter-badge.hidden { display: none; }

.letter-panel,
.letter-detail {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.letter-panel {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: .15rem 0 .55rem;
}
.letter-panel.hidden,
.letter-detail.hidden { display: none; }
.letter-page-header,
.letter-detail-toolbar {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr) 2.3rem;
  gap: .7rem;
  align-items: center;
}
.letter-page-header > div,
.letter-detail-toolbar > div { min-width: 0; }
.letter-page-header p,
.letter-page-header h1,
.letter-page-header small,
.letter-detail-toolbar p,
.letter-detail-toolbar strong {
  margin: 0;
}
.letter-page-header p,
.letter-detail-toolbar p {
  color: #9a796a;
  font-size: .64rem;
  font-weight: 720;
}
.letter-page-header h1 {
  margin-top: .06rem;
  color: #4d4540;
  font-size: 1.42rem;
  letter-spacing: 0;
}
.letter-page-header small {
  display: block;
  overflow: hidden;
  margin-top: .12rem;
  color: #968c84;
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.letter-detail-toolbar {
  position: sticky;
  z-index: 3;
  top: 0;
  padding: .25rem 0 .55rem;
  background: linear-gradient(180deg, #fbf7f1 0%, #fbf7f1 82%, rgba(251, 247, 241, 0));
}
.letter-detail-toolbar strong {
  display: block;
  overflow: hidden;
  margin-top: .08rem;
  color: #574d47;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.letter-icon-button {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  padding: 0;
  border: 1px solid #ded6cd;
  border-radius: .62rem;
  background: #fffefa;
  color: #7d685d;
  font-size: 1.25rem;
  line-height: 1;
}
.letter-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .22rem;
  padding: .22rem;
  border: 1px solid #e2d9d0;
  border-radius: .72rem;
  background: #f0ebe5;
}
.letter-tabs button {
  min-width: 0;
  min-height: 2.15rem;
  padding: .38rem .2rem;
  border: 0;
  border-radius: .52rem;
  background: transparent;
  color: #857a72;
  font-size: .69rem;
  font-weight: 720;
  white-space: nowrap;
}
.letter-tabs button.is-active {
  background: #fffefa;
  color: #7e5b4e;
  box-shadow: 0 .16rem .45rem rgba(86, 71, 63, .08);
}
.letter-status {
  min-height: 1rem;
  margin: 0;
  color: #9a8e85;
  font-size: .68rem;
  text-align: center;
}
.letter-list {
  display: grid;
  gap: .9rem;
}
.letter-day-group {
  display: grid;
  gap: .28rem;
  min-width: 0;
}
.letter-day-group h2 {
  margin: 0;
  padding: 0 .18rem;
  color: #a09187;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: 0;
}
.letter-day-group > div {
  display: grid;
  border-top: 1px solid #e6ddd4;
}
.letter-list-item {
  position: relative;
  display: grid;
  min-width: 0;
  gap: .2rem;
  padding: .78rem .18rem .78rem .88rem;
  border: 0;
  border-bottom: 1px solid #e6ddd4;
  background: transparent;
  color: #5f554f;
  text-align: left;
}
.letter-list-item::before {
  position: absolute;
  top: 1.05rem;
  left: .18rem;
  width: .36rem;
  height: .36rem;
  border-radius: 50%;
  background: transparent;
  content: "";
}
.letter-list-item.is-unread::before { background: #d77762; }
.letter-list-item strong {
  overflow: hidden;
  font-size: .82rem;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.letter-list-item span {
  overflow: hidden;
  color: #9a8e86;
  font-size: .65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.letter-empty {
  margin: 2.6rem 0;
  color: #9b9088;
  font-size: .76rem;
  text-align: center;
}
.letter-load-more {
  align-self: center;
  min-height: 2.3rem;
  padding: .48rem .85rem;
  border: 1px solid #ded6cd;
  border-radius: .58rem;
  background: #fffefa;
  color: #77665c;
  font-size: .7rem;
  font-weight: 700;
}
.letter-load-more.hidden { display: none; }

.letter-detail {
  padding: .15rem 0 .8rem;
}
.letter-paper {
  width: min(100%, 38rem);
  min-width: 0;
  margin: .35rem auto .75rem;
  padding: clamp(1.45rem, 6vw, 3rem) clamp(1.15rem, 6vw, 3.25rem);
  border: 1px solid #e4d9c9;
  border-radius: .28rem;
  background:
    linear-gradient(rgba(156, 127, 91, .055) 1px, transparent 1px) 0 2.9rem / 100% 1.9rem,
    #fffdf6;
  box-shadow: 0 .7rem 1.8rem rgba(96, 76, 61, .08);
  color: #564d46;
  overflow-wrap: anywhere;
}
.letter-paper time {
  display: block;
  color: #9c8f83;
  font-size: .66rem;
  text-align: right;
}
.letter-paper h1 {
  margin: 1.2rem 0 1.7rem;
  color: #443d38;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(1.32rem, 5vw, 1.8rem);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: center;
}
.letter-salutation,
.letter-closing,
.letter-signature {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: .9rem;
}
.letter-body {
  display: grid;
  gap: .72rem;
  margin: 1rem 0 1.5rem;
}
.letter-body p {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: .94rem;
  line-height: 1.9;
  white-space: pre-wrap;
}
.letter-closing,
.letter-signature { text-align: right; }
.letter-signature { margin-top: .36rem; }
.letter-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .42rem;
  width: min(100%, 38rem);
  margin: 0 auto;
}
.letter-detail-actions button {
  min-height: 2.3rem;
  padding: .48rem .72rem;
  border: 1px solid #ded5cc;
  border-radius: .55rem;
  background: #fffefa;
  color: #705f55;
  font-size: .68rem;
  font-weight: 700;
}
.letter-detail-actions #letter-reply {
  border-color: #8e786a;
  background: #8e786a;
  color: #fff;
}
.letter-detail-actions .is-danger {
  border-color: #e0b9b5;
  color: #a9524f;
}

:root[data-coco-desktop-theme="dark"] .letter-detail-toolbar {
  background: linear-gradient(180deg, #232428 0%, #232428 82%, rgba(35, 36, 40, 0));
}
:root[data-coco-desktop-theme="dark"] :is(
  .letter-icon-button,
  .letter-tabs button.is-active,
  .letter-load-more,
  .letter-detail-actions button
) {
  border-color: #4b4d52;
  background: #2f3035;
  color: #d4cec8;
}
:root[data-coco-desktop-theme="dark"] .letter-tabs {
  border-color: #45474c;
  background: #292a2e;
}
:root[data-coco-desktop-theme="dark"] :is(
  .letter-page-header h1,
  .letter-detail-toolbar strong,
  .letter-list-item,
  .letter-paper h1
) { color: #ebe5df; }
:root[data-coco-desktop-theme="dark"] :is(
  .letter-page-header p,
  .letter-page-header small,
  .letter-status,
  .letter-day-group h2,
  .letter-list-item span
) { color: #aaa39d; }
:root[data-coco-desktop-theme="dark"] .letter-day-group > div,
:root[data-coco-desktop-theme="dark"] .letter-list-item {
  border-color: #45474c;
}
:root[data-coco-desktop-theme="dark"] .letter-paper {
  border-color: #4a4843;
  background:
    linear-gradient(rgba(221, 212, 195, .045) 1px, transparent 1px) 0 2.9rem / 100% 1.9rem,
    #2d2c2a;
  color: #ddd5cb;
  box-shadow: none;
}
:root[data-coco-desktop-theme="dark"] .letter-detail-actions #letter-reply {
  border-color: #7c86c8;
  background: #6876c6;
  color: #fff;
}

@media (max-width: 390px) {
  .letter-tabs button { font-size: .64rem; }
  .letter-detail-actions button {
    flex: 1 1 calc(33.333% - .42rem);
    min-width: 5.2rem;
  }
}

/* 我们的日历只保留高价值日期标记，详情统一收进底部面板。 */
.assistant-avatar-menu-icon.is-calendar {
  background: #e5efe9;
  color: #557866;
}
.calendar-panel {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: .78rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: .15rem 0 .8rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.calendar-panel.hidden { display: none; }
.calendar-page-header {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr) 2.3rem;
  gap: .68rem;
  align-items: center;
}
.calendar-page-header > div {
  min-width: 0;
  text-align: center;
}
.calendar-page-header p,
.calendar-page-header h1,
.calendar-page-header small {
  margin: 0;
}
.calendar-page-header p {
  color: #718778;
  font-size: .64rem;
  font-weight: 720;
}
.calendar-page-header h1 {
  display: inline-flex;
  max-width: 100%;
  align-items: baseline;
  justify-content: center;
  margin-top: .08rem;
  color: #494b47;
  font-size: 1.28rem;
  font-weight: 680;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}
.calendar-page-header #calendar-day-count {
  display: inline-block;
  margin: 0 .16em;
  color: #557866;
  font-size: 2.08rem;
  font-weight: 780;
  line-height: 1;
}
.calendar-page-header small {
  display: block;
  margin-top: .14rem;
  color: #8f928c;
  font-size: .65rem;
  line-height: 1.45;
}
.calendar-icon-button,
.calendar-month-toolbar button {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d9ddd8;
  background: #fbfcfa;
  color: #68756c;
  line-height: 1;
}
.calendar-icon-button {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: .6rem;
  font-size: 1.18rem;
}
.calendar-month-toolbar {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 2rem;
  align-items: center;
  padding: .34rem .42rem;
  border-top: 1px solid #e1e3df;
  border-bottom: 1px solid #e1e3df;
}
.calendar-month-toolbar button {
  width: 2rem;
  height: 2rem;
  border-color: transparent;
  border-radius: .5rem;
  background: transparent;
  font-size: 1.15rem;
}
.calendar-month-toolbar strong {
  color: #555b56;
  font-size: .78rem;
  text-align: center;
}
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-weekdays span {
  color: #9a9d97;
  font-size: .59rem;
  font-weight: 680;
  text-align: center;
}
.calendar-grid {
  border-top: 1px solid #e2e4e0;
  border-left: 1px solid #e2e4e0;
}
.calendar-day {
  display: grid;
  min-width: 0;
  min-height: 3.55rem;
  align-content: start;
  justify-items: center;
  gap: .42rem;
  padding: .52rem .12rem .34rem;
  border: 0;
  border-right: 1px solid #e2e4e0;
  border-bottom: 1px solid #e2e4e0;
  border-radius: 0;
  background: transparent;
  color: #575c57;
}
.calendar-day.is-blank {
  min-height: 3.55rem;
  border-right: 1px solid #e2e4e0;
  border-bottom: 1px solid #e2e4e0;
  background: #f8f9f7;
}
.calendar-day strong {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border-radius: 50%;
  font-size: .68rem;
  font-weight: 660;
}
.calendar-day.is-today strong {
  background: #63796b;
  color: #fff;
}
.calendar-day-marks {
  display: flex;
  min-height: .38rem;
  align-items: center;
  justify-content: center;
  gap: .16rem;
}
.calendar-day-mark,
.calendar-legend i {
  display: inline-block;
  width: .34rem;
  height: .34rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7d8b82;
}
.calendar-day-mark.is-heart,
.calendar-legend .is-heart { background: #c87872; }
.calendar-day-mark.is-letter,
.calendar-legend .is-letter { background: #b18a51; }
.calendar-day-mark.is-message { background: #7589ae; }
.calendar-day-mark.is-anniversary,
.calendar-legend .is-anniversary { background: #718f79; }
.calendar-day-mark.is-period,
.calendar-legend .is-period { background: #b7798d; }
.calendar-day-mark.is-reflection,
.calendar-legend .is-reflection { background: #8675a3; }
.calendar-status {
  min-height: 1rem;
  margin: 0;
  color: #8d928c;
  font-size: .66rem;
  line-height: 1.5;
  text-align: center;
}
.calendar-origin-shortcut {
  display: grid;
  gap: .16rem;
  width: 100%;
  padding: .62rem .12rem;
  border: 0;
  border-top: 1px solid #e1e4df;
  border-bottom: 1px solid #e1e4df;
  border-radius: 0;
  background: transparent;
  color: #64746a;
  text-align: left;
}
.calendar-origin-shortcut.hidden { display: none; }
.calendar-origin-shortcut span {
  color: #929892;
  font-size: .61rem;
}
.calendar-origin-shortcut strong {
  font-size: .7rem;
  font-weight: 720;
}
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .38rem .72rem;
  color: #858b85;
  font-size: .59rem;
}
.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.calendar-event-sheet {
  position: fixed;
  z-index: 70;
  top: var(--app-viewport-top, 0);
  right: 0;
  left: 0;
  display: grid;
  height: var(--app-viewport-height, 100dvh);
  align-items: end;
  padding-top: max(.5rem, env(safe-area-inset-top));
  overflow: hidden;
}
.calendar-event-sheet.hidden { display: none; }
.calendar-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgba(43, 47, 44, .28);
}
.calendar-sheet-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 36rem);
  max-height: min(
    44rem,
    calc(var(--app-viewport-height, 100dvh) - max(.5rem, env(safe-area-inset-top)))
  );
  min-width: 0;
  gap: .72rem;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: .48rem 1rem max(1rem, env(safe-area-inset-bottom));
  border: 1px solid #dfe2de;
  border-bottom: 0;
  border-radius: .75rem .75rem 0 0;
  background: #fbfcfa;
  box-shadow: 0 -1rem 2.4rem rgba(42, 48, 44, .12);
  overscroll-behavior: contain;
  scroll-padding-block: 4.4rem 4.8rem;
  -webkit-overflow-scrolling: touch;
}
.calendar-sheet-handle {
  width: 2.2rem;
  height: .22rem;
  margin: 0 auto .12rem;
  border-radius: 99rem;
  background: #d0d4cf;
}
.calendar-sheet-panel > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: .7rem;
  align-items: start;
}
.calendar-sheet-panel > header p,
.calendar-sheet-panel > header h2,
.calendar-sheet-panel > header time {
  display: block;
  margin: 0;
}
.calendar-sheet-panel > header p {
  color: #75877b;
  font-size: .62rem;
  font-weight: 720;
}
.calendar-sheet-panel > header h2 {
  margin-top: .12rem;
  color: #4b514c;
  font-size: 1rem;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.calendar-sheet-panel > header time {
  margin-top: .14rem;
  color: #949994;
  font-size: .62rem;
}
.calendar-sheet-panel > header button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef0ed;
  color: #737a74;
  font-size: 1.05rem;
}
.calendar-event-recorder {
  display: inline-flex;
  margin-top: .3rem;
  padding: .2rem .42rem;
  border: 1px solid #d7e2d9;
  border-radius: 999px;
  background: #f0f6f1;
  color: #5f7c68;
  font-size: .6rem;
  font-weight: 720;
}
.calendar-event-list {
  display: grid;
  border-top: 1px solid #e1e4df;
}
.calendar-event-list-item {
  display: grid;
  grid-template-columns: .5rem minmax(0, 1fr);
  gap: .58rem;
  align-items: center;
  min-width: 0;
  padding: .72rem .08rem;
  border: 0;
  border-bottom: 1px solid #e1e4df;
  border-radius: 0;
  background: transparent;
  color: #535a54;
  text-align: left;
}
.calendar-event-list-item span {
  display: grid;
  min-width: 0;
  gap: .14rem;
}
.calendar-event-list-item strong {
  overflow: hidden;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event-list-item small {
  color: #909690;
  font-size: .61rem;
}
.calendar-empty-date-action {
  min-height: 2.55rem;
  margin-top: .35rem;
  border: 1px solid #cfd8d1;
  border-radius: .5rem;
  background: #f1f6f2;
  color: #5f7667;
  font-size: .7rem;
  font-weight: 700;
}
.calendar-event-detail {
  display: grid;
  gap: .48rem;
  padding: .12rem 0;
}
.calendar-event-detail.hidden { display: none; }
.calendar-event-detail p { margin: 0; }
#calendar-event-mood {
  color: #7c877f;
  font-size: .64rem;
}
#calendar-event-summary {
  color: #555c56;
  font-size: .76rem;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.calendar-event-source {
  justify-self: start;
  min-height: 2.1rem;
  padding: .4rem .62rem;
  border: 1px solid #d4dbd5;
  border-radius: .48rem;
  background: transparent;
  color: #61766a;
  font-size: .65rem;
}
.calendar-event-source.hidden,
.calendar-event-actions.hidden,
.calendar-event-actions button.hidden,
.calendar-event-form .hidden { display: none; }
.calendar-event-actions,
.calendar-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .42rem;
}
.calendar-event-actions button,
.calendar-form-actions button {
  min-height: 2.25rem;
  padding: .44rem .72rem;
  border: 1px solid #d5dad5;
  border-radius: .5rem;
  background: #fff;
  color: #657068;
  font-size: .67rem;
  font-weight: 700;
}
.calendar-event-actions #calendar-event-confirm,
.calendar-form-actions #calendar-event-form-save {
  border-color: #687d6f;
  background: #687d6f;
  color: #fff;
}
.calendar-event-actions .is-danger {
  border-color: #dfc3c0;
  color: #a45d58;
}
.calendar-event-form label {
  display: grid;
  min-width: 0;
  gap: .28rem;
  color: #6f7871;
  font-size: .63rem;
  font-weight: 680;
  scroll-margin-block: 4.4rem 5rem;
}
.calendar-event-form :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  padding: .58rem .62rem;
  border: 1px solid #d7dcd7;
  border-radius: .48rem;
  background: #fff;
  color: #4f5650;
  font: inherit;
  font-size: .72rem;
  line-height: 1.5;
}
.calendar-event-form textarea {
  resize: vertical;
  min-height: 4.8rem;
}
.calendar-form-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .6rem;
}
.calendar-event-form > header {
  position: sticky;
  z-index: 2;
  top: -.48rem;
  margin: 0 -1rem;
  padding: .48rem 1rem .52rem;
  border-bottom: 1px solid rgba(225, 228, 223, .92);
  background: rgba(251, 252, 250, .97);
}
.calendar-event-form .calendar-form-actions {
  position: sticky;
  z-index: 2;
  bottom: calc(0px - max(1rem, env(safe-area-inset-bottom)));
  margin: .08rem -1rem calc(0px - max(1rem, env(safe-area-inset-bottom)));
  padding: .62rem 1rem max(.72rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(225, 228, 223, .92);
  background: rgba(251, 252, 250, .97);
}
body.calendar-form-keyboard-open .calendar-event-form {
  gap: .52rem;
}
body.calendar-form-keyboard-open .calendar-event-form textarea {
  min-height: 3.6rem;
}

:root[data-coco-desktop-theme="dark"] :is(
  .calendar-icon-button,
  .calendar-month-toolbar button,
  .calendar-sheet-panel,
  .calendar-event-actions button,
  .calendar-form-actions button,
  .calendar-event-form input,
  .calendar-event-form select,
  .calendar-event-form textarea
) {
  border-color: #484c49;
  background: #2c2f2d;
  color: #c8cec9;
}
:root[data-coco-desktop-theme="dark"] :is(
  .calendar-page-header h1,
  .calendar-month-toolbar strong,
  .calendar-day,
  .calendar-sheet-panel > header h2,
  .calendar-event-list-item,
  #calendar-event-summary
) { color: #cbd0cc; }
:root[data-coco-desktop-theme="dark"] .calendar-event-recorder {
  border-color: #4d6253;
  background: #2f3b32;
  color: #b8cbbb;
}
:root[data-coco-desktop-theme="dark"] :is(
  .calendar-page-header p,
  .calendar-page-header small,
  .calendar-status,
  .calendar-weekdays span,
  .calendar-legend,
  .calendar-event-list-item small,
  #calendar-event-mood
) { color: #959c97; }
:root[data-coco-desktop-theme="dark"] :is(
  .calendar-month-toolbar,
  .calendar-grid,
  .calendar-day,
  .calendar-day.is-blank,
  .calendar-event-list,
  .calendar-event-list-item
) { border-color: #414542; }
:root[data-coco-desktop-theme="dark"] .calendar-day.is-blank {
  background: #252826;
}
:root[data-coco-desktop-theme="dark"] .calendar-sheet-backdrop {
  background: rgba(8, 10, 9, .52);
}
:root[data-coco-desktop-theme="dark"] .calendar-sheet-panel {
  background: #272a28;
  box-shadow: 0 -1rem 2.4rem rgba(0, 0, 0, .3);
}
:root[data-coco-desktop-theme="dark"] :is(
  .calendar-event-form > header,
  .calendar-event-form .calendar-form-actions
) {
  border-color: #414542;
  background: rgba(39, 42, 40, .98);
}
:root[data-coco-desktop-theme="dark"] .calendar-empty-date-action {
  border-color: #4a554e;
  background: #303833;
  color: #b8c4bc;
}
:root[data-coco-desktop-theme="dark"] :is(
  .calendar-event-actions #calendar-event-confirm,
  .calendar-form-actions #calendar-event-form-save
) {
  border-color: #7b9182;
  background: #718577;
  color: #fff;
}

@media (max-width: 390px) {
  .calendar-day { min-height: 3.15rem; }
  .calendar-day.is-blank { min-height: 3.15rem; }
}

/* 图片消息与大图查看。图片正文仍与头像保持同一行，避免改变聊天节奏。 */
.message-content {
  display: grid;
  min-width: 0;
  gap: .42rem;
  justify-items: start;
}
.message.user .message-content {
  justify-items: end;
}
.assistant-avatar-menu-emotion .ai-emotion-kicker { color: #8a928e; }
.assistant-avatar-menu-emotion .ai-emotion-kicker,
.assistant-avatar-menu-emotion strong,
.assistant-avatar-menu-emotion .ai-emotion-value {
  flex: 0 0 auto;
}
.assistant-avatar-menu-emotion strong {
  overflow: hidden;
  color: #4f5d57;
  font-size: .63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-image-button {
  position: relative;
  display: block;
  width: min(68vw, 18rem);
  max-width: 100%;
  max-height: 20rem;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e3dcd3;
  border-radius: .95rem;
  background: #ece7e1;
  box-shadow: 0 .45rem 1rem rgba(73, 66, 59, .1);
}
.message.user .message-image-button {
  border-color: rgba(215, 125, 104, .35);
}
.message-image-button.is-loading::after,
.message-image-button.is-missing::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8e857d;
  font-size: .7rem;
  content: "正在读取图片…";
}
.message-image-button.is-missing::after {
  content: "图片暂时无法读取";
}
.message-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 20rem;
  object-fit: contain;
}
.message-image:not([src]) {
  visibility: hidden;
}
.attachment-preview.is-error {
  border-color: rgba(182, 83, 88, .28);
  background: rgba(255, 244, 243, .9);
}
.attachment-preview.is-error p {
  color: #b65358;
}

.message-image-viewer {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}
.message-image-viewer.hidden {
  display: none;
}
.message-image-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(25, 24, 23, .86);
}
.message-image-viewer-panel {
  position: relative;
  display: grid;
  width: min(100%, 42rem);
  max-height: 100%;
  place-items: center;
}
.message-image-viewer-panel > button {
  position: absolute;
  z-index: 1;
  top: .35rem;
  right: .35rem;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: #403c39;
  font-size: 1.4rem;
  line-height: 1;
}
.message-image-viewer-panel img {
  display: block;
  max-width: 100%;
  max-height: calc(var(--app-viewport-height, 100dvh) - 2rem);
  border-radius: .35rem;
  object-fit: contain;
}

@media (max-width: 420px) {
  .message-image-button {
    max-width: min(66vw, 16rem);
  }
}

#attachment-button {
  background: #f0ece5;
  box-shadow: none;
  color: #716963;
}
#record-button {
  border: 1px solid #e7c8c2;
  background: #fff5f2;
  box-shadow: none;
}

/* 记忆运营二级工作区与 Memory V3 召回验收。 */
.memory-ops-workspace {
  padding-bottom: .9rem;
}
.memory-ops-subnav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .85rem;
}
.memory-ops-subnav button {
  display: grid;
  min-width: 0;
  min-height: 4.2rem;
  align-content: center;
  gap: .18rem;
  padding: .68rem .75rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .78rem;
  background: rgba(249, 249, 252, .78);
  color: #6b6870;
  text-align: left;
}
.memory-ops-subnav button strong {
  font-size: .75rem;
}
.memory-ops-subnav button span {
  color: #96919a;
  font-size: .62rem;
  line-height: 1.4;
}
.memory-ops-subnav button.is-active {
  border-color: rgba(98, 118, 212, .18);
  background: #6276d4;
  color: #fff;
  box-shadow: 0 .45rem 1rem rgba(98, 118, 212, .18);
}
.memory-ops-subnav button.is-active span {
  color: rgba(255, 255, 255, .76);
}
.archive-queue-safety {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
  margin: .7rem 0 .85rem;
}
.archive-queue-safety span {
  padding: .28rem .48rem;
  border-radius: 99rem;
  background: rgba(229, 241, 233, .82);
  color: #567660;
  font-size: .61rem;
  font-weight: 720;
}
.archive-queue-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin: .7rem 0;
}
.archive-queue-summary article {
  display: grid;
  gap: .16rem;
  min-width: 0;
  padding: .62rem .68rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .42rem;
  background: #f6f7f5;
}
.archive-queue-summary span,
.archive-queue-summary small {
  overflow: hidden;
  color: #8e918e;
  font-size: .61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-queue-summary strong {
  color: #526d61;
  font-size: 1rem;
}
.archive-queue-summary .is-warning strong { color: #a66b45; }
.archive-queue-filters {
  display: grid;
  grid-template-columns:
    minmax(8rem, 1fr)
    minmax(8.5rem, .9fr)
    minmax(8.5rem, .9fr)
    minmax(9rem, 1fr)
    auto;
  align-items: end;
  gap: .5rem;
  margin: .7rem 0 .85rem;
  padding: .62rem;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .42rem;
  background: rgba(247, 248, 246, .84);
}
.archive-queue-filters label {
  display: grid;
  gap: .28rem;
  min-width: 0;
}
.archive-queue-filters label > span {
  color: #7c827e;
  font-size: .65rem;
  font-weight: 700;
}
.archive-queue-filters select,
.archive-queue-filters input {
  width: 100%;
  min-width: 0;
  min-height: 2.2rem;
  padding: .42rem .5rem;
  border: 1px solid rgba(111, 125, 116, .18);
  border-radius: .36rem;
  background: #fff;
  color: #5f6661;
  font-size: .7rem;
}
.archive-queue-filters > button { min-height: 2.2rem; }
.archive-queue-list {
  display: grid;
  gap: .42rem;
  margin-top: .55rem;
}
.archive-queue-item {
  border: 1px solid rgba(112, 124, 117, .16);
  border-left: .24rem solid #87978e;
  border-radius: .42rem;
  background: #fff;
  overflow: hidden;
}
.archive-queue-item.is-source_changed,
.archive-queue-item.is-blocked {
  border-left-color: #b78258;
}
.archive-queue-item.is-ready { border-left-color: #658473; }
.archive-queue-item.is-already_processed { border-left-color: #9a9d9a; }
.archive-queue-item > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  min-height: 4rem;
  padding: .68rem .72rem;
  cursor: pointer;
  list-style: none;
}
.archive-queue-item > summary::-webkit-details-marker { display: none; }
.archive-queue-item-heading {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.archive-queue-item-heading strong {
  overflow: hidden;
  color: #4f5d56;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-queue-status {
  flex: 0 0 auto;
  padding: .2rem .36rem;
  border-radius: 99rem;
  background: #edf1ee;
  color: #68786f;
  font-size: .58rem;
  font-weight: 720;
}
.archive-queue-status.is-source_changed,
.archive-queue-status.is-blocked {
  background: #f8ede3;
  color: #a66b45;
}
.archive-queue-status.is-ready {
  background: #e8f1eb;
  color: #587665;
}
.archive-queue-status.is-already_processed {
  background: #eeefed;
  color: #7e837f;
}
.archive-queue-item summary p {
  margin: .22rem 0 0;
  color: #737d77;
  font-size: .68rem;
}
.archive-queue-item summary small {
  display: block;
  margin-top: .14rem;
  color: #979d99;
  font-size: .61rem;
}
.archive-queue-expand {
  color: #858c87;
  font-size: .62rem;
}
.archive-queue-item-body {
  padding: .68rem .72rem .75rem;
  border-top: 1px solid rgba(112, 124, 117, .11);
  background: #fafbf9;
}
.archive-queue-item-body > p {
  margin: 0 0 .38rem;
  color: #6f7772;
  font-size: .67rem;
  line-height: 1.5;
}
.archive-queue-reason { font-weight: 700; }
.archive-queue-boundary {
  color: #587665 !important;
}
.archive-dry-run-result {
  margin-top: .55rem;
}
.archive-dry-run-result:empty { display: none; }
.archive-dry-run-boundary {
  padding: .48rem .54rem;
  border: 1px solid rgba(93, 130, 105, .16);
  border-radius: .36rem;
  background: #edf5ef;
  color: #55715f;
  font-size: .64rem;
  line-height: 1.5;
}
.archive-dry-run-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .34rem;
  margin-top: .46rem;
}
.archive-dry-run-metrics span {
  display: grid;
  gap: .12rem;
  min-width: 0;
  padding: .42rem .45rem;
  border: 1px solid rgba(112, 124, 117, .12);
  border-radius: .36rem;
  background: #fff;
}
.archive-dry-run-metrics small {
  overflow: hidden;
  color: #8f9691;
  font-size: .56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-dry-run-metrics strong {
  color: #526d61;
  font-size: .76rem;
}
.archive-dry-run-result > p {
  margin: .42rem 0 0;
  color: #737b76;
  font-size: .64rem;
  line-height: 1.5;
}
.archive-dry-run-warning { color: #a66b45 !important; }
.archive-dry-run-ready { color: #587665 !important; font-weight: 700; }
.archive-queue-empty {
  padding: 1.1rem;
  border: 1px dashed rgba(112, 124, 117, .18);
  border-radius: .42rem;
  background: #fafbf9;
  text-align: center;
}
.archive-queue-empty strong {
  color: #59645e;
  font-size: .78rem;
}
.archive-queue-empty p {
  margin: .32rem auto 0;
  max-width: 34rem;
  color: #929894;
  font-size: .65rem;
  line-height: 1.5;
}
.recall-evaluation-security {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
  margin: .75rem 0 .9rem;
}
.recall-evaluation-security span {
  padding: .28rem .48rem;
  border-radius: 99rem;
  background: rgba(229, 241, 233, .82);
  color: #567660;
  font-size: .61rem;
  font-weight: 720;
}
.recall-evaluation-batch-guide {
  display: flex;
  justify-content: space-between;
  gap: .9rem;
  align-items: center;
  margin-bottom: .7rem;
  padding: .72rem .78rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .8rem;
  background: linear-gradient(
    135deg,
    rgba(244, 246, 255, .92),
    rgba(249, 250, 252, .82)
  );
}
.recall-evaluation-batch-guide strong {
  color: #596589;
  font-size: .73rem;
}
.recall-evaluation-batch-guide p {
  margin: .14rem 0 0;
  color: #88848d;
  font-size: .62rem;
  line-height: 1.55;
}
.recall-evaluation-batch-guide > p {
  flex: 0 0 min(22rem, 42%);
  margin: 0;
  text-align: right;
}
.recall-evaluation-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
}
.recall-evaluation-summary article {
  display: grid;
  min-width: 0;
  gap: .12rem;
  padding: .66rem .7rem;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .76rem;
  background: rgba(249, 249, 252, .8);
}
.recall-evaluation-summary article span,
.recall-evaluation-summary article small {
  color: #92909a;
  font-size: .6rem;
  line-height: 1.35;
}
.recall-evaluation-summary article strong {
  color: #596589;
  font-size: 1rem;
}
.recall-evaluation-summary article.is-passed {
  background: rgba(232, 245, 236, .76);
}
.recall-evaluation-summary article.is-passed strong { color: #4f7b5d; }
.recall-evaluation-summary article.is-failed {
  background: rgba(250, 232, 234, .76);
}
.recall-evaluation-summary article.is-failed strong { color: #a35e66; }
.recall-evaluation-summary article.is-review {
  background: rgba(255, 244, 215, .76);
}
.recall-evaluation-summary article.is-review strong { color: #947333; }
.recall-evaluation-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(7rem, 1fr)) minmax(10rem, 1.4fr) auto;
  gap: .5rem;
  align-items: end;
  margin-top: .7rem;
}
.recall-evaluation-maintenance,
.recall-question-advanced {
  margin-top: .75rem;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .76rem;
  background: rgba(249, 249, 252, .72);
}
.recall-evaluation-maintenance > summary,
.recall-question-advanced > summary {
  padding: .62rem .7rem;
  color: #817b82;
  font-size: .64rem;
  font-weight: 720;
  cursor: pointer;
}
.recall-evaluation-maintenance[open] > summary,
.recall-question-advanced[open] > summary {
  border-bottom: 1px solid rgba(98, 118, 212, .08);
}
.recall-evaluation-maintenance .recall-evaluation-filters {
  margin: 0;
  padding: .68rem;
}
.recall-evaluation-maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  padding: 0 .68rem .68rem;
}
.recall-evaluation-filters label,
.recall-evaluation-editor label,
.recall-evaluation-editor-grid label {
  display: grid;
  min-width: 0;
  gap: .25rem;
}
.recall-evaluation-filters label > span,
.recall-evaluation-editor label > span,
.recall-evaluation-editor-grid label > span {
  color: #766f73;
  font-size: .62rem;
  font-weight: 720;
}
.recall-evaluation-filters select,
.recall-evaluation-filters input,
.recall-evaluation-editor select,
.recall-evaluation-editor input,
.recall-evaluation-editor textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .52rem .58rem;
  border: 1px solid rgba(98, 118, 212, .14);
  border-radius: .62rem;
  background: rgba(255, 255, 255, .94);
  color: #57545a;
  font: inherit;
  font-size: .68rem;
  line-height: 1.5;
}
.recall-evaluation-editor textarea {
  min-height: 5.2rem;
  resize: vertical;
}
.recall-evaluation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .52rem;
  margin-top: .55rem;
}
.recall-evaluation-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .42rem;
}
.recall-evaluation-list-actions .soft-button {
  white-space: nowrap;
}
.recall-evaluation-list-item {
  display: grid;
  min-width: 0;
  min-height: 8.1rem;
  align-content: start;
  gap: .48rem;
  padding: .72rem .76rem;
  border: 1px solid rgba(98, 118, 212, .11);
  border-radius: .82rem;
  background: rgba(251, 250, 252, .86);
  color: #5f5b61;
  text-align: left;
}
.recall-evaluation-list-item:hover {
  border-color: rgba(98, 118, 212, .24);
  background: #fff;
}
.recall-evaluation-list-item.is-failed {
  border-color: rgba(182, 83, 88, .18);
  background: rgba(255, 247, 247, .88);
}
.recall-evaluation-list-item.is-passed {
  border-color: rgba(83, 142, 103, .16);
  background: rgba(247, 252, 248, .88);
}
.recall-evaluation-list-heading {
  display: grid;
  gap: .38rem;
}
.recall-evaluation-list-heading > div {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
}
.recall-evaluation-list-heading span {
  padding: .18rem .34rem;
  border-radius: 99rem;
  background: rgba(98, 118, 212, .08);
  color: #7580aa;
  font-size: .56rem;
  font-weight: 720;
}
.recall-evaluation-list-heading span.is-passed {
  background: #dff1e5;
  color: #477158;
}
.recall-evaluation-list-heading span.is-failed {
  background: #f8dfe1;
  color: #9a4e55;
}
.recall-evaluation-list-heading span.is-needs_review {
  background: #fff0c9;
  color: #90702e;
}
.recall-evaluation-list-heading strong {
  color: #5a5150;
  font-size: .76rem;
  line-height: 1.55;
}
.recall-evaluation-list-item > small,
.recall-evaluation-run-meta {
  color: #959097;
  font-size: .61rem;
  line-height: 1.45;
}
.recall-evaluation-detail {
  display: grid;
  gap: .75rem;
}
.recall-evaluation-editor {
  display: grid;
  gap: .62rem;
  padding: .78rem;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .84rem;
  background: rgba(250, 250, 252, .78);
}
.recall-question-advanced-body {
  display: grid;
  gap: .62rem;
  padding: .68rem;
}
.recall-question-advanced-body .recall-evaluation-maintenance-actions {
  padding: 0;
}
.recall-evaluation-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .52rem;
}
.recall-evaluation-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .42rem;
  padding-top: .1rem;
}
.recall-evaluation-actions button.is-danger {
  border-color: rgba(182, 83, 88, .14);
  background: #fff7f6;
  color: #a95f64;
}
.recall-evaluation-actions > span {
  color: #8e8990;
  font-size: .64rem;
}
.recall-evaluation-results {
  padding: .8rem;
  border: 1px solid rgba(98, 118, 212, .12);
  border-radius: .86rem;
  background: rgba(255, 255, 255, .78);
}
.recall-evaluation-result-heading {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
}
.recall-evaluation-result-heading h3 {
  margin: .15rem 0 0;
  color: #5b5558;
  font-size: .88rem;
}
.recall-evaluation-result-heading small {
  display: block;
  margin-top: .18rem;
  color: #96919a;
  font-size: .59rem;
  line-height: 1.5;
}
.recall-evaluation-result-heading h3.is-passed { color: #4f7b5d; }
.recall-evaluation-result-heading h3.is-failed { color: #a35e66; }
.recall-evaluation-result-heading h3.is-needs_review { color: #947333; }
.recall-evaluation-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .7rem;
}
.recall-evaluation-comparison > article {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(98, 118, 212, .1);
  border-radius: .8rem;
  background: rgba(249, 249, 252, .72);
}
.recall-evaluation-comparison > article > header {
  display: grid;
  gap: .12rem;
  padding: .62rem .68rem;
  border-bottom: 1px solid rgba(98, 118, 212, .08);
}
.recall-evaluation-comparison > article > header strong {
  color: #596589;
  font-size: .72rem;
}
.recall-evaluation-comparison > article > header span {
  color: #96919a;
  font-size: .59rem;
}
.recall-evaluation-result-list {
  display: grid;
  gap: .45rem;
  padding: .6rem;
}
.recall-evaluation-result-list > article {
  display: grid;
  min-width: 0;
  gap: .34rem;
  padding: .58rem .62rem;
  border-radius: .68rem;
  background: rgba(255, 255, 255, .9);
}
.recall-evaluation-result-list > article > div {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}
.recall-evaluation-result-list strong {
  color: #625757;
  font-size: .68rem;
}
.recall-evaluation-result-list article span {
  flex: 0 0 auto;
  color: #7d84a0;
  font-size: .58rem;
}
.recall-evaluation-result-list p {
  margin: 0;
  color: #625f64;
  font-size: .68rem;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.recall-evaluation-result-list small {
  color: #98939a;
  font-size: .57rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.recall-evaluation-empty {
  margin: 0;
  padding: .7rem;
  border: 1px dashed rgba(98, 118, 212, .15);
  border-radius: .68rem;
  color: #8e8990;
  font-size: .65rem;
  line-height: 1.55;
}
.recall-evaluation-empty.is-warning {
  border-color: rgba(193, 139, 56, .2);
  background: rgba(255, 248, 226, .62);
  color: #806d4c;
}
.recall-evaluation-result-security {
  margin: .65rem 0 0;
  padding: .55rem .62rem;
  border-radius: .68rem;
  background: rgba(232, 245, 236, .68);
  color: #587060;
  font-size: .62rem;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .memory-ops-subnav,
  .recall-evaluation-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .archive-queue-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .archive-queue-filters > button { width: fit-content; }
  .archive-dry-run-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .recall-evaluation-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .recall-evaluation-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .memory-ops-subnav,
  .archive-queue-filters,
  .recall-evaluation-summary,
  .recall-evaluation-filters,
  .recall-evaluation-list,
  .recall-evaluation-editor-grid,
  .recall-evaluation-comparison {
    grid-template-columns: 1fr;
  }
  .memory-ops-subnav button {
    min-height: auto;
  }
  .archive-queue-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .archive-queue-filters > button { width: 100%; }
  .archive-queue-item > summary {
    align-items: start;
  }
  .archive-queue-item-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .24rem;
  }
  .archive-queue-item-heading strong {
    overflow: visible;
    white-space: normal;
  }
  .archive-dry-run-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recall-evaluation-list-item {
    min-height: auto;
  }
  .recall-evaluation-list-actions {
    justify-content: flex-start;
  }
  .recall-evaluation-result-heading {
    display: grid;
  }
  .recall-evaluation-batch-guide {
    display: grid;
  }
  .recall-evaluation-batch-guide > p {
    width: auto;
    text-align: left;
  }
}

/* 独立的管理台操作流程页。只读说明，不读取任何本地数据。 */
.studio-nav-link {
  display: grid;
  gap: .18rem;
  min-height: 4.2rem;
  align-content: center;
  padding: .72rem .75rem;
  border: 1px solid rgba(145, 105, 89, .1);
  border-radius: .72rem;
  background: transparent;
  color: #776f69;
  text-decoration: none;
}
.studio-nav-link:hover {
  background: rgba(98, 118, 212, .07);
  color: #5d6fbe;
}
.studio-nav-link strong { font-size: .8rem; }
.studio-nav-link span {
  color: #9c958f;
  font-size: .65rem;
  line-height: 1.35;
}

.workflow-shell {
  width: min(100% - 2rem, 76rem);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 0 max(1.4rem, env(safe-area-inset-bottom));
}
.workflow-header {
  padding: .2rem .15rem 1.15rem;
}
.workflow-header-links {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1.05rem;
}
.workflow-chat-link {
  color: #8d7b74;
  font-size: .72rem;
  font-weight: 720;
  text-decoration: none;
}
.workflow-chat-link:hover,
.back-link:hover { color: #6276d4; }
.workflow-header h1 {
  margin: .35rem 0 .3rem;
  color: #4c3d39;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -.055em;
}
.workflow-header > p:not(.studio-kicker) {
  max-width: 45rem;
  margin: 0;
  color: #88756d;
}
.workflow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .85rem;
}
.workflow-principle {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  margin-bottom: .85rem;
  padding: 1rem 1.1rem;
}
.workflow-principle h2,
.workflow-section-heading h2,
.workflow-panel h2,
.workflow-footer h2 {
  margin: .18rem 0 0;
  color: #4d403b;
  font-size: 1.05rem;
  letter-spacing: -.025em;
}
.workflow-principle-copy {
  margin: 0;
  color: #796862;
  font-size: .78rem;
}
.workflow-principle-copy strong { color: #6c554e; }
.workflow-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: .9rem;
}
.workflow-readonly-badge {
  padding: .3rem .48rem;
  border: 1px solid rgba(98, 118, 212, .18);
  border-radius: 99rem;
  background: rgba(233, 237, 255, .75);
  color: #6276b6;
  font-size: .63rem;
  font-weight: 760;
  white-space: nowrap;
}
.workflow-map { padding: 1.1rem; }
.workflow-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: .65rem;
  align-items: stretch;
}
.workflow-step {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .52rem;
  min-height: 12.2rem;
  padding: .8rem;
  border: 1px solid rgba(145, 105, 89, .12);
  border-radius: 1rem;
  background: rgba(255, 252, 247, .78);
}
.workflow-step > div:last-child {
  display: contents;
}
.workflow-step-number {
  position: absolute;
  top: .6rem;
  right: .7rem;
  color: #a89a92;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.workflow-step-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: .72rem;
  background: #eee8e1;
  color: #79645c;
  font-size: .72rem;
  font-weight: 800;
}
.workflow-step h3 {
  grid-column: 2;
  grid-row: 1;
  margin: 0 1.25rem 0 0;
  color: #55443e;
  font-size: .9rem;
  line-height: 1.35;
}
.workflow-step p {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  color: #8b7971;
  font-size: .71rem;
  line-height: 1.55;
}
.workflow-step ul {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  gap: .18rem;
  margin: .16rem 0 0;
  padding-left: .9rem;
  color: #77655e;
  font-size: .67rem;
  line-height: 1.52;
}
.workflow-step-source { background: linear-gradient(145deg, #fffaf4, #f8efe5); }
.workflow-step-source .workflow-step-icon { background: #f2ddce; color: #99624d; }
.workflow-step-retain { background: linear-gradient(145deg, #fffaf4, #f6f1df); }
.workflow-step-retain .workflow-step-icon { background: #eee7c9; color: #8e7b42; }
.workflow-step-review { background: linear-gradient(145deg, #fbf9ff, #edeafb); }
.workflow-step-review .workflow-step-icon { background: #e3def8; color: #705aab; }
.workflow-step-memory { background: linear-gradient(145deg, #f5fbf8, #e5f2eb); }
.workflow-step-memory .workflow-step-icon { background: #d9eee1; color: #4f8c68; }
.workflow-step-cleanup { background: linear-gradient(145deg, #fff8f8, #f7e7e8); }
.workflow-step-cleanup .workflow-step-icon { background: #f2d7da; color: #a25d68; }
.workflow-arrow {
  display: grid;
  min-width: 1.1rem;
  place-items: center;
  color: #b49c91;
  font-size: 1.25rem;
  font-weight: 800;
}
.workflow-arrow-down {
  grid-column: 5;
  grid-row: 2;
  align-self: center;
  transform: rotate(90deg);
}
.workflow-loop-note {
  margin-top: .8rem;
  padding: .7rem .8rem;
  border: 1px solid rgba(98, 118, 212, .13);
  border-radius: .8rem;
  background: rgba(238, 241, 255, .65);
  color: #6672a2;
  font-size: .7rem;
  line-height: 1.5;
}
.workflow-loop-note strong { color: #56669f; }
.workflow-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin-top: .85rem;
}
.workflow-panel,
.workflow-safety,
.workflow-footer { padding: 1rem 1.1rem; }
.workflow-panel-heading {
  display: flex;
  gap: .65rem;
  align-items: center;
  margin-bottom: .85rem;
}
.workflow-panel-icon {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: .65rem;
  background: #ece8fa;
  color: #6f5ba4;
  font-size: .7rem;
  font-weight: 820;
}
.workflow-status-list,
.workflow-layer-list {
  display: grid;
  gap: .62rem;
}
.workflow-status-list > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .55rem;
  align-items: start;
}
.workflow-status-dot {
  width: .58rem;
  height: .58rem;
  margin-top: .28rem;
  border-radius: 50%;
  background: #9c958f;
}
.workflow-status-dot.is-active { background: #71a781; }
.workflow-status-dot.is-archived { background: #c79b56; }
.workflow-status-dot.is-unmanaged { background: #a09aa0; }
.workflow-status-list strong,
.workflow-layer-list strong {
  display: block;
  color: #5d4d46;
  font-size: .75rem;
}
.workflow-status-list p {
  margin: .12rem 0 0;
  color: #8b7971;
  font-size: .67rem;
}
.workflow-layer-list > div {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: .6rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid rgba(145, 105, 89, .1);
}
.workflow-layer-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.workflow-layer-list span {
  color: #8b7971;
  font-size: .68rem;
  line-height: 1.45;
}
.workflow-safety { margin-top: .85rem; }
.workflow-safety-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
}
.workflow-safety-grid > div {
  display: grid;
  gap: .28rem;
  padding: .65rem;
  border: 1px solid rgba(190, 109, 119, .12);
  border-radius: .78rem;
  background: rgba(255, 247, 247, .7);
}
.workflow-safety-grid strong {
  color: #85575d;
  font-size: .7rem;
}
.workflow-safety-grid span {
  color: #987d80;
  font-size: .64rem;
  line-height: 1.4;
}
.workflow-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: .85rem;
}
.workflow-footer h2 { margin-bottom: .22rem; }
.workflow-footer p:last-child {
  margin: 0;
  color: #8b7971;
  font-size: .7rem;
}
.workflow-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}
.workflow-primary-link,
.workflow-secondary-link {
  display: inline-flex;
  min-height: 2.45rem;
  align-items: center;
  justify-content: center;
  padding: .55rem .8rem;
  border-radius: .72rem;
  font-size: .72rem;
  font-weight: 760;
  text-decoration: none;
}
.workflow-primary-link {
  background: #6276d4;
  color: #fff;
  box-shadow: 0 .45rem .9rem rgba(98, 118, 212, .2);
}
.workflow-secondary-link {
  border: 1px solid rgba(145, 105, 89, .12);
  background: #fffaf4;
  color: #79655d;
}

@media (max-width: 900px) {
  .workflow-flow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .workflow-step-cleanup { grid-column: 1 / -1; }
  .workflow-arrow-down { display: none; }
  .workflow-safety-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .studio-nav-link {
    flex: 0 0 9.5rem;
    min-height: auto;
    padding: .6rem .65rem;
  }
  .workflow-shell { width: min(100% - 1rem, 48rem); }
  .workflow-principle,
  .workflow-columns { grid-template-columns: 1fr; }
  .workflow-principle { gap: .5rem; }
  .workflow-flow { grid-template-columns: 1fr; }
  .workflow-step,
  .workflow-step-cleanup { grid-column: auto; }
  .workflow-arrow {
    min-height: 1rem;
    transform: rotate(90deg);
  }
  .workflow-safety-grid { grid-template-columns: 1fr; }
  .workflow-footer {
    display: grid;
    align-items: start;
  }
  .workflow-footer-actions { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .workflow-step {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .workflow-step-icon { grid-column: 1; grid-row: 1; }
  .workflow-step h3 { grid-column: 2; grid-row: 1; }
  .workflow-step p,
  .workflow-step ul { grid-column: 1 / -1; }
  .workflow-layer-list > div { grid-template-columns: 4.8rem minmax(0, 1fr); }
}

/* 管理后台视觉层：仅作用于 studio.html，不改变任何功能和交互。 */
body.studio-page {
  --studio-canvas: #eeefed;
  --studio-surface: #fbfbfa;
  --studio-surface-muted: #f4f5f3;
  --studio-ink: #24292d;
  --studio-copy: #626a6c;
  --studio-muted: #8a9191;
  --studio-line: #d7dad6;
  --studio-line-strong: #c7cbc6;
  --studio-nav: #20252b;
  --studio-nav-muted: #aeb6b8;
  --studio-accent: #415d60;
  --studio-accent-soft: #e6ecea;
  --studio-warm: #8b654f;
  --studio-danger: #9a4e51;
  min-height: 100dvh;
  background: linear-gradient(180deg, #f3f4f2 0, var(--studio-canvas) 100%);
  color: var(--studio-ink);
}

.studio-page .studio-shell {
  grid-template-columns: 15rem minmax(0, 1fr);
  grid-template-areas:
    "nav header"
    "nav content";
  column-gap: 1.5rem;
  width: min(100%, 86rem);
  padding: 1.25rem 1.4rem 3rem;
}

.studio-page .studio-header {
  align-self: start;
  margin: 0 0 1rem;
  padding: .2rem 0 1.15rem;
  border-bottom: 1px solid var(--studio-line);
}

.studio-page .back-link {
  color: #687173;
  font-size: .73rem;
  font-weight: 650;
  text-decoration: none;
}

.studio-page .back-link:hover { color: var(--studio-ink); }

.studio-page .studio-kicker,
.studio-page .section-kicker {
  color: var(--studio-warm);
  font-size: .64rem;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.studio-page .studio-header h1 {
  margin: .48rem 0 .32rem;
  color: var(--studio-ink);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 720;
  letter-spacing: 0;
}

.studio-page .studio-header > p:last-child {
  max-width: 49rem;
  color: var(--studio-copy);
  font-size: .82rem;
  line-height: 1.7;
}

.studio-page .config-legend {
  gap: .42rem;
  margin-top: .85rem;
}

.studio-page .config-status {
  gap: .28rem;
  padding: .24rem .44rem;
  border: 1px solid transparent;
  border-radius: .28rem;
  font-size: .61rem;
  font-weight: 700;
}

.studio-page .config-status::before {
  width: .34rem;
  height: .34rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: .72;
}

.studio-page .config-status.active {
  border-color: #cadbcf;
  background: #edf5ef;
  color: #4f7259;
}

.studio-page .config-status.pending {
  border-color: #e3d5bd;
  background: #f8f2e8;
  color: #8b6734;
}

.studio-page .config-status.local {
  border-color: #d6d9d6;
  background: #f1f2f0;
  color: #697173;
}

.studio-page .studio-nav {
  top: 1.25rem;
  align-content: start;
  gap: .3rem;
  min-height: calc(100dvh - 2.5rem);
  padding: .78rem;
  border: 1px solid #2d343b;
  border-radius: .5rem;
  background: var(--studio-nav);
  box-shadow: 0 1.1rem 2.4rem rgba(28, 33, 37, .15);
  backdrop-filter: none;
}

.studio-page .studio-nav button,
.studio-page .studio-nav-link {
  gap: .2rem;
  min-height: 3.45rem;
  padding: .7rem .72rem;
  border: 1px solid transparent;
  border-radius: .36rem;
  background: transparent;
  color: #e7eaeb;
}

.studio-page .studio-nav button strong,
.studio-page .studio-nav-link strong {
  font-size: .76rem;
  font-weight: 690;
}

.studio-page .studio-nav button span,
.studio-page .studio-nav-link span {
  color: var(--studio-nav-muted);
  font-size: .62rem;
  line-height: 1.42;
}

.studio-page .studio-nav button:hover,
.studio-page .studio-nav-link:hover {
  border-color: #3a4249;
  background: #292f35;
}

.studio-page .studio-nav button.is-active {
  border-color: #e4e6e2;
  background: #f2f3f0;
  color: var(--studio-ink);
  box-shadow: none;
}

.studio-page .studio-nav button.is-active span { color: #6f7778; }

.studio-page .studio-nav-link {
  margin-top: .38rem;
  border-top-color: #343b42;
}

.studio-page .studio-nav-badge,
.studio-page .transcript-task-badge {
  border-radius: .25rem;
  box-shadow: none;
}

.studio-page .studio-form { padding-bottom: 1rem; }

.studio-page .studio-section {
  margin-bottom: .9rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--studio-line);
  border-radius: .5rem;
  background: var(--studio-surface);
  box-shadow: 0 1px 2px rgba(31, 37, 40, .04);
}

.studio-page .section-heading { align-items: center; }

.studio-page .section-heading h2 {
  color: var(--studio-ink);
  font-size: 1rem;
  font-weight: 690;
  letter-spacing: 0;
}

.studio-page .section-heading .section-kicker { margin-bottom: .22rem; }

.studio-page .section-copy {
  margin: .48rem 0 1rem;
  color: var(--studio-copy);
  font-size: .76rem;
  line-height: 1.65;
}

.studio-page .field > span,
.studio-page .memory-field > span,
.studio-page .memory-v2-generator-controls label > span,
.studio-page .memory-v2-filters label > span,
.studio-page .transcript-filters label > span,
.studio-page .transcript-detail-search label > span,
.studio-page .transcript-range-selector label > span,
.studio-page .memory-library-filters label > span,
.studio-page .transcript-task-list-controls label span,
.studio-page .transcript-task-journal-review > label > span,
.studio-page .transcript-task-candidate-editor label > span {
  color: #596164;
  font-size: .67rem;
  font-weight: 680;
}

.studio-page .studio-form :is(
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  select,
  textarea
) {
  border-color: var(--studio-line-strong);
  border-radius: .38rem;
  background-color: #fff;
  color: var(--studio-ink);
  box-shadow: inset 0 1px 1px rgba(33, 38, 41, .025);
}

.studio-page .studio-form :is(
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  select,
  textarea
):focus {
  outline: 2px solid rgba(65, 93, 96, .15);
  outline-offset: 1px;
  border-color: var(--studio-accent);
}

.studio-page input::placeholder,
.studio-page textarea::placeholder { color: #a1a7a5; }

.studio-page input[type="checkbox"],
.studio-page input[type="radio"],
.studio-page input[type="range"] { accent-color: var(--studio-accent); }

.studio-page .field-limit,
.studio-page .binding-note,
.studio-page .memory-access-note,
.studio-page .memory-actions p,
.studio-page .memory-status,
.studio-page .memory-curator-actions p {
  color: var(--studio-muted);
}

.studio-page .soft-button,
.studio-page .persona-editor-actions button,
.studio-page .memory-lock-button,
.studio-page .avatar-upload-button,
.studio-page .avatar-clear,
.studio-page .memory-v2-pagination button,
.studio-page .transcript-pagination button,
.studio-page .memory-library-pagination button,
.studio-page .memory-pause {
  min-height: 2.18rem;
  padding: .48rem .68rem;
  border: 1px solid var(--studio-line-strong);
  border-radius: .36rem;
  background: #fff;
  color: #454d50;
  box-shadow: none;
  font-size: .69rem;
  font-weight: 680;
}

.studio-page .soft-button:hover,
.studio-page .persona-editor-actions button:hover,
.studio-page .avatar-upload-button:hover {
  border-color: #aeb5b1;
  background: #f5f6f4;
}

.studio-page .memory-access-actions button,
.studio-page .primary-compact-button,
.studio-page .memory-v2-generator-actions button,
.studio-page .memory-import-button,
.studio-page .memory-v2-approve,
.studio-page .memory-approve,
.studio-page .studio-save button,
.studio-page .memory-library-reminder button {
  border: 1px solid var(--studio-accent);
  border-radius: .38rem;
  background: var(--studio-accent);
  color: #fff;
  box-shadow: none;
}

.studio-page .memory-access-actions button:hover,
.studio-page .primary-compact-button:hover,
.studio-page .memory-v2-generator-actions button:hover,
.studio-page .memory-import-button:hover,
.studio-page .studio-save button:hover {
  border-color: #334c4e;
  background: #334c4e;
}

.studio-page .memory-lock-button,
.studio-page .persona-editor-actions .persona-delete-button,
.studio-page .transcript-list-item-actions .is-danger,
.studio-page .transcript-detail-toolbar-actions .is-danger,
.studio-page .transcript-task-remove,
.studio-page .transcript-task-review-actions .is-reject,
.studio-page .memory-v2-reject {
  border-color: #dfc7c7;
  background: #fffafa;
  color: var(--studio-danger);
}

.studio-page .memory-delete,
.studio-page .avatar-clear {
  color: var(--studio-danger);
  background: transparent;
}

.studio-page .memory-access-panel {
  grid-template-columns: 3rem minmax(0, 42rem);
  min-height: 20rem;
  padding: 2rem;
}

.studio-page .memory-access-icon {
  width: 3rem;
  height: 3rem;
  border: 1px solid #cbd7d5;
  border-radius: .42rem;
  background: var(--studio-accent-soft);
  color: var(--studio-accent);
}

.studio-page .memory-access-panel h2 {
  color: var(--studio-ink);
  font-size: 1.1rem;
  font-weight: 690;
}

.studio-page .avatar-editor,
.studio-page .persona-editor,
.studio-page .persona-runtime-setting,
.studio-page .voice-intent-panel,
.studio-page .memory-policy-panel,
.studio-page .memory-zone-guide,
.studio-page .memory-curator-status,
.studio-page .memory-v2-generator,
.studio-page .memory-v2-current-day,
.studio-page .memory-v2-review,
.studio-page .memory-preview,
.studio-page .memory-card,
.studio-page .transcript-security-note,
.studio-page .transcript-selection-panel,
.studio-page .transcript-task-purpose-panel,
.studio-page .transcript-task-preview,
.studio-page .transcript-task-cloud-panel,
.studio-page .transcript-task-review-output,
.studio-page .transcript-task-result-panel,
.studio-page .transcript-task-memory-result,
.studio-page .memory-v3-diagnostic {
  border-color: var(--studio-line);
  border-radius: .42rem;
  background: #fff;
  box-shadow: none;
}

.studio-page .persona-runtime-setting {
  border-color: var(--studio-line);
  border-radius: .42rem;
  background: var(--studio-surface-muted);
}

.studio-page .persona-runtime-setting strong { color: var(--studio-ink); }
.studio-page .persona-runtime-setting p { color: var(--studio-muted); }
.studio-page .studio-toggle input:checked + .studio-toggle-track {
  border-color: var(--studio-accent);
  background: var(--studio-accent);
}
.studio-page .studio-toggle-label { color: var(--studio-muted); }

.studio-page .persona-editor {
  padding: 1.05rem;
  border-left: .2rem solid #758486;
}

.studio-page .persona-editor.is-archived {
  border-left-color: #a7abaa;
  background: #f4f5f3;
}

.studio-page .persona-card-title,
.studio-page .avatar-editor strong {
  color: var(--studio-ink);
}

.studio-page .persona-state {
  border: 1px solid #cbdacf;
  border-radius: .28rem;
  background: #edf4ef;
  color: #54705c;
}

.studio-page .persona-state.is-draft,
.studio-page .persona-state.is-archived {
  border-color: #d6d9d6;
  background: #f1f2f0;
  color: #737a7b;
}

.studio-page .avatar-preview {
  border-color: #fff;
  border-radius: .5rem;
  background: var(--studio-nav);
  color: #d8b27a;
  box-shadow: 0 .3rem .8rem rgba(32, 37, 43, .12);
}

.studio-page .avatar-preview-user {
  border-radius: 50%;
  background: #d9c4b6;
  color: #664f43;
}

.studio-page .avatar-upload-button {
  display: inline-block;
  line-height: 1.15;
}

.studio-page .voice-intent-panel summary,
.studio-page .memory-policy-panel summary,
.studio-page .memory-zone-guide summary {
  color: var(--studio-accent);
}

.studio-page .voice-sliders label { color: #596164; }
.studio-page .voice-sliders output { color: var(--studio-accent); }

.studio-page .memory-library-tabs {
  gap: .2rem;
  padding: .22rem;
  border: 1px solid var(--studio-line);
  border-radius: .42rem;
  background: #eceeeb;
}

.studio-page .memory-library-tabs button {
  border-radius: .3rem;
  color: #6f7778;
}

.studio-page .memory-library-tabs button.is-active {
  background: #fff;
  color: var(--studio-ink);
  box-shadow: 0 1px 2px rgba(31, 37, 40, .08);
}

.studio-page .memory-v2-filters,
.studio-page .transcript-filters,
.studio-page .memory-library-filters,
.studio-page .transcript-task-list-controls,
.studio-page .transcript-detail-search {
  border-color: var(--studio-line);
  border-radius: .42rem;
  background: var(--studio-surface-muted);
}

.studio-page .memory-v2-source-preview,
.studio-page .memory-v2-sanitized-preview,
.studio-page .memory-v2-sanitized-toolbar,
.studio-page .transcript-selection-content,
.studio-page .transcript-task-preview-filter,
.studio-page .transcript-task-storage-boundary,
.studio-page .transcript-task-cloud-confirm {
  border-color: var(--studio-line);
  border-radius: .38rem;
  background: var(--studio-surface-muted);
  box-shadow: none;
}

.studio-page :is(
  .memory-v2-summary,
  .transcript-summary,
  .diagnostic-summary-grid,
  .memory-library-summary,
  .transcript-task-preview-summary,
  .transcript-task-run-summary
) article {
  border: 1px solid var(--studio-line);
  border-radius: .38rem;
  background: #f6f7f5;
}

.studio-page :is(
  .memory-v2-summary,
  .transcript-summary,
  .diagnostic-summary-grid,
  .memory-library-summary,
  .transcript-task-preview-summary,
  .transcript-task-run-summary
) article strong {
  color: var(--studio-accent);
}

.studio-page .memory-v2-day-button,
.studio-page .transcript-list-item,
.studio-page .transcript-task-card,
.studio-page .transcript-task-preview-message,
.studio-page .transcript-task-candidate-card,
.studio-page .memory-library-categories button {
  border-color: var(--studio-line);
  border-radius: .38rem;
  background: #fff;
  box-shadow: none;
}

.studio-page .memory-v2-day-button:hover,
.studio-page .transcript-list-item:hover,
.studio-page .memory-library-categories button:hover {
  border-color: #aeb8b4;
  background: #f7f8f6;
  box-shadow: none;
  transform: none;
}

.studio-page .memory-library-categories button.is-active,
.studio-page .transcript-task-purpose-options label:has(input:checked) {
  border-color: #9fb2af;
  background: var(--studio-accent-soft);
  color: var(--studio-accent);
  box-shadow: inset 0 0 0 1px rgba(65, 93, 96, .05);
}

.studio-page .transcript-task-purpose-options label {
  border-color: var(--studio-line);
  border-radius: .38rem;
  background: #fff;
}

.studio-page .transcript-message {
  border-color: var(--studio-line);
  border-radius: .38rem;
  background: #fff;
}

.studio-page .transcript-message.is-user {
  border-left-color: #647483;
  background: #f2f4f5;
}

.studio-page .transcript-message.is-assistant {
  border-left-color: #6f8a7a;
  background: #f2f5f3;
}

.studio-page .transcript-detail-safety,
.studio-page .transcript-task-safety,
.studio-page .transcript-task-stage-banner {
  border: 1px solid #cedbd3;
  border-radius: .38rem;
  background: #eff5f1;
}

.studio-page .memory-library-reminder {
  border-color: #dfd0b4;
  border-left-color: #9b7947;
  border-radius: .42rem;
  background: #faf6ed;
}

.studio-page .memory-card.is-needs_review,
.studio-page .memory-library-summary article.is-review[role="button"] {
  border-color: #dfd0b4;
  background: #faf7ef;
}

.studio-page .memory-card > summary,
.studio-page .transcript-task-result-panel > summary {
  border-radius: .38rem;
}

.studio-page .memory-v2-status,
.studio-page .memory-card-status,
.studio-page .transcript-list-item-top span,
.studio-page .transcript-task-card header span,
.studio-page .transcript-task-stage-flags span,
.studio-page .transcript-task-preview-tags i,
.studio-page .memory-v2-candidate-labels span,
.studio-page .memory-v3-diagnostic-metrics span {
  border-radius: .26rem;
}

.studio-page .studio-save {
  bottom: .75rem;
  border-color: #cfd4d0;
  border-radius: .5rem;
  background: rgba(250, 251, 249, .94);
  box-shadow: 0 .8rem 1.8rem rgba(31, 37, 40, .1);
}

.studio-page .studio-save p { color: var(--studio-copy); }

@media (max-width: 840px) {
  .studio-page .studio-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "nav"
      "content";
    row-gap: .7rem;
    width: min(100%, 52rem);
    padding: 1rem;
  }

  .studio-page .studio-nav {
    position: static;
    display: flex;
    min-height: auto;
    overflow-x: auto;
    padding: .42rem;
    border-radius: .42rem;
  }

  .studio-page .studio-nav button,
  .studio-page .studio-nav-link {
    flex: 0 0 9.5rem;
    min-height: 3.2rem;
    padding: .58rem .65rem;
  }

  .studio-page .studio-nav-link {
    margin-top: 0;
    border-top-color: transparent;
  }
}

@media (max-width: 420px) {
  .studio-page .studio-shell {
    row-gap: .55rem;
    padding: max(.75rem, env(safe-area-inset-top)) .72rem 2rem;
  }

  .studio-page .studio-header {
    padding: .05rem 0 .7rem;
  }

  .studio-page .studio-header h1 {
    margin: .28rem 0 .2rem;
    font-size: 1.42rem;
  }

  .studio-page .studio-header > p:last-child {
    font-size: .69rem;
    line-height: 1.55;
  }

  .studio-page .studio-nav {
    gap: .2rem;
    padding: .34rem;
  }

  .studio-page .studio-nav button,
  .studio-page .studio-nav-link {
    flex-basis: 7.2rem;
    min-height: 2.7rem;
    padding: .48rem .52rem;
  }

  .studio-page .studio-section {
    margin-bottom: .62rem;
    padding: .85rem .78rem;
    border-radius: .42rem;
  }

  .studio-page .memory-access-panel {
    grid-template-columns: 1fr;
    min-height: 17rem;
    padding: 1.1rem;
  }

  .studio-page .studio-save {
    border-radius: .42rem;
  }
}

/* 操作流程图沿用管理后台视觉语言，仅调整只读页面外观。 */
body.workflow-page {
  --workflow-canvas: #eeefed;
  --workflow-surface: #fbfbfa;
  --workflow-surface-muted: #f4f5f3;
  --workflow-ink: #24292d;
  --workflow-copy: #626a6c;
  --workflow-muted: #899091;
  --workflow-line: #d7dad6;
  --workflow-line-strong: #c7cbc6;
  --workflow-accent: #415d60;
  --workflow-accent-soft: #e6ecea;
  --workflow-warm: #8b654f;
  min-height: 100dvh;
  background: linear-gradient(180deg, #f3f4f2 0, var(--workflow-canvas) 100%);
  color: var(--workflow-ink);
}

.workflow-page .workflow-shell {
  width: min(100% - 2.5rem, 82rem);
  padding: max(1.25rem, env(safe-area-inset-top)) 0 max(2rem, env(safe-area-inset-bottom));
}

.workflow-page .workflow-header {
  padding: .15rem 0 1.25rem;
  border-bottom: 1px solid var(--workflow-line);
}

.workflow-page .workflow-header-links { margin-bottom: 1.35rem; }

.workflow-page .back-link,
.workflow-page .workflow-chat-link {
  color: #687173;
  font-size: .72rem;
  font-weight: 650;
}

.workflow-page .back-link:hover,
.workflow-page .workflow-chat-link:hover { color: var(--workflow-ink); }

.workflow-page .studio-kicker,
.workflow-page .card-kicker {
  color: var(--workflow-warm);
  font-size: .64rem;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.workflow-page .workflow-header h1 {
  margin: .48rem 0 .32rem;
  color: var(--workflow-ink);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 720;
  letter-spacing: 0;
}

.workflow-page .workflow-header > p:not(.studio-kicker) {
  max-width: 48rem;
  color: var(--workflow-copy);
  font-size: .8rem;
  line-height: 1.7;
}

.workflow-page .workflow-legend { gap: .42rem; }

.workflow-page .config-status,
.workflow-page .workflow-readonly-badge {
  gap: .28rem;
  padding: .24rem .44rem;
  border: 1px solid transparent;
  border-radius: .28rem;
  font-size: .61rem;
  font-weight: 700;
}

.workflow-page .config-status::before,
.workflow-page .workflow-readonly-badge::before {
  width: .34rem;
  height: .34rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: .72;
}

.workflow-page .config-status.active {
  border-color: #cadbcf;
  background: #edf5ef;
  color: #4f7259;
}

.workflow-page .config-status.pending {
  border-color: #e3d5bd;
  background: #f8f2e8;
  color: #8b6734;
}

.workflow-page .config-status.local {
  border-color: #d6d9d6;
  background: #f1f2f0;
  color: #697173;
}

.workflow-page .card {
  border: 1px solid var(--workflow-line);
  border-radius: .5rem;
  background: var(--workflow-surface);
  box-shadow: 0 1px 2px rgba(31, 37, 40, .04);
}

.workflow-page .card::after { display: none; }

.workflow-page .workflow-principle {
  margin: 1rem 0;
  padding: 1.15rem 1.2rem;
  border-color: #2c3339;
  background: #20252b;
}

.workflow-page .workflow-principle .card-kicker { color: #d3b28c; }

.workflow-page .workflow-principle h2 {
  color: #f4f5f3;
  font-weight: 680;
  letter-spacing: 0;
}

.workflow-page .workflow-principle-copy { color: #c3c9ca; }
.workflow-page .workflow-principle-copy strong { color: #fff; }

.workflow-page .workflow-map {
  padding: 1.2rem;
}

.workflow-page .workflow-principle h2,
.workflow-page .workflow-section-heading h2,
.workflow-page .workflow-panel h2,
.workflow-page .workflow-footer h2 {
  color: var(--workflow-ink);
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: 0;
}

.workflow-page .workflow-principle h2 { color: #f4f5f3; }

.workflow-page .workflow-readonly-badge {
  display: inline-flex;
  align-items: center;
  border-color: #cbd7d5;
  background: var(--workflow-accent-soft);
  color: var(--workflow-accent);
}

.workflow-page .workflow-flow { gap: .7rem; }

.workflow-page .workflow-step {
  min-height: 12.2rem;
  padding: .82rem;
  border-color: var(--workflow-line);
  border-left-width: .22rem;
  border-radius: .42rem;
  background: #fff;
  box-shadow: none;
}

.workflow-page .workflow-step-number {
  color: #9da3a2;
  letter-spacing: .08em;
}

.workflow-page .workflow-step-icon {
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: .36rem;
  font-weight: 760;
}

.workflow-page .workflow-step h3 {
  color: var(--workflow-ink);
  font-size: .86rem;
  font-weight: 680;
}

.workflow-page .workflow-step p {
  color: var(--workflow-copy);
  font-size: .69rem;
}

.workflow-page .workflow-step ul {
  color: #697173;
  font-size: .66rem;
}

.workflow-page .workflow-step-source { border-left-color: #9b7057; }
.workflow-page .workflow-step-source .workflow-step-icon {
  border-color: #dfcfc3;
  background: #f4ece7;
  color: #815a45;
}

.workflow-page .workflow-step-retain { border-left-color: #9a814a; }
.workflow-page .workflow-step-retain .workflow-step-icon {
  border-color: #ded5bb;
  background: #f4f0e3;
  color: #786738;
}

.workflow-page .workflow-step-review { border-left-color: #66748a; }
.workflow-page .workflow-step-review .workflow-step-icon {
  border-color: #ced4dd;
  background: #eef0f4;
  color: #58667c;
}

.workflow-page .workflow-step-memory { border-left-color: #65816e; }
.workflow-page .workflow-step-memory .workflow-step-icon {
  border-color: #c9d9ce;
  background: #edf4ef;
  color: #54705d;
}

.workflow-page .workflow-step-cleanup { border-left-color: #985d61; }
.workflow-page .workflow-step-cleanup .workflow-step-icon {
  border-color: #dfcacc;
  background: #f7eeee;
  color: #874f53;
}

.workflow-page .workflow-arrow {
  color: #929998;
  font-size: 1.05rem;
  font-weight: 650;
}

.workflow-page .workflow-loop-note {
  margin-top: .85rem;
  padding: .72rem .8rem;
  border: 1px solid #cbd7d5;
  border-radius: .38rem;
  background: var(--workflow-accent-soft);
  color: #5f7172;
}

.workflow-page .workflow-loop-note strong { color: var(--workflow-accent); }

.workflow-page .workflow-columns {
  gap: .9rem;
  margin-top: .9rem;
}

.workflow-page .workflow-panel,
.workflow-page .workflow-safety,
.workflow-page .workflow-footer {
  padding: 1.1rem 1.15rem;
}

.workflow-page .workflow-panel-icon {
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid #cbd7d5;
  border-radius: .36rem;
  background: var(--workflow-accent-soft);
  color: var(--workflow-accent);
}

.workflow-page .workflow-status-list strong,
.workflow-page .workflow-layer-list strong {
  color: var(--workflow-ink);
  font-weight: 680;
}

.workflow-page .workflow-status-list p,
.workflow-page .workflow-layer-list span,
.workflow-page .workflow-footer p:last-child {
  color: var(--workflow-copy);
}

.workflow-page .workflow-layer-list > div {
  border-bottom-color: var(--workflow-line);
}

.workflow-page .workflow-safety { margin-top: .9rem; }

.workflow-page .workflow-safety-grid > div {
  border: 1px solid var(--workflow-line);
  border-left: .18rem solid #9a676a;
  border-radius: .38rem;
  background: #fff;
}

.workflow-page .workflow-safety-grid strong { color: #734d50; }
.workflow-page .workflow-safety-grid span { color: #7a7071; }

.workflow-page .workflow-footer {
  margin-top: .9rem;
  border-color: #cfd4d0;
}

.workflow-page .workflow-primary-link,
.workflow-page .workflow-secondary-link {
  min-height: 2.35rem;
  padding: .52rem .76rem;
  border-radius: .38rem;
  box-shadow: none;
}

.workflow-page .workflow-primary-link {
  border: 1px solid var(--workflow-accent);
  background: var(--workflow-accent);
  color: #fff;
}

.workflow-page .workflow-primary-link:hover {
  border-color: #334c4e;
  background: #334c4e;
}

.workflow-page .workflow-secondary-link {
  border: 1px solid var(--workflow-line-strong);
  background: #fff;
  color: #454d50;
}

.workflow-page .workflow-secondary-link:hover { background: #f5f6f4; }

@media (max-width: 680px) {
  .workflow-page .workflow-shell {
    width: min(100% - 1.2rem, 48rem);
    padding-top: max(.85rem, env(safe-area-inset-top));
  }

  .workflow-page .workflow-header-links { margin-bottom: 1rem; }

  .workflow-page .workflow-principle,
  .workflow-page .workflow-map,
  .workflow-page .workflow-panel,
  .workflow-page .workflow-safety,
  .workflow-page .workflow-footer {
    padding: .88rem;
    border-radius: .42rem;
  }

  .workflow-page .workflow-step {
    min-height: auto;
  }
}
