:root {
  --ink: #000;
  --ink-2: rgba(0, 0, 0, .45);
  --ink-3: rgba(0, 0, 0, .30);
  --bg: #fff;
  --surface: #f5f5f5;
  --fill: rgba(0, 0, 0, .03);
  --line: rgba(0, 0, 0, .06);
  --accent: rgb(0, 122, 255);
  --accent-wash: rgba(59, 130, 246, .12);
  --red: rgb(220, 38, 38);
  --yellow: rgb(255, 209, 92);
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --conversation-width: 280px;
  --read-width: 760px;
  --bottom-nav-height: 84px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --overlay-shadow: rgba(0, 0, 0, .12) 0 6px 12px;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 21px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg circle[r=".6"],
svg circle[r=".7"],
svg circle[r="1.3"],
svg circle[r="1.4"] {
  fill: currentColor;
  stroke: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.hidden,
.page {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.active-page {
  display: block !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 24px;
  padding: 24px;
  background: var(--bg);
}

.brand-block {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.brand-block h1 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.brand-block p,
.muted {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
}

input,
textarea {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: var(--r-pill);
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
}

.login-panel button {
  height: 40px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.main-view {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  background: var(--bg);
}

.rail {
  width: 60px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  gap: 12px;
  background: var(--surface);
}

.rail-logo {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: var(--r-pill);
  background: #7cb8e8;
  color: #1b3b5c;
}

.rail-logo svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.rail-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  position: relative;
}

.rail-label {
  display: none;
}

.rail-btn.active {
  background: #fff;
  color: var(--ink);
}

.rail-spacer {
  flex: 1;
}

.discover-shell {
  min-height: 100vh;
  padding: 32px 40px;
  background: var(--surface);
}

.discover-page-head {
  max-width: 430px;
  margin: 0 auto;
  padding: 18px 4px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.discover-page-head h1 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

.discover-search {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
}

.discover-card-group {
  max-width: 430px;
  margin: 0 auto 12px;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--bg);
}

.discover-group-title {
  padding: 12px 16px 4px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.discover-post {
  padding: 14px 16px;
}

.discover-post + .discover-post,
.discover-row + .discover-row {
  border-top: 1px solid var(--line);
}

.discover-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.discover-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.discover-avatar.ai {
  background: #111;
  color: #fff;
}

.discover-post-meta strong {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.discover-post-meta span,
.discover-row-copy small {
  display: block;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.discover-ai-bolt,
.discover-ai-bolt svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.discover-post-body {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 21px;
}

.discover-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.discover-attachment svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.discover-actions {
  display: flex;
  gap: 18px;
}

.discover-actions button {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.discover-actions button.liked {
  color: var(--accent);
}

.discover-actions svg {
  width: 16px;
  height: 16px;
}

.discover-row {
  width: 100%;
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
}

.discover-row-icon,
.discover-row-icon svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.discover-row-copy {
  flex: 1;
  min-width: 0;
}

.discover-row-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-row-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-row-tail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.discover-chip {
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 10px;
  line-height: 15px;
}

.discover-chip.soon {
  background: var(--accent-wash);
  color: var(--accent);
}

.discover-chevron,
.discover-chevron svg {
  width: 14px;
  height: 14px;
  color: var(--ink-2);
}

.content {
  min-width: 0;
  height: 100vh;
}

.chat-layout {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--conversation-width) minmax(0, 1fr);
}

.chat-layout.detail-open {
  grid-template-columns: var(--conversation-width) minmax(0, 1fr) 320px;
}

.chat-layout:not(.detail-open) .conversation-settings {
  display: none !important;
}

.conversation-panel {
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
}

.panel-head {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 8px 12px 16px;
}

.panel-head h2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-btn {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.pill-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}

.icon-btn-32,
.icon-btn-36,
.circle-40 {
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  color: rgba(0, 0, 0, .6);
  transition: background .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}

.icon-btn-32 {
  width: 32px;
  height: 32px;
}

.icon-btn-36 {
  width: 36px;
  height: 36px;
}

.circle-40 {
  width: 44px;
  height: 44px;
  background: var(--fill);
}

.composer-attach {
  position: relative;
  color: var(--accent);
}

.composer-attach::after {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  right: 7px;
  top: 7px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.icon-btn-32:hover,
.icon-btn-36:hover,
.circle-40:hover,
.pill-btn:hover {
  background: var(--fill);
  color: var(--ink);
}

.icon-btn-32:active,
.icon-btn-36:active,
.circle-40:active,
.pill-btn:active {
  transform: translateY(1px);
  background: rgba(0, 0, 0, .06);
}

.icon-btn-32:focus-visible,
.icon-btn-36:focus-visible,
.circle-40:focus-visible,
.composer-tool-btn:focus-visible,
.pin-button:focus-visible,
.context-menu-item:focus-visible,
.quick-create-menu > button:focus-visible,
.profile-copy-btn:focus-visible {
  outline: 2px solid rgba(0, 122, 255, .28);
  outline-offset: 2px;
}

.icon-btn-36.active {
  background: var(--accent-wash);
  color: var(--accent);
}

.icon-btn-32:disabled,
.icon-btn-36:disabled,
.circle-40:disabled {
  cursor: default;
  color: var(--ink-3);
  opacity: .58;
  transform: none;
}

.icon-btn-32:disabled:hover,
.icon-btn-36:disabled:hover,
.circle-40:disabled:hover {
  background: transparent;
  color: var(--ink-3);
}

.search-box {
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 8px 0;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-2);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.search-box:focus-within {
  border-color: rgba(0, 122, 255, .18);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .08);
  color: var(--ink);
}

.search-box svg {
  width: 18px;
  height: 18px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--accent);
  font-size: 16px;
  line-height: 24px;
}

.search-box input::placeholder,
.composer textarea::placeholder {
  color: var(--ink-2);
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.conversation-item:hover {
  background: var(--fill);
}

.conversation-item.active {
  background: var(--accent-wash);
}

.conversation-item.pinned .conversation-name::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.pin-button {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  color: var(--ink-3);
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.pin-button:hover,
.pin-button.active {
  background: var(--accent-wash);
  color: var(--accent);
}

.pin-button:active {
  transform: translateY(1px);
}

.pin-button svg {
  width: 18px;
  height: 18px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: #2c2c2c;
  color: #fff;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  position: relative;
}

.chat-avatar.group {
  background: #444;
}

.avatar-dot {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  box-sizing: content-box;
  text-align: center;
}

.conversation-copy {
  flex: 1;
  min-width: 0;
}

.conversation-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.conversation-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.conversation-title-row time,
.time-separator,
.delivery-state,
.composer-status {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.conversation-preview {
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-group {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.search-group-title {
  padding: 0 12px 4px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.search-result {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  text-align: left;
}

.search-result:hover {
  background: var(--fill);
}

.search-sender {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.search-snippet {
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
}

.search-snippet mark {
  padding: 0 2px;
  border-radius: var(--r-sm);
  color: var(--accent);
  background: var(--accent-wash);
}

.bolt-icon {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--ink);
  fill: currentColor;
  stroke: none;
}

.chat-panel {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}

.chat-header {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
}

.chat-back {
  display: none;
}

.chat-header-main {
  min-width: 0;
}

.chat-title-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.chat-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.chat-count {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.chat-desc-line {
  min-height: 41px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  overflow: hidden;
  background: var(--fill);
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-desc-line::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  opacity: .7;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.8 4.8h6.6l9 9a1.8 1.8 0 0 1 0 2.6l-4 4a1.8 1.8 0 0 1-2.6 0l-9-9z' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='9' r='1.3' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}

.chat-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
}

.conversation-settings {
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.detail-rail-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-rail-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.detail-rail-head strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-rail-head span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.detail-tabs.room-tabs {
  grid-template-columns: repeat(5, 1fr);
}

.detail-tab {
  min-height: 32px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.detail-tab.active {
  background: var(--surface);
  color: var(--ink);
}

.detail-rail-body {
  height: calc(100vh - 113px);
  overflow: auto;
  padding: 4px 0 16px;
}

.settings-section {
  padding: 12px;
}

.settings-section + .settings-section {
  border-top: 1px solid var(--line);
}

.settings-error {
  margin: 10px 12px 0;
  border: 1px solid rgba(196, 63, 63, .2);
  border-radius: var(--r-md);
  background: #fff6f6;
  color: #9c2d2d;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 16px;
}

.room-summary-section {
  padding-bottom: 10px;
}

.room-summary {
  display: grid;
  gap: 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 10px;
}

.room-summary span,
.room-summary small,
.room-action-row small,
.archived-room-row small,
.room-output-card span,
.room-focus-card span,
.room-primary-actions span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.room-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.room-summary p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 17px;
}

.room-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.room-summary-stats span {
  min-height: 42px;
  display: grid;
  align-content: center;
  border-radius: var(--r-sm);
  background: #fff;
  padding: 6px 8px;
}

.room-summary-stats strong {
  margin: 0;
}

.room-focus-card,
.room-output-card {
  display: grid;
  gap: 3px;
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 10px;
}

.room-focus-card strong,
.room-output-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.room-output-card {
  border-left: 3px solid var(--accent);
}

.room-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.room-primary-actions button {
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 1px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  padding: 7px 8px;
  font-size: 13px;
  line-height: 17px;
  font-weight: 700;
}

.room-primary-actions button:nth-child(n+3) {
  background: var(--surface);
  color: var(--ink);
}

.room-primary-actions button:disabled {
  opacity: .65;
  cursor: default;
}

.room-member-summary {
  display: grid;
  gap: 6px;
}

.room-member-summary-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 8px 10px;
}

.room-member-summary-row span {
  flex: none;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.room-member-summary-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.room-actions,
.archived-room-list {
  display: grid;
  gap: 6px;
}

.room-action-row,
.archived-room-row {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 8px 10px;
  text-align: left;
}

.room-action-row span,
.archived-room-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.room-action-row strong,
.archived-room-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.room-action-row b,
.archived-room-row button {
  flex: none;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}

.room-action-row input {
  width: 34px;
  height: 20px;
  flex: none;
  margin: 0;
  appearance: none;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .18);
  position: relative;
}

.room-action-row input::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform .16s ease;
}

.room-action-row input:checked {
  background: var(--accent);
}

.room-action-row input:checked::before {
  transform: translateX(14px);
}

.settings-section-head {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.settings-section-head span,
.settings-section-head strong {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.settings-section-head strong {
  font-weight: 600;
}

.member-panel-list,
.group-permissions {
  display: grid;
  gap: 6px;
}

.member-panel-row,
.permission-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 8px;
}

.member-mini-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: #2c2c2c;
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}

.member-mini-avatar.ai {
  background: #444;
}

.member-panel-copy,
.permission-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.member-panel-copy strong,
.permission-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.member-panel-copy span,
.permission-copy span,
.settings-empty {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.detail-id-row,
.detail-history-entry,
.detail-history-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 8px 10px;
  text-align: left;
}

.detail-id-row span,
.detail-history-entry span,
.detail-history-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-id-row strong,
.detail-history-row strong {
  flex: none;
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.detail-history-entry svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-2);
}

.detail-history-list {
  display: grid;
  gap: 6px;
}

.detail-history-row {
  display: grid;
  justify-content: stretch;
  gap: 2px;
}

.member-presence {
  min-height: 18px;
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
}

.switch-line {
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.switch-line input {
  width: 28px;
  height: 16px;
  margin: 0;
  appearance: none;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .18);
  position: relative;
}

.switch-line input::before {
  content: "";
  width: 12px;
  height: 12px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: var(--r-pill);
  background: #fff;
  transition: transform .16s ease;
}

.switch-line input:checked {
  background: var(--accent);
}

.switch-line input:checked::before {
  transform: translateX(12px);
}

.settings-empty {
  min-height: 44px;
  display: grid;
  align-items: center;
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 0 12px;
}

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 8px;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 220px;
  color: var(--ink-2);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.message {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  position: relative;
}

.message.self {
  justify-content: flex-end;
}

.message.self .message-stack {
  align-items: flex-end;
}

.message.selected .bubble,
.message.selected .structured-card,
.message.selected .media-bubble {
  outline: 1px solid var(--accent);
  background: var(--accent-wash);
}

.message.is-jump-target .bubble,
.message.is-jump-target .structured-card,
.message.is-jump-target .media-bubble {
  outline: 1px solid var(--accent);
}

.message-select-toggle {
  width: 24px;
  height: 24px;
  flex: none;
  align-self: flex-start;
  display: grid;
  place-items: center;
  margin-top: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
}

.message-select-toggle.selected {
  border-color: var(--accent);
  background: var(--accent);
}

.message-avatar {
  margin-top: 0;
}

.message-stack {
  min-width: 0;
  max-width: 673px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sender {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.message-reply-ref {
  max-width: min(420px, calc(100vw - 460px));
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
  padding: 8px 10px;
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .03);
  text-align: left;
}

.message-reply-ref strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.message-reply-ref span {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message-forwarded-ref {
  max-width: min(420px, calc(100vw - 460px));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  margin-bottom: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .025);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.message-forwarded-ref .card-icon {
  width: 14px;
  height: 14px;
  color: var(--ink-2);
}

.message-forwarded-ref span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bubble {
  max-width: min(673px, calc(100vw - 460px));
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
}

.bubble {
  overflow-x: auto;
}

.message.self .bubble {
  background: var(--accent-wash);
}

.media-bubble {
  max-width: min(360px, calc(100vw - 460px));
  overflow: hidden;
  padding: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 21px;
  text-align: left;
}

.media-bubble img {
  width: 100%;
  max-height: 360px;
  display: block;
  object-fit: cover;
}

.media-bubble span {
  display: block;
  padding: 14px 16px;
}

.bubble p {
  margin: 0 0 8px;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble table {
  width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
  background: transparent;
}

.bubble th,
.bubble td {
  border: 1px solid rgba(0, 0, 0, .1);
  padding: 8px 12px;
  text-align: left;
  font-size: 14px;
  line-height: 21px;
}

.bubble th,
.bubble td:first-child {
  font-weight: 700;
  white-space: nowrap;
}

.item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.item-meta {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.pill,
.ai-badge,
.lead-badge,
.mention {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  color: var(--accent);
  background: var(--accent-wash);
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
}

.mention {
  margin: 0 1px;
  border-radius: var(--r-sm);
}

.inline-guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 0 1px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  vertical-align: baseline;
}

.inline-guide-link:hover,
.inline-guide-link:focus-visible {
  border-color: var(--accent);
}

.structured-message {
  margin-bottom: 24px;
}

.structured-card {
  width: min(420px, calc(100vw - 460px));
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
}

.message.self .structured-card {
  background: var(--accent-wash);
}

.structured-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--accent);
}

.card-icon svg {
  width: 20px;
  height: 20px;
}

.structured-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.structured-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.structured-title span,
.card-meta-row span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.card-status {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.card-status.danger {
  background: rgba(220, 38, 38, .08);
  color: var(--red);
}

.card-status.done {
  background: rgba(0, 0, 0, .06);
  color: var(--ink-2);
}

.card-link,
.card-meta-row,
.choice-options,
.card-actions {
  margin-top: 12px;
}

.card-link {
  color: var(--accent);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.card-meta-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.card-meta-row strong {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.choice-options {
  display: grid;
  gap: 8px;
}

.choice-option {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: #fff;
  text-align: left;
  font-size: 14px;
  line-height: 21px;
}

.choice-option:not(:disabled):hover {
  background: var(--fill);
}

.choice-option.selected {
  background: var(--accent-wash);
  color: var(--accent);
}

.choice-option:disabled {
  cursor: default;
}

.choice-option strong {
  flex: none;
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
}

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

.card-primary,
.card-secondary {
  height: 36px;
  min-width: 72px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.card-primary {
  background: var(--accent);
  color: #fff;
}

.card-secondary {
  background: #fff;
  color: var(--ink-2);
}

.action-line,
.trust-note,
.typing-line {
  width: fit-content;
  max-width: 80%;
  margin: 0 auto 16px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.typing-line {
  margin: 0 16px 8px 18px;
}

.back-to-bottom {
  position: absolute;
  right: 24px;
  bottom: 72px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
}

.composer {
  flex: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 14px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer-tool-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  transition: background .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}

.composer-tool-btn:hover {
  background: var(--fill);
  color: var(--ink);
}

.composer-tool-btn:active {
  transform: translateY(1px);
  background: rgba(0, 0, 0, .06);
}

.composer-tool-btn.pending {
  color: var(--ink-3);
}

.composer-tool-btn.pending:hover {
  background: rgba(0, 0, 0, .025);
  color: var(--ink-2);
}

.composer-tool-btn svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}

.reply-preview,
.multi-select-bar {
  flex: none;
  margin: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

.reply-preview {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 14px;
}

.reply-preview-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reply-preview-copy strong,
.multi-select-bar span {
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.reply-preview-copy span {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.multi-select-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
}

.multi-select-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.small-action-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
}

.small-action-btn:disabled {
  color: var(--ink-3);
}

.composer-field {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 6px 18px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--surface);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.composer-field:focus-within {
  border-color: rgba(0, 122, 255, .18);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .08);
}

.composer textarea {
  width: 100%;
  min-width: 0;
  max-height: 132px;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--accent);
  font-size: 17px;
  line-height: 26px;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.composer textarea.with-scroll {
  overflow-y: auto;
}

.send-button.ready {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 122, 255, .22);
}

.send-button:disabled {
  cursor: default;
}

.composer-status {
  grid-column: 2;
  min-height: 16px;
}

.composer-attachment-preview {
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .82);
}

.composer-attachment-preview img {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
}

.composer-attachment-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  font-size: 12px;
  line-height: 16px;
}

.composer-attachment-copy strong,
.composer-attachment-copy span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.composer-attachment-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.composer-attachment-copy span {
  color: var(--ink-2);
}

.composer-attachment-remove {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: var(--r-pill);
  color: var(--ink-2);
}

.composer-attachment-remove:hover {
  background: var(--fill);
  color: var(--ink);
}

.media-caption {
  max-width: 320px;
  padding-top: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.composer-status.error,
.delivery-state.failed {
  color: var(--red);
}

.copy-toast {
  position: fixed;
  z-index: 220;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
}

.context-menu-layer {
  position: fixed;
  inset: 0;
  z-index: 215;
  pointer-events: none;
}

.context-menu-backdrop {
  display: none;
}

.context-menu {
  width: 232px;
  position: fixed;
  padding: 6px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--overlay-shadow);
  pointer-events: auto;
}

.context-menu-title {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.context-menu-item {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 21px;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}

.context-menu-item small {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 11px;
}

.context-menu-item:hover {
  background: var(--fill);
}

.context-menu-item:active {
  transform: translateY(1px);
  background: rgba(0, 0, 0, .06);
}

.context-menu-item:disabled,
.context-menu-item.disabled {
  cursor: default;
  color: var(--ink-3);
  opacity: .62;
}

.context-menu-item:disabled:hover,
.context-menu-item.disabled:hover {
  background: transparent;
}

.context-menu-item:disabled:active,
.context-menu-item.disabled:active {
  transform: none;
}

.context-menu-item.danger {
  color: var(--red);
}

.context-menu-icon,
.context-menu-icon svg {
  width: 21px;
  height: 21px;
  flex: none;
}

.media-lightbox {
  position: fixed;
  z-index: 210;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 48px;
  background: rgba(255, 255, 255, .96);
}

.media-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r-lg);
  object-fit: contain;
}

.media-lightbox .icon-btn-36 {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface);
}

.floating-panel {
  position: fixed;
  z-index: 216;
  width: min(292px, calc(100vw - 24px));
  max-height: min(420px, calc(100dvh - 24px));
  overflow: auto;
  padding: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.floating-panel-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 6px;
}

.floating-panel-head strong {
  font-size: 13px;
  line-height: 18px;
}

.floating-panel-head button {
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
}

.quick-create-menu > button,
.profile-copy-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}

.quick-create-menu > button:hover,
.profile-copy-btn:hover {
  background: var(--fill);
}

.quick-create-menu > button:active,
.profile-copy-btn:active {
  transform: translateY(1px);
  background: rgba(0, 0, 0, .06);
}

.quick-create-menu > button:disabled {
  color: var(--ink-3);
  cursor: default;
  opacity: .62;
}

.quick-create-menu > button:disabled:hover {
  background: transparent;
}

.quick-create-menu > button:disabled:active {
  transform: none;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.emoji-grid button {
  width: 40px;
  height: 36px;
  border-radius: 8px;
  font-size: 20px;
}

.emoji-grid button:hover,
.mention-list button:hover {
  background: var(--fill);
}

.mention-list {
  display: grid;
  gap: 4px;
}

.mention-list button,
.profile-share-card,
.asset-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mention-list button {
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: left;
}

.mention-list strong,
.profile-share-card strong,
.asset-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mention-list small,
.profile-share-card span,
.profile-share-card p,
.asset-row small {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.profile-share-card {
  align-items: flex-start;
  padding: 8px 4px 12px;
}

.profile-share-card div:last-child,
.asset-row span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.asset-list {
  display: grid;
  gap: 6px;
}

.asset-row {
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.asset-icon,
.asset-icon svg,
.asset-icon .card-icon {
  width: 28px;
  height: 28px;
  flex: none;
}

.profile-card,
.panel,
.list-item,
.task-card,
.person-row,
.identity-panel {
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 12px;
}

.split-layout,
.people-layout,
.mine-stack {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.people-layout {
  grid-template-columns: 320px minmax(0, 1fr);
}

.list-stack,
.contact-group,
.profile-card,
.mine-stack {
  display: grid;
  gap: 8px;
}

.person-row,
.avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar,
.profile-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: #2c2c2c;
  color: #fff;
  font-weight: 600;
}

.profile-avatar {
  width: 72px;
  height: 72px;
}

.profile-card-v2 {
  gap: 14px;
  padding: 0;
  background: #fff;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 6px;
}

.profile-avatar-wrap {
  position: relative;
  flex: none;
}

.profile-card-v2 .profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--r-pill);
  background: #2c2c2c;
  font-size: 16px;
  line-height: 24px;
}

.profile-card-v2 .profile-avatar.ai {
  background: var(--accent);
}

.profile-presence {
  width: 12px;
  height: 12px;
  position: absolute;
  right: 2px;
  bottom: 2px;
  border: 2px solid #fff;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .18);
}

.profile-presence.online {
  background: #23c56b;
}

.profile-title-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-title-copy h3 {
  overflow: hidden;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-title-copy p,
.profile-section p,
.profile-field-row span,
.profile-id-line {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

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

.profile-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.profile-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
}

.profile-section-head,
.profile-field-row {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-section-head span,
.profile-section-head strong,
.profile-field-row strong {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.profile-section-head span {
  color: var(--ink-2);
}

.profile-id-line {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

.profile-primary-action,
.profile-secondary-action {
  min-height: 40px;
  flex: 1;
  border-radius: var(--r-pill);
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.profile-primary-action {
  background: var(--ink);
  color: #fff;
}

.profile-secondary-action {
  background: var(--surface);
  color: var(--ink);
}

.placeholder-page {
  padding: 24px;
  color: var(--ink-2);
}

/* Tools page v2 — mirrors golden-sample tokens, no shadow. */
#toolsPage {
  height: 100vh;
  overflow: auto;
  background: var(--bg);
}

.tools-page-shell {
  max-width: 1120px;
  min-height: 100%;
  margin: 0 auto;
  padding: 32px 40px 48px;
}

.tools-page-layout {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.tools-page-layout.detail-open {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.tools-page-main {
  min-width: 0;
}

.tools-page-head {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.tools-page-head h1,
.tools-section-head h2,
.tool-card-copy h2,
.tools-task-head h2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.tools-page-head p,
.tools-section-head span,
.tool-card-copy p,
.tool-meta-row,
.tools-task-meta,
.tools-empty span,
.tool-result {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.tools-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.tools-summary span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--surface);
}

.tools-summary strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.tool-result {
  min-height: 36px;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
}

.tools-status {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}

.tools-status strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.tools-status span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.tools-status-error {
  border-color: rgba(220, 38, 38, .16);
  background: rgba(220, 38, 38, .04);
}

.tool-result.success {
  color: var(--accent);
  background: var(--accent-wash);
}

.tool-result.error {
  color: var(--red);
  background: rgba(220, 38, 38, .08);
}

.tools-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 16px;
}

.tools-section {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.tools-section-head {
  min-height: 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

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

.tool-card,
.tools-task-card,
.tools-empty {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
}

.tool-card {
  cursor: pointer;
}

.tool-card-top,
.tool-meta-row,
.tools-task-head,
.tools-task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-wash);
  color: var(--accent);
}

.tool-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.tool-price {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
}

.tool-card-copy {
  display: grid;
  gap: 4px;
}

.tool-card-copy p {
  min-height: 48px;
}

.tool-meta-row {
  padding-top: 2px;
}

.tool-detail-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.tool-detail-link svg {
  width: 16px;
  height: 16px;
}

.tool-call-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.tool-call-btn:hover {
  background: rgb(0, 110, 230);
}

.tool-call-btn:disabled {
  background: var(--surface);
  color: var(--ink-2);
  cursor: default;
}

.tool-call-btn svg {
  width: 20px;
  height: 20px;
}

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

.tools-task-card {
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  text-align: left;
  cursor: pointer;
}

.tools-task-card:hover,
.tools-task-card.active {
  border-color: rgba(0, 122, 255, .28);
  background: var(--accent-wash);
}

.tools-task-card.stalled {
  border-color: rgba(220, 38, 38, .16);
}

.tools-task-head {
  align-items: flex-start;
}

.tools-task-head h2 {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tools-task-meta {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.tools-empty {
  min-height: 120px;
  align-content: center;
}

.tools-empty.compact {
  min-height: 88px;
}

.tools-empty strong {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.tool-detail-rail,
.task-detail-rail {
  min-width: 0;
  height: calc(100vh - 80px);
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #fff;
}

.task-detail-rail {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.tool-detail-copy {
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
}

.task-detail-copy {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 18px;
}

.tool-detail-list,
.tool-call-history,
.task-detail-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.tool-detail-row,
.tool-call-row,
.task-detail-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border-radius: var(--r-md);
  background: var(--surface);
}

.tool-detail-row span,
.tool-call-row span,
.tool-call-row div span,
.task-detail-row span,
.task-event-row span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.tool-detail-row strong,
.tool-call-row strong,
.task-detail-row strong,
.task-event-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
}

.task-detail-row strong,
.task-event-row strong {
  text-align: right;
  overflow-wrap: anywhere;
}

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

.task-event-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
}

.tool-call-row div,
.task-event-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.task-event-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.task-jump-btn {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}
@media (min-width: 901px) {
  .chat-layout {
    height: 100vh;
    min-height: 0;
  }

  .conversation-panel,
  .chat-panel {
    min-height: 0;
  }

  .conversation-list {
    min-height: 0;
    padding-bottom: 24px;
  }

  .chat-header,
  .chat-desc-line,
  .message-list,
  .composer {
    padding-right: 16px;
  }

  .chat-actions {
    padding-right: 0;
  }

  .chat-layout.detail-open .chat-header,
  .chat-layout.detail-open .chat-desc-line,
  .chat-layout.detail-open .message-list,
  .chat-layout.detail-open .composer {
    padding-right: 16px;
  }

  .message-list {
    min-height: 0;
    padding-bottom: 16px;
  }

  .message-empty {
    width: min(100%, var(--read-width));
    min-height: 100%;
    justify-items: center;
  }

  .message.self {
    padding-left: min(96px, 8vw);
  }

  .back-to-bottom {
    right: 24px;
  }
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .main-view {
    height: 100dvh;
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }

  .rail {
    position: fixed;
    z-index: 100;
    top: auto;
    bottom: calc(16px + var(--safe-bottom));
    left: 12px;
    right: 12px;
    width: auto;
    height: 64px;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: 10px 6px;
    border-radius: var(--r-pill);
    background: #fff;
    box-shadow: var(--overlay-shadow);
    pointer-events: auto;
  }

  .rail-logo,
  .rail-spacer {
    display: none;
  }

  .rail-btn {
    min-width: 52px;
    width: auto;
    height: 44px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    margin: 0;
    border-radius: var(--r-pill);
    font-size: 10px;
    line-height: 15px;
  }

  .rail-btn svg {
    width: 20px;
    height: 20px;
  }

  .rail-btn.active {
    background: transparent;
    color: var(--ink);
    font-weight: 700;
  }

  .rail-btn.active svg {
    stroke-width: 2;
  }

  .rail-label {
    display: block;
  }

  .chat-open-page .rail {
    display: none;
  }

  .content {
    height: 100dvh;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    overflow: auto;
  }

  .chat-layout {
    height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom));
    grid-template-columns: 1fr;
  }

  .chat-open-page .chat-layout {
    height: 100dvh;
  }

  .chat-open-page .content {
    padding-bottom: 0;
    overflow: hidden;
  }

  .conversation-panel {
    height: 100%;
    border-right: 0;
  }

  .chat-layout .chat-panel {
    display: none;
  }

  .chat-layout.chat-open .conversation-panel {
    display: none;
  }

  .chat-layout.chat-open .chat-panel {
    display: flex;
    height: 100dvh;
  }

  .chat-back {
    display: grid;
  }

  .bubble,
  .message-card,
  .media-bubble {
    max-width: calc(100vw - 98px);
  }

  .panel-head {
    padding: 14px 12px 10px 16px;
  }

  .conversation-list {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 12px);
  }

  .chat-header {
    height: 64px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .chat-title {
    font-size: 16px;
  }

  .chat-desc-line {
    min-height: 37px;
    font-size: 12px;
    line-height: 16px;
  }

  .conversation-settings.is-mobile-page {
    position: fixed;
    z-index: 160;
    inset: 0;
    height: 100dvh;
    border-left: 0;
    background: #fff;
  }

  .conversation-settings.is-mobile-page .detail-rail-body {
    height: calc(100dvh - 113px);
    padding-bottom: calc(var(--safe-bottom) + 16px);
  }

  .settings-section {
    padding: 10px;
  }

  .member-panel-row,
  .permission-row {
    min-height: 48px;
  }

  .permission-row {
    flex-wrap: wrap;
  }

  .permission-copy {
    flex-basis: 100%;
  }

  .message-list {
    padding: 16px 14px calc(168px + var(--safe-bottom));
    scroll-padding-bottom: calc(168px + var(--safe-bottom));
  }

  body.floating-panel-open .message-list {
    padding-bottom: calc(400px + var(--safe-bottom));
    scroll-padding-bottom: calc(400px + var(--safe-bottom));
  }

  .message {
    gap: 8px;
    margin-bottom: 16px;
  }

  .message.self {
    padding-left: 44px;
  }

  .message-select-toggle {
    width: 22px;
    height: 22px;
    margin-top: 18px;
  }

  .message-stack {
    max-width: none;
  }

  .message-reply-ref,
  .message-forwarded-ref {
    max-width: calc(100vw - 88px);
  }

  .bubble {
    padding: 10px 12px;
    border-radius: var(--r-lg);
    font-size: 14px;
    line-height: 21px;
  }

  .structured-card {
    width: min(100%, calc(100vw - 88px));
    padding: 12px;
  }

  .structured-head {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .card-icon {
    width: 32px;
    height: 32px;
  }

  .composer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    grid-template-areas:
      "field send"
      "attach attach"
      "tools tools"
      "status status";
    grid-template-columns: 1fr 44px;
    padding: 10px 12px calc(12px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
  }

  .composer-tools {
    grid-area: tools;
    justify-content: space-between;
    padding: 0 2px;
  }

  .composer-field {
    grid-area: field;
  }

  .send-button {
    grid-area: send;
  }

  .reply-preview,
  .multi-select-bar {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(156px + var(--safe-bottom));
    z-index: 8;
    margin: 0;
  }

  .multi-select-bar {
    flex-wrap: wrap;
  }

  .composer-field {
    min-height: 46px;
    border-radius: 16px;
  }

  .composer textarea {
    font-size: 16px;
    line-height: 24px;
    max-height: 112px;
  }

  .composer-status {
    grid-area: status;
  }

  .composer-attachment-preview {
    grid-area: attach;
  }

  .back-to-bottom {
    bottom: calc(156px + var(--safe-bottom));
  }

  .floating-panel {
    left: 12px;
    right: 12px;
    bottom: calc(156px + var(--safe-bottom));
    width: auto;
    max-height: min(232px, calc(100dvh - 280px));
    border-radius: 16px;
    box-shadow: var(--overlay-shadow);
  }

  .people-layout,
  .split-layout {
    grid-template-columns: 1fr;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  }

  .profile-panel {
    display: none;
  }

  .mine-stack,
  .discover-shell,
  .placeholder-page {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  }

  .discover-shell {
    min-height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom));
    padding: 18px 12px;
  }

  #toolsPage {
    height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom));
  }

  .tools-page-shell {
    max-width: none;
    padding: 20px 16px 32px;
  }

  .tools-page-layout,
  .tools-page-layout.detail-open {
    min-height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom) - 52px);
    display: block;
  }

  .tools-page-head {
    min-height: 44px;
    margin-bottom: 12px;
  }

  .tools-page-layout,
  .tools-page-layout.detail-open {
    display: block;
  }

  .tools-summary {
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
  }

  .tools-summary span {
    min-height: 24px;
    padding: 0;
    background: transparent;
  }

  .tool-result {
    margin-bottom: 12px;
  }

  .tools-page-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .tool-card,
  .tools-task-card,
  .tools-empty {
    padding: 14px;
  }

  .tool-card-copy p {
    min-height: 0;
  }

  .tools-task-section {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  }

  .tool-detail-rail.is-mobile-page,
  .task-detail-rail.is-mobile-page {
    position: fixed;
    z-index: 150;
    inset: 0;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .tool-detail-rail.is-mobile-page .detail-rail-body,
  .task-detail-rail.is-mobile-page .detail-rail-body {
    height: calc(100dvh - 64px);
    overflow-y: auto;
    padding-bottom: calc(var(--safe-bottom) + 16px);
  }
}

/* Mine page v2 — golden-sample tokens only. */
#minePage {
  height: 100vh;
  overflow: auto;
  background: var(--bg);
}

.mine-stack {
  display: block;
  max-width: 920px;
  min-height: 100%;
  margin: 0 auto;
  padding: 32px 40px 48px;
}

.mine-page-head {
  margin-bottom: 24px;
}

.mine-page-head h1 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.mine-grid {
  display: grid;
  gap: 16px;
}

.mine-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
}

.mine-profile-card {
  padding: 24px;
}

.mine-profile-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mine-avatar {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.mine-profile-copy {
  min-width: 0;
}

.mine-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mine-name-row h2,
.mine-settings-card h2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.mine-profile-copy p,
.mine-card-copy small,
.mine-setting-copy small,
.mine-ledger-heading span {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
}

.mine-identity-badge {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
}

.mine-trust-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 21px;
}

.mine-trust-row span {
  color: var(--ink-2);
}

.mine-trust-row strong {
  color: var(--accent);
  font-weight: 600;
}

.mine-card-button,
.mine-setting-row {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
}

.mine-card-button:hover,
.mine-setting-row:not(.static):hover {
  background: var(--fill);
}

.mine-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-wash);
  color: var(--accent);
}

.mine-icon svg,
.mine-chevron {
  width: 20px;
  height: 20px;
}

.mine-card-copy,
.mine-setting-copy {
  min-width: 0;
  flex: 1;
  display: grid;
}

.mine-card-copy strong,
.mine-setting-copy strong,
.mine-ledger-heading strong {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.mine-ledger-balance {
  flex: none;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.mine-chevron {
  flex: none;
  color: var(--ink-3);
  transition: transform .16s ease;
}

.mine-chevron.open {
  transform: rotate(90deg);
}

.mine-ledger-detail {
  display: none;
  padding: 0 16px 16px;
}

.mine-ledger-detail.open {
  display: block;
}

.mine-ledger-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 10px;
  border-top: 1px solid var(--line);
}

.mine-ledger-events {
  display: grid;
}

.mine-ledger-events .list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.mine-ledger-events .list-item:last-child {
  border-bottom: 0;
}

.mine-settings-card h2 {
  padding: 16px 16px 8px;
}

.mine-setting-row + .mine-setting-row {
  border-top: 1px solid var(--line);
}

.mine-status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .18);
}

.mine-status-dot.online {
  background: var(--accent);
}

.mine-logout {
  height: 48px;
  border: 1px solid rgba(220, 38, 38, .16);
  border-radius: var(--r-md);
  color: var(--red);
  background: #fff;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.mine-logout:hover {
  background: rgba(220, 38, 38, .04);
}

/* Mine page v2.1 — list-type primary page. */
#minePage {
  background: var(--surface);
}

.mine-stack {
  max-width: 430px;
  padding: 32px 40px 48px;
}

.mine-page-head {
  padding: 18px 4px 12px;
  margin-bottom: 0;
}

.mine-page-head h1 {
  font-weight: 500;
}

.mine-hero-card,
.mine-card-group {
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: var(--r-lg);
  background: #fff;
}

.mine-hero-card {
  padding: 16px;
}

.mine-hero-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mine-avatar {
  width: 48px;
  height: 48px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
}

.mine-profile-copy {
  flex: 1;
}

.mine-name-row h2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.mine-identity-badge,
.mine-hero-pill {
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 10px;
  line-height: 15px;
  font-weight: 600;
}

.mine-hero-pill {
  flex: none;
}

.mine-hero-stats {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mine-hero-stats span {
  display: grid;
  gap: 2px;
}

.mine-hero-stats strong {
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.mine-hero-stats small,
.mine-row-copy small,
.mine-ledger-heading span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
}

.mine-group-title {
  padding: 12px 16px 4px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.mine-list-row {
  width: 100%;
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
}

.mine-list-row + .mine-list-row,
.mine-permission-guide + .mine-list-row {
  border-top: 1px solid var(--line);
}

.mine-list-row:not(.static):hover {
  background: var(--fill);
}

.mine-row-icon,
.mine-row-icon svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.mine-row-icon {
  color: var(--ink);
}

.mine-row-copy {
  flex: 1;
  min-width: 0;
  display: grid;
}

.mine-row-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-row-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-row-tail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.mine-ledger-balance {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
}

.mine-chevron,
.mine-chevron svg {
  width: 14px;
  height: 14px;
}

.mine-list-row.danger {
  color: var(--red);
}

.mine-list-row.danger .mine-row-copy strong {
  color: var(--red);
}

.mine-list-row.danger .mine-row-copy small {
  color: rgba(220, 38, 38, .55);
}

.mine-ledger-detail {
  padding: 0 16px 16px;
}

.mine-ledger-heading {
  padding: 12px 0 10px;
}

.mine-permission-guide {
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  #minePage {
    height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom));
  }

  .mine-stack {
    max-width: none;
    padding: 18px 12px 32px;
  }

  .mine-page-head {
    margin-bottom: 16px;
  }

  .mine-grid {
    gap: 12px;
  }

  .mine-profile-card {
    padding: 16px;
  }

  .mine-avatar {
    width: 48px;
    height: 48px;
    font-size: 14px;
    line-height: 21px;
  }

  .mine-profile-main {
    gap: 12px;
  }

  .mine-card-button,
  .mine-setting-row {
    min-height: 64px;
    padding: 12px 14px;
  }

  .mine-ledger-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

/* Contacts page restyle v1. Profile card intentionally unchanged. */
.people-layout {
  height: 100vh;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.contacts-panel {
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
}

.contacts-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.contacts-head h1 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.contacts-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 16px;
}

.contact-group {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
}

.contact-group-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  color: var(--ink-2);
}

.contact-group-head h2,
.contact-group-head span {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.person-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
}

.person-row:hover {
  background: var(--fill);
}

.person-row.active {
  background: var(--accent-wash);
}

.contact-avatar {
  width: 36px;
  height: 36px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.contact-online {
  width: 8px;
  height: 8px;
  position: absolute;
  right: -1px;
  bottom: -1px;
  border: 2px solid #fff;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .18);
}

.contact-online.online {
  background: var(--accent);
}

.contact-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.contact-name {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact-meta {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact-arrow {
  width: 20px;
  height: 20px;
  color: var(--ink-3);
}

.profile-panel {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  background: #fff;
}

.profile-mobile-close {
  display: none;
}

.mine-more-button {
  width: 100%;
  height: 40px;
  margin-top: 4px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.mine-permission-guide {
  display: none;
  padding: 0 16px 16px 64px;
}

.mine-permission-guide.open {
  display: block;
}

.mine-permission-guide > p,
.mine-permission-empty span {
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.mine-permission-list {
  display: grid;
  gap: 4px;
}

.mine-permission-list button {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: left;
}

.mine-permission-list button span,
.mine-permission-empty strong {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.mine-permission-list button small {
  flex: none;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 15px;
}

.mine-permission-empty {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
}

.mine-permission-empty span {
  margin: 0;
}

@media (max-width: 900px) {
  .people-layout {
    height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom));
    grid-template-columns: 1fr;
  }

  .contacts-panel {
    height: 100%;
    border-right: 0;
  }

  .contacts-head {
    min-height: 64px;
    padding: 12px 16px;
  }

  .contacts-list {
    padding-bottom: 16px;
  }

  .profile-panel {
    display: none;
  }

  #peoplePage.profile-open .people-layout {
    height: 100dvh;
  }

  #peoplePage.profile-open .contacts-panel {
    display: none;
  }

  #peoplePage.profile-open .profile-panel {
    display: block;
    height: 100dvh;
    padding: 12px;
    padding-bottom: calc(20px + var(--safe-bottom));
    overflow-y: auto;
  }

  #peoplePage.profile-open .profile-mobile-close {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--ink-2);
    font-size: 12px;
    line-height: 16px;
  }

  #peoplePage.profile-open .profile-mobile-close svg {
    width: 20px;
    height: 20px;
  }

  .mine-permission-guide {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Login + search restyle v1 — golden-sample language. */
.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #fff;
}

.login-shell {
  width: min(420px, 100%);
  display: grid;
  gap: 28px;
}

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

.login-logo {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
}

.login-logo svg {
  width: 20px;
  height: 20px;
}

.login-brand h1,
.login-copy h2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.login-brand p,
.login-copy p,
.login-hint,
.login-footnote {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.login-panel {
  width: 100%;
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
}

.login-copy {
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
}

.login-panel label {
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.login-panel input {
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 0 14px;
  background: var(--surface);
  font-size: 14px;
  line-height: 21px;
}

.login-panel input:focus {
  border-color: var(--accent);
  background: #fff;
}

.login-panel button {
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
}

.login-panel button:hover {
  background: rgb(0, 110, 230);
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 20px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
}

.login-panel .auth-switch button {
  width: auto;
  height: auto;
  min-height: 20px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  line-height: 16px;
}

.login-panel .auth-switch button:hover {
  background: transparent;
}

.login-hint {
  min-height: 32px;
  text-align: center;
}

.login-hint.error {
  color: var(--red);
}

.login-footnote {
  text-align: center;
}

.search-group {
  gap: 2px;
  margin-bottom: 16px;
}

.search-group-title {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.search-group-title small {
  font-size: 10px;
  line-height: 15px;
  font-weight: 400;
}

.search-result {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--fill);
}

.search-result-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.search-result-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.search-result-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.search-result-meta strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-result-meta time {
  flex: none;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 15px;
}

.search-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-snippet mark {
  border-radius: 3px;
  padding: 0 2px;
  background: var(--accent-wash);
  color: var(--accent);
}

.search-result-arrow {
  width: 20px;
  height: 20px;
  color: var(--ink-3);
}

@media (max-width: 900px) {
  .login-view {
    align-items: start;
    padding: 56px 20px 32px;
  }

  .login-shell {
    gap: 24px;
  }

  .login-panel {
    padding: 20px;
  }

  .conversation-list:has(.search-group) {
    padding: 8px 8px calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  }
}

@media (max-width: 900px) {
  .context-menu-layer {
    pointer-events: auto;
  }

  .context-menu-layer.is-sheet .context-menu-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .18);
  }

  .context-menu-layer.is-sheet .context-menu {
    width: auto;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(12px + var(--safe-bottom));
    padding: 8px;
    border-radius: 16px;
  }

  .context-menu-layer.is-sheet .context-menu-title {
    justify-content: center;
    min-height: 36px;
  }

  .context-menu-layer.is-sheet .context-menu-item {
    height: 48px;
    border-radius: 12px;
  }
}
