:root {
  --bg: #f1f5f3;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --ink: #18241f;
  --muted: #64736c;
  --line: #dde6e1;
  --green: #146c4d;
  --green-deep: #0d4e38;
  --teal: #2f6f8f;
  --terra: #cf5f3a;
  --amber: #b7832a;
  --rose: #b9506a;
  --shadow: 0 8px 24px rgba(18, 46, 37, 0.08);
  --radius: 8px;
  --topbar-h: 56px;
  --rail-w: 72px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: var(--green-deep);
  color: #fff;
  box-shadow: 0 2px 10px rgba(10, 40, 30, 0.18);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 15px;
  white-space: nowrap;
}

.brand-copy small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.wecom-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  white-space: nowrap;
}

.wecom-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f4b84a;
  flex: 0 0 auto;
}

.wecom-status.is-online::before {
  background: #7ce0a3;
}

.wecom-status.is-offline::before {
  background: #ff7b7b;
}

.demo-tag {
  font-size: 11px;
  line-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
}

.clock {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.82);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  border-radius: 999px;
}

.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.2s ease;
  flex: 0 0 auto;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch[aria-pressed="true"] .switch-track {
  background: #f4b84a;
}

.switch[aria-pressed="true"] .switch-thumb {
  transform: translateX(16px);
}

.switch-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}

.navrail {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 8px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  min-height: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item span {
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item.is-active {
  background: #e6f2ec;
  color: var(--green);
}

.main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}

.mobilenav {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.btn:hover {
  border-color: #c6d4cd;
  background: var(--surface-2);
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-deep);
  border-color: var(--green-deep);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn svg,
.icon-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  flex: 0 0 auto;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: #c6d4cd;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.seg-btn {
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.is-active {
  background: var(--green);
  color: #fff;
}

.seg-btn[data-tone="xing"].is-active {
  background: var(--teal);
}

.console-view {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 12px;
}

.console-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

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

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.stat-pill b {
  font-weight: 600;
}

.stat-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
}

.console-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 12px;
}

.guest-drawer,
.guest-drawer-backdrop {
  display: none;
}

.mobile-back {
  display: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.convo-list {
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.panel-head small {
  font-size: 11px;
  color: var(--muted);
}

.convo-items {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px;
}

.convo-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
}

.convo-item:hover {
  background: var(--surface-2);
}

.convo-item.is-active {
  background: #eaf3ee;
  border-color: #cfe2d8;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  flex: 0 0 auto;
}

.convo-main {
  min-width: 0;
  flex: 1;
}

.convo-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.convo-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-time {
  font-size: 11px;
  color: var(--muted);
  flex: 0 0 auto;
}

.convo-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 3px;
}

.convo-last {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 11px;
  flex: 0 0 auto;
}

.badge.soft {
  background: #f0e7e9;
  color: var(--rose);
}

.badge.night {
  background: #e7edf0;
  color: var(--teal);
}

.chat-pane {
  display: flex;
  flex-direction: column;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.chat-head-info {
  min-width: 0;
  flex: 1;
}

.chat-head-info h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.chat-head-info p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.night-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fbf3e2;
  border-bottom: 1px solid #f0e2c4;
  color: #8a6420;
  font-size: 12px;
}

.night-banner svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
    repeating-linear-gradient(45deg, #f3f7f5 0, #f3f7f5 8px, #eef4f1 8px, #eef4f1 16px);
}

.msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 82%;
}

.msg-me {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px 4px;
  font-size: 11px;
  color: var(--muted);
}

.msg-role {
  font-weight: 600;
}

.msg-guest .msg-role {
  color: var(--teal);
}

.msg-me .msg-role {
  color: var(--green);
}

.msg-bubble {
  position: relative;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 2px 6px rgba(20, 44, 36, 0.04);
}

.msg-me .msg-bubble {
  background: #e5f2ea;
  border-color: #cfe2d4;
}

.msg-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.msg-tools .icon-btn {
  width: 26px;
  height: 26px;
}

.suggestion-box {
  flex: 0 0 auto;
  margin: 0 14px 10px;
  padding: 10px 12px;
  border: 1px solid #b9d9c9;
  border-radius: var(--radius);
  background: #f2faf5;
}

.suggestion-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
}

.ai-chip svg {
  width: 12px;
  height: 12px;
}

.suggestion-intent {
  font-size: 12px;
  color: var(--muted);
}

.suggestion-text {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bar-chart {
  display: flex;
  align-items: stretch;
  gap: 12px;
  height: 200px;
  padding: 4px 0 0;
}

.bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-stack {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.bar {
  width: min(22px, 42%);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  transition: height 0.2s ease;
}

.bar-label {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  flex: 0 0 auto;
}

.composer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
  background: var(--surface);
}

.quick-replies {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.chip:hover {
  border-color: #bcd4c8;
  color: var(--green);
  background: #f0f8f3;
}

.composer-textarea {
  width: 100%;
  min-height: 64px;
  max-height: 120px;
  resize: vertical;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  outline: none;
}

.composer-textarea:focus {
  border-color: #9ec7b2;
  background: var(--surface);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.composer-hint {
  margin-right: auto;
  font-size: 11px;
  color: var(--muted);
}

.guest-pane {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.guest-section {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.guest-section:last-child {
  border-bottom: 0;
}

.guest-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guest-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  flex: 0 0 auto;
}

.guest-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.guest-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.info-row svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--green);
}

.info-row b {
  color: var(--ink);
  font-weight: 600;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.guest-pane-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.guest-drawer-backdrop {
  display: none;
}

/* Properties */
.properties-view,
.guide-view,
.finance-view {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.view-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0;
}

.view-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.property-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.property-visual {
  position: relative;
  height: 150px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  color: #fff;
}

.property-visual.zhi {
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 236, 187, 0.42), transparent 34%),
    linear-gradient(135deg, #175f45 0%, #0d4e38 58%, #0a3c2c 100%);
}

.property-visual.xing {
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.3), transparent 32%),
    linear-gradient(135deg, #24566f 0%, #163c52 60%, #102d40 100%);
}

.property-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
  pointer-events: none;
}

.property-visual h2 {
  position: relative;
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.property-visual p {
  position: relative;
  margin: 3px 0 0;
  font-size: 12px;
  opacity: 0.82;
}

.property-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.property-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.property-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
}

.property-chip svg {
  width: 13px;
  height: 13px;
  color: var(--green);
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.room-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  min-width: 0;
}

.room-card b {
  display: block;
  font-size: 13px;
}

.room-card span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.subsection-title svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.step-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.guide-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.guide-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: #e7f2ec;
  color: var(--green);
  flex: 0 0 auto;
}

.guide-icon svg {
  width: 18px;
  height: 18px;
}

.guide-card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.guide-card p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.guide-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

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

.guide-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-item b {
  font-size: 13px;
}

.guide-item .tag {
  margin-left: auto;
}

.guide-item p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.finance-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.metric-label svg {
  width: 14px;
  height: 14px;
  color: var(--green);
}

.metric-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-delta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
}

.chart-card h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.chart-legend {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--muted);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.svg-chart {
  width: 100%;
  height: 220px;
  display: block;
}

.finance-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.finance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 640px;
}

.finance-table th,
.finance-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.finance-table th:first-child,
.finance-table td:first-child {
  text-align: left;
}

.finance-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}

.finance-table tbody tr:last-child td {
  border-bottom: 0;
}

.xhs-view {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
}

.xhs-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.xhs-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f4f3;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.xhs-status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9a227;
}

.xhs-status-pill.is-online::before {
  background: #2fa36b;
}

.xhs-status-pill.is-offline::before {
  background: #d25555;
}

.xhs-hint {
  font-size: 12px;
  color: var(--muted);
}

.xhs-searchbar {
  display: flex;
  gap: 8px;
}

.xhs-searchbar input {
  flex: 1;
}

.xhs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.xhs-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.xhs-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.xhs-rank {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e93d5b;
  color: #fff;
  font-size: 12px;
  flex: 0 0 auto;
}

.xhs-card h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.xhs-author {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.xhs-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.xhs-detail {
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.xhs-detail-body {
  padding: 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xhs-detail-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.xhs-detail-content {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.xhs-detail h4 {
  margin: 4px 0 0;
  font-size: 13px;
}

.xhs-comment {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 12px;
}

.xhs-comment b {
  color: var(--ink);
}

.xhs-comment span {
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.xhs-publish {
  display: flex;
  flex-direction: column;
}

.xhs-publish-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xhs-loading,
.xhs-error,
.xhs-empty {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}

.xhs-loading {
  background: #eef4f1;
  color: var(--green);
}

.xhs-error {
  background: #fbecec;
  color: #b23b3b;
}

.xhs-empty {
  color: var(--muted);
  text-align: center;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 26, 20, 0.42);
}

.modal-root.is-open {
  display: flex;
}

.modal {
  width: min(560px, 100%);
  max-height: min(680px, 86dvh);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(8, 28, 21, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.modal-body {
  padding: 14px 16px;
  overflow: auto;
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-item {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.modal-item:hover {
  border-color: #b9d9c9;
  background: #f0f8f3;
}

.modal-item b {
  display: block;
  font-size: 13px;
}

.modal-item span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .console-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .guest-pane {
    display: none;
  }

  .guest-toggle {
    display: inline-flex;
  }

  .guest-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(10, 26, 20, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .guest-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .guest-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 88vw);
    z-index: 61;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 34px rgba(8, 28, 21, 0.16);
    transform: translateX(105%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  .guest-drawer.is-open {
    transform: translateX(0);
  }
}

@media (min-width: 1101px) {
  .guest-toggle {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --rail-w: 0px;
    --topbar-h: 52px;
  }

  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  }

  .navrail {
    display: none;
  }

  .main {
    grid-column: 1;
    grid-row: 2;
    padding-bottom: 58px;
  }

  .mobilenav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }

  .mobilenav .nav-item {
    min-height: 48px;
    border-radius: 8px;
  }

  .topbar {
    padding: 0 12px;
  }

  .brand-copy small,
  .demo-tag,
  .clock {
    display: none;
  }

  .console-view {
    padding: 10px;
  }

  .console-toolbar {
    flex-wrap: wrap;
  }

  .console-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .convo-list {
    grid-row: 1;
  }

  .chat-pane {
    display: none;
    grid-row: 1;
  }

  .mobile-back {
    display: inline-flex;
  }

  .app.mobile-chat-open .convo-list {
    display: none;
  }

  .app.mobile-chat-open .chat-pane {
    display: flex;
  }

  .msg {
    max-width: 88%;
  }

  .composer {
    padding: 8px 10px 10px;
  }

  .composer-hint {
    display: none;
  }

  .properties-view,
  .guide-view,
  .finance-view {
    padding: 12px;
  }

  .property-grid,
  .metric-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .view-head h1 {
    font-size: 19px;
  }

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

  .xhs-view {
    padding: 12px;
  }

  .xhs-searchbar {
    flex-direction: column;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
