:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --control: #f2f2f7;
  --control-strong: #e5e5ea;
  --surface: #f5f5f7;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(229, 229, 234, 0.86);
  --ink: #111111;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #0a84ff;
  --accent-rgb: 10, 132, 255;
  --accent-soft: #eef7ff;
  --accent-card-mid: #3a9dff;
  --accent-card-end: #72c6ff;
  --accent-gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-card-mid) 55%, var(--accent-card-end) 100%);
  --inset-card-bg:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #f8f9fc 56%, #eef1f6 100%);
  --inset-card-border: rgba(60, 60, 67, 0.10);
  --inset-card-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 22px rgba(0, 0, 0, 0.035);
  --green: #34c759;
  --green-soft: #eefaf2;
  --red: #ff3b30;
  --red-soft: #fff0ef;
  --blue: var(--accent);
  --radius-xs: 14px;
  --radius-sm: 18px;
  --radius-md: 24px;
  --radius-lg: 30px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: #f5f6f8;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
  overflow: hidden;
}

html.sheet-open body {
  background: #f5f6f8;
}

/* 打开 sheet 时不再切换 .app-shell 的 overflow：
   全屏浮层已经挡住背景、拦截触摸，无需锁滚动容器；
   在 iOS 独立 PWA 里切 overflow 会让 sticky 顶栏错位并引发重绘卡顿。 */

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

button {
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 72px) 18px calc(110px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.boot,
.login {
  min-height: calc(100vh - 40px);
  display: grid;
  align-content: center;
  gap: 24px;
}

.activity-layer {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  z-index: 60;
  height: 3px;
  pointer-events: none;
  overflow: hidden;
}

.activity-bar {
  width: 44%;
  height: 100%;
  margin: 0 auto;
  border-radius: 999px;
  transform-origin: center;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0), rgba(10, 132, 255, 0.95), rgba(90, 200, 250, 0));
  box-shadow: 0 0 18px rgba(10, 132, 255, 0.34);
}

.brand-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(180deg, #1c1c1e 0%, #000000 100%);
  color: var(--panel);
  font-weight: 800;
  font-size: 28px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.login-card {
  display: grid;
  gap: 20px;
  max-width: 460px;
}

.login-title {
  margin: 0;
  font-size: 40px;
  line-height: 1.02;
  font-weight: 700;
}

.login-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 17px;
}

.google-slot {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.config-warning,
.notice,
.error {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  line-height: 1.45;
  background: var(--control);
  color: var(--muted);
}

.error {
  border-color: #ffd1cf;
  background: var(--red-soft);
  color: #b42318;
}

.notice {
  background: var(--green-soft);
  border-color: #ccefd7;
  color: #1d7d3c;
}

.topbar-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 8px;
  pointer-events: none;
}

.topbar-float {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 0.5px solid rgba(60, 60, 67, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.topbar-title {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: -0.01em;
}

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

.topbar-pill-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(242, 242, 247, 0.92);
  color: var(--ink);
  border: 0.5px solid rgba(60, 60, 67, 0.10);
  transition: background 160ms var(--ease-standard), transform 160ms var(--ease-standard);
}

.topbar-pill-button:hover {
  background: rgba(229, 229, 234, 0.96);
}

.account {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, #1c1c1e 0%, #000000 100%);
  color: var(--panel);
  display: grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-name,
.group-name,
.member-name,
.holding-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.min-w-0 {
  min-width: 0;
}

.account-name {
  font-weight: 760;
  font-size: 17px;
}

.account-mail,
.subtle {
  color: var(--muted);
  font-size: 13px;
}

.icon-button,
.text-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 46px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 600;
  transition:
    transform 180ms var(--ease-standard),
    background 180ms var(--ease-standard),
    border 180ms var(--ease-standard),
    box-shadow 180ms var(--ease-standard),
    color 180ms var(--ease-standard);
}

.icon-button {
  width: 46px;
  min-height: 46px;
  padding: 0;
  background: var(--control);
  color: var(--accent);
  border: 1px solid transparent;
}

.text-button,
.secondary-button {
  background: var(--control);
  color: var(--accent);
  border: 1px solid transparent;
}

.primary-button {
  background: var(--accent-gradient);
  background-size: 140% 140%;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.22);
}

.danger-button {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #ffd1cf;
}

button:active {
  transform: scale(0.98);
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover,
.icon-button:hover,
.danger-button:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.primary-button:hover {
  background-position: 60% 40%;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.24);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.group-control {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.group-select,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid transparent;
  background: #f4f4f7;
  color: var(--ink);
  border-radius: 22px;
  min-height: 50px;
  padding: 13px 16px;
  font-size: 15px;
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(60, 60, 67, 0.08),
    0 1px 1px rgba(0, 0, 0, 0.02);
  transition:
    background 160ms var(--ease-standard),
    border-color 160ms var(--ease-standard),
    box-shadow 160ms var(--ease-standard);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a5a5ad;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.5;
}

.group-select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  background: #ffffff;
  border-color: rgba(var(--accent-rgb), 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.18),
    0 0 0 4px rgba(var(--accent-rgb), 0.10);
}

.page-viewport {
  position: relative;
  overflow-x: clip;
}

.page-slide {
  width: 100%;
}

.page-viewport > .page-slide {
  top: 0;
  left: 0;
  right: 0;
}

.content {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.section {
  display: grid;
  gap: 11px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-header > h2,
.section-header > h3,
.section-header h2,
.section-header h3,
.section-header .section-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.section-header-copy {
  display: grid;
  gap: 2px;
}

.section-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 12px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.metric,
.panel,
.list-item,
.form-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition:
    transform 220ms var(--ease-standard),
    box-shadow 220ms var(--ease-standard),
    background 220ms var(--ease-standard),
    border-color 220ms var(--ease-standard);
}

.metric {
  min-height: 110px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.panel,
.form-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

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

.list-item {
  padding: 13px;
  display: grid;
  gap: 9px;
}

.list-item:hover,
.metric:hover,
.panel:hover,
.form-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

button.list-item {
  width: 100%;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.group-forms {
  display: grid;
  gap: 10px;
}

.group-forms .group-form-card {
  gap: 10px;
  padding: 13px;
}

.group-forms .group-form-head {
  gap: 9px;
}

.group-forms .field {
  gap: 4px;
}

.group-forms .field input {
  min-height: 43px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
}

.group-forms .primary-button,
.group-forms .secondary-button {
  min-height: 40px;
  margin-top: 0;
  font-size: 14px;
}

button.list-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.member-list-card {
  gap: 12px;
}

.holding-row,
.member-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.member-list-value {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
}

.member-list-strip {
  height: 8px;
}

.member-list-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.member-selector-section {
  gap: 0;
}

.member-selector-button {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  color: #ffffff;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(145deg, var(--accent) 0%, var(--accent-card-mid) 52%, var(--accent-card-end) 100%);
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.16);
}

.member-selector-button .avatar {
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.member-selector-id {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.member-selector-hint {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.member-selector-name {
  display: block;
  margin-top: 1px;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-selector-value {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.member-selector-value strong {
  font-size: 16px;
  line-height: 1.05;
  white-space: nowrap;
}

.member-selector-value span {
  color: rgba(255, 255, 255, 0.70);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.member-selector-chevron {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: rotate(90deg);
}

.member-selector-button .member-selector-bio {
  color: rgba(255, 255, 255, 0.70);
}

.holding-card {
  gap: 9px;
  padding: 13px;
  border-radius: 24px;
}

.holding-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.holding-card-price {
  min-width: 78px;
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.holding-card-price strong {
  font-size: 16px;
  line-height: 1.05;
  font-weight: 820;
  white-space: nowrap;
}

.holding-card-price span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.holding-meta,
.member-meta,
.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.privacy-pill {
  min-height: 18px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

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

.holding-stat {
  min-width: 0;
  padding: 6px 5px;
  border-radius: 12px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
  display: grid;
  gap: 2px;
}

.holding-stat-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.holding-stat-value {
  font-size: 13px;
  line-height: 1.08;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holding-stat-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.holding-primary-value {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 800;
  white-space: nowrap;
}

.holding-hidden-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.holding-change {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #9a9aa1;
  font-size: 12px;
  line-height: 1.4;
}

.value-stack {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.member-row .value-stack,
.member-overview-head .value-stack {
  min-width: max-content;
}

.weight-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.value-caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.portfolio-note,
.allocation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weight-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weight-summary .weight-bar {
  flex: 1;
}

.weight-chip,
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--control);
  color: var(--muted);
  font-size: 12px;
}

.weight-chip.strong {
  background: var(--accent-soft);
  color: var(--accent);
}

.weight-chip.positive {
  background: var(--green-soft);
  color: #1d7d3c;
}

.weight-chip.negative {
  background: var(--red-soft);
  color: var(--red);
}

.weight-bar {
  height: 8px;
  border-radius: 999px;
  background: #edf0f5;
  overflow: hidden;
}

.weight-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fd1ff 0%, #5ac8fa 100%);
  transition: width 360ms var(--ease-standard);
}

.weight-fill.tone-0 {
  background: linear-gradient(90deg, #8fd1ff 0%, #5ac8fa 100%);
}

.weight-fill.tone-1 {
  background: linear-gradient(90deg, #a9eec0 0%, #6ee59c 100%);
}

.weight-fill.tone-2 {
  background: linear-gradient(90deg, #ffdca2 0%, #ffc15e 100%);
}

.weight-fill.tone-3 {
  background: linear-gradient(90deg, #c8c7ff 0%, #a9a7ff 100%);
}

.weight-fill.tone-4 {
  background: linear-gradient(90deg, #ffb3c8 0%, #ff86a8 100%);
}

.weight-fill.tone-5 {
  background: linear-gradient(90deg, #b7efff 0%, #84dcff 100%);
}

.portfolio-summary {
  gap: 10px;
  padding: 13px;
}

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

.portfolio-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 16px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
}

.portfolio-focus-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

.portfolio-focus-title {
  margin-top: 2px;
  font-size: 17px;
  line-height: 1.05;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.portfolio-stat-grid-compact .portfolio-stat {
  padding: 8px 10px;
  border-radius: 14px;
}

.portfolio-stat-grid-compact .portfolio-stat-value {
  font-size: 15px;
}

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

.group-overview-panel {
  gap: 15px;
  padding: 17px;
  color: #ffffff;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.30), transparent 34%),
    linear-gradient(145deg, var(--accent) 0%, var(--accent-card-mid) 48%, var(--accent-card-end) 100%);
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18);
}

.group-overview-panel .subtle {
  color: rgba(255, 255, 255, 0.72);
}

.group-overview-panel .invite-button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.overview-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.overview-heading.compact {
  align-items: center;
}

.overview-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0;
  padding: 2px 0;
}

.overview-kpi {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 3px 12px;
  background: transparent;
  border: 0;
}

.overview-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 1px;
  background: rgba(255, 255, 255, 0.24);
}

.overview-kpi span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.overview-kpi strong {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.overview-signal-list {
  display: grid;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(18px);
}

.overview-signal-row {
  display: grid;
  gap: 9px;
  padding: 13px 14px;
}

.overview-signal-row + .overview-signal-row {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.overview-signal-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.overview-signal-label {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 780;
}

.overview-signal-detail {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.35;
}

.overview-signal-value {
  flex: none;
  font-size: 17px;
  line-height: 1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.overview-signal-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.20);
  overflow: hidden;
}

.overview-signal-fill {
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.88);
}

.compact-progress {
  width: 112px;
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.16);
  overflow: hidden;
}

.compact-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
  transition: width 360ms var(--ease-standard);
}

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

.overview-market-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.overview-market-chips {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-overview-panel .legend-chip,
.group-overview-panel .legend-chip.tone-0,
.group-overview-panel .legend-chip.tone-1,
.group-overview-panel .legend-chip.tone-2,
.group-overview-panel .legend-chip.tone-3,
.group-overview-panel .legend-chip.tone-4,
.group-overview-panel .legend-chip.tone-5 {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.14);
}

.group-overview-note {
  gap: 10px 14px;
}

.pill-button {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
}

.invite-button {
  gap: 8px;
  font-weight: 600;
}

.invite-button strong {
  color: var(--ink);
  font-size: 12px;
}

.profile-card,
.member-overview-card {
  gap: 10px;
}

.profile-card-head,
.member-overview-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.profile-meta-row,
.member-card-meta,
.member-symbol-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-meta-row,
.member-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.profile-close-button {
  width: 32px;
  min-height: 32px;
  background: var(--control);
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  box-shadow: none;
}

.compact-sheet-panel {
  gap: 12px;
  padding: 18px;
}

.confirm-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 4px 2px 0;
  text-align: center;
}

.confirm-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  font-weight: 850;
}

.confirm-card.danger .confirm-icon {
  background: var(--red-soft);
  color: var(--red);
}

.confirm-copy {
  display: grid;
  gap: 6px;
}

.confirm-copy h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 780;
}

.confirm-copy p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.confirm-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.confirm-actions button {
  min-height: 44px;
}

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

.member-select-option {
  width: 100%;
  min-height: 62px;
  border-radius: 20px;
  padding: 10px 12px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.member-select-option.active {
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.member-select-metrics {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.member-select-metrics strong {
  font-size: 15px;
  line-height: 1.05;
  white-space: nowrap;
}

.member-select-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.member-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.member-overview-card {
  align-content: start;
  padding: 13px;
  border-radius: 24px;
}

.member-overview-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.member-overview-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 760;
}

.member-overview-name .mini-avatar {
  width: 28px;
  height: 28px;
  margin-left: 0;
  border-width: 1px;
}

.member-overview-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-overview-value {
  font-size: 18px;
  line-height: 1.05;
  font-weight: 800;
  white-space: nowrap;
}

.member-overview-subline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.member-overview-subline span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-allocation-strip {
  height: 8px;
}

.consensus-holder-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.consensus-holder-copy {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.compact-exposure-card {
  padding: 14px;
  gap: 10px;
}

.consensus-compact-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.consensus-weight-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.consensus-weight-item {
  min-width: 0;
  min-height: 34px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 5px;
  border-radius: 999px;
  background: var(--control);
}

.consensus-weight-item .mini-avatar {
  width: 24px;
  height: 24px;
  margin-left: 0;
  border-width: 1px;
  font-size: 10px;
}

.consensus-weight-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #515154;
  font-size: 12px;
  font-weight: 650;
}

.consensus-weight-item strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.portfolio-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.portfolio-stat {
  padding: 14px;
  border-radius: 22px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
  display: grid;
  gap: 4px;
}

.portfolio-stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.portfolio-stat-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.allocation-wrap {
  display: grid;
  gap: 10px;
}

.allocation-strip {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf0f5;
}

.allocation-segment {
  height: 100%;
  min-width: 0;
  transition: width 360ms var(--ease-standard);
}

.portfolio-note {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.allocation-segment.tone-0 {
  background: linear-gradient(90deg, #8fd1ff 0%, #5ac8fa 100%);
}

.allocation-segment.tone-1 {
  background: linear-gradient(90deg, #a9eec0 0%, #6ee59c 100%);
}

.allocation-segment.tone-2 {
  background: linear-gradient(90deg, #ffdca2 0%, #ffc15e 100%);
}

.allocation-segment.tone-3 {
  background: linear-gradient(90deg, #c8c7ff 0%, #a9a7ff 100%);
}

.allocation-segment.tone-4 {
  background: linear-gradient(90deg, #ffb3c8 0%, #ff86a8 100%);
}

.allocation-segment.tone-5 {
  background: linear-gradient(90deg, #b7efff 0%, #84dcff 100%);
}

.legend-chip strong {
  color: var(--ink);
  font-size: 12px;
}

.legend-chip.tone-0 {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.legend-chip.tone-1 {
  background: rgba(52, 199, 89, 0.12);
  color: #1d7d3c;
}

.legend-chip.tone-2 {
  background: rgba(255, 159, 10, 0.14);
  color: #b86c00;
}

.legend-chip.tone-3 {
  background: rgba(94, 92, 230, 0.12);
  color: #4340c7;
}

.legend-chip.tone-4 {
  background: rgba(255, 55, 95, 0.12);
  color: #d92052;
}

.legend-chip.tone-5 {
  background: rgba(100, 210, 255, 0.14);
  color: #0074a6;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 11px;
  background: var(--control);
  color: #515154;
  font-size: 12px;
  white-space: nowrap;
}

.pill.green {
  background: var(--green-soft);
  color: #1d7d3c;
}

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

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

.group-menu {
  display: grid;
  gap: 10px;
}

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

.group-menu-item {
  width: 100%;
  padding: 8px 9px 8px 10px;
  border-radius: 22px;
  border: 1px solid var(--inset-card-border);
  background: var(--inset-card-bg);
  box-shadow: var(--inset-card-shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.group-menu-select {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.group-menu-action {
  justify-self: end;
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  background: #f3f3f7;
}

.group-menu-item.active {
  background: var(--accent-gradient);
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.16);
}

.group-menu-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: start;
}

.group-name-bubble {
  max-width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 12px;
  color: #275f93;
  background: rgba(127, 183, 216, 0.18);
  font-size: 14px;
  font-weight: 740;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-menu-item.active .group-name-bubble {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.group-menu-item.active .group-menu-item-meta {
  color: rgba(255, 255, 255, 0.78);
}

.group-menu-item.active .group-menu-action {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.group-menu-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  padding-left: 4px;
}

.group-menu-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f2f2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.group-menu-status.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
}

.group-manage-card {
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--inset-card-bg);
  border-color: var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.group-manage-name {
  font-size: 17px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.danger-zone {
  gap: 10px;
  padding: 14px;
  border-color: #ffd1cf;
}

.danger-zone .danger-button {
  min-height: 40px;
}

.avatar-stack {
  display: flex;
  align-items: center;
  padding-left: 2px;
}

.mini-avatar {
  width: 30px;
  height: 30px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: linear-gradient(180deg, #1c1c1e 0%, #000000 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.mini-avatar:first-child {
  margin-left: 0;
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-avatar-more {
  background: var(--control-strong);
  color: var(--muted);
}

.value {
  text-align: right;
  font-weight: 760;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.tabbar-float {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(6px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 36px), 420px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 0.5px solid rgba(60, 60, 67, 0.12);
  border-radius: 28px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
}

.tabbar-slider {
  position: absolute;
  top: 6px;
  left: 6px;
  bottom: 6px;
  width: calc((100% - 12px) / 3);
  border-radius: 22px;
  background: var(--accent-gradient);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.32);
  z-index: 0;
}

.tabbar-item {
  position: relative;
  z-index: 1;
  min-height: 48px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  border-radius: 22px;
  transition: color 200ms var(--ease-standard);
}

.tabbar-icon {
  display: grid;
  place-items: center;
}

.tabbar-item.active {
  color: #ffffff;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  background: rgba(245, 246, 248, 0.72);
  padding: calc(52px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
  animation: fade-in 180ms var(--ease-standard);
}

.sheet-panel {
  width: min(100%, 560px);
  max-height: min(82dvh, 760px);
  margin: 0 auto;
  overflow: auto;
  background: #ffffff;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 30px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.14);
  padding: 12px 16px 16px;
  display: grid;
  gap: 14px;
  animation: sheet-in 320ms var(--ease-spring);
  will-change: transform, opacity;
}

.sheet-grabber {
  justify-self: center;
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.18);
}

.sheet-header {
  position: sticky;
  top: -12px;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: -12px -16px 0;
  padding: 14px 16px 12px;
  border-radius: 30px 30px 0 0;
  background: #ffffff;
  border-bottom: 1px solid rgba(229, 229, 234, 0.72);
}

.sheet-header-nav {
  grid-template-columns: auto 1fr auto;
}

.sheet-header-nav .sheet-title {
  text-align: center;
}

.sheet-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.field > span,
.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  padding-left: 4px;
}

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

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  background: var(--control);
  border-radius: var(--radius-md);
}

.segmented button {
  min-height: 42px;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  transition:
    background 180ms var(--ease-standard),
    color 180ms var(--ease-standard),
    box-shadow 180ms var(--ease-standard),
    transform 180ms var(--ease-standard);
}

.segmented button.active {
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.10);
  animation: soft-pop 220ms var(--ease-spring);
}

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

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  box-shadow: none;
}

.import-sync-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--control-strong);
  border-radius: var(--radius-lg);
  background: var(--control);
  color: var(--muted);
  line-height: 1.5;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent-gradient);
}

.timeline-body {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.snapshot-card {
  gap: 10px;
}

.snapshot-feed-list {
  gap: 10px;
}

.snapshot-feed-card {
  position: relative;
  padding: 13px 13px 13px 34px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
}

.snapshot-feed-card::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 26px;
  bottom: 18px;
  width: 2px;
  border-radius: 999px;
  background: #e7edf5;
}

.snapshot-feed-card::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 18px;
  width: 12px;
  height: 12px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #7fb7d8;
  box-shadow: 0 0 0 1px rgba(127, 183, 216, 0.35);
}

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

.snapshot-feed-head {
  gap: 10px;
}

.account-compact {
  grid-template-columns: 36px 1fr;
  gap: 10px;
}

.account-compact .avatar {
  width: 36px;
  height: 36px;
}

.account-compact .mini-avatar {
  width: 36px;
  height: 36px;
  margin-left: 0;
  border-width: 1px;
}

.account-compact .account-name {
  font-size: 15px;
}

.snapshot-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.snapshot-highlight {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 18px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
}

.snapshot-highlight.positive {
  background: var(--inset-card-bg);
  border-color: var(--inset-card-border);
  color: var(--ink);
}

.snapshot-highlight.negative {
  background: var(--inset-card-bg);
  border-color: var(--inset-card-border);
  color: var(--ink);
}

.snapshot-highlight-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.snapshot-highlight-title {
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-highlight-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.snapshot-highlight-value {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.snapshot-highlight-value strong {
  font-size: 15px;
}

.snapshot-highlight-value span {
  font-size: 12px;
  font-weight: 700;
}

.snapshot-change-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(229, 229, 234, 0.72);
  border-radius: 18px;
  background: #ffffff;
}

.compact-change-list {
  gap: 0;
}

.snapshot-change-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.snapshot-change-row + .snapshot-change-row {
  border-top: 1px solid rgba(229, 229, 234, 0.72);
}

.snapshot-change-row:first-child {
  border-top: 0;
}

.snapshot-change-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--control-strong);
  color: var(--muted);
}

.snapshot-change-icon.positive {
  background: rgba(143, 199, 161, 0.18);
  color: #4f8c62;
}

.snapshot-change-icon.negative {
  background: rgba(218, 161, 174, 0.18);
  color: #9c5b69;
}

.snapshot-change-icon .tab-icon {
  width: 16px;
  height: 16px;
  padding: 0;
}

.snapshot-change-symbol {
  display: grid;
  gap: 2px;
}

.snapshot-change-symbol strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-change-symbol span {
  color: var(--muted);
  font-size: 11px;
}

.snapshot-change-values {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.snapshot-change-values strong {
  font-size: 13px;
  font-weight: 760;
}

.snapshot-change-values span {
  font-size: 11px;
  font-weight: 700;
}

.snapshot-empty {
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
  color: var(--muted);
  font-size: 13px;
}

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

.draft-list .list-item {
  background: var(--inset-card-bg);
  border-color: var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
}

.draft-card {
  gap: 14px;
}

.draft-card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.ghost-icon-button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--control);
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background 180ms var(--ease-standard),
    color 180ms var(--ease-standard),
    transform 180ms var(--ease-standard);
}

.ghost-icon-button:hover {
  background: var(--control-strong);
}

.ghost-icon-button.danger-text {
  color: var(--red);
}

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

.draft-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.draft-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.draft-field input,
.draft-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 9px 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
}

.draft-field input:focus,
.draft-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.file-drop {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--inset-card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--inset-card-bg);
  box-shadow: var(--inset-card-shadow);
}

.file-drop-title {
  font-size: 16px;
  font-weight: 720;
}

.file-drop input {
  width: 100%;
}

.import-loading-card {
  padding: 16px;
  border-radius: 20px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
  display: grid;
  gap: 14px;
}

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

.import-orb {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.14);
}

.import-orb::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: import-spin 820ms linear infinite;
}

.import-orb-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-gradient);
  animation: import-pulse 1.4s ease-in-out infinite;
}

.import-loading-title {
  font-size: 15px;
  font-weight: 760;
  display: block;
}

.import-loading-step {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.import-shimmer-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(var(--accent-rgb), 0.14);
}

.import-shimmer-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0) 0%, var(--accent) 50%, rgba(10, 132, 255, 0) 100%);
}

@keyframes import-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.6; }
  50% { transform: scale(1); opacity: 1; }
}

.ai-advice-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 24px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
}

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

.ai-advice-kicker {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.ai-advice-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.ai-advice-card p {
  margin: 0;
  color: #343438;
  line-height: 1.65;
}

.ai-advice-section {
  display: grid;
  gap: 8px;
}

.ai-advice-section-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ai-advice-section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: #343438;
  line-height: 1.55;
}

.advice-disclaimer {
  text-align: center;
}

.import-warning-list {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 159, 10, 0.12);
  color: #8a5600;
  font-size: 12px;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

.toast-layer {
  position: fixed;
  left: 50%;
  top: max(18px, env(safe-area-inset-top));
  z-index: 60;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  min-width: min(88vw, 420px);
  max-width: min(88vw, 460px);
  padding: 14px 18px;
  border-radius: 22px;
  backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.14);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  animation: toast-in 300ms var(--ease-spring);
}

.toast-success {
  background: rgba(28, 28, 30, 0.9);
  color: #ffffff;
}

.toast-error {
  background: rgba(255, 59, 48, 0.94);
  color: #ffffff;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes soft-pop {
  from {
    transform: scale(0.96);
  }
  to {
    transform: scale(1);
  }
}

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

@keyframes import-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 760px) {
  .app-shell {
    max-width: 980px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
  }

  .content {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: start;
  }

  .metric-grid,
  .portfolio-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .content.single {
    grid-template-columns: 1fr;
  }

  .tabbar-float {
    width: min(460px, calc(100% - 36px));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
}

@media (max-width: 420px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 20px;
  }

  .overview-market-row {
    display: grid;
    gap: 8px;
  }

  .overview-heading,
  .member-overview-head {
    grid-template-columns: 1fr;
  }

  .group-menu-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .group-menu-select {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .group-menu-action {
    justify-self: end;
  }

  .group-manage-card {
    grid-template-columns: 1fr;
  }

  .exposure-card .holding-card-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .exposure-card .value-stack {
    justify-items: end;
    text-align: right;
  }

  .exposure-card .holding-primary-value {
    font-size: 20px;
  }

  .member-overview-value {
    font-size: 17px;
  }

  .snapshot-meta {
    justify-items: start;
    text-align: left;
  }

  .snapshot-change-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .snapshot-change-values {
    justify-items: end;
    text-align: right;
  }

  .group-overview-note {
    align-items: start;
  }

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

  .member-select-option {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .member-selector-value,
  .member-select-metrics {
    justify-items: end;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 第三轮迭代新增样式 ===== */

/* 个人资料卡片（可点击进入编辑） */
.profile-card-button {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.profile-card-chevron {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--control);
  color: var(--muted);
}

.profile-bio {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.profile-bio-empty {
  color: var(--muted);
}

.text-link-button {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  color: #ff3b30;
  font-size: 14px;
  font-weight: 640;
  padding: 10px;
}

/* 编辑资料 sheet */
.profile-edit-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 2px 14px;
}

.profile-edit-hero strong {
  display: block;
  font-size: 17px;
  font-weight: 740;
}

.field-hint {
  align-self: flex-end;
  font-size: 11px;
  color: var(--muted);
}

/* 成员 bio 弱化显示 */
.member-selector-bio {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 成员选择 sheet 重设计 */
.member-select-option {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 22px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
  transition:
    border-color 160ms var(--ease-standard),
    background 160ms var(--ease-standard),
    transform 160ms var(--ease-standard);
}

.member-select-option.active {
  color: #ffffff;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(145deg, var(--accent) 0%, var(--accent-card-mid) 52%, var(--accent-card-end) 100%);
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.15);
}

.member-select-option.active .avatar {
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.member-select-option.active .member-select-bio,
.member-select-option.active .member-select-sub,
.member-select-option.active .member-select-metrics span {
  color: rgba(255, 255, 255, 0.70);
}

.member-select-info {
  display: grid;
  gap: 2px;
}

.member-select-name {
  font-size: 15px;
  font-weight: 720;
}

.member-select-bio,
.member-select-sub {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-select-check {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

/* 群组创建/加入卡片 */
.group-form-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border-radius: 24px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
}

.group-form-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.group-form-head strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 740;
}

.group-form-head .subtle {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.25;
}

.group-form-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  color: var(--accent);
  flex: none;
  background: rgba(var(--accent-rgb), 0.10);
  box-shadow: none;
}

.group-form-icon.join {
  color: #34a853;
  background: rgba(52, 168, 83, 0.10);
}

.invite-code-input {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
}

/* AI 健康解读 */
.advice-overview-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
}

.advice-overview-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 760;
}

.advice-overview-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.advice-overview-card .pill {
  justify-self: start;
}

.advice-member-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.advice-member-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
}

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

.advice-member-name {
  display: block;
  font-size: 16px;
  font-weight: 760;
}

.advice-health-label {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 640;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--control);
  color: var(--muted);
}

.advice-health-label.positive {
  background: rgba(52, 199, 89, 0.14);
  color: #1f8f3d;
}

.advice-health-label.negative {
  background: rgba(255, 59, 48, 0.12);
  color: #d12b20;
}

.advice-health-label.neutral {
  background: rgba(255, 149, 0, 0.14);
  color: #c8780a;
}

.advice-score-ring {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 58px;
  padding: 8px 10px;
  border-radius: 16px;
  background: var(--inset-card-bg);
  border: 1px solid var(--inset-card-border);
  box-shadow: var(--inset-card-shadow);
}

.advice-score-ring strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.advice-score-ring span {
  font-size: 10px;
  color: var(--muted);
}

.advice-score-ring.positive strong {
  color: #1f8f3d;
}

.advice-score-ring.negative strong {
  color: #d12b20;
}

.advice-score-ring.neutral strong {
  color: #c8780a;
}

.advice-score-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.16);
  overflow: hidden;
}

.advice-score-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #5ac8fa);
}

.advice-score-fill.positive {
  background: linear-gradient(90deg, #34c759, #30d158);
}

.advice-score-fill.negative {
  background: linear-gradient(90deg, #ff3b30, #ff6961);
}

.advice-score-fill.neutral {
  background: linear-gradient(90deg, #ff9500, #ffcc00);
}

.advice-member-block {
  display: grid;
  gap: 3px;
}

.advice-block-label {
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.advice-member-block p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

/* ---- 骨架屏 ---- */
@keyframes sk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.sk {
  background: linear-gradient(100deg, var(--control) 30%, var(--control-strong) 50%, var(--control) 70%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
  border-radius: 14px;
}
.boot-skeleton {
  display: grid;
  gap: 14px;
  padding: 4px 0 0;
}
.boot-skeleton-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.boot-skeleton .sk-line { height: 18px; }
.boot-skeleton .sk-panel { height: 152px; border-radius: 24px; }
.boot-skeleton-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.boot-skeleton .sk-kpi { height: 62px; border-radius: 16px; }
.boot-skeleton .sk-card { height: 96px; border-radius: 20px; }
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
}

/* ---- Toast 图标 ---- */
.toast {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.toast-icon {
  display: grid;
  place-items: center;
  flex: none;
}

/* ---- 市场分布环形图 ---- */
.overview-market-viz {
  display: flex;
  align-items: center;
  gap: 16px;
}
.overview-market-legend {
  display: grid;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
.overview-market-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.overview-market-legend-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.overview-market-legend-name {
  flex: 1;
  min-width: 0;
  color: var(--ink);
}
.overview-market-legend-item strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---- Sheet 下滑手柄 ---- */
.sheet-grabber {
  cursor: grab;
  touch-action: none;
}
.sheet-grabber:active {
  cursor: grabbing;
}

/* ---- 深色模式（.theme-dark 由主题切换脚本控制；跟随系统时也会加上此类） ---- */
html.theme-dark {
  color-scheme: dark;
  --bg: #000000;
  --panel: #1c1c1e;
  --panel-strong: #2c2c2e;
  --control: #1c1c1e;
  --control-strong: #2c2c2e;
  --surface: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #9a9aa2;
  --line: rgba(255, 255, 255, 0.14);
  /* 石墨中性主题色（仅深色模式；浅色保持原蓝色不变） */
  --accent: #8b95a7;
  --accent-rgb: 139, 149, 167;
  --accent-soft: rgba(139, 149, 167, 0.20);
  --accent-gradient: linear-gradient(135deg, #3a4250 0%, #4b5462 55%, #5c6675 100%);
  --accent-card-mid: #4b5462;
  --accent-card-end: #5c6675;
  --card-bg: rgba(28, 28, 30, 0.92);
  --card-border: rgba(255, 255, 255, 0.09);
  --inset-card-bg:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.06), transparent 34%),
    linear-gradient(145deg, #242427 0%, #1e1e21 56%, #191919 100%);
  --inset-card-border: rgba(255, 255, 255, 0.09);
  --inset-card-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 22px rgba(0, 0, 0, 0.4);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.16);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.theme-dark body,
html.theme-dark.sheet-open body { background: #000000; }
.theme-dark .topbar-float { background: rgba(28, 28, 30, 0.72); }
.theme-dark .tabbar-float { background: rgba(28, 28, 30, 0.74); }
.theme-dark .topbar-pill-button { background: rgba(44, 44, 46, 0.92); }
.theme-dark .topbar-pill-button:hover { background: rgba(58, 58, 60, 0.96); }
.theme-dark .field input,
.theme-dark .field select,
.theme-dark .field textarea,
.theme-dark .draft-field input { background: #1c1c1e; color: var(--ink); }
.theme-dark .field input:focus,
.theme-dark .field select:focus,
.theme-dark .field textarea:focus,
.theme-dark .draft-field input:focus { background: #2c2c2e; }
.theme-dark .field input::placeholder,
.theme-dark .field textarea::placeholder { color: #6c6c72; }
.theme-dark .form-panel { background: rgba(28, 28, 30, 0.9); }
.theme-dark .weight-bar,
.theme-dark .allocation-strip { background: rgba(255, 255, 255, 0.08); }
/* 持仓占比/分布条 + AI 健康分条：亮色渐变在深色下太扎眼，统一压暗降饱和 */
.theme-dark .weight-fill,
.theme-dark .allocation-segment,
.theme-dark .advice-score-fill { filter: brightness(0.66) saturate(0.85); }
.theme-dark .group-menu-action { background: #2c2c2e; }
.theme-dark .group-menu-status { background: #1c1c1e; }
.theme-dark .group-menu-status.active { background: #2c2c2e; }
.theme-dark .sheet-panel,
.theme-dark .sheet-header { background: #1c1c1e; }
.theme-dark .snapshot-feed-card { background: linear-gradient(180deg, #202023 0%, #191919 100%); }
.theme-dark .snapshot-feed-card::before { background: rgba(255, 255, 255, 0.06); }
.theme-dark .snapshot-change-list { background: rgba(255, 255, 255, 0.03); }
.theme-dark .draft-field select { background: #1c1c1e; }
.theme-dark .group-overview-panel,
.theme-dark .member-selector-button {
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(145deg, #363d49 0%, #2c323c 52%, #262a33 100%);
  border-color: rgba(255, 255, 255, 0.12);
}
.theme-dark .group-overview-panel .invite-button { background: rgba(255, 255, 255, 0.22); }
.theme-dark .sheet { background: rgba(0, 0, 0, 0.6); }
