:root {
  color-scheme: light;
  --bg: #eaf1ee;
  --surface: rgba(251, 253, 251, 0.9);
  --surface-2: rgba(244, 249, 247, 0.82);
  --line: rgba(143, 170, 158, 0.32);
  --line-strong: rgba(75, 128, 106, 0.46);
  --text: #10231d;
  --muted: #5c7067;
  --soft: #899891;
  --green: #147a5a;
  --green-soft: rgba(204, 238, 224, 0.74);
  --blue: #236e9f;
  --blue-soft: rgba(210, 234, 246, 0.75);
  --mint: #61d6b4;
  --cyan: #61c5f1;
  --ink: #0d1b16;
  --amber: #a16318;
  --amber-soft: #f3e5cf;
  --red: #b74334;
  --red-soft: #f2dbd6;
  --shadow: 0 24px 70px rgba(12, 28, 22, 0.14);
  --glow: 0 0 0 1px rgba(97, 214, 180, 0.16), 0 22px 60px rgba(31, 122, 91, 0.13);
  --radius: 18px;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 7% 10%, rgba(97, 214, 180, 0.26), transparent 24%),
    radial-gradient(circle at 72% 4%, rgba(97, 197, 241, 0.22), transparent 27%),
    radial-gradient(circle at 95% 82%, rgba(31, 122, 91, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), transparent 36%),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 122, 90, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 122, 90, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  left: -12%;
  right: -12%;
  top: 96px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(97, 214, 180, 0.52), rgba(97, 197, 241, 0.44), transparent);
  box-shadow: 0 0 22px rgba(97, 214, 180, 0.45);
}

body.has-protocol-notice .app-shell {
  padding-top: 58px;
}

body.has-protocol-notice .user-panel,
body.has-protocol-notice .chat-stage,
body.has-protocol-notice .insight-panel {
  height: calc(100vh - 74px);
}

.identity-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 16%, rgba(97, 214, 180, 0.22), transparent 28%),
    radial-gradient(circle at 84% 20%, rgba(97, 197, 241, 0.18), transparent 24%),
    rgba(234, 244, 240, 0.9);
  backdrop-filter: blur(14px);
}

.identity-gate.hidden {
  display: none;
}

.identity-card {
  width: min(440px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid rgba(31, 122, 91, 0.16);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 249, 244, 0.92)),
    white;
  box-shadow: var(--shadow);
}

.identity-card h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.02;
  letter-spacing: 0;
}

.identity-card p {
  margin: -6px 0 4px;
  color: var(--muted);
  line-height: 1.65;
}

.identity-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.identity-card input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 16px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.identity-card input:focus {
  border-color: rgba(20, 122, 90, 0.46);
  box-shadow: 0 0 0 4px rgba(97, 214, 180, 0.14);
}

.identity-error {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.identity-submit {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f805d, #2d8bab);
  color: white;
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(31, 122, 91, 0.22);
}

.protocol-notice {
  position: fixed;
  z-index: 20;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid #e6c36c;
  border-radius: 999px;
  background: #fff7d8;
  color: #835300;
  box-shadow: 0 12px 30px rgba(131, 83, 0, 0.12);
  font-size: 13px;
  text-align: center;
}

.protocol-notice strong {
  margin-right: 8px;
}

.protocol-notice span {
  font-weight: 900;
}

.protocol-notice a {
  margin-left: 10px;
  color: var(--green);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.guide-page {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  padding: 28px;
  background:
    radial-gradient(circle at 16% 10%, rgba(31, 122, 91, 0.18), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(43, 111, 159, 0.12), transparent 30%),
    linear-gradient(135deg, #edf4ef, #f9fbf8);
}

.report-page {
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow-y: auto;
  padding: 28px;
  background: rgba(14, 24, 19, 0.36);
  backdrop-filter: blur(8px);
}

.report-page.hidden {
  display: none;
}

.trace-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 20, 17, 0.32);
  backdrop-filter: blur(8px);
}

.trace-modal.hidden {
  display: none;
}

.call-modal {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 22px;
  background: transparent;
  pointer-events: none;
}

.call-modal.hidden {
  display: none;
}

.call-window {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(380px, 92vw);
  pointer-events: auto;
  transform: translate(var(--call-x, 0), var(--call-y, 0));
  border: 1px solid rgba(31, 122, 91, 0.22);
  border-radius: 28px;
  padding: 34px 28px 24px;
  background:
    radial-gradient(circle at 50% 12%, rgba(45, 174, 130, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 251, 247, 0.96));
  box-shadow: 0 28px 80px rgba(14, 35, 29, 0.26);
}

.call-window.dragging {
  cursor: grabbing;
  user-select: none;
}

.call-avatar-wrap,
.call-copy {
  cursor: grab;
}

.call-window::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, 0.58) 46%, transparent 72%);
  opacity: 0.45;
  transform: translateX(-72%);
  animation: callPanelSheen 2.8s ease-in-out infinite;
}

.call-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.call-close:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.call-avatar-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin-bottom: 8px;
}

.call-avatar {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2cb786, #16715f);
  color: white;
  font-size: 38px;
  font-weight: 950;
  box-shadow: 0 14px 36px rgba(31, 122, 91, 0.28);
  animation: callAvatarPulse 1.55s ease-in-out infinite;
}

.call-ring {
  position: absolute;
  inset: 12px;
  border: 3px solid rgba(31, 122, 91, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(31, 122, 91, 0.18);
  animation: callRipple 1.65s ease-out infinite;
}

.call-ring.ring-two {
  animation-delay: 0.52s;
}

.call-ring.ring-three {
  animation-delay: 1.04s;
}

.call-copy {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.call-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  letter-spacing: 0;
}

.call-copy p {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.55;
}

.call-copy small {
  min-height: 18px;
  color: #6f827b;
  font-size: 12px;
  font-weight: 800;
}

.call-modal[data-phase="failed"] .call-copy p {
  color: var(--muted);
}

.call-modal[data-phase="live"] .call-copy p {
  color: var(--green);
}

.call-modal[data-phase="failed"] .call-copy small {
  color: #a55a4f;
}

.call-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 44px;
  margin: 18px 0 20px;
}

.call-wave span {
  display: block;
  width: 7px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2cb786, #1b8068);
  animation: callWave 0.9s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(31, 122, 91, 0.22);
}

.call-wave span:nth-child(2) {
  animation-delay: 0.1s;
}

.call-wave span:nth-child(3) {
  animation-delay: 0.2s;
}

.call-wave span:nth-child(4) {
  animation-delay: 0.3s;
}

.call-wave span:nth-child(5) {
  animation-delay: 0.4s;
}

.call-modal[data-phase="failed"] .call-wave span {
  background: linear-gradient(180deg, #7f9a8d, #57746a);
  animation-duration: 1.25s;
  opacity: 0.72;
}

.call-modal[data-phase="failed"] .call-avatar {
  animation-duration: 2.1s;
  background: linear-gradient(135deg, #6f9b88, #3f7468);
}

.call-modal[data-phase="live"] .call-start-button {
  background: linear-gradient(135deg, #d85a4b, #a8322d);
  box-shadow: 0 14px 30px rgba(183, 67, 52, 0.26);
}

.call-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: 10px;
  width: 100%;
}

.call-start-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 16px;
  background: linear-gradient(135deg, #24986f, #176e61);
  color: white;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(31, 122, 91, 0.28);
}

.call-start-button:disabled,
.call-modal-actions .guide-secondary:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

@keyframes callRipple {
  0% {
    opacity: 0.82;
    transform: scale(0.62);
  }
  58% {
    opacity: 0.36;
  }
  100% {
    opacity: 0;
    transform: scale(1.36);
  }
}

@keyframes callWave {
  0%,
  100% {
    height: 16px;
  }
  50% {
    height: 38px;
  }
}

@keyframes callAvatarPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 14px 36px rgba(31, 122, 91, 0.28), 0 0 0 0 rgba(31, 122, 91, 0.2);
  }
  50% {
    transform: scale(1.045);
    box-shadow: 0 18px 42px rgba(31, 122, 91, 0.34), 0 0 0 10px rgba(31, 122, 91, 0.08);
  }
}

@keyframes callPanelSheen {
  0%,
  45% {
    transform: translateX(-78%);
  }
  100% {
    transform: translateX(78%);
  }
}

.trace-window {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  width: min(980px, 94vw);
  height: min(760px, 88vh);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(154, 86, 245, 0.32);
  background: white;
  box-shadow: 0 30px 90px rgba(54, 26, 96, 0.28);
}

.trace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  background: linear-gradient(135deg, #a34cf4, #7f4df2);
  color: white;
}

.trace-head div {
  display: grid;
  gap: 2px;
}

.trace-head span {
  font-size: 12px;
  font-weight: 900;
  opacity: 0.82;
}

.trace-head strong {
  font-size: 18px;
}

.trace-head button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.trace-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfafc;
}

.trace-tabs button {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  background: white;
  color: #676b75;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(35, 26, 54, 0.08);
}

.trace-tabs button.active {
  background: linear-gradient(135deg, #a34cf4, #8e4df0);
  color: white;
}

.trace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.trace-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trace-toolbar button {
  border: 1px solid rgba(154, 86, 245, 0.42);
  border-radius: 12px;
  padding: 8px 13px;
  background: rgba(154, 86, 245, 0.08);
  color: #8d3df0;
  font-weight: 900;
  cursor: pointer;
}

.trace-code {
  overflow: auto;
  margin: 0;
  padding: 22px 26px;
  background: #fbfbfd;
  color: #1f2937;
}

.trace-code pre {
  margin: 0;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
}

.prompt-trace-grid {
  display: grid;
  gap: 16px;
}

.prompt-trace-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(20, 40, 33, 0.06);
  overflow: hidden;
}

.prompt-trace-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(154, 86, 245, 0.12), rgba(38, 131, 94, 0.08));
  border-bottom: 1px solid var(--line);
}

.prompt-trace-card-head div {
  display: grid;
  gap: 4px;
}

.prompt-trace-card-head span {
  color: #8d3df0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prompt-trace-card-head strong {
  color: var(--ink);
  font-size: 18px;
}

.prompt-trace-card-head em {
  flex: 0 0 auto;
  border: 1px solid rgba(38, 131, 94, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--green);
  background: rgba(38, 131, 94, 0.08);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.prompt-trace-card p {
  margin: 0;
  padding: 14px 18px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.prompt-trace-card pre {
  max-height: 360px;
  overflow: auto;
  margin: 14px 18px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faf8;
  white-space: pre-wrap;
  word-break: break-word;
}

.report-shell {
  display: grid;
  gap: 16px;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(14, 24, 19, 0.22);
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.report-head h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.report-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.report-content {
  display: grid;
  gap: 12px;
}

.report-hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  border: 1px solid rgba(31, 122, 91, 0.22);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(31, 122, 91, 0.1), rgba(245, 250, 247, 0.95)),
    white;
}

.report-hero-card h3 {
  margin: 4px 0 8px;
  color: var(--text);
  font-size: 24px;
}

.report-hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.report-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 320px;
}

.report-hero-meta span {
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.report-summary-card,
.report-memory-grid,
.report-capability-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.report-summary-card div,
.report-memory-grid div,
.report-capability-grid div,
.report-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.report-summary-card div,
.report-memory-grid div,
.report-capability-grid div {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.report-summary-card span,
.report-memory-grid span,
.report-capability-grid span {
  color: var(--muted);
  font-size: 12px;
}

.report-summary-card strong,
.report-memory-grid strong,
.report-capability-grid strong {
  font-size: 16px;
  line-height: 1.35;
}

.report-capability-grid .ready {
  border-color: rgba(31, 122, 91, 0.22);
  background: var(--green-soft);
}

.report-capability-grid .degraded {
  border-color: rgba(203, 135, 35, 0.28);
  background: #fff7e9;
}

.report-pipeline {
  display: grid;
  gap: 8px;
}

.report-pipeline div {
  display: grid;
  grid-template-columns: 42px 128px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-2);
}

.report-pipeline span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.report-pipeline strong {
  color: var(--text);
  font-size: 13px;
}

.report-pipeline em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.report-section {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.report-section h3 {
  margin: 0;
  font-size: 16px;
}

.report-section p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

.report-line {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.report-line strong {
  color: var(--green);
  font-size: 12px;
}

.report-line span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.report-tags span {
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.guide-page.hidden {
  display: none;
}

.guide-shell {
  display: grid;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.guide-hero {
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid #cfe4db;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(220, 238, 230, 0.86)),
    white;
  box-shadow: 0 24px 60px rgba(26, 39, 33, 0.12);
}

.guide-hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.08;
}

.guide-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-primary,
.guide-secondary,
.guide-open-button {
  border-radius: 999px;
  font-weight: 900;
}

.guide-primary,
.guide-secondary {
  min-height: 44px;
  padding: 0 18px;
}

.guide-primary {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
}

.guide-secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--green);
}

.guide-open-button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--green);
  padding: 6px 10px;
  font-size: 12px;
}

.guide-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.guide-flow article {
  display: grid;
  gap: 9px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(26, 39, 33, 0.07);
}

.guide-flow article span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.guide-flow article strong {
  font-size: 17px;
  line-height: 1.3;
}

.guide-flow article p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.guide-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.guide-map div {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid #cfe4db;
  border-radius: 16px;
  background: var(--green-soft);
}

.guide-map strong {
  color: var(--green);
  font-size: 15px;
}

.guide-map span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(500px, 1fr) minmax(430px, 520px);
  gap: 18px;
  height: 100vh;
  padding: 18px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

body.customer-view .app-shell {
  grid-template-columns: minmax(230px, 270px) minmax(700px, 1fr) minmax(330px, 390px);
  width: min(1920px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  margin: 12px auto;
  padding: 0;
  gap: 14px;
}

body.customer-view .internal-only {
  display: none !important;
}

body.customer-view .chat-stage {
  height: 100%;
}

body.customer-view .user-panel {
  display: grid;
  height: 100%;
}

body.customer-view .insight-panel {
  display: grid;
  height: 100%;
}

.user-panel,
.chat-stage,
.insight-panel {
  min-height: 0;
  height: calc(100vh - 36px);
  border: 1px solid rgba(255, 255, 255, 0.54);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(242, 249, 246, 0.78)),
    rgba(251, 252, 250, 0.78);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  border-radius: 24px;
}

.user-panel,
.insight-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-panel {
  padding: 22px;
  gap: 20px;
  background:
    radial-gradient(circle at 34% 0%, rgba(97, 214, 180, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(239, 249, 245, 0.8));
}

.brand-block h1,
.insight-header h2 {
  margin: 4px 0 8px;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.brand-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.eyebrow {
  display: inline-flex;
  color: #0e8d68;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.section-block {
  display: grid;
  gap: 10px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.text-button.danger-lite {
  border: 1px solid rgba(194, 104, 44, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(235, 166, 64, 0.12);
  color: #a45a14;
}

.scenario-list,
.prompt-list,
.profile-sheet {
  display: grid;
  gap: 8px;
}

.scenario-option,
.prompt-chip,
.profile-row {
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.scenario-option {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  text-align: left;
  border-radius: var(--radius);
}

.scenario-option.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.scenario-option strong {
  font-size: 14px;
}

.scenario-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: var(--radius);
}

.profile-row span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.profile-row span:last-child {
  font-size: 13px;
  line-height: 1.45;
}

.prompt-chip {
  border-radius: 999px;
  padding: 9px 11px;
  color: var(--text);
  text-align: left;
  font-size: 13px;
}

.user-profile-card {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.profile-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(97, 214, 180, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(242, 250, 247, 0.86));
  box-shadow: 0 16px 34px rgba(22, 72, 55, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.45), transparent 20%),
    linear-gradient(145deg, #0f7f5c, #72d6b8);
  color: white;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 18px 32px rgba(31, 122, 91, 0.2), 0 0 0 8px rgba(97, 214, 180, 0.12);
}

.profile-hero h2 {
  margin: 0;
  font-size: 22px;
}

.profile-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.profile-kv {
  display: grid;
  gap: 8px;
}

.profile-kv .profile-row {
  border-color: rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 251, 249, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.lina-schedule-card {
  border-color: #c7e0d5;
  background:
    linear-gradient(135deg, rgba(220, 238, 230, 0.75), rgba(255, 255, 255, 0.96)),
    white;
}

.schedule-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.schedule-mini-grid div,
.schedule-note {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.schedule-mini-grid span,
.schedule-note span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.schedule-mini-grid strong,
.schedule-note strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.compact-tags {
  gap: 5px;
}

.schedule-seeds {
  display: grid;
  gap: 7px;
}

.schedule-seeds p {
  margin: 0;
  padding: 8px 9px;
  border-left: 3px solid var(--green);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.chat-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% -10%, rgba(97, 214, 180, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 248, 245, 0.76));
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(97, 214, 180, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(227, 247, 240, 0.68)),
    rgba(255, 255, 255, 0.65);
  z-index: 2;
}

.contact-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.4), transparent 22%),
    linear-gradient(145deg, #0f7f5c, #39b98f);
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(31, 122, 91, 0.24), 0 0 0 5px rgba(97, 214, 180, 0.12);
}

.contact-meta strong,
.contact-meta span {
  display: block;
}

.contact-meta span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.stage-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.stage-pills span,
.live-badge,
.mini-badge {
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.stage-pills select {
  min-height: 32px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  outline: none;
}

#replyModelSelect {
  max-width: 260px;
}

.reply-style-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(31, 122, 91, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.reply-style-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.reply-style-option strong {
  color: inherit;
  font-size: 12px;
  font-weight: 900;
}

.reply-style-option span {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-size: 11px;
}

.reply-style-option:hover {
  color: var(--green);
  background: rgba(31, 122, 91, 0.08);
}

.reply-style-option.active {
  background: linear-gradient(135deg, #0f805d, #2d8bab);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 122, 91, 0.18);
}

.session-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.session-action {
  min-height: 32px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--green);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.chat-log {
  min-height: 0;
  overflow-y: auto;
  padding: 22px 22px 26px;
  background:
    radial-gradient(circle at 18% 12%, rgba(97, 214, 180, 0.12), transparent 28%),
    radial-gradient(circle at 88% 28%, rgba(97, 197, 241, 0.08), transparent 24%),
    linear-gradient(rgba(240, 248, 245, 0.78), rgba(234, 244, 240, 0.9)),
    repeating-linear-gradient(45deg, rgba(23, 33, 29, 0.022) 0 1px, transparent 1px 12px);
  scroll-behavior: smooth;
}

.date-divider {
  width: fit-content;
  margin: 0 auto 16px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--soft);
  font-size: 12px;
}

.demo-guide {
  display: grid;
  gap: 8px;
  max-width: 620px;
  margin: 0 auto 18px;
  padding: 14px;
  border: 1px solid #c8e2d7;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(220, 238, 230, 0.95), rgba(255, 255, 255, 0.9)),
    white;
  box-shadow: 0 12px 26px rgba(31, 122, 91, 0.08);
}

.demo-guide > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.demo-guide strong {
  line-height: 1.55;
  font-size: 14px;
}

.demo-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.demo-steps span {
  border-radius: 999px;
  padding: 6px 8px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: min(78%, 760px);
  margin-bottom: 16px;
  cursor: pointer;
}

.message.active-round .bubble {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.12);
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message.assistant {
  margin-right: auto;
}

.message-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #147a5a, #55c5a0);
  color: white;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(31, 122, 91, 0.18);
}

.message.user .message-avatar {
  background: linear-gradient(145deg, #236e9f, #61c5f1);
}

.message-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.message-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.message.user .message-head {
  justify-content: flex-end;
}

.message-head strong {
  color: var(--text);
  font-size: 13px;
}

.trace-open {
  border: 1px solid rgba(31, 122, 91, 0.22);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(31, 122, 91, 0.08);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.trace-open:hover {
  background: var(--green);
  color: white;
}

.bubble {
  border: 1px solid rgba(209, 222, 216, 0.9);
  border-radius: 18px;
  padding: 12px 14px;
  line-height: 1.62;
  font-size: 15px;
  white-space: pre-wrap;
  box-shadow: 0 10px 24px rgba(28, 48, 39, 0.05);
}

.message.user .bubble {
  border-color: rgba(31, 122, 91, 0.18);
  background:
    linear-gradient(135deg, rgba(20, 122, 90, 0.98), rgba(27, 133, 99, 0.98) 52%, rgba(37, 108, 146, 0.96)),
    var(--green);
  color: white;
  border-top-right-radius: 6px;
  box-shadow: 0 14px 30px rgba(31, 122, 91, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.message.user.voice-message .bubble {
  padding: 0;
  min-width: min(430px, 100%);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.message.assistant .bubble {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 250, 0.96));
  border-top-left-radius: 6px;
  border-color: rgba(255, 255, 255, 0.75);
}

.message.assistant.voice-message .bubble {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.message-meta {
  color: var(--soft);
  font-size: 11px;
}

.inline-strategy {
  display: grid;
  gap: 5px;
  max-width: 420px;
  padding: 9px 10px;
  border: 1px solid #cfe1fb;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #eaf3ff, #f7fbff);
}

.inline-strategy strong {
  color: #2f63c7;
  font-size: 12px;
  text-transform: uppercase;
}

.inline-strategy span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.message.user .inline-strategy {
  margin-left: auto;
}

.translation-card {
  display: grid;
  gap: 6px;
  max-width: 430px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.message.user .translation-card {
  margin-left: auto;
  border-left-color: var(--green);
}

.translation-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: start;
}

.translation-row span,
.translation-foot {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.translation-row strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
  white-space: pre-wrap;
}

.translation-row.accent strong {
  color: var(--blue);
}

.translation-foot {
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.voice-output-card {
  display: grid;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.voice-output-card div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
}

.voice-output-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.voice-output-card strong {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
}

.voice-output-card em {
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--green-soft);
  color: var(--green);
  font-style: normal;
  font-size: 11px;
}

.voice-output-card audio {
  width: 100%;
}

.assistant-reply-text {
  margin-bottom: 10px;
}

.assistant-voice-card {
  display: grid;
  gap: 8px;
  min-width: min(320px, 100%);
  padding: 0;
  border-radius: 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-voice-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assistant-voice-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assistant-voice-card strong {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(31, 122, 91, 0.09);
  color: var(--green);
  font-size: 13px;
}

.assistant-voice-card.planned,
.assistant-voice-card.failed {
  border-color: rgba(224, 164, 49, 0.35);
  background: rgba(255, 248, 231, 0.92);
}

.assistant-voice-card.planned strong,
.assistant-voice-card.failed strong {
  color: #a36a00;
}

.voice-bubble {
  display: grid;
  gap: 0;
  width: min(430px, 100%);
}

.assistant-voice-card > .voice-bubble {
  display: grid;
  align-items: initial;
  justify-content: initial;
  gap: 10px;
}

.voice-output-card .voice-bubble {
  display: grid;
  grid-template-columns: none;
  gap: 10px;
}

.voice-player {
  display: grid;
  grid-template-columns: 44px minmax(170px, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 64px;
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  color: currentColor;
  background:
    linear-gradient(135deg, rgba(20, 122, 90, 0.98), rgba(27, 133, 99, 0.98) 52%, rgba(37, 108, 146, 0.96)),
    var(--green);
  box-shadow: 0 12px 26px rgba(31, 122, 91, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.voice-output-card .voice-player {
  display: grid;
  grid-template-columns: 44px minmax(170px, 1fr) auto;
  gap: 14px;
}

.message.assistant .voice-player,
.voice-bubble.assistant .voice-player {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 250, 245, 0.96));
  border: 1px solid rgba(31, 122, 91, 0.12);
  box-shadow: 0 10px 24px rgba(28, 48, 39, 0.07);
}

.voice-play-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--green);
  cursor: pointer;
  box-shadow: 0 9px 20px rgba(6, 57, 42, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.message.assistant .voice-play-button,
.voice-bubble.assistant .voice-play-button {
  background: var(--green);
  color: white;
  box-shadow: 0 9px 20px rgba(31, 122, 91, 0.2);
}

.voice-play-button::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 13px solid currentColor;
}

.voice-bubble.is-playing .voice-play-button::before {
  width: 13px;
  height: 16px;
  margin-left: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.voice-play-button:disabled {
  cursor: default;
  opacity: 0.52;
  box-shadow: none;
}

.voice-wave {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 34px;
  overflow: hidden;
}

.voice-wave i {
  display: block;
  width: 5px;
  height: var(--bar);
  min-height: 6px;
  border-radius: 999px;
  background: rgba(236, 255, 247, 0.5);
}

.message.user .voice-wave i {
  background: rgba(238, 255, 249, 0.54);
}

.message.assistant .voice-wave i,
.voice-bubble.assistant .voice-wave i {
  background: rgba(31, 122, 91, 0.32);
}

.voice-bubble.is-playing .voice-wave i {
  background: rgba(255, 255, 255, 0.9);
  animation: voiceWavePulse 0.9s ease-in-out infinite alternate;
  animation-delay: calc(var(--bar) * -12ms);
}

.message.assistant .voice-bubble.is-playing .voice-wave i,
.voice-bubble.assistant.is-playing .voice-wave i {
  background: var(--green);
}

.voice-duration {
  color: currentColor;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: 0;
}

.assistant-voice-card .voice-duration {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.voice-output-card .voice-duration {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.voice-transcript {
  color: currentColor;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message.voice-message .voice-transcript,
.message.voice-message .voice-meta {
  display: none;
}

.message.assistant .voice-transcript,
.voice-bubble.assistant .voice-transcript {
  color: var(--text);
  font-size: 15px;
}

.voice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.voice-output-card .voice-transcript {
  display: block;
  grid-template-columns: none;
}

.voice-output-card .voice-meta {
  display: flex;
  grid-template-columns: none;
}

.voice-meta em {
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.message.assistant .voice-meta em,
.voice-bubble.assistant .voice-meta em {
  background: rgba(31, 122, 91, 0.09);
  color: var(--green);
  box-shadow: none;
}

.voice-bubble.is-disabled .voice-player {
  opacity: 0.78;
}

@keyframes voiceWavePulse {
  from {
    transform: scaleY(0.68);
  }
  to {
    transform: scaleY(1.08);
  }
}

.turn-analysis {
  display: grid;
  gap: 9px;
  min-width: min(560px, 100%);
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(43, 126, 94, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(244, 250, 247, 0.96), rgba(255, 255, 255, 0.92));
  white-space: normal;
}

.turn-analysis-head {
  display: grid;
  gap: 3px;
}

.turn-analysis-head strong {
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.turn-analysis-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.turn-analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.turn-analysis-grid div {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.82);
}

.turn-analysis-grid span,
.turn-analysis-sections p span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.turn-analysis-grid strong,
.turn-analysis-sections p strong {
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
}

.turn-analysis-details {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.turn-analysis-details summary {
  cursor: pointer;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.turn-analysis-sections {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}

.turn-analysis-sections section {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.turn-analysis-sections h4 {
  margin: 0;
  color: var(--green);
  font-size: 11px;
}

.turn-analysis-sections p {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  margin: 0;
}

.turn-analysis-sections pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 9px;
  border-radius: 10px;
  background: #0d1b16;
  color: #d9f7e8;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.system-note {
  max-width: 78%;
  margin: 8px auto 14px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.media-preview {
  display: grid;
  gap: 10px;
}

.media-preview audio {
  width: min(420px, 100%);
}

.media-preview img {
  width: min(260px, 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.media-preview video {
  width: min(320px, 100%);
  max-height: 240px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: #0f1714;
}

.media-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-caption em {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--green);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.reply-dock {
  border-top: 1px solid var(--line);
  padding: 11px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 250, 0.98)),
    rgba(251, 252, 250, 0.94);
  z-index: 2;
}

.reply-dock[hidden],
.quick-actions[hidden] {
  display: none !important;
}

.reply-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.reply-actions {
  display: flex;
  gap: 10px;
}

.reply-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reply-dock.collapsed .reply-options {
  grid-template-columns: 1fr;
}

.reply-dock.collapsed .reply-option:not(:first-child) {
  display: none;
}

.reply-dock.collapsed .reply-option {
  min-height: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.reply-dock.collapsed .reply-option strong {
  margin-bottom: 0;
}

.reply-option {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 9px;
  text-align: left;
  min-height: 74px;
}

.reply-option:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.reply-option strong {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 12px;
}

.reply-option span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.reply-option em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.processing-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-top: 1px solid var(--line);
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
}

.processing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 0.9s infinite ease-in-out;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.composer {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 10% 0%, rgba(31, 122, 91, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 249, 0.98)),
    white;
  box-shadow: 0 -18px 40px rgba(31, 57, 47, 0.09);
  z-index: 3;
}

.composer.is-busy {
  opacity: 0.92;
}

.media-toolbar {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 122, 91, 0.12);
  border-radius: 18px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.64);
}

.media-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 2px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.media-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #54c095, var(--green));
  box-shadow: 0 0 0 4px rgba(31, 122, 91, 0.08);
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 246, 0.95)),
    rgba(246, 249, 247, 0.92);
  padding: 6px 12px 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.tool-button::before {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  line-height: 1;
}

.image-tool::before {
  content: "图";
}

.video-tool::before {
  content: "视";
}

.voice-tool::before {
  content: "声";
}

.call-tool::before {
  content: "话";
}

.call-tool.is-live {
  border-color: var(--green);
  background: #e9fff3;
  color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 122, 91, 0.08), 0 10px 24px rgba(31, 122, 91, 0.12);
}

.call-tool.is-live::before {
  background: var(--green);
  color: white;
  animation: recordingPulse 1s ease-in-out infinite;
}

.call-tool.is-calling {
  border-color: rgba(43, 111, 159, 0.28);
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 0 0 4px rgba(43, 111, 159, 0.08), 0 10px 24px rgba(43, 111, 159, 0.12);
}

.call-tool.is-calling::before {
  background: var(--blue);
  color: white;
  animation: recordingPulse 1.2s ease-in-out infinite;
}

.tool-button:hover {
  border-color: var(--green);
  background: white;
  color: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(31, 122, 91, 0.1);
}

.tool-button.recording {
  border-color: #d84c3d;
  background: #fff0ee;
  color: #b74334;
  box-shadow: 0 0 0 4px rgba(183, 67, 52, 0.08), 0 10px 24px rgba(183, 67, 52, 0.12);
}

.tool-button.recording::before {
  background: var(--red-soft);
  color: var(--red);
  animation: recordingPulse 1s ease-in-out infinite;
}

@keyframes recordingPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.86);
  }
}

.tool-button:disabled,
.quick-actions button:disabled,
.send-button:disabled,
.reply-option:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.managed-pill {
  margin-left: auto;
  border: 1px solid #b9e8d0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e9fff3;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.voice-status {
  justify-self: end;
  min-height: 34px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(245, 247, 244, 0.92);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.call-status {
  min-height: 34px;
  border: 1px solid rgba(43, 111, 159, 0.18);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(241, 247, 252, 0.92);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.call-status[data-mode="live"] {
  border-color: rgba(31, 122, 91, 0.26);
  background: #e9fff3;
  color: var(--green);
}

.call-status[data-mode="calling"] {
  border-color: rgba(43, 111, 159, 0.24);
  background: var(--blue-soft);
  color: var(--blue);
}

.call-status[data-mode="error"] {
  border-color: rgba(183, 67, 52, 0.24);
  background: var(--red-soft);
  color: var(--red);
}

.voice-status[data-mode="recording"] {
  border-color: rgba(183, 67, 52, 0.32);
  background: var(--red-soft);
  color: var(--red);
}

.voice-status[data-mode="sending"],
.voice-status[data-mode="pending"] {
  border-color: rgba(43, 111, 159, 0.28);
  background: var(--blue-soft);
  color: var(--blue);
}

.voice-status[data-mode="ready"] {
  border-color: rgba(31, 122, 91, 0.28);
  background: var(--green-soft);
  color: var(--green);
}

.voice-status[data-mode="error"] {
  justify-self: end;
  max-width: min(420px, 100%);
  border-color: rgba(183, 67, 52, 0.34);
  background: rgba(255, 246, 244, 0.96);
  color: var(--red);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-actions > span {
  display: inline-flex;
  align-items: center;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.quick-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-actions button:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid rgba(31, 122, 91, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 252, 250, 0.96)),
    white;
  box-shadow: 0 12px 30px rgba(31, 57, 47, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.composer-row:focus-within {
  border-color: rgba(31, 122, 91, 0.44);
  box-shadow: 0 14px 34px rgba(31, 122, 91, 0.12), 0 0 0 4px rgba(31, 122, 91, 0.07);
}

.voice-test-bar {
  display: grid;
  grid-template-columns: auto minmax(104px, 0.45fr) minmax(86px, 0.35fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(43, 111, 159, 0.14);
  border-radius: 18px;
  background: rgba(244, 249, 252, 0.78);
}

.voice-test-bar > span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.voice-test-fixed {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid rgba(43, 111, 159, 0.16);
  border-radius: 999px;
  padding: 0 13px;
  background: white;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.voice-test-bar select {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(43, 111, 159, 0.18);
  border-radius: 999px;
  padding: 0 11px;
  background: white;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

#voiceTestButton::before {
  content: "试";
}

#voiceTestSendButton::before {
  content: "发";
}

.voice-test-result {
  grid-column: 1 / -1;
  max-height: 150px;
  overflow-y: auto;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.voice-test-result .voice-bubble {
  max-width: 100%;
  margin: 0;
  background: rgba(255, 255, 255, 0.72);
}

.voice-test-result .voice-player {
  grid-template-columns: 34px minmax(110px, 1fr) auto;
  min-height: 46px;
  gap: 9px;
  padding: 6px 11px 6px 6px;
}

.voice-test-result .voice-play-button {
  width: 34px;
  height: 34px;
}

.voice-test-result .voice-play-button::before {
  border-top-width: 7px;
  border-bottom-width: 7px;
  border-left-width: 10px;
}

.voice-test-result .voice-wave {
  height: 24px;
  gap: 3px;
}

.voice-test-result .voice-wave i {
  width: 3px;
}

.voice-test-result .voice-duration {
  font-size: 12px;
}

.voice-test-result .voice-transcript {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.voice-test-result .voice-meta {
  margin-top: 4px;
}

.voice-test-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.voice-test-note strong {
  margin-right: 6px;
  color: var(--text);
}

.voice-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.voice-test-actions .tool-button {
  min-height: 34px;
  padding: 0 14px;
}

.voice-test-actions .tool-button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  border-color: rgba(16, 114, 78, 0.2);
}

.composer-hint {
  margin-top: 7px;
  padding-left: 4px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.icon-button,
.send-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: 42px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
}

.send-button {
  border-color: var(--green);
  background:
    linear-gradient(135deg, #23845f, #19734f),
    var(--green);
  color: white;
  min-height: 54px;
  border-radius: 18px;
  box-shadow: 0 12px 22px rgba(31, 122, 91, 0.16);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.send-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(31, 122, 91, 0.22);
  filter: saturate(1.04);
}

.send-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(31, 122, 91, 0.18);
}

textarea {
  width: 100%;
  min-height: 58px;
  max-height: 118px;
  resize: none;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(246, 249, 247, 0.98);
  color: var(--text);
  outline: none;
  font-size: 15px;
  line-height: 1.5;
}

.composer textarea {
  min-height: 54px;
  max-height: 122px;
  border: 0;
  border-radius: 16px;
  padding: 14px 14px;
  background: transparent;
  box-shadow: none;
}

.composer textarea:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.composer textarea::placeholder {
  color: #7d8983;
}

textarea:focus {
  border-color: var(--green);
  background: white;
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.08);
}

.insight-panel {
  padding: 0;
  background:
    radial-gradient(circle at 80% -6%, rgba(97, 197, 241, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(239, 248, 245, 0.78));
}

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(97, 214, 180, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(228, 247, 240, 0.68));
}

.insight-header h2 {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.insight-actions {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  justify-content: end;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  max-width: none;
}

.session-badge {
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 999px;
  padding: 7px 11px;
  background: linear-gradient(135deg, rgba(204, 238, 224, 0.92), rgba(255, 255, 255, 0.72));
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid rgba(97, 214, 180, 0.16);
  background: rgba(255, 255, 255, 0.46);
}

.tabs button {
  border: 1px solid rgba(31, 122, 91, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  padding: 9px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tabs button.active {
  border-color: var(--green);
  background:
    linear-gradient(135deg, rgba(209, 240, 227, 0.95), rgba(255, 255, 255, 0.72));
  color: var(--green);
  box-shadow: 0 10px 22px rgba(31, 122, 91, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.panel-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

.panel-stack {
  display: grid;
  gap: 10px;
}

.tower-hero {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, white, var(--green-soft));
}

.strategy-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cfe4db;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(220, 238, 230, 0.95), rgba(255, 255, 255, 0.96)),
    white;
}

.director-hero,
.director-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(97, 214, 180, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(246, 253, 250, 0.92), rgba(255, 255, 255, 0.82));
  box-shadow: 0 16px 34px rgba(20, 52, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  position: relative;
  overflow: hidden;
}

.director-hero {
  border-color: rgba(97, 214, 180, 0.44);
  background:
    radial-gradient(circle at 88% 8%, rgba(97, 214, 180, 0.28), transparent 30%),
    radial-gradient(circle at 12% 4%, rgba(97, 197, 241, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(242, 251, 247, 0.96), rgba(255, 255, 255, 0.84) 72%);
  box-shadow: var(--glow);
}

.director-hero::after,
.director-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-120%);
  opacity: 0.42;
}

.director-hero.just-updated::after {
  animation: scanSheen 1.2s ease-out;
}

@keyframes scanSheen {
  to {
    transform: translateX(120%);
  }
}

.director-hero-head,
.director-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.director-hero-head strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.director-hero-head p,
.director-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.director-section-head span {
  color: #0e8d68;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.director-section-head strong {
  font-size: 16px;
}

.director-status-grid,
.director-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.director-status-grid div,
.director-note-grid div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(31, 122, 91, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 252, 250, 0.72));
}

.director-status-grid span,
.director-note-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.director-status-grid strong,
.director-note-grid strong {
  font-size: 13px;
  line-height: 1.45;
}

.realtime-prompt-box,
.realtime-log,
.realtime-transcript {
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(31, 122, 91, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.realtime-transcript {
  display: grid;
  gap: 8px;
  white-space: normal;
}

.realtime-transcript.compact {
  max-height: none;
  background: rgba(247, 252, 250, 0.78);
}

.realtime-latest-line {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(31, 122, 91, 0.1);
}

.realtime-latest-line[data-role="assistant"] {
  background: rgba(232, 255, 243, 0.82);
}

.realtime-latest-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.realtime-latest-line strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.realtime-line {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(245, 247, 244, 0.78);
}

.realtime-line[data-role="assistant"] {
  background: #e9fff3;
}

.realtime-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.realtime-line strong {
  font-size: 13px;
  line-height: 1.45;
}

.call-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.call-provider-select {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.call-provider-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.call-provider-select select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  padding: 0 12px;
}

.call-action-row .text-button {
  background: white;
}

.actor-card {
  border-color: rgba(31, 122, 91, 0.28);
}

.live-card {
  background:
    linear-gradient(135deg, rgba(220, 238, 230, 0.98), rgba(255, 255, 255, 0.95));
}

.muted-card {
  opacity: 0.86;
}

.actor-signal-list {
  display: grid;
  gap: 8px;
}

.actor-signal-list b {
  display: block;
  padding: 10px 12px;
  border-left: 4px solid var(--mint);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(204, 238, 224, 0.48), rgba(255, 255, 255, 0.9));
  font-size: 15px;
  line-height: 1.45;
}

.director-footer {
  margin-top: -2px;
}

.compact-decision {
  margin-top: 0;
}

.just-updated {
  position: relative;
  animation: updateGlow 1.6s ease-out;
}

@keyframes updateGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 122, 91, 0.28);
    border-color: var(--green);
  }

  100% {
    box-shadow: 0 0 0 12px rgba(31, 122, 91, 0);
  }
}

.live-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
  border: 1px solid #cfe4db;
  border-radius: var(--radius);
  background: white;
}

.live-summary div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.live-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-summary strong {
  line-height: 1.45;
  font-size: 14px;
}

.strategy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.strategy-head strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.25;
}

.strategy-body {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.strategy-line {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: baseline;
}

.strategy-line.line-updated {
  margin: -3px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(220, 238, 230, 0.8);
}

.strategy-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.strategy-line strong {
  font-size: 15px;
  line-height: 1.4;
}

.strategy-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.strategy-footer span {
  border-radius: 999px;
  padding: 5px 8px;
  background: white;
  color: var(--muted);
  font-size: 12px;
}

.emotion-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.emotion-row span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.emotion-row span.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.tower-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tower-topline strong {
  font-size: 18px;
}

.status-pill {
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.round-source {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 122, 91, 0.14);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #6fcbb0);
}

.control-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.control-card h3 {
  margin: 0;
  font-size: 14px;
}

.fold-card {
  display: block;
}

.fold-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.fold-card > summary::-webkit-details-marker {
  display: none;
}

.fold-card > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  font-size: 14px;
  line-height: 1;
}

.fold-card[open] > summary {
  margin-bottom: 10px;
}

.fold-card[open] > summary::after {
  content: "-";
}

.round-input {
  padding: 10px;
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.round-result {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.round-result span {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.chain-list {
  display: grid;
  gap: 8px;
}

.chain-step {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.chain-step strong {
  font-size: 13px;
}

.chain-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.warning-card {
  border-color: #e9c8c1;
  background: var(--red-soft);
}

.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.goal-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.goal-box span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.goal-box strong {
  line-height: 1.4;
  font-size: 13px;
}

.decision-box {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(220, 238, 230, 0.72), rgba(255, 255, 255, 0.92));
}

.decision-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.decision-box strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.asset-preview {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: var(--radius);
  background: #fff;
}

.asset-preview img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface-2);
}

.asset-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-preview strong {
  color: var(--text);
  font-size: 13px;
}

.execution-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.execution-step {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.execution-step::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--soft);
}

.execution-step.done::before {
  background: var(--green);
}

.execution-step.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.execution-step.active::before {
  background: var(--blue);
}

.execution-step.weak::before {
  background: var(--amber);
}

.execution-step span {
  color: var(--muted);
  font-size: 12px;
}

.execution-step strong {
  font-size: 12px;
  line-height: 1.35;
}

.matrix-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.matrix-compare div {
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.matrix-compare span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.matrix-compare strong {
  display: block;
  margin-top: 5px;
  line-height: 1.35;
  font-size: 13px;
}

.compare-arrow {
  color: var(--green);
  font-weight: 800;
}

.strategy-chip {
  justify-self: start;
  max-width: min(420px, 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 7px 9px;
  background: linear-gradient(180deg, var(--green-soft), white);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.archive-panel {
  display: grid;
  gap: 14px;
}

.profile-command-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 8%, rgba(97, 214, 180, 0.26), transparent 30%),
    linear-gradient(135deg, rgba(232, 249, 242, 0.96), rgba(255, 255, 255, 0.86)),
    white;
  box-shadow: 0 16px 34px rgba(20, 52, 40, 0.08);
}

.profile-command-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.profile-command-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.25;
}

.profile-command-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.profile-score-ring {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid #b9dacb;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, white 56%, transparent 57%),
    conic-gradient(var(--green) 0 var(--profile-score), rgba(31, 122, 91, 0.14) var(--profile-score) 100%);
}

.profile-score-ring strong {
  color: var(--green);
  font-size: 18px;
  line-height: 1;
}

.profile-score-ring span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-signal-grid div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.profile-signal-grid span {
  color: var(--muted);
  font-size: 12px;
}

.profile-signal-grid strong {
  font-size: 14px;
  line-height: 1.35;
}

.persona-basis-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #cfe4db;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 246, 241, 0.96)),
    white;
}

.persona-basis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.persona-basis-grid div {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.persona-basis-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.persona-basis-grid strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.persona-basis-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.collection-focus-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.focus-block {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.focus-block.primary {
  border-color: #b9dacb;
  background: var(--green-soft);
}

.focus-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.focus-block strong {
  font-size: 14px;
  line-height: 1.4;
}

.focus-block p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.profile-gap-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.internal-purpose-card {
  padding: 12px;
}

.archive-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.archive-status-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.archive-status-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.archive-status-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-monitor-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid #cfe4db;
  border-radius: var(--radius);
  background: white;
}

.collection-monitor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.collection-monitor-grid > div,
.collection-monitor-subgrid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.collection-monitor-grid span,
.collection-monitor-subgrid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.collection-monitor-grid strong {
  font-size: 13px;
  line-height: 1.4;
}

.collection-monitor-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.collection-monitor-subgrid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.monitor-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.monitor-chip-list b {
  border-radius: 999px;
  padding: 6px 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
}

.monitor-update-list {
  display: grid;
  gap: 7px;
}

.monitor-update-row {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.monitor-update-row strong {
  font-size: 12px;
  line-height: 1.35;
}

.monitor-update-row span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.monitor-update-row em,
.monitor-update-row small,
.monitor-empty {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.monitor-empty {
  margin: 0;
}

.gap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.gap-list span {
  border-radius: 999px;
  padding: 6px 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
}

.archive-groups {
  display: grid;
  gap: 10px;
}

.archive-group {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  background: white;
}

.archive-group > summary {
  display: grid;
  grid-template-columns: 12px 1fr auto 20px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  list-style: none;
  cursor: pointer;
}

.archive-group > summary::-webkit-details-marker {
  display: none;
}

.archive-group > summary::after {
  content: "+";
  color: var(--green);
  font-size: 16px;
  font-weight: 900;
}

.archive-group[open] > summary::after {
  content: "-";
}

.archive-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
}

.archive-group summary strong {
  font-size: 15px;
}

.archive-group summary em {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.archive-group summary em.done {
  background: var(--green-soft);
  color: var(--green);
}

.archive-field-list {
  display: grid;
  gap: 0;
  padding: 0 12px 12px 24px;
}

.archive-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.archive-field span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.archive-field strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.archive-status {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  min-width: 82px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.archive-status.filled {
  background: var(--green-soft);
  color: var(--green);
  border-color: #b9dacb;
}

.archive-source {
  margin-top: 7px;
  padding: 7px 8px;
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.memory-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.memory-search {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
}

.memory-search input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  outline: none;
}

.memory-search button,
.memory-alert button,
.memory-meta-row button {
  border: 1px solid var(--green);
  border-radius: var(--radius);
  background: var(--green);
  color: white;
  font-weight: 800;
}

.memory-alert {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #f0c766;
  border-radius: var(--radius);
  background: #fff7db;
  color: #8f5200;
}

.memory-alert::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffe58a;
  font-weight: 900;
}

.memory-alert strong,
.memory-alert span {
  display: block;
}

.memory-alert span {
  margin-top: 4px;
  font-size: 12px;
}

.memory-card-list {
  display: grid;
  gap: 10px;
}

.memory-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.memory-overview div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.memory-overview span {
  color: var(--muted);
  font-size: 12px;
}

.memory-overview strong {
  font-size: 18px;
}

.memory-layer {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.memory-layer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  font-weight: 900;
}

.memory-layer > summary::-webkit-details-marker {
  display: none;
}

.memory-layer > summary em {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-style: normal;
}

.memory-layer > p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.memory-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.memory-card.conflict {
  border-color: #c9daf2;
  box-shadow: inset 3px 0 0 var(--blue);
}

.memory-card p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.memory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memory-tags span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.memory-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.memory-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}

.memory-actions button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--green);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.memory-actions button.danger {
  border-color: #ffc6c6;
  color: var(--red);
}

.memory-state {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}

.memory-state.confirm {
  background: var(--green-soft);
  color: var(--green);
}

.memory-state.merge {
  background: var(--amber-soft);
  color: var(--amber);
}

.memory-strength {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}

.memory-strength i {
  width: 6px;
  height: 16px;
  border-radius: 999px;
  background: #dbe3df;
}

.memory-strength i.on {
  background: #3f7ff2;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric,
.insight-card,
.field-row,
.evidence-row,
.timeline-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.metric {
  padding: 11px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.35;
}

.insight-card {
  padding: 12px;
}

.insight-card h3 {
  margin: 0 0 9px;
  font-size: 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  padding: 6px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.tag.green {
  background: var(--green-soft);
  color: var(--green);
}

.tag.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.red {
  background: var(--red-soft);
  color: var(--red);
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group > summary {
  margin: 0;
  font-size: 14px;
}

.field-row,
.evidence-row {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.field-row.updated {
  border-color: var(--green);
  background: linear-gradient(90deg, var(--green-soft), white);
}

.field-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.field-meta,
.evidence-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.confidence {
  color: var(--green);
  font-weight: 800;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.matrix-cell {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-2);
}

.matrix-cell.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.matrix-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.matrix-cell strong {
  display: block;
  margin-top: 6px;
  line-height: 1.35;
  font-size: 14px;
}

.timeline {
  display: grid;
  gap: 7px;
}

.timeline-step {
  width: 100%;
  padding: 9px;
  text-align: left;
  color: var(--muted);
  font-size: 13px;
}

.timeline-step.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .guide-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 260px minmax(390px, 1fr);
  }

  .insight-panel {
    grid-column: 1 / -1;
    min-height: 560px;
  }
}

@media (max-width: 780px) {
  body {
    overflow: auto;
  }

  .guide-page {
    padding: 14px;
  }

  .report-page {
    padding: 14px;
  }

  .report-head {
    flex-direction: column;
  }

  .report-hero-card {
    grid-template-columns: 1fr;
  }

  .report-hero-meta {
    justify-content: flex-start;
    max-width: none;
  }

  .report-summary-card,
  .report-memory-grid,
  .report-capability-grid,
  .report-line {
    grid-template-columns: 1fr;
  }

  .collection-monitor-grid,
  .collection-monitor-subgrid {
    grid-template-columns: 1fr;
  }

  .report-pipeline div {
    grid-template-columns: 34px 1fr;
  }

  .report-pipeline em {
    grid-column: 2;
  }

  .guide-hero {
    padding: 20px;
  }

  .guide-flow,
  .guide-map {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    padding: 10px;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .chat-stage {
    order: 1;
  }

  .user-panel {
    order: 3;
  }

  .insight-panel {
    order: 2;
  }

  .user-panel,
  .chat-stage,
  .insight-panel {
    height: auto;
    min-height: auto;
  }

  .chat-stage {
    min-height: 0;
    grid-template-rows: auto minmax(220px, 1fr) auto auto auto;
  }

  .chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .message {
    max-width: 88%;
  }

  .chat-log {
    min-height: 0;
    max-height: none;
    padding: 16px 12px 20px;
  }

  .user-panel {
    gap: 10px;
  }

  .brand-block {
    padding: 16px;
  }

  .brand-block p {
    margin-top: 6px;
  }

  .profile-hero {
    padding: 16px;
  }

  .profile-hero p,
  .memory-section {
    display: none;
  }

  .profile-tags {
    gap: 6px;
  }

  .insight-panel {
    max-height: calc(100vh - 20px);
    min-height: 640px;
  }

  .panel-content {
    max-height: calc(100vh - 188px);
    overflow: auto;
  }

  .bubble {
    font-size: 14px;
  }

  .composer {
    padding: 12px;
    max-height: min(42vh, 320px);
    overflow-y: auto;
  }

  .media-toolbar {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .media-label {
    grid-column: 1 / -1;
    width: auto;
  }

  .tool-button {
    justify-content: center;
  }

  .voice-status {
    grid-column: 1 / -1;
    justify-self: stretch;
    max-width: none;
    text-align: center;
  }

  .voice-status[data-mode="error"] {
    justify-self: stretch;
    text-align: center;
  }

  .call-status {
    grid-column: 1 / -1;
    text-align: center;
  }

  .voice-test-bar {
    grid-template-columns: 1fr 1fr;
  }

  .voice-test-bar > span,
  .voice-test-result {
    grid-column: 1 / -1;
  }

  .voice-test-result {
    max-height: 96px;
  }

  .reply-options,
  .metric-grid,
  .matrix-grid,
  .execution-timeline,
  .goal-grid {
    grid-template-columns: 1fr;
  }

  .matrix-compare {
    grid-template-columns: 1fr;
  }

  .compare-arrow {
    text-align: center;
  }

  .composer-row {
    grid-template-columns: 1fr;
    padding: 8px;
    border-radius: 18px;
  }

  .send-button {
    grid-column: 1 / -1;
    min-height: 46px;
    border-radius: 14px;
  }
}

.debug-body {
  overflow: auto;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31, 122, 91, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(43, 111, 159, 0.14), transparent 24%),
    #0f1512;
  color: #e8f0eb;
}

.debug-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.debug-sidebar {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 16, 13, 0.82);
  backdrop-filter: blur(12px);
  align-content: start;
}

.debug-brand h1,
.debug-header h2 {
  margin: 6px 0 10px;
  font-size: 30px;
}

.debug-brand p {
  margin: 0;
  color: #9aa7a0;
  line-height: 1.65;
}

.debug-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.debug-toolbar input,
.debug-toolbar button,
.debug-actions button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #eef4f0;
}

.debug-toolbar input {
  min-width: 0;
  padding: 12px 14px;
}

.debug-toolbar button,
.debug-actions button {
  padding: 12px 14px;
}

.debug-session-list {
  display: grid;
  gap: 10px;
}

.debug-session-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #edf3ef;
}

.debug-session-item strong {
  font-size: 15px;
}

.debug-session-item span,
.debug-session-item em,
.debug-empty-list {
  color: #92a19a;
  font-style: normal;
  font-size: 13px;
}

.debug-session-item.active {
  border-color: rgba(124, 220, 182, 0.44);
  background: rgba(31, 122, 91, 0.22);
}

.debug-main {
  display: grid;
  gap: 18px;
  padding: 28px;
  align-content: start;
}

.debug-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.debug-content {
  display: grid;
  gap: 18px;
}

.debug-content.hidden,
.debug-empty.hidden {
  display: none;
}

.debug-empty,
.debug-block,
.debug-metrics article,
.debug-json-card,
.debug-round-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
}

.debug-empty,
.debug-block {
  padding: 18px;
}

.debug-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.debug-metrics article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.debug-metrics span,
.debug-block-head span {
  color: #8ca099;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.debug-metrics strong {
  font-size: 18px;
  line-height: 1.35;
}

.debug-block {
  display: grid;
  gap: 14px;
}

.debug-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.debug-code {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(7, 11, 9, 0.72);
  color: #dff0e7;
  overflow: auto;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.debug-round-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.debug-round-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.debug-round-grid span {
  color: #8ca099;
  font-size: 12px;
}

.debug-round-list {
  display: grid;
  gap: 12px;
}

.debug-round-card {
  overflow: hidden;
}

.debug-round-card summary {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.debug-round-card summary::-webkit-details-marker {
  display: none;
}

.debug-round-card summary span,
.debug-round-card summary em {
  color: #9bb1a9;
  font-style: normal;
}

.debug-round-sections {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.debug-json-card {
  padding: 14px;
}

@media (max-width: 1100px) {
  .debug-shell {
    grid-template-columns: 1fr;
  }

  .debug-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .debug-metrics,
  .debug-round-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .debug-main,
  .debug-sidebar {
    padding: 18px;
  }

  .debug-metrics,
  .debug-round-grid {
    grid-template-columns: 1fr;
  }

  .debug-round-card summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  body.customer-view .app-shell {
    width: 100%;
    height: auto;
    min-height: 100vh;
    margin: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  body.customer-view .user-panel,
  body.customer-view .insight-panel,
  body.customer-view .internal-only,
  body.customer-view .guide-page,
  body.customer-view .report-page,
  body.customer-view .trace-modal {
    display: none !important;
  }

  body.customer-view .chat-stage {
    order: 1;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    grid-template-rows: auto minmax(220px, 1fr) auto auto auto;
    border: 0;
    border-radius: 0;
  }
}
