/* Account library — isolated from other modules */

#accountsView .account-library-shell {display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

#accountsView .account-library-form {display: grid;
  gap: 14px;
  padding: 18px 22px 24px;
  overflow-y: auto;
}

#accountsView .alib-form-hint {margin: 0 0 2px;
  font-size: 12px;
  color: var(--text-secondary, #86909c);
}

#accountsView .account-library-main {display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

#accountsView .account-library-list-panel {width: 100%;
  max-width: none;
}

#accountsView .account-library-list-head {display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 24px;
}

#accountsView .account-library-title-row {display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#accountsView .account-library-list-head h2,
#accountsView .account-library-list-head p {margin: 0;
}

#accountsView .account-library-list-head h2 {color: #1d2129;
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
  white-space: nowrap;
}

#accountsView .account-library-list-head p {overflow: hidden;
  color: #9e9e9e;
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#accountsView .account-library-head-actions {display: flex;
  align-items: center;
  gap: 8px;
}

#accountsView .account-library-form > .primary-button {color: #fff;
  background: var(--brand, #8470FF);
  border-color: var(--brand, #8470FF);
}

#accountsView .account-library-form > .primary-button:hover {background: #7360E6;
  border-color: #7360E6;
}

#accountsView .account-item-actions [data-account-detail] {color: #fff;
  background: var(--brand, #8470FF);
  border-color: var(--brand, #8470FF);
}

#accountsView .account-item-actions [data-account-detail]:hover {background: #7360E6;
  border-color: #7360E6;
}

#accountsView .account-item-actions .account-delete-button {
  color: #f53f3f;
  border-color: #ffccc7;
}

#accountsView .account-item-actions .account-delete-button:hover {
  color: #fff;
  background: #f53f3f;
  border-color: #f53f3f;
}

#accountsView .account-library-list-status {
  margin: 0 0 12px;
}

#accountsView .account-library-list-status[data-tone="success"] {
  color: #00b42a;
}

#accountsView .account-library-list-status[data-tone="error"] {
  color: #f53f3f;
}

#accountsView .account-create-backdrop {position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(17, 24, 39, 0.28);
  backdrop-filter: blur(2px);
}

#accountsView .account-create-backdrop[hidden] {display: none;
}

#accountsView .account-create-drawer {position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 71;
  display: flex;
  width: min(460px, 100vw);
  max-width: 100%;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-left: 1px solid var(--line-soft, #e5e6eb);
  box-shadow: -16px 0 40px rgba(17, 24, 39, 0.14);
  transform: translateX(102%);
  transition: transform 0.24s ease;
  visibility: hidden;
}

#accountsView .account-create-drawer.is-open {transform: translateX(0);
  visibility: visible;
}

#accountsView .account-create-drawer-head {position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 18px 38px;
  border-bottom: 1px solid var(--line-soft, #e5e6eb);
}

#accountsView .account-create-drawer-head::before {position: absolute;
  top: 24px;
  bottom: 20px;
  left: 22px;
  width: 4px;
  background: var(--brand, #8470FF);
  border-radius: 999px;
  content: "";
}

#accountsView .account-create-drawer-head h2,
#accountsView .account-create-drawer-head p {margin: 0;
  color: var(--text, #1d2129);
}

#accountsView .account-create-drawer-head h2 {font-size: 18px;
  line-height: 26px;
}

#accountsView .account-create-drawer-head p {margin-top: 3px;
  font-size: 12px;
  line-height: 18px;
}

#accountsView .account-create-drawer-close {display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--text, #1d2129);
  background: #fff;
  border: 1px solid var(--line-soft, #e5e6eb);
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

#accountsView .account-create-drawer-close:hover {background: var(--prediction-primary-soft, #f8f7ff);
  border-color: var(--prediction-primary-border, #ebe8ff);
}

body.account-create-drawer-open {overflow: hidden;
}

#accountsView .account-sync-progress {margin-top: 12px;
}

#accountsView .account-sync-progress.is-hidden {display: none;
}

#accountsView .account-sync-progress-bar {height: 8px;
  border-radius: 999px;
  background: #f2f3f5;
  border: 1px solid var(--border-soft, #e5e6eb);
  overflow: hidden;
}

#accountsView .account-sync-progress-bar i {display: block;
  height: 100%;
  width: 0;
  background: var(--brand, #8470FF);
  transition: width 0.35s ease;
}

#accountsView .account-max-items-wrap.is-hidden {display: none;
}

#accountsView .account-item.is-clickable {cursor: pointer;
}

#accountsView .account-item.is-clickable:hover {border-color: var(--brand, #8470FF);
}

#accountsView .account-library-list-status {margin-top: 12px;
}

#accountsView .account-library-list-status[data-tone="success"] {color: #00b42a;
}

#accountsView .account-library-list-status[data-tone="error"] {color: #f53f3f;
}

@media (max-width: 760px) {#accountsView .account-library-list-head {align-items: stretch;
    flex-direction: column;
  }

  #accountsView .account-library-title-row {flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #accountsView .account-library-head-actions {width: 100%;
  }
  }

  #accountsView .account-library-head-actions button {flex: 1;
  }

  #accountsView .account-create-drawer {width: 100vw;
  }
}

/* —— 独立看板页 —— */

body.account-dashboard-view .workspace-header,
body.account-compare-view .workspace-header {min-height: auto;
  margin-bottom: 24px;
  padding-left: 0;
}

body.account-dashboard-view .workspace-header h1,
body.account-compare-view .workspace-header h1 {font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

#accountDashboardView .account-dashboard-toolbar,
#accountCompareView .account-dashboard-toolbar {margin: 0 0 28px;
}

#accountDashboardView .account-dashboard-page,
#accountCompareView .account-dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: none;
}

#accountCompareView .account-dashboard-page {
  min-height: calc(100vh - 120px);
}

#accountDashboardView .account-info-card,
#accountCompareView .account-info-card {padding: 16px 20px 20px;
  margin-bottom: 16px;
}

#accountDashboardView .account-info-card-label,
#accountCompareView .account-info-card-label {margin: 0 0 14px;
  font-size: 12px;
  line-height: 1;
  color: var(--text-3, #86909c);
}

#accountDashboardView .account-info-card-main,
#accountCompareView .account-info-card-main {display: flex;
  align-items: flex-start;
  gap: 16px;
}

#accountDashboardView .account-info-copy,
#accountCompareView .account-info-copy {flex: 1;
  min-width: 0;
}

#accountDashboardView .account-info-title-row,
#accountCompareView .account-info-title-row {display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}

#accountDashboardView .account-info-title-row h2, #accountCompareView .account-info-title-row h2 {margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

#accountDashboardView .account-info-sync,
#accountCompareView .account-info-sync {font-size: 12px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .account-info-platform-icon,
#accountCompareView .account-info-platform-icon {display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 0;
  vertical-align: middle;
}

#accountDashboardView .account-info-platform-icon svg,
#accountCompareView .account-info-platform-icon svg {display: block;
  width: 100%;
  height: 100%;
}

#accountDashboardView .account-info-stats,
#accountCompareView .account-info-stats {display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-2, #4e5969);
}

#accountDashboardView .account-info-bio,
#accountCompareView .account-info-bio {margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3, #86909c);
}

#accountDashboardView .account-info-actions,
#accountCompareView .account-info-actions {display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

@media (max-width: 960px) {#accountDashboardView .account-info-card-main,
#accountCompareView .account-info-card-main {flex-wrap: wrap;
  }

  #accountDashboardView .account-info-actions,
#accountCompareView .account-info-actions {width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

body.account-dashboard-view .workspace,
body.account-compare-view .workspace {padding: 8px 12px 24px;
}

body.account-dashboard-view .work-grid, body.account-compare-view .work-grid, body.account-dashboard-view .main-column,
body.account-compare-view .main-column {width: 100%;
  max-width: none;
}

body.account-dashboard-view #accountDashboardView,
body.account-compare-view #accountCompareView {width: 100%;
  max-width: none;
}

body.account-dashboard-view #accountDashboardView .panel-card, body.account-dashboard-view #accountDashboardView .account-info-card, body.account-compare-view #accountCompareView .panel-card,
body.account-compare-view #accountCompareView .account-info-card {width: 100%;
  max-width: none;
  box-sizing: border-box;
}

body.account-dashboard-view.input-page-view, body.account-compare-view.input-page-view, body.account-dashboard-view,
body.account-compare-view {overflow: auto;
}

body.account-dashboard-view.input-page-view .main-column, body.account-compare-view.input-page-view .main-column, body.account-dashboard-view .main-column,
body.account-compare-view .main-column {justify-content: flex-start;
  min-height: auto;
  overflow: visible;
  align-items: stretch;
}

#accountDashboardView .account-dashboard-body,
#accountCompareView .account-dashboard-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

#accountCompareView .account-dashboard-body {
  flex: 1;
  min-height: 480px;
}

#accountDashboardView .alib-dash,
#accountCompareView .alib-dash {display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  padding-bottom: 24px;
}

#accountDashboardView .alib-section,
#accountCompareView .alib-section {display: flex;
  flex-direction: column;
  gap: 12px;
}

#accountDashboardView .alib-section-head,
#accountCompareView .alib-section-head {display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#accountDashboardView .alib-section-head h3, #accountCompareView .alib-section-head h3 {margin: 0;
  font-size: 16px;
  font-weight: 600;
}

#accountDashboardView .alib-section-head span, #accountCompareView .alib-section-head span {font-size: 12px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-profile-hero,
#accountCompareView .alib-profile-hero {display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px;
}

#accountDashboardView .alib-profile-copy,
#accountCompareView .alib-profile-copy {flex: 1;
  min-width: 0;
}

#accountDashboardView .alib-profile-title-row,
#accountCompareView .alib-profile-title-row {display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

#accountDashboardView .alib-profile-title-row h3, #accountCompareView .alib-profile-title-row h3 {margin: 0;
  font-size: 22px;
}

#accountDashboardView .alib-platform-badge,
#accountCompareView .alib-platform-badge {display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--launch-primary-soft, #f8f7ff);
  color: var(--launch-primary, #8470FF);
  font-size: 12px;
  font-weight: 500;
}

#accountDashboardView .alib-profile-stats,
#accountCompareView .alib-profile-stats {display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-2, #4e5969);
}

#accountDashboardView .alib-profile-bio,
#accountCompareView .alib-profile-bio,
#accountDashboardView .alib-profile-sync,
#accountCompareView .alib-profile-sync {margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2, #4e5969);
}

#accountDashboardView .alib-profile-sync,
#accountCompareView .alib-profile-sync {font-size: 12px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-kpi-row,
#accountCompareView .alib-kpi-row {display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

#accountDashboardView .alib-kpi-card,
#accountCompareView .alib-kpi-card {background: #fff;
  border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 92px;
}

#accountDashboardView .alib-kpi-label,
#accountCompareView .alib-kpi-label {display: block;
  font-size: 12px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-kpi-value-row,
#accountCompareView .alib-kpi-value-row {display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}

#accountDashboardView .alib-kpi-value,
#accountCompareView .alib-kpi-value {font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
}

#accountDashboardView .alib-kpi-trend,
#accountCompareView .alib-kpi-trend {display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

#accountDashboardView .alib-kpi-trend.is-up,
#accountCompareView .alib-kpi-trend.is-up {color: #00b42a;
}

#accountDashboardView .alib-kpi-trend.is-down,
#accountCompareView .alib-kpi-trend.is-down {color: #f53f3f;
}

#accountDashboardView .alib-kpi-trend.is-flat,
#accountCompareView .alib-kpi-trend.is-flat {color: var(--text-3, #86909c);
}

#accountDashboardView .alib-kpi-trend-arrow,
#accountCompareView .alib-kpi-trend-arrow {font-size: 13px;
  line-height: 1;
}

#accountDashboardView .alib-card h4, #accountCompareView .alib-card h4 {margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}

#accountDashboardView .alib-chart-card,
#accountCompareView .alib-chart-card {min-height: 260px;
}

#accountDashboardView .alib-section-portrait,
#accountCompareView .alib-section-portrait {gap: 0;
}

#accountDashboardView .alib-portrait-content-board.alib-card,
#accountCompareView .alib-portrait-content-board.alib-card {background: #f7f8fa;
  border: 1px solid var(--border-soft, #e5e6eb);
  padding: 16px 16px 18px;
}

#accountDashboardView .alib-portrait-content-title,
#accountCompareView .alib-portrait-content-title {margin: 0 0 12px;
  padding: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text, #1d2129);
  border-bottom: none;
}

#accountDashboardView .alib-portrait-content-grid,
#accountCompareView .alib-portrait-content-grid {display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 12px;
  background: transparent;
}

#accountDashboardView .alib-xhs-content-grid,
#accountCompareView .alib-xhs-content-grid {grid-template-rows: auto;
}

#accountDashboardView .alib-sync-notice,
#accountCompareView .alib-sync-notice {padding: 12px 16px;
  color: #4e5969;
  background: #f7f8fa;
  border: 1px solid #e5e6eb;
  font-size: 13px;
  line-height: 1.5;
}

#accountDashboardView .alib-portrait-stack-col,
#accountCompareView .alib-portrait-stack-col {grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  background: transparent;
}

#accountDashboardView .alib-portrait-stack-col .alib-insight-panel, #accountCompareView .alib-portrait-stack-col .alib-insight-panel {flex: 0 0 auto;
}

#accountDashboardView .alib-insight-panel,
#accountCompareView .alib-insight-panel {min-height: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#accountDashboardView .alib-insight-panel.is-category,
#accountCompareView .alib-insight-panel.is-category {grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#accountDashboardView .alib-insight-panel.is-gender,
#accountCompareView .alib-insight-panel.is-gender,
#accountDashboardView .alib-insight-panel.is-form,
#accountCompareView .alib-insight-panel.is-form {grid-column: auto;
  grid-row: auto;
}

#accountDashboardView .alib-insight-panel.is-city,
#accountCompareView .alib-insight-panel.is-city {grid-column: 1;
  grid-row: 2;
}

#accountDashboardView .alib-insight-panel.is-age,
#accountCompareView .alib-insight-panel.is-age {grid-column: 2;
  grid-row: 2;
}

#accountDashboardView .alib-insight-panel-head,
#accountCompareView .alib-insight-panel-head {margin: 0 0 14px;
  line-height: 1.55;
}

#accountDashboardView .alib-insight-panel-head h4, #accountCompareView .alib-insight-panel-head h4 {margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1d2129);
}

#accountDashboardView .alib-insight-summary,
#accountCompareView .alib-insight-summary {margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-insight-body,
#accountCompareView .alib-insight-body {min-height: 0;
}

#accountDashboardView .alib-insight-panel.is-category .alib-insight-body, #accountCompareView .alib-insight-panel.is-category .alib-insight-body {flex: 1;
  display: flex;
  align-items: center;
  min-height: 180px;
}

#accountDashboardView .alib-insight-panel.is-category .alib-donut.is-lg, #accountCompareView .alib-insight-panel.is-category .alib-donut.is-lg {width: 100%;
}

#accountDashboardView .alib-city-chart,
#accountCompareView .alib-city-chart {position: relative;
}

#accountDashboardView .alib-city-chart-body,
#accountCompareView .alib-city-chart-body {position: relative;
  padding-bottom: 8px;
}

#accountDashboardView .alib-city-chart-grid,
#accountCompareView .alib-city-chart-grid {position: absolute;
  inset: 0 0 0 56px;
  pointer-events: none;
}

#accountDashboardView .alib-city-chart-grid i, #accountCompareView .alib-city-chart-grid i {position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed #e5e6eb;
}

#accountDashboardView .alib-city-bar-row,
#accountCompareView .alib-city-bar-row {display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
}

#accountDashboardView .alib-city-bar-row:last-child,
#accountCompareView .alib-city-bar-row:last-child {margin-bottom: 0;
}

#accountDashboardView .alib-city-bar-label,
#accountCompareView .alib-city-bar-label {color: var(--text-2, #4e5969);
  text-align: right;
  padding-right: 4px;
}

#accountDashboardView .alib-city-bar-area,
#accountCompareView .alib-city-bar-area {position: relative;
  height: 18px;
}

#accountDashboardView .alib-city-bar-track,
#accountCompareView .alib-city-bar-track {position: relative;
  height: 100%;
  min-width: 8px;
}

#accountDashboardView .alib-city-bar-fill,
#accountCompareView .alib-city-bar-fill {display: block;
  width: 100%;
  height: 100%;
  min-width: 8px;
  background: var(--launch-primary, #8470FF);
  border-radius: 999px;
}

#accountDashboardView .alib-city-bar-value,
#accountCompareView .alib-city-bar-value {position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-city-chart-bars,
#accountCompareView .alib-city-chart-bars {padding-right: 72px;
}

#accountDashboardView .alib-city-chart-axis,
#accountCompareView .alib-city-chart-axis {display: flex;
  justify-content: space-between;
  margin: 8px 72px 0 56px;
  padding-top: 8px;
  border-top: 1px solid #e5e6eb;
  font-size: 11px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-age-capsule,
#accountCompareView .alib-age-capsule {display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f8fa;
  border: 1px solid #eef0f3;
}

#accountDashboardView .alib-age-capsule:last-child,
#accountCompareView .alib-age-capsule:last-child {margin-bottom: 0;
}

#accountDashboardView .alib-age-capsule-label,
#accountCompareView .alib-age-capsule-label {flex-shrink: 0;
  font-size: 13px;
  color: var(--text-2, #4e5969);
}

#accountDashboardView .alib-age-capsule-right,
#accountCompareView .alib-age-capsule-right {display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
}

#accountDashboardView .alib-age-capsule-value,
#accountCompareView .alib-age-capsule-value {flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1d2129);
}

#accountDashboardView .alib-age-capsule-track,
#accountCompareView .alib-age-capsule-track {width: min(168px, 42%);
  height: 10px;
  background: #eceef2;
  border-radius: 999px;
  overflow: hidden;
}

#accountDashboardView .alib-age-capsule-track i, #accountCompareView .alib-age-capsule-track i {display: block;
  height: 100%;
  background: var(--launch-primary, #8470FF);
  border-radius: 999px;
}

#accountDashboardView .alib-donut,
#accountCompareView .alib-donut {display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

#accountDashboardView .alib-donut.is-sm,
#accountCompareView .alib-donut.is-sm {grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
}

#accountDashboardView .alib-donut.is-lg,
#accountCompareView .alib-donut.is-lg {grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

#accountDashboardView .alib-donut-chart,
#accountCompareView .alib-donut-chart {width: 120px;
  height: 120px;
}

#accountDashboardView .alib-donut.is-sm .alib-donut-chart, #accountCompareView .alib-donut.is-sm .alib-donut-chart {width: 88px;
  height: 88px;
}

#accountDashboardView .alib-donut.is-lg .alib-donut-chart, #accountCompareView .alib-donut.is-lg .alib-donut-chart {width: 140px;
  height: 140px;
}

#accountDashboardView .alib-donut-chart svg, #accountCompareView .alib-donut-chart svg {width: 100%;
  height: 100%;
}

#accountDashboardView .alib-donut-legend,
#accountCompareView .alib-donut-legend {display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

#accountDashboardView .alib-donut-legend.is-boxed,
#accountCompareView .alib-donut-legend.is-boxed {min-width: 0;
}

#accountDashboardView .alib-donut-legend-box,
#accountCompareView .alib-donut-legend-box {border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

#accountDashboardView .alib-donut-legend-box .alib-donut-legend-item, #accountCompareView .alib-donut-legend-box .alib-donut-legend-item {padding: 11px 12px;
}

#accountDashboardView .alib-donut-legend-box .alib-donut-legend-item + .alib-donut-legend-item, #accountCompareView .alib-donut-legend-box .alib-donut-legend-item + .alib-donut-legend-item {border-top: 1px solid #f0f1f3;
}

#accountDashboardView .alib-donut-legend-item,
#accountCompareView .alib-donut-legend-item {display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-2, #4e5969);
}

#accountDashboardView .alib-donut-swatch,
#accountCompareView .alib-donut-swatch {width: 10px;
  height: 10px;
  border-radius: 3px;
}

#accountDashboardView .alib-donut-legend-value,
#accountCompareView .alib-donut-legend-value {color: var(--text, #1d2129);
  white-space: nowrap;
  font-weight: 500;
}

#accountDashboardView .alib-insight-panel.is-category .alib-donut-legend, #accountCompareView .alib-insight-panel.is-category .alib-donut-legend {gap: 10px;
}

#accountDashboardView .alib-bar-value,
#accountCompareView .alib-bar-value {width: 48px;
  flex-shrink: 0;
  text-align: right;
  font-size: 12px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-grid-works,
#accountCompareView .alib-grid-works {align-items: start;
}

#accountDashboardView .alib-works-keywords-col,
#accountCompareView .alib-works-keywords-col {display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

#accountDashboardView .alib-keywords-table-card,
#accountCompareView .alib-keywords-table-card,
#accountDashboardView .alib-works-table-card,
#accountCompareView .alib-works-table-card {padding: 0;
  overflow: hidden;
  background: #fff;
}

#accountDashboardView .alib-keywords-table-scroll,
#accountCompareView .alib-keywords-table-scroll,
#accountDashboardView .alib-works-table-scroll,
#accountCompareView .alib-works-table-scroll {overflow-x: auto;
  background: #fff;
}

#accountDashboardView .alib-keywords-table-card .alib-keywords-table thead th, #accountCompareView .alib-keywords-table-card .alib-keywords-table thead th,
#accountDashboardView .alib-works-table thead th, #accountCompareView .alib-works-table thead th {padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2, #4e5969);
  background: #f7f8fa;
  border-bottom: 1px solid var(--border-soft, #e5e6eb);
}

#accountDashboardView .alib-keywords-table-card .alib-keywords-table tbody td, #accountCompareView .alib-keywords-table-card .alib-keywords-table tbody td,
#accountDashboardView .alib-works-table tbody td, #accountCompareView .alib-works-table tbody td {padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft, #e5e6eb);
  vertical-align: middle;
}

#accountDashboardView .alib-works-table tbody tr, #accountCompareView .alib-works-table tbody tr,
#accountDashboardView .alib-keywords-table tbody tr, #accountCompareView .alib-keywords-table tbody tr {height: 84px;
}

#accountDashboardView .alib-keywords-table tbody td.is-rank, #accountCompareView .alib-keywords-table tbody td.is-rank {width: 72px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-keywords-table tbody td.is-num, #accountCompareView .alib-keywords-table tbody td.is-num,
#accountDashboardView .alib-works-table tbody td.is-num, #accountCompareView .alib-works-table tbody td.is-num {text-align: right;
  color: var(--text, #1d2129);
  white-space: nowrap;
}

#accountDashboardView .alib-keywords-table thead th:last-child, #accountCompareView .alib-keywords-table thead th:last-child,
#accountDashboardView .alib-works-table thead th:not(:first-child), #accountCompareView .alib-works-table thead th:not(:first-child) {width: 110px;
  text-align: right;
}

#accountDashboardView .alib-works-table,
#accountCompareView .alib-works-table {width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#accountDashboardView .alib-works-table thead th, #accountCompareView .alib-works-table thead th {text-align: left;
}

#accountDashboardView .alib-works-table thead th:not(:first-child), #accountCompareView .alib-works-table thead th:not(:first-child) {width: 110px;
  text-align: right;
}

#accountDashboardView .alib-works-title-wrap,
#accountCompareView .alib-works-title-wrap {display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#accountDashboardView .alib-work-thumb,
#accountCompareView .alib-work-thumb {width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #f2f3f5 center / cover no-repeat;
  overflow: hidden;
}

#accountDashboardView .alib-work-thumb img, #accountCompareView .alib-work-thumb img {width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#accountDashboardView .alib-works-title,
#accountCompareView .alib-works-title {margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text, #1d2129);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#accountDashboardView .alib-table-pagination,
#accountCompareView .alib-table-pagination {display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft, #e5e6eb);
  flex-wrap: wrap;
  flex-shrink: 0;
  background: #fff;
}

#accountDashboardView .alib-table-pagination-nav,
#accountCompareView .alib-table-pagination-nav {display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#accountDashboardView .alib-table-page-btn,
#accountCompareView .alib-table-page-btn {min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 6px;
  background: #fff;
  color: var(--text-2, #4e5969);
  font-size: 12px;
  cursor: pointer;
}

#accountDashboardView .alib-table-page-btn.is-active,
#accountCompareView .alib-table-page-btn.is-active {border-color: var(--launch-primary, #8470FF);
  color: var(--launch-primary, #8470FF);
  background: #fff;
}

#accountDashboardView .alib-table-page-btn:disabled,
#accountCompareView .alib-table-page-btn:disabled {opacity: 0.45;
  cursor: not-allowed;
}

#accountDashboardView .alib-table-page-ellipsis,
#accountCompareView .alib-table-page-ellipsis {padding: 0 4px;
  color: var(--text-3, #86909c);
  font-size: 12px;
}

#accountDashboardView .alib-table-pagination-meta,
#accountCompareView .alib-table-pagination-meta {display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-table-page-jump,
#accountCompareView .alib-table-page-jump {display: inline-flex;
  align-items: center;
  gap: 6px;
}

#accountDashboardView .alib-table-page-jump input, #accountCompareView .alib-table-page-jump input {width: 44px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  background: #fff;
}

#accountDashboardView .alib-work-stats,
#accountCompareView .alib-work-stats {margin-top: 6px;
  color: var(--text-3, #86909c);
}

#accountDashboardView .alib-avatar,
#accountCompareView .alib-avatar {width: 72px;
  height: 72px;
}

@media (max-width: 1200px) {#accountDashboardView .alib-kpi-row,
#accountCompareView .alib-kpi-row {grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {#accountDashboardView .alib-portrait-content-grid,
#accountCompareView .alib-portrait-content-grid {grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  #accountDashboardView .alib-portrait-stack-col,
#accountCompareView .alib-portrait-stack-col {grid-column: 1;
    grid-row: 1;
  }

  #accountDashboardView .alib-insight-panel.is-category,
#accountCompareView .alib-insight-panel.is-category {grid-column: 2;
    grid-row: 1;
    display: flex;
  }

  #accountDashboardView .alib-insight-panel.is-city,
#accountCompareView .alib-insight-panel.is-city {grid-column: 1;
    grid-row: 2;
  }

  #accountDashboardView .alib-insight-panel.is-age,
#accountCompareView .alib-insight-panel.is-age {grid-column: 2;
    grid-row: 2;
  }

  #accountDashboardView .alib-insight-panel.is-category .alib-insight-body,
  #accountCompareView .alib-insight-panel.is-category .alib-insight-body {
    display: flex;
    min-height: 220px;
  }
}

@media (max-width: 960px) {#accountDashboardView .alib-portrait-content-grid,
#accountCompareView .alib-portrait-content-grid {grid-template-columns: 1fr;
  }

  #accountDashboardView .alib-portrait-stack-col,
#accountCompareView .alib-portrait-stack-col,
#accountDashboardView .alib-insight-panel.is-category,
#accountCompareView .alib-insight-panel.is-category,
#accountDashboardView .alib-insight-panel.is-city,
#accountCompareView .alib-insight-panel.is-city,
#accountDashboardView .alib-insight-panel.is-age,
#accountCompareView .alib-insight-panel.is-age {grid-column: 1;
    grid-row: auto;
  }

  #accountDashboardView .alib-grid-2,
#accountCompareView .alib-grid-2,
#accountDashboardView .alib-grid-3,
#accountCompareView .alib-grid-3 {grid-template-columns: 1fr;
  }

  #accountDashboardView .alib-kpi-row,
#accountCompareView .alib-kpi-row {grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #accountDashboardView .alib-donut,
#accountCompareView .alib-donut,
#accountDashboardView .alib-donut.is-sm,
#accountCompareView .alib-donut.is-sm,
#accountDashboardView .alib-donut.is-lg,
#accountCompareView .alib-donut.is-lg {grid-template-columns: 1fr;
    justify-items: center;
  }

  #accountDashboardView .alib-donut-legend,
#accountCompareView .alib-donut-legend {width: 100%;
  }
}

#accountDashboardView .alib-tabs,
#accountCompareView .alib-tabs {display: none;
}

#accountDashboardView .alib-grid,
#accountCompareView .alib-grid {display: grid;
  gap: 16px;
}

#accountDashboardView .alib-grid-2,
#accountCompareView .alib-grid-2 {grid-template-columns: repeat(2, minmax(0, 1fr));
}

#accountDashboardView .alib-grid-1,
#accountCompareView .alib-grid-1 {grid-template-columns: minmax(0, 1fr);
}

#accountDashboardView .alib-grid-3,
#accountCompareView .alib-grid-3 {grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 960px) {#accountDashboardView .alib-grid-2,
#accountCompareView .alib-grid-2,
#accountDashboardView .alib-grid-3,
#accountCompareView .alib-grid-3 {grid-template-columns: 1fr;
  }
}

#accountDashboardView .alib-card,
#accountCompareView .alib-card {background: #fff;
  border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 12px;
  padding: 16px;
}

#accountDashboardView .alib-card h3, #accountCompareView .alib-card h3 {margin: 0 0 12px;
  font-size: 15px;
}

#accountDashboardView .alib-metric-grid,
#accountCompareView .alib-metric-grid {display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#accountDashboardView .alib-metric,
#accountCompareView .alib-metric {border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

#accountDashboardView .alib-metric span, #accountCompareView .alib-metric span {font-size: 12px;
  color: var(--text-secondary, #86909c);
}

#accountDashboardView .alib-metric-note,
#accountCompareView .alib-metric-note {display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary, #86909c);
}

#accountDashboardView .alib-metric strong, #accountCompareView .alib-metric strong {display: block;
  font-size: 18px;
  margin-top: 4px;
}

#accountDashboardView .alib-metric span, #accountCompareView .alib-metric span {font-size: 12px;
  color: var(--text-secondary, #86909c);
}

#accountDashboardView .alib-delta-up,
#accountCompareView .alib-delta-up {color: #00b42a;
  font-size: 12px;
}

#accountDashboardView .alib-delta-down,
#accountCompareView .alib-delta-down {color: #f53f3f;
  font-size: 12px;
}

#accountDashboardView .alib-trend-chart,
#accountCompareView .alib-trend-chart {display: flex;
  flex-direction: column;
  gap: 8px;
}

#accountDashboardView .alib-chart-body,
#accountCompareView .alib-chart-body {display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

#accountDashboardView .alib-chart-y-axis,
#accountCompareView .alib-chart-y-axis {position: relative;
  height: 220px;
  font-size: 11px;
  line-height: 1;
  color: #86909c;
}

#accountDashboardView .alib-chart-y-label,
#accountCompareView .alib-chart-y-label {position: absolute;
  left: 0;
  transform: translateY(50%);
  white-space: nowrap;
}

#accountDashboardView .alib-chart-main,
#accountCompareView .alib-chart-main {min-width: 0;
}

#accountDashboardView .alib-chart-wrap,
#accountCompareView .alib-chart-wrap {position: relative;
  height: 220px;
  border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

#accountDashboardView .alib-chart-wrap svg, #accountCompareView .alib-chart-wrap svg {width: 100%;
  height: 100%;
}

#accountDashboardView .alib-chart-axis,
#accountCompareView .alib-chart-axis {position: relative;
  height: 18px;
  font-size: 11px;
  color: #86909c;
}

#accountDashboardView .alib-chart-axis-label,
#accountCompareView .alib-chart-axis-label {position: absolute;
  top: 0;
  white-space: nowrap;
}

#accountDashboardView .alib-chart-axis-label.is-start,
#accountCompareView .alib-chart-axis-label.is-start {transform: translateX(0);
}

#accountDashboardView .alib-chart-axis-label.is-center,
#accountCompareView .alib-chart-axis-label.is-center {transform: translateX(-50%);
}

#accountDashboardView .alib-chart-axis-label.is-end,
#accountCompareView .alib-chart-axis-label.is-end {transform: translateX(-100%);
}

#accountDashboardView .alib-bar-row,
#accountCompareView .alib-bar-row {display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

#accountDashboardView .alib-bar-label,
#accountCompareView .alib-bar-label {width: 72px;
  flex-shrink: 0;
}

#accountDashboardView .alib-bar-track,
#accountCompareView .alib-bar-track {flex: 1;
  height: 8px;
  background: #f2f3f5;
  border-radius: 999px;
  overflow: hidden;
}

#accountDashboardView .alib-bar-fill,
#accountCompareView .alib-bar-fill {height: 100%;
  background: var(--brand, #8470FF);
  border-radius: 999px;
}

#accountDashboardView .alib-works-grid,
#accountCompareView .alib-works-grid {display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

#accountDashboardView .alib-work-card,
#accountCompareView .alib-work-card {border: 1px solid var(--border-soft, #e5e6eb);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

#accountDashboardView .alib-work-cover,
#accountCompareView .alib-work-cover {aspect-ratio: 3 / 4;
  background: #f7f8fa center / cover no-repeat;
}

#accountDashboardView .alib-work-body,
#accountCompareView .alib-work-body {padding: 10px;
  font-size: 12px;
}

#accountDashboardView .alib-work-body strong, #accountCompareView .alib-work-body strong {display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
}

#accountDashboardView .alib-table,
#accountCompareView .alib-table {width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#accountDashboardView .alib-table th, #accountCompareView .alib-table th,
#accountDashboardView .alib-table td, #accountCompareView .alib-table td {border-bottom: 1px solid var(--border-soft, #e5e6eb);
  padding: 8px 6px;
  text-align: left;
}

#accountDashboardView .alib-profile-card,
#accountCompareView .alib-profile-card {display: flex;
  gap: 14px;
  align-items: center;
}

#accountDashboardView .alib-avatar,
#accountCompareView .alib-avatar {width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f2f3f5 center / cover no-repeat;
  border: 1px solid var(--border-soft, #e5e6eb);
  flex-shrink: 0;
  overflow: hidden;
}

#accountDashboardView .alib-avatar img, #accountCompareView .alib-avatar img {width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#accountDashboardView .alib-highlight,
#accountCompareView .alib-highlight {background: var(--accent-soft, #f8f7ff);
  border: 1px solid #ebe8ff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
}

.account-sync-dialog{border: none;
  padding: 0;
  background: transparent;
  max-width: min(520px, calc(100vw - 32px));
}

.account-sync-dialog::backdrop{background: rgba(15, 23, 42, 0.35);
}

.account-sync-card{margin: 0;
  width: 100%;
}

.account-sync-dialog-head{display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.account-sync-dialog-head h2{margin: 0 0 6px;
  font-size: 18px;
}

.account-sync-dialog-head p{margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #86909c);
}

.account-sync-dialog-actions{display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.account-delete-dialog{border: none;
  padding: 0;
  background: transparent;
  max-width: min(440px, calc(100vw - 32px));
}

.account-delete-dialog::backdrop{background: rgba(15, 23, 42, 0.35);
}

.account-delete-card{margin: 0;
  width: 100%;
}

.account-delete-dialog-head{display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-delete-dialog-head h2{margin: 0 0 8px;
  font-size: 18px;
  color: #1d2129;
}

.account-delete-dialog-head p{margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, #86909c);
}

.account-delete-dialog-actions{display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.account-delete-confirm{background: #f53f3f;
  border-color: #f53f3f;
}

.account-delete-confirm:hover{background: #e03535;
  border-color: #e03535;
}

#accountDashboardView .link-button,
#accountCompareView .link-button {border: 0;
  background: none;
  color: var(--brand, #8470FF);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

#accountDashboardView .alib-compare-tabs,
#accountCompareView .alib-compare-tabs {display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

#accountDashboardView .alib-compare-tab,
#accountCompareView .alib-compare-tab {border: 1px solid var(--border-soft, #e5e6eb);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

#accountDashboardView .alib-compare-tab.is-active,
#accountCompareView .alib-compare-tab.is-active {background: var(--brand, #8470FF);
  border-color: var(--brand, #8470FF);
  color: #fff;
}

#accountDashboardView .alib-compare-kpi-row,
#accountCompareView .alib-compare-kpi-row,
#accountDashboardView .alib-compare-subgrid,
#accountCompareView .alib-compare-subgrid {display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

#accountDashboardView .alib-compare-card.is-insufficient,
#accountCompareView .alib-compare-card.is-insufficient {background: #fafafa;
}

#accountDashboardView .alib-compare-reason,
#accountCompareView .alib-compare-reason {margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #86909c);
}

#accountDashboardView .alib-compare-pct,
#accountCompareView .alib-compare-pct {margin-left: 6px;
  font-size: 12px;
  color: var(--text-secondary, #86909c);
}

#accountDashboardView .alib-compare-zhiyun,
#accountCompareView .alib-compare-zhiyun {margin: 12px 0 16px;
  padding: 12px;
  border-radius: 12px;
  background: #f8f7ff;
}

#accountDashboardView .alib-compare-hint,
#accountCompareView .alib-compare-hint {margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-secondary, #86909c);
}

#accountDashboardView .alib-compare-hint.is-warn,
#accountCompareView .alib-compare-hint.is-warn {color: #d4820a;
}

#accountDashboardView .alib-compare-card.is-zhiyun,
#accountCompareView .alib-compare-card.is-zhiyun {background: #fff;
}

#accountDashboardView .alib-sync-status,
#accountCompareView .alib-sync-status {display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

#accountDashboardView .alib-sync-status.is-ok,
#accountCompareView .alib-sync-status.is-ok {background: #e8ffea;
  color: #009a29;
}

#accountDashboardView .alib-sync-status.is-partial,
#accountCompareView .alib-sync-status.is-partial {background: #fff7e8;
  color: #d25f00;
}

#accountDashboardView .alib-sync-status.is-failed,
#accountCompareView .alib-sync-status.is-failed {background: #ffece8;
  color: #cb2634;
}

#accountDashboardView .alib-sync-history-scroll,
#accountCompareView .alib-sync-history-scroll {overflow-x: auto;
}

#accountDashboardView .alib-sync-error summary, #accountCompareView .alib-sync-error summary {cursor: pointer;
  color: var(--brand, #8470FF);
}

#accountDashboardView .alib-sync-error p, #accountCompareView .alib-sync-error p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #86909c);
  white-space: pre-wrap;
}

/* Account library card grid */
#accountsView .sr-only {position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#accountsView .account-library-list-panel {max-width: none;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body:has(#accountsView.active) .workspace-header {display: none;
}

body.input-page-view:has(#accountsView.active) .workspace {padding-top: 60px;
  padding-left: 20px;
  padding-right: 20px;
}

#accountsView .account-library-head-actions {display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#accountsView .account-library-head-actions .ghost-button,
#accountsView .account-library-head-actions .account-reload-button {min-width: 80px;
  height: 32px;
  padding: 0 16px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #f1f3f5;
  color: #4d5562;
  font-size: 14px;
  line-height: 20px;
  box-shadow: none;
}

#accountsView .account-library-head-actions .ghost-button:hover,
#accountsView .account-library-head-actions .account-reload-button:hover {background: #e9ebee;
  border-color: #e5e6eb;
  color: #4d5562;
}

#accountsView .account-library-head-actions .primary-button,
#accountsView .account-library-head-actions .account-create-button {min-width: 108px;
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  box-shadow: none;
}

#accountsView .account-library-head-actions .primary-button:hover,
#accountsView .account-library-head-actions .account-create-button:hover {background: #27272a;
  border-color: #27272a;
}

#accountsView .account-library-toolbar {display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

#accountsView .account-search-field {position: relative;
  display: block;
  width: min(378px, 100%);
}

#accountsView .account-search-field input,
#accountsView .account-platform-filter select {height: 36px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #fff;
  color: #4d5562;
  outline: none;
}

#accountsView .account-search-field input {width: 100%;
  padding: 0 40px 0 16px;
  font-size: 14px;
  line-height: 20px;
}

#accountsView .account-search-field input::placeholder {color: #caccd0;
}

#accountsView .account-search-icon {position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #4d5562;
  transform: translateY(-50%);
  pointer-events: none;
}

#accountsView .account-platform-filter select {min-width: 104px;
  padding: 0 28px 0 12px;
  font-size: 14px;
  line-height: 20px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #4d5562 50%), linear-gradient(135deg, #4d5562 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

#accountsView .account-search-field input:focus,
#accountsView .account-platform-filter select:focus {border-color: #8470ff;
  box-shadow: 0 0 0 3px rgba(132, 112, 255, 0.1);
}

#accountsView .account-list {grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  min-height: 0;
}

#accountsView .account-list-footer {margin: 24px 0 0;
  color: #caccd0;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

#accountsView .account-card {position: relative;
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #f2f3f5;
  border-radius: 20px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#accountsView .account-card:hover {border-color: #e5e6eb;
  box-shadow: 0 8px 24px rgba(35, 31, 62, 0.06);
  transform: none;
}

#accountsView .account-card-head {display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

#accountsView .account-card-avatar {position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #f1efff, #e8f7f3);
  color: #6c5ce7;
  font-size: 24px;
  font-weight: 700;
}

#accountsView .account-card-avatar img {position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#accountsView .account-card-identity {min-width: 0;
  flex: 1;
}

#accountsView .account-card-title-row {display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

#accountsView .account-card-name-group {display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

#accountsView .account-card-name-icon {display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

#accountsView .account-card-name-icon > strong {overflow: hidden;
  color: #1d2129;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#accountsView .account-card-name-icon > .account-info-platform-icon {margin: 0;
}

#accountsView .account-info-platform-icon {display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 0;
  vertical-align: middle;
}

#accountsView .account-info-platform-icon svg {display: block;
  width: 100%;
  height: 100%;
}

#accountsView .account-snapshot-badge {margin: 0;
  padding: 2px 8px;
  overflow: hidden;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: #f9f9fa;
  color: #868f9c;
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#accountsView .account-card-baseline {margin: 4px 0 0;
  overflow: hidden;
  color: #868f9c;
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#accountsView .account-card-sync-row {margin-top: 6px;
  overflow: hidden;
  color: #868f9c;
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#accountsView .account-card-sync-gap {display: inline-block;
  width: 16px;
  margin-top: 0;
  vertical-align: top;
}

#accountsView .account-card-menu {position: relative;
  flex: 0 0 auto;
}

#accountsView .account-card-menu-trigger {display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4d5562;
  cursor: pointer;
  place-items: center;
}

#accountsView .account-card-menu-trigger:hover {background: #f5f4ff;
  color: #8470ff;
}

#accountsView .account-card-menu-popover {position: absolute;
  top: 24px;
  right: 0;
  z-index: 3;
  display: none;
  width: 110px;
  padding: 5px;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.14);
}

#accountsView .account-card-menu:hover .account-card-menu-popover,
#accountsView .account-card-menu:focus-within .account-card-menu-popover {display: grid;
}

#accountsView .account-card-menu-popover button {padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4e5969;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

#accountsView .account-card-menu-popover button:hover {background: #f7f8fa;
}

#accountsView .account-card-menu-popover .account-delete-button {color: #f53f3f;
}

#accountsView .account-card-metrics {display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

#accountsView .account-card-metrics > div {min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #f2f3f5;
}

#accountsView .account-card-metrics span,
#accountsView .account-card-metrics strong {display: block;
  margin: 0;
}

#accountsView .account-card-metrics span {color: #868f9c;
  font-size: 12px;
  line-height: 16px;
}

#accountsView .account-card-metrics strong {overflow: hidden;
  margin-top: 8px;
  color: rgba(0, 0, 0, 0.9);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-overflow: ellipsis;
}

#accountsView .account-item-actions {display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

#accountsView .account-item-actions button {width: 100%;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
}

#accountsView .account-item-actions .ghost-button {border: 1px solid #e5e6eb;
  background: #fff;
  color: #4d5562;
}

#accountsView .account-item-actions .ghost-button:hover {background: #f7f8fa;
  border-color: #e5e6eb;
  color: #4d5562;
}

#accountsView .account-item.is-clickable:hover {border-color: #e5e6eb;
}

@media (max-width: 1380px) {
  #accountsView .account-list {grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  #accountsView .account-list {grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #accountsView .account-library-toolbar {align-items: stretch;
    flex-direction: column;
  }

  #accountsView .account-search-field,
  #accountsView .account-platform-filter select {width: 100%;
  }
}

@media (max-width: 640px) {
  #accountsView .account-list {grid-template-columns: 1fr;
  }
}
