:root {
  --ink: #17211f;
  --muted: #69736f;
  --line: #e3e7e4;
  --paper: #ffffff;
  --paper-soft: #f8faf8;
  --soft: #f4f6f3;
  --teal: #0d8276;
  --teal-ink: #07564e;
  --teal-soft: #e8f5f2;
  --gold: #9a743f;
  --danger: #9f3f35;
  --shadow: 0 18px 44px rgba(25, 35, 31, 0.07);
  --shadow-soft: 0 8px 22px rgba(25, 35, 31, 0.05);
  color-scheme: light;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f6f7f5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 0 14px;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:hover {
  border-color: rgba(23, 108, 98, 0.45);
  box-shadow: 0 8px 20px rgba(24, 32, 30, 0.05);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.app {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
  touch-action: manipulation;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(23, 32, 31, 0.1);
  background: rgba(255, 255, 255, 0.72);
  padding: 26px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(23, 33, 31, 0.12);
  border-radius: 8px;
  background: #17211f;
  color: #f5dca8;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(20, 32, 30, 0.1);
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0;
  line-height: 1.18;
}

.brand p {
  margin: 5px 0 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  border-color: transparent;
  background: transparent;
  text-align: left;
  color: rgba(24, 33, 31, 0.78);
  padding: 0 12px;
}

.nav button.active {
  border-color: rgba(13, 130, 118, 0.18);
  background: var(--teal-soft);
  color: var(--teal);
  box-shadow: none;
}

.tab-icon {
  position: relative;
  display: inline-block;
  width: 21px;
  min-width: 21px;
  height: 21px;
  color: currentColor;
}

.tab-icon-dashboard {
  border: 2px solid currentColor;
  border-radius: 6px;
}

.tab-icon-dashboard::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  box-shadow:
    7px 0 0 currentColor,
    0 7px 0 currentColor,
    7px 7px 0 currentColor;
}

.tab-icon-train {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.tab-icon-train::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.tab-icon-contacts::before,
.tab-icon-contacts::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.tab-icon-contacts::before {
  left: 2px;
  top: 2px;
  width: 6px;
  height: 6px;
  box-shadow: 10px 0 0 -1px currentColor;
}

.tab-icon-contacts::after {
  left: 1px;
  bottom: 2px;
  width: 15px;
  height: 8px;
  border-radius: 9px 9px 4px 4px;
  border-top-color: transparent;
}

.tab-icon-conversation {
  border: 2px solid currentColor;
  border-radius: 7px;
}

.tab-icon-conversation::before {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -5px;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: #ffffff;
  transform: rotate(-20deg);
}

.tab-icon-opportunities {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.tab-icon-opportunities::before,
.tab-icon-opportunities::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: currentColor;
}

.tab-icon-opportunities::before {
  left: 7px;
  top: 3px;
  width: 3px;
  height: 11px;
}

.tab-icon-opportunities::after {
  left: 3px;
  top: 7px;
  width: 11px;
  height: 3px;
}

.tab-icon-memory {
  border: 2px solid currentColor;
  border-radius: 5px;
}

.tab-icon-memory::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.composer-nav {
  justify-content: center;
  padding: 0;
}

.composer-tag-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  min-width: 22px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 6px;
}

.composer-tag-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.composer-tag-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 7px 0 currentColor;
}

.main {
  min-width: 0;
  padding: 28px;
}

.view {
  min-width: 0;
  max-width: 1240px;
  margin: 0 auto;
}

.system-notice-host {
  width: min(1240px, 100%);
  margin: 0 auto 12px;
}

.system-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(154, 116, 63, 0.26);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(25, 35, 31, 0.06);
  padding: 12px 14px;
}

.system-notice.danger {
  border-color: rgba(159, 63, 53, 0.28);
  background: #fff5f3;
}

.system-notice-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(154, 116, 63, 0.14);
  color: #755a31;
  font-weight: 900;
}

.system-notice.danger .system-notice-icon {
  background: rgba(159, 63, 53, 0.12);
  color: var(--danger);
}

.system-notice strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.system-notice p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.system-notice button {
  min-height: 34px;
  white-space: nowrap;
}

.system-notice button:not(.system-notice-close) {
  border-color: rgba(154, 116, 63, 0.22);
  background: #ffffff;
  color: #755a31;
}

.system-notice-close {
  width: 34px;
  padding: 0;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.82fr);
  gap: 18px;
}

body[data-auth="guest"] {
  background: #f8faf8;
}

body[data-auth="guest"] .app {
  display: block;
  min-height: 100vh;
}

body[data-auth="guest"] .sidebar {
  display: none;
}

body[data-auth="guest"] .main {
  min-height: 100vh;
  padding: 0;
}

body[data-auth="guest"] .view {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
}

body[data-view="embed-name-card"] {
  background: transparent;
}

body[data-view="embed-name-card"] .app {
  display: block;
  min-height: 100vh;
}

body[data-view="embed-name-card"] .sidebar {
  display: none;
}

body[data-view="embed-name-card"] .main {
  min-height: 100vh;
  padding: 0;
}

body[data-view="embed-name-card"] .view {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
}

.login-screen {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.visitor-header {
  display: flex;
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid rgba(23, 32, 31, 0.08);
  background: rgba(255, 255, 255, 0.82);
  padding: 16px 28px;
}

.visitor-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.visitor-brand strong {
  display: block;
  font-size: 19px;
  line-height: 1.18;
}

.visitor-brand p {
  margin: 5px 0 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  align-items: start;
  gap: 24px;
  width: min(1160px, calc(100% - 56px));
  margin: 0 auto;
  padding: 38px 0;
}

.visitor-portal {
  display: grid;
  gap: 18px;
}

.visitor-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.portal-hero {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(13, 130, 118, 0.16);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 26px;
}

.portal-hero span,
.section-head span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: 0;
}

.portal-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.72;
}

.portal-actions,
.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.portal-actions a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  padding: 0 16px;
}

.portal-actions a.secondary {
  border-color: rgba(13, 130, 118, 0.18);
  background: var(--teal-soft);
  color: var(--teal);
}

.login-points strong {
  border: 1px solid rgba(13, 130, 118, 0.14);
  border-radius: 8px;
  background: #ffffff;
  color: var(--teal);
  padding: 8px 10px;
  font-size: 13px;
}

.audience-split,
.portal-flow {
  display: grid;
  gap: 10px;
}

.audience-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audience-split article,
.portal-flow article {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(23, 32, 31, 0.08);
  border-radius: 10px;
  background: #ffffff;
  padding: 14px;
}

.audience-split article {
  border-color: rgba(13, 130, 118, 0.13);
}

.audience-split span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.audience-split h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.portal-flow strong {
  color: var(--teal);
  font-size: 14px;
}

.audience-split p,
.portal-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.portal-card-section {
  display: grid;
  gap: 12px;
}

.trust-panel {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(13, 130, 118, 0.14);
  border-radius: 10px;
  background: #f6fbf9;
  padding: 14px;
}

.trust-panel strong {
  color: var(--teal-ink);
  font-size: 14px;
}

.trust-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.section-head {
  display: grid;
  gap: 4px;
}

.section-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.public-name-card {
  display: grid;
  gap: 18px;
  width: 100%;
  margin-top: 0;
  border: 1px solid rgba(13, 130, 118, 0.18);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(25, 35, 31, 0.08);
  padding: 22px;
}

.public-name-card.is-embedded {
  width: min(100%, 460px);
  margin: 0;
  box-shadow: 0 14px 36px rgba(25, 35, 31, 0.1);
}

.public-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.public-card-avatar {
  display: grid;
  place-items: center;
  width: 68px;
  min-width: 68px;
  height: 68px;
  border-radius: 14px;
  background: #17211f;
  color: #f5dca8;
  font-size: 24px;
  font-weight: 900;
}

.public-card-top p,
.public-card-body p {
  margin: 0;
}

.public-card-top p {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.public-card-top h3 {
  margin: 3px 0 2px;
  font-size: 30px;
  line-height: 1.12;
}

.public-card-top strong {
  color: var(--muted);
  font-size: 13px;
}

.public-card-body {
  display: grid;
  gap: 10px;
  padding-top: 3px;
}

.public-card-body h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.22;
}

.public-card-body p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

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

.public-card-tags span {
  border: 1px solid rgba(13, 130, 118, 0.14);
  border-radius: 999px;
  background: #f6fbf9;
  color: var(--teal);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
}

.public-card-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.public-card-sections section {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(23, 32, 31, 0.08);
  border-radius: 10px;
  background: #fbfdfc;
  padding: 12px;
}

.public-card-sections h5 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

.public-card-sections p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  padding-left: 12px;
}

.public-card-sections p::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--teal);
}

.public-card-promise {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(13, 130, 118, 0.14);
  border-radius: 10px;
  background: #f6fbf9;
  padding: 12px;
}

.public-card-promise p {
  margin: 0;
  color: var(--teal-ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.55;
}

.public-card-promise div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.public-card-promise span {
  border-radius: 999px;
  background: #ffffff;
  color: var(--teal);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 850;
}

.public-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.public-card-actions.is-single {
  grid-template-columns: 1fr;
}

.public-card-actions a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.public-card-actions a.secondary {
  border-color: rgba(13, 130, 118, 0.18);
  background: var(--teal-soft);
  color: var(--teal);
}

.embed-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 16px;
}

.intent-card,
.login-card {
  display: grid;
  gap: 13px;
  border: 1px solid rgba(13, 130, 118, 0.16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.intent-card h3,
.login-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.intent-card {
  border-color: rgba(13, 130, 118, 0.22);
}

.intent-card h3 {
  font-size: 22px;
}

.login-card p,
.intent-card p,
.login-card small {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.login-card input {
  font-size: 16px;
}

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

.intent-permission-list span {
  border: 1px solid rgba(13, 130, 118, 0.14);
  border-radius: 999px;
  background: #f6fbf9;
  color: var(--teal);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
}

.login-error {
  border-radius: 8px;
  background: #fff0ee;
  color: var(--danger);
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.45;
}

.login-primary,
.login-wechat {
  width: 100%;
  min-height: 46px;
}

.login-primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.login-wechat {
  border-color: rgba(13, 130, 118, 0.18);
  background: var(--teal-soft);
  color: var(--teal);
}

.wide {
  grid-column: 1 / -1;
}

.hero-panel,
.panel,
.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: center;
  grid-column: 1 / -1;
  padding: 28px;
  overflow: hidden;
  position: relative;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 2px solid rgba(13, 130, 118, 0.68);
  pointer-events: none;
}

.hero-panel h2,
.panel h3,
.contact-card h3 {
  margin: 0;
}

.hero-panel h2 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.18;
}

.hero-panel p,
.panel p,
.contact-card p,
.memory p,
.opportunity p,
.task-list p {
  color: var(--muted);
  line-height: 1.62;
}

.hero-panel p {
  max-width: 620px;
  margin-bottom: 0;
}

.meter-block {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 16px;
}

.meter-block strong {
  font-size: 38px;
  line-height: 1;
}

.meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebe7;
}

.meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #80a76c);
}

.dashboard-hero {
  grid-template-columns: minmax(0, 1fr) 240px;
  padding: 26px 28px;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.dashboard-hero-actions button:first-child,
.dashboard-ai .panel-head button {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
}

.dashboard-next,
.dashboard-ai,
.dashboard-preview {
  box-shadow: var(--shadow-soft);
}

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

.judgment-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(23, 32, 31, 0.08);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 13px;
}

.judgment-item > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.judgment-item strong,
.recent-task strong,
.compact-row strong {
  display: block;
  color: var(--ink);
  line-height: 1.28;
}

.judgment-item p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-ai {
  align-content: start;
}

.desktop-composer-entry {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 98px;
  justify-items: start;
  border-color: rgba(13, 130, 118, 0.22);
  background: #f2faf8;
  color: var(--ink);
  text-align: left;
  padding: 16px;
}

.desktop-composer-entry span,
.recent-task span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.desktop-composer-entry strong {
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.55;
}

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.quick-prompts button {
  min-height: 38px;
  border-color: rgba(13, 130, 118, 0.14);
  background: #ffffff;
  color: var(--teal);
  padding: 0 8px;
  font-size: 12px;
}

.recent-task {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border: 1px solid rgba(23, 32, 31, 0.08);
  border-radius: 8px;
  background: #ffffff;
  padding: 13px;
}

.recent-task p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-preview {
  min-height: 260px;
}

.compact-list {
  display: grid;
  gap: 9px;
}

.compact-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  border-color: rgba(23, 32, 31, 0.08);
  background: var(--paper-soft);
  text-align: left;
  padding: 10px;
}

.compact-row.is-plain {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-row span:not(.avatar) {
  min-width: 0;
}

.compact-row small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-row b {
  color: var(--teal);
  font-size: 13px;
  white-space: nowrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  grid-column: 1 / -1;
}

.stat {
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.stat span,
.panel-head span,
.memory span,
.opportunity small {
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 30px;
  line-height: 1;
}

.stat p {
  margin: 6px 0 0;
  font-size: 12px;
}

.panel {
  padding: 20px;
}

.main-panel {
  min-height: 520px;
}

.panel-head,
.card-title,
.opportunity div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.train-form,
.opp-form,
.composer {
  display: grid;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 117, 106, 0.58);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 117, 106, 0.11);
}

textarea {
  resize: vertical;
}

.train-form button,
.opp-form button,
.composer button,
.contact-card button {
  min-height: 46px;
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(13, 130, 118, 0.14);
}

.voice-panel {
  display: grid;
  gap: 7px;
  position: relative;
  max-height: inherit;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  padding: 0;
}

.voice-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.voice-close {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  border-color: rgba(13, 130, 118, 0.18);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.voice-layout {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.voice-record {
  display: inline-grid;
  grid-template-columns: auto auto;
  place-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border-color: rgba(13, 130, 118, 0.16);
  border-radius: 8px;
  background: #0f756a;
  color: #ffffff;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: none;
}

.voice-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.voice-panel[data-composer-mode="input"] .voice-status {
  display: none;
}

.voice-sheet {
  pointer-events: auto;
}

.voice-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 180px));
  overflow: visible;
}

.voice-record::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-bottom: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fffdf8 0 5px, transparent 6px),
    linear-gradient(#fffdf8, #fffdf8);
  background-size: 100% 100%, 5px 9px;
  background-position: center top, center 10px;
  background-repeat: no-repeat;
}

.voice-record.listening,
.composer-voice-action.is-capturing {
  background: #9f3f35;
  color: #ffffff;
  animation: listeningPulse 1.25s ease-in-out infinite;
}

.voice-editor {
  display: grid;
  gap: 0;
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.command-box {
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(13, 130, 118, 0.34);
  border-radius: 16px;
  background: #fbfdfc;
  box-shadow: 0 14px 34px rgba(13, 71, 64, 0.12);
}

.voice-panel[data-text-expanded="true"] .command-box::before {
  content: "";
  position: absolute;
  top: 0;
  right: 14px;
  left: 14px;
  z-index: 2;
  height: 1.5px;
  border-radius: 999px;
  background: rgba(13, 130, 118, 0.38);
  pointer-events: none;
}

.voice-editor textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 82px;
  max-height: 142px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 15px 16px 8px;
  resize: none;
  line-height: 1.45;
}

.voice-panel[data-text-expanded="true"] .voice-editor textarea {
  min-height: min(42vh, 320px);
  max-height: min(42vh, 320px);
  padding-top: 42px;
}

.voice-editor textarea:focus {
  box-shadow: none;
}

.composer-collapse-text {
  position: absolute;
  top: 8px;
  right: 9px;
  z-index: 1;
  min-height: 28px;
  border-color: rgba(13, 130, 118, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--teal);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(13, 71, 64, 0.1);
}

.voice-interim,
.voice-error,
.voice-meta-line {
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.5;
}

.voice-interim {
  background: var(--teal-soft);
  color: var(--teal-ink);
}

.voice-error {
  background: #fff0ee;
  color: var(--danger);
}

.voice-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  background: rgba(247, 250, 249, 0.86);
  color: var(--muted);
  overflow: hidden;
}

.voice-timer {
  flex: 0 0 auto;
  color: var(--teal);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.voice-timer.is-warning {
  color: #9f3f35;
}

.voice-notice {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-log {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  border-top: 1px solid rgba(13, 130, 118, 0.1);
  background: rgba(240, 248, 245, 0.72);
  padding: 6px 8px;
}

.composer-confirmation {
  border: 1px solid rgba(13, 130, 118, 0.18);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(13, 71, 64, 0.12);
}

.composer-log-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 102px;
  align-items: center;
  gap: 8px;
}

.composer-log-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.composer-log-text span,
.composer-log-text small {
  color: var(--muted);
  font-size: 12px;
}

.composer-log-text strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.composer-log-text small {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.composer-confirm {
  min-width: 0;
  min-height: 32px;
  border-color: rgba(13, 130, 118, 0.24);
  background: #ffffff;
  color: var(--teal);
  padding: 0 8px;
  white-space: nowrap;
}

.composer-log .operator-details {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  border-top: 1px solid rgba(13, 130, 118, 0.12);
  padding-top: 5px;
  overflow-wrap: anywhere;
}

.composer-log .operator-details ol {
  margin: 5px 0 0;
  padding-left: 18px;
}

.composer-log .operator-details li {
  overflow-wrap: anywhere;
}

.voice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  border-top: 0;
  background: transparent;
  padding: 0 10px 10px;
}

.voice-actions.is-compact {
  display: flex;
}

.composer-icon-button,
.voice-actions button {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border-color: rgba(13, 130, 118, 0.16);
  border-radius: 999px;
  background: #ffffff;
  color: var(--teal);
  padding: 0;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
}

.composer-tool-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.composer-voice-action {
  background: #ffffff;
  color: var(--teal);
}

.composer-voice-action span {
  position: relative;
  width: 18px;
  height: 18px;
  font-size: 0;
}

.composer-voice-action span::before,
.composer-voice-action span::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.composer-voice-action span::before {
  top: 1px;
  width: 10px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.composer-voice-action span::after {
  bottom: 0;
  width: 14px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
}

.composer-voice-action.is-capturing span {
  width: auto;
  height: auto;
  font-size: 15px;
}

.composer-voice-action.is-capturing span::before,
.composer-voice-action.is-capturing span::after {
  content: none;
}

.voice-actions button[data-clear-voice] {
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.voice-actions.is-compact .composer-tool-button,
.voice-actions.is-compact [data-voice-close] {
  display: none;
}

.voice-actions.is-compact .composer-expand-button {
  display: grid;
}

.composer-primary {
  width: 40px;
  min-width: 40px;
  min-height: 38px;
  margin: 0;
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
  box-shadow: none;
}

.operator-details {
  color: var(--muted);
  font-size: 12px;
}

.operator-details summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 850;
}

@keyframes listeningPulse {
  0%,
  100% {
    box-shadow: 0 18px 36px rgba(7, 16, 15, 0.28), 0 0 0 0 rgba(159, 63, 53, 0.32);
  }

  50% {
    box-shadow: 0 18px 36px rgba(7, 16, 15, 0.28), 0 0 0 8px rgba(159, 63, 53, 0);
  }
}

.result-box,
.note,
.empty {
  border: 1px dashed rgba(23, 108, 98, 0.28);
  border-radius: 8px;
  background: #f5fbf9;
  color: var(--muted);
  padding: 12px;
  line-height: 1.6;
}

.memory-list,
.contact-grid,
.opportunity-list,
.task-list {
  display: grid;
  gap: 12px;
}

.contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-card,
.memory,
.opportunity {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
  box-shadow: 0 1px 0 rgba(24, 33, 31, 0.03);
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-ink);
  font-weight: 900;
  flex: 0 0 auto;
}

.card-title {
  margin-bottom: 0;
}

.card-title > div {
  min-width: 0;
  flex: 1;
}

.card-title p {
  margin: 2px 0 0;
  font-size: 12px;
}

.card-title strong,
.opportunity span {
  color: var(--teal);
  font-weight: 900;
}

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

.tag-row span {
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-ink);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.path {
  color: #755a31;
  font-size: 12px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  margin-bottom: 16px;
}

.chat {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 390px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 14px;
}

.bubble {
  max-width: 76%;
  border-radius: 8px;
  padding: 11px 13px;
  line-height: 1.55;
  box-shadow: 0 6px 16px rgba(24, 32, 30, 0.06);
}

.bubble.me {
  justify-self: end;
  background: var(--teal);
  color: #ffffff;
}

.bubble.ai {
  justify-self: start;
  background: #eaf4f1;
  color: #213b37;
}

.memory > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.memory p,
.opportunity p {
  margin: 0;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button:last-child {
  color: var(--danger);
}

@media (max-width: 1080px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(23, 32, 31, 0.1);
    padding: 16px 22px;
    backdrop-filter: blur(18px);
  }

  .nav {
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow-x: auto;
    padding: 3px;
    border: 1px solid rgba(24, 33, 31, 0.08);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.48);
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    width: auto;
    min-width: 72px;
    min-height: 34px;
    justify-content: center;
    white-space: nowrap;
    padding: 0 11px;
  }

  .nav button.active {
    box-shadow: none;
  }

  .content-grid,
  .hero-panel,
  .login-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-workspace,
  .dashboard-preview-grid,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .audience-split,
  .portal-flow {
    grid-template-columns: 1fr;
  }

  .contact-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    background: #f6f7f5;
  }

  button {
    min-height: 46px;
  }

  .app {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 74px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: none;
    padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  }

  .brand {
    gap: 11px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .brand p {
    font-size: 10px;
  }

  .brand strong {
    font-size: 18px;
  }

  .system-notice-host {
    margin-bottom: 10px;
  }

  .system-notice {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 11px;
  }

  .system-notice button:not(.system-notice-close) {
    grid-column: 1 / -1;
    width: 100%;
  }

  .dashboard-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-prompts {
    grid-template-columns: 1fr;
  }

  .judgment-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .judgment-item > span {
    width: 32px;
    height: 32px;
  }

  .judgment-item button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .desktop-composer-entry {
    min-height: 88px;
  }

  .nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    height: 64px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(24, 32, 30, 0.1);
    backdrop-filter: blur(18px);
    padding: 5px;
  }

  .nav button {
    display: grid;
    place-items: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    border-radius: 8px;
    font-size: 11px;
    padding: 0 4px;
  }

  .composer-nav {
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
  }

  .tab-icon {
    width: 20px;
    min-width: 20px;
    height: 20px;
  }

  .composer-tag-icon {
    width: 21px;
    min-width: 21px;
    height: 17px;
  }

  .nav button.active {
    border-color: transparent;
    background: var(--teal-soft);
    color: var(--teal);
  }

  .voice-dock {
    left: 14px;
    right: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: flex-end;
    overflow: visible;
  }

  .voice-sheet {
    position: static;
    width: 100%;
    max-width: 100%;
    max-height: min(34vh, 300px);
    overflow: visible;
  }

  .voice-panel {
    gap: 7px;
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .voice-close {
    width: 26px;
    min-width: 26px;
    min-height: 26px;
    font-size: 17px;
  }

  .voice-status {
    display: none;
  }

  .voice-editor textarea {
    width: 100%;
    min-height: 86px;
    max-height: 132px;
    padding: 14px 14px 8px;
  }

  .voice-actions {
    padding: 0 9px 9px;
  }

  .voice-actions button {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .composer-log {
    padding: 6px;
  }

  .composer-log-main {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .composer-log-text small {
    display: none;
  }

  .main {
    padding: 16px 14px calc(92px + env(safe-area-inset-bottom));
  }

  body[data-auth="guest"] .main {
    padding-bottom: 0;
  }

  .login-screen {
    min-height: 100vh;
  }

  .visitor-header {
    min-height: 68px;
    padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  }

  .visitor-brand {
    gap: 11px;
  }

  .visitor-brand strong {
    font-size: 18px;
  }

  .visitor-brand p {
    font-size: 10px;
  }

  .login-layout {
    gap: 18px;
    width: 100%;
    padding: 18px 14px 24px;
  }

  .portal-hero {
    padding: 20px;
  }

  .portal-hero h2 {
    font-size: 30px;
  }

  .public-name-card {
    width: 100%;
    margin-top: 4px;
    padding: 15px;
  }

  .public-card-top h3 {
    font-size: 22px;
  }

  .public-card-sections {
    grid-template-columns: 1fr;
  }

  .public-card-actions {
    grid-template-columns: 1fr;
  }

  .portal-hero p {
    font-size: 15px;
  }

  .login-points strong {
    padding: 7px 9px;
    font-size: 12px;
  }

  .intent-card,
  .login-card {
    padding: 18px;
  }

  .panel-head,
  .filters {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .voice-panel .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .contact-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    padding: 18px;
    gap: 18px;
  }

  .voice-layout {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .voice-actions {
    gap: 7px;
    padding: 0 9px 9px;
  }

  .composer-primary {
    width: 38px;
    min-width: 38px;
    min-height: 36px;
    margin: 0;
  }

  .hero-panel h2 {
    font-size: 24px;
  }

  .meter-block {
    padding: 14px;
  }

  .panel {
    padding: 16px;
  }

  .stat,
  .panel,
  .hero-panel {
    box-shadow: 0 10px 26px rgba(24, 32, 30, 0.05);
  }

  .main-panel {
    min-height: 0;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 88%;
  }
}
