/* Home-only rhythm and theme corrections. Asset-library interactions stay unchanged. */
#dashboard-view {
  --home-surface: #111112;
  --home-soft: #19191b;
  --home-hover: #202023;
  --home-border: #303034;
  --home-text: #f3f3f4;
  --home-secondary: #b0b0b8;
  --home-track: #303034;
  --home-grid: rgb(255 255 255 / 5%);
  gap: 20px;
}
html[data-theme="light"] #dashboard-view {
  --home-surface: #ffffff;
  --home-soft: #fafafa;
  --home-hover: #f4f4f5;
  --home-border: #e4e4e7;
  --home-text: #202023;
  --home-secondary: #66666e;
  --home-track: #eaeaed;
  --home-grid: rgb(24 24 27 / 3.5%);
}
.workspace.page-home .workspace-content { padding-top: 28px; padding-bottom: 40px; }

#dashboard-view :is(.agent-copy-launcher-home, .dashboard-command-board) {
  border: 1px solid var(--home-border);
  background: var(--home-surface);
  box-shadow: none;
}
#dashboard-view .agent-copy-launcher-home {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 254px;
  background: linear-gradient(110deg, rgb(223 63 67 / 5%), transparent 45%), var(--home-surface);
}
#dashboard-view .agent-connect-copy { padding: 28px 32px; min-width: 0; border: 0; }
#dashboard-view .agent-connect-copy::after {
  top: 24px; bottom: 24px; right: 0; left: auto; width: 1px; height: auto;
  background: var(--home-border);
}
#dashboard-view :is(.section-kicker, .agent-bridge-kicker) {
  font-size: 11px; line-height: 16px; letter-spacing: .13em;
  color: var(--brand);
}
#dashboard-view .agent-connect-copy h3 {
  margin: 12px 0 0;
  color: var(--home-text);
  font-size: clamp(26px, 2.2vw, 34px);
  line-height: 1.3; letter-spacing: -.025em;
  white-space: normal; max-width: none;
}
#dashboard-view .agent-connect-copy p {
  margin: 12px 0 0; max-width: 36em;
  font-size: 15px; line-height: 1.7;
  color: var(--home-secondary);
}
#dashboard-view .agent-connect-actions { margin-top: 22px; }
#dashboard-view .agent-copy-pill {
  min-height: 48px;
  padding: 5px 6px 5px 14px;
  grid-template-columns: auto minmax(0, 1fr) 32px;
  gap: 10px;
  background: var(--home-soft);
  color: var(--home-text);
  border-color: var(--home-border);
  box-shadow: none;
}
#dashboard-view .agent-copy-label { font-size: 15px; color: inherit; }
#dashboard-view .agent-copy-status {
  width: 32px; height: 30px;
  border-color: var(--home-border);
  color: inherit;
}
#dashboard-view .agent-copy-status .ui-icon { width: 17px; height: 17px; }
#dashboard-view .agent-copy-status img { filter: brightness(0) invert(.8); }
html[data-theme="light"] #dashboard-view .agent-copy-status img { filter: brightness(0) opacity(.65); }
#dashboard-view .agent-copy-pill:is(:hover, :focus-visible) .agent-copy-status img { filter: brightness(0) invert(1); }
html[data-theme="light"] #dashboard-view .agent-copy-pill:is(:hover, :focus-visible) .agent-copy-status img { filter: brightness(0) opacity(.8); }
#dashboard-view .agent-copy-pill:is(:hover, :focus-visible) .agent-copy-status {
  border-color: var(--home-border);
}
#dashboard-view .agent-copy-launcher-home.copied .agent-copy-pill {
  background: var(--home-hover); color: var(--home-text); border-color: var(--brand);
}
#dashboard-view .agent-signal-field {
  padding: 20px 26px 14px;
  min-height: 0;
  background:
    linear-gradient(var(--home-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--home-grid) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, rgb(223 63 67 / 7%), transparent 45%);
  background-size: 32px 32px, 32px 32px, auto;
}
#dashboard-view .agent-signal-field > header { color: var(--home-secondary); font-size: 10px; }
#dashboard-view .agent-signal-map { min-height: 182px; }
#dashboard-view :is(.agent-signal-core, .asset-layer, .agent-signal-source .agent-client-strip) {
  background: var(--home-soft);
  color: var(--home-text);
  border-color: var(--home-border);
}
#dashboard-view .agent-signal-core {
  width: 96px; height: 96px;
  border-color: rgb(223 63 67 / 45%);
}
#dashboard-view .agent-signal-core strong { color: var(--home-text); font-size: 13px; }
#dashboard-view :is(.agent-signal-source > span, .agent-signal-assets > strong) {
  color: var(--home-secondary); font-size: 12px;
}
#dashboard-view .asset-layer-front .ui-icon { background-color: var(--home-text); }

#dashboard-view .dashboard-heading {
  padding: 26px 28px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 24px;
  background: var(--home-surface);
}
#dashboard-view .dashboard-heading-copy { gap: 8px; }
#dashboard-view .dashboard-heading h2 {
  font-size: 30px; line-height: 1.3; letter-spacing: -.025em;
  color: var(--home-text);
}
#dashboard-view .dashboard-heading p {
  font-size: 15px; line-height: 1.6; color: var(--home-secondary);
}
#dashboard-view .dashboard-heading-actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
#dashboard-view .dashboard-data-status {
  display: flex; gap: 8px; min-height: 20px; padding: 0; border: 0; background: none;
  font-size: 12px; color: var(--home-secondary);
}
#dashboard-view .dashboard-data-status time { font-size: 12px; color: var(--home-secondary); }
#dashboard-view .dashboard-data-status > i { display: none; }
#dashboard-view .dashboard-asset-link {
  min-height: 38px; padding: 0 14px; gap: 12px;
  font-size: 13px; line-height: 20px;
  border: 1px solid var(--home-border);
  background: var(--home-soft); color: var(--home-text);
}
#dashboard-view .dashboard-asset-link .ui-icon { width: 16px; height: 16px; color: inherit; }
#dashboard-view .dashboard-asset-link:is(:hover, :focus-visible) {
  background: var(--hux-interactive-inverse-surface); color: var(--home-text); border-color: var(--home-border);
  transform: none; box-shadow: none;
}
#dashboard-view .dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  border-inline: 0; border-color: var(--home-border); background: var(--home-surface);
}
#dashboard-view .dashboard-metrics article.metric-card {
  min-height: 134px; padding: 22px 28px;
  border: 0; border-right: 1px solid var(--home-border);
  background: var(--home-surface); box-shadow: none;
}
#dashboard-view .dashboard-metrics article.metric-card:last-child { border-right: 0; }
#dashboard-view .metric-card::before { display: none; }
#dashboard-view .metric-sequence { display: none; }
#dashboard-view .metric-label { font-size: 14px; line-height: 20px; color: var(--home-secondary); }
#dashboard-view .metric-value { margin-top: 16px; gap: 8px; }
#dashboard-view .metric-value strong { font-size: 40px; line-height: 1; color: var(--home-text); }
#dashboard-view .metric-value em { font-size: 13px; color: var(--home-secondary); }
#dashboard-view .dashboard-metrics article.metric-card:hover { background: var(--home-soft); }

#dashboard-view :is(.activity-card, .activity-trend-pane, .activity-category-pane) {
  background: var(--home-surface); box-shadow: none; border-color: var(--home-border);
}
#dashboard-view .dashboard-insight-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
#dashboard-view :is(.activity-card-header, .category-pane-header) {
  height: 100px; min-height: 100px; padding: 22px 28px;
  border-bottom: 1px solid var(--home-border); align-items: center; gap: 16px;
}
#dashboard-view :is(.activity-card-header h3, .category-pane-header h3) {
  font-size: 22px; line-height: 30px; margin-top: 6px; color: var(--home-text);
}
#dashboard-view .activity-card-meta { flex-direction: column; align-items: flex-end; gap: 6px; }
#dashboard-view :is(.activity-legend, .activity-card-meta small, .category-pane-header .panel-note) {
  font-size: 12px; line-height: 18px; color: var(--home-secondary);
}
#dashboard-view .category-pane-header .panel-note strong { font-size: 20px; color: var(--home-text); }
#dashboard-view .activity-visual { padding: 6px 8px 0; }
#dashboard-view .activity-chart { height: 284px; min-height: 0; }
#dashboard-view .activity-grid-line { stroke: var(--home-border); }
#dashboard-view .activity-baseline { stroke: var(--home-border); }
#dashboard-view .activity-column {
  fill: var(--brand); opacity: .68;
  /* Only the entrance transform is staggered. Inspection is immediate. */
  transition: opacity 80ms ease-out, fill 80ms ease-out,
    transform 520ms var(--v43-ease) calc(90ms + var(--activity-index) * 55ms);
}
#dashboard-view .activity-column.is-zero { fill: var(--home-track); opacity: 1; }
#dashboard-view .activity-period.is-active .activity-column { fill: var(--brand); opacity: 1; }
#dashboard-view :is(.activity-value-label, .activity-label) { fill: var(--home-secondary); opacity: 1; }
#dashboard-view .activity-period.is-active :is(.activity-value-label, .activity-label) { fill: var(--home-text); }
#dashboard-view .activity-category-pane .category-bars { padding: 0 28px; }
#dashboard-view .category-row {
  grid-template-columns: 22px minmax(84px, auto) minmax(36px, 1fr) 62px;
  gap: 12px; padding: 18px 0; min-height: 76px;
  border-color: var(--home-border);
  background: transparent; box-shadow: none;
}
#dashboard-view .category-row:is(:hover, :focus-visible) { background: var(--home-hover); border-color: var(--home-border); }
#dashboard-view .category-rank { font-size: 11px; color: var(--home-secondary); }
#dashboard-view .category-row-label strong { font-size: 14px; color: var(--home-text); }
#dashboard-view .category-row-label .ui-icon { width: 18px; height: 18px; background-color: var(--home-secondary); }
#dashboard-view .category-track { height: 7px; background: var(--home-track); }
#dashboard-view .category-track i { background: var(--brand); }
#dashboard-view .category-stat { gap: 6px; }
#dashboard-view .category-stat strong { font-size: 22px; color: var(--home-text); }
#dashboard-view .category-stat small { font-size: 12px; color: var(--home-secondary); }
#dashboard-view .category-empty {
  display: grid; align-content: center; justify-items: start; gap: 8px;
  min-height: 180px; padding: 28px; color: var(--home-secondary); font-size: 14px; line-height: 1.6;
}
#dashboard-view .category-empty strong { color: var(--home-text); font-size: 16px; }

/* The chart tooltip is portaled to body; resolve its theme independently. */
html[data-theme] [data-hux-activity-tooltip] {
  border: 1px solid #414147; border-radius: 6px;
  background: #202023; color: #f3f3f4;
  box-shadow: 0 6px 18px rgb(0 0 0 / 16%);
  transform: none;
  backdrop-filter: none;
  transition: opacity 60ms ease-out;
}
html[data-theme="light"] [data-hux-activity-tooltip] {
  background: #ffffff; color: #202023; border-color: #e4e4e7;
  box-shadow: 0 6px 18px rgb(0 0 0 / 10%);
}
html[data-theme] [data-hux-activity-tooltip] strong { color: inherit; font-size: 13px; }
html[data-theme] [data-hux-activity-tooltip] span > em { color: inherit; font-size: 13px; }
html[data-theme] [data-hux-activity-tooltip] span > b { color: var(--brand); font-size: 22px; }

@media (prefers-reduced-motion: reduce) {
  #dashboard-view .activity-column,
  html[data-theme] [data-hux-activity-tooltip] { transition: none; }
}

@media (max-width: 1100px) {
  #dashboard-view .agent-copy-launcher-home { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  #dashboard-view .agent-connect-copy { padding: 24px; }
  #dashboard-view .agent-signal-field { padding-inline: 14px; }
  #dashboard-view .agent-signal-source .agent-client-strip { grid-template-columns: repeat(3, 24px); }
  #dashboard-view .agent-signal-source .agent-client-mark { width: 24px; }
  #dashboard-view .agent-signal-assets { left: 85%; }
  #dashboard-view .agent-signal-core { width: 80px; height: 80px; }
  #dashboard-view .dashboard-insight-grid { grid-template-columns: 1fr; }
  #dashboard-view .activity-trend-pane { border-right: 0; border-bottom: 1px solid var(--home-border); }
  #dashboard-view .category-overview { min-height: 0; }
  #dashboard-view .category-row { min-height: 70px; }
}
@media (max-width: 720px) {
  .workspace.page-home .workspace-content { padding-top: 18px; padding-bottom: 24px; }
  #dashboard-view { gap: 16px; }
  #dashboard-view .agent-copy-launcher-home { grid-template-columns: 1fr; }
  #dashboard-view .agent-connect-copy { padding: 24px 20px; }
  #dashboard-view .agent-connect-copy::after { display: none; }
  #dashboard-view .agent-connect-copy h3 { font-size: 27px; line-height: 1.3; }
  #dashboard-view .agent-connect-copy p { font-size: 14px; }
  #dashboard-view .agent-copy-pill { width: fit-content; max-width: 100%; gap: 8px; padding-left: 10px; }
  #dashboard-view .agent-copy-label { font-size: 13px; }
  #dashboard-view .agent-signal-field { border-top: 1px solid var(--home-border); padding: 14px 20px 8px; }
  #dashboard-view .agent-signal-map { min-height: 156px; }
  #dashboard-view .agent-signal-source > span, #dashboard-view .agent-signal-assets > strong { font-size: 11px; }
  #dashboard-view .dashboard-heading { grid-template-columns: 1fr; padding: 22px 20px; gap: 18px; }
  #dashboard-view .dashboard-heading h2 { font-size: 26px; }
  #dashboard-view .dashboard-heading p { font-size: 14px; }
  #dashboard-view .dashboard-heading-actions { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  #dashboard-view .dashboard-data-status { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
  #dashboard-view .dashboard-asset-link { width: auto; flex-shrink: 0; }
  #dashboard-view .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dashboard-view .dashboard-metrics article.metric-card { min-height: 120px; padding: 20px; }
  #dashboard-view .dashboard-metrics article.metric-card:nth-child(2) { border-right: 0; }
  #dashboard-view .dashboard-metrics article.metric-card:nth-child(-n+2) { border-bottom: 1px solid var(--home-border); }
  #dashboard-view .metric-value strong { font-size: 34px; }
  #dashboard-view .metric-label { font-size: 13px; }
  #dashboard-view :is(.activity-card-header, .category-pane-header) { padding: 20px; height: auto; min-height: 94px; }
  #dashboard-view .activity-card-header { grid-template-columns: 1fr; gap: 12px; }
  #dashboard-view .activity-card-meta { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  #dashboard-view :is(.activity-card-header h3, .category-pane-header h3) { font-size: 21px; }
  #dashboard-view .activity-chart { height: 250px; }
  #dashboard-view .activity-category-pane .category-bars { padding: 0 20px; }
  #dashboard-view .category-row { grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 10px; }
  #dashboard-view .category-rank { grid-column: 1; grid-row: 1; }
  #dashboard-view .category-row-label { grid-column: 2; grid-row: 1; }
  #dashboard-view .category-stat { grid-column: 3; grid-row: 1; }
  #dashboard-view .category-track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 360px) {
  #dashboard-view .agent-copy-pill { grid-template-columns: minmax(0, 1fr) 30px; }
  #dashboard-view .agent-copy-pill > .agent-client-strip { display: none; }
  #dashboard-view .agent-signal-source { left: 13%; }
  #dashboard-view .agent-signal-assets { left: 88%; }
  #dashboard-view .agent-signal-core { width: 70px; height: 70px; }
}
